stimeo-ui 0.17.0 → 0.18.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +136 -2
- data/README.md +19 -10
- data/dist/cable/index.js +22 -14
- data/dist/controllers/accordion_controller.js +14 -6
- data/dist/controllers/alert_dialog_controller.js +145 -118
- data/dist/controllers/announcer_controller.js +113 -17
- data/dist/controllers/auto_submit_controller.js +185 -60
- data/dist/controllers/avatar_controller.js +55 -43
- data/dist/controllers/bulk_select_controller.js +64 -50
- data/dist/controllers/calendar_controller.js +55 -53
- data/dist/controllers/carousel_controller.js +124 -86
- data/dist/controllers/character_counter_controller.js +291 -95
- data/dist/controllers/checkbox_controller.js +6 -0
- data/dist/controllers/clipboard_controller.js +118 -27
- data/dist/controllers/collapsible_controller.js +52 -49
- data/dist/controllers/color_picker_controller.js +29 -7
- data/dist/controllers/combobox_controller.js +210 -71
- data/dist/controllers/command_palette_controller.js +290 -140
- data/dist/controllers/conditional_fields_controller.js +145 -58
- data/dist/controllers/confirm_controller.js +145 -118
- data/dist/controllers/context_menu_controller.js +138 -73
- data/dist/controllers/countdown_controller.js +109 -21
- data/dist/controllers/currency_input_controller.js +446 -72
- data/dist/controllers/data_grid_controller.js +134 -28
- data/dist/controllers/date_range_picker_controller.js +93 -72
- data/dist/controllers/dialog_controller.js +145 -118
- data/dist/controllers/direct_upload_controller.js +24 -14
- data/dist/controllers/dirty_form_controller.js +68 -31
- data/dist/controllers/dismissible_controller.js +66 -46
- data/dist/controllers/drawer_controller.js +145 -118
- data/dist/controllers/dropdown_controller.js +76 -63
- data/dist/controllers/editable_controller.js +200 -62
- data/dist/controllers/empty_state_controller.js +13 -6
- data/dist/controllers/file_dropzone_controller.js +55 -48
- data/dist/controllers/filter_controller.js +9 -2
- data/dist/controllers/flash_controller.js +66 -33
- data/dist/controllers/focus_controller.js +39 -14
- data/dist/controllers/form_field_controller.js +52 -43
- data/dist/controllers/form_validation_controller.js +18 -11
- data/dist/controllers/frame_loading_controller.js +55 -48
- data/dist/controllers/hover_card_controller.js +67 -61
- data/dist/controllers/idle_controller.js +10 -6
- data/dist/controllers/input_mask_controller.js +434 -24
- data/dist/controllers/intersection_controller.js +3 -0
- data/dist/controllers/lazy_frame_controller.js +15 -3
- data/dist/controllers/listbox_controller.js +260 -79
- data/dist/controllers/local_time_controller.js +48 -13
- data/dist/controllers/masonry_controller.js +11 -4
- data/dist/controllers/menu_controller.js +138 -82
- data/dist/controllers/menubar_controller.js +65 -19
- data/dist/controllers/meter_controller.js +270 -24
- data/dist/controllers/multi_select_controller.js +272 -95
- data/dist/controllers/navigation_menu_controller.js +67 -19
- data/dist/controllers/nested_form_controller.js +98 -64
- data/dist/controllers/network_status_controller.js +70 -52
- data/dist/controllers/number_input_controller.js +344 -94
- data/dist/controllers/optimistic_controller.js +29 -11
- data/dist/controllers/otp_controller.js +502 -104
- data/dist/controllers/overflow_indicator_controller.js +6 -0
- data/dist/controllers/overflow_menu_controller.js +136 -21
- data/dist/controllers/pagination_controller.js +47 -14
- data/dist/controllers/password_reveal_controller.js +52 -49
- data/dist/controllers/password_strength_controller.js +13 -6
- data/dist/controllers/persist_controller.js +48 -128
- data/dist/controllers/pointer_drag_controller.js +255 -24
- data/dist/controllers/popover_controller.js +91 -65
- data/dist/controllers/portal_controller.js +6 -0
- data/dist/controllers/preview_guard_controller.js +14 -3
- data/dist/controllers/progress_controller.js +271 -27
- data/dist/controllers/radio_group_controller.js +167 -80
- data/dist/controllers/range_slider_controller.js +27 -7
- data/dist/controllers/rating_controller.js +93 -57
- data/dist/controllers/read_more_controller.js +10 -6
- data/dist/controllers/reading_progress_controller.js +22 -5
- data/dist/controllers/relative_time_controller.js +75 -11
- data/dist/controllers/reset_on_restore_controller.js +6 -0
- data/dist/controllers/resizable_controller.js +55 -22
- data/dist/controllers/roving_controller.js +10 -4
- data/dist/controllers/scroll_area_controller.js +129 -88
- data/dist/controllers/scroll_restore_controller.js +14 -2
- data/dist/controllers/scroll_visibility_controller.js +93 -60
- data/dist/controllers/scrollspy_controller.js +11 -5
- data/dist/controllers/separator_controller.js +59 -43
- data/dist/controllers/sidebar_controller.js +150 -122
- data/dist/controllers/skeleton_controller.js +55 -48
- data/dist/controllers/slider_controller.js +27 -6
- data/dist/controllers/smart_sticky_header_controller.js +13 -5
- data/dist/controllers/sortable_controller.js +27 -14
- data/dist/controllers/spinner_controller.js +55 -48
- data/dist/controllers/step_indicator_controller.js +6 -0
- data/dist/controllers/stepper_controller.js +6 -0
- data/dist/controllers/stick_to_bottom_controller.js +19 -8
- data/dist/controllers/sticky_observer_controller.js +49 -43
- data/dist/controllers/submit_once_controller.js +145 -85
- data/dist/controllers/switch_controller.js +172 -28
- data/dist/controllers/tabs_controller.js +6 -1
- data/dist/controllers/tags_input_controller.js +157 -28
- data/dist/controllers/textarea_autosize_controller.js +40 -19
- data/dist/controllers/theme_controller.js +10 -4
- data/dist/controllers/time_picker_controller.js +192 -54
- data/dist/controllers/toast_controller.js +58 -27
- data/dist/controllers/toggle_group_controller.js +158 -56
- data/dist/controllers/toolbar_controller.js +150 -21
- data/dist/controllers/tree_view_controller.js +134 -25
- data/dist/index.js +2515 -1315
- data/dist/positioning/index.js +6 -0
- data/lib/generators/stimeo/install/install_generator.rb +7 -2
- data/lib/generators/stimeo/install/templates/stimeo.js +19 -6
- data/lib/stimeo/ui/version.rb +1 -1
- metadata +2 -2
|
@@ -1,5 +1,103 @@
|
|
|
1
1
|
import { Controller } from '@hotwired/stimulus';
|
|
2
2
|
|
|
3
|
+
function setAttributeIfChanged(element, name, value, beforeWrite) {
|
|
4
|
+
if (element.getAttribute(name) === value) return false;
|
|
5
|
+
beforeWrite?.();
|
|
6
|
+
if (value === null) element.removeAttribute(name);
|
|
7
|
+
else element.setAttribute(name, value);
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var AuthoredMutationWatcher = class {
|
|
12
|
+
#onAuthored;
|
|
13
|
+
#claims = null;
|
|
14
|
+
#observer = null;
|
|
15
|
+
constructor(onAuthored) {
|
|
16
|
+
this.#onAuthored = onAuthored;
|
|
17
|
+
}
|
|
18
|
+
observe(root, options) {
|
|
19
|
+
this.disconnect();
|
|
20
|
+
const observer = new MutationObserver((records) => {
|
|
21
|
+
if (this.#observer !== observer) return;
|
|
22
|
+
const authored = this.#filter(records);
|
|
23
|
+
if (authored.length > 0) this.#onAuthored(authored);
|
|
24
|
+
});
|
|
25
|
+
this.#observer = observer;
|
|
26
|
+
this.#claims = { attributes: /* @__PURE__ */ new Map(), children: /* @__PURE__ */ new Map() };
|
|
27
|
+
observer.observe(root, {
|
|
28
|
+
attributes: true,
|
|
29
|
+
attributeFilter: [...options.attributes],
|
|
30
|
+
subtree: options.subtree ?? false,
|
|
31
|
+
childList: options.childList ?? false
|
|
32
|
+
});
|
|
33
|
+
if (options.ancestorAttributes) {
|
|
34
|
+
let ancestor = root.parentElement;
|
|
35
|
+
while (ancestor) {
|
|
36
|
+
observer.observe(ancestor, {
|
|
37
|
+
attributes: true,
|
|
38
|
+
attributeFilter: [...options.ancestorAttributes]
|
|
39
|
+
});
|
|
40
|
+
ancestor = ancestor.parentElement;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
claim(target, name, value) {
|
|
45
|
+
const claims = this.#claims?.attributes;
|
|
46
|
+
let attributes = claims?.get(target);
|
|
47
|
+
if (!attributes) {
|
|
48
|
+
attributes = /* @__PURE__ */ new Map();
|
|
49
|
+
claims?.set(target, attributes);
|
|
50
|
+
}
|
|
51
|
+
const pending = attributes.get(name);
|
|
52
|
+
attributes.set(name, { value, count: (pending?.count ?? 0) + 1 });
|
|
53
|
+
}
|
|
54
|
+
claimCurrent(target, name) {
|
|
55
|
+
this.claim(target, name, target.getAttribute(name));
|
|
56
|
+
}
|
|
57
|
+
claimChildList(target, added, removed) {
|
|
58
|
+
const claims = this.#claims?.children;
|
|
59
|
+
const pending = claims?.get(target) ?? { added: /* @__PURE__ */ new Map(), removed: /* @__PURE__ */ new Map() };
|
|
60
|
+
for (const node of added) pending.added.set(node, (pending.added.get(node) ?? 0) + 1);
|
|
61
|
+
for (const node of removed) pending.removed.set(node, (pending.removed.get(node) ?? 0) + 1);
|
|
62
|
+
claims?.set(target, pending);
|
|
63
|
+
}
|
|
64
|
+
take() {
|
|
65
|
+
return this.#filter(this.#observer?.takeRecords() ?? []);
|
|
66
|
+
}
|
|
67
|
+
disconnect() {
|
|
68
|
+
this.#observer?.disconnect();
|
|
69
|
+
this.#observer = null;
|
|
70
|
+
this.#claims = null;
|
|
71
|
+
}
|
|
72
|
+
#filter(records) {
|
|
73
|
+
const authored = records.filter((record) => !this.#consume(record));
|
|
74
|
+
this.#claims?.attributes.clear();
|
|
75
|
+
this.#claims?.children.clear();
|
|
76
|
+
return authored;
|
|
77
|
+
}
|
|
78
|
+
#consume(record) {
|
|
79
|
+
if (record.type === "attributes") {
|
|
80
|
+
const target = record.target;
|
|
81
|
+
const pending2 = this.#claims?.attributes.get(target)?.get(record.attributeName);
|
|
82
|
+
if (!pending2 || pending2.count === 0 || target.getAttribute(record.attributeName) !== pending2.value) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
pending2.count -= 1;
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
const pending = this.#claims?.children.get(record.target);
|
|
89
|
+
if (!pending) return false;
|
|
90
|
+
const added = [...record.addedNodes];
|
|
91
|
+
const removed = [...record.removedNodes];
|
|
92
|
+
if (added.some((node) => !pending.added.get(node)) || removed.some((node) => !pending.removed.get(node))) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
for (const node of added) pending.added.set(node, (pending.added.get(node) ?? 0) - 1);
|
|
96
|
+
for (const node of removed) pending.removed.set(node, (pending.removed.get(node) ?? 0) - 1);
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
3
101
|
function ownerIndex(candidates, node) {
|
|
4
102
|
if (!(node instanceof Node)) return -1;
|
|
5
103
|
return candidates.findIndex((candidate) => candidate.contains(node));
|
|
@@ -32,6 +130,11 @@ function canTakeFocus(element) {
|
|
|
32
130
|
if (element.disabled) return false;
|
|
33
131
|
return !inheritsFieldsetDisabled(element);
|
|
34
132
|
}
|
|
133
|
+
function deepActiveElement(ownerDocument) {
|
|
134
|
+
let active = ownerDocument.activeElement;
|
|
135
|
+
while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
|
|
136
|
+
return active;
|
|
137
|
+
}
|
|
35
138
|
|
|
36
139
|
var FormResetWatcher = class {
|
|
37
140
|
#owns;
|
|
@@ -100,6 +203,9 @@ var MicrotaskCoalescer = class {
|
|
|
100
203
|
this.#queued = false;
|
|
101
204
|
this.#generation += 1;
|
|
102
205
|
}
|
|
206
|
+
get pending() {
|
|
207
|
+
return this.#queued;
|
|
208
|
+
}
|
|
103
209
|
schedule() {
|
|
104
210
|
if (!this.#active || this.#queued) return;
|
|
105
211
|
this.#queued = true;
|
|
@@ -130,6 +236,9 @@ var MorphRenderWatcher = class {
|
|
|
130
236
|
schedule() {
|
|
131
237
|
this.#pass.schedule();
|
|
132
238
|
}
|
|
239
|
+
get pending() {
|
|
240
|
+
return this.#pass.pending;
|
|
241
|
+
}
|
|
133
242
|
disconnect() {
|
|
134
243
|
this.#listeners.dispose();
|
|
135
244
|
this.#pass.cancel();
|
|
@@ -163,6 +272,9 @@ function sharedRegistry(key, create) {
|
|
|
163
272
|
return registry;
|
|
164
273
|
}
|
|
165
274
|
|
|
275
|
+
function holdsFocus(element) {
|
|
276
|
+
return element.matches(":focus") || deepActiveElement(element.ownerDocument) === element;
|
|
277
|
+
}
|
|
166
278
|
var TabindexLoan = class _TabindexLoan {
|
|
167
279
|
static #registry = sharedRegistry(
|
|
168
280
|
"stimeo-ui.tabindex-loan.registry.v1",
|
|
@@ -170,19 +282,22 @@ var TabindexLoan = class _TabindexLoan {
|
|
|
170
282
|
);
|
|
171
283
|
#value;
|
|
172
284
|
#record;
|
|
285
|
+
#preserveFocus;
|
|
173
286
|
#lent = /* @__PURE__ */ new Set();
|
|
174
|
-
constructor(value, owner) {
|
|
287
|
+
constructor(value, owner, options = {}) {
|
|
175
288
|
this.#value = value;
|
|
176
289
|
this.#record = `data-${owner}-tabindex-loan`;
|
|
290
|
+
this.#preserveFocus = options.preserveFocus === true;
|
|
177
291
|
_TabindexLoan.#registry.names.add(this.#record);
|
|
178
292
|
}
|
|
179
|
-
lend(element) {
|
|
293
|
+
lend(element, options = {}) {
|
|
180
294
|
const stack = this.#stack(element);
|
|
181
295
|
const current = element.getAttribute("tabindex");
|
|
182
296
|
const held = stack.find((hold) => hold.loan === this) ?? stack.find(
|
|
183
297
|
(hold) => hold.loan === null && hold.record === this.#record && hold.value === this.#value
|
|
184
298
|
);
|
|
185
299
|
const linked = stack.at(-1)?.value === current;
|
|
300
|
+
if (!held && options.onlyIfUnfocusable && (current !== null || element.tabIndex >= 0)) return;
|
|
186
301
|
if (!held && current !== null && !linked) return;
|
|
187
302
|
this.#lent.add(element);
|
|
188
303
|
if (held) held.loan = this;
|
|
@@ -192,19 +307,28 @@ var TabindexLoan = class _TabindexLoan {
|
|
|
192
307
|
element.setAttribute("tabindex", this.#value);
|
|
193
308
|
}
|
|
194
309
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
310
|
+
return(element) {
|
|
311
|
+
const stack = this.#stack(element);
|
|
312
|
+
const hold = stack.find((held) => held.loan === this) ?? stack.find(
|
|
313
|
+
(held) => held.loan === null && held.record === this.#record && held.value === this.#value
|
|
314
|
+
);
|
|
315
|
+
if (!hold) return false;
|
|
316
|
+
if (!this.#release(element, stack, hold, this.#preserveFocus)) {
|
|
317
|
+
hold.loan = this;
|
|
318
|
+
this.#lent.add(element);
|
|
319
|
+
return false;
|
|
200
320
|
}
|
|
201
|
-
this.#lent.
|
|
321
|
+
this.#lent.delete(element);
|
|
322
|
+
return true;
|
|
323
|
+
}
|
|
324
|
+
returnAll() {
|
|
325
|
+
for (const element of Array.from(this.#lent)) this.return(element);
|
|
202
326
|
}
|
|
203
327
|
reclaim(element) {
|
|
204
328
|
if (element.getAttribute(this.#record) !== this.#value) return;
|
|
205
329
|
const stack = this.#stack(element);
|
|
206
330
|
const hold = stack.find((held) => held.loan === null && held.record === this.#record);
|
|
207
|
-
if (hold && !element
|
|
331
|
+
if (hold && !holdsFocus(element)) this.#release(element, stack, hold);
|
|
208
332
|
}
|
|
209
333
|
reclaimWithin(root) {
|
|
210
334
|
for (const element of queryOpenDescendants(root, `[${this.#record}]`)) {
|
|
@@ -228,26 +352,26 @@ var TabindexLoan = class _TabindexLoan {
|
|
|
228
352
|
for (const [index, hold] of holds.entries()) hold.linked = index > 0;
|
|
229
353
|
return holds;
|
|
230
354
|
}
|
|
231
|
-
#release(element, stack, hold) {
|
|
355
|
+
#release(element, stack, hold, preserveFocus = false) {
|
|
232
356
|
const current = element.getAttribute("tabindex");
|
|
233
357
|
const index = stack.indexOf(hold);
|
|
234
358
|
const owns = current === hold.value && !stack.slice(index + 1).some((above2) => above2.value === current);
|
|
359
|
+
if (owns && preserveFocus && holdsFocus(element)) return false;
|
|
235
360
|
stack.splice(index, 1);
|
|
236
361
|
const above = stack[index];
|
|
237
362
|
if (above) above.linked &&= hold.linked;
|
|
238
363
|
this.#mark(element, stack);
|
|
239
|
-
if (!owns) return;
|
|
364
|
+
if (!owns) return true;
|
|
240
365
|
const below = hold.linked ? stack[index - 1] : void 0;
|
|
241
366
|
if (!below) element.removeAttribute("tabindex");
|
|
242
367
|
else if (below.value !== current) element.setAttribute("tabindex", below.value);
|
|
368
|
+
return true;
|
|
243
369
|
}
|
|
244
370
|
#mark(element, stack) {
|
|
245
371
|
const records = /* @__PURE__ */ new Map([[this.#record, null]]);
|
|
246
372
|
for (const hold of stack) records.set(hold.record, hold.value);
|
|
247
373
|
for (const [name, recorded] of records) {
|
|
248
|
-
|
|
249
|
-
if (recorded === null) element.removeAttribute(name);
|
|
250
|
-
else element.setAttribute(name, recorded);
|
|
374
|
+
setAttributeIfChanged(element, name, recorded);
|
|
251
375
|
}
|
|
252
376
|
}
|
|
253
377
|
};
|
|
@@ -277,8 +401,6 @@ var ConditionalFieldsController = class extends Controller {
|
|
|
277
401
|
static actions = ["evaluate"];
|
|
278
402
|
static events = ["change", "reconcile"];
|
|
279
403
|
#lastVisible = /* @__PURE__ */ new WeakMap();
|
|
280
|
-
#internalWrites = /* @__PURE__ */ new WeakMap();
|
|
281
|
-
#observing = false;
|
|
282
404
|
#departed = /* @__PURE__ */ new Set();
|
|
283
405
|
#concealed = /* @__PURE__ */ new WeakSet();
|
|
284
406
|
#reconcile = new MorphRenderWatcher(() => this.#reconcileDom());
|
|
@@ -288,7 +410,7 @@ var ConditionalFieldsController = class extends Controller {
|
|
|
288
410
|
() => this.#reconcile.schedule()
|
|
289
411
|
);
|
|
290
412
|
#rootTabindex = new TabindexLoan("-1", this.identifier);
|
|
291
|
-
#observer = new
|
|
413
|
+
#observer = new AuthoredMutationWatcher((records) => this.#onMutations(records));
|
|
292
414
|
#onTriggerInput = (event) => {
|
|
293
415
|
const target = event.target;
|
|
294
416
|
const triggers = this.triggerTargets;
|
|
@@ -299,23 +421,19 @@ var ConditionalFieldsController = class extends Controller {
|
|
|
299
421
|
connect() {
|
|
300
422
|
this.#rootTabindex.reclaim(this.element);
|
|
301
423
|
this.#lastVisible = /* @__PURE__ */ new WeakMap();
|
|
302
|
-
this.#internalWrites = /* @__PURE__ */ new WeakMap();
|
|
303
424
|
this.#settle();
|
|
304
425
|
this.#reconcile.observe(this.element);
|
|
305
426
|
this.#observer.observe(this.element, {
|
|
306
|
-
attributes:
|
|
307
|
-
attributeFilter: OBSERVED_ATTRIBUTES,
|
|
427
|
+
attributes: OBSERVED_ATTRIBUTES,
|
|
308
428
|
childList: true,
|
|
309
429
|
subtree: true
|
|
310
430
|
});
|
|
311
|
-
this.#observing = true;
|
|
312
431
|
this.#listeners.add(this.element, "change", this.#onTriggerInput);
|
|
313
432
|
this.#listeners.add(this.element, "input", this.#onTriggerInput);
|
|
314
433
|
this.#formReset.observe();
|
|
315
434
|
}
|
|
316
435
|
disconnect() {
|
|
317
436
|
this.#reconcile.disconnect();
|
|
318
|
-
this.#observing = false;
|
|
319
437
|
this.#observer.disconnect();
|
|
320
438
|
this.#listeners.dispose();
|
|
321
439
|
this.#formReset.disconnect();
|
|
@@ -468,47 +586,16 @@ var ConditionalFieldsController = class extends Controller {
|
|
|
468
586
|
return [...plan].every(([region, visible]) => visible || !region.contains(candidate));
|
|
469
587
|
}
|
|
470
588
|
#writeAttribute(element, name, value) {
|
|
471
|
-
|
|
472
|
-
if (this.#observing) {
|
|
473
|
-
let writes = this.#internalWrites.get(element);
|
|
474
|
-
if (!writes) {
|
|
475
|
-
writes = /* @__PURE__ */ new Map();
|
|
476
|
-
this.#internalWrites.set(element, writes);
|
|
477
|
-
}
|
|
478
|
-
writes.set(name, value);
|
|
479
|
-
}
|
|
480
|
-
if (value === null) element.removeAttribute(name);
|
|
481
|
-
else element.setAttribute(name, value);
|
|
482
|
-
}
|
|
589
|
+
setAttributeIfChanged(element, name, value, () => this.#observer.claim(element, name, value));
|
|
483
590
|
}
|
|
484
591
|
#onMutations(records) {
|
|
485
592
|
const triggers = this.triggerTargets;
|
|
486
593
|
const regions = this.regionTargets;
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
const name = record.attributeName;
|
|
492
|
-
const writes = this.#internalWrites.get(record.target);
|
|
493
|
-
if (name && writes?.has(name)) {
|
|
494
|
-
let names = touchedWrites.get(record.target);
|
|
495
|
-
if (!names) {
|
|
496
|
-
names = /* @__PURE__ */ new Set();
|
|
497
|
-
touchedWrites.set(record.target, names);
|
|
498
|
-
}
|
|
499
|
-
names.add(name);
|
|
500
|
-
if (record.target.getAttribute(name) === writes.get(name)) continue;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
if (record.target instanceof Element && this.#elementAffectsState(record.target, triggers, regions)) {
|
|
504
|
-
needsReconcile = true;
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
for (const [element, names] of touchedWrites) {
|
|
508
|
-
const writes = this.#internalWrites.get(element);
|
|
509
|
-
for (const name of names) writes?.delete(name);
|
|
594
|
+
if (records.some(
|
|
595
|
+
(record) => record.target instanceof Element && this.#elementAffectsState(record.target, triggers, regions)
|
|
596
|
+
)) {
|
|
597
|
+
this.#reconcile.schedule();
|
|
510
598
|
}
|
|
511
|
-
if (needsReconcile) this.#reconcile.schedule();
|
|
512
599
|
}
|
|
513
600
|
#elementAffectsState(target, triggers, regions) {
|
|
514
601
|
return ownerIndex(triggers, target) !== -1 || ownerIndex(regions, target) !== -1;
|