@object-ui/core 17.2.0 → 17.5.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +1436 -0
  2. package/README.md +31 -12
  3. package/dist/actions/ActionEngine.d.ts +53 -31
  4. package/dist/actions/ActionEngine.js +87 -66
  5. package/dist/actions/ActionRunner.d.ts +215 -24
  6. package/dist/actions/ActionRunner.js +334 -17
  7. package/dist/actions/actionErrorDetail.d.ts +26 -0
  8. package/dist/actions/actionErrorDetail.js +37 -0
  9. package/dist/actions/actionKeys.d.ts +96 -20
  10. package/dist/actions/actionKeys.js +168 -18
  11. package/dist/actions/actionResponse.d.ts +42 -0
  12. package/dist/actions/actionResponse.js +104 -0
  13. package/dist/actions/index.d.ts +3 -0
  14. package/dist/actions/index.js +3 -0
  15. package/dist/actions/serverActionHandler.d.ts +143 -0
  16. package/dist/actions/serverActionHandler.js +137 -0
  17. package/dist/data-scope/ViewDataProvider.d.ts +37 -12
  18. package/dist/data-scope/ViewDataProvider.js +83 -5
  19. package/dist/data-scope/element-data-source.d.ts +113 -0
  20. package/dist/data-scope/element-data-source.js +216 -0
  21. package/dist/data-scope/index.d.ts +2 -1
  22. package/dist/data-scope/index.js +1 -0
  23. package/dist/evaluator/ExpressionEvaluator.js +4 -2
  24. package/dist/evaluator/declaredPredicate.d.ts +119 -0
  25. package/dist/evaluator/declaredPredicate.js +152 -0
  26. package/dist/evaluator/fieldRules.d.ts +42 -2
  27. package/dist/evaluator/fieldRules.js +101 -11
  28. package/dist/evaluator/index.d.ts +2 -0
  29. package/dist/evaluator/index.js +2 -0
  30. package/dist/evaluator/listConditional.d.ts +18 -3
  31. package/dist/evaluator/listConditional.js +0 -0
  32. package/dist/evaluator/optionRules.js +5 -1
  33. package/dist/evaluator/predicateInput.d.ts +132 -0
  34. package/dist/evaluator/predicateInput.js +129 -0
  35. package/dist/index.d.ts +7 -1
  36. package/dist/index.js +26 -1
  37. package/dist/protocols/DndProtocol.d.ts +42 -1
  38. package/dist/protocols/KeyboardProtocol.d.ts +31 -1
  39. package/dist/protocols/SharingProtocol.d.ts +11 -1
  40. package/dist/protocols/index.d.ts +0 -1
  41. package/dist/protocols/index.js +8 -1
  42. package/dist/registry/Registry.d.ts +24 -0
  43. package/dist/theme/ThemeEngine.d.ts +0 -8
  44. package/dist/theme/ThemeEngine.js +22 -103
  45. package/dist/theme/index.d.ts +1 -1
  46. package/dist/theme/index.js +7 -1
  47. package/dist/types/index.d.ts +42 -8
  48. package/dist/utils/chart-series.d.ts +258 -5
  49. package/dist/utils/chart-series.js +423 -20
  50. package/dist/utils/compare-to.d.ts +40 -13
  51. package/dist/utils/compare-to.js +4 -32
  52. package/dist/utils/dashboard-filters.d.ts +54 -8
  53. package/dist/utils/dashboard-filters.js +261 -12
  54. package/dist/utils/dataset-format.d.ts +79 -15
  55. package/dist/utils/dataset-format.js +130 -9
  56. package/dist/utils/dataset-pivot.d.ts +78 -0
  57. package/dist/utils/dataset-pivot.js +78 -0
  58. package/dist/utils/dom-props.d.ts +137 -0
  59. package/dist/utils/dom-props.js +153 -0
  60. package/dist/utils/filter-converter.d.ts +39 -11
  61. package/dist/utils/filter-converter.js +87 -7
  62. package/dist/utils/normalize-list-view.d.ts +26 -6
  63. package/dist/utils/normalize-list-view.js +30 -8
  64. package/dist/utils/number-display.d.ts +151 -0
  65. package/dist/utils/number-display.js +71 -0
  66. package/dist/utils/predicate-fields.d.ts +96 -0
  67. package/dist/utils/predicate-fields.js +163 -0
  68. package/dist/utils/predicate-record.d.ts +32 -0
  69. package/dist/utils/predicate-record.js +120 -0
  70. package/dist/utils/record-title.js +0 -0
  71. package/dist/utils/resolve-view-id.d.ts +31 -0
  72. package/dist/utils/resolve-view-id.js +45 -0
  73. package/dist/utils/sort-query.d.ts +55 -0
  74. package/dist/utils/sort-query.js +35 -0
  75. package/package.json +5 -5
  76. package/dist/protocols/NotificationProtocol.d.ts +0 -71
  77. package/dist/protocols/NotificationProtocol.js +0 -89
  78. package/dist/utils/merge-views-into-objects.d.ts +0 -19
  79. package/dist/utils/merge-views-into-objects.js +0 -39
@@ -1,89 +0,0 @@
1
- /**
2
- * ObjectUI
3
- * Copyright (c) 2024-present ObjectStack Inc.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- // ============================================================================
9
- // Severity → Variant Mapping
10
- // ============================================================================
11
- const SEVERITY_TO_VARIANT = {
12
- info: 'default',
13
- success: 'success',
14
- warning: 'warning',
15
- error: 'destructive',
16
- };
17
- /**
18
- * Map a spec notification severity to a toast variant string.
19
- *
20
- * @param severity - Spec severity (info, success, warning, error)
21
- * @returns Toast variant (default, success, warning, destructive)
22
- */
23
- export function mapSeverityToVariant(severity) {
24
- return SEVERITY_TO_VARIANT[severity] ?? 'default';
25
- }
26
- // ============================================================================
27
- // Position Mapping
28
- // ============================================================================
29
- const POSITION_MAP = {
30
- top_left: 'top-left',
31
- top_center: 'top-center',
32
- top_right: 'top-right',
33
- bottom_left: 'bottom-left',
34
- bottom_center: 'bottom-center',
35
- bottom_right: 'bottom-right',
36
- };
37
- /**
38
- * Map a spec notification position (underscore-separated) to a
39
- * toast position string (hyphen-separated).
40
- *
41
- * @param position - Spec position (e.g. "top_right")
42
- * @returns Toast position (e.g. "top-right")
43
- */
44
- export function mapPosition(position) {
45
- return POSITION_MAP[position] ?? 'top-right';
46
- }
47
- // ============================================================================
48
- // Notification Config Resolution
49
- // ============================================================================
50
- /**
51
- * Resolve a notification configuration by applying spec defaults.
52
- *
53
- * @param config - NotificationConfig from the spec
54
- * @returns Fully resolved notification configuration
55
- */
56
- export function resolveNotificationConfig(config) {
57
- return {
58
- defaultPosition: config.defaultPosition ?? 'top_right',
59
- defaultDuration: config.defaultDuration ?? 5000,
60
- maxVisible: config.maxVisible ?? 5,
61
- stackDirection: config.stackDirection ?? 'down',
62
- pauseOnHover: config.pauseOnHover ?? true,
63
- };
64
- }
65
- // ============================================================================
66
- // Spec Notification → Toast
67
- // ============================================================================
68
- /**
69
- * Convert a spec Notification to a toast-compatible object.
70
- *
71
- * @param notification - Spec Notification
72
- * @returns Toast-compatible notification with title, description, variant, etc.
73
- */
74
- export function specNotificationToToast(notification) {
75
- const actions = (notification.actions ?? []).map((a) => ({
76
- label: a.label,
77
- action: a.action,
78
- variant: a.variant ?? 'primary',
79
- }));
80
- return {
81
- title: notification.title,
82
- description: notification.message ?? '',
83
- variant: mapSeverityToVariant(notification.severity ?? 'info'),
84
- position: mapPosition(notification.position ?? 'top_right'),
85
- duration: notification.duration ?? 5000,
86
- dismissible: notification.dismissible ?? true,
87
- actions,
88
- };
89
- }
@@ -1,19 +0,0 @@
1
- /**
2
- * ObjectUI
3
- * Copyright (c) 2024-present ObjectStack Inc.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- /**
9
- * Adapter: merge stack-level views into object definitions.
10
- *
11
- * Views are defined at the stack level (views[].listViews) but the runtime
12
- * expects listViews on each object definition. This bridges the gap until
13
- * the runtime/provider layer handles it natively.
14
- *
15
- * @param objects - Object definitions from composed stack
16
- * @param views - View definitions containing listViews keyed by object name
17
- * @returns Objects with listViews merged in from matching views
18
- */
19
- export declare function mergeViewsIntoObjects(objects: any[], views: any[]): any[];
@@ -1,39 +0,0 @@
1
- /**
2
- * ObjectUI
3
- * Copyright (c) 2024-present ObjectStack Inc.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- /**
9
- * Adapter: merge stack-level views into object definitions.
10
- *
11
- * Views are defined at the stack level (views[].listViews) but the runtime
12
- * expects listViews on each object definition. This bridges the gap until
13
- * the runtime/provider layer handles it natively.
14
- *
15
- * @param objects - Object definitions from composed stack
16
- * @param views - View definitions containing listViews keyed by object name
17
- * @returns Objects with listViews merged in from matching views
18
- */
19
- export function mergeViewsIntoObjects(objects, views) {
20
- const viewsByObject = {};
21
- for (const view of views) {
22
- if (!view.listViews)
23
- continue;
24
- for (const [viewName, listView] of Object.entries(view.listViews)) {
25
- const objectName = listView?.data?.object;
26
- if (!objectName)
27
- continue;
28
- if (!viewsByObject[objectName])
29
- viewsByObject[objectName] = {};
30
- viewsByObject[objectName][viewName] = listView;
31
- }
32
- }
33
- return objects.map((obj) => {
34
- const v = viewsByObject[obj.name];
35
- if (!v)
36
- return obj;
37
- return { ...obj, listViews: { ...(obj.listViews || {}), ...v } };
38
- });
39
- }