altcha 3.0.4 → 3.0.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/README.md +68 -0
- package/dist/external/altcha.js +40 -13
- package/dist/external/altcha.min.js +1 -1
- package/dist/external/altcha.umd.cjs +40 -13
- package/dist/external/altcha.umd.min.cjs +1 -1
- package/dist/main/altcha.i18n.js +40 -13
- package/dist/main/altcha.i18n.min.js +1 -1
- package/dist/main/altcha.i18n.umd.cjs +40 -13
- package/dist/main/altcha.i18n.umd.min.cjs +1 -1
- package/dist/main/altcha.js +40 -13
- package/dist/main/altcha.min.js +1 -1
- package/dist/main/altcha.umd.cjs +40 -13
- package/dist/main/altcha.umd.min.cjs +1 -1
- package/package.json +1 -1
|
@@ -5368,7 +5368,7 @@
|
|
|
5368
5368
|
button.disabled = get(audioState) === AudioState.LOADING || get(audioState) === AudioState.ERROR;
|
|
5369
5369
|
set_attribute(button, "aria-label", get(audioState) === AudioState.LOADING ? strings().loading : strings().getAudioChallenge);
|
|
5370
5370
|
});
|
|
5371
|
-
|
|
5371
|
+
event("click", button, () => onPlayAudio(), true);
|
|
5372
5372
|
append($$anchor2, button);
|
|
5373
5373
|
};
|
|
5374
5374
|
if_block(node_1, ($$render) => {
|
|
@@ -5423,12 +5423,12 @@
|
|
|
5423
5423
|
event("submit", form, onSubmitCapture, true);
|
|
5424
5424
|
delegated("keydown", input, onInputKeyDown);
|
|
5425
5425
|
bind_value(input, () => get(code), ($$value) => set(code, $$value));
|
|
5426
|
-
|
|
5427
|
-
|
|
5426
|
+
event("click", button_1, () => onReload()?.(), true);
|
|
5427
|
+
event("click", button_3, () => onCancel()?.(), true);
|
|
5428
5428
|
append($$anchor, div);
|
|
5429
5429
|
return pop($$exports);
|
|
5430
5430
|
}
|
|
5431
|
-
delegate(["keydown"
|
|
5431
|
+
delegate(["keydown"]);
|
|
5432
5432
|
create_custom_element(
|
|
5433
5433
|
Code,
|
|
5434
5434
|
{
|
|
@@ -5451,7 +5451,7 @@
|
|
|
5451
5451
|
var root$1 = /* @__PURE__ */ from_html(`<!> <div><!> <!> <div class="altcha-popover-content"><!></div></div>`, 1);
|
|
5452
5452
|
function Popover($$anchor, $$props) {
|
|
5453
5453
|
push($$props, true);
|
|
5454
|
-
let anchor = prop($$props, "anchor"), children = prop($$props, "children"), display = prop($$props, "display", 7, "standard"), backdrop = prop($$props, "backdrop", 7, false), onClickOutside = prop($$props, "onClickOutside"), onClickOutsideDelay = prop($$props, "onClickOutsideDelay", 7, 600), onClose = prop($$props, "onClose"), placement = prop($$props, "placement", 7, "auto"), variant = prop($$props, "variant", 7, "neutral"), rest = /* @__PURE__ */ rest_props($$props, [
|
|
5454
|
+
let anchor = prop($$props, "anchor"), children = prop($$props, "children"), display = prop($$props, "display", 7, "standard"), backdrop = prop($$props, "backdrop", 7, false), onClickOutside = prop($$props, "onClickOutside"), onClickOutsideDelay = prop($$props, "onClickOutsideDelay", 7, 600), onClose = prop($$props, "onClose"), placement = prop($$props, "placement", 7, "auto"), updateUISignal = prop($$props, "updateUISignal"), variant = prop($$props, "variant", 7, "neutral"), rest = /* @__PURE__ */ rest_props($$props, [
|
|
5455
5455
|
"$$slots",
|
|
5456
5456
|
"$$events",
|
|
5457
5457
|
"$$legacy",
|
|
@@ -5464,6 +5464,7 @@
|
|
|
5464
5464
|
"onClickOutsideDelay",
|
|
5465
5465
|
"onClose",
|
|
5466
5466
|
"placement",
|
|
5467
|
+
"updateUISignal",
|
|
5467
5468
|
"variant"
|
|
5468
5469
|
]);
|
|
5469
5470
|
let el = /* @__PURE__ */ state(void 0);
|
|
@@ -5475,6 +5476,11 @@
|
|
|
5475
5476
|
set(top, placement() === "top");
|
|
5476
5477
|
}
|
|
5477
5478
|
});
|
|
5479
|
+
user_effect(() => {
|
|
5480
|
+
if (updateUISignal()) {
|
|
5481
|
+
reposition();
|
|
5482
|
+
}
|
|
5483
|
+
});
|
|
5478
5484
|
onMount(() => {
|
|
5479
5485
|
const moveToBody = display() === "bottomsheet" || display() === "overlay";
|
|
5480
5486
|
if (moveToBody) {
|
|
@@ -5497,7 +5503,7 @@
|
|
|
5497
5503
|
}
|
|
5498
5504
|
function onWindowClick(ev) {
|
|
5499
5505
|
const target = ev.target;
|
|
5500
|
-
if (!get(el)?.contains(target) &&
|
|
5506
|
+
if (!get(el)?.contains(target) && (!onClickOutsideDelay() || get(mountedAt) + onClickOutsideDelay() < Date.now())) {
|
|
5501
5507
|
onClickOutside()?.();
|
|
5502
5508
|
}
|
|
5503
5509
|
}
|
|
@@ -5574,6 +5580,13 @@
|
|
|
5574
5580
|
placement($$value);
|
|
5575
5581
|
flushSync();
|
|
5576
5582
|
},
|
|
5583
|
+
get updateUISignal() {
|
|
5584
|
+
return updateUISignal();
|
|
5585
|
+
},
|
|
5586
|
+
set updateUISignal($$value) {
|
|
5587
|
+
updateUISignal($$value);
|
|
5588
|
+
flushSync();
|
|
5589
|
+
},
|
|
5577
5590
|
get variant() {
|
|
5578
5591
|
return variant();
|
|
5579
5592
|
},
|
|
@@ -5583,7 +5596,7 @@
|
|
|
5583
5596
|
}
|
|
5584
5597
|
};
|
|
5585
5598
|
var fragment = root$1();
|
|
5586
|
-
event("click", $window, onWindowClick);
|
|
5599
|
+
event("click", $window, onWindowClick, true);
|
|
5587
5600
|
event("resize", $window, onWindowResize);
|
|
5588
5601
|
event("scroll", $window, onWindowScroll);
|
|
5589
5602
|
var node = first_child(fragment);
|
|
@@ -5620,7 +5633,7 @@
|
|
|
5620
5633
|
{
|
|
5621
5634
|
var consequent_2 = ($$anchor2) => {
|
|
5622
5635
|
var div_3 = root_3$1();
|
|
5623
|
-
|
|
5636
|
+
event("click", div_3, onCloseClick, true);
|
|
5624
5637
|
append($$anchor2, div_3);
|
|
5625
5638
|
};
|
|
5626
5639
|
if_block(node_2, ($$render) => {
|
|
@@ -5636,7 +5649,6 @@
|
|
|
5636
5649
|
append($$anchor, fragment);
|
|
5637
5650
|
return pop($$exports);
|
|
5638
5651
|
}
|
|
5639
|
-
delegate(["click"]);
|
|
5640
5652
|
create_custom_element(
|
|
5641
5653
|
Popover,
|
|
5642
5654
|
{
|
|
@@ -5648,6 +5660,7 @@
|
|
|
5648
5660
|
onClickOutsideDelay: {},
|
|
5649
5661
|
onClose: {},
|
|
5650
5662
|
placement: {},
|
|
5663
|
+
updateUISignal: {},
|
|
5651
5664
|
variant: {}
|
|
5652
5665
|
},
|
|
5653
5666
|
[],
|
|
@@ -5914,6 +5927,7 @@
|
|
|
5914
5927
|
let checked = /* @__PURE__ */ state(false);
|
|
5915
5928
|
let codeChallenge = /* @__PURE__ */ state(null);
|
|
5916
5929
|
let currentController = /* @__PURE__ */ state(null);
|
|
5930
|
+
let currentDisplay = /* @__PURE__ */ state(null);
|
|
5917
5931
|
let currentState = /* @__PURE__ */ state(proxy(State.UNVERIFIED));
|
|
5918
5932
|
let elAnchorArrow = /* @__PURE__ */ state(void 0);
|
|
5919
5933
|
let elFloatingAnchor = /* @__PURE__ */ state(void 0);
|
|
@@ -5924,6 +5938,7 @@
|
|
|
5924
5938
|
let expirationTimeout = /* @__PURE__ */ state(null);
|
|
5925
5939
|
let payload = /* @__PURE__ */ state(null);
|
|
5926
5940
|
let plugins = /* @__PURE__ */ state(proxy([]));
|
|
5941
|
+
let updateUISignal = /* @__PURE__ */ state(0);
|
|
5927
5942
|
let userConfig = /* @__PURE__ */ state(proxy({}));
|
|
5928
5943
|
let visible = /* @__PURE__ */ state(true);
|
|
5929
5944
|
const config = /* @__PURE__ */ user_derived(() => ({
|
|
@@ -6003,7 +6018,9 @@
|
|
|
6003
6018
|
}
|
|
6004
6019
|
});
|
|
6005
6020
|
user_effect(() => {
|
|
6006
|
-
|
|
6021
|
+
if (get(currentDisplay) !== get(config).display) {
|
|
6022
|
+
setDisplay(get(config).display);
|
|
6023
|
+
}
|
|
6007
6024
|
});
|
|
6008
6025
|
user_effect(() => {
|
|
6009
6026
|
if (get(checked) && get(currentState) === State.VERIFYING) {
|
|
@@ -6054,7 +6071,7 @@
|
|
|
6054
6071
|
}
|
|
6055
6072
|
});
|
|
6056
6073
|
onMount(() => {
|
|
6057
|
-
log("mounted", "3.0.
|
|
6074
|
+
log("mounted", "3.0.5");
|
|
6058
6075
|
if (instance) {
|
|
6059
6076
|
globalThis.$altcha.instances.add(instance);
|
|
6060
6077
|
}
|
|
@@ -6348,6 +6365,7 @@
|
|
|
6348
6365
|
}
|
|
6349
6366
|
}
|
|
6350
6367
|
function onWindowPageshow() {
|
|
6368
|
+
setDisplay(get(config).display);
|
|
6351
6369
|
reset$1();
|
|
6352
6370
|
}
|
|
6353
6371
|
function onWindowResize() {
|
|
@@ -6468,6 +6486,9 @@
|
|
|
6468
6486
|
case "standard":
|
|
6469
6487
|
show();
|
|
6470
6488
|
}
|
|
6489
|
+
if (get(currentDisplay) !== value) {
|
|
6490
|
+
set(currentDisplay, value, true);
|
|
6491
|
+
}
|
|
6471
6492
|
}
|
|
6472
6493
|
function setChallengeExpiration(expiresAt) {
|
|
6473
6494
|
if (get(expirationTimeout)) {
|
|
@@ -6588,6 +6609,7 @@
|
|
|
6588
6609
|
case "floating":
|
|
6589
6610
|
return repositionFloating();
|
|
6590
6611
|
}
|
|
6612
|
+
set(updateUISignal, get(updateUISignal) + 1);
|
|
6591
6613
|
}
|
|
6592
6614
|
async function verify(options = {}) {
|
|
6593
6615
|
const {
|
|
@@ -6745,7 +6767,7 @@
|
|
|
6745
6767
|
if (get(config).overlayContent) $$render(consequent_1);
|
|
6746
6768
|
});
|
|
6747
6769
|
}
|
|
6748
|
-
|
|
6770
|
+
event("click", div_2, onCloseClick, true);
|
|
6749
6771
|
append($$anchor2, fragment_1);
|
|
6750
6772
|
};
|
|
6751
6773
|
if_block(node_1, ($$render) => {
|
|
@@ -6890,6 +6912,9 @@
|
|
|
6890
6912
|
get dir() {
|
|
6891
6913
|
return get(dir);
|
|
6892
6914
|
},
|
|
6915
|
+
get updateUISignal() {
|
|
6916
|
+
return get(updateUISignal);
|
|
6917
|
+
},
|
|
6893
6918
|
children: ($$anchor3, $$slotProps) => {
|
|
6894
6919
|
var fragment_9 = comment();
|
|
6895
6920
|
var node_10 = first_child(fragment_9);
|
|
@@ -6955,6 +6980,9 @@
|
|
|
6955
6980
|
get dir() {
|
|
6956
6981
|
return get(dir);
|
|
6957
6982
|
},
|
|
6983
|
+
get updateUISignal() {
|
|
6984
|
+
return get(updateUISignal);
|
|
6985
|
+
},
|
|
6958
6986
|
children: ($$anchor4, $$slotProps) => {
|
|
6959
6987
|
var fragment_12 = root_19();
|
|
6960
6988
|
var node_12 = first_child(fragment_12);
|
|
@@ -7026,7 +7054,6 @@
|
|
|
7026
7054
|
$$cleanup();
|
|
7027
7055
|
return $$pop;
|
|
7028
7056
|
}
|
|
7029
|
-
delegate(["click"]);
|
|
7030
7057
|
if (typeof window !== "undefined" && window.customElements) customElements.define("altcha-widget", create_custom_element(
|
|
7031
7058
|
Widget,
|
|
7032
7059
|
{
|