@loj-lang/rdsl-runtime 0.5.0 → 0.6.1

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 (125) hide show
  1. package/dist/components/Badge.d.ts +2 -1
  2. package/dist/components/Badge.d.ts.map +1 -1
  3. package/dist/components/Badge.js +2 -2
  4. package/dist/components/ConfirmDialog.d.ts +6 -1
  5. package/dist/components/ConfirmDialog.d.ts.map +1 -1
  6. package/dist/components/ConfirmDialog.js +35 -6
  7. package/dist/components/DataTable.d.ts +35 -2
  8. package/dist/components/DataTable.d.ts.map +1 -1
  9. package/dist/components/DataTable.js +64 -38
  10. package/dist/components/DropdownButton.d.ts +11 -0
  11. package/dist/components/DropdownButton.d.ts.map +1 -0
  12. package/dist/components/DropdownButton.js +9 -0
  13. package/dist/components/ErrorBoundary.d.ts +18 -0
  14. package/dist/components/ErrorBoundary.d.ts.map +1 -0
  15. package/dist/components/ErrorBoundary.js +19 -0
  16. package/dist/components/ErrorState.d.ts +6 -0
  17. package/dist/components/ErrorState.d.ts.map +1 -0
  18. package/dist/components/ErrorState.js +25 -0
  19. package/dist/components/FilterBar.d.ts +2 -0
  20. package/dist/components/FilterBar.d.ts.map +1 -1
  21. package/dist/components/FilterBar.js +3 -2
  22. package/dist/components/FormField.d.ts +7 -2
  23. package/dist/components/FormField.d.ts.map +1 -1
  24. package/dist/components/FormField.js +16 -5
  25. package/dist/components/GroupedDataTable.d.ts.map +1 -1
  26. package/dist/components/GroupedDataTable.js +40 -59
  27. package/dist/components/Pagination.js +1 -1
  28. package/dist/components/PivotDataTable.d.ts.map +1 -1
  29. package/dist/components/PivotDataTable.js +42 -65
  30. package/dist/components/Tag.d.ts +2 -1
  31. package/dist/components/Tag.d.ts.map +1 -1
  32. package/dist/components/Tag.js +2 -2
  33. package/dist/components/WorkflowSummary.js +6 -6
  34. package/dist/components/readFormatting.d.ts +2 -0
  35. package/dist/components/readFormatting.d.ts.map +1 -0
  36. package/dist/components/readFormatting.js +1 -0
  37. package/dist/derivations.d.ts +3 -0
  38. package/dist/derivations.d.ts.map +1 -0
  39. package/dist/derivations.js +1 -0
  40. package/dist/hooks/browserStorage.d.ts +3 -0
  41. package/dist/hooks/browserStorage.d.ts.map +1 -0
  42. package/dist/hooks/browserStorage.js +1 -0
  43. package/dist/hooks/deleteConfirmation.d.ts +20 -0
  44. package/dist/hooks/deleteConfirmation.d.ts.map +1 -0
  45. package/dist/hooks/deleteConfirmation.js +21 -0
  46. package/dist/hooks/exportDownload.d.ts +16 -0
  47. package/dist/hooks/exportDownload.d.ts.map +1 -0
  48. package/dist/hooks/exportDownload.js +55 -0
  49. package/dist/hooks/formDerivations.d.ts +7 -0
  50. package/dist/hooks/formDerivations.d.ts.map +1 -0
  51. package/dist/hooks/formDerivations.js +23 -0
  52. package/dist/hooks/formSeeds.d.ts +12 -0
  53. package/dist/hooks/formSeeds.d.ts.map +1 -0
  54. package/dist/hooks/formSeeds.js +26 -0
  55. package/dist/hooks/navigation.d.ts +37 -0
  56. package/dist/hooks/navigation.d.ts.map +1 -1
  57. package/dist/hooks/navigation.js +107 -70
  58. package/dist/hooks/readModelStore.d.ts +29 -0
  59. package/dist/hooks/readModelStore.d.ts.map +1 -0
  60. package/dist/hooks/readModelStore.js +135 -0
  61. package/dist/hooks/recordScopedWorkflow.d.ts +13 -0
  62. package/dist/hooks/recordScopedWorkflow.d.ts.map +1 -0
  63. package/dist/hooks/recordScopedWorkflow.js +40 -0
  64. package/dist/hooks/resourceClient.d.ts +39 -0
  65. package/dist/hooks/resourceClient.d.ts.map +1 -1
  66. package/dist/hooks/resourceClient.js +205 -71
  67. package/dist/hooks/resourceErrors.d.ts +13 -0
  68. package/dist/hooks/resourceErrors.d.ts.map +1 -0
  69. package/dist/hooks/resourceErrors.js +140 -0
  70. package/dist/hooks/resourceRowActions.d.ts +17 -0
  71. package/dist/hooks/resourceRowActions.d.ts.map +1 -0
  72. package/dist/hooks/resourceRowActions.js +48 -0
  73. package/dist/hooks/resourceStore.d.ts +2 -24
  74. package/dist/hooks/resourceStore.d.ts.map +1 -1
  75. package/dist/hooks/resourceStore.js +1 -164
  76. package/dist/hooks/resourceTarget.d.ts +1 -1
  77. package/dist/hooks/resourceTarget.d.ts.map +1 -1
  78. package/dist/hooks/resourceTarget.js +1 -22
  79. package/dist/hooks/serverListStore.d.ts +3 -0
  80. package/dist/hooks/serverListStore.d.ts.map +1 -0
  81. package/dist/hooks/serverListStore.js +1 -0
  82. package/dist/hooks/sessionCaches.d.ts +6 -0
  83. package/dist/hooks/sessionCaches.d.ts.map +1 -0
  84. package/dist/hooks/sessionCaches.js +14 -0
  85. package/dist/hooks/transitionedSetter.d.ts +2 -0
  86. package/dist/hooks/transitionedSetter.d.ts.map +1 -0
  87. package/dist/hooks/transitionedSetter.js +9 -0
  88. package/dist/hooks/useAuth.d.ts +18 -0
  89. package/dist/hooks/useAuth.d.ts.map +1 -1
  90. package/dist/hooks/useAuth.js +30 -0
  91. package/dist/hooks/useCollectionView.d.ts +2 -8
  92. package/dist/hooks/useCollectionView.d.ts.map +1 -1
  93. package/dist/hooks/useCollectionView.js +8 -36
  94. package/dist/hooks/useDocumentMetadata.d.ts.map +1 -1
  95. package/dist/hooks/useDocumentMetadata.js +57 -0
  96. package/dist/hooks/useGroupedCollectionView.d.ts +2 -7
  97. package/dist/hooks/useGroupedCollectionView.d.ts.map +1 -1
  98. package/dist/hooks/useGroupedCollectionView.js +8 -52
  99. package/dist/hooks/useI18n.d.ts +21 -0
  100. package/dist/hooks/useI18n.d.ts.map +1 -0
  101. package/dist/hooks/useI18n.js +86 -0
  102. package/dist/hooks/useReadModel.d.ts +15 -0
  103. package/dist/hooks/useReadModel.d.ts.map +1 -1
  104. package/dist/hooks/useReadModel.js +127 -40
  105. package/dist/hooks/useResource.d.ts +7 -0
  106. package/dist/hooks/useResource.d.ts.map +1 -1
  107. package/dist/hooks/useResource.js +159 -3
  108. package/dist/hooks/useStoredState.d.ts +15 -0
  109. package/dist/hooks/useStoredState.d.ts.map +1 -0
  110. package/dist/hooks/useStoredState.js +28 -0
  111. package/dist/hooks/useToast.d.ts.map +1 -1
  112. package/dist/hooks/useToast.js +1 -1
  113. package/dist/hooks/workflowTransition.d.ts +21 -0
  114. package/dist/hooks/workflowTransition.d.ts.map +1 -0
  115. package/dist/hooks/workflowTransition.js +54 -0
  116. package/dist/index.d.ts +35 -9
  117. package/dist/index.d.ts.map +1 -1
  118. package/dist/index.js +21 -5
  119. package/dist/policies/can.d.ts +2 -14
  120. package/dist/policies/can.d.ts.map +1 -1
  121. package/dist/policies/can.js +1 -160
  122. package/dist/workflow.d.ts +3 -0
  123. package/dist/workflow.d.ts.map +1 -0
  124. package/dist/workflow.js +1 -0
  125. package/package.json +142 -26
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import { navigateToAppHref } from './navigation.js';
3
+ import { resolveDisplayableErrorMessage, resolveWorkflowActionError, resolveWorkflowPreconditionError } from './resourceErrors.js';
4
+ import { useToast } from './useToast.js';
5
+ export function useWorkflowTransitionHandler(options) {
6
+ const toast = useToast();
7
+ const transitionInFlightRef = React.useRef(false);
8
+ return React.useCallback(async (transitionName) => {
9
+ if (transitionInFlightRef.current) {
10
+ return;
11
+ }
12
+ transitionInFlightRef.current = true;
13
+ try {
14
+ options.setPreconditionError(null);
15
+ await options.resourceClient.post(`${options.resourceApi}/${encodeURIComponent(options.id)}/transitions/${encodeURIComponent(transitionName)}`);
16
+ toast.success(options.updatedMessage);
17
+ const transitionedState = options.workflowTransitionTargets[transitionName] ?? null;
18
+ const nextStepHref = transitionedState ? options.resolveNextWorkflowSurfaceHref(transitionedState) : null;
19
+ if (navigateToAppHref(nextStepHref)) {
20
+ return;
21
+ }
22
+ await options.resourceView.refresh();
23
+ }
24
+ catch (err) {
25
+ const workflowPreconditionError = resolveWorkflowPreconditionError(err, options.preconditionMessage);
26
+ if (workflowPreconditionError) {
27
+ options.setPreconditionError(workflowPreconditionError);
28
+ return;
29
+ }
30
+ const workflowActionError = resolveWorkflowActionError(err, options.invalidTransitionMessage);
31
+ if (workflowActionError) {
32
+ options.setPreconditionError(workflowActionError);
33
+ return;
34
+ }
35
+ toast.error(resolveDisplayableErrorMessage(err, options.updateFailedMessage));
36
+ }
37
+ finally {
38
+ transitionInFlightRef.current = false;
39
+ }
40
+ }, [
41
+ options.id,
42
+ options.invalidTransitionMessage,
43
+ options.preconditionMessage,
44
+ options.resourceApi,
45
+ options.resourceClient,
46
+ options.resourceView,
47
+ options.resolveNextWorkflowSurfaceHref,
48
+ options.setPreconditionError,
49
+ options.updateFailedMessage,
50
+ options.updatedMessage,
51
+ options.workflowTransitionTargets,
52
+ toast,
53
+ ]);
54
+ }
package/dist/index.d.ts CHANGED
@@ -10,14 +10,21 @@ export { Pagination } from './components/Pagination.js';
10
10
  export type { PaginationProps } from './components/Pagination.js';
11
11
  export { FormField } from './components/FormField.js';
12
12
  export type { FieldSchema, FormFieldProps } from './components/FormField.js';
13
+ export { ErrorState } from './components/ErrorState.js';
14
+ export type { ErrorStateProps } from './components/ErrorState.js';
15
+ export { ErrorBoundary } from './components/ErrorBoundary.js';
16
+ export type { ErrorBoundaryProps } from './components/ErrorBoundary.js';
13
17
  export { WorkflowSummary } from './components/WorkflowSummary.js';
14
18
  export type { WorkflowSummaryProps, WorkflowSummaryStep } from './components/WorkflowSummary.js';
15
- export { Tag } from './components/Tag.js';
16
- export type { TagProps } from './components/Tag.js';
17
- export { Badge } from './components/Badge.js';
18
- export type { BadgeProps } from './components/Badge.js';
19
+ export { applyDerivedListItems, nativeExprCallBuiltin, applyDerivedObjectFields, nativeExprEquals, nativeExprInList, nativeExprLike, nativeExprQuantifier, nativeExprReadPath, } from './derivations.js';
20
+ export type { CompiledDerivationEntry } from './derivations.js';
21
+ export { resolveWorkflowStepResolution } from './workflow.js';
22
+ export type { WorkflowStepResolution } from './workflow.js';
19
23
  export { ConfirmDialog } from './components/ConfirmDialog.js';
20
24
  export type { ConfirmDialogProps } from './components/ConfirmDialog.js';
25
+ export { DropdownButton, MenuItem } from './components/DropdownButton.js';
26
+ export type { DropdownButtonProps, MenuItemProps } from './components/DropdownButton.js';
27
+ export { formatReadValue, resolveModelDisplayValue } from './components/readFormatting.js';
21
28
  export { useResource } from './hooks/useResource.js';
22
29
  export type { ResourcePaginationState, UseResourceOptions, UseResourceResult } from './hooks/useResource.js';
23
30
  export { useReadModel } from './hooks/useReadModel.js';
@@ -26,17 +33,36 @@ export { useCollectionView } from './hooks/useCollectionView.js';
26
33
  export type { CollectionPaginationState, CollectionSortState, UseCollectionViewOptions, UseCollectionViewResult, } from './hooks/useCollectionView.js';
27
34
  export { useGroupedCollectionView } from './hooks/useGroupedCollectionView.js';
28
35
  export type { GroupedCollectionViewGroup, UseGroupedCollectionViewOptions, UseGroupedCollectionViewResult, } from './hooks/useGroupedCollectionView.js';
29
- export { createFetchResourceClient, createMemoryResourceClient, ResourceProvider, useResourceClient, } from './hooks/resourceClient.js';
30
- export type { FetchResourceClientOptions, ResourceClient, ResourceProviderProps, } from './hooks/resourceClient.js';
36
+ export { createFetchResourceClient, createMemoryResourceClient, ResourceClientError, ResourceProvider, useResourceClient, } from './hooks/resourceClient.js';
37
+ export type { FetchResourceClientOptions, ResourceClient, ResourceClientErrorInit, ResourceFieldError, ResourceProviderProps, } from './hooks/resourceClient.js';
31
38
  export { useToast, ToastProvider } from './hooks/useToast.js';
32
39
  export { resolveToastMessage } from './hooks/useToast.js';
33
40
  export type { ToastApi, ToastMessage, ToastMessageDescriptor, ToastMessageValue } from './hooks/useToast.js';
34
- export { useAuth, AuthProvider } from './hooks/useAuth.js';
35
- export type { AuthState, AuthUser } from './hooks/useAuth.js';
41
+ export { I18nProvider, humanizeEnumValue, resolveEnumValueText, resolveMessageText, resolveMessageTextWithBundle, useI18n } from './hooks/useI18n.js';
42
+ export type { I18nBundle, I18nMessage, I18nMessageDescriptor, I18nMessageValue, I18nState } from './hooks/useI18n.js';
43
+ export { useAuth, useAuthAccessToken, AuthProvider } from './hooks/useAuth.js';
44
+ export type { AuthLoginProvider, AuthSession, AuthState, AuthUser } from './hooks/useAuth.js';
36
45
  export { useDocumentMetadata } from './hooks/useDocumentMetadata.js';
37
46
  export type { DocumentMetadata } from './hooks/useDocumentMetadata.js';
38
- export { configureAppBasePath, getConfiguredAppBasePath, getCurrentAppHref, getCurrentAppPathname, getLocationSearchParams, getLocationSearchValues, normalizeAppBasePath, prefixAppBasePath, replaceLocationSearchValues, getSanitizedReturnTo, sanitizeAppLocalHref, stripAppBasePath, } from './hooks/navigation.js';
47
+ export { resolveDisplayableErrorMessage, resolveStructuredFormError, resolveVersionConflictFormError, resolveWorkflowFormError, resolveWorkflowActionError, resolveWorkflowPreconditionError, } from './hooks/resourceErrors.js';
48
+ export { buildSeedParamAppliers } from './hooks/formSeeds.js';
49
+ export type { SeedParamApplier, SeedParamSpec } from './hooks/formSeeds.js';
50
+ export { buildDerivedFieldSetters } from './hooks/formDerivations.js';
51
+ export type { DerivedFieldSetterSpec } from './hooks/formDerivations.js';
52
+ export { useRecordScopedWorkflowSummary } from './hooks/recordScopedWorkflow.js';
53
+ export type { RecordScopedWorkflowSummaryOptions } from './hooks/recordScopedWorkflow.js';
54
+ export { useTransitionedSetter } from './hooks/transitionedSetter.js';
55
+ export { useDeleteConfirmation } from './hooks/deleteConfirmation.js';
56
+ export { useExportDownload } from './hooks/exportDownload.js';
57
+ export { useWorkflowTransitionHandler } from './hooks/workflowTransition.js';
58
+ export { readStoredJsonValue, writeStoredJsonValue } from './hooks/browserStorage.js';
59
+ export type { BrowserStorageKind } from './hooks/browserStorage.js';
60
+ export { useStoredState } from './hooks/useStoredState.js';
61
+ export type { StoredStateOptions, StoredStateResult, StoredStateStorageKind } from './hooks/useStoredState.js';
62
+ export { buildAppHrefWithSearchEntries, buildRelatedCollectionHref, buildRelatedCreateHref, buildResourceRecordHref, configureAppBasePath, getConfiguredAppBasePath, getCurrentAppHref, getCurrentAppPathname, getCurrentReturnToNavigation, getLocationSearchParams, getLocationSearchValues, navigateToAppHref, normalizeAppBasePath, prefixAppBasePath, replaceLocationSearchValues, useLocationSearchState, getSanitizedReturnTo, sanitizeAppLocalHref, stripAppBasePath, } from './hooks/navigation.js';
63
+ export type { AppHrefSearchEntry } from './hooks/navigation.js';
39
64
  export { can } from './policies/can.js';
40
65
  export { evaluatePolicyExpr, firstPolicyFailure, matchesPolicyRule, resolvePolicyMessage } from './policies/can.js';
41
66
  export type { PolicyContext } from './policies/can.js';
67
+ export { clearSessionCaches } from './hooks/sessionCaches.js';
42
68
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACrG,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,YAAY,EAAE,oBAAoB,EAAE,mB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A4B,EAC5B,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACpH,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -4,19 +4,35 @@ export { PivotDataTable } from './components/PivotDataTable.js';
4
4
  export { FilterBar } from './components/FilterBar.js';
5
5
  export { Pagination } from './components/Pagination.js';
6
6
  export { FormField } from './components/FormField.js';
7
+ export { ErrorState } from './components/ErrorState.js';
8
+ export { ErrorBoundary } from './components/ErrorBoundary.js';
7
9
  export { WorkflowSummary } from './components/WorkflowSummary.js';
8
- export { Tag } from './components/Tag.js';
9
- export { Badge } from './components/Badge.js';
10
+ export { applyDerivedListItems, nativeExprCallBuiltin, applyDerivedObjectFields, nativeExprEquals, nativeExprInList, nativeExprLike, nativeExprQuantifier, nativeExprReadPath, } from './derivations.js';
11
+ export { resolveWorkflowStepResolution } from './workflow.js';
10
12
  export { ConfirmDialog } from './components/ConfirmDialog.js';
13
+ export { DropdownButton, MenuItem } from './components/DropdownButton.js';
14
+ export { formatReadValue, resolveModelDisplayValue } from './components/readFormatting.js';
11
15
  export { useResource } from './hooks/useResource.js';
12
16
  export { useReadModel } from './hooks/useReadModel.js';
13
17
  export { useCollectionView } from './hooks/useCollectionView.js';
14
18
  export { useGroupedCollectionView } from './hooks/useGroupedCollectionView.js';
15
- export { createFetchResourceClient, createMemoryResourceClient, ResourceProvider, useResourceClient, } from './hooks/resourceClient.js';
19
+ export { createFetchResourceClient, createMemoryResourceClient, ResourceClientError, ResourceProvider, useResourceClient, } from './hooks/resourceClient.js';
16
20
  export { useToast, ToastProvider } from './hooks/useToast.js';
17
21
  export { resolveToastMessage } from './hooks/useToast.js';
18
- export { useAuth, AuthProvider } from './hooks/useAuth.js';
22
+ export { I18nProvider, humanizeEnumValue, resolveEnumValueText, resolveMessageText, resolveMessageTextWithBundle, useI18n } from './hooks/useI18n.js';
23
+ export { useAuth, useAuthAccessToken, AuthProvider } from './hooks/useAuth.js';
19
24
  export { useDocumentMetadata } from './hooks/useDocumentMetadata.js';
20
- export { configureAppBasePath, getConfiguredAppBasePath, getCurrentAppHref, getCurrentAppPathname, getLocationSearchParams, getLocationSearchValues, normalizeAppBasePath, prefixAppBasePath, replaceLocationSearchValues, getSanitizedReturnTo, sanitizeAppLocalHref, stripAppBasePath, } from './hooks/navigation.js';
25
+ export { resolveDisplayableErrorMessage, resolveStructuredFormError, resolveVersionConflictFormError, resolveWorkflowFormError, resolveWorkflowActionError, resolveWorkflowPreconditionError, } from './hooks/resourceErrors.js';
26
+ export { buildSeedParamAppliers } from './hooks/formSeeds.js';
27
+ export { buildDerivedFieldSetters } from './hooks/formDerivations.js';
28
+ export { useRecordScopedWorkflowSummary } from './hooks/recordScopedWorkflow.js';
29
+ export { useTransitionedSetter } from './hooks/transitionedSetter.js';
30
+ export { useDeleteConfirmation } from './hooks/deleteConfirmation.js';
31
+ export { useExportDownload } from './hooks/exportDownload.js';
32
+ export { useWorkflowTransitionHandler } from './hooks/workflowTransition.js';
33
+ export { readStoredJsonValue, writeStoredJsonValue } from './hooks/browserStorage.js';
34
+ export { useStoredState } from './hooks/useStoredState.js';
35
+ export { buildAppHrefWithSearchEntries, buildRelatedCollectionHref, buildRelatedCreateHref, buildResourceRecordHref, configureAppBasePath, getConfiguredAppBasePath, getCurrentAppHref, getCurrentAppPathname, getCurrentReturnToNavigation, getLocationSearchParams, getLocationSearchValues, navigateToAppHref, normalizeAppBasePath, prefixAppBasePath, replaceLocationSearchValues, useLocationSearchState, getSanitizedReturnTo, sanitizeAppLocalHref, stripAppBasePath, } from './hooks/navigation.js';
21
36
  export { can } from './policies/can.js';
22
37
  export { evaluatePolicyExpr, firstPolicyFailure, matchesPolicyRule, resolvePolicyMessage } from './policies/can.js';
38
+ export { clearSessionCaches } from './hooks/sessionCaches.js';
@@ -1,15 +1,3 @@
1
- export interface PolicyContext {
2
- currentUser?: unknown | null;
3
- record?: unknown | null;
4
- formData?: unknown | null;
5
- item?: unknown | null;
6
- input?: unknown | null;
7
- payload?: unknown | null;
8
- params?: unknown | null;
9
- }
10
- export declare function evaluatePolicyExpr(node: unknown, context: PolicyContext): unknown;
11
- export declare function matchesPolicyRule(rule: unknown, context: PolicyContext): boolean;
12
- export declare function resolvePolicyMessage(rule: unknown, fallback: string): string;
13
- export declare function firstPolicyFailure(rules: unknown, context: PolicyContext, fallback: string): string | null;
14
- export declare function can(rule: unknown, context: PolicyContext): boolean;
1
+ export { can, evaluatePolicyExpr, firstPolicyFailure, matchesPolicyRule, nativeExprCallBuiltin, resolvePolicyMessage, } from '../../../runtime-core/dist/can.js';
2
+ export type { CompiledPolicyExpr, CompiledPolicyPredicate, PolicyContext, } from '../../../runtime-core/dist/can.js';
15
3
  //# sourceMappingURL=can.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"can.d.ts","sourceRoot":"","sources":["../../src/policies/can.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAuID,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAYjF;AAaD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAKhF;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAK5E;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAUf;AAED,wBAAgB,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAGlE"}
1
+ {"version":3,"file":"can.d.ts","sourceRoot":"","sources":["../../src/policies/can.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,GACd,MAAM,mCAAmC,CAAC"}
@@ -1,160 +1 @@
1
- import { resolveMessageText } from '@loj-lang/shared-contracts';
2
- function isBuiltinRule(rule) {
3
- return typeof rule === 'object'
4
- && rule !== null
5
- && rule.source === 'builtin'
6
- && typeof rule.expr === 'object'
7
- && rule.expr !== null;
8
- }
9
- function isExprNode(node) {
10
- return typeof node === 'object'
11
- && node !== null
12
- && typeof node.type === 'string';
13
- }
14
- function isRuleEntryLike(rule) {
15
- return typeof rule === 'object' && rule !== null;
16
- }
17
- function resolveIdentifier(path, context) {
18
- if (!path || path.length === 0)
19
- return undefined;
20
- if (path.length === 1 && /^[A-Z][A-Z0-9_]*$/.test(path[0])) {
21
- return path[0];
22
- }
23
- let current = context;
24
- for (const segment of path) {
25
- if (current === null || current === undefined || typeof current !== 'object') {
26
- return undefined;
27
- }
28
- current = current[segment];
29
- }
30
- return current;
31
- }
32
- function isEmptyValue(value) {
33
- if (value === null || value === undefined || value === '')
34
- return true;
35
- if (Array.isArray(value))
36
- return value.length === 0;
37
- if (typeof value === 'object')
38
- return Object.keys(value).length === 0;
39
- return false;
40
- }
41
- function evalBuiltin(fn, args) {
42
- switch (fn) {
43
- case 'hasRole':
44
- return typeof args[1] === 'string' && Boolean(args[0]?.role === args[1]);
45
- case 'isOwner': {
46
- const user = args[0];
47
- const record = args[1];
48
- if (!user || !record)
49
- return false;
50
- return user.id === record.id || user.id === record.ownerId || user.id === record.userId;
51
- }
52
- case 'isEmpty':
53
- return isEmptyValue(args[0]);
54
- case 'isNotEmpty':
55
- return !isEmptyValue(args[0]);
56
- case 'count':
57
- if (Array.isArray(args[0]))
58
- return args[0].length;
59
- if (args[0] && typeof args[0] === 'object')
60
- return Object.keys(args[0]).length;
61
- return 0;
62
- default:
63
- return undefined;
64
- }
65
- }
66
- function evaluateExpr(node, context) {
67
- switch (node.type) {
68
- case 'literal':
69
- return node.value;
70
- case 'identifier':
71
- return resolveIdentifier(node.path, context);
72
- case 'member': {
73
- const object = node.object ? evaluateExpr(node.object, context) : undefined;
74
- if (!object || typeof object !== 'object' || !node.property)
75
- return undefined;
76
- return object[node.property];
77
- }
78
- case 'unary':
79
- return node.op === 'not' ? !Boolean(node.operand ? evaluateExpr(node.operand, context) : undefined) : undefined;
80
- case 'binary': {
81
- const left = node.left ? evaluateExpr(node.left, context) : undefined;
82
- const right = node.right ? evaluateExpr(node.right, context) : undefined;
83
- switch (node.op) {
84
- case '==': return left == right;
85
- case '!=': return left != right;
86
- case '>': return left > right;
87
- case '<': return left < right;
88
- case '>=': return left >= right;
89
- case '<=': return left <= right;
90
- case '&&': return Boolean(left) && Boolean(right);
91
- case '||': return Boolean(left) || Boolean(right);
92
- case '+': return Number(left ?? 0) + Number(right ?? 0);
93
- case '-': return Number(left ?? 0) - Number(right ?? 0);
94
- case '*': return Number(left ?? 0) * Number(right ?? 0);
95
- case '/': return Number(right ?? 0) === 0 ? undefined : Number(left ?? 0) / Number(right ?? 0);
96
- default: return undefined;
97
- }
98
- }
99
- case 'call':
100
- return evalBuiltin(node.fn ?? '', (node.args ?? []).map((arg) => evaluateExpr(arg, context)));
101
- case 'in': {
102
- const value = evaluateExpr(node.value, context);
103
- const list = (node.list ?? []).map((entry) => evaluateExpr(entry, context));
104
- return list.includes(value);
105
- }
106
- default:
107
- return undefined;
108
- }
109
- }
110
- export function evaluatePolicyExpr(node, context) {
111
- if (isBuiltinRule(node)) {
112
- return evaluateExpr(node.expr, context);
113
- }
114
- if (!isExprNode(node)) {
115
- return undefined;
116
- }
117
- try {
118
- return evaluateExpr(node, context);
119
- }
120
- catch {
121
- return undefined;
122
- }
123
- }
124
- function truthy(value) {
125
- return Boolean(value);
126
- }
127
- function anyPolicyRuleMatches(candidate, context) {
128
- if (!Array.isArray(candidate)) {
129
- return false;
130
- }
131
- return candidate.some((entry) => truthy(evaluatePolicyExpr(entry, context)));
132
- }
133
- export function matchesPolicyRule(rule, context) {
134
- if (!isRuleEntryLike(rule)) {
135
- return false;
136
- }
137
- return truthy(evaluatePolicyExpr(rule.when, context)) || anyPolicyRuleMatches(rule.or, context);
138
- }
139
- export function resolvePolicyMessage(rule, fallback) {
140
- if (!isRuleEntryLike(rule)) {
141
- return fallback;
142
- }
143
- return resolveMessageText(rule.message, fallback);
144
- }
145
- export function firstPolicyFailure(rules, context, fallback) {
146
- if (!Array.isArray(rules)) {
147
- return null;
148
- }
149
- for (const rule of rules) {
150
- if (!matchesPolicyRule(rule, context)) {
151
- return resolvePolicyMessage(rule, fallback);
152
- }
153
- }
154
- return null;
155
- }
156
- export function can(rule, context) {
157
- if (!isBuiltinRule(rule))
158
- return false;
159
- return truthy(evaluatePolicyExpr(rule, context));
160
- }
1
+ export { can, evaluatePolicyExpr, firstPolicyFailure, matchesPolicyRule, nativeExprCallBuiltin, resolvePolicyMessage, } from '../../../runtime-core/dist/can.js';
@@ -0,0 +1,3 @@
1
+ export type { WorkflowStepResolution } from '../../runtime-core/dist/workflow.js';
2
+ export { resolveWorkflowStepResolution } from '../../runtime-core/dist/workflow.js';
3
+ //# sourceMappingURL=workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1 @@
1
+ export { resolveWorkflowStepResolution } from '../../runtime-core/dist/workflow.js';
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@loj-lang/rdsl-runtime",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "ReactDSL runtime package for generated React/TypeScript apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
- "license": "Apache-2.0",
8
+ "license": "LicenseRef-Loj-SAL-1.0",
9
9
  "files": [
10
10
  "dist"
11
11
  ],
@@ -16,34 +16,150 @@
16
16
  "access": "public"
17
17
  },
18
18
  "exports": {
19
- ".": "./dist/index.js",
20
- "./components/DataTable": "./dist/components/DataTable.js",
21
- "./components/FilterBar": "./dist/components/FilterBar.js",
22
- "./components/Pagination": "./dist/components/Pagination.js",
23
- "./components/FormField": "./dist/components/FormField.js",
24
- "./components/Tag": "./dist/components/Tag.js",
25
- "./components/Badge": "./dist/components/Badge.js",
26
- "./components/ConfirmDialog": "./dist/components/ConfirmDialog.js",
27
- "./components/GroupedDataTable": "./dist/components/GroupedDataTable.js",
28
- "./components/PivotDataTable": "./dist/components/PivotDataTable.js",
29
- "./components/WorkflowSummary": "./dist/components/WorkflowSummary.js",
30
- "./hooks/navigation": "./dist/hooks/navigation.js",
31
- "./hooks/useResource": "./dist/hooks/useResource.js",
32
- "./hooks/useReadModel": "./dist/hooks/useReadModel.js",
33
- "./hooks/useCollectionView": "./dist/hooks/useCollectionView.js",
34
- "./hooks/useGroupedCollectionView": "./dist/hooks/useGroupedCollectionView.js",
35
- "./hooks/resourceClient": "./dist/hooks/resourceClient.js",
36
- "./hooks/useToast": "./dist/hooks/useToast.js",
37
- "./hooks/useAuth": "./dist/hooks/useAuth.js",
38
- "./hooks/useDocumentMetadata": "./dist/hooks/useDocumentMetadata.js",
39
- "./policies/can": "./dist/policies/can.js"
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "default": "./dist/index.js"
22
+ },
23
+ "./components/DataTable": {
24
+ "types": "./dist/components/DataTable.d.ts",
25
+ "default": "./dist/components/DataTable.js"
26
+ },
27
+ "./components/ErrorBoundary": {
28
+ "types": "./dist/components/ErrorBoundary.d.ts",
29
+ "default": "./dist/components/ErrorBoundary.js"
30
+ },
31
+ "./components/ErrorState": {
32
+ "types": "./dist/components/ErrorState.d.ts",
33
+ "default": "./dist/components/ErrorState.js"
34
+ },
35
+ "./components/FilterBar": {
36
+ "types": "./dist/components/FilterBar.d.ts",
37
+ "default": "./dist/components/FilterBar.js"
38
+ },
39
+ "./components/Pagination": {
40
+ "types": "./dist/components/Pagination.d.ts",
41
+ "default": "./dist/components/Pagination.js"
42
+ },
43
+ "./components/FormField": {
44
+ "types": "./dist/components/FormField.d.ts",
45
+ "default": "./dist/components/FormField.js"
46
+ },
47
+ "./components/ConfirmDialog": {
48
+ "types": "./dist/components/ConfirmDialog.d.ts",
49
+ "default": "./dist/components/ConfirmDialog.js"
50
+ },
51
+ "./components/DropdownButton": {
52
+ "types": "./dist/components/DropdownButton.d.ts",
53
+ "default": "./dist/components/DropdownButton.js"
54
+ },
55
+ "./components/readFormatting": {
56
+ "types": "./dist/components/readFormatting.d.ts",
57
+ "default": "./dist/components/readFormatting.js"
58
+ },
59
+ "./components/GroupedDataTable": {
60
+ "types": "./dist/components/GroupedDataTable.d.ts",
61
+ "default": "./dist/components/GroupedDataTable.js"
62
+ },
63
+ "./components/PivotDataTable": {
64
+ "types": "./dist/components/PivotDataTable.d.ts",
65
+ "default": "./dist/components/PivotDataTable.js"
66
+ },
67
+ "./components/WorkflowSummary": {
68
+ "types": "./dist/components/WorkflowSummary.d.ts",
69
+ "default": "./dist/components/WorkflowSummary.js"
70
+ },
71
+ "./derivations": {
72
+ "types": "./dist/derivations.d.ts",
73
+ "default": "./dist/derivations.js"
74
+ },
75
+ "./workflow": {
76
+ "types": "./dist/workflow.d.ts",
77
+ "default": "./dist/workflow.js"
78
+ },
79
+ "./hooks/navigation": {
80
+ "types": "./dist/hooks/navigation.d.ts",
81
+ "default": "./dist/hooks/navigation.js"
82
+ },
83
+ "./hooks/useResource": {
84
+ "types": "./dist/hooks/useResource.d.ts",
85
+ "default": "./dist/hooks/useResource.js"
86
+ },
87
+ "./hooks/useReadModel": {
88
+ "types": "./dist/hooks/useReadModel.d.ts",
89
+ "default": "./dist/hooks/useReadModel.js"
90
+ },
91
+ "./hooks/useCollectionView": {
92
+ "types": "./dist/hooks/useCollectionView.d.ts",
93
+ "default": "./dist/hooks/useCollectionView.js"
94
+ },
95
+ "./hooks/useGroupedCollectionView": {
96
+ "types": "./dist/hooks/useGroupedCollectionView.d.ts",
97
+ "default": "./dist/hooks/useGroupedCollectionView.js"
98
+ },
99
+ "./hooks/resourceClient": {
100
+ "types": "./dist/hooks/resourceClient.d.ts",
101
+ "default": "./dist/hooks/resourceClient.js"
102
+ },
103
+ "./hooks/resourceErrors": {
104
+ "types": "./dist/hooks/resourceErrors.d.ts",
105
+ "default": "./dist/hooks/resourceErrors.js"
106
+ },
107
+ "./hooks/formSeeds": {
108
+ "types": "./dist/hooks/formSeeds.d.ts",
109
+ "default": "./dist/hooks/formSeeds.js"
110
+ },
111
+ "./hooks/formDerivations": {
112
+ "types": "./dist/hooks/formDerivations.d.ts",
113
+ "default": "./dist/hooks/formDerivations.js"
114
+ },
115
+ "./hooks/recordScopedWorkflow": {
116
+ "types": "./dist/hooks/recordScopedWorkflow.d.ts",
117
+ "default": "./dist/hooks/recordScopedWorkflow.js"
118
+ },
119
+ "./hooks/transitionedSetter": {
120
+ "types": "./dist/hooks/transitionedSetter.d.ts",
121
+ "default": "./dist/hooks/transitionedSetter.js"
122
+ },
123
+ "./hooks/deleteConfirmation": {
124
+ "types": "./dist/hooks/deleteConfirmation.d.ts",
125
+ "default": "./dist/hooks/deleteConfirmation.js"
126
+ },
127
+ "./hooks/exportDownload": {
128
+ "types": "./dist/hooks/exportDownload.d.ts",
129
+ "default": "./dist/hooks/exportDownload.js"
130
+ },
131
+ "./hooks/workflowTransition": {
132
+ "types": "./dist/hooks/workflowTransition.d.ts",
133
+ "default": "./dist/hooks/workflowTransition.js"
134
+ },
135
+ "./hooks/useToast": {
136
+ "types": "./dist/hooks/useToast.d.ts",
137
+ "default": "./dist/hooks/useToast.js"
138
+ },
139
+ "./hooks/useI18n": {
140
+ "types": "./dist/hooks/useI18n.d.ts",
141
+ "default": "./dist/hooks/useI18n.js"
142
+ },
143
+ "./hooks/useAuth": {
144
+ "types": "./dist/hooks/useAuth.d.ts",
145
+ "default": "./dist/hooks/useAuth.js"
146
+ },
147
+ "./hooks/useDocumentMetadata": {
148
+ "types": "./dist/hooks/useDocumentMetadata.d.ts",
149
+ "default": "./dist/hooks/useDocumentMetadata.js"
150
+ },
151
+ "./policies/can": {
152
+ "types": "./dist/policies/can.d.ts",
153
+ "default": "./dist/policies/can.js"
154
+ }
40
155
  },
41
156
  "scripts": {
42
- "build": "tsc",
43
- "test": "vitest run"
157
+ "build": "npm run build --workspace=@loj-lang/rdsl-runtime-core && tsc",
158
+ "test": "npm run build --workspace=@loj-lang/rdsl-runtime-core && vitest run"
44
159
  },
45
160
  "dependencies": {
46
- "@loj-lang/shared-contracts": "^0.5.0"
161
+ "@loj-lang/rdsl-runtime-core": "0.6.0",
162
+ "@loj-lang/shared-contracts": "0.6.0"
47
163
  },
48
164
  "peerDependencies": {
49
165
  "react": "^18.0.0 || ^19.0.0"