@striae-org/striae 6.0.1 → 6.1.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.
- package/app/components/actions/case-export/core-export.ts +11 -2
- package/app/components/actions/case-export/download-handlers.ts +3 -1
- package/app/components/canvas/canvas.module.css +1 -1
- package/app/components/canvas/canvas.tsx +32 -11
- package/app/components/icon/icons.svg +1 -1
- package/app/components/icon/manifest.json +1 -1
- package/app/components/navbar/navbar.tsx +10 -9
- package/app/components/sidebar/cases/case-sidebar.tsx +6 -1
- package/app/components/sidebar/files/files-modal.tsx +39 -15
- package/app/components/sidebar/notes/addl-notes-modal.tsx +9 -2
- package/app/components/sidebar/notes/{class-details/class-details-fields.tsx → item-details/item-details-fields.tsx} +10 -10
- package/app/components/sidebar/notes/{class-details/class-details-modal.tsx → item-details/item-details-modal.tsx} +20 -22
- package/app/components/sidebar/notes/{class-details/class-details-sections.tsx → item-details/item-details-sections.tsx} +16 -16
- package/app/components/sidebar/notes/{class-details/class-details-shared.ts → item-details/item-details-shared.ts} +4 -3
- package/app/components/sidebar/notes/{class-details/use-class-details-state.ts → item-details/use-item-details-state.ts} +4 -4
- package/app/components/sidebar/notes/notes-editor-form.tsx +333 -124
- package/app/components/sidebar/notes/notes-editor-modal.tsx +3 -0
- package/app/components/sidebar/notes/notes.module.css +40 -20
- package/app/components/sidebar/sidebar-container.tsx +1 -0
- package/app/components/sidebar/sidebar.tsx +3 -0
- package/app/components/toolbar/toolbar.tsx +5 -5
- package/app/hooks/useFileListPreferences.ts +22 -17
- package/app/routes/striae/striae.tsx +4 -10
- package/app/types/annotations.ts +28 -5
- package/app/utils/data/confirmation-summary/summary-core.ts +40 -8
- package/app/utils/data/file-filters.ts +39 -17
- package/package.json +139 -139
- package/workers/audit-worker/package.json +2 -2
- package/workers/audit-worker/wrangler.jsonc.example +1 -1
- package/workers/data-worker/package.json +2 -2
- package/workers/data-worker/wrangler.jsonc.example +1 -1
- package/workers/image-worker/package.json +2 -2
- package/workers/image-worker/wrangler.jsonc.example +1 -1
- package/workers/pdf-worker/package.json +2 -2
- package/workers/pdf-worker/src/formats/format-striae.ts +65 -8
- package/workers/pdf-worker/src/report-types.ts +13 -1
- package/workers/pdf-worker/wrangler.jsonc.example +1 -1
- package/workers/user-worker/package.json +2 -2
- package/workers/user-worker/wrangler.jsonc.example +1 -1
- package/wrangler.toml.example +1 -1
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
SHOTSHELL_GAUGES,
|
|
17
17
|
SHOTSHELL_STEEL_WATERFOWL_OPTIONS,
|
|
18
18
|
formatCalculatedDiameter,
|
|
19
|
-
} from './
|
|
20
|
-
import { CheckboxField, SelectField, SelectWithCustomField, TextField } from './
|
|
21
|
-
import type { BulletDetailsState, CartridgeCaseDetailsState, ShotshellDetailsState } from './use-
|
|
19
|
+
} from './item-details-shared';
|
|
20
|
+
import { CheckboxField, SelectField, SelectWithCustomField, TextField } from './item-details-fields';
|
|
21
|
+
import type { BulletDetailsState, CartridgeCaseDetailsState, ShotshellDetailsState } from './use-item-details-state';
|
|
22
22
|
|
|
23
23
|
interface BulletSectionProps {
|
|
24
24
|
showHeader: boolean;
|
|
@@ -294,14 +294,14 @@ export const BulletSection = ({
|
|
|
294
294
|
];
|
|
295
295
|
|
|
296
296
|
return (
|
|
297
|
-
<div className={styles.
|
|
298
|
-
{showHeader && <h6 className={styles.
|
|
299
|
-
<div className={styles.
|
|
297
|
+
<div className={styles.itemDetailsSection}>
|
|
298
|
+
{showHeader && <h6 className={styles.itemDetailsSectionHeader}>Bullet</h6>}
|
|
299
|
+
<div className={styles.itemDetailsFieldGrid}>
|
|
300
300
|
{bulletFields.map((field) => renderConfiguredField(field, isReadOnly))}
|
|
301
301
|
</div>
|
|
302
302
|
{bullet.lgCount > 0 && (
|
|
303
303
|
<div className={styles.lgWidthsSection}>
|
|
304
|
-
<h6 className={styles.
|
|
304
|
+
<h6 className={styles.itemDetailsSectionHeader}>L / G Widths</h6>
|
|
305
305
|
<div className={styles.lgWidthsLayout}>
|
|
306
306
|
<div className={styles.lgWidthsColumn}>
|
|
307
307
|
{Array.from({ length: bullet.lgCount }, (_, index) => (
|
|
@@ -331,7 +331,7 @@ export const BulletSection = ({
|
|
|
331
331
|
{bullet.calculatedDiameter !== null && (
|
|
332
332
|
<div className={styles.calculatedDiameterWrapper}>
|
|
333
333
|
<div className={styles.calculatedDiameterDisplay}>
|
|
334
|
-
<span className={styles.
|
|
334
|
+
<span className={styles.itemDetailsLabel}>Calculated Diameter</span>
|
|
335
335
|
<span className={styles.calculatedDiameterValue}>{formatCalculatedDiameter(bullet.calculatedDiameter)}</span>
|
|
336
336
|
</div>
|
|
337
337
|
<button
|
|
@@ -448,12 +448,12 @@ export const CartridgeCaseSection = ({
|
|
|
448
448
|
];
|
|
449
449
|
|
|
450
450
|
return (
|
|
451
|
-
<div className={styles.
|
|
452
|
-
{showHeader && <h6 className={styles.
|
|
453
|
-
<div className={styles.
|
|
451
|
+
<div className={styles.itemDetailsSection}>
|
|
452
|
+
{showHeader && <h6 className={styles.itemDetailsSectionHeader}>Cartridge Case</h6>}
|
|
453
|
+
<div className={styles.itemDetailsFieldGrid}>
|
|
454
454
|
{cartridgeFields.map((field) => renderConfiguredField(field, isReadOnly))}
|
|
455
455
|
</div>
|
|
456
|
-
<div className={styles.
|
|
456
|
+
<div className={styles.itemDetailsCheckboxGroup}>
|
|
457
457
|
{renderCheckboxes([
|
|
458
458
|
{ key: 'fpDrag', label: 'FP Drag', checked: cartridgeCase.hasFpDrag, onChange: cartridgeCase.setHasFpDrag },
|
|
459
459
|
{ key: 'extractor', label: 'Extractor Marks', checked: cartridgeCase.hasExtractorMarks, onChange: cartridgeCase.setHasExtractorMarks },
|
|
@@ -544,12 +544,12 @@ export const ShotshellSection = ({
|
|
|
544
544
|
];
|
|
545
545
|
|
|
546
546
|
return (
|
|
547
|
-
<div className={styles.
|
|
548
|
-
{showHeader && <h6 className={styles.
|
|
549
|
-
<div className={styles.
|
|
547
|
+
<div className={styles.itemDetailsSection}>
|
|
548
|
+
{showHeader && <h6 className={styles.itemDetailsSectionHeader}>Shotshell</h6>}
|
|
549
|
+
<div className={styles.itemDetailsFieldGrid}>
|
|
550
550
|
{shotshellFields.map((field) => renderConfiguredField(field, isReadOnly))}
|
|
551
551
|
</div>
|
|
552
|
-
<div className={styles.
|
|
552
|
+
<div className={styles.itemDetailsCheckboxGroup}>
|
|
553
553
|
{renderCheckboxes([
|
|
554
554
|
{ key: 'extractor', label: 'Extractor Marks', checked: shotshell.hasExtractorMarks, onChange: shotshell.setHasExtractorMarks },
|
|
555
555
|
{ key: 'ejector', label: 'Ejector Marks', checked: shotshell.hasEjectorMarks, onChange: shotshell.setHasEjectorMarks },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { BulletAnnotationData, CartridgeCaseAnnotationData, ShotshellAnnotationData } from '~/types/annotations';
|
|
1
|
+
import type { BulletAnnotationData, CartridgeCaseAnnotationData, ShotshellAnnotationData, ItemType } from '~/types/annotations';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
// Re-export ItemType from annotations for backwards compatibility
|
|
4
|
+
export type ClassType = ItemType;
|
|
4
5
|
|
|
5
6
|
export const CUSTOM = '__custom__';
|
|
6
7
|
|
|
@@ -133,7 +134,7 @@ const avgWidth = (widths: string[] | undefined): number | null => {
|
|
|
133
134
|
return vals.reduce((a, b) => a + b, 0) / vals.length;
|
|
134
135
|
};
|
|
135
136
|
|
|
136
|
-
export const
|
|
137
|
+
export const buildItemDetailsSummary = (
|
|
137
138
|
bulletData: BulletAnnotationData | undefined,
|
|
138
139
|
cartridgeCaseData: CartridgeCaseAnnotationData | undefined,
|
|
139
140
|
shotshellData: ShotshellAnnotationData | undefined,
|
|
@@ -18,9 +18,9 @@ import {
|
|
|
18
18
|
calculateBulletDiameter,
|
|
19
19
|
formatCalculatedDiameter,
|
|
20
20
|
isCustomValue,
|
|
21
|
-
} from './
|
|
21
|
+
} from './item-details-shared';
|
|
22
22
|
|
|
23
|
-
interface
|
|
23
|
+
interface UseItemDetailsStateParams {
|
|
24
24
|
bulletData?: BulletAnnotationData;
|
|
25
25
|
cartridgeCaseData?: CartridgeCaseAnnotationData;
|
|
26
26
|
shotshellData?: ShotshellAnnotationData;
|
|
@@ -139,11 +139,11 @@ export interface ShotshellDetailsState {
|
|
|
139
139
|
setHasChamberMarks: (value: boolean) => void;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
export const
|
|
142
|
+
export const useItemDetailsState = ({
|
|
143
143
|
bulletData,
|
|
144
144
|
cartridgeCaseData,
|
|
145
145
|
shotshellData,
|
|
146
|
-
}:
|
|
146
|
+
}: UseItemDetailsStateParams) => {
|
|
147
147
|
const [bCaliber, setBCaliber] = useState(() => bulletData?.caliber || '');
|
|
148
148
|
const [bCaliberIsCustom, setBCaliberIsCustom] = useState(() => isCustomValue(bulletData?.caliber, ALL_CALIBERS));
|
|
149
149
|
const [bMass, setBMass] = useState(() => bulletData?.mass || '');
|