@selvajs/ui 6.3.1 → 6.4.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/components/compute/ComputeApp.svelte +32 -2
- package/dist/components/compute/ComputeApp.svelte.d.ts +7 -1
- package/dist/components/compute/ComputeMessagesDialog.svelte +118 -95
- package/dist/components/compute/ComputeMessagesDialog.svelte.d.ts +4 -0
- package/dist/components/compute/SolveMessages.svelte +367 -0
- package/dist/components/compute/SolveMessages.svelte.d.ts +28 -0
- package/dist/components/layout/AppShell.svelte +5 -1
- package/dist/components/layout/AppShell.svelte.d.ts +3 -0
- package/dist/components/layout/PageFooter.svelte +34 -14
- package/dist/components/layout/PageFooter.svelte.d.ts +3 -0
- package/dist/components/preview/TabContent.svelte +18 -16
- package/dist/compute/useSolveSession.svelte.js +28 -4
- package/dist/i18n/messages.d.ts +9 -0
- package/dist/i18n/messages.js +18 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -1
- package/dist/public.d.ts +2 -2
- package/dist/schema/visibility-rules.d.ts +6 -0
- package/dist/schema/visibility-rules.js +9 -0
- package/package.json +18 -18
- package/src/lib/components/compute/ComputeApp.svelte +32 -2
- package/src/lib/components/compute/ComputeMessagesDialog.svelte +118 -95
- package/src/lib/components/compute/SolveMessages.svelte +367 -0
- package/src/lib/components/layout/AppShell.svelte +5 -1
- package/src/lib/components/layout/PageFooter.svelte +34 -14
- package/src/lib/components/preview/TabContent.svelte +18 -16
- package/src/lib/compute/useSolveSession.svelte.ts +28 -4
- package/src/lib/i18n/messages.ts +28 -0
- package/src/lib/index.ts +10 -2
- package/src/lib/public.ts +4 -2
- package/src/lib/schema/visibility-rules.ts +12 -1
package/src/lib/public.ts
CHANGED
|
@@ -56,7 +56,9 @@ export {
|
|
|
56
56
|
type SolveSession,
|
|
57
57
|
type SolveSessionArgs,
|
|
58
58
|
type SolveDriver,
|
|
59
|
-
type SolveReporter
|
|
59
|
+
type SolveReporter,
|
|
60
|
+
type LiveSolveState,
|
|
61
|
+
type SolvePhase
|
|
60
62
|
} from '@selvajs/solve/client';
|
|
61
63
|
|
|
62
64
|
// Client-slot context: host apps render their own cell for client-sourced inputs,
|
|
@@ -80,5 +82,5 @@ export * from './schema/dynamic-value-list';
|
|
|
80
82
|
|
|
81
83
|
// UI-facing runtime types (not from schema)
|
|
82
84
|
export type { ActionButton } from './types/actionButton';
|
|
83
|
-
export type { SolveFn, SolveResult } from '@selvajs/solve/shared';
|
|
85
|
+
export type { SolveFn, SolveResult, SolveDiagnostic } from '@selvajs/solve/shared';
|
|
84
86
|
export { DEFAULT_PRESET_LABELS, type PresetLabels } from './types/presetLabels';
|
|
@@ -106,9 +106,10 @@ export function buildVisibilityMap(
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
export function evaluateGroupVisibility(
|
|
109
|
-
group: { visibilityCondition?: GroupVisibilityCondition },
|
|
109
|
+
group: { visibilityCondition?: GroupVisibilityCondition; items?: LayoutItem[] },
|
|
110
110
|
values: Record<string, unknown>
|
|
111
111
|
): boolean {
|
|
112
|
+
if (group.items && !hasVisibleItems(group.items, values)) return false;
|
|
112
113
|
if (!group.visibilityCondition?.rules) return true;
|
|
113
114
|
|
|
114
115
|
const { action = 'show' } = group.visibilityCondition;
|
|
@@ -116,3 +117,13 @@ export function evaluateGroupVisibility(
|
|
|
116
117
|
|
|
117
118
|
return action === 'hide' ? !met : met;
|
|
118
119
|
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* A linebreak is always "visible" but renders as a divider only, so a group left with
|
|
123
|
+
* nothing but separators counts as empty.
|
|
124
|
+
*/
|
|
125
|
+
export function hasVisibleItems(items: LayoutItem[], values: Record<string, unknown>): boolean {
|
|
126
|
+
return items.some(
|
|
127
|
+
(item) => item.type !== 'linebreak' && evaluateVisibility(item, values).visible
|
|
128
|
+
);
|
|
129
|
+
}
|