@almadar/ui 5.132.0 → 5.134.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/avl/index.cjs +1735 -1364
- package/dist/avl/index.js +793 -422
- package/dist/components/index.cjs +580 -199
- package/dist/components/index.d.cts +227 -4
- package/dist/components/index.d.ts +227 -4
- package/dist/components/index.js +576 -200
- package/dist/lib/drawable/three/index.cjs +53 -1
- package/dist/lib/drawable/three/index.js +53 -1
- package/dist/lib/index.cjs +57 -0
- package/dist/lib/index.d.cts +30 -1
- package/dist/lib/index.d.ts +30 -1
- package/dist/lib/index.js +52 -1
- package/dist/marketing/index.cjs +53 -1
- package/dist/marketing/index.d.cts +6 -0
- package/dist/marketing/index.d.ts +6 -0
- package/dist/marketing/index.js +53 -1
- package/dist/providers/index.cjs +1616 -1245
- package/dist/providers/index.js +768 -397
- package/dist/runtime/index.cjs +1596 -1225
- package/dist/runtime/index.js +773 -402
- package/package.json +4 -4
|
@@ -2795,6 +2795,53 @@ var Box = React3__default.default.forwardRef(
|
|
|
2795
2795
|
}
|
|
2796
2796
|
);
|
|
2797
2797
|
Box.displayName = "Box";
|
|
2798
|
+
|
|
2799
|
+
// lib/format.ts
|
|
2800
|
+
function formatDate(value) {
|
|
2801
|
+
if (!value) return "";
|
|
2802
|
+
const d = new Date(String(value));
|
|
2803
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2804
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
2805
|
+
}
|
|
2806
|
+
function formatTime(value) {
|
|
2807
|
+
if (!value) return "";
|
|
2808
|
+
const d = new Date(String(value));
|
|
2809
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2810
|
+
return d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
2811
|
+
}
|
|
2812
|
+
function formatDateTime(value) {
|
|
2813
|
+
if (!value) return "";
|
|
2814
|
+
const d = new Date(String(value));
|
|
2815
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2816
|
+
return `${formatDate(value)} ${formatTime(value)}`;
|
|
2817
|
+
}
|
|
2818
|
+
function asYesNo(value) {
|
|
2819
|
+
return value === false || value === 0 || String(value) === "false" ? "No" : "Yes";
|
|
2820
|
+
}
|
|
2821
|
+
function formatValue(value, format) {
|
|
2822
|
+
if (value === void 0 || value === null) return "";
|
|
2823
|
+
if (typeof value === "boolean") return asYesNo(value);
|
|
2824
|
+
switch (format) {
|
|
2825
|
+
case "date":
|
|
2826
|
+
return formatDate(value);
|
|
2827
|
+
case "time":
|
|
2828
|
+
return formatTime(value);
|
|
2829
|
+
case "datetime":
|
|
2830
|
+
return formatDateTime(value);
|
|
2831
|
+
case "currency":
|
|
2832
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
2833
|
+
case "number":
|
|
2834
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
2835
|
+
case "percent":
|
|
2836
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
2837
|
+
case "boolean":
|
|
2838
|
+
return asYesNo(value);
|
|
2839
|
+
default:
|
|
2840
|
+
return String(value);
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
// components/core/atoms/Typography.tsx
|
|
2798
2845
|
var variantStyles = {
|
|
2799
2846
|
h1: "text-4xl font-bold tracking-tight text-foreground",
|
|
2800
2847
|
h2: "text-3xl font-bold tracking-tight text-foreground",
|
|
@@ -2882,11 +2929,16 @@ var Typography = ({
|
|
|
2882
2929
|
id,
|
|
2883
2930
|
className,
|
|
2884
2931
|
style,
|
|
2932
|
+
format,
|
|
2885
2933
|
content,
|
|
2886
2934
|
children
|
|
2887
2935
|
}) => {
|
|
2888
2936
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
2889
2937
|
const Component2 = as || defaultElements[variant];
|
|
2938
|
+
let body = children ?? content;
|
|
2939
|
+
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
2940
|
+
body = formatValue(body, format);
|
|
2941
|
+
}
|
|
2890
2942
|
return React3__default.default.createElement(
|
|
2891
2943
|
Component2,
|
|
2892
2944
|
{
|
|
@@ -2903,7 +2955,7 @@ var Typography = ({
|
|
|
2903
2955
|
),
|
|
2904
2956
|
style
|
|
2905
2957
|
},
|
|
2906
|
-
|
|
2958
|
+
body
|
|
2907
2959
|
);
|
|
2908
2960
|
};
|
|
2909
2961
|
Typography.displayName = "Typography";
|
|
@@ -2771,6 +2771,53 @@ var Box = React3.forwardRef(
|
|
|
2771
2771
|
}
|
|
2772
2772
|
);
|
|
2773
2773
|
Box.displayName = "Box";
|
|
2774
|
+
|
|
2775
|
+
// lib/format.ts
|
|
2776
|
+
function formatDate(value) {
|
|
2777
|
+
if (!value) return "";
|
|
2778
|
+
const d = new Date(String(value));
|
|
2779
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2780
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
2781
|
+
}
|
|
2782
|
+
function formatTime(value) {
|
|
2783
|
+
if (!value) return "";
|
|
2784
|
+
const d = new Date(String(value));
|
|
2785
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2786
|
+
return d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
2787
|
+
}
|
|
2788
|
+
function formatDateTime(value) {
|
|
2789
|
+
if (!value) return "";
|
|
2790
|
+
const d = new Date(String(value));
|
|
2791
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2792
|
+
return `${formatDate(value)} ${formatTime(value)}`;
|
|
2793
|
+
}
|
|
2794
|
+
function asYesNo(value) {
|
|
2795
|
+
return value === false || value === 0 || String(value) === "false" ? "No" : "Yes";
|
|
2796
|
+
}
|
|
2797
|
+
function formatValue(value, format) {
|
|
2798
|
+
if (value === void 0 || value === null) return "";
|
|
2799
|
+
if (typeof value === "boolean") return asYesNo(value);
|
|
2800
|
+
switch (format) {
|
|
2801
|
+
case "date":
|
|
2802
|
+
return formatDate(value);
|
|
2803
|
+
case "time":
|
|
2804
|
+
return formatTime(value);
|
|
2805
|
+
case "datetime":
|
|
2806
|
+
return formatDateTime(value);
|
|
2807
|
+
case "currency":
|
|
2808
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
2809
|
+
case "number":
|
|
2810
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
2811
|
+
case "percent":
|
|
2812
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
2813
|
+
case "boolean":
|
|
2814
|
+
return asYesNo(value);
|
|
2815
|
+
default:
|
|
2816
|
+
return String(value);
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
// components/core/atoms/Typography.tsx
|
|
2774
2821
|
var variantStyles = {
|
|
2775
2822
|
h1: "text-4xl font-bold tracking-tight text-foreground",
|
|
2776
2823
|
h2: "text-3xl font-bold tracking-tight text-foreground",
|
|
@@ -2858,11 +2905,16 @@ var Typography = ({
|
|
|
2858
2905
|
id,
|
|
2859
2906
|
className,
|
|
2860
2907
|
style,
|
|
2908
|
+
format,
|
|
2861
2909
|
content,
|
|
2862
2910
|
children
|
|
2863
2911
|
}) => {
|
|
2864
2912
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
2865
2913
|
const Component2 = as || defaultElements[variant];
|
|
2914
|
+
let body = children ?? content;
|
|
2915
|
+
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
2916
|
+
body = formatValue(body, format);
|
|
2917
|
+
}
|
|
2866
2918
|
return React3.createElement(
|
|
2867
2919
|
Component2,
|
|
2868
2920
|
{
|
|
@@ -2879,7 +2931,7 @@ var Typography = ({
|
|
|
2879
2931
|
),
|
|
2880
2932
|
style
|
|
2881
2933
|
},
|
|
2882
|
-
|
|
2934
|
+
body
|
|
2883
2935
|
);
|
|
2884
2936
|
};
|
|
2885
2937
|
Typography.displayName = "Typography";
|
package/dist/lib/index.cjs
CHANGED
|
@@ -790,6 +790,57 @@ function clearVerification() {
|
|
|
790
790
|
}
|
|
791
791
|
exposeOnWindow();
|
|
792
792
|
|
|
793
|
+
// lib/format.ts
|
|
794
|
+
function humanizeFieldName(name) {
|
|
795
|
+
return name.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).replace(/\b([A-Z])([A-Z]+)\b/g, (_, first, rest) => first + rest.toLowerCase()).trim();
|
|
796
|
+
}
|
|
797
|
+
function humanizeEnumValue(value) {
|
|
798
|
+
return /^[a-z0-9]+(?:[_-][a-z0-9]+)+$/.test(value) ? humanizeFieldName(value) : value;
|
|
799
|
+
}
|
|
800
|
+
function formatDate(value) {
|
|
801
|
+
if (!value) return "";
|
|
802
|
+
const d = new Date(String(value));
|
|
803
|
+
if (isNaN(d.getTime())) return String(value);
|
|
804
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
805
|
+
}
|
|
806
|
+
function formatTime(value) {
|
|
807
|
+
if (!value) return "";
|
|
808
|
+
const d = new Date(String(value));
|
|
809
|
+
if (isNaN(d.getTime())) return String(value);
|
|
810
|
+
return d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
811
|
+
}
|
|
812
|
+
function formatDateTime(value) {
|
|
813
|
+
if (!value) return "";
|
|
814
|
+
const d = new Date(String(value));
|
|
815
|
+
if (isNaN(d.getTime())) return String(value);
|
|
816
|
+
return `${formatDate(value)} ${formatTime(value)}`;
|
|
817
|
+
}
|
|
818
|
+
function asYesNo(value) {
|
|
819
|
+
return value === false || value === 0 || String(value) === "false" ? "No" : "Yes";
|
|
820
|
+
}
|
|
821
|
+
function formatValue(value, format) {
|
|
822
|
+
if (value === void 0 || value === null) return "";
|
|
823
|
+
if (typeof value === "boolean") return asYesNo(value);
|
|
824
|
+
switch (format) {
|
|
825
|
+
case "date":
|
|
826
|
+
return formatDate(value);
|
|
827
|
+
case "time":
|
|
828
|
+
return formatTime(value);
|
|
829
|
+
case "datetime":
|
|
830
|
+
return formatDateTime(value);
|
|
831
|
+
case "currency":
|
|
832
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
833
|
+
case "number":
|
|
834
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
835
|
+
case "percent":
|
|
836
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
837
|
+
case "boolean":
|
|
838
|
+
return asYesNo(value);
|
|
839
|
+
default:
|
|
840
|
+
return String(value);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
|
|
793
844
|
// lib/getNestedValue.ts
|
|
794
845
|
function getNestedValue(obj, path) {
|
|
795
846
|
if (obj === null || obj === void 0 || !path) {
|
|
@@ -1879,8 +1930,12 @@ exports.debugWarn = debugWarn;
|
|
|
1879
1930
|
exports.eightPointedStarPath = eightPointedStarPath;
|
|
1880
1931
|
exports.extractOutputsFromTransitions = extractOutputsFromTransitions;
|
|
1881
1932
|
exports.extractStateMachine = extractStateMachine;
|
|
1933
|
+
exports.formatDate = formatDate;
|
|
1934
|
+
exports.formatDateTime = formatDateTime;
|
|
1882
1935
|
exports.formatGuard = formatGuard;
|
|
1883
1936
|
exports.formatNestedFieldLabel = formatNestedFieldLabel;
|
|
1937
|
+
exports.formatTime = formatTime;
|
|
1938
|
+
exports.formatValue = formatValue;
|
|
1884
1939
|
exports.gearTeethPath = gearTeethPath;
|
|
1885
1940
|
exports.getAllChecks = getAllChecks;
|
|
1886
1941
|
exports.getAllTicks = getAllTicks;
|
|
@@ -1905,6 +1960,8 @@ exports.getTrait = getTrait;
|
|
|
1905
1960
|
exports.getTraitSnapshots = getTraitSnapshots;
|
|
1906
1961
|
exports.getTransitions = getTransitions;
|
|
1907
1962
|
exports.getTransitionsForTrait = getTransitionsForTrait;
|
|
1963
|
+
exports.humanizeEnumValue = humanizeEnumValue;
|
|
1964
|
+
exports.humanizeFieldName = humanizeFieldName;
|
|
1908
1965
|
exports.initDebugShortcut = initDebugShortcut;
|
|
1909
1966
|
exports.isDebugEnabled = isDebugEnabled;
|
|
1910
1967
|
exports.lockIconPath = lockIconPath;
|
package/dist/lib/index.d.cts
CHANGED
|
@@ -283,6 +283,35 @@ declare function onDebugToggle(listener: DebugToggleListener): () => void;
|
|
|
283
283
|
*/
|
|
284
284
|
declare function initDebugShortcut(): () => void;
|
|
285
285
|
|
|
286
|
+
/**
|
|
287
|
+
* Shared field-name + value formatting — the single owner of the humanize and
|
|
288
|
+
* format vocabulary previously duplicated across DataTable, DataGrid, CardGrid,
|
|
289
|
+
* DataList, TableView, DetailPanel, List, and UISlotRenderer.
|
|
290
|
+
*/
|
|
291
|
+
|
|
292
|
+
type ValueFormat = 'none' | 'date' | 'time' | 'datetime' | 'number' | 'currency' | 'percent' | 'boolean';
|
|
293
|
+
/**
|
|
294
|
+
* Convert a camelCase, PascalCase, ALLCAPS, snake_case, or kebab-case field
|
|
295
|
+
* name to a human-readable header: "estimatedDelivery" → "Estimated Delivery",
|
|
296
|
+
* "PURCHASEPRICE" → "Purchase Price", "is_active" → "Is Active".
|
|
297
|
+
*/
|
|
298
|
+
declare function humanizeFieldName(name: string): string;
|
|
299
|
+
/**
|
|
300
|
+
* Badge/label-position enum values: a lowercase token chain joined by `_` or
|
|
301
|
+
* `-` renders as spaced Title Case ("checked_in" → "Checked In"). Any other
|
|
302
|
+
* shape (ids, emails, mixed case, single words) passes through unchanged —
|
|
303
|
+
* a stated formatting contract, applied only where call sites opt in.
|
|
304
|
+
*/
|
|
305
|
+
declare function humanizeEnumValue(value: string): string;
|
|
306
|
+
declare function formatDate(value: FieldValue | undefined): string;
|
|
307
|
+
declare function formatTime(value: FieldValue | undefined): string;
|
|
308
|
+
declare function formatDateTime(value: FieldValue | undefined): string;
|
|
309
|
+
/**
|
|
310
|
+
* Format a field value for display. Booleans always render Yes/No regardless
|
|
311
|
+
* of the declared format (a raw `true`/`false` cell is never intended output).
|
|
312
|
+
*/
|
|
313
|
+
declare function formatValue(value: FieldValue | undefined, format?: string): string;
|
|
314
|
+
|
|
286
315
|
/**
|
|
287
316
|
* Get Nested Value Utility
|
|
288
317
|
*
|
|
@@ -502,4 +531,4 @@ declare function eightPointedStarPath(cx: number, cy: number, outerR: number, in
|
|
|
502
531
|
*/
|
|
503
532
|
declare function arrowheadPath(size: number): string;
|
|
504
533
|
|
|
505
|
-
export { ApiError, type DebugEvent, type DebugEventType, type EntitySnapshot, type EntityState, type GuardContext, type GuardEvaluation, JAZARI_COLORS, type JazariArmLayout, type JazariEffectInfo, type JazariGearLayout, type JazariGuardInfo, type JazariLayout, type LayoutInput, type LayoutState, type LayoutTransition, type PersistentEntityInfo, type RuntimeEntity, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, apiClient, arrowheadPath, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, formatNestedFieldLabel, gearTeethPath, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, pipeIconPath, recordGuardEvaluation, registerTick, registerTrait, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState };
|
|
534
|
+
export { ApiError, type DebugEvent, type DebugEventType, type EntitySnapshot, type EntityState, type GuardContext, type GuardEvaluation, JAZARI_COLORS, type JazariArmLayout, type JazariEffectInfo, type JazariGearLayout, type JazariGuardInfo, type JazariLayout, type LayoutInput, type LayoutState, type LayoutTransition, type PersistentEntityInfo, type RuntimeEntity, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, type ValueFormat, apiClient, arrowheadPath, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, formatDate, formatDateTime, formatNestedFieldLabel, formatTime, formatValue, gearTeethPath, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, humanizeEnumValue, humanizeFieldName, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, pipeIconPath, recordGuardEvaluation, registerTick, registerTrait, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState };
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -283,6 +283,35 @@ declare function onDebugToggle(listener: DebugToggleListener): () => void;
|
|
|
283
283
|
*/
|
|
284
284
|
declare function initDebugShortcut(): () => void;
|
|
285
285
|
|
|
286
|
+
/**
|
|
287
|
+
* Shared field-name + value formatting — the single owner of the humanize and
|
|
288
|
+
* format vocabulary previously duplicated across DataTable, DataGrid, CardGrid,
|
|
289
|
+
* DataList, TableView, DetailPanel, List, and UISlotRenderer.
|
|
290
|
+
*/
|
|
291
|
+
|
|
292
|
+
type ValueFormat = 'none' | 'date' | 'time' | 'datetime' | 'number' | 'currency' | 'percent' | 'boolean';
|
|
293
|
+
/**
|
|
294
|
+
* Convert a camelCase, PascalCase, ALLCAPS, snake_case, or kebab-case field
|
|
295
|
+
* name to a human-readable header: "estimatedDelivery" → "Estimated Delivery",
|
|
296
|
+
* "PURCHASEPRICE" → "Purchase Price", "is_active" → "Is Active".
|
|
297
|
+
*/
|
|
298
|
+
declare function humanizeFieldName(name: string): string;
|
|
299
|
+
/**
|
|
300
|
+
* Badge/label-position enum values: a lowercase token chain joined by `_` or
|
|
301
|
+
* `-` renders as spaced Title Case ("checked_in" → "Checked In"). Any other
|
|
302
|
+
* shape (ids, emails, mixed case, single words) passes through unchanged —
|
|
303
|
+
* a stated formatting contract, applied only where call sites opt in.
|
|
304
|
+
*/
|
|
305
|
+
declare function humanizeEnumValue(value: string): string;
|
|
306
|
+
declare function formatDate(value: FieldValue | undefined): string;
|
|
307
|
+
declare function formatTime(value: FieldValue | undefined): string;
|
|
308
|
+
declare function formatDateTime(value: FieldValue | undefined): string;
|
|
309
|
+
/**
|
|
310
|
+
* Format a field value for display. Booleans always render Yes/No regardless
|
|
311
|
+
* of the declared format (a raw `true`/`false` cell is never intended output).
|
|
312
|
+
*/
|
|
313
|
+
declare function formatValue(value: FieldValue | undefined, format?: string): string;
|
|
314
|
+
|
|
286
315
|
/**
|
|
287
316
|
* Get Nested Value Utility
|
|
288
317
|
*
|
|
@@ -502,4 +531,4 @@ declare function eightPointedStarPath(cx: number, cy: number, outerR: number, in
|
|
|
502
531
|
*/
|
|
503
532
|
declare function arrowheadPath(size: number): string;
|
|
504
533
|
|
|
505
|
-
export { ApiError, type DebugEvent, type DebugEventType, type EntitySnapshot, type EntityState, type GuardContext, type GuardEvaluation, JAZARI_COLORS, type JazariArmLayout, type JazariEffectInfo, type JazariGearLayout, type JazariGuardInfo, type JazariLayout, type LayoutInput, type LayoutState, type LayoutTransition, type PersistentEntityInfo, type RuntimeEntity, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, apiClient, arrowheadPath, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, formatNestedFieldLabel, gearTeethPath, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, pipeIconPath, recordGuardEvaluation, registerTick, registerTrait, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState };
|
|
534
|
+
export { ApiError, type DebugEvent, type DebugEventType, type EntitySnapshot, type EntityState, type GuardContext, type GuardEvaluation, JAZARI_COLORS, type JazariArmLayout, type JazariEffectInfo, type JazariGearLayout, type JazariGuardInfo, type JazariLayout, type LayoutInput, type LayoutState, type LayoutTransition, type PersistentEntityInfo, type RuntimeEntity, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, type ValueFormat, apiClient, arrowheadPath, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, formatDate, formatDateTime, formatNestedFieldLabel, formatTime, formatValue, gearTeethPath, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, humanizeEnumValue, humanizeFieldName, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, pipeIconPath, recordGuardEvaluation, registerTick, registerTrait, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState };
|
package/dist/lib/index.js
CHANGED
|
@@ -788,6 +788,57 @@ function clearVerification() {
|
|
|
788
788
|
}
|
|
789
789
|
exposeOnWindow();
|
|
790
790
|
|
|
791
|
+
// lib/format.ts
|
|
792
|
+
function humanizeFieldName(name) {
|
|
793
|
+
return name.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).replace(/\b([A-Z])([A-Z]+)\b/g, (_, first, rest) => first + rest.toLowerCase()).trim();
|
|
794
|
+
}
|
|
795
|
+
function humanizeEnumValue(value) {
|
|
796
|
+
return /^[a-z0-9]+(?:[_-][a-z0-9]+)+$/.test(value) ? humanizeFieldName(value) : value;
|
|
797
|
+
}
|
|
798
|
+
function formatDate(value) {
|
|
799
|
+
if (!value) return "";
|
|
800
|
+
const d = new Date(String(value));
|
|
801
|
+
if (isNaN(d.getTime())) return String(value);
|
|
802
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
803
|
+
}
|
|
804
|
+
function formatTime(value) {
|
|
805
|
+
if (!value) return "";
|
|
806
|
+
const d = new Date(String(value));
|
|
807
|
+
if (isNaN(d.getTime())) return String(value);
|
|
808
|
+
return d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
809
|
+
}
|
|
810
|
+
function formatDateTime(value) {
|
|
811
|
+
if (!value) return "";
|
|
812
|
+
const d = new Date(String(value));
|
|
813
|
+
if (isNaN(d.getTime())) return String(value);
|
|
814
|
+
return `${formatDate(value)} ${formatTime(value)}`;
|
|
815
|
+
}
|
|
816
|
+
function asYesNo(value) {
|
|
817
|
+
return value === false || value === 0 || String(value) === "false" ? "No" : "Yes";
|
|
818
|
+
}
|
|
819
|
+
function formatValue(value, format) {
|
|
820
|
+
if (value === void 0 || value === null) return "";
|
|
821
|
+
if (typeof value === "boolean") return asYesNo(value);
|
|
822
|
+
switch (format) {
|
|
823
|
+
case "date":
|
|
824
|
+
return formatDate(value);
|
|
825
|
+
case "time":
|
|
826
|
+
return formatTime(value);
|
|
827
|
+
case "datetime":
|
|
828
|
+
return formatDateTime(value);
|
|
829
|
+
case "currency":
|
|
830
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
831
|
+
case "number":
|
|
832
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
833
|
+
case "percent":
|
|
834
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
835
|
+
case "boolean":
|
|
836
|
+
return asYesNo(value);
|
|
837
|
+
default:
|
|
838
|
+
return String(value);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
|
|
791
842
|
// lib/getNestedValue.ts
|
|
792
843
|
function getNestedValue(obj, path) {
|
|
793
844
|
if (obj === null || obj === void 0 || !path) {
|
|
@@ -1844,4 +1895,4 @@ var JAZARI_COLORS = {
|
|
|
1844
1895
|
darkBg: "#1a1a2e"
|
|
1845
1896
|
};
|
|
1846
1897
|
|
|
1847
|
-
export { ApiError, DEFAULT_CONFIG, JAZARI_COLORS, apiClient, arrowheadPath, bindCanvasCapture, bindEventBus, bindLastDrawables, bindTraitStateGetter, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, clearVerification, cn, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, extractOutputsFromTransitions, extractStateMachine, formatGuard, formatNestedFieldLabel, gearTeethPath, getAllChecks, getAllTicks, getAllTraits, getBridgeHealth, getDebugEvents, getEffectSummary, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getSnapshot, getSummary, getTick, getTrait, getTraitSnapshots, getTransitions, getTransitionsForTrait, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, parseContentSegments, parseMarkdownWithCodeBlocks, pipeIconPath, recordGuardEvaluation, recordServerResponse, recordTransition, registerCheck, registerTick, registerTrait, registerTraitSnapshot, renderStateMachineToDomData, renderStateMachineToSvg, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, subscribeToVerification, toggleDebug, unregisterTick, unregisterTrait, updateAssetStatus, updateBridgeHealth, updateCheck, updateGuardResult, updateTickExecution, updateTraitState, waitForTransition };
|
|
1898
|
+
export { ApiError, DEFAULT_CONFIG, JAZARI_COLORS, apiClient, arrowheadPath, bindCanvasCapture, bindEventBus, bindLastDrawables, bindTraitStateGetter, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, clearVerification, cn, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, extractOutputsFromTransitions, extractStateMachine, formatDate, formatDateTime, formatGuard, formatNestedFieldLabel, formatTime, formatValue, gearTeethPath, getAllChecks, getAllTicks, getAllTraits, getBridgeHealth, getDebugEvents, getEffectSummary, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getSnapshot, getSummary, getTick, getTrait, getTraitSnapshots, getTransitions, getTransitionsForTrait, humanizeEnumValue, humanizeFieldName, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, parseContentSegments, parseMarkdownWithCodeBlocks, pipeIconPath, recordGuardEvaluation, recordServerResponse, recordTransition, registerCheck, registerTick, registerTrait, registerTraitSnapshot, renderStateMachineToDomData, renderStateMachineToSvg, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, subscribeToVerification, toggleDebug, unregisterTick, unregisterTrait, updateAssetStatus, updateBridgeHealth, updateCheck, updateGuardResult, updateTickExecution, updateTraitState, waitForTransition };
|
package/dist/marketing/index.cjs
CHANGED
|
@@ -2958,6 +2958,53 @@ var Stack = ({
|
|
|
2958
2958
|
};
|
|
2959
2959
|
var VStack = (props) => /* @__PURE__ */ jsxRuntime.jsx(Stack, { direction: "vertical", ...props });
|
|
2960
2960
|
var HStack = (props) => /* @__PURE__ */ jsxRuntime.jsx(Stack, { direction: "horizontal", ...props });
|
|
2961
|
+
|
|
2962
|
+
// lib/format.ts
|
|
2963
|
+
function formatDate(value) {
|
|
2964
|
+
if (!value) return "";
|
|
2965
|
+
const d = new Date(String(value));
|
|
2966
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2967
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
2968
|
+
}
|
|
2969
|
+
function formatTime(value) {
|
|
2970
|
+
if (!value) return "";
|
|
2971
|
+
const d = new Date(String(value));
|
|
2972
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2973
|
+
return d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
2974
|
+
}
|
|
2975
|
+
function formatDateTime(value) {
|
|
2976
|
+
if (!value) return "";
|
|
2977
|
+
const d = new Date(String(value));
|
|
2978
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2979
|
+
return `${formatDate(value)} ${formatTime(value)}`;
|
|
2980
|
+
}
|
|
2981
|
+
function asYesNo(value) {
|
|
2982
|
+
return value === false || value === 0 || String(value) === "false" ? "No" : "Yes";
|
|
2983
|
+
}
|
|
2984
|
+
function formatValue(value, format) {
|
|
2985
|
+
if (value === void 0 || value === null) return "";
|
|
2986
|
+
if (typeof value === "boolean") return asYesNo(value);
|
|
2987
|
+
switch (format) {
|
|
2988
|
+
case "date":
|
|
2989
|
+
return formatDate(value);
|
|
2990
|
+
case "time":
|
|
2991
|
+
return formatTime(value);
|
|
2992
|
+
case "datetime":
|
|
2993
|
+
return formatDateTime(value);
|
|
2994
|
+
case "currency":
|
|
2995
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
2996
|
+
case "number":
|
|
2997
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
2998
|
+
case "percent":
|
|
2999
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
3000
|
+
case "boolean":
|
|
3001
|
+
return asYesNo(value);
|
|
3002
|
+
default:
|
|
3003
|
+
return String(value);
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
|
|
3007
|
+
// components/core/atoms/Typography.tsx
|
|
2961
3008
|
var variantStyles = {
|
|
2962
3009
|
h1: "text-4xl font-bold tracking-tight text-foreground",
|
|
2963
3010
|
h2: "text-3xl font-bold tracking-tight text-foreground",
|
|
@@ -3045,11 +3092,16 @@ var Typography = ({
|
|
|
3045
3092
|
id,
|
|
3046
3093
|
className,
|
|
3047
3094
|
style,
|
|
3095
|
+
format,
|
|
3048
3096
|
content,
|
|
3049
3097
|
children
|
|
3050
3098
|
}) => {
|
|
3051
3099
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
3052
3100
|
const Component = as || defaultElements[variant];
|
|
3101
|
+
let body = children ?? content;
|
|
3102
|
+
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
3103
|
+
body = formatValue(body, format);
|
|
3104
|
+
}
|
|
3053
3105
|
return React12__namespace.default.createElement(
|
|
3054
3106
|
Component,
|
|
3055
3107
|
{
|
|
@@ -3066,7 +3118,7 @@ var Typography = ({
|
|
|
3066
3118
|
),
|
|
3067
3119
|
style
|
|
3068
3120
|
},
|
|
3069
|
-
|
|
3121
|
+
body
|
|
3070
3122
|
);
|
|
3071
3123
|
};
|
|
3072
3124
|
Typography.displayName = "Typography";
|
|
@@ -165,6 +165,12 @@ interface TypographyProps {
|
|
|
165
165
|
className?: string;
|
|
166
166
|
/** Inline style */
|
|
167
167
|
style?: React.CSSProperties;
|
|
168
|
+
/**
|
|
169
|
+
* Value formatting applied to string/number/Date content — `none` (the
|
|
170
|
+
* default) renders content as-is. Covers the raw-ISO-date class: a bound
|
|
171
|
+
* datetime renders human-readable via `format="date"|"time"|"datetime"`.
|
|
172
|
+
*/
|
|
173
|
+
format?: "none" | "date" | "time" | "datetime" | "number" | "currency" | "percent";
|
|
168
174
|
/** Text content (alternative to children) */
|
|
169
175
|
content?: React.ReactNode;
|
|
170
176
|
/** Children elements */
|
|
@@ -165,6 +165,12 @@ interface TypographyProps {
|
|
|
165
165
|
className?: string;
|
|
166
166
|
/** Inline style */
|
|
167
167
|
style?: React.CSSProperties;
|
|
168
|
+
/**
|
|
169
|
+
* Value formatting applied to string/number/Date content — `none` (the
|
|
170
|
+
* default) renders content as-is. Covers the raw-ISO-date class: a bound
|
|
171
|
+
* datetime renders human-readable via `format="date"|"time"|"datetime"`.
|
|
172
|
+
*/
|
|
173
|
+
format?: "none" | "date" | "time" | "datetime" | "number" | "currency" | "percent";
|
|
168
174
|
/** Text content (alternative to children) */
|
|
169
175
|
content?: React.ReactNode;
|
|
170
176
|
/** Children elements */
|
package/dist/marketing/index.js
CHANGED
|
@@ -2937,6 +2937,53 @@ var Stack = ({
|
|
|
2937
2937
|
};
|
|
2938
2938
|
var VStack = (props) => /* @__PURE__ */ jsx(Stack, { direction: "vertical", ...props });
|
|
2939
2939
|
var HStack = (props) => /* @__PURE__ */ jsx(Stack, { direction: "horizontal", ...props });
|
|
2940
|
+
|
|
2941
|
+
// lib/format.ts
|
|
2942
|
+
function formatDate(value) {
|
|
2943
|
+
if (!value) return "";
|
|
2944
|
+
const d = new Date(String(value));
|
|
2945
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2946
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
2947
|
+
}
|
|
2948
|
+
function formatTime(value) {
|
|
2949
|
+
if (!value) return "";
|
|
2950
|
+
const d = new Date(String(value));
|
|
2951
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2952
|
+
return d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
2953
|
+
}
|
|
2954
|
+
function formatDateTime(value) {
|
|
2955
|
+
if (!value) return "";
|
|
2956
|
+
const d = new Date(String(value));
|
|
2957
|
+
if (isNaN(d.getTime())) return String(value);
|
|
2958
|
+
return `${formatDate(value)} ${formatTime(value)}`;
|
|
2959
|
+
}
|
|
2960
|
+
function asYesNo(value) {
|
|
2961
|
+
return value === false || value === 0 || String(value) === "false" ? "No" : "Yes";
|
|
2962
|
+
}
|
|
2963
|
+
function formatValue(value, format) {
|
|
2964
|
+
if (value === void 0 || value === null) return "";
|
|
2965
|
+
if (typeof value === "boolean") return asYesNo(value);
|
|
2966
|
+
switch (format) {
|
|
2967
|
+
case "date":
|
|
2968
|
+
return formatDate(value);
|
|
2969
|
+
case "time":
|
|
2970
|
+
return formatTime(value);
|
|
2971
|
+
case "datetime":
|
|
2972
|
+
return formatDateTime(value);
|
|
2973
|
+
case "currency":
|
|
2974
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
2975
|
+
case "number":
|
|
2976
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
2977
|
+
case "percent":
|
|
2978
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
2979
|
+
case "boolean":
|
|
2980
|
+
return asYesNo(value);
|
|
2981
|
+
default:
|
|
2982
|
+
return String(value);
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
// components/core/atoms/Typography.tsx
|
|
2940
2987
|
var variantStyles = {
|
|
2941
2988
|
h1: "text-4xl font-bold tracking-tight text-foreground",
|
|
2942
2989
|
h2: "text-3xl font-bold tracking-tight text-foreground",
|
|
@@ -3024,11 +3071,16 @@ var Typography = ({
|
|
|
3024
3071
|
id,
|
|
3025
3072
|
className,
|
|
3026
3073
|
style,
|
|
3074
|
+
format,
|
|
3027
3075
|
content,
|
|
3028
3076
|
children
|
|
3029
3077
|
}) => {
|
|
3030
3078
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
3031
3079
|
const Component = as || defaultElements[variant];
|
|
3080
|
+
let body = children ?? content;
|
|
3081
|
+
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
3082
|
+
body = formatValue(body, format);
|
|
3083
|
+
}
|
|
3032
3084
|
return React12__default.createElement(
|
|
3033
3085
|
Component,
|
|
3034
3086
|
{
|
|
@@ -3045,7 +3097,7 @@ var Typography = ({
|
|
|
3045
3097
|
),
|
|
3046
3098
|
style
|
|
3047
3099
|
},
|
|
3048
|
-
|
|
3100
|
+
body
|
|
3049
3101
|
);
|
|
3050
3102
|
};
|
|
3051
3103
|
Typography.displayName = "Typography";
|