@molecule/app-exif-panel-solid 0.0.0-stage → 0.0.1-stage
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/LICENSE +202 -0
- package/README.md +294 -2
- package/dist/ExifPanel.d.ts +22 -0
- package/dist/ExifPanel.d.ts.map +1 -0
- package/dist/ExifPanel.jsx +121 -0
- package/dist/ExifPanel.jsx.map +1 -0
- package/dist/format-parts.d.ts +47 -0
- package/dist/format-parts.d.ts.map +1 -0
- package/dist/format-parts.js +88 -0
- package/dist/format-parts.js.map +1 -0
- package/dist/format.d.ts +93 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +164 -0
- package/dist/format.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +68 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/package.json +65 -4
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The number part of each EXIF notation, without its prefix or unit.
|
|
3
|
+
*
|
|
4
|
+
* `format.ts` joins these digits with the canonical English prefix / unit
|
|
5
|
+
* (`f/`, `s`, `ISO`, `mm`) for callers that want the plain notation. The
|
|
6
|
+
* components instead pass them to `t()` as the `{{value}}` of an
|
|
7
|
+
* `exifPanel.value.*` key, so a locale re-words the unit around the digits
|
|
8
|
+
* (Japanese `{{value}}秒`) while the digits stay this helper's.
|
|
9
|
+
*
|
|
10
|
+
* Internal to the panel — not part of the package's public exports.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The f-number of an aperture as digits, without the `f/`.
|
|
16
|
+
*
|
|
17
|
+
* @param fNumber - The aperture value (e.g. `2.8`, `5.6`, `8`).
|
|
18
|
+
* @returns A digit string like `"2.8"` or `"8"`, or `null` when the input
|
|
19
|
+
* is missing / invalid.
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatApertureNumber(fNumber: number | undefined): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* A shutter / exposure time as digits, without the `s`. Sub-second times
|
|
24
|
+
* render as a `1/x` reciprocal with the denominator rounded; longer
|
|
25
|
+
* exposures stay in seconds.
|
|
26
|
+
*
|
|
27
|
+
* @param seconds - Exposure time in seconds.
|
|
28
|
+
* @returns A digit string like `"1/125"`, `"2.5"` or `"30"`, or `null`
|
|
29
|
+
* when the input is missing / invalid.
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatShutterNumber(seconds: number | undefined): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* An ISO sensitivity as digits, without the `ISO` prefix.
|
|
34
|
+
*
|
|
35
|
+
* @param iso - The ISO value (e.g. `100`, `1600`).
|
|
36
|
+
* @returns A digit string like `"1600"`, or `null` when missing.
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatIsoNumber(iso: number | undefined): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* A focal length as digits, without the `mm`.
|
|
41
|
+
*
|
|
42
|
+
* @param mm - Focal length in millimetres.
|
|
43
|
+
* @returns A digit string like `"50"` or `"35.5"`, or `null` when the
|
|
44
|
+
* input is missing / invalid.
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatFocalLengthNumber(mm: number | undefined): string | null;
|
|
47
|
+
//# sourceMappingURL=format-parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-parts.d.ts","sourceRoot":"","sources":["../src/format-parts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA0BH;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAG/E;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAM9E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGtE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAG7E"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The number part of each EXIF notation, without its prefix or unit.
|
|
3
|
+
*
|
|
4
|
+
* `format.ts` joins these digits with the canonical English prefix / unit
|
|
5
|
+
* (`f/`, `s`, `ISO`, `mm`) for callers that want the plain notation. The
|
|
6
|
+
* components instead pass them to `t()` as the `{{value}}` of an
|
|
7
|
+
* `exifPanel.value.*` key, so a locale re-words the unit around the digits
|
|
8
|
+
* (Japanese `{{value}}秒`) while the digits stay this helper's.
|
|
9
|
+
*
|
|
10
|
+
* Internal to the panel — not part of the package's public exports.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The digits of a quantity rounded to one decimal, a whole number's
|
|
16
|
+
* trailing `.0` dropped.
|
|
17
|
+
*
|
|
18
|
+
* @param value - A validated, positive quantity.
|
|
19
|
+
* @returns Its digit text, e.g. `"2.8"`, `"50"`.
|
|
20
|
+
*/
|
|
21
|
+
const digits = (value) => {
|
|
22
|
+
const rounded = Math.round(value * 10) / 10;
|
|
23
|
+
return Number.isInteger(rounded) ? String(rounded) : rounded.toFixed(1);
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The guard every quantity shares: a finite number above zero.
|
|
27
|
+
*
|
|
28
|
+
* @param value - The raw EXIF quantity.
|
|
29
|
+
* @returns The number, or `null` when it is missing / invalid.
|
|
30
|
+
*/
|
|
31
|
+
const positive = (value) => {
|
|
32
|
+
if (value === undefined || value === null)
|
|
33
|
+
return null;
|
|
34
|
+
if (!Number.isFinite(value) || value <= 0)
|
|
35
|
+
return null;
|
|
36
|
+
return value;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The f-number of an aperture as digits, without the `f/`.
|
|
40
|
+
*
|
|
41
|
+
* @param fNumber - The aperture value (e.g. `2.8`, `5.6`, `8`).
|
|
42
|
+
* @returns A digit string like `"2.8"` or `"8"`, or `null` when the input
|
|
43
|
+
* is missing / invalid.
|
|
44
|
+
*/
|
|
45
|
+
export function formatApertureNumber(fNumber) {
|
|
46
|
+
const value = positive(fNumber);
|
|
47
|
+
return value === null ? null : digits(value);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A shutter / exposure time as digits, without the `s`. Sub-second times
|
|
51
|
+
* render as a `1/x` reciprocal with the denominator rounded; longer
|
|
52
|
+
* exposures stay in seconds.
|
|
53
|
+
*
|
|
54
|
+
* @param seconds - Exposure time in seconds.
|
|
55
|
+
* @returns A digit string like `"1/125"`, `"2.5"` or `"30"`, or `null`
|
|
56
|
+
* when the input is missing / invalid.
|
|
57
|
+
*/
|
|
58
|
+
export function formatShutterNumber(seconds) {
|
|
59
|
+
const value = positive(seconds);
|
|
60
|
+
if (value === null)
|
|
61
|
+
return null;
|
|
62
|
+
if (value >= 1)
|
|
63
|
+
return digits(value);
|
|
64
|
+
// Round the reciprocal denominator to nearest integer for sub-second.
|
|
65
|
+
return `1/${Math.round(1 / value)}`;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* An ISO sensitivity as digits, without the `ISO` prefix.
|
|
69
|
+
*
|
|
70
|
+
* @param iso - The ISO value (e.g. `100`, `1600`).
|
|
71
|
+
* @returns A digit string like `"1600"`, or `null` when missing.
|
|
72
|
+
*/
|
|
73
|
+
export function formatIsoNumber(iso) {
|
|
74
|
+
const value = positive(iso);
|
|
75
|
+
return value === null ? null : String(Math.round(value));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A focal length as digits, without the `mm`.
|
|
79
|
+
*
|
|
80
|
+
* @param mm - Focal length in millimetres.
|
|
81
|
+
* @returns A digit string like `"50"` or `"35.5"`, or `null` when the
|
|
82
|
+
* input is missing / invalid.
|
|
83
|
+
*/
|
|
84
|
+
export function formatFocalLengthNumber(mm) {
|
|
85
|
+
const value = positive(mm);
|
|
86
|
+
return value === null ? null : digits(value);
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=format-parts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-parts.js","sourceRoot":"","sources":["../src/format-parts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,GAAG,CAAC,KAAa,EAAU,EAAE;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,EAAE,CAAA;IAC3C,OAAO,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AACzE,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,CAAC,KAAyB,EAAiB,EAAE;IAC5D,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACtD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IACtD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA2B;IAC9D,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC/B,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAA2B;IAC7D,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAC/B,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IACpC,sEAAsE;IACtE,OAAO,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAA;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAuB;IACrD,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;IAC3B,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,EAAsB;IAC5D,MAAM,KAAK,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IAC1B,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9C,CAAC"}
|
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure string-formatting helpers for EXIF values.
|
|
3
|
+
*
|
|
4
|
+
* Kept separate from the React component so they can be unit-tested
|
|
5
|
+
* without a DOM and reused by callers that want the formatted strings
|
|
6
|
+
* for non-rendering purposes (alt text, share captions, etc.).
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Format an aperture f-number as `f/N` with one decimal place dropped
|
|
12
|
+
* when whole.
|
|
13
|
+
*
|
|
14
|
+
* @param fNumber - The aperture value (e.g. `2.8`, `5.6`, `8`).
|
|
15
|
+
* @returns A display string like `"f/2.8"` or `"f/8"`, or `null` when
|
|
16
|
+
* the input is missing / invalid.
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatAperture(fNumber: number | undefined): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Format a shutter / exposure time in seconds as a human-readable
|
|
21
|
+
* string. Sub-second times are rendered as a `1/x s` reciprocal with
|
|
22
|
+
* the denominator rounded; longer exposures stay in seconds.
|
|
23
|
+
*
|
|
24
|
+
* @param seconds - Exposure time in seconds.
|
|
25
|
+
* @returns A display string like `"1/125 s"` or `"2 s"`, or `null` when
|
|
26
|
+
* the input is missing / invalid.
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatShutter(seconds: number | undefined): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Format an ISO sensitivity as `ISO N`.
|
|
31
|
+
*
|
|
32
|
+
* @param iso - The ISO value (e.g. `100`, `1600`).
|
|
33
|
+
* @returns A display string like `"ISO 1600"`, or `null` when missing.
|
|
34
|
+
*/
|
|
35
|
+
export declare function formatIso(iso: number | undefined): string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Format a focal length value as `N mm`.
|
|
38
|
+
*
|
|
39
|
+
* @param mm - Focal length in millimetres.
|
|
40
|
+
* @returns A display string like `"50 mm"`, or `null` when missing.
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatFocalLength(mm: number | undefined): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Format a single GPS coordinate (latitude or longitude) as
|
|
45
|
+
* deg/min/sec with a hemisphere suffix.
|
|
46
|
+
*
|
|
47
|
+
* @param value - Signed decimal degrees.
|
|
48
|
+
* @param axis - Which axis the value represents — picks `N`/`S` vs `E`/`W`.
|
|
49
|
+
* @returns A string like `"37° 25' 19.07" N"`, or `null` when missing.
|
|
50
|
+
*/
|
|
51
|
+
export declare function formatDms(value: number | undefined, axis: 'lat' | 'lon'): string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Format a GPS coordinate pair as a single deg/min/sec string.
|
|
54
|
+
*
|
|
55
|
+
* @param latitude - Latitude in signed decimal degrees.
|
|
56
|
+
* @param longitude - Longitude in signed decimal degrees.
|
|
57
|
+
* @returns A combined string like `"37° 25' 19.07" N, 122° 5' 4.16" W"`,
|
|
58
|
+
* or `null` if either value is missing.
|
|
59
|
+
*/
|
|
60
|
+
export declare function formatGps(latitude: number | undefined, longitude: number | undefined): string | null;
|
|
61
|
+
/**
|
|
62
|
+
* Build an OpenStreetMap link URL for a GPS coordinate pair.
|
|
63
|
+
*
|
|
64
|
+
* @param latitude - Latitude in signed decimal degrees.
|
|
65
|
+
* @param longitude - Longitude in signed decimal degrees.
|
|
66
|
+
* @returns An `https://www.openstreetmap.org/?...` URL, or `null` when
|
|
67
|
+
* either input is missing.
|
|
68
|
+
*/
|
|
69
|
+
export declare function buildMapLink(latitude: number | undefined, longitude: number | undefined): string | null;
|
|
70
|
+
/**
|
|
71
|
+
* Format an EXIF capture timestamp. Accepts `Date`, ISO string, or
|
|
72
|
+
* epoch milliseconds and renders via `toLocaleString` so the result
|
|
73
|
+
* respects the given locale and the host environment's timezone — pass
|
|
74
|
+
* the app's active locale so the text follows a locale switch.
|
|
75
|
+
*
|
|
76
|
+
* @param value - The timestamp value pulled from EXIF.
|
|
77
|
+
* @param locale - The locale to format in (an `Intl` locale code); the
|
|
78
|
+
* host environment's locale when omitted.
|
|
79
|
+
* @returns A locale-formatted date/time string, or `null` when missing
|
|
80
|
+
* or unparseable.
|
|
81
|
+
*/
|
|
82
|
+
export declare function formatTimestamp(value: Date | string | number | undefined, locale?: string): string | null;
|
|
83
|
+
/**
|
|
84
|
+
* Compose camera make + model into a single `"Make Model"` string,
|
|
85
|
+
* collapsing duplication when the model already starts with the make
|
|
86
|
+
* (Sony often does this).
|
|
87
|
+
*
|
|
88
|
+
* @param make - Camera manufacturer.
|
|
89
|
+
* @param model - Camera model.
|
|
90
|
+
* @returns The combined label, or `null` when both inputs are missing.
|
|
91
|
+
*/
|
|
92
|
+
export declare function formatCamera(make: string | undefined, model: string | undefined): string | null;
|
|
93
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGxE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGhE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGvE;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,CAavF;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,GAAG,IAAI,CAKf;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,GAAG,IAAI,CAMf;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,EACzC,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,GAAG,IAAI,CAYf;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAS/F"}
|
package/dist/format.js
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure string-formatting helpers for EXIF values.
|
|
3
|
+
*
|
|
4
|
+
* Kept separate from the React component so they can be unit-tested
|
|
5
|
+
* without a DOM and reused by callers that want the formatted strings
|
|
6
|
+
* for non-rendering purposes (alt text, share captions, etc.).
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { formatApertureNumber, formatFocalLengthNumber, formatIsoNumber, formatShutterNumber, } from './format-parts.js';
|
|
11
|
+
/**
|
|
12
|
+
* Format an aperture f-number as `f/N` with one decimal place dropped
|
|
13
|
+
* when whole.
|
|
14
|
+
*
|
|
15
|
+
* @param fNumber - The aperture value (e.g. `2.8`, `5.6`, `8`).
|
|
16
|
+
* @returns A display string like `"f/2.8"` or `"f/8"`, or `null` when
|
|
17
|
+
* the input is missing / invalid.
|
|
18
|
+
*/
|
|
19
|
+
export function formatAperture(fNumber) {
|
|
20
|
+
const digits = formatApertureNumber(fNumber);
|
|
21
|
+
return digits === null ? null : `f/${digits}`;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Format a shutter / exposure time in seconds as a human-readable
|
|
25
|
+
* string. Sub-second times are rendered as a `1/x s` reciprocal with
|
|
26
|
+
* the denominator rounded; longer exposures stay in seconds.
|
|
27
|
+
*
|
|
28
|
+
* @param seconds - Exposure time in seconds.
|
|
29
|
+
* @returns A display string like `"1/125 s"` or `"2 s"`, or `null` when
|
|
30
|
+
* the input is missing / invalid.
|
|
31
|
+
*/
|
|
32
|
+
export function formatShutter(seconds) {
|
|
33
|
+
const digits = formatShutterNumber(seconds);
|
|
34
|
+
return digits === null ? null : `${digits} s`;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Format an ISO sensitivity as `ISO N`.
|
|
38
|
+
*
|
|
39
|
+
* @param iso - The ISO value (e.g. `100`, `1600`).
|
|
40
|
+
* @returns A display string like `"ISO 1600"`, or `null` when missing.
|
|
41
|
+
*/
|
|
42
|
+
export function formatIso(iso) {
|
|
43
|
+
const digits = formatIsoNumber(iso);
|
|
44
|
+
return digits === null ? null : `ISO ${digits}`;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Format a focal length value as `N mm`.
|
|
48
|
+
*
|
|
49
|
+
* @param mm - Focal length in millimetres.
|
|
50
|
+
* @returns A display string like `"50 mm"`, or `null` when missing.
|
|
51
|
+
*/
|
|
52
|
+
export function formatFocalLength(mm) {
|
|
53
|
+
const digits = formatFocalLengthNumber(mm);
|
|
54
|
+
return digits === null ? null : `${digits} mm`;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Format a single GPS coordinate (latitude or longitude) as
|
|
58
|
+
* deg/min/sec with a hemisphere suffix.
|
|
59
|
+
*
|
|
60
|
+
* @param value - Signed decimal degrees.
|
|
61
|
+
* @param axis - Which axis the value represents — picks `N`/`S` vs `E`/`W`.
|
|
62
|
+
* @returns A string like `"37° 25' 19.07" N"`, or `null` when missing.
|
|
63
|
+
*/
|
|
64
|
+
export function formatDms(value, axis) {
|
|
65
|
+
if (value === undefined || value === null)
|
|
66
|
+
return null;
|
|
67
|
+
if (!Number.isFinite(value))
|
|
68
|
+
return null;
|
|
69
|
+
const positiveLabel = axis === 'lat' ? 'N' : 'E';
|
|
70
|
+
const negativeLabel = axis === 'lat' ? 'S' : 'W';
|
|
71
|
+
const hemisphere = value >= 0 ? positiveLabel : negativeLabel;
|
|
72
|
+
const abs = Math.abs(value);
|
|
73
|
+
const deg = Math.floor(abs);
|
|
74
|
+
const minutesFloat = (abs - deg) * 60;
|
|
75
|
+
const min = Math.floor(minutesFloat);
|
|
76
|
+
const seconds = (minutesFloat - min) * 60;
|
|
77
|
+
const secText = (Math.round(seconds * 100) / 100).toFixed(2);
|
|
78
|
+
return `${deg}° ${min}' ${secText}" ${hemisphere}`;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Format a GPS coordinate pair as a single deg/min/sec string.
|
|
82
|
+
*
|
|
83
|
+
* @param latitude - Latitude in signed decimal degrees.
|
|
84
|
+
* @param longitude - Longitude in signed decimal degrees.
|
|
85
|
+
* @returns A combined string like `"37° 25' 19.07" N, 122° 5' 4.16" W"`,
|
|
86
|
+
* or `null` if either value is missing.
|
|
87
|
+
*/
|
|
88
|
+
export function formatGps(latitude, longitude) {
|
|
89
|
+
const lat = formatDms(latitude, 'lat');
|
|
90
|
+
const lon = formatDms(longitude, 'lon');
|
|
91
|
+
if (!lat || !lon)
|
|
92
|
+
return null;
|
|
93
|
+
return `${lat}, ${lon}`;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Build an OpenStreetMap link URL for a GPS coordinate pair.
|
|
97
|
+
*
|
|
98
|
+
* @param latitude - Latitude in signed decimal degrees.
|
|
99
|
+
* @param longitude - Longitude in signed decimal degrees.
|
|
100
|
+
* @returns An `https://www.openstreetmap.org/?...` URL, or `null` when
|
|
101
|
+
* either input is missing.
|
|
102
|
+
*/
|
|
103
|
+
export function buildMapLink(latitude, longitude) {
|
|
104
|
+
if (latitude === undefined || longitude === undefined)
|
|
105
|
+
return null;
|
|
106
|
+
if (!Number.isFinite(latitude) || !Number.isFinite(longitude))
|
|
107
|
+
return null;
|
|
108
|
+
const lat = latitude.toFixed(6);
|
|
109
|
+
const lon = longitude.toFixed(6);
|
|
110
|
+
return `https://www.openstreetmap.org/?mlat=${lat}&mlon=${lon}#map=15/${lat}/${lon}`;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Format an EXIF capture timestamp. Accepts `Date`, ISO string, or
|
|
114
|
+
* epoch milliseconds and renders via `toLocaleString` so the result
|
|
115
|
+
* respects the given locale and the host environment's timezone — pass
|
|
116
|
+
* the app's active locale so the text follows a locale switch.
|
|
117
|
+
*
|
|
118
|
+
* @param value - The timestamp value pulled from EXIF.
|
|
119
|
+
* @param locale - The locale to format in (an `Intl` locale code); the
|
|
120
|
+
* host environment's locale when omitted.
|
|
121
|
+
* @returns A locale-formatted date/time string, or `null` when missing
|
|
122
|
+
* or unparseable.
|
|
123
|
+
*/
|
|
124
|
+
export function formatTimestamp(value, locale) {
|
|
125
|
+
if (value === undefined || value === null)
|
|
126
|
+
return null;
|
|
127
|
+
let date;
|
|
128
|
+
if (value instanceof Date) {
|
|
129
|
+
date = value;
|
|
130
|
+
}
|
|
131
|
+
else if (typeof value === 'number') {
|
|
132
|
+
date = new Date(value);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
date = new Date(value);
|
|
136
|
+
}
|
|
137
|
+
if (Number.isNaN(date.getTime()))
|
|
138
|
+
return null;
|
|
139
|
+
return date.toLocaleString(locale);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Compose camera make + model into a single `"Make Model"` string,
|
|
143
|
+
* collapsing duplication when the model already starts with the make
|
|
144
|
+
* (Sony often does this).
|
|
145
|
+
*
|
|
146
|
+
* @param make - Camera manufacturer.
|
|
147
|
+
* @param model - Camera model.
|
|
148
|
+
* @returns The combined label, or `null` when both inputs are missing.
|
|
149
|
+
*/
|
|
150
|
+
export function formatCamera(make, model) {
|
|
151
|
+
const m = make?.trim();
|
|
152
|
+
const md = model?.trim();
|
|
153
|
+
if (!m && !md)
|
|
154
|
+
return null;
|
|
155
|
+
if (!md)
|
|
156
|
+
return m ?? null;
|
|
157
|
+
if (!m)
|
|
158
|
+
return md;
|
|
159
|
+
// Avoid "Sony Sony a7 III" when model already starts with make.
|
|
160
|
+
if (md.toLowerCase().startsWith(m.toLowerCase()))
|
|
161
|
+
return md;
|
|
162
|
+
return `${m} ${md}`;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../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AAI,EAAE,CAAA;IACxB,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,IAAI,IAAI,CAAA;IACzB,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IACjB,gEAAgE;IAChE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAAE,OAAO,EAAE,CAAA;IAC3D,OAAO,GAAG,CAAC,IAAI,EAAE,EAAE,CAAA;AACrB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solid EXIF metadata panel for photo-sharing apps.
|
|
3
|
+
*
|
|
4
|
+
* Exports `ExifPanel` — a structured renderer for already-parsed EXIF data
|
|
5
|
+
* (camera, lens, aperture, shutter, ISO, focal length, GPS, timestamp,
|
|
6
|
+
* software, copyright). The caller is responsible for decoding the raw EXIF
|
|
7
|
+
* payload (e.g. via the `exifr` library); this package is a
|
|
8
|
+
* styling-agnostic, i18n-aware renderer only.
|
|
9
|
+
*
|
|
10
|
+
* Also exports the `ExifData` and `ExifPanelProps` types and the pure
|
|
11
|
+
* formatting helpers (`formatAperture`, `formatShutter`, `formatIso`,
|
|
12
|
+
* `formatFocalLength`, `formatGps`, `formatTimestamp`, `formatCamera`,
|
|
13
|
+
* `buildMapLink`, `formatDms`).
|
|
14
|
+
*
|
|
15
|
+
* It is the Solid counterpart of `@molecule/app-exif-panel-react`: the same
|
|
16
|
+
* props (React names) and the same DOM for the same input.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { ExifPanel, type ExifData } from '@molecule/app-exif-panel-solid'
|
|
21
|
+
*
|
|
22
|
+
* export function PhotoMetadata(props: { exif: ExifData }) {
|
|
23
|
+
* return <ExifPanel exif={props.exif} showGps compact={false} />
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Requires a bonded ClassMap (`getClassMap()`) and the binding's i18n
|
|
29
|
+
* provider for `useTranslation()`. All user-facing text resolves through
|
|
30
|
+
* `t()` with React's keys and English `defaultValue`s.
|
|
31
|
+
*
|
|
32
|
+
* @module
|
|
33
|
+
*/
|
|
34
|
+
export * from './ExifPanel.jsx';
|
|
35
|
+
export * from './format.js';
|
|
36
|
+
export * from './types.js';
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solid EXIF metadata panel for photo-sharing apps.
|
|
3
|
+
*
|
|
4
|
+
* Exports `ExifPanel` — a structured renderer for already-parsed EXIF data
|
|
5
|
+
* (camera, lens, aperture, shutter, ISO, focal length, GPS, timestamp,
|
|
6
|
+
* software, copyright). The caller is responsible for decoding the raw EXIF
|
|
7
|
+
* payload (e.g. via the `exifr` library); this package is a
|
|
8
|
+
* styling-agnostic, i18n-aware renderer only.
|
|
9
|
+
*
|
|
10
|
+
* Also exports the `ExifData` and `ExifPanelProps` types and the pure
|
|
11
|
+
* formatting helpers (`formatAperture`, `formatShutter`, `formatIso`,
|
|
12
|
+
* `formatFocalLength`, `formatGps`, `formatTimestamp`, `formatCamera`,
|
|
13
|
+
* `buildMapLink`, `formatDms`).
|
|
14
|
+
*
|
|
15
|
+
* It is the Solid counterpart of `@molecule/app-exif-panel-react`: the same
|
|
16
|
+
* props (React names) and the same DOM for the same input.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { ExifPanel, type ExifData } from '@molecule/app-exif-panel-solid'
|
|
21
|
+
*
|
|
22
|
+
* export function PhotoMetadata(props: { exif: ExifData }) {
|
|
23
|
+
* return <ExifPanel exif={props.exif} showGps compact={false} />
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Requires a bonded ClassMap (`getClassMap()`) and the binding's i18n
|
|
29
|
+
* provider for `useTranslation()`. All user-facing text resolves through
|
|
30
|
+
* `t()` with React's keys and English `defaultValue`s.
|
|
31
|
+
*
|
|
32
|
+
* @module
|
|
33
|
+
*/
|
|
34
|
+
export * from './ExifPanel.jsx';
|
|
35
|
+
export * from './format.js';
|
|
36
|
+
export * from './types.js';
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the EXIF panel renderer.
|
|
3
|
+
*
|
|
4
|
+
* The caller is responsible for parsing the EXIF metadata (e.g. via the
|
|
5
|
+
* `exifr` library) — this package only renders an already-parsed object
|
|
6
|
+
* with normalized field names.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Parsed EXIF metadata. Every field is optional — extra fields are
|
|
12
|
+
* permitted (the renderer ignores them) so callers can pass through the
|
|
13
|
+
* full output of their EXIF parser without filtering.
|
|
14
|
+
*/
|
|
15
|
+
export interface ExifData {
|
|
16
|
+
/** Camera manufacturer (e.g. `"Canon"`, `"Sony"`, `"Apple"`). */
|
|
17
|
+
make?: string;
|
|
18
|
+
/** Camera model (e.g. `"EOS R5"`, `"a7 III"`, `"iPhone 15 Pro"`). */
|
|
19
|
+
model?: string;
|
|
20
|
+
/** Lens model description (e.g. `"RF 24-70mm F2.8 L IS USM"`). */
|
|
21
|
+
lensModel?: string;
|
|
22
|
+
/** Aperture as an f-number (the `N` in `f/N`). */
|
|
23
|
+
fNumber?: number;
|
|
24
|
+
/** Exposure / shutter time in seconds (e.g. `0.008` ≈ `1/125 s`). */
|
|
25
|
+
exposureTime?: number;
|
|
26
|
+
/** ISO sensitivity (e.g. `100`, `1600`). */
|
|
27
|
+
iso?: number;
|
|
28
|
+
/** Focal length in millimetres. */
|
|
29
|
+
focalLength?: number;
|
|
30
|
+
/** 35 mm-equivalent focal length, when supplied by the camera. */
|
|
31
|
+
focalLength35mm?: number;
|
|
32
|
+
/** Capture timestamp — `Date`, ISO 8601 string, or epoch millis. */
|
|
33
|
+
dateTimeOriginal?: Date | string | number;
|
|
34
|
+
/** GPS latitude in signed decimal degrees. */
|
|
35
|
+
gpsLatitude?: number;
|
|
36
|
+
/** GPS longitude in signed decimal degrees. */
|
|
37
|
+
gpsLongitude?: number;
|
|
38
|
+
/** EXIF orientation tag (1–8). */
|
|
39
|
+
orientation?: number;
|
|
40
|
+
/** Software / firmware that produced the file. */
|
|
41
|
+
software?: string;
|
|
42
|
+
/** Copyright statement embedded in the file. */
|
|
43
|
+
copyright?: string;
|
|
44
|
+
/** Pass-through for parser-specific extras the renderer ignores. */
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Props for the `<ExifPanel>` component.
|
|
49
|
+
*/
|
|
50
|
+
export interface ExifPanelProps {
|
|
51
|
+
/** Parsed EXIF metadata. */
|
|
52
|
+
exif: ExifData;
|
|
53
|
+
/**
|
|
54
|
+
* Compact mode collapses the panel into a single condensed grid with
|
|
55
|
+
* smaller type and tighter spacing. Defaults to `false`.
|
|
56
|
+
*/
|
|
57
|
+
compact?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether to render the GPS coordinates row when latitude / longitude
|
|
60
|
+
* are present. Defaults to `true`.
|
|
61
|
+
*/
|
|
62
|
+
showGps?: boolean;
|
|
63
|
+
/** Optional heading override. */
|
|
64
|
+
heading?: string;
|
|
65
|
+
/** Extra classes appended to the panel root. */
|
|
66
|
+
className?: string;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;IACzC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oEAAoE;IACpE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,CAAA;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the EXIF panel renderer.
|
|
3
|
+
*
|
|
4
|
+
* The caller is responsible for parsing the EXIF metadata (e.g. via the
|
|
5
|
+
* `exifr` library) — this package only renders an already-parsed object
|
|
6
|
+
* with normalized field names.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-exif-panel-solid",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1-stage",
|
|
4
|
+
"description": "EXIF metadata renderer for photo-sharing apps — camera, lens, aperture, shutter, ISO, focal length, GPS, timestamp",
|
|
5
|
+
"homepage": "https://www.molecule.dev/packages/app-exif-panel-solid",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"dev": "tsc --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"molecule",
|
|
27
|
+
"exif",
|
|
28
|
+
"photo",
|
|
29
|
+
"metadata",
|
|
30
|
+
"solid"
|
|
31
|
+
],
|
|
32
|
+
"author": "Molecule Dev, Inc. (https://molecule.dev)",
|
|
33
|
+
"license": "Apache-2.0",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
37
|
+
"directory": "packages/app/features/exif-panel-solid"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20"
|
|
41
|
+
},
|
|
42
|
+
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@molecule/app-i18n": "^1.0.1",
|
|
48
|
+
"@molecule/app-solid": "^3.5.0",
|
|
49
|
+
"@molecule/app-ui": "^1.0.1",
|
|
50
|
+
"@molecule/app-ui-solid": "^1.1.0",
|
|
51
|
+
"solid-js": "^1.8.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@molecule/app-framework-conformance": "0.0.0",
|
|
55
|
+
"@molecule/app-i18n": "1.2.2",
|
|
56
|
+
"@molecule/app-icons": "1.0.4",
|
|
57
|
+
"@molecule/app-solid": "3.7.0",
|
|
58
|
+
"@molecule/app-ui": "1.4.0",
|
|
59
|
+
"@molecule/app-ui-solid": "1.1.3",
|
|
60
|
+
"@types/node": "26.6.5",
|
|
61
|
+
"jsdom": "30.1.3",
|
|
62
|
+
"solid-js": "1.9.17",
|
|
63
|
+
"typescript": "6.0.3",
|
|
64
|
+
"vite-plugin-solid": "2.11.15",
|
|
65
|
+
"vitest": "4.1.12"
|
|
66
|
+
}
|
|
67
|
+
}
|