@iota-uz/sdk 0.25.1 → 0.27.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 (104) hide show
  1. package/dist/client-host/identity.d.ts +4 -4
  2. package/dist/client-host/identity.js +2 -2
  3. package/dist/lens/{CascadePanel-Cujqv1pL.js → CascadePanel-CCOzLuq0.js} +64 -64
  4. package/dist/lens/{ChartDataEquivalent-C31BXZpe.js → ChartDataEquivalent-jAEMAHLz.js} +1 -1
  5. package/dist/lens/{ChartPanel-DIerec8R.js → ChartPanel-BM5BNY_0.js} +93 -93
  6. package/dist/lens/{CoveragePanel-Boyvj1Fs.js → CoveragePanel-D9dnY-z3.js} +20 -20
  7. package/dist/lens/DashboardPanels.d.ts +14 -0
  8. package/dist/lens/DashboardPanels.d.ts.map +1 -1
  9. package/dist/lens/{GaugePanel-D3muYFL2.js → GaugePanel-Da_8U-va.js} +12 -12
  10. package/dist/lens/LensDashboard.d.ts +24 -0
  11. package/dist/lens/LensDashboard.d.ts.map +1 -1
  12. package/dist/lens/{MapPanel-Ceq0E2Ek.js → MapPanel-C_5zKBAZ.js} +16 -16
  13. package/dist/lens/{MetricFlowPanel-D1KmjR32.js → MetricFlowPanel-CjIbdcGO.js} +28 -28
  14. package/dist/lens/{MetricHierarchyPanel-DgUyQl0W.js → MetricHierarchyPanel-B2P_uTgk.js} +17 -17
  15. package/dist/lens/{MetricRelationshipPanel-DMHalo2c.js → MetricRelationshipPanel-0d4fAcHP.js} +17 -17
  16. package/dist/lens/{PrintReport-ctxUL0F8.js → PrintReport-awUBISRB.js} +5 -5
  17. package/dist/lens/{TablePanel-Z9SiddhN.js → TablePanel-D46pk8E6.js} +213 -213
  18. package/dist/lens/{adapter-D4u_-czr.js → adapter-BJKTlRCi.js} +7 -7
  19. package/dist/lens/contract/schemas.d.ts +2 -0
  20. package/dist/lens/contract/schemas.d.ts.map +1 -1
  21. package/dist/lens/contract/types.d.ts +7 -0
  22. package/dist/lens/contract/types.d.ts.map +1 -1
  23. package/dist/lens/controls/FilterBar.d.ts +9 -2
  24. package/dist/lens/controls/FilterBar.d.ts.map +1 -1
  25. package/dist/lens/controls/ScopedFilterControls.d.ts.map +1 -1
  26. package/dist/lens/controls/toolbarOverflow.d.ts +5 -0
  27. package/dist/lens/controls/toolbarOverflow.d.ts.map +1 -0
  28. package/dist/lens/dashboardEdit-KuYE7jYk.js +284 -0
  29. package/dist/lens/explore/ExplorePanel.d.ts.map +1 -1
  30. package/dist/lens/icons.d.ts +8 -0
  31. package/dist/lens/icons.d.ts.map +1 -1
  32. package/dist/lens/{index-B8_gR9O0.js → index-BHhPCIjl.js} +1 -1
  33. package/dist/lens/index-C2oaf8ou.js +17066 -0
  34. package/dist/lens/index.d.ts +25 -2
  35. package/dist/lens/index.d.ts.map +1 -1
  36. package/dist/lens/index.js +52 -23
  37. package/dist/lens/{install-DzYk5WmV.js → install-Bu88-uMj.js} +1 -1
  38. package/dist/lens/{install-DE0rZji_.js → install-Ca0kMSB-.js} +1 -1
  39. package/dist/lens/{install-BFYeeAKJ.js → install-Y4ssavWy.js} +1 -1
  40. package/dist/lens/{install-DObyjvvP.js → install-ilsK_qly.js} +1 -1
  41. package/dist/lens/{keys-Bl8ABCBk.js → keys-B-YImOJ9.js} +2 -2
  42. package/dist/lens/{metricViews-CgYh0rJR.js → metricViews-CY3ENGQy.js} +10 -10
  43. package/dist/lens/panels/PanelFrame.d.ts +5 -0
  44. package/dist/lens/panels/PanelFrame.d.ts.map +1 -1
  45. package/dist/lens/panels/context.d.ts +5 -0
  46. package/dist/lens/panels/context.d.ts.map +1 -1
  47. package/dist/lens/panels/drillGate.d.ts +21 -0
  48. package/dist/lens/panels/drillGate.d.ts.map +1 -0
  49. package/dist/lens/panels/focusTrap.d.ts.map +1 -1
  50. package/dist/lens/panels/hostRenderers.d.ts +34 -0
  51. package/dist/lens/panels/hostRenderers.d.ts.map +1 -0
  52. package/dist/lens/panels/registry.d.ts.map +1 -1
  53. package/dist/lens/{prefetch-DwHEXti7.js → prefetch-H6lk56fj.js} +2 -2
  54. package/dist/lens/{prefetchPanels-CCHpQ9K2.js → prefetchPanels-BM6WTBt-.js} +5 -5
  55. package/dist/lens/{print-D_92Iy3k.js → print-DYkxBibF.js} +1 -1
  56. package/dist/lens/reports/DashboardEmptyState.d.ts +6 -0
  57. package/dist/lens/reports/DashboardEmptyState.d.ts.map +1 -0
  58. package/dist/lens/reports/ReportCompositionEditor.d.ts +42 -0
  59. package/dist/lens/reports/ReportCompositionEditor.d.ts.map +1 -0
  60. package/dist/lens/reports/ReportDestinationPicker.d.ts +23 -0
  61. package/dist/lens/reports/ReportDestinationPicker.d.ts.map +1 -0
  62. package/dist/lens/reports/ReportDialog.d.ts +26 -0
  63. package/dist/lens/reports/ReportDialog.d.ts.map +1 -0
  64. package/dist/lens/reports/ReportPicker.d.ts +35 -0
  65. package/dist/lens/reports/ReportPicker.d.ts.map +1 -0
  66. package/dist/lens/reports/ReportPlacementMenu.d.ts +14 -0
  67. package/dist/lens/reports/ReportPlacementMenu.d.ts.map +1 -0
  68. package/dist/lens/reports/ReportPlacementStatus.d.ts +30 -0
  69. package/dist/lens/reports/ReportPlacementStatus.d.ts.map +1 -0
  70. package/dist/lens/reports/ReportVersionNotice.d.ts +11 -0
  71. package/dist/lens/reports/ReportVersionNotice.d.ts.map +1 -0
  72. package/dist/lens/reports/contract/schemas.d.ts +9 -0
  73. package/dist/lens/reports/contract/schemas.d.ts.map +1 -1
  74. package/dist/lens/reports/contract/types.d.ts +41 -0
  75. package/dist/lens/reports/contract/types.d.ts.map +1 -1
  76. package/dist/lens/reports/dashboardEdit.d.ts +128 -0
  77. package/dist/lens/reports/dashboardEdit.d.ts.map +1 -0
  78. package/dist/lens/reports/dashboardEditTypes.d.ts +45 -0
  79. package/dist/lens/reports/dashboardEditTypes.d.ts.map +1 -0
  80. package/dist/lens/reports/draft.d.ts +28 -0
  81. package/dist/lens/reports/draft.d.ts.map +1 -1
  82. package/dist/lens/reports/editing.d.ts +176 -0
  83. package/dist/lens/reports/editing.d.ts.map +1 -0
  84. package/dist/lens/reports/guard.d.ts +40 -0
  85. package/dist/lens/reports/guard.d.ts.map +1 -0
  86. package/dist/lens/reports/layout.d.ts +34 -0
  87. package/dist/lens/reports/layout.d.ts.map +1 -0
  88. package/dist/lens/reports/picker.d.ts +97 -0
  89. package/dist/lens/reports/picker.d.ts.map +1 -0
  90. package/dist/lens/reports/placementHost.d.ts +61 -0
  91. package/dist/lens/reports/placementHost.d.ts.map +1 -0
  92. package/dist/lens/reports/unavailable.d.ts +13 -0
  93. package/dist/lens/reports/unavailable.d.ts.map +1 -0
  94. package/dist/lens/reports/version.d.ts +35 -0
  95. package/dist/lens/reports/version.d.ts.map +1 -0
  96. package/dist/lens/runtime/provider.d.ts +11 -0
  97. package/dist/lens/runtime/provider.d.ts.map +1 -1
  98. package/dist/lens/{scales-D6vubtdW.js → scales-COnESBiP.js} +1 -1
  99. package/dist/lens/style.css +1 -1
  100. package/dist/sdk-identity.cjs +3 -3
  101. package/dist/sdk-identity.js +3 -3
  102. package/dist/sdk-identity.json +2 -2
  103. package/package.json +1 -1
  104. package/dist/lens/index-rtv0Acit.js +0 -13985
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportPlacementMenu.d.ts","sourceRoot":"","sources":["../../src/reports/ReportPlacementMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AA+B3E;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,WAAW,CAAC,EAAE,gBAAgB,CAAA;CAC/B,kCAwFA"}
@@ -0,0 +1,30 @@
1
+ import { type PanelFrameState } from '../runtime';
2
+ export type PlacementFreshness = {
3
+ state: 'failed';
4
+ failed: PanelFrameState[];
5
+ } | {
6
+ state: 'updating';
7
+ } | {
8
+ state: 'calculated';
9
+ at: number;
10
+ };
11
+ /**
12
+ * One reading for a whole card. A member that failed outranks everything: a
13
+ * dashboard refresh that left this card's request broken has not updated it,
14
+ * whatever the board's own stamp says. The calculation time is the oldest of
15
+ * the members, so the card never claims to be newer than its stalest figure.
16
+ */
17
+ export declare function placementFreshness(frames: PanelFrameState[], generatedAt: string, refreshing: boolean): PlacementFreshness | undefined;
18
+ /** A wall-clock time that names its zone, in the card's calendar timezone when it has one. */
19
+ export declare function formatCalculatedAt(at: number, locale: string, timeZone?: string): string;
20
+ /**
21
+ * How current a placement's figures are, and the card's own retry. Retry
22
+ * re-requests only this card's failed members; the dashboard's refresh is a
23
+ * separate control and never marks this card updated while it is failing.
24
+ */
25
+ export declare function ReportPlacementStatus(props: {
26
+ placementId: string;
27
+ panelIds: string[];
28
+ timeZone?: string;
29
+ }): import("solid-js").JSX.Element;
30
+ //# sourceMappingURL=ReportPlacementStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportPlacementStatus.d.ts","sourceRoot":"","sources":["../../src/reports/ReportPlacementStatus.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AAE/G,MAAM,MAAM,kBAAkB,GAC1B;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,GAC9C;IAAE,KAAK,EAAE,UAAU,CAAA;CAAE,GACrB;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAOtI;AAED,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAQxF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,kCAmC1G"}
@@ -0,0 +1,11 @@
1
+ import type { LayoutGroup } from '../contract/types';
2
+ /**
3
+ * Update-available keeps the opened figures intact and offers the newer
4
+ * version; an unavailable placement (incompatible, deleted or forbidden)
5
+ * explains why it cannot be shown.
6
+ */
7
+ export declare function ReportVersionNotice(props: {
8
+ placementId: string;
9
+ unavailable?: LayoutGroup['unavailable'];
10
+ }): import("solid-js").JSX.Element;
11
+ //# sourceMappingURL=ReportVersionNotice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportVersionNotice.d.ts","sourceRoot":"","sources":["../../src/reports/ReportVersionNotice.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAKpD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAA;CAAE,kCAiE3G"}
@@ -8,6 +8,11 @@ export declare class ContractVersionMismatchError extends Error {
8
8
  }
9
9
  export declare const ContractVersionSchema: z.ZodType<string>;
10
10
  export declare const CapabilitiesSchema: z.ZodType<Contract.Capabilities>;
11
+ export declare const CatalogEntrySchema: z.ZodType<Contract.CatalogEntry>;
12
+ export declare const CatalogOwnerSchema: z.ZodType<Contract.CatalogOwner>;
13
+ export declare const CatalogPageSchema: z.ZodType<Contract.CatalogPage>;
14
+ export declare const CatalogQuerySchema: z.ZodType<Contract.CatalogQuery>;
15
+ export declare const CatalogScopeSchema: z.ZodType<Contract.CatalogScope>;
11
16
  export declare const CompositionSchema: z.ZodType<Contract.Composition>;
12
17
  export declare const ContextBoardSchema: z.ZodType<Contract.ContextBoard>;
13
18
  export declare const ContextCalendarSchema: z.ZodType<Contract.ContextCalendar>;
@@ -17,8 +22,12 @@ export declare const ContextLayerSchema: z.ZodType<Contract.ContextLayer>;
17
22
  export declare const ContextOriginSchema: z.ZodType<Contract.ContextOrigin>;
18
23
  export declare const ContextPeriodSchema: z.ZodType<Contract.ContextPeriod>;
19
24
  export declare const DefinitionSchema: z.ZodType<Contract.Definition>;
25
+ export declare const DestinationSchema: z.ZodType<Contract.Destination>;
26
+ export declare const OwnershipSchema: z.ZodType<Contract.Ownership>;
20
27
  export declare const ParametersSchema: z.ZodType<Contract.Parameters>;
21
28
  export declare const PlacementSchema: z.ZodType<Contract.Placement>;
29
+ export declare const ProposalSchema: z.ZodType<Contract.Proposal>;
22
30
  export declare const SourceDescriptorSchema: z.ZodType<Contract.SourceDescriptor>;
23
31
  export declare const SourceRefSchema: z.ZodType<Contract.SourceRef>;
32
+ export declare const VersionStatusSchema: z.ZodType<Contract.VersionStatus>;
24
33
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/reports/contract/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,KAAK,QAAQ,MAAM,SAAS,CAAA;AAQxC,qBAAa,4BAA6B,SAAQ,KAAK;IAIzC,QAAQ,CAAC,aAAa,EAAE,MAAM;IAH1C,QAAQ,CAAC,IAAI,+BAA8B;IAC3C,QAAQ,CAAC,aAAa,SAAyB;gBAE1B,aAAa,EAAE,MAAM;CAI3C;AAED,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAGnD,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC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6 +9,34 @@ export interface Capabilities {
9
9
  save: boolean;
10
10
  export: boolean;
11
11
  }
12
+ export interface CatalogEntry {
13
+ owner?: CatalogOwner;
14
+ id: string;
15
+ revision: string;
16
+ title: string;
17
+ description?: string;
18
+ source?: string;
19
+ ownership: Ownership;
20
+ restriction?: string;
21
+ members?: number;
22
+ placed?: number;
23
+ }
24
+ export interface CatalogOwner {
25
+ id: string;
26
+ name: string;
27
+ }
28
+ export interface CatalogPage {
29
+ entries: Array<CatalogEntry>;
30
+ next?: string;
31
+ }
32
+ export interface CatalogQuery {
33
+ search?: string;
34
+ scope?: CatalogScope;
35
+ cursor?: string;
36
+ target?: string;
37
+ limit?: number;
38
+ }
39
+ export type CatalogScope = "all" | "personal" | "shared";
12
40
  export interface Composition {
13
41
  context?: ContextBoard;
14
42
  id: string;
@@ -61,6 +89,12 @@ export interface Definition {
61
89
  view: string;
62
90
  parameters?: Parameters;
63
91
  }
92
+ export interface Destination {
93
+ id: string;
94
+ title: string;
95
+ placed?: number;
96
+ }
97
+ export type Ownership = "personal" | "shared" | "system";
64
98
  export type Parameters = Record<string, unknown>;
65
99
  export interface Placement {
66
100
  filters?: ContextFilters;
@@ -71,6 +105,12 @@ export interface Placement {
71
105
  span?: number;
72
106
  parameters?: Parameters;
73
107
  }
108
+ export interface Proposal {
109
+ id: string;
110
+ base: string;
111
+ summary?: string;
112
+ composition: Composition;
113
+ }
74
114
  export interface SourceDescriptor {
75
115
  id: string;
76
116
  version: number;
@@ -81,4 +121,5 @@ export interface SourceRef {
81
121
  id: string;
82
122
  version: number;
83
123
  }
124
+ export type VersionStatus = "current" | "incompatible" | "update-available";
84
125
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/reports/contract/types.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,MAAM,CAAA;AAEnC,MAAM,WAAW,YAAY;IAC3B,mBAAmB,CAAC,EAAE,MAAM,C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;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,YAAY,CAAA;CAC3B;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,cAAc,GAAG,kBAAkB,CAAA"}
@@ -0,0 +1,128 @@
1
+ import { type Accessor, type JSX } from 'solid-js';
2
+ import { type LensThemeMode } from '../runtime';
3
+ import type { Placement } from './contract/types';
4
+ import type { SaveIntent } from './draft';
5
+ import type { LensDashboardEditing } from './dashboardEditTypes';
6
+ import { type CompositionSessionHost } from './editing';
7
+ import type { ReportPlacementHost } from './placementHost';
8
+ /** The live dashboard's editing state: a composition session plus the mode's own focus, Escape and lifecycle. */
9
+ declare function createDashboardEditor(edit: LensDashboardEditing, theme: Accessor<LensThemeMode>): {
10
+ edit: LensDashboardEditing;
11
+ session: {
12
+ host: CompositionSessionHost;
13
+ draft: import("./draft").ReportDraft<import("./contract/types").Composition>;
14
+ translate: (key: string, fallback: string, vars?: import("../runtime").TranslationVars) => string;
15
+ instructionsId: string;
16
+ cards: Map<string, HTMLElement>;
17
+ handles: Map<string, HTMLElement>;
18
+ refs: {
19
+ add?: HTMLElement;
20
+ };
21
+ placements: Accessor<import("./editing").SessionPlacement[]>;
22
+ ids: Accessor<string[]>;
23
+ byId: (id: string) => import("./editing").SessionPlacement | undefined;
24
+ title: (placement: Placement) => string;
25
+ placedCount: (reportId: string) => number;
26
+ picking: Accessor<boolean>;
27
+ setPicking: import("solid-js").Setter<boolean>;
28
+ configuring: Accessor<string | undefined>;
29
+ setConfiguring: import("solid-js").Setter<string | undefined>;
30
+ impact: Accessor<{
31
+ placementId: string;
32
+ reportId: string;
33
+ usage?: number;
34
+ } | undefined>;
35
+ setImpact: import("solid-js").Setter<{
36
+ placementId: string;
37
+ reportId: string;
38
+ usage?: number;
39
+ } | undefined>;
40
+ notice: Accessor<string>;
41
+ setNotice: import("solid-js").Setter<string>;
42
+ announcement: Accessor<string>;
43
+ setAnnouncement: import("solid-js").Setter<string>;
44
+ added: Accessor<string[]>;
45
+ saved: Accessor<boolean>;
46
+ copyFailed: Accessor<boolean>;
47
+ pickedEntry: (placementId: string) => import("./contract/types").CatalogEntry | undefined;
48
+ edit: (change: (composition: import("./contract/types").Composition) => import("./contract/types").Composition) => void;
49
+ move: (id: string, direction: import("./layout").PlacementDirection) => void;
50
+ moveBefore: (id: string, targetId: string) => void;
51
+ resize: (id: string, span: number) => void;
52
+ remove: (id: string) => void;
53
+ addPicked: (confirmation: import("./picker").ReportPickerConfirmation) => void;
54
+ configure: (id: string, settings: {
55
+ title: string;
56
+ span: number;
57
+ period?: import("./contract/types").ContextPeriod;
58
+ }) => void;
59
+ save: (intent: SaveIntent) => Promise<boolean>;
60
+ cancel: (options?: {
61
+ announce?: boolean;
62
+ }) => void;
63
+ openImpact: (placementId: string, reportId: string) => Promise<void>;
64
+ saveCopy: () => void;
65
+ conflict: () => import("./draft").ReportRevisionConflictError<import("./contract/types").Composition> | undefined;
66
+ saveError: () => boolean;
67
+ status: () => string;
68
+ proposal: () => import("./contract/types").Proposal | undefined;
69
+ proposalValid: (value: import("./editing").ReportProposal) => boolean;
70
+ applyProposal: (current: import("./editing").ReportProposal) => void;
71
+ rejectProposal: (current: import("./editing").ReportProposal) => void;
72
+ };
73
+ guard: import("./guard").ReportLeaveGuard;
74
+ refs: {
75
+ toggle?: HTMLElement;
76
+ cancel?: HTMLElement;
77
+ };
78
+ editing: () => boolean;
79
+ start: () => void;
80
+ addReport: (trigger?: HTMLElement) => void;
81
+ cancel: () => void;
82
+ save: (intent: SaveIntent) => Promise<void>;
83
+ placementHost: (outer: ReportPlacementHost | undefined) => ReportPlacementHost;
84
+ modeAnnouncement: Accessor<string>;
85
+ cardEdit: (id: string, options: {
86
+ title: () => string;
87
+ preview: () => boolean;
88
+ grid: () => HTMLElement | undefined;
89
+ }) => {
90
+ readonly editing: boolean;
91
+ readonly row: number;
92
+ readonly preview: boolean;
93
+ readonly added: boolean;
94
+ span: () => number;
95
+ dropTarget: Accessor<boolean>;
96
+ dropProps: {
97
+ onDragLeave: () => false;
98
+ onDragOver: (event: DragEvent) => void;
99
+ onDrop: (event: DragEvent) => void;
100
+ };
101
+ handle: () => JSX.Element;
102
+ resize: () => JSX.Element;
103
+ cardRef: (element: HTMLElement) => Map<string, HTMLElement>;
104
+ };
105
+ };
106
+ type EditorState = ReturnType<typeof createDashboardEditor>;
107
+ /** What the dashboard renders of the edit mode, bound to one editor. */
108
+ export interface DashboardEditor extends EditorState {
109
+ Toggle: () => JSX.Element;
110
+ Bar: () => JSX.Element;
111
+ Notices: () => JSX.Element;
112
+ Dialogs: () => JSX.Element;
113
+ Added: (props: {
114
+ placement: Placement;
115
+ theme: LensThemeMode;
116
+ locale?: string;
117
+ csrf?: string;
118
+ fetcher?: typeof fetch;
119
+ }) => JSX.Element;
120
+ }
121
+ /** Creates the editor inside the dashboard's runtime and hands it to the board. */
122
+ export declare function DashboardEditScope(props: {
123
+ edit: LensDashboardEditing;
124
+ theme: Accessor<LensThemeMode>;
125
+ children: (editor: DashboardEditor) => JSX.Element;
126
+ }): JSX.Element;
127
+ export {};
128
+ //# sourceMappingURL=dashboardEdit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboardEdit.d.ts","sourceRoot":"","sources":["../../src/reports/dashboardEdit.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwE,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAIxH,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC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AA;CACtI;AAED,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,GAAG,CAAC,OAAO,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAgBzK"}
@@ -0,0 +1,45 @@
1
+ import type { Accessor } from 'solid-js';
2
+ import type { DashboardDocument } from '../contract/types';
3
+ import type { Composition, Placement } from './contract/types';
4
+ import type { SaveIntent } from './draft';
5
+ import type { CompositionSessionHost } from './editing';
6
+ import type { ReportLeaveGuard } from './guard';
7
+ /**
8
+ * A host-driven edit mode over the live dashboard. The host owns the draft
9
+ * (createReportDraft, which persists through its own save), whether the board
10
+ * is being edited, and what happens after a save or cancel; the SDK edits the
11
+ * draft in place and renders the cards from it.
12
+ */
13
+ export interface LensDashboardEditing extends Omit<CompositionSessionHost, 'theme'> {
14
+ /** Whether the board is in edit mode. */
15
+ editing: Accessor<boolean>;
16
+ setEditing: (editing: boolean) => void;
17
+ /** In-app navigation guard; one with browser-unload protection is created when omitted. */
18
+ guard?: ReportLeaveGuard;
19
+ /**
20
+ * The document of a placement the open document does not contain yet (added
21
+ * in this session), so its card shows live figures before the save. The
22
+ * catalog's preview of the picked report is used when omitted.
23
+ */
24
+ placementDocument?: (placement: Placement, options: {
25
+ signal: AbortSignal;
26
+ }) => Promise<DashboardDocument>;
27
+ /** After the host acknowledged a save; edit mode has ended. A host typically refreshes the document here. */
28
+ onSaved?: (composition: Composition, intent: SaveIntent) => void;
29
+ /** After the reader cancelled; the draft is back at its saved state and edit mode has ended. */
30
+ onCancel?: () => void;
31
+ /** Show the built-in Edit action (true by default); false when the host renders its own toggle. */
32
+ toggle?: boolean;
33
+ }
34
+ /** Which parts of the dashboard header the SDK renders. Every member defaults to the full chrome. */
35
+ export interface LensDashboardChrome {
36
+ /** The document title. Hide it when the host page renders its own heading. */
37
+ title?: boolean;
38
+ /** The document's own description line after the filters. */
39
+ description?: boolean;
40
+ /** The whole header (title, actions and filters). An edit mode keeps its action row. */
41
+ header?: boolean;
42
+ /** compact folds report periods, restoring saved filters, filter defaults and comparison into a "More" menu. */
43
+ toolbar?: 'full' | 'compact';
44
+ }
45
+ //# sourceMappingURL=dashboardEditTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboardEditTypes.d.ts","sourceRoot":"","sources":["../../src/reports/dashboardEditTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C;;;;;GAKG;AACH,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC;IACjF,yCAAyC;IACzC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC1B,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,2FAA2F;IAC3F,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACxB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAC1G,6GAA6G;IAC7G,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;IAChE,gGAAgG;IAChG,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,mGAAmG;IACnG,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,qGAAqG;AACrG,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,6DAA6D;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,wFAAwF;IACxF,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gHAAgH;IAChH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B"}
@@ -10,6 +10,18 @@ export interface ReportDraftHost<T> {
10
10
  intent: SaveIntent;
11
11
  }): Promise<T>;
12
12
  }
13
+ /**
14
+ * Thrown by a host save when expectedRevision is no longer the stored one.
15
+ * latest, when supplied, is the stored value the reader can review or adopt;
16
+ * the draft keeps every local edit until the reader decides.
17
+ */
18
+ export declare class ReportRevisionConflictError<T = unknown> extends Error {
19
+ readonly latest?: T | undefined;
20
+ readonly code = "REPORT_REVISION_CONFLICT";
21
+ constructor(latest?: T | undefined, message?: string);
22
+ }
23
+ /** How a draft adopts a newer stored value: keep the local edits on top of it, or discard them. */
24
+ export type ReportRebaseMode = 'keep' | 'discard';
13
25
  export declare function parseReportDefinition(value: unknown): Definition;
14
26
  export declare function parseReportComposition(value: unknown): Composition;
15
27
  export declare function copyReportDefinition(value: Definition, id: string, revision: string): Definition;
@@ -21,8 +33,24 @@ export declare function createReportDraft<T extends Definition | Composition>(in
21
33
  dirty: import("solid-js").Accessor<boolean>;
22
34
  saving: import("solid-js").Accessor<boolean>;
23
35
  error: import("solid-js").Accessor<unknown>;
36
+ /** Counts local changes (edit, cancel, rebase); an external proposal is stale once it moves. */
37
+ sequence: import("solid-js").Accessor<number>;
38
+ /** The revision conflict of the last save, or undefined. */
39
+ conflict: () => ReportRevisionConflictError<T> | undefined;
24
40
  update(change: (current: T) => T): void;
25
41
  cancel(): void;
42
+ /**
43
+ * Adopts a newer stored value as the saved base, for example after a
44
+ * revision conflict. keep leaves the local edits in place to be saved
45
+ * against it; discard replaces them with it.
46
+ */
47
+ rebase(latest: T, mode: ReportRebaseMode): void;
26
48
  save(intent?: SaveIntent): Promise<T>;
27
49
  };
50
+ export type ReportDraft<T extends Definition | Composition> = ReturnType<typeof createReportDraft<T>>;
51
+ /**
52
+ * Identifies the draft state an external proposal was prepared against. A
53
+ * proposal whose base differs from the current token is stale.
54
+ */
55
+ export declare function reportDraftToken(draft: Pick<ReportDraft<Composition>, 'saved' | 'sequence'>): string;
28
56
  //# sourceMappingURL=draft.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/reports/draft.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAE5F,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAA;AACzC,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAA;AAC3C,MAAM,MAAM,eAAe,GAAG,SAAS,CAAA;AACvC,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,CAAA;AAE5C,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;CACtF;AAMD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAMhE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAiBlE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAA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wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAMhE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAiBlE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAGhG;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,CAGhF;AAED,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,UAAU,GAAG,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;;;;;;IAgBtG,gGAAgG;;IAEhG,4DAA4D;oBAC9C,2BAA2B,CAAC,CAAC,CAAC,GAAG,SAAS;mBAIzC,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC;;IAWhC;;;;OAIG;mBACY,CAAC,QAAQ,gBAAgB;kBASrB,UAAU;EAwBhC;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,UAAU,GAAG,WAAW,IAAI,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;AAErG;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG,MAAM,CAEpG"}
@@ -0,0 +1,176 @@
1
+ import { type JSX } from 'solid-js';
2
+ import { useTranslate, type LensThemeMode } from '../runtime';
3
+ import type { Composition, ContextPeriod, Placement, Proposal } from './contract/types';
4
+ import { type ReportDraft, type SaveIntent } from './draft';
5
+ import type { ReportLeaveGuard } from './guard';
6
+ import { type PlacementDirection } from './layout';
7
+ import { type ReportCatalogHost, type ReportPickerConfirmation } from './picker';
8
+ export type ReportProposal = Proposal;
9
+ /** new: an unpublished draft (Save draft / Publish). existing: a saved object (Save changes / Cancel). */
10
+ export type ReportEditorLifecycle = 'new' | 'existing';
11
+ export interface ReportProposalHandlers {
12
+ /** Called after the reader applied or rejected the proposal. */
13
+ settled?: (proposalId: string, outcome: 'applied' | 'rejected') => void;
14
+ /** Prepare the proposal again against the current draft (reportDraftToken). */
15
+ regenerate?: (proposal: ReportProposal) => void;
16
+ /** Keep a stale proposal as a separate draft instead of applying it here. */
17
+ openAsDraft?: (proposal: ReportProposal) => void;
18
+ }
19
+ /** The host operations a composition editing session can call. Every member is read when used. */
20
+ export interface CompositionSessionHost {
21
+ draft: ReportDraft<Composition>;
22
+ lifecycle?: ReportEditorLifecycle;
23
+ /** The saved report's title for a placement without its own caption. */
24
+ reportTitle?: (reportId: string) => string | undefined;
25
+ /** Enables "Add report" through the picker. */
26
+ catalog?: ReportCatalogHost;
27
+ /** How many placements use a report, shown before editing the shared definition. */
28
+ usage?: (reportId: string) => Promise<number> | number;
29
+ /** Opens the shared report definition for editing. */
30
+ onEditReport?: (reportId: string, placementId: string) => Promise<void> | void;
31
+ /** Replaces the placement's report with an independent copy. */
32
+ onCopyReport?: (placementId: string) => Promise<void> | void;
33
+ /** After a revision conflict: keep the local draft as an independent object. */
34
+ onSaveCopy?: (draft: Composition) => Promise<void> | void;
35
+ proposal?: ReportProposal;
36
+ proposalHandlers?: ReportProposalHandlers;
37
+ /** Placement span of cards added from the picker (12 by default). */
38
+ addSpan?: number;
39
+ theme?: LensThemeMode;
40
+ }
41
+ export interface SessionPlacement {
42
+ placement: Placement;
43
+ row: number;
44
+ index: number;
45
+ rowSize: number;
46
+ }
47
+ export declare function periodText(period: ContextPeriod | undefined, translate: ReturnType<typeof useTranslate>): string | undefined;
48
+ /**
49
+ * The state of one editing session over a composition draft: layout commands
50
+ * with their announcements and focus moves, the dialogs they open, saving,
51
+ * cancelling and proposals. The separate editor and the live dashboard's edit
52
+ * mode both drive a draft through it, so they behave the same.
53
+ */
54
+ export declare function createCompositionSession(host: CompositionSessionHost): {
55
+ host: CompositionSessionHost;
56
+ draft: ReportDraft<Composition>;
57
+ translate: (key: string, fallback: string, vars?: import("../runtime").TranslationVars) => string;
58
+ instructionsId: string;
59
+ cards: Map<string, HTMLElement>;
60
+ handles: Map<string, HTMLElement>;
61
+ refs: {
62
+ add?: HTMLElement;
63
+ };
64
+ placements: import("solid-js").Accessor<SessionPlacement[]>;
65
+ ids: import("solid-js").Accessor<string[]>;
66
+ byId: (id: string) => SessionPlacement | undefined;
67
+ title: (placement: Placement) => string;
68
+ placedCount: (reportId: string) => number;
69
+ picking: import("solid-js").Accessor<boolean>;
70
+ setPicking: import("solid-js").Setter<boolean>;
71
+ configuring: import("solid-js").Accessor<string | undefined>;
72
+ setConfiguring: import("solid-js").Setter<string | undefined>;
73
+ impact: import("solid-js").Accessor<{
74
+ placementId: string;
75
+ reportId: string;
76
+ usage?: number;
77
+ } | undefined>;
78
+ setImpact: import("solid-js").Setter<{
79
+ placementId: string;
80
+ reportId: string;
81
+ usage?: number;
82
+ } | undefined>;
83
+ notice: import("solid-js").Accessor<string>;
84
+ setNotice: import("solid-js").Setter<string>;
85
+ announcement: import("solid-js").Accessor<string>;
86
+ setAnnouncement: import("solid-js").Setter<string>;
87
+ added: import("solid-js").Accessor<string[]>;
88
+ saved: import("solid-js").Accessor<boolean>;
89
+ copyFailed: import("solid-js").Accessor<boolean>;
90
+ /** The catalog entry each placement added in this session came from, for its preview. */
91
+ pickedEntry: (placementId: string) => import("./contract/types").CatalogEntry | undefined;
92
+ edit: (change: (composition: Composition) => Composition) => void;
93
+ move: (id: string, direction: PlacementDirection) => void;
94
+ moveBefore: (id: string, targetId: string) => void;
95
+ resize: (id: string, span: number) => void;
96
+ remove: (id: string) => void;
97
+ addPicked: (confirmation: ReportPickerConfirmation) => void;
98
+ configure: (id: string, settings: {
99
+ title: string;
100
+ span: number;
101
+ period?: ContextPeriod;
102
+ }) => void;
103
+ save: (intent: SaveIntent) => Promise<boolean>;
104
+ cancel: (options?: {
105
+ announce?: boolean;
106
+ }) => void;
107
+ openImpact: (placementId: string, reportId: string) => Promise<void>;
108
+ saveCopy: () => void;
109
+ conflict: () => import("./draft").ReportRevisionConflictError<Composition> | undefined;
110
+ saveError: () => boolean;
111
+ status: () => string;
112
+ proposal: () => Proposal | undefined;
113
+ proposalValid: (value: ReportProposal) => boolean;
114
+ applyProposal: (current: ReportProposal) => void;
115
+ rejectProposal: (current: ReportProposal) => void;
116
+ };
117
+ export type CompositionSession = ReturnType<typeof createCompositionSession>;
118
+ /** Save failure, revision conflict and notices, then the screen-reader announcement and move instructions. */
119
+ export declare function SessionAlerts(props: {
120
+ session: CompositionSession;
121
+ }): JSX.Element;
122
+ /** The pending external proposal, if any, as an apply/reject panel over the draft. */
123
+ export declare function SessionProposal(props: {
124
+ session: CompositionSession;
125
+ }): JSX.Element;
126
+ /** The picker, card settings, shared-edit impact and leave dialogs of a session. */
127
+ export declare function SessionDialogs(props: {
128
+ session: CompositionSession;
129
+ guard: ReportLeaveGuard;
130
+ }): JSX.Element;
131
+ /** The session's save actions: Save changes, or Save draft and Publish for a new object. */
132
+ export declare function SessionSaveActions(props: {
133
+ session: CompositionSession;
134
+ onSave: (intent: SaveIntent) => void;
135
+ }): JSX.Element;
136
+ /**
137
+ * The pointer and keyboard controls of one editable card: a drag handle that
138
+ * also moves the card with the arrow keys, a width slider and the card's drop
139
+ * target. preview is the width shown while a resize drag is in progress.
140
+ */
141
+ export declare function createPlacementControls(props: {
142
+ id: () => string;
143
+ span: () => number;
144
+ grid: () => HTMLElement | undefined;
145
+ onMove: (direction: PlacementDirection) => void;
146
+ onResize: (span: number) => void;
147
+ onDropBefore: (draggedId: string) => void;
148
+ }): {
149
+ span: () => number;
150
+ dropTarget: import("solid-js").Accessor<boolean>;
151
+ dropProps: {
152
+ onDragLeave: () => false;
153
+ onDragOver: (event: DragEvent) => void;
154
+ onDrop: (event: DragEvent) => void;
155
+ };
156
+ onHandleKey: (event: KeyboardEvent) => void;
157
+ onResizeKey: (event: KeyboardEvent) => void;
158
+ onResizePointer: (event: PointerEvent) => void;
159
+ onDragStart: (event: DragEvent) => void;
160
+ };
161
+ export type PlacementControls = ReturnType<typeof createPlacementControls>;
162
+ /** The drag handle: a pointer drags the card, the arrow keys move it one step. */
163
+ export declare function PlacementHandle(props: {
164
+ id: string;
165
+ title: string;
166
+ describedBy: string;
167
+ controls: PlacementControls;
168
+ handleRef: (element: HTMLButtonElement) => void;
169
+ }): JSX.Element;
170
+ /** The width slider on a card's trailing edge: drag it, or use the arrow keys, Home and End. */
171
+ export declare function PlacementResize(props: {
172
+ id: string;
173
+ title: string;
174
+ controls: PlacementControls;
175
+ }): JSX.Element;
176
+ //# sourceMappingURL=editing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editing.d.ts","sourceRoot":"","sources":["../../src/reports/editing.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuD,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAExF,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACvF,OAAO,EAA4C,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AACrG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAEmB,KAAK,kBAAkB,EAChD,MAAM,UAAU,CAAA;AACjB,OAAO,EAAqB,KAAK,iBAAiB,EAAE,KAAK,wBAAwB,EAAmB,MAAM,UAAU,CAAA;AAIpH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAA;AAErC,0GAA0G;AAC1G,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,UAAU,CAAA;AAEtD,MAAM,WAAW,sBAAsB;IACrC,gEAAgE;IAChE,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAA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EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,iBAAiB,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAkB9G"}
@@ -0,0 +1,40 @@
1
+ import { type Accessor } from 'solid-js';
2
+ import type { SaveIntent } from './draft';
3
+ export type ReportLeaveChoice = 'save' | 'discard' | 'stay';
4
+ /** The part of a report draft a leave guard needs. */
5
+ export interface GuardedDraft {
6
+ dirty: Accessor<boolean>;
7
+ /** A save is in flight; the guard waits for it instead of competing with it. */
8
+ saving: Accessor<boolean>;
9
+ cancel(): void;
10
+ save(intent?: SaveIntent): Promise<unknown>;
11
+ }
12
+ export interface ReportLeaveGuard {
13
+ /** A leave request is waiting for the reader's choice. */
14
+ pending: Accessor<boolean>;
15
+ /** The choice is being carried out: an earlier save is settling or the chosen save is in flight. */
16
+ saving: Accessor<boolean>;
17
+ /** The chosen action failed; the request stays open. */
18
+ failed: Accessor<boolean>;
19
+ /** Which choice failed, for the message shown with it. */
20
+ failure: Accessor<'save' | 'discard' | undefined>;
21
+ /**
22
+ * Asks before the host navigates away. Resolves true when leaving may
23
+ * proceed: nothing was unsaved, an in-flight save completed with nothing
24
+ * left unsaved, the reader discarded, or the chosen save succeeded. A
25
+ * failed save never resolves true.
26
+ */
27
+ request(): Promise<boolean>;
28
+ /** Carries out the reader's choice. It never rejects; a failure is reported through failed. */
29
+ choose(choice: ReportLeaveChoice): Promise<void>;
30
+ }
31
+ /**
32
+ * Guards in-app navigation and browser unload while a draft has unsaved
33
+ * changes. Browser unload uses the browser's own confirmation; in-app
34
+ * navigation awaits request() and the editor renders the choice.
35
+ */
36
+ export declare function createReportLeaveGuard(draft: GuardedDraft, options?: {
37
+ intent?: SaveIntent;
38
+ beforeUnload?: boolean;
39
+ }): ReportLeaveGuard;
40
+ //# sourceMappingURL=guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../src/reports/guard.ts"],"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