@striae-org/striae 4.2.1 → 4.3.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 (66) hide show
  1. package/app/components/actions/case-import/confirmation-import.ts +20 -1
  2. package/app/components/actions/case-import/orchestrator.ts +3 -0
  3. package/app/components/actions/case-manage.ts +5 -1
  4. package/app/components/actions/confirm-export.ts +12 -3
  5. package/app/components/audit/viewer/audit-entries-list.tsx +20 -2
  6. package/app/components/audit/viewer/use-audit-viewer-export.ts +2 -2
  7. package/app/components/audit/viewer/use-audit-viewer-filters.ts +11 -1
  8. package/app/components/canvas/canvas.tsx +2 -1
  9. package/app/components/navbar/case-modals/archive-case-modal.module.css +0 -76
  10. package/app/components/navbar/case-modals/archive-case-modal.tsx +9 -8
  11. package/app/components/navbar/case-modals/case-modal-shared.module.css +94 -0
  12. package/app/components/navbar/case-modals/delete-case-modal.module.css +9 -0
  13. package/app/components/navbar/case-modals/delete-case-modal.tsx +79 -0
  14. package/app/components/navbar/case-modals/open-case-modal.module.css +2 -1
  15. package/app/components/navbar/case-modals/rename-case-modal.module.css +0 -72
  16. package/app/components/navbar/case-modals/rename-case-modal.tsx +9 -8
  17. package/app/components/navbar/navbar.module.css +11 -0
  18. package/app/components/navbar/navbar.tsx +38 -19
  19. package/app/components/sidebar/case-import/hooks/useImportExecution.ts +2 -0
  20. package/app/components/sidebar/cases/case-sidebar.tsx +27 -3
  21. package/app/components/sidebar/cases/cases-modal.module.css +312 -10
  22. package/app/components/sidebar/cases/cases-modal.tsx +690 -110
  23. package/app/components/sidebar/cases/cases.module.css +23 -0
  24. package/app/components/sidebar/files/delete-files-modal.module.css +26 -0
  25. package/app/components/sidebar/files/delete-files-modal.tsx +94 -0
  26. package/app/components/sidebar/files/files-modal.module.css +285 -44
  27. package/app/components/sidebar/files/files-modal.tsx +452 -145
  28. package/app/components/sidebar/notes/class-details-fields.tsx +146 -0
  29. package/app/components/sidebar/notes/class-details-modal.tsx +147 -0
  30. package/app/components/sidebar/notes/class-details-sections.tsx +561 -0
  31. package/app/components/sidebar/notes/class-details-shared.ts +239 -0
  32. package/app/components/sidebar/notes/notes-editor-form.tsx +43 -5
  33. package/app/components/sidebar/notes/notes.module.css +236 -4
  34. package/app/components/sidebar/notes/use-class-details-state.ts +371 -0
  35. package/app/components/sidebar/sidebar-container.tsx +2 -0
  36. package/app/components/sidebar/sidebar.tsx +8 -1
  37. package/app/hooks/useCaseListPreferences.ts +99 -0
  38. package/app/hooks/useFileListPreferences.ts +106 -0
  39. package/app/routes/striae/striae.tsx +45 -1
  40. package/app/services/audit/audit-export-csv.ts +4 -2
  41. package/app/services/audit/audit-export-report.ts +36 -4
  42. package/app/services/audit/audit.service.ts +2 -0
  43. package/app/services/audit/builders/audit-entry-builder.ts +1 -0
  44. package/app/services/audit/builders/audit-event-builders-workflow.ts +8 -2
  45. package/app/types/annotations.ts +48 -1
  46. package/app/types/audit.ts +1 -0
  47. package/app/utils/data/case-filters.ts +127 -0
  48. package/app/utils/data/confirmation-summary/summary-core.ts +18 -2
  49. package/app/utils/data/file-filters.ts +201 -0
  50. package/app/utils/forensics/confirmation-signature.ts +20 -5
  51. package/functions/api/image/[[path]].ts +4 -0
  52. package/package.json +3 -4
  53. package/workers/audit-worker/wrangler.jsonc.example +1 -1
  54. package/workers/data-worker/src/signing-payload-utils.ts +5 -0
  55. package/workers/data-worker/wrangler.jsonc.example +1 -1
  56. package/workers/image-worker/wrangler.jsonc.example +1 -1
  57. package/workers/keys-worker/wrangler.jsonc.example +1 -1
  58. package/workers/pdf-worker/src/formats/format-striae.ts +84 -118
  59. package/workers/pdf-worker/src/pdf-worker.example.ts +28 -10
  60. package/workers/pdf-worker/src/report-layout.ts +227 -0
  61. package/workers/pdf-worker/src/report-types.ts +20 -0
  62. package/workers/pdf-worker/wrangler.jsonc.example +1 -1
  63. package/workers/user-worker/wrangler.jsonc.example +1 -1
  64. package/wrangler.toml.example +1 -1
  65. package/workers/pdf-worker/src/assets/icon-256.png +0 -0
  66. /package/workers/pdf-worker/src/assets/{generated-assets.ts → generated-assets.example.ts} +0 -0
@@ -0,0 +1,227 @@
1
+ import type { ReportPdfOptions } from './report-types';
2
+
3
+ interface ReportChromeTemplateConfig {
4
+ headerLeft?: string;
5
+ headerCenter?: string;
6
+ headerRight?: string;
7
+ headerDetailLeft?: string;
8
+ headerDetailRight?: string;
9
+ footerLeft?: string;
10
+ footerCenter?: string;
11
+ footerRight?: string;
12
+ footerLeftImageSrc?: string;
13
+ includePageNumbers?: boolean;
14
+ }
15
+
16
+ const HEADER_TEMPLATE_STYLES = `
17
+ <style>
18
+ .report-header {
19
+ width: 100%;
20
+ box-sizing: border-box;
21
+ padding: 0 0.5in 8px;
22
+ border-bottom: 2px solid #333333;
23
+ color: #333333;
24
+ font-family: Arial, sans-serif;
25
+ font-size: 18px;
26
+ font-weight: 700;
27
+ }
28
+ .report-header__content {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: space-between;
32
+ gap: 12px;
33
+ width: 100%;
34
+ }
35
+ .report-header__details {
36
+ display: flex;
37
+ align-items: flex-start;
38
+ justify-content: space-between;
39
+ gap: 12px;
40
+ width: 100%;
41
+ margin-top: 8px;
42
+ padding-top: 8px;
43
+ border-top: 1px solid #d9d9d9;
44
+ font-size: 10px;
45
+ font-weight: 600;
46
+ letter-spacing: 0.04em;
47
+ text-transform: uppercase;
48
+ color: #666666;
49
+ }
50
+ .report-header__cell {
51
+ flex: 1 1 0;
52
+ min-width: 0;
53
+ white-space: nowrap;
54
+ overflow: hidden;
55
+ text-overflow: ellipsis;
56
+ }
57
+ .report-header__cell--left {
58
+ text-align: left;
59
+ }
60
+ .report-header__cell--center {
61
+ text-align: center;
62
+ }
63
+ .report-header__cell--right {
64
+ text-align: right;
65
+ }
66
+ .report-header__detail {
67
+ flex: 1 1 0;
68
+ min-width: 0;
69
+ white-space: nowrap;
70
+ overflow: hidden;
71
+ text-overflow: ellipsis;
72
+ }
73
+ .report-header__detail--left {
74
+ text-align: left;
75
+ }
76
+ .report-header__detail--right {
77
+ text-align: right;
78
+ }
79
+ </style>
80
+ `;
81
+
82
+ const FOOTER_TEMPLATE_STYLES = `
83
+ <style>
84
+ .report-footer {
85
+ width: 100%;
86
+ box-sizing: border-box;
87
+ padding: 8px 0.5in 0;
88
+ border-top: 1px solid #cccccc;
89
+ color: #666666;
90
+ font-family: Arial, sans-serif;
91
+ font-size: 9px;
92
+ }
93
+ .report-footer__content {
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: space-between;
97
+ gap: 12px;
98
+ width: 100%;
99
+ }
100
+ .report-footer__cell {
101
+ flex: 1 1 0;
102
+ min-width: 0;
103
+ white-space: nowrap;
104
+ overflow: hidden;
105
+ text-overflow: ellipsis;
106
+ }
107
+ .report-footer__cell--left {
108
+ display: flex;
109
+ align-items: center;
110
+ gap: 6px;
111
+ text-align: left;
112
+ font-weight: 500;
113
+ }
114
+ .report-footer__cell--center {
115
+ text-align: center;
116
+ color: #333333;
117
+ font-weight: 600;
118
+ }
119
+ .report-footer__cell--right {
120
+ text-align: right;
121
+ font-style: italic;
122
+ }
123
+ .report-footer__page-count {
124
+ font-style: normal;
125
+ font-weight: 600;
126
+ color: #333333;
127
+ }
128
+ .report-footer__separator {
129
+ margin: 0 6px;
130
+ color: #999999;
131
+ font-style: normal;
132
+ }
133
+ .report-footer__icon {
134
+ width: 12px;
135
+ height: 12px;
136
+ object-fit: contain;
137
+ flex: 0 0 auto;
138
+ }
139
+ </style>
140
+ `;
141
+
142
+ export function escapeHtml(value: string | undefined): string {
143
+ if (!value) {
144
+ return '';
145
+ }
146
+
147
+ return value
148
+ .replace(/&/g, '&amp;')
149
+ .replace(/</g, '&lt;')
150
+ .replace(/>/g, '&gt;')
151
+ .replace(/"/g, '&quot;')
152
+ .replace(/'/g, '&#39;');
153
+ }
154
+
155
+ function renderTemplateCell(value: string | undefined, className: string): string {
156
+ const content = value && value.trim().length > 0 ? escapeHtml(value.trim()) : '&nbsp;';
157
+ return `<div class="${className}">${content}</div>`;
158
+ }
159
+
160
+ export function buildRepeatedChromePdfOptions(config: ReportChromeTemplateConfig): Partial<ReportPdfOptions> {
161
+ const hasHeaderDetails = Boolean(
162
+ (config.headerDetailLeft && config.headerDetailLeft.trim().length > 0) ||
163
+ (config.headerDetailRight && config.headerDetailRight.trim().length > 0)
164
+ );
165
+
166
+ const headerDetails = hasHeaderDetails
167
+ ? `
168
+ <div class="report-header__details">
169
+ ${renderTemplateCell(config.headerDetailLeft, 'report-header__detail report-header__detail--left')}
170
+ ${renderTemplateCell(config.headerDetailRight, 'report-header__detail report-header__detail--right')}
171
+ </div>
172
+ `
173
+ : '';
174
+
175
+ const headerTemplate = `
176
+ ${HEADER_TEMPLATE_STYLES}
177
+ <div class="report-header">
178
+ <div class="report-header__content">
179
+ ${renderTemplateCell(config.headerLeft, 'report-header__cell report-header__cell--left')}
180
+ ${renderTemplateCell(config.headerCenter, 'report-header__cell report-header__cell--center')}
181
+ ${renderTemplateCell(config.headerRight, 'report-header__cell report-header__cell--right')}
182
+ </div>
183
+ ${headerDetails}
184
+ </div>
185
+ `;
186
+
187
+ const footerLeftContent = config.footerLeft && config.footerLeft.trim().length > 0
188
+ ? `<span>${escapeHtml(config.footerLeft.trim())}</span>`
189
+ : '<span>&nbsp;</span>';
190
+
191
+ const footerIcon = config.footerLeftImageSrc
192
+ ? `<img class="report-footer__icon" src="${escapeHtml(config.footerLeftImageSrc)}" alt="" />`
193
+ : '';
194
+
195
+ const footerRightText = config.footerRight && config.footerRight.trim().length > 0
196
+ ? `<span>${escapeHtml(config.footerRight.trim())}</span>`
197
+ : '';
198
+
199
+ const footerPageCount = config.includePageNumbers === false
200
+ ? ''
201
+ : `<span class="report-footer__page-count">Page <span class="pageNumber"></span> of <span class="totalPages"></span></span>`;
202
+
203
+ const footerRightContent = footerRightText && footerPageCount
204
+ ? `${footerRightText}<span class="report-footer__separator">|</span>${footerPageCount}`
205
+ : footerRightText || footerPageCount || '&nbsp;';
206
+
207
+ const footerTemplate = `
208
+ ${FOOTER_TEMPLATE_STYLES}
209
+ <div class="report-footer">
210
+ <div class="report-footer__content">
211
+ <div class="report-footer__cell report-footer__cell--left">${footerLeftContent}${footerIcon}</div>
212
+ ${renderTemplateCell(config.footerCenter, 'report-footer__cell report-footer__cell--center')}
213
+ <div class="report-footer__cell report-footer__cell--right">${footerRightContent}</div>
214
+ </div>
215
+ </div>
216
+ `;
217
+
218
+ return {
219
+ displayHeaderFooter: true,
220
+ headerTemplate,
221
+ footerTemplate,
222
+ margin: {
223
+ top: hasHeaderDetails ? '1.45in' : '1.15in',
224
+ bottom: '0.8in',
225
+ },
226
+ };
227
+ }
@@ -65,8 +65,28 @@ export interface PDFGenerationRequest {
65
65
  data: PDFGenerationData;
66
66
  }
67
67
 
68
+ export interface PDFMarginOptions {
69
+ top: string;
70
+ bottom: string;
71
+ left: string;
72
+ right: string;
73
+ }
74
+
75
+ export interface ReportPdfOptions {
76
+ printBackground?: boolean;
77
+ format?: string;
78
+ margin?: Partial<PDFMarginOptions>;
79
+ displayHeaderFooter?: boolean;
80
+ headerTemplate?: string;
81
+ footerTemplate?: string;
82
+ preferCSSPageSize?: boolean;
83
+ }
84
+
68
85
  export type ReportRenderer = (data: PDFGenerationData) => string;
69
86
 
87
+ export type ReportPdfOptionsBuilder = (data: PDFGenerationData) => Partial<ReportPdfOptions>;
88
+
70
89
  export interface ReportModule {
71
90
  renderReport: ReportRenderer;
91
+ getPdfOptions?: ReportPdfOptionsBuilder;
72
92
  }
@@ -2,7 +2,7 @@
2
2
  "name": "PDF_WORKER_NAME",
3
3
  "account_id": "ACCOUNT_ID",
4
4
  "main": "src/pdf-worker.ts",
5
- "compatibility_date": "2026-03-21",
5
+ "compatibility_date": "2026-03-22",
6
6
  "compatibility_flags": [
7
7
  "nodejs_compat"
8
8
  ],
@@ -2,7 +2,7 @@
2
2
  "name": "USER_WORKER_NAME",
3
3
  "account_id": "ACCOUNT_ID",
4
4
  "main": "src/user-worker.ts",
5
- "compatibility_date": "2026-03-21",
5
+ "compatibility_date": "2026-03-22",
6
6
  "compatibility_flags": [
7
7
  "nodejs_compat"
8
8
  ],
@@ -1,6 +1,6 @@
1
1
  #:schema node_modules/wrangler/config-schema.json
2
2
  name = "PAGES_PROJECT_NAME"
3
- compatibility_date = "2026-03-21"
3
+ compatibility_date = "2026-03-22"
4
4
  compatibility_flags = ["nodejs_compat"]
5
5
  pages_build_output_dir = "./build/client"
6
6