@yuneta/gobj-ui 7.26.50 → 7.26.51
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 +111 -32
- package/dist/gobj-ui.cjs.js +91 -24
- package/dist/gobj-ui.es.js +91 -24
- package/package.json +2 -2
- package/scripts/validate-locales.mjs +472 -149
- package/src/c_yui_form.js +20 -2
- package/src/c_yui_shell.js +103 -20
- package/src/form_time_field.wiring.test.js +127 -0
- package/src/form_time_value.js +7 -4
- package/src/shell_history_debt.wiring.test.js +192 -9
package/README.md
CHANGED
|
@@ -242,11 +242,36 @@ Published as `@yuneta/gobj-ui`. Built on top of [`@yuneta/gobj-js`](https://gith
|
|
|
242
242
|
> pushes runs after it, and the position the URL holds is put back where it
|
|
243
243
|
> lands. In 7.26.47 and 7.26.48 they stayed, and every logout with an overlay
|
|
244
244
|
> up left more dead Backs (two per cycle with a question over a panel). The
|
|
245
|
-
>
|
|
246
|
-
>
|
|
247
|
-
>
|
|
248
|
-
>
|
|
249
|
-
>
|
|
245
|
+
> walk stops at the first entry of the reader's, and at the first entry of the
|
|
246
|
+
> current DOCUMENT (7.26.51): a `location.replace()` to another page keeps the
|
|
247
|
+
> key of the entry it replaces, so a later load of the app can sit on the key
|
|
248
|
+
> of a dead marker, over the entries of the load before it, and 7.26.49 went
|
|
249
|
+
> back into them -- that load was loaded again. After a reload every entry is
|
|
250
|
+
> the new load's (`sameDocument`, Chromium and Firefox), and its dead entries
|
|
251
|
+
> go. Dead entries UNDER an entry of the reader's (the reader moved while the
|
|
252
|
+
> login page was up) are taken off when a Back of the reader's lands on them:
|
|
253
|
+
> the shell goes on over them, down to the first live entry, with one
|
|
254
|
+
> `history.go(-n)`; a Forward onto them goes on up to the first live entry
|
|
255
|
+
> over them, or stays where it is when there is none (7.26.51; in 7.26.49 and
|
|
256
|
+
> 7.26.50 they were never taken off: two dead Backs with a question over a
|
|
257
|
+
> panel). The direction comes from the Navigation API's `currententrychange`.
|
|
258
|
+
> **So a shell may move the history by itself, at its start and after a Back
|
|
259
|
+
> or Forward of the reader's** (7.26.49 and 7.26.51): an app with its own
|
|
260
|
+
> `popstate` / `hashchange` listener hears that traversal.
|
|
261
|
+
> The entries are known by their Navigation API key (Chromium, Firefox and
|
|
262
|
+
> Safari 26.2+). **Without the API they stay, as in 7.26.48**: each logout with
|
|
263
|
+
> a question over a panel adds two entries and two dead Backs, and each logout
|
|
264
|
+
> with the preferences up on their action route (`/prefs`, `stay`) leaves the
|
|
265
|
+
> action entry under their marker -- `yui_shell_unpark_route()` rewrites only
|
|
266
|
+
> the entry the URL is on --, so a Back over it opens the preferences again,
|
|
267
|
+
> once per such logout (three logouts: three times; measured in Chromium and
|
|
268
|
+
> Firefox with the API taken away). **A page with no next shell keeps them**
|
|
269
|
+
> -- a login page that stays while the reader presses Back: two dead Backs
|
|
270
|
+
> with a question over a panel, which change nothing on screen since no router
|
|
271
|
+
> is on the page --, and the next shell takes them off. A reload keeps them in
|
|
272
|
+
> the tab's `sessionStorage` for the first shell of the new load (a tab
|
|
273
|
+
> opened from this one starts with a copy, and a key that names none of its
|
|
274
|
+
> entries is dropped). A `history.back()` of
|
|
250
275
|
> the stopped shell still in flight (an overlay closed by its own control in
|
|
251
276
|
> the same turn as the stop) is adopted by a shell started before it lands. An
|
|
252
277
|
> overlay parked on an action route (`redirect: "stay"`) whose `on_close` calls
|
|
@@ -1123,11 +1148,23 @@ form was opened on.
|
|
|
1123
1148
|
**Known limit — the change of hour** (`form_time_value.js`). A
|
|
1124
1149
|
`datetime-local` holds a local wall time and no offset. The night the clocks
|
|
1125
1150
|
go back, one hour happens twice: an epoch in its second pass is shown with the
|
|
1126
|
-
wall time of the first and read back
|
|
1127
|
-
|
|
1151
|
+
wall time of the first, and a wall time is read back as the FIRST pass. A time
|
|
1152
|
+
field or cell that still shows what it was filled with gives back the value it
|
|
1153
|
+
was filled from, so saving the record does not move it (7.26.51 for the field,
|
|
1154
|
+
7.26.49 for the cell; before, a save of any field of the record moved a
|
|
1155
|
+
WRITABLE time column in the second pass by -3600 s). What stays exposed is a
|
|
1156
|
+
wall time TYPED inside the repeated hour: it is taken as the first pass. The
|
|
1128
1157
|
hour skipped in spring holds no epoch, so nothing read there comes back wrong.
|
|
1129
1158
|
Read-only time columns never go back, and a time pkey2 goes back as it was.
|
|
1130
1159
|
|
|
1160
|
+
```js
|
|
1161
|
+
// Europe/Madrid. 01:30Z on 2026-10-25 is 02:30 of the SECOND pass.
|
|
1162
|
+
form record: {when: 1792891800, when_s: "2026-10-25T01:30:00.000Z"}
|
|
1163
|
+
box shows: 2026-10-25T02:30 (the browser drops :00 seconds)
|
|
1164
|
+
Save, untouched: {when: 1792891800, when_s: "2026-10-25T01:30:00.000Z"}
|
|
1165
|
+
// up to 7.26.50: {when: 1792888200, when_s: "2026-10-25T00:30:00.000Z"}
|
|
1166
|
+
```
|
|
1167
|
+
|
|
1131
1168
|
```js
|
|
1132
1169
|
// A host of C_YUI_TREEDB_TOPIC_WITH_FORM that answers the form's writes
|
|
1133
1170
|
gobj_create_pure_child(name, "C_YUI_TREEDB_TOPIC_WITH_FORM",
|
|
@@ -3735,7 +3772,13 @@ the epoch into a `string` column, and showed no time as January 1970, which a
|
|
|
3735
3772
|
save wrote back as `0`. A template field written `"time.writable"` (no real
|
|
3736
3773
|
type) is an epoch (7.26.49): the template grammar gives such a spec `string`,
|
|
3737
3774
|
and 7.26.47 read it as an ISO text -- the field showed no time and a save wrote
|
|
3738
|
-
`null` over it. Write `"string.time.writable"` for an ISO text.
|
|
3775
|
+
`null` over it. Write `"string.time.writable"` for an ISO text. Like the cell,
|
|
3776
|
+
a field the reader did not change is saved as the record had it (7.26.51): the
|
|
3777
|
+
form keeps the value it filled the box from and the text the box reads back,
|
|
3778
|
+
and a box that still shows that text gives back that value. Up to 7.26.50 a
|
|
3779
|
+
save converted the box again, and a time in the second pass of the hour that
|
|
3780
|
+
repeats in autumn went back -3600 s; a template field too. A load, an undo
|
|
3781
|
+
or a paste fills the box again and keeps the new value; a clear drops it.
|
|
3739
3782
|
|
|
3740
3783
|
A field Save refuses (a required box left empty, a date with a part cleared)
|
|
3741
3784
|
is outlined AND carries `aria-invalid`, and the line under it is its
|
|
@@ -4166,7 +4209,15 @@ run; a shallow clone is not kept, and a file that cannot be read is said and
|
|
|
4166
4209
|
read again from git). Up to `7.26.48` that search read every package.json of
|
|
4167
4210
|
the history again on every round while the range was the current one: on a
|
|
4168
4211
|
history of 30 000 commits, 1.2 s per round against 0.25 s without it; now the
|
|
4169
|
-
first round pays it once.
|
|
4212
|
+
first round pays it once. They are kept PER PACKAGE (since `7.26.51`): a
|
|
4213
|
+
state is what a package.json says of the package of the round, and up to
|
|
4214
|
+
`7.26.50` the key was the commits alone, so a round of `@yuneta/gobj-js` after
|
|
4215
|
+
one of `@yuneta/gobj-ui` on the same HEAD read the library's states -- and
|
|
4216
|
+
said "already" for an app born with both new ranges whose number had gone out
|
|
4217
|
+
with the runtime's old range (deploying a new bundle under that number), or
|
|
4218
|
+
raised a version for nothing. A file of another format (one of those rounds)
|
|
4219
|
+
is not read, and is written again; the 64 entries used last are kept. A
|
|
4220
|
+
package.json born with the range in the ROOT of a
|
|
4170
4221
|
history joined to another one (`--allow-unrelated-histories`) is asked of the
|
|
4171
4222
|
other history, by version, as one born in a commit with parents is. The
|
|
4172
4223
|
version raised is the package's own, the `"version"` of the top object: up to
|
|
@@ -4514,7 +4565,8 @@ This tree asks for "admin" (a root with children and no `label`), for
|
|
|
4514
4565
|
**The source is PARSED, never run** (since `7.26.28`, with `acorn`, a
|
|
4515
4566
|
dependency of this package since `7.26.29`: an app need not declare it). A
|
|
4516
4567
|
LOCALE is not a source: it is parsed, and then imported, so its top-level code
|
|
4517
|
-
runs -- the app's own code, but code
|
|
4568
|
+
runs -- the app's own code, but code, and in a process of its own (since
|
|
4569
|
+
`7.26.51`), so nothing it does reaches the verdict. Comments are not code. A key is read
|
|
4518
4570
|
where it is WRITTEN -- given to a translator, as an `i18n` or `data-i18n*`
|
|
4519
4571
|
value of an object literal, by `setAttribute()`, or (since `7.26.29`) written
|
|
4520
4572
|
as a member, `attrs.i18n = "save"`, `attrs["data-i18n-title"] = "save"` -- and
|
|
@@ -4599,7 +4651,11 @@ options). What is followed:
|
|
|
4599
4651
|
`comment || "print-tranger failed"` for its fallback;
|
|
4600
4652
|
- a `const`, to its value, in the scope that declares it (a parameter or a
|
|
4601
4653
|
`let` of the same name hides it), and what a destructuring reads from it
|
|
4602
|
-
(since `7.26.32`: `const {title = "untitled"} = LABELS`)
|
|
4654
|
+
(since `7.26.32`: `const {title = "untitled"} = LABELS`). A default there
|
|
4655
|
+
is asked for only where what it reads can be undefined -- past the end, a
|
|
4656
|
+
hole, a property not written, `undefined`, or a value the reader cannot
|
|
4657
|
+
know (a parameter, a call) -- since `7.26.51`: `const [a = "d0", b = "d1"]
|
|
4658
|
+
= ["x0", "x1"]` asked for "d0" and "d1", which no run of the code reaches;
|
|
4603
4659
|
- an IMPORT of a const or of a function, into the module it names, when the
|
|
4604
4660
|
reader reads that module -- a file of the app, a module of this library;
|
|
4605
4661
|
re-exports are followed (since `7.26.32`). A package (gobj-js, i18next) is
|
|
@@ -4632,17 +4688,37 @@ options). What is followed:
|
|
|
4632
4688
|
and so do an index past a spread and a computed one (since `7.26.49`; up to
|
|
4633
4689
|
`7.26.48` only the writes the reader knew -- `X[0] = k`, `.push()`,
|
|
4634
4690
|
`.reverse()`, `delete`, ... in the array's own scope -- did, and the shapes
|
|
4635
|
-
above read the element the source wrote there, not the one the array held)
|
|
4691
|
+
above read the element the source wrote there, not the one the array held).
|
|
4692
|
+
Since `7.26.51` also: `.at()` with no index (element 0) or with more than
|
|
4693
|
+
one argument (the first), an `.at()` of whatever holds an array literal
|
|
4694
|
+
(`ROWS[0].at(1)`, `ROWS.at(0).at(1)`), a `.slice()` read by its index or
|
|
4695
|
+
walked (`const [b] = LABELS.slice(1)`, `LABELS.slice(1)[0]`,
|
|
4696
|
+
`for(const k of LABELS.slice(1))`), and a rest (`const [a, ...others] =
|
|
4697
|
+
LABELS; t(others[0])`) -- up to `7.26.50` all of them read nothing. An array
|
|
4698
|
+
literal written INSIDE another one, or as the value of a property
|
|
4699
|
+
(`[["foto", "CLS", "photo"]]`, `{cols: ["a", "b"]}`), is read by its index
|
|
4700
|
+
as a property of an object is (up to `7.26.50` by every element): no name
|
|
4701
|
+
holds it, and what is written into it after its declaration is not seen
|
|
4702
|
+
(below);
|
|
4636
4703
|
- an element of a `let` (or `var`) that is only ever given array literals of
|
|
4637
4704
|
literals and elements that are literals (`L[0] = "k"`, `L.push("k")`):
|
|
4638
4705
|
every one of them, at any index (`L[1]`, `L.at(1)`, `t(...L)`, a `for...of`,
|
|
4639
4706
|
`const [a, b] = L`), since `7.26.49`; up to `7.26.48` it was read as nothing.
|
|
4640
|
-
|
|
4707
|
+
Since `7.26.51` the array literals may also come as the branches of `?:`,
|
|
4708
|
+
`||` and `??`, as `null` / `undefined`, or as a const of one (`let L = c()?
|
|
4709
|
+
["a"] : ["b"]`, `L = c()? A : null`), and `Object.assign(L, {1: "k"})` gives
|
|
4710
|
+
it its literals; `L.length = n` gives it no element. An element of an
|
|
4711
|
+
element, a part (`L.slice(1)[0]`) and an `.at()` with any index read every
|
|
4712
|
+
one of them too. Up to `7.26.50` each of these read nothing. A let given
|
|
4713
|
+
anything else is not followed (below);
|
|
4641
4714
|
- the element of a const array literal that a `for...of` walks, or that the
|
|
4642
4715
|
first parameter of a callback of one of the methods above receives (in the
|
|
4643
4716
|
same forms, and since `7.26.42` also the callback of `Array.from(ROWS, cb)`,
|
|
4644
4717
|
of `.findIndex()` and of `Array.prototype.forEach.call(ROWS, cb)`), and what a
|
|
4645
|
-
destructuring reads from it (`for(const {key} of ROWS)
|
|
4718
|
+
destructuring reads from it (`for(const {key} of ROWS)`; an array
|
|
4719
|
+
destructured, `for(const [id, key] of ROWS)`, `ROWS.map(([id, key]) =>
|
|
4720
|
+
...)`, since `7.26.51` -- up to `7.26.50` it read nothing) with its default
|
|
4721
|
+
where that can be undefined;
|
|
4646
4722
|
- `String(x)`, and a template that is only `${x}`, as `x` (since `7.26.29`);
|
|
4647
4723
|
- a parameter, however it is read (since `7.26.32`): `opts.title`,
|
|
4648
4724
|
`opts?.title`, `arguments[1]`, `rest[0]` of a rest parameter, a destructuring
|
|
@@ -5299,8 +5375,6 @@ reading the page in another language:
|
|
|
5299
5375
|
since `7.26.49`), and a spread of a `.slice()` whose bounds are not integers
|
|
5300
5376
|
written out (`t(...KEYS.slice(i))`): from the spread on, no position is
|
|
5301
5377
|
known;
|
|
5302
|
-
- an element a REST takes from an array (`const [first, ...others] = KEYS;
|
|
5303
|
-
t(others[0])`): the reader does not count positions through a rest;
|
|
5304
5378
|
- a translator handed to a FUNCTION (`{t: t}`, `yui_tabulator_lang(t)`,
|
|
5305
5379
|
`run(t)`) or to any method but those listed above (`keys.reduce(t)`,
|
|
5306
5380
|
`keys.sort(t)`, an alias of a method, `Reflect.apply()`): only those
|
|
@@ -5330,7 +5404,8 @@ reading the page in another language:
|
|
|
5330
5404
|
use (`LIST.push("k")`, `Reflect.set(LIST, 0, "k")`, `fill(LIST)`). The same
|
|
5331
5405
|
for a `let` of literal arrays, for what is written into it in a way the
|
|
5332
5406
|
reader does not read (`Reflect.set(L, 0, "k")`, a function it is handed
|
|
5333
|
-
to)
|
|
5407
|
+
to), and for an array literal written inside another one, which is read by
|
|
5408
|
+
its index (`ROWS[0][1] = "k"`, `ROWS.forEach((row) => row.push("k"))`);
|
|
5334
5409
|
- what a module of a package exports (gobj-js, i18next), and an exported
|
|
5335
5410
|
`let`;
|
|
5336
5411
|
- in the library's forwarder search, a key stored in a heap object or a DOM
|
|
@@ -5411,21 +5486,25 @@ name that does not look like one (`app.js`, a helper that needs a browser to
|
|
|
5411
5486
|
load) is said and skipped, as before. The script runs the same when it is
|
|
5412
5487
|
reached through a symlinked package with `--preserve-symlinks-main` (also from
|
|
5413
5488
|
`NODE_OPTIONS`): both sides of its "am I the script?" test are resolved. A
|
|
5414
|
-
locale is IMPORTED, so its code runs
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
`
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
does
|
|
5489
|
+
locale is IMPORTED, so its code runs -- and since `7.26.51` it runs in a
|
|
5490
|
+
PROCESS OF ITS OWN, which reports what each locale exports (its keys and its
|
|
5491
|
+
endonym, as JSON) and ends with `process.reallyExit(0)` before any timer of a
|
|
5492
|
+
locale is due after the report and before any exit handler of one runs. The
|
|
5493
|
+
run itself executes no code of the app, so it ends with the code of its own
|
|
5494
|
+
verdict, whatever a locale does, and what it writes reaches a pipe whole. Up
|
|
5495
|
+
to `7.26.50` the locales were imported into the run, and a locale could still
|
|
5496
|
+
turn a failing run into exit code 0 -- `process.on("exit", () => {
|
|
5497
|
+
process.exitCode = 0 })`, a `process.reallyExit(0)` at its top or in an exit
|
|
5498
|
+
handler, `process.removeAllListeners("exit")` before a `process.exit(0)` --,
|
|
5499
|
+
or end it with most of a long list still on its way to a pipe; `7.26.49` had
|
|
5500
|
+
closed only the `process.exitCode` and `process.exit()` of a timer. A locale
|
|
5501
|
+
that ends its process before the report -- `process.exit()` or
|
|
5502
|
+
`process.reallyExit()` at its top or in a timer of 0, a signal -- fails the run,
|
|
5503
|
+
saying so; so does one that holds it past 60 s (a loop). A promise a locale
|
|
5504
|
+
rejects, or an exception it throws, with nothing to catch it, at its top or in
|
|
5505
|
+
a timer of 0, fails the run with its stack (since `7.26.47` for a rejection).
|
|
5506
|
+
What a timer of a locale due later, or an exit handler of one, would do is
|
|
5507
|
+
never run: in a browser `process` does not even exist.
|
|
5429
5508
|
|
|
5430
5509
|
Up to `7.26.24` each app carried its own copy, and the copies had drifted into
|
|
5431
5510
|
three families: only one read the codes of the schema editor, only the other
|
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -1295,6 +1295,8 @@ var PRIVATE_DATA$22 = {
|
|
|
1295
1295
|
expected_pop_ids: [],
|
|
1296
1296
|
given_up: null,
|
|
1297
1297
|
own_entries: [],
|
|
1298
|
+
traverse_from: -1,
|
|
1299
|
+
entry_change_handler: null,
|
|
1298
1300
|
popstate_handler: null,
|
|
1299
1301
|
avatar_provider: null,
|
|
1300
1302
|
avatar_nodes: [],
|
|
@@ -1370,7 +1372,13 @@ function mt_start$21(gobj) {
|
|
|
1370
1372
|
let p = gobj.priv;
|
|
1371
1373
|
if (!p) return;
|
|
1372
1374
|
note_late_landing(gobj, ev);
|
|
1375
|
+
let from = p.traverse_from;
|
|
1376
|
+
p.traverse_from = -1;
|
|
1373
1377
|
let hash_moved = window.location.hash !== p.last_hash;
|
|
1378
|
+
if (p.expected_pops === 0 && from >= 0 && retire_dead_entries(gobj, from, hash_moved)) {
|
|
1379
|
+
if (!p.skip_hash) p.last_hash = window.location.hash;
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1374
1382
|
if (p.expected_pops > 0 && window.location.hash !== p.expected_pop_hash) {
|
|
1375
1383
|
drop_expected_pops(gobj);
|
|
1376
1384
|
on_traversal(ev);
|
|
@@ -1421,6 +1429,15 @@ function mt_start$21(gobj) {
|
|
|
1421
1429
|
}
|
|
1422
1430
|
};
|
|
1423
1431
|
window.addEventListener("popstate", priv.popstate_handler);
|
|
1432
|
+
let nav = window.navigation;
|
|
1433
|
+
if (nav && typeof nav.addEventListener === "function") {
|
|
1434
|
+
priv.entry_change_handler = (ev) => {
|
|
1435
|
+
let p = gobj.priv;
|
|
1436
|
+
if (!p) return;
|
|
1437
|
+
p.traverse_from = ev && ev.navigationType === "traverse" && ev.from && typeof ev.from.index === "number" ? ev.from.index : -1;
|
|
1438
|
+
};
|
|
1439
|
+
nav.addEventListener("currententrychange", priv.entry_change_handler);
|
|
1440
|
+
}
|
|
1424
1441
|
keep_dead_entries_across_reload();
|
|
1425
1442
|
adopt_orphan_back(gobj);
|
|
1426
1443
|
}
|
|
@@ -1463,6 +1480,12 @@ function mt_stop$20(gobj) {
|
|
|
1463
1480
|
window.removeEventListener("popstate", priv.popstate_handler);
|
|
1464
1481
|
priv.popstate_handler = null;
|
|
1465
1482
|
}
|
|
1483
|
+
if (priv.entry_change_handler) {
|
|
1484
|
+
let nav = window.navigation;
|
|
1485
|
+
if (nav && typeof nav.removeEventListener === "function") nav.removeEventListener("currententrychange", priv.entry_change_handler);
|
|
1486
|
+
priv.entry_change_handler = null;
|
|
1487
|
+
}
|
|
1488
|
+
priv.traverse_from = -1;
|
|
1466
1489
|
for (let entry of priv.pending_markers) {
|
|
1467
1490
|
entry.marker_pending = false;
|
|
1468
1491
|
entry.no_marker = true;
|
|
@@ -2860,7 +2883,9 @@ function retire_overlays(gobj) {
|
|
|
2860
2883
|
*
|
|
2861
2884
|
* A page with no next shell keeps them: with no router on the
|
|
2862
2885
|
* page, a Back over the app's own entries changes nothing on
|
|
2863
|
-
* screen anyway, and the next shell retires them all the same
|
|
2886
|
+
* screen anyway, and the next shell retires them all the same --
|
|
2887
|
+
* at its start, or when a traversal of the reader's lands on them
|
|
2888
|
+
* if the reader moved meanwhile.
|
|
2864
2889
|
************************************************************/
|
|
2865
2890
|
function hand_over_history(gobj) {
|
|
2866
2891
|
let priv = gobj.priv;
|
|
@@ -2980,6 +3005,7 @@ function note_own_entry(gobj) {
|
|
|
2980
3005
|
let priv = gobj.priv;
|
|
2981
3006
|
let key = current_entry_key();
|
|
2982
3007
|
if (!key || priv.own_entries.includes(key)) return;
|
|
3008
|
+
__dead_entries__.delete(key);
|
|
2983
3009
|
priv.own_entries.push(key);
|
|
2984
3010
|
if (priv.own_entries.length > OWN_ENTRIES_PRUNE_AT) {
|
|
2985
3011
|
let alive = new Set(window.navigation.entries().map((e) => e.key));
|
|
@@ -2990,42 +3016,70 @@ function note_own_entry(gobj) {
|
|
|
2990
3016
|
* Take off, with ONE history.go(-n), the dead entries a
|
|
2991
3017
|
* stopped shell left under the current one (hand_over_history).
|
|
2992
3018
|
* The walk stops at the first entry that is not dead, so it
|
|
2993
|
-
* never goes past an entry of the reader's
|
|
2994
|
-
*
|
|
2995
|
-
*
|
|
2996
|
-
* the
|
|
2997
|
-
*
|
|
2998
|
-
*
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3019
|
+
* never goes past an entry of the reader's, and at the first
|
|
3020
|
+
* entry of the current document: a navigation to another page
|
|
3021
|
+
* with replace keeps the entry's key, so a later document can
|
|
3022
|
+
* sit on the key of a dead marker, over the entries of the one
|
|
3023
|
+
* before it (up to gobj-ui 7.26.50 the walk went into them and
|
|
3024
|
+
* that document was loaded again). After a reload every entry
|
|
3025
|
+
* is the new document's, and its dead ones go.
|
|
3026
|
+
*
|
|
3027
|
+
* With `from` (the index a traversal of the reader's came
|
|
3028
|
+
* from), it goes on over the dead entries that traversal landed
|
|
3029
|
+
* on, the way it was going: down to the first live one under
|
|
3030
|
+
* them, or up to the first live one over them -- there is none
|
|
3031
|
+
* when they are the newest, and nothing moves. Dead entries
|
|
3032
|
+
* under an entry of the reader's are taken off that way: the
|
|
3033
|
+
* start of a shell never goes past one.
|
|
3034
|
+
*
|
|
3035
|
+
* The traversal is this shell's own (expected_pops): its
|
|
3036
|
+
* overlays' markers and the routes it pushes wait for the
|
|
3037
|
+
* landing. At the start, a position the URL holds is put back
|
|
3038
|
+
* on the entry it lands on, as for any back() of ours
|
|
3039
|
+
* (restore_hash). The keys stay dead while their entries
|
|
3040
|
+
* exist: a later Back or Forward onto them goes over them too.
|
|
3041
|
+
* Returns true when it went.
|
|
3042
|
+
************************************************************/
|
|
3043
|
+
function retire_dead_entries(gobj, from, hash_moved) {
|
|
3044
|
+
let priv = gobj.priv;
|
|
3045
|
+
let reader = typeof from === "number";
|
|
3002
3046
|
if (__dead_entries__.size === 0 || priv.expected_pops > 0 || !priv.popstate_handler || !current_entry_key()) return false;
|
|
3003
3047
|
let nav = window.navigation;
|
|
3004
3048
|
let entries = nav.entries();
|
|
3005
3049
|
let index = nav.currentEntry.index;
|
|
3006
3050
|
let alive = new Set(entries.map((e) => e.key));
|
|
3007
3051
|
for (let key of __dead_entries__) if (!alive.has(key)) __dead_entries__.delete(key);
|
|
3052
|
+
if (reader && (from === index || !__dead_entries__.has(entries[index].key))) return false;
|
|
3053
|
+
let step = reader && from < index ? 1 : -1;
|
|
3008
3054
|
let landing = index;
|
|
3009
|
-
while (
|
|
3010
|
-
|
|
3055
|
+
while (__dead_entries__.has(entries[landing].key)) {
|
|
3056
|
+
let next = landing + step;
|
|
3057
|
+
if (next < 0 || next >= entries.length || !entries[next].sameDocument) break;
|
|
3058
|
+
landing = next;
|
|
3059
|
+
}
|
|
3060
|
+
if (step > 0 && __dead_entries__.has(entries[landing].key)) return false;
|
|
3061
|
+
let steps = landing - index;
|
|
3011
3062
|
if (steps === 0) return false;
|
|
3012
3063
|
let landing_hash = "";
|
|
3013
3064
|
try {
|
|
3014
3065
|
landing_hash = new URL(entries[landing].url).hash;
|
|
3015
3066
|
} catch (e) {
|
|
3016
|
-
(0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: the entry
|
|
3067
|
+
(0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: the entry past the dead ones has no url: ${e}`);
|
|
3017
3068
|
return false;
|
|
3018
3069
|
}
|
|
3019
|
-
for (let i = landing + 1; i <= index; i++) __dead_entries__.delete(entries[i].key);
|
|
3020
3070
|
priv.expected_pops++;
|
|
3021
3071
|
priv.expected_pop_hash = landing_hash;
|
|
3022
|
-
|
|
3072
|
+
if (reader) {
|
|
3073
|
+
priv.restore_hash = "";
|
|
3074
|
+
if (hash_moved && window.location.hash !== landing_hash) priv.skip_hash = window.location.hash;
|
|
3075
|
+
} else priv.restore_hash = window.location.hash !== landing_hash ? window.location.hash : "";
|
|
3023
3076
|
try {
|
|
3024
|
-
window.history.go(
|
|
3077
|
+
window.history.go(steps);
|
|
3025
3078
|
} catch (e) {
|
|
3026
3079
|
priv.expected_pops--;
|
|
3027
3080
|
priv.restore_hash = "";
|
|
3028
|
-
|
|
3081
|
+
priv.skip_hash = "";
|
|
3082
|
+
(0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: going over ${Math.abs(steps)} dead history entries failed: ${e}`);
|
|
3029
3083
|
return false;
|
|
3030
3084
|
}
|
|
3031
3085
|
clear_deferred_timer(gobj);
|
|
@@ -3133,6 +3187,8 @@ function push_overlay_marker(gobj, entry) {
|
|
|
3133
3187
|
if (below === null || plain) try {
|
|
3134
3188
|
window.history.replaceState(Object.assign({}, below, { __yui_below__: entry.id }), "");
|
|
3135
3189
|
stamped = true;
|
|
3190
|
+
let key = current_entry_key();
|
|
3191
|
+
if (key) __dead_entries__.delete(key);
|
|
3136
3192
|
} catch (e) {
|
|
3137
3193
|
(0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: stamping the entry under an overlay failed: ${e}`);
|
|
3138
3194
|
}
|
|
@@ -9985,8 +10041,11 @@ function json_diff_rows(doc_a, doc_b) {
|
|
|
9985
10041
|
* `new Date("YYYY-MM-DDT02:30:00")` answers the EARLIER one
|
|
9986
10042
|
* (ECMAScript's "compatible" disambiguation). An epoch in the
|
|
9987
10043
|
* SECOND pass of that hour is shown as 02:30 and comes back
|
|
9988
|
-
* one hour earlier
|
|
9989
|
-
*
|
|
10044
|
+
* one hour earlier. So neither the form's field nor the cell
|
|
10045
|
+
* editor reads a box that still shows what it was filled
|
|
10046
|
+
* with: they give back the value it was filled from (up to
|
|
10047
|
+
* gobj-ui 7.26.48 the cell, and 7.26.50 the field, wrote
|
|
10048
|
+
* -3600 s on a save of any field of the record).
|
|
9990
10049
|
* - the night the clocks go forward (spring), one hour does not
|
|
9991
10050
|
* exist. No epoch is shown in it, so nothing read comes back
|
|
9992
10051
|
* wrong; a wall time TYPED in it is moved forward by the
|
|
@@ -9996,8 +10055,8 @@ function json_diff_rows(doc_a, doc_b) {
|
|
|
9996
10055
|
* carry. What is safe: a read-only time column never goes back
|
|
9997
10056
|
* (treedb_write_plan.js, col_goes_back_to_treedb), and a time
|
|
9998
10057
|
* pkey2 goes back as the record had it, never through this
|
|
9999
|
-
* widget (instance_keys_of). A
|
|
10000
|
-
*
|
|
10058
|
+
* widget (instance_keys_of). A wall time TYPED inside the
|
|
10059
|
+
* repeated hour is the exposed case: it is the first pass.
|
|
10001
10060
|
*
|
|
10002
10061
|
* Copyright (c) 2026, ArtGins.
|
|
10003
10062
|
* All Rights Reserved.
|
|
@@ -12903,7 +12962,8 @@ function get_form_values(gobj, $form) {
|
|
|
12903
12962
|
case "input":
|
|
12904
12963
|
switch (input_type) {
|
|
12905
12964
|
case "datetime-local":
|
|
12906
|
-
value =
|
|
12965
|
+
if ($input.yui_time_kept && $input.value === $input.yui_time_kept.shown) value = $input.yui_time_kept.value;
|
|
12966
|
+
else value = datetime_local_to_epoch($input.value);
|
|
12907
12967
|
break;
|
|
12908
12968
|
default: value = getInputValue($input);
|
|
12909
12969
|
}
|
|
@@ -12971,8 +13031,10 @@ function clear_data(gobj, $form) {
|
|
|
12971
13031
|
if (jsoneditor) jsoneditor.set({ text: "" });
|
|
12972
13032
|
} else if ($input.type === "checkbox") $input.checked = false;
|
|
12973
13033
|
else if ($input.type === "radio") $input.checked = false;
|
|
12974
|
-
else if ($input.type === "datetime-local")
|
|
12975
|
-
|
|
13034
|
+
else if ($input.type === "datetime-local") {
|
|
13035
|
+
$input.value = null;
|
|
13036
|
+
$input.yui_time_kept = null;
|
|
13037
|
+
} else if ($input.type === "color") {
|
|
12976
13038
|
$input.value = "#000000";
|
|
12977
13039
|
if ($input.yui_color_value) {
|
|
12978
13040
|
$input.yui_color_value.textContent = $input.value;
|
|
@@ -13062,6 +13124,7 @@ function set_form_values(gobj, template, $form, record) {
|
|
|
13062
13124
|
value = field_desc.default_value;
|
|
13063
13125
|
modified = true;
|
|
13064
13126
|
}
|
|
13127
|
+
let stored = value === void 0 ? null : value;
|
|
13065
13128
|
value = treedb_value_2_form_value(gobj, field_desc, value);
|
|
13066
13129
|
if (value === void 0) value = null;
|
|
13067
13130
|
switch (tag) {
|
|
@@ -13074,6 +13137,10 @@ function set_form_values(gobj, template, $form, record) {
|
|
|
13074
13137
|
switch (input_type) {
|
|
13075
13138
|
case "datetime-local":
|
|
13076
13139
|
$input.value = date_to_datetime_local(value);
|
|
13140
|
+
$input.yui_time_kept = {
|
|
13141
|
+
value: stored,
|
|
13142
|
+
shown: $input.value
|
|
13143
|
+
};
|
|
13077
13144
|
break;
|
|
13078
13145
|
case "color":
|
|
13079
13146
|
$input.value = convertColor(value);
|