@zeyos/zx 5.7.1 → 5.8.0
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/CHANGELOG.md +296 -0
- package/README.md +47 -9
- package/dist/types/components/activity-item/activity-item.d.ts +14 -3
- package/dist/types/components/agent-avatar/agent-avatar.d.ts +165 -0
- package/dist/types/components/agent-avatar/agent-face.d.ts +93 -0
- package/dist/types/components/agent-thread/ag-ui.d.ts +21 -9
- package/dist/types/components/agent-thread/agent-thread.d.ts +26 -0
- package/dist/types/components/agent-thread/ui-message-stream.d.ts +3 -1
- package/dist/types/components/approval-card/approval-card.d.ts +31 -2
- package/dist/types/components/aurora/aurora.d.ts +31 -5
- package/dist/types/components/calendar/calendar.d.ts +39 -26
- package/dist/types/components/chart/chart.d.ts +250 -20
- package/dist/types/components/chart/color.d.ts +66 -0
- package/dist/types/components/chart/svg-adapter.d.ts +103 -0
- package/dist/types/components/chart/svg-geometry.d.ts +203 -0
- package/dist/types/components/check-button/check-button.d.ts +1 -4
- package/dist/types/components/checklist/checklist.d.ts +19 -5
- package/dist/types/components/code-editor/code-editor.d.ts +55 -1
- package/dist/types/components/composer/composer.d.ts +41 -6
- package/dist/types/components/context-menu/context-menu.d.ts +36 -8
- package/dist/types/components/copy/copy-button.d.ts +6 -0
- package/dist/types/components/copy/copy-input.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +14 -0
- package/dist/types/components/date-picker/time-picker.d.ts +26 -17
- package/dist/types/components/datebox/datebox.d.ts +8 -4
- package/dist/types/components/dialog/dialog.d.ts +13 -2
- package/dist/types/components/empty-state/empty-state.d.ts +10 -1
- package/dist/types/components/field/field.d.ts +4 -2
- package/dist/types/components/form/form.d.ts +2 -1
- package/dist/types/components/kanban-view/kanban-card.d.ts +7 -0
- package/dist/types/components/kanban-view/kanban-view.d.ts +15 -3
- package/dist/types/components/launcher/launcher.d.ts +26 -0
- package/dist/types/components/master-panel/master-panel.d.ts +9 -4
- package/dist/types/components/menu-button/menu-button.d.ts +29 -5
- package/dist/types/components/message/message.d.ts +308 -5
- package/dist/types/components/modal/modal.d.ts +11 -0
- package/dist/types/components/modal/native-dialog.d.ts +40 -0
- package/dist/types/components/module-bar/module-bar.d.ts +9 -2
- package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +5 -4
- package/dist/types/components/number-field/number-field.d.ts +7 -0
- package/dist/types/components/pagination/pagination.d.ts +341 -19
- package/dist/types/components/run-status/run-status.d.ts +26 -0
- package/dist/types/components/run-trace/run-trace.d.ts +10 -6
- package/dist/types/components/search/search.d.ts +16 -4
- package/dist/types/components/select/select.d.ts +19 -1
- package/dist/types/components/sheet/sheet.d.ts +18 -4
- package/dist/types/components/slider/slider.d.ts +2 -1
- package/dist/types/components/stat-tile/stat-tile.d.ts +20 -3
- package/dist/types/components/stepper/stepper.d.ts +17 -4
- package/dist/types/components/surface/catalog.d.ts +61 -17
- package/dist/types/components/surface/surface.d.ts +6 -4
- package/dist/types/components/table/table.d.ts +207 -5
- package/dist/types/components/table/window.d.ts +25 -1
- package/dist/types/components/toggle/toggle.d.ts +38 -6
- package/dist/types/components/tooltip/tooltip.d.ts +5 -4
- package/dist/types/components/tree/tree.d.ts +43 -6
- package/dist/types/components/truncate/truncate.d.ts +4 -2
- package/dist/types/components/value-list/value-list.d.ts +9 -2
- package/dist/types/core/date.d.ts +2 -1
- package/dist/types/core/drag-axis.d.ts +10 -5
- package/dist/types/core/export.d.ts +2 -2
- package/dist/types/core/format.d.ts +3 -1
- package/dist/types/core/icons.d.ts +36 -3
- package/dist/types/core/keyboard.d.ts +7 -3
- package/dist/types/core/messages.d.ts +3 -0
- package/dist/types/core/storage.d.ts +4 -3
- package/dist/types/core/util.d.ts +3 -1
- package/dist/types/elements/define.d.ts +5 -2
- package/dist/types/index.d.ts +6 -4
- package/dist/types/internal/agent-model.d.ts +99 -0
- package/dist/types/internal/app-rail.d.ts +37 -2
- package/dist/types/internal/collections.d.ts +18 -0
- package/dist/types/internal/menu-items.d.ts +27 -0
- package/dist/types/internal/overlay-content.d.ts +23 -0
- package/dist/types/internal/presence-loop.d.ts +5 -2
- package/dist/types/locales/index.d.ts +3 -0
- package/dist/types/zeyos/calendar.d.ts +43 -7
- package/dist/types/zeyos/connect.d.ts +4 -0
- package/dist/types/zeyos/form.d.ts +13 -5
- package/dist/types/zeyos/select.d.ts +5 -2
- package/dist/types/zeyos/table.d.ts +16 -8
- package/dist/types/zeyos/view.d.ts +2 -1
- package/dist/zx-zeyos.esm.js +2998 -451
- package/dist/zx-zeyos.esm.min.js +4 -4
- package/dist/zx.core.css +4 -0
- package/dist/zx.core.min.css +1 -1
- package/dist/zx.css +948 -48
- package/dist/zx.esm.js +7432 -3408
- package/dist/zx.esm.min.js +26 -26
- package/dist/zx.global.js +7432 -3408
- package/dist/zx.global.min.js +26 -26
- package/dist/zx.layered.css +950 -48
- package/dist/zx.layered.min.css +1 -1
- package/dist/zx.min.css +1 -1
- package/docs/agent-catalog.json +159 -1
- package/docs/agent-surfaces.md +21 -21
- package/docs/api.json +3122 -528
- package/docs/components/account-menu.md +24 -0
- package/docs/components/activity-item.md +23 -0
- package/docs/components/activity-list.md +28 -0
- package/docs/components/agent-avatar.md +59 -0
- package/docs/components/agent-thread.md +275 -0
- package/docs/components/app-icon.md +36 -0
- package/docs/components/app-sidebar.md +92 -0
- package/docs/components/approval-card.md +71 -0
- package/docs/components/aurora.md +34 -0
- package/docs/components/avatar.md +37 -0
- package/docs/components/badge.md +36 -0
- package/docs/components/block-view.md +34 -0
- package/docs/components/breadcrumb.md +20 -0
- package/docs/components/button.md +23 -0
- package/docs/components/calendar.md +68 -0
- package/docs/components/card-view.md +73 -0
- package/docs/components/card.md +25 -0
- package/docs/components/chart.md +109 -0
- package/docs/components/check-button.md +16 -0
- package/docs/components/checklist.md +19 -0
- package/docs/components/code-editor.md +38 -0
- package/docs/components/composer.md +107 -0
- package/docs/components/context-menu.md +32 -0
- package/docs/components/copy.md +37 -0
- package/docs/components/data-filter.md +16 -0
- package/docs/components/date-picker.md +31 -0
- package/docs/components/date-range.md +21 -0
- package/docs/components/datebox.md +31 -0
- package/docs/components/dialog.md +25 -0
- package/docs/components/dock.md +57 -0
- package/docs/components/dropdown.md +39 -0
- package/docs/components/elements.md +63 -0
- package/docs/components/empty-state.md +17 -0
- package/docs/components/entity-ref.md +26 -0
- package/docs/components/field-upload.md +18 -0
- package/docs/components/file-item.md +27 -0
- package/docs/components/file-list.md +23 -0
- package/docs/components/filter-panel.md +45 -0
- package/docs/components/filter.md +47 -0
- package/docs/components/finder.md +25 -0
- package/docs/components/form-widgets.md +42 -0
- package/docs/components/form.md +80 -0
- package/docs/components/grid.md +26 -0
- package/docs/components/groupbox.md +11 -0
- package/docs/components/helpers.md +359 -0
- package/docs/components/icons.md +87 -0
- package/docs/components/index.md +99 -0
- package/docs/components/kanban-view.md +42 -0
- package/docs/components/kbd.md +23 -0
- package/docs/components/kernel.md +41 -0
- package/docs/components/launcher.md +66 -0
- package/docs/components/layout.md +33 -0
- package/docs/components/list-toolbar.md +38 -0
- package/docs/components/loading.md +48 -0
- package/docs/components/menu-button.md +47 -0
- package/docs/components/message.md +76 -0
- package/docs/components/modal.md +27 -0
- package/docs/components/module-bar.md +71 -0
- package/docs/components/multi-value-editor.md +16 -0
- package/docs/components/navigation-bar.md +22 -0
- package/docs/components/number-field.md +34 -0
- package/docs/components/pagination.md +73 -0
- package/docs/components/panel.md +28 -0
- package/docs/components/prompt-starters.md +40 -0
- package/docs/components/prose.md +38 -0
- package/docs/components/questionnaire.md +115 -0
- package/docs/components/rating.md +19 -0
- package/docs/components/run-status.md +50 -0
- package/docs/components/run-trace.md +72 -0
- package/docs/components/search.md +11 -0
- package/docs/components/select.md +129 -0
- package/docs/components/sheet-stack.md +39 -0
- package/docs/components/sheet.md +77 -0
- package/docs/components/skeleton.md +27 -0
- package/docs/components/slider.md +29 -0
- package/docs/components/sort-control.md +21 -0
- package/docs/components/source-list.md +30 -0
- package/docs/components/split-view.md +12 -0
- package/docs/components/stat-tile.md +49 -0
- package/docs/components/stepper.md +27 -0
- package/docs/components/surface.md +152 -0
- package/docs/components/tabbox.md +33 -0
- package/docs/components/table-view.md +43 -0
- package/docs/components/table.md +232 -0
- package/docs/components/tag-picker.md +39 -0
- package/docs/components/timebox.md +16 -0
- package/docs/components/toggle.md +21 -0
- package/docs/components/tokens.md +82 -0
- package/docs/components/toolbar.md +26 -0
- package/docs/components/tooltip.md +16 -0
- package/docs/components/tree.md +48 -0
- package/docs/components/truncate.md +21 -0
- package/docs/components/value-list.md +14 -0
- package/docs/components/view-settings.md +56 -0
- package/docs/components/workspace-switcher.md +42 -0
- package/docs/components/zeyos.md +196 -0
- package/docs/llms-small.txt +299 -0
- package/docs/llms.md +697 -100
- package/docs/llms.txt +46 -19
- package/package.json +9 -4
- package/src/components/activity-item/activity-item.js +21 -2
- package/src/components/agent-avatar/agent-avatar.css +195 -0
- package/src/components/agent-avatar/agent-avatar.js +333 -0
- package/src/components/agent-avatar/agent-face.js +292 -0
- package/src/components/agent-thread/ag-ui.js +44 -11
- package/src/components/agent-thread/agent-thread.js +103 -11
- package/src/components/agent-thread/ui-message-stream.js +3 -1
- package/src/components/app-rail/app-rail.css +5 -0
- package/src/components/app-sidebar/app-sidebar.css +3 -0
- package/src/components/app-sidebar/app-sidebar.js +4 -3
- package/src/components/approval-card/approval-card.css +6 -0
- package/src/components/approval-card/approval-card.js +55 -7
- package/src/components/aurora/aurora.css +149 -14
- package/src/components/aurora/aurora.js +49 -6
- package/src/components/calendar/calendar.css +6 -2
- package/src/components/calendar/calendar.js +127 -47
- package/src/components/card-view/card-view.js +5 -6
- package/src/components/chart/chart.css +159 -1
- package/src/components/chart/chart.js +450 -62
- package/src/components/chart/color.js +297 -0
- package/src/components/chart/svg-adapter.js +576 -0
- package/src/components/chart/svg-geometry.js +323 -0
- package/src/components/check-button/check-button.js +3 -18
- package/src/components/checklist/checklist.js +46 -17
- package/src/components/checklist/field-adapter.js +4 -1
- package/src/components/code-editor/code-editor.css +33 -0
- package/src/components/code-editor/code-editor.js +97 -8
- package/src/components/code-editor/field-adapter.js +3 -0
- package/src/components/composer/composer.css +3 -0
- package/src/components/composer/composer.js +100 -22
- package/src/components/context-menu/context-menu.js +41 -5
- package/src/components/copy/copy-button.js +9 -1
- package/src/components/copy/copy-input.js +5 -0
- package/src/components/data-filter/filter-core.js +0 -1
- package/src/components/date-picker/date-picker.css +8 -0
- package/src/components/date-picker/date-picker.js +47 -8
- package/src/components/date-picker/date-range-picker.js +1 -1
- package/src/components/date-picker/month-picker.js +19 -3
- package/src/components/date-picker/time-picker.js +54 -19
- package/src/components/datebox/date-range-box.js +7 -3
- package/src/components/datebox/datebox.js +32 -6
- package/src/components/dialog/dialog.css +6 -0
- package/src/components/dialog/dialog.js +22 -30
- package/src/components/dropdown/dropdown.js +1 -18
- package/src/components/empty-state/empty-state.js +21 -2
- package/src/components/field/field.js +19 -3
- package/src/components/fieldset/fieldset.js +3 -1
- package/src/components/filter/filter.js +9 -0
- package/src/components/form/form.js +19 -2
- package/src/components/kanban-view/kanban-card.js +15 -2
- package/src/components/kanban-view/kanban-view.css +21 -0
- package/src/components/kanban-view/kanban-view.js +29 -16
- package/src/components/launcher/launcher.css +14 -0
- package/src/components/launcher/launcher.js +54 -9
- package/src/components/master-panel/master-panel.js +24 -22
- package/src/components/menu-button/menu-button.js +26 -4
- package/src/components/message/message.css +228 -29
- package/src/components/message/message.js +664 -30
- package/src/components/modal/modal.js +70 -25
- package/src/components/modal/native-dialog.js +91 -0
- package/src/components/module-bar/module-bar.css +3 -0
- package/src/components/module-bar/module-bar.js +17 -4
- package/src/components/multi-value-editor/multi-value-editor.css +7 -2
- package/src/components/multi-value-editor/multi-value-editor.js +3 -2
- package/src/components/navigation-bar/navigation-bar.js +13 -1
- package/src/components/number-field/field-adapter.js +3 -0
- package/src/components/number-field/number-field.js +2 -1
- package/src/components/pagination/pagination.css +26 -2
- package/src/components/pagination/pagination.js +551 -65
- package/src/components/prose/prose.js +7 -1
- package/src/components/rating/field-adapter.js +3 -0
- package/src/components/run-status/run-status.js +43 -3
- package/src/components/run-trace/run-trace.js +15 -7
- package/src/components/search/search.js +3 -18
- package/src/components/select/field-adapter.js +8 -1
- package/src/components/select/select.js +68 -13
- package/src/components/sheet/sheet.js +27 -8
- package/src/components/slider/field-adapter.js +3 -0
- package/src/components/slider/slider.js +4 -6
- package/src/components/stat-tile/stat-tile.js +24 -9
- package/src/components/stepper/stepper.css +15 -0
- package/src/components/stepper/stepper.js +34 -2
- package/src/components/surface/catalog.js +185 -28
- package/src/components/surface/surface.js +10 -5
- package/src/components/tabbox/tabbox.js +13 -1
- package/src/components/table/table.css +160 -2
- package/src/components/table/table.js +479 -52
- package/src/components/table/window.js +46 -4
- package/src/components/table-view/table-view.js +1 -10
- package/src/components/tag-picker/field-adapter.js +3 -0
- package/src/components/tag-picker/tag-picker.js +2 -0
- package/src/components/timebox/field-adapter.js +3 -0
- package/src/components/toggle/toggle.js +51 -27
- package/src/components/tooltip/tooltip.js +21 -14
- package/src/components/tree/tree.js +87 -14
- package/src/components/truncate/truncate.js +21 -5
- package/src/components/value-list/value-list.js +37 -9
- package/src/components/view-settings/view-settings.js +1 -5
- package/src/core/component.js +34 -2
- package/src/core/date.js +5 -4
- package/src/core/drag-axis.js +24 -7
- package/src/core/export.js +4 -4
- package/src/core/fontawesome.js +34 -3
- package/src/core/format.js +3 -1
- package/src/core/http.js +23 -11
- package/src/core/icons.js +51 -10
- package/src/core/keyboard.js +83 -9
- package/src/core/messages.js +3 -0
- package/src/core/position.js +2 -2
- package/src/core/storage.js +80 -31
- package/src/core/util.js +16 -5
- package/src/elements/define.js +82 -47
- package/src/elements/kit.js +46 -35
- package/src/index.js +8 -4
- package/src/internal/agent-model.js +152 -0
- package/src/internal/app-rail.js +53 -2
- package/src/internal/collections.js +25 -0
- package/src/internal/menu-items.js +59 -0
- package/src/internal/overlay-content.js +35 -0
- package/src/internal/presence-loop.js +61 -14
- package/src/locales/de.js +3 -0
- package/src/zeyos/calendar.js +81 -19
- package/src/zeyos/connect.js +5 -1
- package/src/zeyos/form.js +29 -10
- package/src/zeyos/select.js +36 -12
- package/src/zeyos/table.js +43 -11
- package/src/zeyos/view.js +2 -1
- package/styles/tokens/semantic.css +7 -1
- package/styles/zx.css +1 -0
package/src/zeyos/calendar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { translate } from '../core/i18n.js';
|
|
2
2
|
import { Calendar, calendarDayDifference } from '../index.js';
|
|
3
|
-
import { dateToUnixSeconds, unixSecondsToDate } from './query.js';
|
|
3
|
+
import { calendarDayToUnixSeconds, calendarZone, dateToUnixSeconds, unixSecondsToDate } from './query.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {Object} ZeyosCalendarOptions
|
|
@@ -13,29 +13,58 @@ import { dateToUnixSeconds, unixSecondsToDate } from './query.js';
|
|
|
13
13
|
* @property {number} [weekStart=1] User-preferred first weekday.
|
|
14
14
|
* @property {boolean} [workweek=false] Show five days in week view.
|
|
15
15
|
* @property {(event: CustomEvent<Record<string, any>>) => void} [oneventchange] Persistence listener.
|
|
16
|
+
* @property {string} [timeZone] IANA time zone of the ZeyOS instance. An appointment running from
|
|
17
|
+
* midnight to midnight in this zone is all-day and shows on the calendar days it names there, for a
|
|
18
|
+
* viewer in any zone; defaults to the runtime's own zone.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {Object} ZeyosCalendarZoneOptions
|
|
23
|
+
* @property {string} [timeZone] IANA time zone of the ZeyOS instance; the runtime's own zone when
|
|
24
|
+
* omitted.
|
|
16
25
|
*/
|
|
17
26
|
|
|
18
27
|
/**
|
|
19
28
|
* Maps one expanded ZeyOS appointment/event row to the product-neutral Calendar shape. Occurrence
|
|
20
29
|
* identity includes the start timestamp because recurring rows intentionally share their base ID;
|
|
21
|
-
* persistence callers keep using `event.data.ID`.
|
|
30
|
+
* persistence callers keep using `event.data.ID`. A row without an `allDay` flag is all-day when it
|
|
31
|
+
* runs from midnight to midnight, at least a day apart, in `options.timeZone`; with a zone given,
|
|
32
|
+
* an all-day row's start and end become local midnight of the calendar days they name there.
|
|
22
33
|
* @param {Record<string, any>} record ZeyOS row.
|
|
34
|
+
* @param {ZeyosCalendarZoneOptions} [options={}] Instance time zone.
|
|
23
35
|
* @returns {Record<string, any>} Generic Calendar event.
|
|
36
|
+
* @throws {RangeError} When `options.timeZone` names a zone the runtime does not know.
|
|
24
37
|
*/
|
|
25
|
-
export function zeyosAppointmentToEvent(record) {
|
|
38
|
+
export function zeyosAppointmentToEvent(record, options = {}) {
|
|
26
39
|
if (!record || typeof record !== 'object' || Array.isArray(record)) {
|
|
27
40
|
throw new TypeError('ZeyOS appointment must be an object');
|
|
28
41
|
}
|
|
29
42
|
const baseId = record.ID ?? record.id;
|
|
30
43
|
if (baseId == null || baseId === '') throw new TypeError('ZeyOS appointment requires ID');
|
|
31
|
-
const
|
|
32
|
-
const
|
|
44
|
+
const timeZone = options?.timeZone;
|
|
45
|
+
const zone = timeZone == null || timeZone === '' ? null : calendarZone(timeZone);
|
|
46
|
+
let start = unixSecondsToDate(record.datefrom);
|
|
47
|
+
let end = unixSecondsToDate(record.dateto ?? record.datefrom);
|
|
33
48
|
if (!(start instanceof Date) || !(end instanceof Date)) throw new TypeError('ZeyOS appointment requires datefrom and dateto');
|
|
34
49
|
const association = String(record.assoc_name ?? '').trim();
|
|
35
50
|
const name = String(record.name ?? '').trim() || translate('zeyosCalendar.untitled');
|
|
36
51
|
const title = record.entity && association ? `${association}: ${name}` : name;
|
|
37
|
-
|
|
38
|
-
|
|
52
|
+
let allDay;
|
|
53
|
+
if (zone) {
|
|
54
|
+
// Midnight is read in the instance's zone, not the viewer's, and an all-day row is shown on
|
|
55
|
+
// the days it names there.
|
|
56
|
+
const startDay = zoneMidnightDay(start, zone);
|
|
57
|
+
const endDay = zoneMidnightDay(end, zone);
|
|
58
|
+
allDay = record.allDay != null ? Boolean(record.allDay)
|
|
59
|
+
: Boolean(startDay && endDay && calendarDayDifference(startDay, endDay) >= 1);
|
|
60
|
+
if (allDay && startDay && endDay) {
|
|
61
|
+
start = startDay;
|
|
62
|
+
end = endDay;
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
allDay = record.allDay != null ? Boolean(record.allDay)
|
|
66
|
+
: isMidnight(start) && isMidnight(end) && calendarDayDifference(start, end) >= 1;
|
|
67
|
+
}
|
|
39
68
|
return {
|
|
40
69
|
id: String(record.occurrenceid ?? `${baseId}@${record.datefrom}`),
|
|
41
70
|
title,
|
|
@@ -50,27 +79,44 @@ export function zeyosAppointmentToEvent(record) {
|
|
|
50
79
|
};
|
|
51
80
|
}
|
|
52
81
|
|
|
53
|
-
/**
|
|
54
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Maps expanded ZeyOS appointment/event rows with {@link zeyosAppointmentToEvent}.
|
|
84
|
+
* @param {Record<string, any>[]} records ZeyOS rows.
|
|
85
|
+
* @param {ZeyosCalendarZoneOptions} [options={}] Instance time zone.
|
|
86
|
+
* @returns {Record<string, any>[]} Generic Calendar events.
|
|
87
|
+
*/
|
|
88
|
+
export function zeyosAppointmentsToEvents(records, options = {}) {
|
|
55
89
|
if (!Array.isArray(records)) throw new TypeError('ZeyOS appointments must be an array');
|
|
56
|
-
return records.map(zeyosAppointmentToEvent);
|
|
90
|
+
return records.map((record) => zeyosAppointmentToEvent(record, options));
|
|
57
91
|
}
|
|
58
92
|
|
|
59
93
|
/**
|
|
60
94
|
* Converts a proposed Calendar occurrence back to the current ZeyOS appointment update fields.
|
|
61
95
|
* The base appointment identifier remains the source record's `ID`; date values become Unix
|
|
62
|
-
* seconds and the adapter never adds recurrence or DAV fields.
|
|
63
|
-
*
|
|
96
|
+
* seconds and the adapter never adds recurrence or DAV fields. With `options.timeZone`, an all-day
|
|
97
|
+
* event's days are stored as midnight in that zone, the way {@link zeyosAppointmentToEvent} reads
|
|
98
|
+
* them.
|
|
99
|
+
* @param {{start: Date, end: Date, allDay?: boolean, data?: Record<string, any>}} event Calendar event proposal.
|
|
100
|
+
* @param {ZeyosCalendarZoneOptions} [options={}] Instance time zone.
|
|
64
101
|
* @returns {{ID?: unknown, datefrom: number|null, dateto: number|null}}
|
|
102
|
+
* @throws {RangeError} When the event is all-day and `options.timeZone` names a zone the runtime
|
|
103
|
+
* does not know.
|
|
65
104
|
*/
|
|
66
|
-
export function calendarEventToZeyosPatch(event) {
|
|
105
|
+
export function calendarEventToZeyosPatch(event, options = {}) {
|
|
67
106
|
if (!event || !(event.start instanceof Date) || !(event.end instanceof Date)) {
|
|
68
107
|
throw new TypeError('Calendar event patch requires start and end Dates');
|
|
69
108
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
109
|
+
const timeZone = options?.timeZone;
|
|
110
|
+
const days = event.allDay === true && timeZone != null && timeZone !== '';
|
|
111
|
+
const patch = days
|
|
112
|
+
? {
|
|
113
|
+
datefrom: calendarDayToUnixSeconds(event.start, timeZone),
|
|
114
|
+
dateto: calendarDayToUnixSeconds(event.end, timeZone)
|
|
115
|
+
}
|
|
116
|
+
: {
|
|
117
|
+
datefrom: dateToUnixSeconds(event.start),
|
|
118
|
+
dateto: dateToUnixSeconds(event.end)
|
|
119
|
+
};
|
|
74
120
|
if (event.data?.ID != null) return { ID: event.data.ID, ...patch };
|
|
75
121
|
return patch;
|
|
76
122
|
}
|
|
@@ -82,14 +128,14 @@ export function calendarEventToZeyosPatch(event) {
|
|
|
82
128
|
* @returns {Record<string, any>} Plain Calendar options.
|
|
83
129
|
*/
|
|
84
130
|
export function buildZeyosCalendarOptions(options = {}) {
|
|
85
|
-
const { appointments, ...calendarOptions } = options;
|
|
131
|
+
const { appointments, timeZone, ...calendarOptions } = options;
|
|
86
132
|
return {
|
|
87
133
|
weekStart: 1,
|
|
88
134
|
optimistic: true,
|
|
89
135
|
...calendarOptions,
|
|
90
136
|
events: appointments == null
|
|
91
137
|
? (Array.isArray(calendarOptions.events) ? calendarOptions.events : [])
|
|
92
|
-
: zeyosAppointmentsToEvents(appointments)
|
|
138
|
+
: zeyosAppointmentsToEvents(appointments, { timeZone })
|
|
93
139
|
};
|
|
94
140
|
}
|
|
95
141
|
|
|
@@ -114,3 +160,19 @@ function zeyosCalendarColor(value) {
|
|
|
114
160
|
function isMidnight(date) {
|
|
115
161
|
return date.getHours() === 0 && date.getMinutes() === 0 && date.getSeconds() === 0 && date.getMilliseconds() === 0;
|
|
116
162
|
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Local midnight of the calendar day an instant names in `zone`, or null when the instant is not
|
|
166
|
+
* that day's midnight there.
|
|
167
|
+
* @param {Date} date Instant.
|
|
168
|
+
* @param {import('./query.js').CalendarZone} zone Instance zone.
|
|
169
|
+
* @returns {Date|null}
|
|
170
|
+
*/
|
|
171
|
+
function zoneMidnightDay(date, zone) {
|
|
172
|
+
const { year, month, day } = zone.dayOf(date.getTime());
|
|
173
|
+
if (zone.midnightOf(year, month, day) !== date.getTime()) return null;
|
|
174
|
+
const local = new Date(2000, 0, 1);
|
|
175
|
+
local.setFullYear(year, month, day);
|
|
176
|
+
local.setHours(0, 0, 0, 0);
|
|
177
|
+
return local;
|
|
178
|
+
}
|
package/src/zeyos/connect.js
CHANGED
|
@@ -3,6 +3,8 @@ import { Message, setLanguage } from '../index.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef {Object} ConnectOptions
|
|
5
5
|
* @property {(error: unknown, context?: {operation?: string, resource?: string}) => unknown} [onError] Error reporter.
|
|
6
|
+
* Every failed helper call reaches it, including one for a resource with no matching operation;
|
|
7
|
+
* `context.operation` is the operation id, or the action (`list`, `get`, …) when none was found.
|
|
6
8
|
* @property {string} [locale] BCP 47 locale applied to Zx i18n/date formatting.
|
|
7
9
|
*/
|
|
8
10
|
/**
|
|
@@ -38,8 +40,10 @@ export function connect(client, { onError, locale } = {}) {
|
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
const invoke = async (action, resource, input) => {
|
|
41
|
-
|
|
43
|
+
// Resolving the operation is part of the request: a resource without one is reported too.
|
|
44
|
+
let operation = action;
|
|
42
45
|
try {
|
|
46
|
+
operation = operationFor(client, action, resource);
|
|
43
47
|
return await client.api[operation](input);
|
|
44
48
|
} catch (error) {
|
|
45
49
|
try { reportError(error, { operation, resource }); } catch { /* Preserve the API failure. */ }
|
package/src/zeyos/form.js
CHANGED
|
@@ -45,8 +45,12 @@ import { buildZeyosSelectConfig } from './select.js';
|
|
|
45
45
|
/**
|
|
46
46
|
* @typedef {Object} ZeyosFormBinding
|
|
47
47
|
* @property {Form} form Generated Zx form.
|
|
48
|
-
* @property {Promise<Record<string, unknown>|null>} ready Initial value/load readiness.
|
|
49
|
-
*
|
|
48
|
+
* @property {Promise<Record<string, unknown>|null>} ready Initial value/load readiness. It rejects
|
|
49
|
+
* when the initial load fails (reported like any failed request); left unawaited, that rejection is
|
|
50
|
+
* not reported a second time as unhandled.
|
|
51
|
+
* @property {(id: unknown) => Promise<Record<string, unknown>>} load Loads and maps one record. Only
|
|
52
|
+
* the latest call shows its record and becomes the one `save()` updates: an earlier call that
|
|
53
|
+
* settles later still resolves with its record, but leaves the form alone.
|
|
50
54
|
* @property {() => Promise<Record<string, unknown>|null>} save Validates and creates or updates the
|
|
51
55
|
* record, then confirms with a toast in the form's scope unless `notify` is false.
|
|
52
56
|
* @property {() => Form} getForm Returns the generated Zx Form.
|
|
@@ -109,7 +113,7 @@ export function buildZeyosFormConfig(client, resource, opts = {}) {
|
|
|
109
113
|
/**
|
|
110
114
|
* Generates a schema-driven Zx Form and a small async binding object. `load(id)` hydrates entity
|
|
111
115
|
* labels and converts Unix seconds to Date objects. `save()` validates, maps values back to API
|
|
112
|
-
* storage types, calls create/update through the
|
|
116
|
+
* storage types, calls create/update through the `connect()` facade, invokes
|
|
113
117
|
* `onSaved(record)`, and shows a success toast. Its toasts — that confirmation and the report of a
|
|
114
118
|
* failed request — appear in the theme scope of `opts.scope` or of the form itself, and
|
|
115
119
|
* `notify: false` silences them. Await `ready` when `opts.id` or `opts.value` is supplied.
|
|
@@ -134,29 +138,41 @@ export function zeyosForm(client, resource, opts = {}) {
|
|
|
134
138
|
let currentId = opts.value?.ID ?? opts.id ?? null;
|
|
135
139
|
let destroyed = false;
|
|
136
140
|
let savePending = null;
|
|
141
|
+
// Each load or value application takes a number; only the latest may write to the form.
|
|
142
|
+
let loadSequence = 0;
|
|
137
143
|
|
|
138
|
-
|
|
144
|
+
/**
|
|
145
|
+
* @param {Record<string, unknown>} record Record to show.
|
|
146
|
+
* @param {number} [mine] This application's sequence number.
|
|
147
|
+
* @param {unknown} [id] Record id that becomes `currentId` once the record is shown.
|
|
148
|
+
*/
|
|
149
|
+
const applyRecord = async (record, mine = ++loadSequence, id = undefined) => {
|
|
139
150
|
if (!record || typeof record !== 'object' || Array.isArray(record)) {
|
|
140
151
|
throw new TypeError('ZeyOS form value must be a record');
|
|
141
152
|
}
|
|
142
|
-
|
|
143
|
-
|
|
153
|
+
const current = () => !destroyed && mine === loadSequence;
|
|
154
|
+
await Promise.all(config.entityFields.map(async ({ id: fieldId, resource: referencedResource }) => {
|
|
155
|
+
const value = record[fieldId];
|
|
144
156
|
if (value == null) return;
|
|
145
157
|
const selected = value && typeof value === 'object'
|
|
146
158
|
? value
|
|
147
159
|
: normalizeRecord(await facade.get(referencedResource, value));
|
|
148
|
-
|
|
160
|
+
if (!current()) return;
|
|
161
|
+
const select = Select.from(form.getField(fieldId)?.getInput());
|
|
149
162
|
if (select instanceof Select) select.setItems([selected]);
|
|
150
163
|
}));
|
|
151
|
-
if (!
|
|
164
|
+
if (!current()) return record;
|
|
165
|
+
if (id !== undefined) currentId = id;
|
|
166
|
+
form.setValues(config.mapFromRecord(record), { silent: true });
|
|
152
167
|
return record;
|
|
153
168
|
};
|
|
154
169
|
|
|
155
170
|
const load = async (id) => {
|
|
156
171
|
if (id == null || id === '') throw new TypeError('zeyosForm.load() requires an id');
|
|
172
|
+
const mine = ++loadSequence;
|
|
157
173
|
const record = normalizeRecord(await facade.get(resource, id));
|
|
158
|
-
|
|
159
|
-
await applyRecord(record);
|
|
174
|
+
if (destroyed || mine !== loadSequence) return record;
|
|
175
|
+
await applyRecord(record, mine, record.ID ?? id);
|
|
160
176
|
return record;
|
|
161
177
|
};
|
|
162
178
|
|
|
@@ -203,6 +219,9 @@ export function zeyosForm(client, resource, opts = {}) {
|
|
|
203
219
|
const ready = Object.prototype.hasOwnProperty.call(opts, 'id')
|
|
204
220
|
? load(opts.id)
|
|
205
221
|
: (opts.value ? applyRecord(opts.value) : Promise.resolve(null));
|
|
222
|
+
// `ready` stays rejectable for callers that await it; this observer keeps a failure nobody awaits
|
|
223
|
+
// (already reported through `onError`) from surfacing again as an unhandled rejection.
|
|
224
|
+
void ready.catch(() => {});
|
|
206
225
|
|
|
207
226
|
return {
|
|
208
227
|
form,
|
package/src/zeyos/select.js
CHANGED
|
@@ -81,7 +81,10 @@ export function buildZeyosSelectConfig(client, resource, opts = {}) {
|
|
|
81
81
|
/**
|
|
82
82
|
* Creates an async Zx Select backed by the injected client's generated list operation. A non-null
|
|
83
83
|
* initial id is hydrated through the resource get operation; await `select.ready` when code must
|
|
84
|
-
* wait for that label before presenting the control.
|
|
84
|
+
* wait for that label before presenting the control. A selection made while that lookup runs wins
|
|
85
|
+
* over the initial id, and a select destroyed meanwhile is left alone. `ready` rejects when the
|
|
86
|
+
* lookup fails (reported through `connect()` like any failed request); left unawaited, that
|
|
87
|
+
* rejection is not reported a second time as unhandled.
|
|
85
88
|
* @param {Record<string, any>} client Injected ZeyOS client instance.
|
|
86
89
|
* @param {string} resource Resource name such as `accounts`.
|
|
87
90
|
* @param {ZeyosSelectOptions} [opts={}] Query and Select options.
|
|
@@ -183,7 +186,7 @@ export function buildZeyosEntitySelectConfig(client, resource, opts = {}) {
|
|
|
183
186
|
|
|
184
187
|
/**
|
|
185
188
|
* Creates a ZeyOS Entity-box preset. Await `select.ready` when a non-null initial ID must be
|
|
186
|
-
* hydrated before presentation.
|
|
189
|
+
* hydrated before presentation; it settles like {@link zeyosSelect}'s.
|
|
187
190
|
* @param {Record<string, any>} client Injected ZeyOS client instance.
|
|
188
191
|
* @param {string} resource Resource name.
|
|
189
192
|
* @param {Record<string, any>} [opts={}] Entity Select options.
|
|
@@ -221,16 +224,37 @@ function normalizeLocalListResult(result) {
|
|
|
221
224
|
return Number.isFinite(count) ? { data, count } : { data };
|
|
222
225
|
}
|
|
223
226
|
|
|
224
|
-
/**
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Shows the initial id's record once it has loaded. A selection made meanwhile — by the user or by
|
|
229
|
+
* code — wins, and a select destroyed meanwhile is left alone. The returned promise still rejects
|
|
230
|
+
* for a caller that awaits it; an internal observer keeps an unawaited failure, which `connect()`
|
|
231
|
+
* already reported, from becoming an unhandled rejection.
|
|
232
|
+
* @param {Select} select @param {Record<string, any>} client @param {string} resource @param {unknown} value
|
|
233
|
+
* @returns {Promise<Select>}
|
|
234
|
+
*/
|
|
235
|
+
function hydrateInitialValue(select, client, resource, value) {
|
|
236
|
+
const ready = (async () => {
|
|
237
|
+
if (value == null) return select;
|
|
238
|
+
const initial = select.value;
|
|
239
|
+
let changed = false;
|
|
240
|
+
const onChange = () => { changed = true; };
|
|
241
|
+
select.on('change', onChange);
|
|
242
|
+
try {
|
|
243
|
+
const record = value && typeof value === 'object'
|
|
244
|
+
? value
|
|
245
|
+
: await connect(client).get(resource, value);
|
|
246
|
+
const normalized = normalizeRecord(record);
|
|
247
|
+
// The component registry forgets a destroyed select.
|
|
248
|
+
if (changed || !Object.is(select.value, initial) || Select.from(select.el) !== select) return select;
|
|
249
|
+
select.setItems([normalized]);
|
|
250
|
+
select.set(normalized, { silent: true });
|
|
251
|
+
return select;
|
|
252
|
+
} finally {
|
|
253
|
+
select.off('change', onChange);
|
|
254
|
+
}
|
|
255
|
+
})();
|
|
256
|
+
void ready.catch(() => {});
|
|
257
|
+
return ready;
|
|
234
258
|
}
|
|
235
259
|
|
|
236
260
|
/** @param {unknown} result @returns {Record<string, unknown>} */
|
package/src/zeyos/table.js
CHANGED
|
@@ -95,7 +95,8 @@ const TABLE_OPTION_KEYS = [
|
|
|
95
95
|
* @property {(options?: ZeyosTableLoadOptions) => Promise<ZeyosTableLoadResult>} load Loads/reloads a server page.
|
|
96
96
|
* @property {(search: string) => Promise<ZeyosTableLoadResult>} setSearch Replaces search and reloads page zero.
|
|
97
97
|
* @property {(filters: Record<string, unknown>) => Promise<ZeyosTableLoadResult>} setFilters Replaces predicates and reloads page zero.
|
|
98
|
-
* @property {() => Promise<ZeyosTableLoadResult>} loadMore Appends the next page when available
|
|
98
|
+
* @property {() => Promise<ZeyosTableLoadResult>} loadMore Appends the next page when available;
|
|
99
|
+
* sends nothing while a page-zero reload (a new search, filter, or sort) is still in flight.
|
|
99
100
|
* @property {number|null} count Current server count.
|
|
100
101
|
* @property {number} page Current zero-based page.
|
|
101
102
|
* @property {number} pageSize Current server page size.
|
|
@@ -134,12 +135,14 @@ const TABLE_OPTION_KEYS = [
|
|
|
134
135
|
* @property {(options?: ZeyosTableLoadOptions) => {page: number, pageSize: number, filters: Record<string, unknown>, search: string}} check
|
|
135
136
|
* Validates load options without applying them; throws what `load()` would reject with.
|
|
136
137
|
* @property {() => Promise<ZeyosTableLoadResult>} loadMore Appends the next page when available,
|
|
137
|
-
* else resolves without a request
|
|
138
|
+
* else resolves without a request — also while a page-zero or `replace` load is still in flight,
|
|
139
|
+
* whose rows the next page of the old query would otherwise land on.
|
|
138
140
|
* @property {(sort: {id: string, dir: 'asc'|'desc'}|null) => void} setSort Replaces the sort used
|
|
139
141
|
* by the next load.
|
|
140
142
|
* @property {(state: {filters?: unknown, search?: unknown}) => void} setQuery Replaces filters and
|
|
141
143
|
* search without loading.
|
|
142
|
-
* @property {() => void} reset Forgets the loaded page, count, and `hasMore`.
|
|
144
|
+
* @property {() => void} reset Forgets the loaded page, count, and `hasMore`. A request still in
|
|
145
|
+
* flight is returned to its caller but no longer renders, and the loading state is cleared.
|
|
143
146
|
* @property {() => void} destroy Stops rendering: in-flight responses are ignored, later loads reject.
|
|
144
147
|
* @property {boolean} destroyed Whether `destroy()` ran.
|
|
145
148
|
* @property {number|null} count Current server count.
|
|
@@ -154,7 +157,7 @@ const TABLE_OPTION_KEYS = [
|
|
|
154
157
|
/**
|
|
155
158
|
* Builds the DOM-free schema-derived columns and Table options used by {@link zeyosTable}. Entity
|
|
156
159
|
* projections include an `<field>_label` alias from a real label field on the referenced resource.
|
|
157
|
-
* Amount fields use each row's real `currency` value for display while retaining the
|
|
160
|
+
* Amount fields use each row's real `currency` value for display while retaining the typed
|
|
158
161
|
* column strategy and right alignment. Enum columns show labels, date-only columns calendar days in
|
|
159
162
|
* `timeZone`, and Table presentation options and listeners pass through to `tableOptions`.
|
|
160
163
|
* @param {Record<string, any>} client Injected ZeyOS client instance.
|
|
@@ -281,7 +284,9 @@ export function zeyosTable(client, resource, opts = {}) {
|
|
|
281
284
|
* the rows, a higher page appends them — and keeps `count`, `page`, and `hasMore`.
|
|
282
285
|
*
|
|
283
286
|
* Only the newest request may render: an older one that resolves late is returned to its caller
|
|
284
|
-
* but never touches the target
|
|
287
|
+
* but never touches the target, and `reset()` retires every request in flight the same way. While
|
|
288
|
+
* a page-zero or `replace` load is pending, `loadMore()` sends nothing: the rows on screen belong to
|
|
289
|
+
* the previous query. After `destroy()` nothing renders at all — a response that arrives
|
|
285
290
|
* afterwards is ignored, the loading state is left alone — and further loads reject.
|
|
286
291
|
*
|
|
287
292
|
* Validation is strict and the same for both bindings: a page must be a non-negative integer and a
|
|
@@ -301,6 +306,9 @@ export function createServerPager(options) {
|
|
|
301
306
|
let count = null;
|
|
302
307
|
let more = false;
|
|
303
308
|
let sequence = 0;
|
|
309
|
+
// Sequence number of the replacing load in flight, or 0; `loading` mirrors what the target shows.
|
|
310
|
+
let replacing = 0;
|
|
311
|
+
let loading = false;
|
|
304
312
|
let destroyed = false;
|
|
305
313
|
|
|
306
314
|
const query = (forPage) => buildListQuery({
|
|
@@ -332,19 +340,23 @@ export function createServerPager(options) {
|
|
|
332
340
|
// binding exactly as it was: no page size or search half-applied ahead of a bad filter.
|
|
333
341
|
const next = check(request);
|
|
334
342
|
const nextPage = next.page;
|
|
335
|
-
pageSize
|
|
343
|
+
// The size this request is sent with; a later load may change `pageSize` before it returns.
|
|
344
|
+
const size = next.pageSize;
|
|
345
|
+
pageSize = size;
|
|
336
346
|
filters = next.filters;
|
|
337
347
|
search = next.search;
|
|
338
348
|
const replace = nextPage === 0 || request.replace === true;
|
|
339
349
|
const sent = query(nextPage);
|
|
340
350
|
const mine = ++sequence;
|
|
351
|
+
if (replace) replacing = mine;
|
|
352
|
+
loading = true;
|
|
341
353
|
target.setLoading(true);
|
|
342
354
|
try {
|
|
343
355
|
const normalized = normalizeZeyosListResult(client, await facade.list(resource, sent));
|
|
344
356
|
const total = normalized.count ?? null;
|
|
345
357
|
const hasMore = total == null
|
|
346
|
-
? normalized.data.length ===
|
|
347
|
-
: nextPage *
|
|
358
|
+
? normalized.data.length === size
|
|
359
|
+
: nextPage * size + normalized.data.length < total;
|
|
348
360
|
if (!destroyed && mine === sequence) {
|
|
349
361
|
page = nextPage;
|
|
350
362
|
count = total;
|
|
@@ -353,15 +365,25 @@ export function createServerPager(options) {
|
|
|
353
365
|
else target.addData(normalized.data);
|
|
354
366
|
}
|
|
355
367
|
return { data: normalized.data, count: total, page: nextPage, hasMore, query: sent };
|
|
368
|
+
} catch (error) {
|
|
369
|
+
// A failed replacement leaves the previous query's rows on screen while the query already
|
|
370
|
+
// names the new one: appending to them would mix the two, so paging waits for a replacement
|
|
371
|
+
// that succeeds.
|
|
372
|
+
if (replace && !destroyed && mine === sequence) more = false;
|
|
373
|
+
throw error;
|
|
356
374
|
} finally {
|
|
357
|
-
if (
|
|
375
|
+
if (replacing === mine) replacing = 0;
|
|
376
|
+
if (!destroyed && mine === sequence) {
|
|
377
|
+
loading = false;
|
|
378
|
+
target.setLoading(false);
|
|
379
|
+
}
|
|
358
380
|
}
|
|
359
381
|
};
|
|
360
382
|
|
|
361
383
|
return {
|
|
362
384
|
load,
|
|
363
385
|
check,
|
|
364
|
-
loadMore: () => more ? load({ page: page + 1 }) : (destroyed
|
|
386
|
+
loadMore: () => more && !replacing ? load({ page: page + 1 }) : (destroyed
|
|
365
387
|
? Promise.reject(new Error(`${label} binding has been destroyed`))
|
|
366
388
|
: Promise.resolve({ data: [], count, page, hasMore: false, query: query(page) })),
|
|
367
389
|
setSort: (next) => { sort = next ?? null; },
|
|
@@ -371,7 +393,17 @@ export function createServerPager(options) {
|
|
|
371
393
|
if (Object.prototype.hasOwnProperty.call(state, 'search')) search = String(state.search ?? '');
|
|
372
394
|
filters = nextFilters;
|
|
373
395
|
},
|
|
374
|
-
reset: () => {
|
|
396
|
+
reset: () => {
|
|
397
|
+
// Retire every request in flight: a response for the query being replaced must not render
|
|
398
|
+
// over the new state, and none of them is left to clear the loading state.
|
|
399
|
+
sequence += 1;
|
|
400
|
+
replacing = 0;
|
|
401
|
+
page = 0;
|
|
402
|
+
count = null;
|
|
403
|
+
more = false;
|
|
404
|
+
if (loading && !destroyed) target.setLoading(false);
|
|
405
|
+
loading = false;
|
|
406
|
+
},
|
|
375
407
|
destroy: () => {
|
|
376
408
|
if (destroyed) return;
|
|
377
409
|
destroyed = true;
|
package/src/zeyos/view.js
CHANGED
|
@@ -108,7 +108,8 @@ import { buildZeyosTableConfig, createServerPager } from './table.js';
|
|
|
108
108
|
* @property {(options?:ZeyosViewLoadOptions)=>Promise<ZeyosViewLoadResult>} load Loads a page.
|
|
109
109
|
* @property {(search:string)=>Promise<ZeyosViewLoadResult>} setSearch Replaces search and reloads.
|
|
110
110
|
* @property {(filters:Record<string,unknown>)=>Promise<ZeyosViewLoadResult>} setFilters Replaces filters and reloads.
|
|
111
|
-
* @property {()=>Promise<ZeyosViewLoadResult>} loadMore Loads the next page when available
|
|
111
|
+
* @property {()=>Promise<ZeyosViewLoadResult>} loadMore Loads the next page when available; sends
|
|
112
|
+
* nothing while a page-zero reload (a new search, filter, or sort) is still in flight.
|
|
112
113
|
* @property {number|null} count Current server count.
|
|
113
114
|
* @property {number} page Current zero-based page.
|
|
114
115
|
* @property {number} pageSize Current server page size.
|
|
@@ -160,6 +160,9 @@
|
|
|
160
160
|
--zx-color-text-chrome: color-mix(in srgb, var(--zx-color-text-muted) 70%, var(--zx-color-text));
|
|
161
161
|
--zx-color-app-icon-glyph: var(--zx-gray-0);
|
|
162
162
|
--zx-color-app-icon-shade: var(--zx-gray-950);
|
|
163
|
+
/* AgentAvatar's eyes on a solid tone: a white and a pupil ink that do not flip with the theme. */
|
|
164
|
+
--zx-color-agent-eye: var(--zx-gray-0);
|
|
165
|
+
--zx-color-agent-pupil: var(--zx-gray-950);
|
|
163
166
|
--zx-color-app-icon-depth: color-mix(in srgb, var(--zx-color-app-icon-shade) 26%, transparent);
|
|
164
167
|
/* White on the 600 accent in light, near-black on the 400 in dark: the ramp promise in
|
|
165
168
|
tokens/themes.css is what keeps both legible. */
|
|
@@ -358,7 +361,7 @@
|
|
|
358
361
|
color-mix(in srgb, var(--zx-color-glass-lift) 15%, transparent) 18%, transparent 45%),
|
|
359
362
|
radial-gradient(120% 70% at 100% 100%, color-mix(in srgb, var(--zx-color-accent) 4%, transparent), transparent 62%),
|
|
360
363
|
linear-gradient(var(--zx-color-glass-shade), var(--zx-color-glass-shade));
|
|
361
|
-
/*
|
|
364
|
+
/* The toast's own body, so a theme can set it apart; the kind shows in the toast's icon. */
|
|
362
365
|
--zx-overlay-toast-image: var(--zx-overlay-surface-image);
|
|
363
366
|
--zx-overlay-panel-image: linear-gradient(180deg, var(--zx-color-glass-lift) 0%,
|
|
364
367
|
color-mix(in srgb, var(--zx-color-glass-lift) 15%, transparent) 16%, transparent 40%),
|
|
@@ -398,6 +401,9 @@
|
|
|
398
401
|
--zx-color-text-invert: var(--zx-gray-50);
|
|
399
402
|
--zx-color-app-icon-glyph: var(--zx-gray-0);
|
|
400
403
|
--zx-color-app-icon-shade: var(--zx-gray-950);
|
|
404
|
+
/* AgentAvatar's eyes on a solid tone: a white and a pupil ink that do not flip with the theme. */
|
|
405
|
+
--zx-color-agent-eye: var(--zx-gray-0);
|
|
406
|
+
--zx-color-agent-pupil: var(--zx-gray-950);
|
|
401
407
|
--zx-color-accent: var(--zx-accent-600);
|
|
402
408
|
--zx-color-accent-hover: var(--zx-accent-700);
|
|
403
409
|
--zx-color-accent-active: var(--zx-accent-700);
|
package/styles/zx.css
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
@import url("../src/components/app-icon/app-icon.css");
|
|
28
28
|
@import url("../src/components/launcher/launcher.css");
|
|
29
29
|
@import url("../src/components/avatar/avatar.css");
|
|
30
|
+
@import url("../src/components/agent-avatar/agent-avatar.css");
|
|
30
31
|
@import url("../src/components/entity-ref/entity-ref.css");
|
|
31
32
|
@import url("../src/components/file-item/file-item.css");
|
|
32
33
|
@import url("../src/components/file-list/file-list.css");
|