@declarion/react 0.31.2 → 0.34.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 (55) hide show
  1. package/dist-lib/{ActionRunner-BzaZQtiI.js → ActionRunner-UGGvGypS.js} +925 -788
  2. package/dist-lib/{DraggableChildrenTable-DILqStHQ.js → DraggableChildrenTable-CljdYXd_.js} +30 -30
  3. package/dist-lib/DynamicIcon-BWO6QtNF.js +261 -0
  4. package/dist-lib/{Grid-BIsiUwPh.js → Grid-5Y_iPqNW.js} +2 -2
  5. package/dist-lib/{LayoutRenderer-3RvIsC9M.js → LayoutRenderer-CoTMmvNW.js} +670 -670
  6. package/dist-lib/{MarkdownRenderer-CaHhWrfm.js → MarkdownRenderer-unbncYEV.js} +1 -1
  7. package/dist-lib/RefreshControl-oeKhCjEC.js +837 -0
  8. package/dist-lib/SmartDetailPage.impl-Caxd97q6.js +1771 -0
  9. package/dist-lib/{SmartRecordListPage.impl-B1iws8yf.js → SmartRecordListPage.impl-BF_ieDc2.js} +253 -253
  10. package/dist-lib/api/data.d.ts +4 -4
  11. package/dist-lib/api/params.d.ts +1 -1
  12. package/dist-lib/components/layout/Rail.d.ts +5 -5
  13. package/dist-lib/components/layout/TopBar.d.ts +3 -1
  14. package/dist-lib/components/pages/DocumentsMenu.d.ts +22 -0
  15. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +42 -0
  16. package/dist-lib/components/pages/auth/AuthShell.d.ts +1 -1
  17. package/dist-lib/components/pages/list/ListHeader.d.ts +1 -11
  18. package/dist-lib/components/primitives/BrandLogo.d.ts +1 -1
  19. package/dist-lib/components/primitives/Icons.d.ts +1 -0
  20. package/dist-lib/components/primitives/Tooltip.d.ts +30 -0
  21. package/dist-lib/components/primitives/index.d.ts +2 -0
  22. package/dist-lib/components/shared/ActionResultDialog.d.ts +4 -0
  23. package/dist-lib/components/shared/ActionRunner.d.ts +1 -0
  24. package/dist-lib/components/shared/ObjectActionBar.d.ts +29 -0
  25. package/dist-lib/components/shared/PageHeader.d.ts +1 -1
  26. package/dist-lib/components/shared/RecordHeader.d.ts +3 -1
  27. package/dist-lib/components/shared/RefreshControl.d.ts +6 -0
  28. package/dist-lib/components/shared/ResponsiveActionBar.d.ts +9 -1
  29. package/dist-lib/hooks/useBranding.d.ts +8 -0
  30. package/dist-lib/hooks/useBrandingChrome.d.ts +6 -0
  31. package/dist-lib/hooks/useLiveObject.d.ts +9 -0
  32. package/dist-lib/hooks/useMutations.d.ts +3 -3
  33. package/dist-lib/hooks/useObject.d.ts +10 -0
  34. package/dist-lib/hooks/usePageStateRuntime.d.ts +1 -1
  35. package/dist-lib/hooks/useParams.d.ts +10 -1
  36. package/dist-lib/icons.js +1 -1
  37. package/dist-lib/index.d.ts +11 -5
  38. package/dist-lib/index.js +2457 -2335
  39. package/dist-lib/lib/actions.d.ts +6 -2
  40. package/dist-lib/lib/branding.d.ts +10 -1
  41. package/dist-lib/lib/document-templates.d.ts +12 -0
  42. package/dist-lib/lib/download.d.ts +20 -0
  43. package/dist-lib/lib/record-documents-key.d.ts +1 -0
  44. package/dist-lib/{registry-2KliNTHB.js → registry-DnPK3Msj.js} +1658 -1607
  45. package/dist-lib/testing.d.ts +5 -3
  46. package/dist-lib/testing.js +37 -33
  47. package/dist-lib/types/api.d.ts +62 -3
  48. package/dist-lib/types/schema.d.ts +18 -16
  49. package/dist-lib/{useProperties-Co3RdtuT.js → useProperties-CgRhBh0k.js} +70 -70
  50. package/dist-lib/{value-BooGwUik.js → value-GmL5BVFm.js} +29 -29
  51. package/package.json +1 -1
  52. package/dist-lib/DynamicIcon-DCRdxxZ7.js +0 -260
  53. package/dist-lib/SmartDetailPage.impl--EO-9fos.js +0 -1494
  54. package/dist-lib/hooks/useEntityItem.d.ts +0 -10
  55. package/dist-lib/peekDraftStore-yyzMbaiI.js +0 -468
@@ -18,6 +18,8 @@ export declare function rowDetailId(row: Record<string, unknown> | undefined, en
18
18
  * An action with no conditions is always available.
19
19
  */
20
20
  export declare function evaluateConditions(conditions: ActionCondition[] | undefined, row: Record<string, unknown>): boolean;
21
+ export declare function actionConditionFieldValue(row: Record<string, unknown>, field: string): unknown;
22
+ export declare function withActionConditionFields<T extends Record<string, unknown>>(row: T): T;
21
23
  /**
22
24
  * Returns actions from an entity whose visibility array contains the given
23
25
  * placement. Canonical values: detail | list_row | list_toolbar | app_menu |
@@ -116,8 +118,9 @@ export type ResolvedActionLayoutNode = ResolvedActionLeaf | ResolvedActionGroup;
116
118
  *
117
119
  * Disable conditions:
118
120
  * - enabled_if conditions not satisfied by row -> leaf enabled=false + reason set
119
- * - For bulk (rowSelection.length > 1): disabled if ANY selected row fails enabled_if
120
- * (plan §5: "disabled if ANY row fails"). Reason is from the first failing row.
121
+ * - For bulk (rowSelection.length > 0): visible when ANY selected row satisfies
122
+ * visible_if; enabled only when ALL selected rows satisfy visible_if and
123
+ * enabled_if. Reason carries the failing count.
121
124
  *
122
125
  * @param layout RBAC-pruned tree from the server (or resolveActionLayout client-side).
123
126
  * @param entityActions Entity-level actions map (entity wins on code collision).
@@ -170,6 +173,7 @@ export declare function filterLayoutForSlot(layout: ResolvedActionLayoutNode[],
170
173
  bulkRequiredPredicate?: (action: Action) => boolean;
171
174
  excludeIf?: (action: Action) => boolean;
172
175
  }): ResolvedActionLayoutNode[];
176
+ export declare function resolveActionLayoutForSlot(screenActionLayout: ResolvedActionLayoutNode[] | null | undefined, entityActionLayout: ResolvedActionLayoutNode[] | null | undefined, entityActions: Record<string, Action> | undefined, globalActions: Record<string, Action> | undefined, slot: string, opts?: Parameters<typeof filterLayoutForSlot>[4]): ResolvedActionLayoutNode[];
173
177
  /**
174
178
  * True when an action needs at least one selected row to be meaningful, so a
175
179
  * surface (the list toolbar) greys it while nothing is selected and enables it
@@ -1,6 +1,15 @@
1
+ import type { BrandingChrome, BrandingIdentity, BrandingTheme, PublicBranding, PublicParam, PublicParamsResponse } from "../types/api";
2
+ export declare const BRANDING_PARAM_CODE = "branding";
3
+ export declare function paramsToRecord(list: PublicParam[] | undefined): Record<string, unknown>;
4
+ export declare function publicParamValue(publicParams: PublicParamsResponse | undefined, code: string): unknown;
5
+ export declare function getPublicBranding(publicParams: PublicParamsResponse | undefined): PublicBranding | undefined;
6
+ export declare function brandingFromValue(value: unknown): PublicBranding | undefined;
7
+ export declare function getBrandingIdentity(publicParams: PublicParamsResponse | undefined): BrandingIdentity | undefined;
8
+ export declare function getBrandingTheme(publicParams: PublicParamsResponse | undefined): BrandingTheme | undefined;
9
+ export declare function getBrandingChrome(publicParams: PublicParamsResponse | undefined): BrandingChrome | undefined;
1
10
  /**
2
11
  * Returns true when `value` is a renderable logo URL. Accepts:
3
- * - root-relative paths ("/logo.png"), served from the UI bundle root;
12
+ * - root-relative paths ("/logo.png" or "/modules/<module>/public/logo.png");
4
13
  * - absolute http(s) URLs;
5
14
  * - data:image/... URIs.
6
15
  *
@@ -0,0 +1,12 @@
1
+ import type { Schema } from "../types/schema";
2
+ /**
3
+ * Heuristic used by DocumentsMenu mount sites to decide whether the caller
4
+ * can manage TENANT document templates: the `document_template` entity is
5
+ * present in the projected schema (schema.entities is already RBAC-pruned -
6
+ * `document_template` appears only when the caller can read it). Gates the
7
+ * lazy `document.templates.available` tenant-template visibility probe
8
+ * (Business Case 6, plan 2026-07-08-document-generation-hardening) so a
9
+ * caller who cannot manage templates never fires it - the Haia default.
10
+ * One shared predicate so SmartDetailPage and SmartListPage agree.
11
+ */
12
+ export declare function canManageDocumentTemplates(schema: Schema | undefined): boolean;
@@ -0,0 +1,20 @@
1
+ export declare class DownloadError extends Error {
2
+ readonly code?: string | undefined;
3
+ constructor(message: string, code?: string | undefined);
4
+ }
5
+ /** True when `err` is the download failing because the underlying blob is
6
+ * gone (purged, superseded, never generated). Callers use this to disable a
7
+ * dead Download button instead of leaving it re-clickable against nothing. */
8
+ export declare function isMissingArtifactError(err: unknown): boolean;
9
+ /**
10
+ * Fetches `url` as an authenticated (same-origin cookie) request, then
11
+ * triggers a browser download of the resulting blob. Refuses any URL whose
12
+ * scheme is not in the safeExternalUrl allowlist (http/https/mailto/relative)
13
+ * BEFORE issuing the fetch - a `javascript:`/`data:` URL never reaches
14
+ * `fetch` or an anchor's `href`.
15
+ *
16
+ * Blob-fetch (not a bare `<a href>`) so a non-2xx response (404 FILE_NOT_FOUND,
17
+ * 403, etc.) surfaces as a thrown DownloadError instead of silently
18
+ * navigating the browser to an error page.
19
+ */
20
+ export declare function downloadFile(url: string, filename?: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const RECORD_DOCUMENTS_KEY: "record-documents";