@coffer-org/plugin-transit 6.0.0 → 7.0.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.
- package/dist/index.js +6 -1
- package/dist/runtime/index.js +0 -4
- package/dist/schema.js +45 -2
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -13,7 +13,12 @@ export default definePlugin({
|
|
|
13
13
|
id: 'transit',
|
|
14
14
|
label: 'transit.library.label',
|
|
15
15
|
icon: 'lucide:bus',
|
|
16
|
-
agent:
|
|
16
|
+
agent: {
|
|
17
|
+
description: 'Local bus routes and their departure schedules (bus_route).',
|
|
18
|
+
instructions: 'bus_route: weekday_times/saturday_times/sunday_times — departure schedule.' +
|
|
19
|
+
' When the schedule changes, update *_times via update_record.',
|
|
20
|
+
},
|
|
21
|
+
starterHint: 'the next departures on the saved routes',
|
|
17
22
|
}),
|
|
18
23
|
shelves: [bus_route],
|
|
19
24
|
},
|
package/dist/runtime/index.js
CHANGED
package/dist/schema.js
CHANGED
|
@@ -6184,6 +6184,28 @@ registerPreset("reminder", "date", { lead: 30 }, {
|
|
|
6184
6184
|
};
|
|
6185
6185
|
}
|
|
6186
6186
|
});
|
|
6187
|
+
/** Age — date whose whole-year age (as of today) renders alongside it, e.g. a birth date.
|
|
6188
|
+
* kind 'age', prim 'date'. The age itself is computed at RENDER time, never stored: unlike a
|
|
6189
|
+
* `mutate`-driven computed field, it must be right on every day that passes, not only the day
|
|
6190
|
+
* the record was last written, so this is display metadata over `date`, the same shape as
|
|
6191
|
+
* `f.reminder`'s own relative-to-today note.
|
|
6192
|
+
*
|
|
6193
|
+
* @layer preset
|
|
6194
|
+
* @base date
|
|
6195
|
+
* @prim date
|
|
6196
|
+
* @widget age
|
|
6197
|
+
* @example f.age({ label: 'mod.fields.birthDate' })
|
|
6198
|
+
*/
|
|
6199
|
+
function age(o) {
|
|
6200
|
+
return declare("age", o);
|
|
6201
|
+
}
|
|
6202
|
+
registerPreset("age", "date", {}, {
|
|
6203
|
+
kind: "age",
|
|
6204
|
+
widget: "age",
|
|
6205
|
+
build(o, parts) {
|
|
6206
|
+
return typeOf("date").build(o, parts);
|
|
6207
|
+
}
|
|
6208
|
+
});
|
|
6187
6209
|
/**
|
|
6188
6210
|
* Percentage 0..100 — real with rules:{min:0,max:100}.
|
|
6189
6211
|
*
|
|
@@ -6389,6 +6411,7 @@ var presets = {
|
|
|
6389
6411
|
rating,
|
|
6390
6412
|
duration,
|
|
6391
6413
|
reminder,
|
|
6414
|
+
age,
|
|
6392
6415
|
percent,
|
|
6393
6416
|
year,
|
|
6394
6417
|
weight,
|
|
@@ -7097,11 +7120,20 @@ function status(opts) {
|
|
|
7097
7120
|
}
|
|
7098
7121
|
/** A gauge value between an optional min and max, with an optional "of" total.
|
|
7099
7122
|
*
|
|
7123
|
+
* `direction` is opt-in: when given, the gauge decides in plain JavaScript whether its own
|
|
7124
|
+
* value crossed the bound that matters (`meterTone`, `blocks/meter.tsx`) and reaches for the
|
|
7125
|
+
* tone palette — the fill, the value text and the `of` companion all move together, never
|
|
7126
|
+
* colour alone (a glyph rides along, see the renderer's own comment). Omit it and nothing
|
|
7127
|
+
* about the gauge changes from today. A `'ceiling'` gauge with no declared `max` (config or
|
|
7128
|
+
* the source field's own hints) resolves it from `of`'s own value instead — a budget's cap is
|
|
7129
|
+
* a per-record field, never a compile-time constant.
|
|
7130
|
+
*
|
|
7100
7131
|
* @layer block
|
|
7101
7132
|
* @base group
|
|
7102
7133
|
* @prim —
|
|
7103
7134
|
* @widget meter
|
|
7104
7135
|
* @example f.meter({ source: { used: f.real({ label: '…' }) }, min: 0, max: 100 })
|
|
7136
|
+
* @example f.meter({ source: { spent: f.real({ label: '…' }) }, of: { budget: f.real({ label: '…' }) }, direction: 'ceiling' })
|
|
7105
7137
|
*/
|
|
7106
7138
|
function meter(opts) {
|
|
7107
7139
|
const source = slot("meter", "source", opts.source);
|
|
@@ -7117,7 +7149,8 @@ function meter(opts) {
|
|
|
7117
7149
|
source: Object.keys(source)[0],
|
|
7118
7150
|
min: opts.min,
|
|
7119
7151
|
max: opts.max,
|
|
7120
|
-
of: of && Object.keys(of)[0]
|
|
7152
|
+
of: of && Object.keys(of)[0],
|
|
7153
|
+
direction: opts.direction
|
|
7121
7154
|
}
|
|
7122
7155
|
};
|
|
7123
7156
|
}
|
|
@@ -8556,6 +8589,12 @@ function divider(o) {
|
|
|
8556
8589
|
/**
|
|
8557
8590
|
* Reference markdown block by i18n key.
|
|
8558
8591
|
*
|
|
8592
|
+
* The key is resolved WITH the variables of the running instance, so the locale string
|
|
8593
|
+
* may name facts that are not constants: `{{origin}}` is this instance's own address
|
|
8594
|
+
* (`https://coffer.example`), which is how a block documents an endpoint without
|
|
8595
|
+
* freezing a developer's `localhost` into every translation. The set is fixed and
|
|
8596
|
+
* ambient — the block declares only its key. See `web-ui/src/render/info-text.ts`.
|
|
8597
|
+
*
|
|
8559
8598
|
* @layer primitive
|
|
8560
8599
|
* @prim —
|
|
8561
8600
|
* @widget info
|
|
@@ -11085,7 +11124,11 @@ var src_default = definePlugin({
|
|
|
11085
11124
|
id: "transit",
|
|
11086
11125
|
label: "transit.library.label",
|
|
11087
11126
|
icon: "lucide:bus",
|
|
11088
|
-
agent:
|
|
11127
|
+
agent: {
|
|
11128
|
+
description: "Local bus routes and their departure schedules (bus_route).",
|
|
11129
|
+
instructions: "bus_route: weekday_times/saturday_times/sunday_times — departure schedule. When the schedule changes, update *_times via update_record."
|
|
11130
|
+
},
|
|
11131
|
+
starterHint: "the next departures on the saved routes"
|
|
11089
11132
|
}),
|
|
11090
11133
|
shelves: [bus_route_default]
|
|
11091
11134
|
}],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffer-org/plugin-transit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"test": "node --import tsx/esm --test 'src/runtime/*.test.ts'"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@coffer-org/sdk": "^
|
|
30
|
-
"@coffer-org/server": "^
|
|
31
|
-
"@coffer-org/helper-dav": "^
|
|
29
|
+
"@coffer-org/sdk": "^7.2.0",
|
|
30
|
+
"@coffer-org/server": "^7.2.0",
|
|
31
|
+
"@coffer-org/helper-dav": "^7.0.0"
|
|
32
32
|
},
|
|
33
33
|
"coffer": {
|
|
34
34
|
"runtime": "node",
|