@yuneta/gobj-ui 7.26.28 → 7.26.29
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 +169 -40
- package/dist/gobj-ui.cjs.js +17 -13
- package/dist/gobj-ui.es.js +17 -13
- package/package.json +4 -2
- package/scripts/validate-locales.mjs +565 -177
- package/src/c_yui_form.js +5 -3
- package/src/c_yui_gobj_tree_js.js +1 -1
- package/src/c_yui_nav.js +12 -10
- package/src/c_yui_period.js +3 -3
- package/src/c_yui_schema_editor.js +22 -18
- package/src/c_yui_shell.js +4 -3
- package/src/c_yui_treedb_graph.js +3 -4
- package/src/c_yui_treedb_topic_with_form.js +15 -15
- package/src/c_yui_treedb_topics.js +8 -8
- package/src/c_yui_window_manager.js +5 -2
- package/src/i18n_key_functions.js +112 -23
- package/src/i18n_key_functions.test.js +329 -8
- package/src/shell_route_map.js +2 -2
- package/src/yui_gclass_view.js +1 -1
- package/src/yui_time.js +1 -1
package/README.md
CHANGED
|
@@ -3476,9 +3476,10 @@ text is in the yunetas `CLAUDE.md` ("JS GUI conventions"); in short:
|
|
|
3476
3476
|
1. Run the static check on the app's sources, from the published package
|
|
3477
3477
|
(7.26.11+ ships the script):
|
|
3478
3478
|
`node node_modules/@yuneta/gobj-ui/scripts/check-markup-strings.mjs src`
|
|
3479
|
-
— usually from the app's `prebuild`. It imports `acorn`,
|
|
3480
|
-
|
|
3481
|
-
|
|
3479
|
+
— usually from the app's `prebuild`. It imports `acorn`, a dependency
|
|
3480
|
+
of this package since `7.26.29`, so npm installs it with the package
|
|
3481
|
+
(up to `7.26.28` it was a devDependency here, and the APP had to
|
|
3482
|
+
declare it). It lists a markup string literal in a description
|
|
3482
3483
|
(`literal`, wrap it in `html_markup()`), markup built with values
|
|
3483
3484
|
(`built`: a template, `String.raw`, a `+` chain, `.concat()`, a
|
|
3484
3485
|
`[...].join()`, or a string method such as `.trim()` over one of those,
|
|
@@ -3667,9 +3668,9 @@ DOM is a race with the next one:
|
|
|
3667
3668
|
DEPLOYED DOM, resolve each control's name the way a reader does (`aria-label`
|
|
3668
3669
|
→ `label[for]` → a wrapping `<label>` → the text → `title` → `placeholder`),
|
|
3669
3670
|
then switch language and diff. A key that arrives as a VARIABLE — from a data
|
|
3670
|
-
table, a local alias of `t()`, a
|
|
3671
|
-
|
|
3672
|
-
|
|
3671
|
+
table, a local alias of `t()`, a wrapper of the app's own — is invisible to
|
|
3672
|
+
`validate-locales` unless its module publishes it (below), and shows up only
|
|
3673
|
+
there.
|
|
3673
3674
|
|
|
3674
3675
|
### i18n: a string must be able to CHANGE language, not just be translated once
|
|
3675
3676
|
|
|
@@ -3787,10 +3788,14 @@ declaration is a literal when it is the endonym of one of the app's locales
|
|
|
3787
3788
|
(the `name` its catalog exports: `"中文"`, `"español"`); any other lower-case
|
|
3788
3789
|
text is a key, `"configuración"` included.
|
|
3789
3790
|
|
|
3790
|
-
**The source is PARSED, never run** (since `7.26.28`, with `acorn`,
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3791
|
+
**The source is PARSED, never run** (since `7.26.28`, with `acorn`, a
|
|
3792
|
+
dependency of this package since `7.26.29`: an app need not declare it). A
|
|
3793
|
+
LOCALE is not a source: it is parsed, and then imported, so its top-level code
|
|
3794
|
+
runs -- the app's own code, but code. Comments are not code. A key is read
|
|
3795
|
+
where it is WRITTEN -- given to `t()`, as an `i18n` or `data-i18n*` value of
|
|
3796
|
+
an object literal, by `setAttribute()`, or (since `7.26.29`) written as a
|
|
3797
|
+
member, `attrs.i18n = "save"`, `attrs["data-i18n-title"] = "save"` -- and
|
|
3798
|
+
FOLLOWED where the source writes it out:
|
|
3794
3799
|
|
|
3795
3800
|
- a string literal, a template with no `${}`, and every branch of `?:`, `||`
|
|
3796
3801
|
and `??` (the right one of `&&`), so
|
|
@@ -3801,7 +3806,14 @@ it out:
|
|
|
3801
3806
|
- a property of a const object literal: `DEFAULT_LABEL.ok`, and for a
|
|
3802
3807
|
computed one, `NOTES[verdict]`, every value the object holds;
|
|
3803
3808
|
- the element of a const array literal that a `.map()`, `.forEach()`, ...
|
|
3804
|
-
callback or a `for...of` walks
|
|
3809
|
+
callback or a `for...of` walks, and what a destructuring reads from it
|
|
3810
|
+
(`for(const {key} of ROWS)`);
|
|
3811
|
+
- `String(x)`, and a template that is only `${x}`, as `x` (since `7.26.29`);
|
|
3812
|
+
- the default of a parameter, `function f(msg = "fallback")`, besides the
|
|
3813
|
+
parameter (since `7.26.29`);
|
|
3814
|
+
- a call of a function of the same module whose every `return` is one of
|
|
3815
|
+
these (since `7.26.29`). One that returns anything else -- a parameter, a
|
|
3816
|
+
variable, a concatenation -- is not followed.
|
|
3805
3817
|
|
|
3806
3818
|
```js
|
|
3807
3819
|
const KEY = "save";
|
|
@@ -3812,6 +3824,10 @@ for(const zone of ZONES) {
|
|
|
3812
3824
|
build_zone(gobj, zone); // ZONES[].key, at build_zone's key position
|
|
3813
3825
|
}
|
|
3814
3826
|
SHAPES.map((s) => ({value: s, i18n: s})); // every element of SHAPES
|
|
3827
|
+
function pick(ok) {
|
|
3828
|
+
return ok? "accepted" : "refused";
|
|
3829
|
+
}
|
|
3830
|
+
t(pick(answer)); // asks for both
|
|
3815
3831
|
```
|
|
3816
3832
|
|
|
3817
3833
|
What it cannot follow cannot be known: a `let`, a parameter, an import, a
|
|
@@ -3844,16 +3860,56 @@ given at those positions is read like any other key (literals, consts,
|
|
|
3844
3860
|
branches): in the app's own code, on a call bound to an import of that
|
|
3845
3861
|
function from gobj-ui (an app function of the same name is not mistaken for
|
|
3846
3862
|
it), and in every module the app mounts, where an entry with
|
|
3847
|
-
`exported: false` is a helper of its own module.
|
|
3848
|
-
|
|
3863
|
+
`exported: false` is a helper of its own module. A position may also hold
|
|
3864
|
+
DOM, which is no key (since `7.26.29`): an array (a `createElement2` spec), a
|
|
3865
|
+
call of `createElement2()`, `createOneHtml()` or `html_markup()` imported
|
|
3866
|
+
from gobj-js, of `text_node()` from gobj-ui, of `document.createElement()`
|
|
3867
|
+
and the like, a `const` bound to one, or a plain `let` that is only ever
|
|
3868
|
+
given one. DOM is known by where it comes from, never by the name of a
|
|
3869
|
+
variable: `$box` says nothing. The exported ones an app calls:
|
|
3870
|
+
`yui_shell_show_info` / `_warning` / `_error` (the message),
|
|
3849
3871
|
`yui_shell_show_modal` (a string content, `title`),
|
|
3850
3872
|
`yui_shell_confirm_ok` / `_yesno` / `_danger` / `_yesnocancel` (the message,
|
|
3851
3873
|
`title`, the `*_label`s), `yui_install_ask_once` (`message`, `yes_label`,
|
|
3852
3874
|
`no_label`), `yui_selection_bar` (each action's `label`), `yui_asset_missing`
|
|
3853
|
-
/ `yui_asset_element` (`key`), `hook_cell_spec` (the title key)
|
|
3854
|
-
`period_name` (a granularity id)
|
|
3855
|
-
|
|
3856
|
-
|
|
3875
|
+
/ `yui_asset_element` (`key`), `hook_cell_spec` (the title key),
|
|
3876
|
+
`period_name` (a granularity id), `card_descriptor` / `cards_grid_descriptor`
|
|
3877
|
+
(a nav item's `name`, `tooltip`, `aria_label`) and `open_gclass_view` (the
|
|
3878
|
+
gclass name, which titles it).
|
|
3879
|
+
|
|
3880
|
+
**Every function that forwards a key is in the table, and a test finds them**
|
|
3881
|
+
(since `7.26.29`: up to `7.26.28` the table lacked 39 of them, and 6 entries
|
|
3882
|
+
lacked positions, so a literal handed to one went unasked -- REV-CLOUD
|
|
3883
|
+
V21.4.1). `src/i18n_key_functions.test.js` reads every module and finds each
|
|
3884
|
+
function that hands one of its PARAMETERS on to a place a key is read --
|
|
3885
|
+
`t()`, an `i18n`, `code` or `data-i18n*` value, a key position of a function
|
|
3886
|
+
of the table -- the parameter itself or what is read from it (`opts.title`, a
|
|
3887
|
+
destructured `{label}`, each `items[].name`), directly or through a `let` it is
|
|
3888
|
+
given to. The search runs to a fixpoint: a function that hands its parameter
|
|
3889
|
+
to one it found is one too.
|
|
3890
|
+
|
|
3891
|
+
- A function called by NAME -- in its module, or exported -- must be in the
|
|
3892
|
+
table with that position, or the test fails, naming the entry to add:
|
|
3893
|
+
|
|
3894
|
+
```
|
|
3895
|
+
c_yui_nav.js:684 item_li() hands [1.name, 1.tooltip, 1.aria_label] to a place a key is read:
|
|
3896
|
+
name it in I18N_KEY_FUNCTIONS -- {module: "c_yui_nav.js", name: "item_li", exported: false, ...}
|
|
3897
|
+
```
|
|
3898
|
+
|
|
3899
|
+
- One that nothing calls by name -- an FSM action (the framework calls it
|
|
3900
|
+
with an event's kw), a callback, a method -- has no call a reader can
|
|
3901
|
+
read, so listing it would read nothing: what it hands on is MARKED where it
|
|
3902
|
+
hands it, or the test fails. `C_YUI_WINDOW_MANAGER`'s `ac_register_window`
|
|
3903
|
+
writes `i18n: /* i18n: data */ title_key`: the window's title is a key its
|
|
3904
|
+
host chose.
|
|
3905
|
+
- What a gobj keeps in its `priv` is its own state, not what a caller hands:
|
|
3906
|
+
a path through the `priv` of a parameter is no position.
|
|
3907
|
+
|
|
3908
|
+
Naming a function moves the marker to where the value ENTERS: its callers give
|
|
3909
|
+
it a literal, a const, a position of their own, or a marker. The nav's items
|
|
3910
|
+
and the shell's toolbar are marked once, where the library reads its config --
|
|
3911
|
+
`render_vertical(gobj, /* i18n: data */ items)`, the app's nav declaration,
|
|
3912
|
+
whose keys `validate-locales` reads in its `app_config.json`.
|
|
3857
3913
|
|
|
3858
3914
|
**A key the reader cannot follow is PUBLISHED by its module** (since
|
|
3859
3915
|
`7.26.27`): an exported `<NAME>_I18N_KEYS` array of string literals, which
|
|
@@ -3885,15 +3941,26 @@ export const MY_VIEW_I18N_KEYS = ['shape', 'radius', 'apply to'];
|
|
|
3885
3941
|
|
|
3886
3942
|
The list is read as DATA, never run: `export const` (or `let`, `var`),
|
|
3887
3943
|
`const X = [...]; export {X}` (or `export {x as X_I18N_KEYS}`), wrapped in
|
|
3888
|
-
`Object.freeze()` or not, each element a string literal
|
|
3889
|
-
`${}
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3944
|
+
`Object.freeze()` or not, each element a string literal, a template with no
|
|
3945
|
+
`${}`, or (since `7.26.29`) a SPREAD of another array of the same module read
|
|
3946
|
+
the same way -- a top-level `const`, or a list the module publishes:
|
|
3947
|
+
|
|
3948
|
+
```js
|
|
3949
|
+
const COMMON_KEYS = ['shape', 'radius'];
|
|
3950
|
+
export const MY_VIEW_I18N_KEYS = [...COMMON_KEYS, 'apply to'];
|
|
3951
|
+
export const MY_EDITOR_I18N_KEYS = [...MY_VIEW_I18N_KEYS, 'discard'];
|
|
3952
|
+
```
|
|
3953
|
+
|
|
3954
|
+
Anything named `*_I18N_KEYS` (the name in any letter case) that no consumer
|
|
3955
|
+
can read **fails the build**, naming the file and the list, in the app's own
|
|
3956
|
+
code too: an export that is not such an array (an element that is a variable,
|
|
3957
|
+
a call, a template with `${}`, a spread of an import or of a `let`), a list
|
|
3958
|
+
that is not exported, one declared inside a function or a block, one declared
|
|
3959
|
+
by destructuring (`export const {X_I18N_KEYS} = tables`), one exported under a
|
|
3960
|
+
name that does not end in `_I18N_KEYS`. Up to `7.26.27` the regex that read
|
|
3961
|
+
the lists dropped such a list in silence, and a key holding `]` dropped the
|
|
3962
|
+
whole array; up to `7.26.28` a spread of a const of the module was refused
|
|
3963
|
+
too.
|
|
3897
3964
|
|
|
3898
3965
|
**A MARKER says where the keys of a place come from.** It is a comment that
|
|
3899
3966
|
stands right before the node it marks (only whitespace between): an argument,
|
|
@@ -3913,6 +3980,25 @@ confirm_then(gobj, /* i18n: C_YUI_FORM_I18N_KEYS */ kw.warning || "all changes w
|
|
|
3913
3980
|
published lists. The keys of the marked expression that the reader CAN
|
|
3914
3981
|
follow must be in them: a marker is a claim, and it is checked.
|
|
3915
3982
|
|
|
3983
|
+
**A `data` marker is a claim too** (since `7.26.29`). On what the reader
|
|
3984
|
+
follows to keys and nothing else -- a literal, a template with no `${}`, a
|
|
3985
|
+
`const` bound to one, a `?:` / `||` / `??` branch that is one, a call of a
|
|
3986
|
+
function of the module whose returns are literals -- it claims data where the
|
|
3987
|
+
reader reads a key, and it fails. Up to `7.26.28` that is how the key behind
|
|
3988
|
+
a call went unread: the reader stopped at the call, and the marker excused it.
|
|
3989
|
+
|
|
3990
|
+
```js
|
|
3991
|
+
function pick() {
|
|
3992
|
+
return "accepted";
|
|
3993
|
+
}
|
|
3994
|
+
yui_shell_show_info(shell, /* i18n: data */ pick());
|
|
3995
|
+
// main.js:4: marked as data, but what it marks is the key "accepted", which the
|
|
3996
|
+
// reader follows: drop the marker (it is no data)
|
|
3997
|
+
```
|
|
3998
|
+
|
|
3999
|
+
`/* i18n: data */ comment || "print-tranger failed"` stays legal: `comment` is
|
|
4000
|
+
data, and the fallback is read anyway.
|
|
4001
|
+
|
|
3916
4002
|
**A marked `let` (or `var`) is held to its marker.** A marker that names a list
|
|
3917
4003
|
used to let a `let` pass unread, whatever it held: a new literal branch on it
|
|
3918
4004
|
was neither asked for nor checked (REV-CLOUD V20). Now, when what a marker
|
|
@@ -3978,20 +4064,55 @@ before no place a key is read (a key position, `t()`, an `i18n` or
|
|
|
3978
4064
|
publishes, a marked key that is not in the lists it names, a marked variable
|
|
3979
4065
|
that only ever holds literals -- each one fails, with the file and the line.
|
|
3980
4066
|
|
|
3981
|
-
**The
|
|
3982
|
-
reads every module
|
|
3983
|
-
|
|
4067
|
+
**The rule is per CALL, in the library and in the app.**
|
|
4068
|
+
`src/i18n_key_functions.test.js` reads every module of the library with the
|
|
4069
|
+
validator's own reader, and `validate-locales` reads the app's own code the
|
|
4070
|
+
same way (since `7.26.29`; up to `7.26.28` only the library was held to it, and
|
|
4071
|
+
a `let`, a wrapper or a concatenation in an app passed unread). Every value a
|
|
4072
|
+
key position of a key function can take must be:
|
|
3984
4073
|
|
|
3985
|
-
1. a string literal, a `?:` / `||` / `??` of them, or
|
|
3986
|
-
2. a const the reader follows to one of those
|
|
4074
|
+
1. a string literal, a `?:` / `||` / `??` of them, nothing, or DOM;
|
|
4075
|
+
2. a const the reader follows to one of those, or a plain `let` that is only
|
|
4076
|
+
ever given DOM;
|
|
3987
4077
|
3. a key position of the enclosing table function, handed on (`message`
|
|
3988
|
-
where `message` is a key parameter of the function the call is in)
|
|
4078
|
+
where `message` is a key parameter of the function the call is in) -- in
|
|
4079
|
+
the library only: a function of an app is in no table; or
|
|
3989
4080
|
4. MARKED, `/* i18n: data */` or `/* i18n: <NAME>_I18N_KEYS */`.
|
|
3990
4081
|
|
|
3991
4082
|
Anything else fails, naming the file, the line and the call:
|
|
3992
4083
|
|
|
3993
4084
|
```
|
|
3994
4085
|
c_yui_treedb_topics.js:860 (call at 859) card_action_anchor() [2]: table_key
|
|
4086
|
+
src/main.js:12: yui_shell_confirm_yesno() [2.title] is given opts, which the reader cannot follow:
|
|
4087
|
+
hand it a literal or a const, or mark it /* i18n: data */ or /* i18n: <NAME>_I18N_KEYS */
|
|
4088
|
+
```
|
|
4089
|
+
|
|
4090
|
+
A TRANSLATED text handed to a key position fails even when it is marked: the
|
|
4091
|
+
function translates it again and marks it `data-i18n` with the translation,
|
|
4092
|
+
so it never changes language. Hand it the key:
|
|
4093
|
+
|
|
4094
|
+
```js
|
|
4095
|
+
yui_install_ask_once(shell, {t: t, message: t("install this app")}); // fails
|
|
4096
|
+
yui_install_ask_once(shell, {t: t, message: "install this app"}); // the key
|
|
4097
|
+
```
|
|
4098
|
+
|
|
4099
|
+
```
|
|
4100
|
+
src/c_app.js:734 (call at line 732): yui_install_ask_once() [1.message] is given t("install this app"):
|
|
4101
|
+
a TRANSLATED text where a KEY goes (translated again and marked data-i18n with the translation,
|
|
4102
|
+
it never changes language): hand it the key
|
|
4103
|
+
```
|
|
4104
|
+
|
|
4105
|
+
In an app, what a wrapper of its own hands on is marked where it hands it:
|
|
4106
|
+
`/* i18n: data */` when it is data (a backend's comment, a key built from a
|
|
4107
|
+
name, the DOM its callers built). When its callers give it the module's own
|
|
4108
|
+
literal keys, the module PUBLISHES them and the marker names the list --
|
|
4109
|
+
wattyzer's `open_route_modal()` hands on the titles of `C_WZ_APP_I18N_KEYS`:
|
|
4110
|
+
|
|
4111
|
+
```js
|
|
4112
|
+
export const C_WZ_APP_I18N_KEYS = ["backend connection", "about wattyzer", "preferences"];
|
|
4113
|
+
...
|
|
4114
|
+
let handle = yui_shell_show_modal(priv.shell, /* i18n: data */ $content,
|
|
4115
|
+
/* i18n: C_WZ_APP_I18N_KEYS */ modal_opts);
|
|
3995
4116
|
```
|
|
3996
4117
|
|
|
3997
4118
|
Publishing a list does not exempt a module: the rule is per call, not per
|
|
@@ -4048,13 +4169,17 @@ it asks for or carries with the list.
|
|
|
4048
4169
|
|
|
4049
4170
|
**What is NOT pinned.** `t()` is not a key function, and only the positions of
|
|
4050
4171
|
`I18N_KEY_FUNCTIONS` are held to the per-call rule. So a key handed to `t()`,
|
|
4051
|
-
`i18n` or a `data-i18n*` value by an UNMARKED `let`, a
|
|
4052
|
-
concatenation is invisible to the validator and fails no test --
|
|
4053
|
-
library and in an app alike.
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4172
|
+
`i18n` or a `data-i18n*` value by an UNMARKED `let`, a call the reader does not
|
|
4173
|
+
follow or a concatenation is invisible to the validator and fails no test --
|
|
4174
|
+
in the library and in an app alike. (A PARAMETER is not, in the library: the
|
|
4175
|
+
forwarder test puts its function in the table, or demands a marker.) So is
|
|
4176
|
+
what is written INTO a `const` table after its declaration (`LIST.push("k")`,
|
|
4177
|
+
`TABLE.k = "k"`): the reader follows a const to its value, and only a marked
|
|
4178
|
+
`let` is followed into what is written into it. It is found only by reading
|
|
4179
|
+
the page in another language. In an app, a key its callers hand a wrapper of
|
|
4180
|
+
its own reaches the locales only through a list the module publishes: the
|
|
4181
|
+
wrapper's hand-off must be marked (the rule per call), and nothing ties its
|
|
4182
|
+
callers' literals to the list.
|
|
4058
4183
|
|
|
4059
4184
|
**What fails the build, besides a key no locale defines:**
|
|
4060
4185
|
|
|
@@ -4066,7 +4191,11 @@ function the table does not name.
|
|
|
4066
4191
|
`translation` dict;
|
|
4067
4192
|
- a source file that cannot be parsed;
|
|
4068
4193
|
- a published list no consumer can read (above);
|
|
4069
|
-
- a marker that is wrong (above)
|
|
4194
|
+
- a marker that is wrong (above), a `data` marker on what the reader follows
|
|
4195
|
+
to keys included;
|
|
4196
|
+
- a key position of a key function, in the app's own code, given what the
|
|
4197
|
+
reader cannot follow and unmarked, or given a translated text (the rule per
|
|
4198
|
+
call, above).
|
|
4070
4199
|
|
|
4071
4200
|
Up to `7.26.27` the locale cases were "skipped" with an OK: one language less
|
|
4072
4201
|
validated, and nobody told. A file of the locales directory with a locale's
|
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -1837,7 +1837,7 @@ function safe_id(s) {
|
|
|
1837
1837
|
* the same Bulma-helper logic as zones.
|
|
1838
1838
|
************************************************************/
|
|
1839
1839
|
function build_toolbar$1(gobj, config) {
|
|
1840
|
-
|
|
1840
|
+
const tb = config && config.toolbar;
|
|
1841
1841
|
if (!tb || !(0, _yuneta_gobj_js.is_array)(tb.items)) return;
|
|
1842
1842
|
let priv = gobj.priv;
|
|
1843
1843
|
let zone_id = tb.zone || find_toolbar_zone(config);
|
|
@@ -76179,18 +76179,22 @@ function render_treedbs(gobj, $body) {
|
|
|
76179
76179
|
let priv = gobj.priv;
|
|
76180
76180
|
let $cards = [];
|
|
76181
76181
|
for (let treedb of priv.model.treedbs) {
|
|
76182
|
-
|
|
76183
|
-
|
|
76184
|
-
|
|
76185
|
-
|
|
76186
|
-
|
|
76187
|
-
|
|
76188
|
-
|
|
76189
|
-
|
|
76190
|
-
|
|
76191
|
-
|
|
76192
|
-
|
|
76193
|
-
|
|
76182
|
+
const from_c = treedb.c_schema_version !== void 0 && String(treedb.c_schema_version) !== String(treedb.schema_version);
|
|
76183
|
+
const tags = [
|
|
76184
|
+
{
|
|
76185
|
+
i18n: "topics",
|
|
76186
|
+
text: treedb.topics.length
|
|
76187
|
+
},
|
|
76188
|
+
{
|
|
76189
|
+
i18n: "version",
|
|
76190
|
+
text: treedb.schema_version === void 0 ? "?" : treedb.schema_version
|
|
76191
|
+
},
|
|
76192
|
+
...from_c ? [{
|
|
76193
|
+
i18n: "from c",
|
|
76194
|
+
text: treedb.c_schema_version,
|
|
76195
|
+
style: "is-warning is-light"
|
|
76196
|
+
}] : []
|
|
76197
|
+
];
|
|
76194
76198
|
$cards.push(open_card(gobj, "SCHEMA_TREEDB_CARD", treedb.id, "yi-database", tags, "EV_SELECT_TREEDB", { treedb: treedb.id }));
|
|
76195
76199
|
}
|
|
76196
76200
|
if (priv.model.orphan_topics.length > 0 || priv.model.orphan_cols.length > 0) $cards.push(open_card(gobj, "SCHEMA_ORPHAN_CARD", (0, i18next.t)("orphans"), "yi-triangle-exclamation", [{
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -1832,7 +1832,7 @@ function safe_id(s) {
|
|
|
1832
1832
|
* the same Bulma-helper logic as zones.
|
|
1833
1833
|
************************************************************/
|
|
1834
1834
|
function build_toolbar$1(gobj, config) {
|
|
1835
|
-
|
|
1835
|
+
const tb = config && config.toolbar;
|
|
1836
1836
|
if (!tb || !is_array(tb.items)) return;
|
|
1837
1837
|
let priv = gobj.priv;
|
|
1838
1838
|
let zone_id = tb.zone || find_toolbar_zone(config);
|
|
@@ -76174,18 +76174,22 @@ function render_treedbs(gobj, $body) {
|
|
|
76174
76174
|
let priv = gobj.priv;
|
|
76175
76175
|
let $cards = [];
|
|
76176
76176
|
for (let treedb of priv.model.treedbs) {
|
|
76177
|
-
|
|
76178
|
-
|
|
76179
|
-
|
|
76180
|
-
|
|
76181
|
-
|
|
76182
|
-
|
|
76183
|
-
|
|
76184
|
-
|
|
76185
|
-
|
|
76186
|
-
|
|
76187
|
-
|
|
76188
|
-
|
|
76177
|
+
const from_c = treedb.c_schema_version !== void 0 && String(treedb.c_schema_version) !== String(treedb.schema_version);
|
|
76178
|
+
const tags = [
|
|
76179
|
+
{
|
|
76180
|
+
i18n: "topics",
|
|
76181
|
+
text: treedb.topics.length
|
|
76182
|
+
},
|
|
76183
|
+
{
|
|
76184
|
+
i18n: "version",
|
|
76185
|
+
text: treedb.schema_version === void 0 ? "?" : treedb.schema_version
|
|
76186
|
+
},
|
|
76187
|
+
...from_c ? [{
|
|
76188
|
+
i18n: "from c",
|
|
76189
|
+
text: treedb.c_schema_version,
|
|
76190
|
+
style: "is-warning is-light"
|
|
76191
|
+
}] : []
|
|
76192
|
+
];
|
|
76189
76193
|
$cards.push(open_card(gobj, "SCHEMA_TREEDB_CARD", treedb.id, "yi-database", tags, "EV_SELECT_TREEDB", { treedb: treedb.id }));
|
|
76190
76194
|
}
|
|
76191
76195
|
if (priv.model.orphan_topics.length > 0 || priv.model.orphan_cols.length > 0) $cards.push(open_card(gobj, "SCHEMA_ORPHAN_CARD", t("orphans"), "yi-triangle-exclamation", [{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuneta/gobj-ui",
|
|
3
|
-
"version": "7.26.
|
|
3
|
+
"version": "7.26.29",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/gobj-ui.cjs.js",
|
|
6
6
|
"module": "dist/gobj-ui.es.js",
|
|
@@ -33,11 +33,13 @@
|
|
|
33
33
|
"deploy-round": "node scripts/deploy-round.mjs",
|
|
34
34
|
"prepublishOnly": "npm run build"
|
|
35
35
|
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"acorn": "^8.19.0"
|
|
38
|
+
},
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"@rollup/plugin-terser": "^1.0.0",
|
|
38
41
|
"@vitest/coverage-v8": "^4.1.10",
|
|
39
42
|
"@yuneta/gobj-js": "^7.26.3",
|
|
40
|
-
"acorn": "^8.19.0",
|
|
41
43
|
"vite": "^8.3.3",
|
|
42
44
|
"vitest": "^4.1.10"
|
|
43
45
|
},
|