@cosmicdrift/kumiko-renderer 0.406.0 → 0.410.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/dist/app/action-form-body.js +23 -8
- package/dist/app/action-form-support.d.ts +7 -0
- package/dist/app/action-form-support.js +14 -1
- package/dist/app/config-edit-action-row.d.ts +7 -0
- package/dist/app/config-edit-action-row.js +45 -0
- package/dist/app/config-edit-body.js +32 -4
- package/dist/app/entity-list-screen.js +8 -11
- package/dist/app/nav.js +2 -1
- package/dist/app/projection-detail-body.js +3 -1
- package/dist/app/projection-detail-header.d.ts +1 -0
- package/dist/app/projection-detail-header.js +1 -1
- package/dist/app/projection-detail-navigation.d.ts +2 -1
- package/dist/app/projection-detail-navigation.js +6 -3
- package/dist/app/projection-detail-shim.js +3 -1
- package/dist/app/projection-list-render-props.d.ts +1 -1
- package/dist/app/projection-list-render-props.js +4 -2
- package/dist/app/projection-list-render.js +1 -1
- package/dist/app/screen-access.js +4 -2
- package/dist/app/screen-shared.d.ts +3 -2
- package/dist/app/screen-shared.js +30 -2
- package/dist/app/use-embedded-screen.d.ts +2 -0
- package/dist/app/use-embedded-screen.js +7 -1
- package/dist/components/edit-mounts.d.ts +3 -1
- package/dist/components/edit-mounts.js +3 -3
- package/dist/components/related-list-section.d.ts +3 -1
- package/dist/components/related-list-section.js +2 -2
- package/dist/components/render-edit-field-grid.d.ts +2 -2
- package/dist/components/render-edit-field-grid.js +12 -4
- package/dist/components/render-edit-fields-section.js +6 -7
- package/dist/components/render-edit-helpers.d.ts +4 -0
- package/dist/components/render-edit-helpers.js +5 -0
- package/dist/components/render-edit-section-kinds.js +6 -4
- package/dist/components/render-edit-submit.js +18 -1
- package/dist/components/render-edit-titles.js +6 -6
- package/dist/components/render-edit-types.d.ts +6 -0
- package/dist/components/render-field-control.d.ts +2 -0
- package/dist/components/render-field-control.js +23 -1
- package/dist/components/render-field-write-only.d.ts +1 -1
- package/dist/components/render-field-write-only.js +12 -2
- package/dist/components/render-field.js +2 -1
- package/dist/components/use-render-edit-sections.js +4 -4
- package/dist/format-when.d.ts +1 -1
- package/dist/format-when.js +2 -2
- package/dist/headless/format/escape.js +3 -2
- package/dist/headless/view-model/edit.js +0 -2
- package/dist/headless/view-model/types.d.ts +0 -3
- package/dist/i18n-defaults.js +38 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/primitives.d.ts +30 -7
- package/dist/primitives.js +1 -51
- package/dist/status-tone.d.ts +6 -0
- package/dist/status-tone.js +51 -0
- package/dist/toggle-set-member.d.ts +1 -0
- package/dist/toggle-set-member.js +8 -0
- package/dist/web/app/dashboard-header.js +5 -1
- package/dist/web/app/dashboard-screen-tiles.js +19 -3
- package/dist/web/icons.d.ts +2 -0
- package/dist/web/icons.js +3 -1
- package/dist/web/index.d.ts +3 -2
- package/dist/web/index.js +2 -1
- package/dist/web/layout/default-app-shell.d.ts +4 -1
- package/dist/web/layout/default-app-shell.js +5 -2
- package/dist/web/layout/focus-aware-sidebar.d.ts +27 -0
- package/dist/web/layout/focus-aware-sidebar.js +23 -0
- package/dist/web/layout/focus-rail.d.ts +16 -0
- package/dist/web/layout/focus-rail.js +61 -0
- package/dist/web/layout/nav-tree.d.ts +2 -1
- package/dist/web/layout/nav-tree.js +3 -9
- package/dist/web/layout/shell-focus.d.ts +19 -0
- package/dist/web/layout/shell-focus.js +35 -0
- package/dist/web/layout/shell-header.d.ts +1 -1
- package/dist/web/layout/shell-header.js +12 -9
- package/dist/web/layout/sidebar-brand.js +1 -1
- package/dist/web/layout/workspace-shell.d.ts +4 -1
- package/dist/web/layout/workspace-shell.js +5 -2
- package/dist/web/primitives/banner.js +3 -1
- package/dist/web/primitives/data-table/toolbar.js +2 -2
- package/dist/web/primitives/default-form.js +12 -5
- package/dist/web/primitives/field.js +4 -1
- package/dist/web/primitives/input-text-kinds.js +8 -2
- package/dist/web/primitives/layout-elements.js +2 -4
- package/dist/web/primitives/tabs.d.ts +1 -1
- package/dist/web/primitives/tabs.js +21 -4
- package/dist/web/theme-plugin.d.ts +1 -1
- package/dist/web/theme-plugin.js +7 -0
- package/dist/web/ui/sidebar.js +5 -2
- package/dist/web/widgets/ai-text-end-action.d.ts +12 -0
- package/dist/web/widgets/ai-text-end-action.js +15 -0
- package/dist/web/widgets/ai-text-field.d.ts +3 -0
- package/dist/web/widgets/ai-text-field.js +4 -3
- package/dist/web/widgets/attachment-card.d.ts +6 -0
- package/dist/web/widgets/attachment-card.js +11 -0
- package/dist/web/widgets/attachment-chip.d.ts +8 -0
- package/dist/web/widgets/attachment-chip.js +21 -0
- package/dist/web/widgets/clamped-text.d.ts +11 -0
- package/dist/web/widgets/clamped-text.js +38 -0
- package/dist/web/widgets/html-mail-frame.d.ts +17 -0
- package/dist/web/widgets/html-mail-frame.js +56 -0
- package/dist/web/widgets/index.d.ts +10 -1
- package/dist/web/widgets/index.js +9 -1
- package/dist/web/widgets/infinity-list.d.ts +3 -1
- package/dist/web/widgets/infinity-list.js +2 -2
- package/dist/web/widgets/message-body-view.d.ts +10 -0
- package/dist/web/widgets/message-body-view.js +36 -0
- package/dist/web/widgets/message-reader.d.ts +4 -0
- package/dist/web/widgets/message-reader.js +31 -0
- package/dist/web/widgets/message-thread.d.ts +5 -0
- package/dist/web/widgets/message-thread.js +66 -0
- package/dist/web/widgets/message-types.d.ts +68 -0
- package/dist/web/widgets/message-types.js +1 -0
- package/dist/web/widgets/mobile-top-bar.d.ts +21 -0
- package/dist/web/widgets/mobile-top-bar.js +8 -0
- package/dist/web/widgets/pdf-document.d.ts +19 -0
- package/dist/web/widgets/pdf-document.js +70 -0
- package/dist/web/widgets/pdf-page.d.ts +35 -0
- package/dist/web/widgets/pdf-page.js +155 -0
- package/dist/web/widgets/pdf-preview.d.ts +27 -7
- package/dist/web/widgets/pdf-preview.js +21 -133
- package/dist/web/widgets/pdf-search.d.ts +43 -0
- package/dist/web/widgets/pdf-search.js +178 -0
- package/dist/web/widgets/pdf-thumbnails.d.ts +10 -0
- package/dist/web/widgets/pdf-thumbnails.js +35 -0
- package/dist/web/widgets/pdf-viewer-toolbar.d.ts +22 -0
- package/dist/web/widgets/pdf-viewer-toolbar.js +35 -0
- package/dist/web/widgets/pdf-viewer.d.ts +21 -0
- package/dist/web/widgets/pdf-viewer.js +176 -0
- package/dist/web/widgets/quoted-text.d.ts +16 -0
- package/dist/web/widgets/quoted-text.js +76 -0
- package/dist/web/widgets/status-badge.js +3 -1
- package/dist/web/widgets/step-list-fit.d.ts +25 -0
- package/dist/web/widgets/step-list-fit.js +79 -0
- package/dist/web/widgets/step-list-row.d.ts +50 -0
- package/dist/web/widgets/step-list-row.js +97 -0
- package/dist/web/widgets/step-list.d.ts +33 -0
- package/dist/web/widgets/step-list.js +36 -0
- package/dist/web/widgets/surfaces.d.ts +23 -0
- package/dist/web/widgets/surfaces.js +15 -0
- package/dist/web/widgets/use-in-view.d.ts +5 -0
- package/dist/web/widgets/use-in-view.js +18 -0
- package/package.json +5 -5
- package/src/changes.json +192 -0
- package/src/web/styles.css +22 -0
|
@@ -98,7 +98,7 @@ function pickEmptyStateText(emptyState, record) {
|
|
|
98
98
|
return undefined;
|
|
99
99
|
return (emptyState.variants?.find((variant) => evalFieldCondition(variant.when, record)) ?? emptyState);
|
|
100
100
|
}
|
|
101
|
-
export function RelatedListSection({ section, parentId, record, featureName, translate, hideTitle, grow, onOpenDrawer, actions, embedded, onAfterWrite, refreshToken, }) {
|
|
101
|
+
export function RelatedListSection({ section, parentId, record, featureName, translate, hideTitle, grow, onOpenDrawer, actions, anchorId, embedded, onAfterWrite, refreshToken, }) {
|
|
102
102
|
const { Banner, Section, Card, FillContainer, Text, Button, Dialog } = usePrimitives();
|
|
103
103
|
const [emptyStateActionError, setEmptyStateActionError] = useState(null);
|
|
104
104
|
const t = useTranslation();
|
|
@@ -343,5 +343,5 @@ export function RelatedListSection({ section, parentId, record, featureName, tra
|
|
|
343
343
|
if (hideTitle) {
|
|
344
344
|
return (_jsxs(_Fragment, { children: [bridges, FillContainer !== undefined ? (_jsx(FillContainer, { ...(grow === true && { grow: true }), children: content })) : (content)] }));
|
|
345
345
|
}
|
|
346
|
-
return (_jsxs(_Fragment, { children: [bridges, _jsx(Section, { title: section.title, ...(actions !== undefined && { actions }), testId: `related-list-${section.title}`, children: content })] }));
|
|
346
|
+
return (_jsxs(_Fragment, { children: [bridges, _jsx(Section, { title: section.title, ...(anchorId !== undefined && { id: anchorId }), ...(actions !== undefined && { actions }), testId: `related-list-${section.title}`, children: content })] }));
|
|
347
347
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import type { EditFieldViewModel, FormValues } from "../headless/index.ts";
|
|
3
3
|
import type { FieldsSection, RenderEditModel } from "./render-edit-render-model.ts";
|
|
4
|
-
export declare function renderFieldGrid<TValues extends FormValues, TCtx>(model: RenderEditModel<TValues, TCtx>, section: FieldsSection, fields: readonly EditFieldViewModel[], columns: number, gridKey: string
|
|
4
|
+
export declare function renderFieldGrid<TValues extends FormValues, TCtx>(model: RenderEditModel<TValues, TCtx>, section: FieldsSection, fields: readonly EditFieldViewModel[], columns: number, gridKey: string): ReactNode;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
2
3
|
import { GridCellForField } from "./grid-cell-for-field.js";
|
|
3
4
|
function appendixCellProps(props, fieldName) {
|
|
4
5
|
const { labelAppendix, fieldAppendix, fieldAppendixPlacement, fieldDescription } = props;
|
|
@@ -33,10 +34,17 @@ function createFieldCellRenderer(model, section, columns) {
|
|
|
33
34
|
}), GridCell: GridCell, featureName: props.featureName, ...appendixCellProps(props, field.field), allIssues: snapshot.errors, valueDisplay: props.valueDisplay, row: snapshot.values, ...(disabled && { fillDisabled: true }), ...(props.hideSectionTitles !== true &&
|
|
34
35
|
section.title !== undefined && { sectionTitle: section.title }), ...(showsChangedMarker && field.field in snapshot.changes && { changed: true }) }, field.field));
|
|
35
36
|
}
|
|
36
|
-
export function renderFieldGrid(model, section, fields, columns, gridKey
|
|
37
|
-
const { Grid } = model.engine.state.primitives;
|
|
37
|
+
export function renderFieldGrid(model, section, fields, columns, gridKey) {
|
|
38
|
+
const { Grid, GridCell } = model.engine.state.primitives;
|
|
39
|
+
const { rowAfterField } = model.engine.props;
|
|
40
|
+
const dirty = Object.keys(model.engine.form.snapshot.changes).length > 0;
|
|
38
41
|
const { isSettingsList } = model.footer;
|
|
39
42
|
const { usesFieldFlow } = model.titles;
|
|
40
43
|
const renderCell = createFieldCellRenderer(model, section, columns);
|
|
41
|
-
return (_jsx(Grid, { columns:
|
|
44
|
+
return (_jsx(Grid, { columns: columns, ...(isSettingsList ? { list: true } : usesFieldFlow && { flow: true }), children: fields.map((field) => {
|
|
45
|
+
const extraRow = rowAfterField?.(field.field, { dirty });
|
|
46
|
+
if (extraRow === undefined)
|
|
47
|
+
return renderCell(field);
|
|
48
|
+
return (_jsxs(Fragment, { children: [renderCell(field), _jsx(GridCell, { span: columns, children: extraRow })] }, field.field));
|
|
49
|
+
}) }, gridKey));
|
|
42
50
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { renderAllRequiredHint } from "./render-edit-banners.js";
|
|
3
3
|
import { renderFieldGrid } from "./render-edit-field-grid.js";
|
|
4
|
-
import {
|
|
4
|
+
import { sectionNavAnchorId } from "./render-edit-helpers.js";
|
|
5
5
|
function renderTabbedGroupsSection(rc, section, sectionKey) {
|
|
6
6
|
const { Grid, Card } = rc.model.engine.state.primitives;
|
|
7
|
-
const groupsGrid = (_jsx(Grid, { columns: 1, children: section.groups?.map((group, groupIndex) => (_jsx(Card, { slots: { title: group.title }, testId: `section-${sectionKey}-group-${groupIndex}`, children: renderFieldGrid(rc.model, section, group.fields, group.columns, `${sectionKey}-group-${groupIndex}-grid
|
|
7
|
+
const groupsGrid = (_jsx(Grid, { columns: 1, children: section.groups?.map((group, groupIndex) => (_jsx(Card, { slots: { title: group.title }, testId: `section-${sectionKey}-group-${groupIndex}`, children: renderFieldGrid(rc.model, section, group.fields, group.columns, `${sectionKey}-group-${groupIndex}-grid`) }, group.title))) }, `${sectionKey}-groups`));
|
|
8
8
|
// `actions` on a `groups` section has no group of its own to
|
|
9
9
|
// sit in and would need an extra title-less Card around the
|
|
10
10
|
// group cards (Card-in-Card) — the boot-validator rejects that
|
|
@@ -26,7 +26,7 @@ function renderTabbedFieldsSection(rc, section, sectionKey) {
|
|
|
26
26
|
...(section.description !== undefined && { subtitle: section.description }),
|
|
27
27
|
...(sectionActionsEl !== undefined && { headerActions: sectionActionsEl }),
|
|
28
28
|
},
|
|
29
|
-
}), testId: `section-${sectionKey}`, children: renderFieldGrid(rc.model, section, section.fields, section.columns, `${sectionKey}-grid
|
|
29
|
+
}), testId: `section-${sectionKey}`, children: renderFieldGrid(rc.model, section, section.fields, section.columns, `${sectionKey}-grid`) }, sectionKey));
|
|
30
30
|
return rc.wrapWizardStep(sectionKey, cardEl);
|
|
31
31
|
}
|
|
32
32
|
// Suppress the section header when it would just repeat the form
|
|
@@ -48,14 +48,13 @@ function resolveSectionSubtitle({ model, sectionIndex }, section) {
|
|
|
48
48
|
function renderDefaultFieldsSection(rc, section, sectionKey) {
|
|
49
49
|
const { model, sectionIndex, sectionActionsEl } = rc;
|
|
50
50
|
const { Section } = model.engine.state.primitives;
|
|
51
|
+
const anchorId = sectionNavAnchorId(model.titles.sectionNavItems, sectionIndex);
|
|
51
52
|
const sectionTitle = resolveSectionTitle(rc, section);
|
|
52
53
|
const sectionSubtitle = resolveSectionSubtitle(rc, section);
|
|
53
|
-
const sectionEl = (_jsxs(Section, { ...(
|
|
54
|
-
id: formSectionDomId(sectionIndex),
|
|
55
|
-
}), ...(sectionTitle !== undefined && { title: sectionTitle }), ...(sectionSubtitle !== undefined && { subtitle: sectionSubtitle }), ...(section.icon !== undefined && { icon: section.icon }), ...(sectionActionsEl !== undefined && { actions: sectionActionsEl }), ...(model.footer.isSettingsList && { layout: "settings-list" }), testId: `section-${sectionKey}`, children: [model.engine.sections.showsAllRequiredHint &&
|
|
54
|
+
const sectionEl = (_jsxs(Section, { ...(anchorId !== undefined && { id: anchorId }), ...(sectionTitle !== undefined && { title: sectionTitle }), ...(sectionSubtitle !== undefined && { subtitle: sectionSubtitle }), ...(section.icon !== undefined && { icon: section.icon }), ...(sectionActionsEl !== undefined && { actions: sectionActionsEl }), ...(model.footer.isSettingsList && { layout: "settings-list" }), testId: `section-${sectionKey}`, children: [model.engine.sections.showsAllRequiredHint &&
|
|
56
55
|
model.engine.state.insideDrawer &&
|
|
57
56
|
sectionIndex === 0 &&
|
|
58
|
-
renderAllRequiredHint(model), renderFieldGrid(model, section, section.fields, section.columns, `${sectionKey}-grid
|
|
57
|
+
renderAllRequiredHint(model), renderFieldGrid(model, section, section.fields, section.columns, `${sectionKey}-grid`)] }, sectionKey));
|
|
59
58
|
return rc.wrapWizardStep(sectionKey, sectionEl);
|
|
60
59
|
}
|
|
61
60
|
export function renderFieldsSection(rc, section) {
|
|
@@ -23,6 +23,10 @@ export declare function wizardStepKey(section: EditSectionViewModel, index: numb
|
|
|
23
23
|
export declare function isFieldsStepFilled(section: FieldsSectionViewModel, parse: DryRunParse | undefined): boolean;
|
|
24
24
|
export type FormErrorSource = "submit" | "delete";
|
|
25
25
|
export declare function formSectionDomId(sectionIndex: number): string;
|
|
26
|
+
/** The scroll-anchor id of a section, only when the "on this page" navigation lists it. */
|
|
27
|
+
export declare function sectionNavAnchorId(sectionNavItems: readonly {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
}[], sectionIndex: number): string | undefined;
|
|
26
30
|
/** A record title is a non-blank string; anything else leaves the screen title alone. */
|
|
27
31
|
export declare function resolveRecordTitle(value: unknown): string | undefined;
|
|
28
32
|
export declare function resolveTitleTemplate(template: string | undefined, values: FormValues, translate: Translate, fallback: string): string;
|
|
@@ -100,6 +100,11 @@ export function isFieldsStepFilled(section, parse) {
|
|
|
100
100
|
export function formSectionDomId(sectionIndex) {
|
|
101
101
|
return `form-section-${sectionIndex}`;
|
|
102
102
|
}
|
|
103
|
+
/** The scroll-anchor id of a section, only when the "on this page" navigation lists it. */
|
|
104
|
+
export function sectionNavAnchorId(sectionNavItems, sectionIndex) {
|
|
105
|
+
const id = formSectionDomId(sectionIndex);
|
|
106
|
+
return sectionNavItems.some((item) => item.id === id) ? id : undefined;
|
|
107
|
+
}
|
|
103
108
|
/** A record title is a non-blank string; anything else leaves the screen title alone. */
|
|
104
109
|
export function resolveRecordTitle(value) {
|
|
105
110
|
return typeof value === "string" && value.trim() !== "" ? value : undefined;
|
|
@@ -3,14 +3,15 @@ import { ExtensionSectionMount } from "./edit-mounts.js";
|
|
|
3
3
|
import { RelatedListSection } from "./related-list-section.js";
|
|
4
4
|
import { RenderEditActionButton } from "./render-edit-action-button.js";
|
|
5
5
|
import { renderFieldsSection } from "./render-edit-fields-section.js";
|
|
6
|
-
import { wizardStepKey } from "./render-edit-helpers.js";
|
|
6
|
+
import { sectionNavAnchorId, wizardStepKey } from "./render-edit-helpers.js";
|
|
7
7
|
import { resolveExtensionEntityId } from "./render-edit-logic.js";
|
|
8
8
|
import { WriteFormSection } from "./write-form-section.js";
|
|
9
9
|
function renderExtensionSection({ model, sectionIndex, sectionActionsEl, wrapWizardStep }, section) {
|
|
10
10
|
const { props, state, form, draft, sections } = model.engine;
|
|
11
11
|
const { hideSectionTitles } = props;
|
|
12
12
|
const { Card } = state.primitives;
|
|
13
|
-
const
|
|
13
|
+
const anchorId = sectionNavAnchorId(model.titles.sectionNavItems, sectionIndex);
|
|
14
|
+
const mount = (_jsx(ExtensionSectionMount, { ...(anchorId !== undefined && { anchorId }), section: section, entityName: sections.vm.entityName, entityId: resolveExtensionEntityId(props.entityId, sections.vm.id), initialValues: props.extensionInitialValues, values: form.snapshot.values, patch: model.patchForExtension, validate: draft.scopedValidate, markSaved: draft.markSaved, hideTitle: hideSectionTitles, ...(state.isWizard &&
|
|
14
15
|
!state.isCreateMode && {
|
|
15
16
|
stepKey: wizardStepKey(section, sectionIndex),
|
|
16
17
|
onReportStepComplete: state.reportExtensionStepComplete,
|
|
@@ -26,7 +27,7 @@ function renderExtensionSection({ model, sectionIndex, sectionActionsEl, wrapWiz
|
|
|
26
27
|
}), children: mount }, section.title));
|
|
27
28
|
return wrapWizardStep(section.title, wrapped);
|
|
28
29
|
}
|
|
29
|
-
function renderRelatedListSection({ model, sectionActionsEl }, section) {
|
|
30
|
+
function renderRelatedListSection({ model, sectionIndex, sectionActionsEl }, section) {
|
|
30
31
|
const { props, form, sections } = model.engine;
|
|
31
32
|
const { hideSectionTitles, fillScreenHeight, refreshToken, onRelatedListDrawerAction } = props;
|
|
32
33
|
// parentId is the displayed record's id — without it there's no
|
|
@@ -35,7 +36,8 @@ function renderRelatedListSection({ model, sectionActionsEl }, section) {
|
|
|
35
36
|
const parentId = resolveExtensionEntityId(props.entityId, sections.vm.id);
|
|
36
37
|
if (parentId === null)
|
|
37
38
|
return null;
|
|
38
|
-
const
|
|
39
|
+
const anchorId = sectionNavAnchorId(model.titles.sectionNavItems, sectionIndex);
|
|
40
|
+
const mount = (_jsx(RelatedListSection, { ...(anchorId !== undefined && { anchorId }), section: section, parentId: parentId,
|
|
39
41
|
// @cast-boundary form-values: TValues is structurally a Record.
|
|
40
42
|
record: form.snapshot.values, featureName: props.featureName, translate: model.engine.state.translate, hideTitle: hideSectionTitles, ...(refreshToken !== undefined && { refreshToken }), ...(fillScreenHeight === true && { grow: true }), ...(hideSectionTitles !== true &&
|
|
41
43
|
sectionActionsEl !== undefined && { actions: sectionActionsEl }), ...(onRelatedListDrawerAction !== undefined && {
|
|
@@ -43,6 +43,21 @@ export function createHandleSubmit(engine) {
|
|
|
43
43
|
};
|
|
44
44
|
return blocked;
|
|
45
45
|
}
|
|
46
|
+
// A typed secret was just written; keeping the plaintext in form state would
|
|
47
|
+
// leave it readable in memory and re-sendable. Back to the write-only wire
|
|
48
|
+
// shape "set" (true), so the field shows the masked row again.
|
|
49
|
+
function dropSavedSecrets() {
|
|
50
|
+
const values = controller.getSnapshot().values;
|
|
51
|
+
const saved = {};
|
|
52
|
+
for (const [name, def] of Object.entries(props.entity.fields)) {
|
|
53
|
+
if ("writeOnly" in def && def.writeOnly === true && typeof values[name] === "string") {
|
|
54
|
+
if (values[name] !== "")
|
|
55
|
+
saved[name] = true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (Object.keys(saved).length > 0)
|
|
59
|
+
controller.setValues({ ...values, ...saved });
|
|
60
|
+
}
|
|
46
61
|
// Enter in the active step triggers the native form submit (Next is
|
|
47
62
|
// type="submit" for Enter support) — on intermediate steps that means
|
|
48
63
|
// "Next", not "Save". Checked BEFORE the `disabled` guard below:
|
|
@@ -87,8 +102,10 @@ export function createHandleSubmit(engine) {
|
|
|
87
102
|
let result = customSubmit !== undefined ? blockedCustomSubmitResult() : undefined;
|
|
88
103
|
if (result === undefined && customSubmit !== undefined) {
|
|
89
104
|
result = await customSubmit(controller.getSnapshot());
|
|
90
|
-
if (result.isSuccess)
|
|
105
|
+
if (result.isSuccess) {
|
|
106
|
+
dropSavedSecrets();
|
|
91
107
|
controller.rebase();
|
|
108
|
+
}
|
|
92
109
|
}
|
|
93
110
|
else if (result === undefined) {
|
|
94
111
|
result = await controller.submit();
|
|
@@ -31,12 +31,12 @@ function resolveFormSubtitle(hideSectionTitles, explicitSubtitle, descriptionSub
|
|
|
31
31
|
return explicitSubtitle !== descriptionSubtitle ? explicitSubtitle : undefined;
|
|
32
32
|
}
|
|
33
33
|
function sectionNavItemsFor(section, index, formTitle) {
|
|
34
|
-
const
|
|
35
|
-
section.
|
|
36
|
-
section.
|
|
37
|
-
|
|
38
|
-
return
|
|
39
|
-
? [{ id: formSectionDomId(index), title
|
|
34
|
+
const isListed = section.kind === "relatedList" ||
|
|
35
|
+
section.kind === "extension" ||
|
|
36
|
+
(section.kind === "fields" && section.visible);
|
|
37
|
+
const title = section.title;
|
|
38
|
+
return isListed && title !== undefined && title !== formTitle
|
|
39
|
+
? [{ id: formSectionDomId(index), title }]
|
|
40
40
|
: [];
|
|
41
41
|
}
|
|
42
42
|
function deriveSectionNavItems(filteredSections, formTitle) {
|
|
@@ -112,6 +112,12 @@ export type RenderEditProps<TValues extends FormValues, TCtx = unknown> = {
|
|
|
112
112
|
readonly fieldAppendixPlacement?: "above-control" | "below-control";
|
|
113
113
|
/** Per-field help text rendered under the label (translated by the caller). */
|
|
114
114
|
readonly fieldDescription?: (fieldName: string) => ReactNode | undefined;
|
|
115
|
+
/** Extra full-width row drawn right after a field's cell (configEdit actions). `dirty` is true
|
|
116
|
+
* while the form has unsaved changes. Called with the field name, returns a ReactNode or
|
|
117
|
+
* undefined. */
|
|
118
|
+
readonly rowAfterField?: (fieldName: string, state: {
|
|
119
|
+
readonly dirty: boolean;
|
|
120
|
+
}) => ReactNode | undefined;
|
|
115
121
|
/** Marks fields whose value is set at this level; drawn by `settings-list` rows. */
|
|
116
122
|
readonly fieldAccent?: (fieldName: string) => boolean;
|
|
117
123
|
/** Edit-mode "changed" markers also for screens without an entity id
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { EditFieldViewModel, FieldIssue } from "../headless/index.ts";
|
|
3
|
+
import type { usePrimitives } from "../primitives.tsx";
|
|
3
4
|
import type { RenderInputArgs } from "./render-field-input-shared.ts";
|
|
4
5
|
export type ControlContext = RenderInputArgs & {
|
|
6
|
+
readonly Link: ReturnType<typeof usePrimitives>["Link"];
|
|
5
7
|
readonly readOnlyText: boolean;
|
|
6
8
|
readonly featureName: string | undefined;
|
|
7
9
|
readonly allIssues: Readonly<Record<string, readonly FieldIssue[]>> | undefined;
|
|
@@ -55,10 +55,32 @@ const selectAvailabilityRule = (ctx) => {
|
|
|
55
55
|
return undefined;
|
|
56
56
|
return (_jsx(AvailabilityOptionsSelect, { field: field, query: source.query, payload: source.payload, row: rowOf(ctx), id: id, hasError: hasError, onChange: onChange }));
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
// Only digits and a leading "+" survive into the tel: href, so a stored
|
|
59
|
+
// "+49 (30) 123-45" dials but can never smuggle other URI parts.
|
|
60
|
+
function telHrefDigits(value) {
|
|
61
|
+
const digits = value.replace(/[^\d]/g, "");
|
|
62
|
+
return value.trim().startsWith("+") ? `+${digits}` : digits;
|
|
63
|
+
}
|
|
64
|
+
function contactHref(field) {
|
|
65
|
+
if (field.type !== "text" || typeof field.value !== "string" || field.value.trim() === "") {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
if (field.format === "email")
|
|
69
|
+
return `mailto:${field.value.trim()}`;
|
|
70
|
+
if (field.format === "phone") {
|
|
71
|
+
const digits = telHrefDigits(field.value);
|
|
72
|
+
return digits.replace("+", "") === "" ? undefined : `tel:${digits}`;
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const readOnlyTextRule = ({ field, Text, Link, appLocale, t, readOnlyText }) => {
|
|
59
77
|
if (!readOnlyText || isComplexFieldType(field.type) || isFileFieldType(field.type)) {
|
|
60
78
|
return undefined;
|
|
61
79
|
}
|
|
80
|
+
const href = contactHref(field);
|
|
81
|
+
if (href !== undefined) {
|
|
82
|
+
return (_jsx(Link, { href: href, className: "underline", testId: `field-value-${field.field}`, children: readOnlyDisplayText(field, appLocale, t) }));
|
|
83
|
+
}
|
|
62
84
|
return (_jsx(Text, { testId: `field-value-${field.field}`, children: readOnlyDisplayText(field, appLocale, t) }));
|
|
63
85
|
};
|
|
64
86
|
const writeOnlyRule = ({ field, id, hasError, onChange, changed, readOnlyText }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import type { EditFieldViewModel } from "../headless/index.ts";
|
|
3
3
|
export declare function WriteOnlyTextInput({ field, id, hasError, onChange, changed, }: {
|
|
4
4
|
readonly field: EditFieldViewModel;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
2
3
|
import { useTranslation } from "../i18n.js";
|
|
3
4
|
import { usePrimitives } from "../primitives.js";
|
|
4
5
|
// Wire value of a writeOnly field is `true` (set) / `null` (empty), never the
|
|
@@ -6,10 +7,19 @@ import { usePrimitives } from "../primitives.js";
|
|
|
6
7
|
// nothing / "" which the server reads as "keep". `null` after a loaded `true`
|
|
7
8
|
// (changed) means "remove on save".
|
|
8
9
|
export function WriteOnlyTextInput({ field, id, hasError, onChange, changed, }) {
|
|
9
|
-
const { Input } = usePrimitives();
|
|
10
|
+
const { Input, Button, Text, Grid } = usePrimitives();
|
|
10
11
|
const t = useTranslation();
|
|
11
12
|
const isSet = field.value === true;
|
|
12
13
|
const isMarkedForRemoval = field.value === null && changed;
|
|
14
|
+
const [replacing, setReplacing] = useState(false);
|
|
15
|
+
// A save turns the wire value back into `true`; the masked row returns with it.
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (isSet)
|
|
18
|
+
setReplacing(false);
|
|
19
|
+
}, [isSet]);
|
|
20
|
+
if (isSet && !replacing && !field.readOnly) {
|
|
21
|
+
return (_jsxs(Grid, { columns: "auto", children: [_jsx(Text, { testId: `field-write-only-set-${field.field}`, children: t("kumiko.field.writeOnly.maskedSet") }), _jsx(Button, { type: "button", variant: "secondary", onClick: () => setReplacing(true), testId: `field-write-only-replace-${field.field}`, children: t("kumiko.field.writeOnly.replace") })] }));
|
|
22
|
+
}
|
|
13
23
|
if (isMarkedForRemoval) {
|
|
14
24
|
return (_jsx(Input, { kind: "password", id: id, name: field.field, disabled: true, hasError: hasError, value: "", onChange: () => { }, autoComplete: "new-password", placeholder: t("kumiko.field.writeOnly.willRemove"), testId: `field-write-only-removal-${field.field}`, trailingAction: {
|
|
15
25
|
icon: "undo",
|
|
@@ -21,7 +21,7 @@ function fieldOptionalProps({ issues, printsIssues, labelAppendix, fieldAppendix
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
export function RenderField({ field, issues, onChange, onSuggest, featureName, labelAppendix, fieldAppendix, appendixPlacement, description, status, allIssues, valueDisplay = "form", row, changed, layout, accent, fillDisabled, hideLabel, }) {
|
|
24
|
-
const { Field, Input, Banner, Text, JsonView } = usePrimitives();
|
|
24
|
+
const { Field, Input, Banner, Text, JsonView, Link } = usePrimitives();
|
|
25
25
|
// The app locale is required for money/date inputs; otherwise they fall back
|
|
26
26
|
// to navigator.language instead of the selected app language. RenderField is
|
|
27
27
|
// publicly exported and therefore requires a LocaleProvider; standalone
|
|
@@ -48,6 +48,7 @@ export function RenderField({ field, issues, onChange, onSuggest, featureName, l
|
|
|
48
48
|
appLocale,
|
|
49
49
|
Banner,
|
|
50
50
|
Text,
|
|
51
|
+
Link,
|
|
51
52
|
JsonView,
|
|
52
53
|
t,
|
|
53
54
|
readOnlyText,
|
|
@@ -49,10 +49,10 @@ function useFilteredSections(vm, fieldsFilter) {
|
|
|
49
49
|
}
|
|
50
50
|
function useAllFieldsRequired(filteredSections) {
|
|
51
51
|
return useMemo(() => {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return fillable.length > 0 && fillable.every((field) => field.required);
|
|
52
|
+
const shown = filteredSections.flatMap((section) => section.kind === "fields" ? section.fields.filter((field) => field.visible) : []);
|
|
53
|
+
const fillable = shown.filter((field) => !field.readOnly && field.type !== "boolean");
|
|
54
|
+
// A lone field carries its own required marker; "all required" only says something for several.
|
|
55
|
+
return shown.length >= 2 && fillable.length > 0 && fillable.every((field) => field.required);
|
|
56
56
|
}, [filteredSections]);
|
|
57
57
|
}
|
|
58
58
|
export function useRenderEditSections(core) {
|
package/dist/format-when.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function formatWhen(value: string): string;
|
|
1
|
+
export declare function formatWhen(value: string, locale?: string): string;
|
package/dist/format-when.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { toInstant } from "./headless/index.js";
|
|
2
2
|
// Shared timestamp formatter for operator screens (audit log, job runs) —
|
|
3
3
|
// falls back to the raw ISO string on an unparseable value instead of "Invalid Date".
|
|
4
|
-
export function formatWhen(value) {
|
|
4
|
+
export function formatWhen(value, locale) {
|
|
5
5
|
try {
|
|
6
|
-
return toInstant(value).toLocaleString();
|
|
6
|
+
return toInstant(value).toLocaleString(locale);
|
|
7
7
|
}
|
|
8
8
|
catch {
|
|
9
9
|
return value;
|
|
@@ -37,7 +37,7 @@ export function stripControlChars(value) {
|
|
|
37
37
|
}
|
|
38
38
|
return result;
|
|
39
39
|
}
|
|
40
|
-
// http(s)/mailto or scheme-less (relative/anchor) allowed; javascript:,
|
|
40
|
+
// http(s)/mailto/tel or scheme-less (relative/anchor) allowed; javascript:,
|
|
41
41
|
// data:, vbscript:, etc. rejected. Shared between renderer/web's Link
|
|
42
42
|
// primitive and page-render's server-side markdown renderer (both take
|
|
43
43
|
// untrusted tenant-authored hrefs) — no sanitizer dependency needed for a
|
|
@@ -71,5 +71,6 @@ export function isSafeHref(href) {
|
|
|
71
71
|
const trimmed = stripControlChars(decodeHtmlEntities(href)).toLowerCase();
|
|
72
72
|
if (!/^[a-z][a-z0-9+.-]*:/.test(trimmed))
|
|
73
73
|
return true;
|
|
74
|
-
|
|
74
|
+
// tel: only dials a number; USSD codes like tel:*#06# and anything with letters stay blocked.
|
|
75
|
+
return /^(?:https?|mailto):/.test(trimmed) || /^tel:\+?[\d ()./-]+$/.test(trimmed);
|
|
75
76
|
}
|
|
@@ -470,7 +470,6 @@ export function computeEditViewModel(input) {
|
|
|
470
470
|
.map((group) => ({
|
|
471
471
|
title: translate(group.title),
|
|
472
472
|
columns: group.columns ?? 2,
|
|
473
|
-
columnsDeclared: group.columns !== undefined,
|
|
474
473
|
fields: group.fields.map((fieldSpec) => {
|
|
475
474
|
const fieldName = normalizeEditField(fieldSpec).field;
|
|
476
475
|
const fieldView = fields.find((f) => f.field === fieldName);
|
|
@@ -493,7 +492,6 @@ export function computeEditViewModel(input) {
|
|
|
493
492
|
}),
|
|
494
493
|
...(sectionSpec.subtitle !== undefined && { subtitle: translate(sectionSpec.subtitle) }),
|
|
495
494
|
columns: sectionSpec.columns ?? defaultColumns,
|
|
496
|
-
columnsDeclared: sectionSpec.columns !== undefined,
|
|
497
495
|
fields,
|
|
498
496
|
...(groups !== undefined && { groups }),
|
|
499
497
|
...(sectionSpec.icon !== undefined && { icon: sectionSpec.icon }),
|
|
@@ -317,15 +317,12 @@ export type EditFieldsSectionViewModel = {
|
|
|
317
317
|
/** Translated `EditFieldsSection.subtitle` (wizard step rail / up-next box). */
|
|
318
318
|
readonly subtitle?: string;
|
|
319
319
|
readonly columns: number;
|
|
320
|
-
/** True when the author declared `columns`; false means the tabs/stacked default. */
|
|
321
|
-
readonly columnsDeclared?: boolean;
|
|
322
320
|
readonly fields: readonly EditFieldViewModel[];
|
|
323
321
|
/** From `EditFieldsSection.groups` — each entry's `fields` are the same
|
|
324
322
|
* view-model objects as `fields` above, re-grouped (not recomputed). */
|
|
325
323
|
readonly groups?: readonly {
|
|
326
324
|
readonly title: string;
|
|
327
325
|
readonly columns: number;
|
|
328
|
-
readonly columnsDeclared?: boolean;
|
|
329
326
|
readonly fields: readonly EditFieldViewModel[];
|
|
330
327
|
}[];
|
|
331
328
|
/** From `EditFieldsSection.icon` — closed IconKey vocabulary, renders
|
package/dist/i18n-defaults.js
CHANGED
|
@@ -13,6 +13,7 @@ export const kumikoDefaultTranslations = {
|
|
|
13
13
|
"kumiko.actions.delete-confirm": "Confirm delete?",
|
|
14
14
|
"kumiko.actions.reload": "Reload",
|
|
15
15
|
"kumiko.actionForm.success": "Done.",
|
|
16
|
+
"kumiko.configEdit.action.saveFirst": "Save first",
|
|
16
17
|
"kumiko.actions.retry": "Try again",
|
|
17
18
|
"kumiko.actions.create": "New",
|
|
18
19
|
"kumiko.actions.edit": "Edit",
|
|
@@ -44,6 +45,8 @@ export const kumikoDefaultTranslations = {
|
|
|
44
45
|
"kumiko.field.fillAction.failed": "Could not fetch a suggestion.",
|
|
45
46
|
"kumiko.field.writeOnly.remove": "Remove stored value",
|
|
46
47
|
"kumiko.field.writeOnly.set": "Set",
|
|
48
|
+
"kumiko.field.writeOnly.maskedSet": "•••••••••• set",
|
|
49
|
+
"kumiko.field.writeOnly.replace": "Replace",
|
|
47
50
|
"kumiko.pii.erased": "Deleted",
|
|
48
51
|
"kumiko.field.writeOnly.setPlaceholder": "Set — leave empty to keep it",
|
|
49
52
|
"kumiko.field.writeOnly.undo": "Undo",
|
|
@@ -144,6 +147,7 @@ export const kumikoDefaultTranslations = {
|
|
|
144
147
|
"kumiko.page-header.actions": "Page actions",
|
|
145
148
|
"kumiko.list.actions": "Actions",
|
|
146
149
|
"kumiko.sidebar.toggle": "Toggle sidebar",
|
|
150
|
+
"kumiko.focusRail.more": "More",
|
|
147
151
|
"kumiko.sidebar.title": "Navigation",
|
|
148
152
|
"kumiko.sidebar.description": "The app's main navigation.",
|
|
149
153
|
"kumiko.breadcrumb.label": "Breadcrumb",
|
|
@@ -231,6 +235,39 @@ export const kumikoDefaultTranslations = {
|
|
|
231
235
|
"kumiko.widget.pdf-preview.loading": "Loading PDF…",
|
|
232
236
|
"kumiko.widget.pdf-preview.pageOf": "Page {page} of {pages}",
|
|
233
237
|
"kumiko.widget.pdf-preview.renderFailed": "The PDF could not be displayed.",
|
|
238
|
+
"kumiko.widget.pdf-preview.page": "Page",
|
|
239
|
+
"kumiko.widget.pdf-preview.pageCount": "of {pages}",
|
|
240
|
+
"kumiko.widget.pdf-preview.pageInput": "Page number",
|
|
241
|
+
"kumiko.widget.pdf-preview.zoomOut": "Zoom out",
|
|
242
|
+
"kumiko.widget.pdf-preview.zoomIn": "Zoom in",
|
|
243
|
+
"kumiko.widget.pdf-preview.search": "Search in document",
|
|
244
|
+
"kumiko.widget.pdf-preview.matchCount": "Match {index} of {total}",
|
|
245
|
+
"kumiko.widget.pdf-preview.noMatch": "No match",
|
|
246
|
+
"kumiko.widget.pdf-preview.previousMatch": "Previous match",
|
|
247
|
+
"kumiko.widget.pdf-preview.nextMatch": "Next match",
|
|
248
|
+
"kumiko.widget.pdf-preview.pages": "Pages",
|
|
249
|
+
"kumiko.widget.pdf-preview.thumbnail": "Page {page}",
|
|
250
|
+
"kumiko.widget.message-thread.showMore": "Show more",
|
|
251
|
+
"kumiko.widget.message-thread.readWholeMail": "Read the whole mail",
|
|
252
|
+
"kumiko.widget.attachment-card.openOriginal": "View original",
|
|
253
|
+
"kumiko.widget.message-thread.showEarlier": "{count} earlier mails",
|
|
254
|
+
"kumiko.widget.message-thread.showEarlierOne": "1 earlier mail",
|
|
255
|
+
"kumiko.widget.message-thread.showLess": "Show less",
|
|
256
|
+
"kumiko.widget.message-thread.showQuoted": "Show quoted text ({lines} lines)",
|
|
257
|
+
"kumiko.widget.message-thread.hideQuoted": "Hide quoted text",
|
|
258
|
+
"kumiko.widget.message-thread.imagesBlocked": "HTML mail, shown sanitized. External images blocked.",
|
|
259
|
+
"kumiko.widget.message-thread.showImages": "Load images",
|
|
260
|
+
"kumiko.widget.message-reader.mail": "Mail",
|
|
261
|
+
"kumiko.widget.step-list.progress": "{done} of {total} done",
|
|
262
|
+
"kumiko.widget.step-list.progressLabel": "Progress",
|
|
263
|
+
"kumiko.widget.step-list.moreSteps": "and {count} more steps",
|
|
264
|
+
"kumiko.widget.step-list.waitingFor": "Waiting for: {reason}",
|
|
265
|
+
"kumiko.widget.step-list.statusDone": "Done",
|
|
266
|
+
"kumiko.widget.step-list.statusOpen": "Open",
|
|
267
|
+
"kumiko.widget.step-list.statusLocked": "Locked",
|
|
268
|
+
"kumiko.widget.step-list.statusRunning": "Running",
|
|
269
|
+
"kumiko.widget.step-list.statusRejected": "Rejected",
|
|
270
|
+
"kumiko.widget.step-list.statusFailed": "Failed",
|
|
234
271
|
"kumiko.widget.step-bar.done": "Done",
|
|
235
272
|
"kumiko.widget.drawer.restore": "Restore drawer width",
|
|
236
273
|
"kumiko.widget.drawer.maximize": "Maximize drawer width",
|
|
@@ -355,6 +392,7 @@ export const kumikoDefaultTranslations = {
|
|
|
355
392
|
"errors.validation.invalid_element": "Invalid entry.",
|
|
356
393
|
"errors.validation.invalid_value": "Invalid choice.",
|
|
357
394
|
"errors.validation.custom": "Invalid value.",
|
|
395
|
+
"errors.validation.onlyDeleted": "The trash list is not available here.",
|
|
358
396
|
"errors.validation.unexpected_field": "Unknown field.",
|
|
359
397
|
"errors.validation.out_of_bounds": "Value out of allowed range.",
|
|
360
398
|
"errors.validation.invalid_option": "Invalid choice.",
|
package/dist/index.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ export { InsideDrawerProvider, useInsideDrawer } from "./inside-drawer.ts";
|
|
|
88
88
|
export { hasUnsavedInput, registerUnsavedInputSource, requestLeave, setLeaveConfirmer, useUnsavedInputSource, } from "./leave-guard.ts";
|
|
89
89
|
export { LeaveGuardDialog } from "./leave-guard-dialog.tsx";
|
|
90
90
|
export { PageHeaderCompactProvider, PageHeaderSlotAvailableProvider, usePageHeaderCompact, usePageHeaderSlotAvailable, } from "./page-header-slot.ts";
|
|
91
|
-
export type { ActionMenuItemSpec, ActionOverflowMenuProps, AppPrimitives, BannerProps, BulkRowOutcome, ButtonProps, CardOptions, CardProps, CardSlots, CopyButtonProps, CorePrimitives, DataTableBulk, DataTableBulkAction, DataTableDateRangeFacet, DataTableFacet, DataTableFacetChip, DataTableProps, DataTableRowAction, DataTableRowActionMode, DataTableSort, DataTableSortDir, DialogProps, DrawerProps, EmbeddedListCellType, EmbeddedListColumn, EmbeddedListInputProps, EmbeddedListTotal, FieldCellWidth, FieldProps, FileValueListProps, FillContainerProps, FooterActionMarker, FooterActionRole, FormProps, FormSectionNavItem, FormWidth, GridCellProps, GridProps, HeadingProps, InputFillAction, InputProps, JsonViewProps, LightboxImage, LightboxProps, LinkProps, MetricBandProps, MetricProps, ModalProps, PageHeaderProps, PickedFile, PrimitivesProviderProps, PrimitivesRegistry, ProgressProps, ProgressTone, PromoPanelAction, PromoPanelProps, RuntimeRenderer, SecretRevealProps, SecretRevealValue, SectionProps, ShareButtonProps, StatusBadgeProps, StatusTone, StepBarProps, StickyActionBarProps, StickyPrimaryActionMarker, TabsProps, TextProps, TrailingInputAction, WizardStepGroupProps, } from "./primitives.tsx";
|
|
91
|
+
export type { ActionMenuItemSpec, ActionOverflowMenuProps, AppPrimitives, BannerProps, BulkRowOutcome, ButtonProps, CardOptions, CardProps, CardSlots, CopyButtonProps, CorePrimitives, DataTableBulk, DataTableBulkAction, DataTableDateRangeFacet, DataTableFacet, DataTableFacetChip, DataTableProps, DataTableRowAction, DataTableRowActionMode, DataTableSort, DataTableSortDir, DialogProps, DrawerProps, EmbeddedListCellType, EmbeddedListColumn, EmbeddedListInputProps, EmbeddedListTotal, FieldCellWidth, FieldProps, FileValueListProps, FillContainerProps, FooterActionMarker, FooterActionRole, FormProps, FormSectionNavItem, FormWidth, GridCellProps, GridProps, HeadingProps, InputEndAction, InputFillAction, InputProps, JsonViewProps, LightboxImage, LightboxProps, LinkProps, MetricBandProps, MetricProps, ModalProps, PageHeaderProps, PickedFile, PrimitivesProviderProps, PrimitivesRegistry, ProgressProps, ProgressTone, PromoPanelAction, PromoPanelProps, RuntimeRenderer, SecretRevealProps, SecretRevealValue, SectionProps, ShareButtonProps, StatusBadgeProps, StatusTone, StepBarProps, StickyActionBarProps, StickyPrimaryActionMarker, TabsProps, TextProps, TrailingInputAction, WizardStepGroupProps, } from "./primitives.tsx";
|
|
92
92
|
export { FOOTER_ACTION_ROLE_PROP, NARROW_LABEL_PROP, PrimitivesProvider, STICKY_PRIMARY_ACTION_PROP, shouldRenderActionsIconOnly, statusToneForOptionTone, statusToneForValue, useOptionalPrimitives, usePrimitives, } from "./primitives.tsx";
|
|
93
93
|
export type { SessionEndedSignal, SessionEndedSignalProviderProps, } from "./session/session-ended.tsx";
|
|
94
94
|
export { createSessionEndedSignal, isSessionEndedError, SESSION_ENDED_ERROR_CODES, SessionEndedSignalProvider, useSessionEndedSignal, withSessionEndedDetection, } from "./session/session-ended.tsx";
|
|
@@ -96,5 +96,6 @@ export { buildWhatsAppShareUrl } from "./share-links.ts";
|
|
|
96
96
|
export { sortByAccessor } from "./sort-by-accessor.ts";
|
|
97
97
|
export type { LiveEvent, LiveEventSubscriber, LiveEventsProviderProps, } from "./sse/live-events.tsx";
|
|
98
98
|
export { LIVE_RESYNC_EVENT_TYPE, LiveEventsProvider, useLiveEvents } from "./sse/live-events.tsx";
|
|
99
|
+
export { toggleSetMember } from "./toggle-set-member.ts";
|
|
99
100
|
export type { AppTokens, ColorTokens, CoreTokens, FontTokens, RadiusTokens, ShadowTokens, SpacingTokens, ThemeMode, ThemePreference, Tokens, TokensApi, TokensProviderProps, } from "./tokens.tsx";
|
|
100
101
|
export { cssVarTokens, TokensProvider, useTokenController, useTokens } from "./tokens.tsx";
|
package/dist/index.js
CHANGED
|
@@ -70,4 +70,5 @@ export { createSessionEndedSignal, isSessionEndedError, SESSION_ENDED_ERROR_CODE
|
|
|
70
70
|
export { buildWhatsAppShareUrl } from "./share-links.js";
|
|
71
71
|
export { sortByAccessor } from "./sort-by-accessor.js";
|
|
72
72
|
export { LIVE_RESYNC_EVENT_TYPE, LiveEventsProvider, useLiveEvents } from "./sse/live-events.js";
|
|
73
|
+
export { toggleSetMember } from "./toggle-set-member.js";
|
|
73
74
|
export { cssVarTokens, TokensProvider, useTokenController, useTokens } from "./tokens.js";
|
package/dist/primitives.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { DataTableTableBlock } from "./data-table-view-types.ts";
|
|
|
7
7
|
import type { EmbeddedListInputProps } from "./embedded-list-types.ts";
|
|
8
8
|
import type { FieldIssue, ListColumnViewModel, ListRowViewModel, RuntimeRenderer } from "./headless/index.ts";
|
|
9
9
|
import type { MetricBandProps, MetricProps } from "./metric-types.ts";
|
|
10
|
+
import type { StatusBadgeOptionTone, StatusTone } from "./status-tone.ts";
|
|
10
11
|
export type { EmbeddedListCellType, EmbeddedListColumn, EmbeddedListInputProps, EmbeddedListTotal, } from "./embedded-list-types.ts";
|
|
11
12
|
export type { RuntimeRenderer };
|
|
12
13
|
/** Escape hatch for `data-*` test hooks (e.g. an E2E selector) that don't
|
|
@@ -113,8 +114,10 @@ export type BannerProps = {
|
|
|
113
114
|
* placeholders (not-found, loading), "loading" for load states, "warning"
|
|
114
115
|
* for a non-blocking but attention-grabbing notice (e.g. secretMint's
|
|
115
116
|
* "this is shown only once"), "primary" for a call-to-action notice (neutral
|
|
116
|
-
* background, accent in the primary color; pair it with `title` and `actions`)
|
|
117
|
-
|
|
117
|
+
* background, accent in the primary color; pair it with `title` and `actions`),
|
|
118
|
+
* "hint" for a quiet aside on a muted background (e.g. per-entry results of
|
|
119
|
+
* a submit, with an "Open" link in `actions`). */
|
|
120
|
+
readonly variant?: "error" | "info" | "loading" | "warning" | "primary" | "hint";
|
|
118
121
|
/** Bold heading above `children`, inside the text column. */
|
|
119
122
|
readonly title?: ReactNode;
|
|
120
123
|
readonly titleTestId?: string;
|
|
@@ -178,6 +181,21 @@ export type FieldProps = {
|
|
|
178
181
|
* signature. Custom implementations can dispatch internally, render a
|
|
179
182
|
* different control (toggle instead of checkbox), or customize individual
|
|
180
183
|
* kinds. */
|
|
184
|
+
/** Button inside the right edge of a text input: an icon (e.g. a microphone)
|
|
185
|
+
* or, with `label`, a small primary text button that submits what was typed. */
|
|
186
|
+
export type InputEndAction = {
|
|
187
|
+
readonly onClick: () => void;
|
|
188
|
+
/** Toggle state, e.g. a microphone that is currently recording. */
|
|
189
|
+
readonly pressed?: boolean;
|
|
190
|
+
} & ({
|
|
191
|
+
readonly icon: ReactNode;
|
|
192
|
+
readonly ariaLabel: string;
|
|
193
|
+
readonly label?: undefined;
|
|
194
|
+
} | {
|
|
195
|
+
readonly label: string;
|
|
196
|
+
readonly icon?: undefined;
|
|
197
|
+
readonly ariaLabel?: undefined;
|
|
198
|
+
});
|
|
181
199
|
/** Button beside a single-line text/number input that fills it with a
|
|
182
200
|
* suggestion. Stays usable on a `disabled` input (the readOnly+fill case). */
|
|
183
201
|
export type InputFillAction = {
|
|
@@ -231,6 +249,7 @@ export type InputProps = {
|
|
|
231
249
|
readonly prefix?: string;
|
|
232
250
|
readonly suffix?: string;
|
|
233
251
|
readonly fill?: InputFillAction;
|
|
252
|
+
readonly endAction?: InputEndAction;
|
|
234
253
|
readonly dataAttributes?: DataAttributes;
|
|
235
254
|
/** Raw keydown access (e.g. Enter-to-submit at the field instead of
|
|
236
255
|
* the surrounding Form). Forwarded to the element. */
|
|
@@ -1244,22 +1263,26 @@ export type TabsProps = {
|
|
|
1244
1263
|
/** Shown dimmed after the label (e.g. an open-items count). Omit for
|
|
1245
1264
|
* tabs without a counter. */
|
|
1246
1265
|
readonly count?: number;
|
|
1266
|
+
/** Rendered before the label. */
|
|
1267
|
+
readonly icon?: ReactNode;
|
|
1268
|
+
/** Small muted text after the label, e.g. "4 Seiten". */
|
|
1269
|
+
readonly detail?: string;
|
|
1247
1270
|
}[];
|
|
1248
1271
|
readonly activeId: string;
|
|
1249
1272
|
readonly onSelect: (id: string) => void;
|
|
1273
|
+
/** "pill" (default) = count badge, 44px strip. "plain" = count as plain muted number, 40px strip
|
|
1274
|
+
* flush with its content (tabs that switch a reader). "filter" = the plain look inset by 6px with
|
|
1275
|
+
* no gap between tabs (the filter strip of a list pane). */
|
|
1276
|
+
readonly appearance?: "pill" | "plain" | "filter";
|
|
1250
1277
|
readonly testId?: string;
|
|
1251
1278
|
};
|
|
1252
|
-
export type
|
|
1253
|
-
/** Tones a select option can request: the status tones plus the brand `accent`. */
|
|
1254
|
-
export type StatusBadgeOptionTone = StatusTone | "accent";
|
|
1279
|
+
export { type StatusBadgeOptionTone, type StatusTone, statusToneForOptionTone, statusToneForValue, } from "./status-tone.ts";
|
|
1255
1280
|
/** Status pill. `value` is the raw column value — tone-mapping is the app's job. */
|
|
1256
1281
|
export type StatusBadgeProps = {
|
|
1257
1282
|
readonly value: string;
|
|
1258
1283
|
readonly tone?: StatusBadgeOptionTone;
|
|
1259
1284
|
readonly testId?: string;
|
|
1260
1285
|
};
|
|
1261
|
-
export declare function statusToneForOptionTone(tone: SelectOptionTone): StatusBadgeOptionTone | undefined;
|
|
1262
|
-
export declare function statusToneForValue(value: string): StatusTone | undefined;
|
|
1263
1286
|
/** Structured JSON display (audit payload/metadata, job logs, unsupported
|
|
1264
1287
|
* jsonb/embedded field fallback). Takes the raw value, not a pre-stringified
|
|
1265
1288
|
* one — the implementation owns `JSON.stringify` (and must not throw on
|