@ai-ecoverse/slicc-spectrum 1.84.2 → 1.84.3
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/slicc-ui.js +14 -4
- package/dist/slicc-ui.js.map +3 -3
- package/package.json +4 -4
package/dist/slicc-ui.js
CHANGED
|
@@ -8675,6 +8675,15 @@ var o43 = class extends a10 {
|
|
|
8675
8675
|
e25("swc-icon-close", o43);
|
|
8676
8676
|
|
|
8677
8677
|
// src/app/base.ts
|
|
8678
|
+
var typed = false;
|
|
8679
|
+
document.addEventListener("keydown", () => typed = true, true);
|
|
8680
|
+
document.addEventListener("pointerdown", () => typed = false, true);
|
|
8681
|
+
function keyboardFocus() {
|
|
8682
|
+
let active = document.activeElement;
|
|
8683
|
+
while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
|
|
8684
|
+
if (!active || active === document.body) return typed;
|
|
8685
|
+
return active.matches(":focus-visible");
|
|
8686
|
+
}
|
|
8678
8687
|
var ModelElement = class extends i2 {
|
|
8679
8688
|
static properties = { model: { attribute: false } };
|
|
8680
8689
|
static shadowRootOptions = {
|
|
@@ -8693,7 +8702,8 @@ var ModelElement = class extends i2 {
|
|
|
8693
8702
|
this.focusWith({}, ...selectors);
|
|
8694
8703
|
}
|
|
8695
8704
|
focusWith(options, ...selectors) {
|
|
8696
|
-
const
|
|
8705
|
+
const settled3 = { focusVisible: keyboardFocus(), ...options };
|
|
8706
|
+
const focus = () => selectors.map((selector) => this.renderRoot.querySelector(selector)).find(Boolean)?.focus(settled3);
|
|
8697
8707
|
if (this.hasUpdated) focus();
|
|
8698
8708
|
else void this.updateComplete.then(focus);
|
|
8699
8709
|
}
|
|
@@ -35188,7 +35198,7 @@ function called(value = "") {
|
|
|
35188
35198
|
return `Called ${url}`.trim();
|
|
35189
35199
|
}
|
|
35190
35200
|
}
|
|
35191
|
-
function
|
|
35201
|
+
function typed2(action) {
|
|
35192
35202
|
const count = action.length === void 0 ? "" : ` ${action.length} ${action.length === 1 ? "character" : "characters"}`;
|
|
35193
35203
|
return `Typed${count}${action.target ? ` into ${action.target}` : ""}`;
|
|
35194
35204
|
}
|
|
@@ -35203,8 +35213,8 @@ var verbs2 = {
|
|
|
35203
35213
|
screenshot: () => "Took a screenshot",
|
|
35204
35214
|
eval: () => "Ran a script",
|
|
35205
35215
|
click: (action) => `Clicked${action.target ? ` ${action.target}` : ""}`,
|
|
35206
|
-
fill:
|
|
35207
|
-
type:
|
|
35216
|
+
fill: typed2,
|
|
35217
|
+
type: typed2,
|
|
35208
35218
|
press: (action) => `Pressed${action.value ? ` ${action.value}` : ""}`,
|
|
35209
35219
|
scroll: () => "Scrolled",
|
|
35210
35220
|
request: (action) => called(action.value)
|