@molecule/app-file-card-angular 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 +10 -2
- package/dist/file-card.component.d.ts +173 -0
- package/dist/file-card.component.d.ts.map +1 -0
- package/dist/file-card.component.js +513 -0
- package/dist/file-card.component.js.map +1 -0
- package/dist/file-icon.component.d.ts +26 -0
- package/dist/file-icon.component.d.ts.map +1 -0
- package/dist/file-icon.component.js +110 -0
- package/dist/file-icon.component.js.map +1 -0
- package/dist/format.d.ts +80 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +88 -0
- package/dist/format.js.map +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +71 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +71 -4
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FileIcon component (React parity).
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { Component } from '@angular/core';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
function FileIcon_Case_0_Template(rf, ctx) { if (rf & 1) {
|
|
9
|
+
i0.ɵɵnamespaceSVG();
|
|
10
|
+
i0.ɵɵdomElement(0, "rect", 1)(1, "circle", 2)(2, "path", 3);
|
|
11
|
+
} }
|
|
12
|
+
function FileIcon_Case_1_Template(rf, ctx) { if (rf & 1) {
|
|
13
|
+
i0.ɵɵnamespaceSVG();
|
|
14
|
+
i0.ɵɵdomElement(0, "rect", 1)(1, "path", 4);
|
|
15
|
+
} }
|
|
16
|
+
function FileIcon_Case_2_Template(rf, ctx) { if (rf & 1) {
|
|
17
|
+
i0.ɵɵnamespaceSVG();
|
|
18
|
+
i0.ɵɵdomElement(0, "path", 5)(1, "circle", 6)(2, "circle", 7);
|
|
19
|
+
} }
|
|
20
|
+
function FileIcon_Case_3_Template(rf, ctx) { if (rf & 1) {
|
|
21
|
+
i0.ɵɵnamespaceSVG();
|
|
22
|
+
i0.ɵɵdomElement(0, "path", 8)(1, "path", 9);
|
|
23
|
+
} }
|
|
24
|
+
function FileIcon_Case_4_Template(rf, ctx) { if (rf & 1) {
|
|
25
|
+
i0.ɵɵnamespaceSVG();
|
|
26
|
+
i0.ɵɵdomElement(0, "rect", 10)(1, "path", 11)(2, "path", 12);
|
|
27
|
+
} }
|
|
28
|
+
function FileIcon_Case_5_Template(rf, ctx) { if (rf & 1) {
|
|
29
|
+
i0.ɵɵnamespaceSVG();
|
|
30
|
+
i0.ɵɵdomElement(0, "path", 13)(1, "path", 14)(2, "path", 15);
|
|
31
|
+
} }
|
|
32
|
+
function FileIcon_Case_6_Template(rf, ctx) { if (rf & 1) {
|
|
33
|
+
i0.ɵɵnamespaceSVG();
|
|
34
|
+
i0.ɵɵdomElement(0, "path", 0);
|
|
35
|
+
} }
|
|
36
|
+
function FileIcon_Case_7_Template(rf, ctx) { if (rf & 1) {
|
|
37
|
+
i0.ɵɵnamespaceSVG();
|
|
38
|
+
i0.ɵɵdomElement(0, "path", 8)(1, "path", 9)(2, "path", 16)(3, "path", 17);
|
|
39
|
+
} }
|
|
40
|
+
/**
|
|
41
|
+
* FileIcon component.
|
|
42
|
+
*
|
|
43
|
+
* Icon glyph for a file kind. Stroke-currentColor SVG so it inherits the
|
|
44
|
+
* surrounding text color (no ClassMap colors needed). The host IS the `<svg>`
|
|
45
|
+
* (`svg[mol-file-icon]`), matching React's root exactly.
|
|
46
|
+
*/
|
|
47
|
+
export class FileIcon {
|
|
48
|
+
/** File kind — picks the SVG glyph. */
|
|
49
|
+
kind;
|
|
50
|
+
/** Pixel size of the rendered SVG (default 24). */
|
|
51
|
+
size;
|
|
52
|
+
/** Optional aria-label. When omitted the icon is `aria-hidden`. */
|
|
53
|
+
ariaLabel;
|
|
54
|
+
/**
|
|
55
|
+
* The rendered size (React's `size = 24` default parameter: a later-bound
|
|
56
|
+
* write of `undefined` must not erase the default).
|
|
57
|
+
* @returns The pixel size.
|
|
58
|
+
*/
|
|
59
|
+
attrSize() {
|
|
60
|
+
return this.size ?? 24;
|
|
61
|
+
}
|
|
62
|
+
static ɵfac = function FileIcon_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FileIcon)(); };
|
|
63
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FileIcon, selectors: [["svg", "mol-file-icon", ""]], hostVars: 13, hostBindings: function FileIcon_HostBindings(rf, ctx) { if (rf & 2) {
|
|
64
|
+
i0.ɵɵattribute("xmlns", "http://www.w3.org/2000/svg")("width", ctx.attrSize())("height", ctx.attrSize())("viewBox", "0 0 24 24")("fill", "none")("stroke", "currentColor")("stroke-width", 1.75)("stroke-linecap", "round")("stroke-linejoin", "round")("role", ctx.ariaLabel ? "img" : null)("aria-label", ctx.ariaLabel ?? null)("aria-hidden", ctx.ariaLabel ? null : true)("data-mol-id", "file-icon-" + ctx.kind);
|
|
65
|
+
} }, inputs: { kind: "kind", size: "size", ariaLabel: "ariaLabel" }, decls: 8, vars: 1, consts: [["d", "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"], ["x", "3", "y", "5", "width", "18", "height", "14", "rx", "2"], ["cx", "8.5", "cy", "10.5", "r", "1.5"], ["d", "m21 15-5-5L5 21"], ["d", "m10 9 5 3-5 3z", "fill", "currentColor"], ["d", "M9 18V5l12-2v13"], ["cx", "6", "cy", "18", "r", "3"], ["cx", "18", "cy", "16", "r", "3"], ["d", "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"], ["d", "M14 3v6h6"], ["x", "3", "y", "3", "width", "18", "height", "6", "rx", "1"], ["d", "M3 9v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9"], ["d", "M10 13h4"], ["d", "m9 8-5 4 5 4"], ["d", "m15 8 5 4-5 4"], ["d", "m13 5-2 14"], ["d", "M9 14h6"], ["d", "M9 17h4"]], template: function FileIcon_Template(rf, ctx) { if (rf & 1) {
|
|
66
|
+
i0.ɵɵconditionalCreate(0, FileIcon_Case_0_Template, 3, 0)(1, FileIcon_Case_1_Template, 2, 0)(2, FileIcon_Case_2_Template, 3, 0)(3, FileIcon_Case_3_Template, 2, 0)(4, FileIcon_Case_4_Template, 3, 0)(5, FileIcon_Case_5_Template, 3, 0)(6, FileIcon_Case_6_Template, 1, 0, "path", 0)(7, FileIcon_Case_7_Template, 4, 0);
|
|
67
|
+
} if (rf & 2) {
|
|
68
|
+
let tmp_0_0;
|
|
69
|
+
i0.ɵɵconditional((tmp_0_0 = ctx.kind) === "image" ? 0 : tmp_0_0 === "video" ? 1 : tmp_0_0 === "audio" ? 2 : tmp_0_0 === "document" ? 3 : tmp_0_0 === "archive" ? 4 : tmp_0_0 === "code" ? 5 : tmp_0_0 === "folder" ? 6 : tmp_0_0 === "other" ? 7 : -1);
|
|
70
|
+
} }, encapsulation: 2 });
|
|
71
|
+
}
|
|
72
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FileIcon, [{
|
|
73
|
+
type: Component,
|
|
74
|
+
args: [{
|
|
75
|
+
selector: 'svg[mol-file-icon]',
|
|
76
|
+
standalone: true,
|
|
77
|
+
inputs: ['kind', 'size', 'ariaLabel'],
|
|
78
|
+
host: {
|
|
79
|
+
'[attr.xmlns]': '"http://www.w3.org/2000/svg"',
|
|
80
|
+
'[attr.width]': 'attrSize()',
|
|
81
|
+
'[attr.height]': 'attrSize()',
|
|
82
|
+
'[attr.viewBox]': '"0 0 24 24"',
|
|
83
|
+
'[attr.fill]': '"none"',
|
|
84
|
+
'[attr.stroke]': '"currentColor"',
|
|
85
|
+
'[attr.stroke-width]': '1.75',
|
|
86
|
+
'[attr.stroke-linecap]': '"round"',
|
|
87
|
+
'[attr.stroke-linejoin]': '"round"',
|
|
88
|
+
'[attr.role]': 'ariaLabel ? "img" : null',
|
|
89
|
+
'[attr.aria-label]': 'ariaLabel ?? null',
|
|
90
|
+
'[attr.aria-hidden]': 'ariaLabel ? null : true',
|
|
91
|
+
'[attr.data-mol-id]': '"file-icon-" + kind',
|
|
92
|
+
},
|
|
93
|
+
// The glyphs are inline in the template, one @case per FileKind, so the
|
|
94
|
+
// rendered elements match React's PATHS exactly (SVG child elements need
|
|
95
|
+
// the svg: namespace prefix under an SVG host).
|
|
96
|
+
// prettier-ignore
|
|
97
|
+
template: `@switch (kind) {
|
|
98
|
+
@case ('image') {<svg:rect x="3" y="5" width="18" height="14" rx="2" /><svg:circle cx="8.5" cy="10.5" r="1.5" /><svg:path d="m21 15-5-5L5 21" />}
|
|
99
|
+
@case ('video') {<svg:rect x="3" y="5" width="18" height="14" rx="2" /><svg:path d="m10 9 5 3-5 3z" fill="currentColor" />}
|
|
100
|
+
@case ('audio') {<svg:path d="M9 18V5l12-2v13" /><svg:circle cx="6" cy="18" r="3" /><svg:circle cx="18" cy="16" r="3" />}
|
|
101
|
+
@case ('document') {<svg:path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" /><svg:path d="M14 3v6h6" />}
|
|
102
|
+
@case ('archive') {<svg:rect x="3" y="3" width="18" height="6" rx="1" /><svg:path d="M3 9v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9" /><svg:path d="M10 13h4" />}
|
|
103
|
+
@case ('code') {<svg:path d="m9 8-5 4 5 4" /><svg:path d="m15 8 5 4-5 4" /><svg:path d="m13 5-2 14" />}
|
|
104
|
+
@case ('folder') {<svg:path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />}
|
|
105
|
+
@case ('other') {<svg:path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" /><svg:path d="M14 3v6h6" /><svg:path d="M9 14h6" /><svg:path d="M9 17h4" />}
|
|
106
|
+
}`,
|
|
107
|
+
}]
|
|
108
|
+
}], null, null); })();
|
|
109
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FileIcon, { className: "FileIcon", filePath: "file-icon.component.ts", lineNumber: 52 }); })();
|
|
110
|
+
//# sourceMappingURL=file-icon.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-icon.component.js","sourceRoot":"","sources":["../src/file-icon.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;;;;IAmCuE,AAAzC,AAAtD,6BAAsD,gBAAyC,cAAgC;;;;IACzE,AAAtD,6BAAsD,cAAmD;;;;IACtC,AAAnC,AAAhC,6BAAgC,gBAAmC,gBAAoC;;;;IACzB,AAA3E,6BAA2E,cAA0B;;;;IACQ,AAAzD,AAArD,8BAAqD,eAAyD,eAAyB;;;;IAC/E,AAA9B,AAA7B,8BAA6B,eAA8B,eAA2B;;;;IACpF,6BAA0F;;;;IACkC,AAAxB,AAA1B,AAA3E,6BAA2E,cAA0B,eAAwB,eAAwB;;AAtCtK;;;;;;GAMG;AAmCH,MAAM,OAAO,QAAQ;IACnB,uCAAuC;IACvC,IAAI,CAAW;IACf,mDAAmD;IACnD,IAAI,CAAS;IACb,mEAAmE;IACnE,SAAS,CAAS;IAElB;;;;OAIG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,IAAI,EAAE,CAAA;IACxB,CAAC;kGAfU,QAAQ;6DAAR,QAAQ;oCAAR,4BACI,WADJ,cAAU,YAAV,cAAU,aAAV,WACb,UADa,MAAM,YAAN,cACV,kBADU,IAAI,oBAAJ,OAAO,qBAAP,OAAO,0BACnB,KAAK,GAAG,IAAI,iCAAX,IAAI,iCAAL,IAAI,GAAG,IAAI,iBADC,YACZ;;YAJD,AADA,AADA,AADA,AADA,AADA,AADA,AADA,yDAAiB,mCACA,mCACA,mCACG,mCACD,mCACH,8CACE,mCACD;;;YARJ,0CAAA,OAAO,mBAAP,OAAO,mBAAP,OAAO,mBAAP,UAAU,mBAAV,SAAS,mBAAT,MAAM,mBAAN,QAAQ,mBAAR,OAAO,UASnB;;;iFAEY,QAAQ;cAlCpB,SAAS;eAAC;gBACT,QAAQ,EAAE,oBAAoB;gBAC9B,UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC;gBACrC,IAAI,EAAE;oBACJ,cAAc,EAAE,8BAA8B;oBAC9C,cAAc,EAAE,YAAY;oBAC5B,eAAe,EAAE,YAAY;oBAC7B,gBAAgB,EAAE,aAAa;oBAC/B,aAAa,EAAE,QAAQ;oBACvB,eAAe,EAAE,gBAAgB;oBACjC,qBAAqB,EAAE,MAAM;oBAC7B,uBAAuB,EAAE,SAAS;oBAClC,wBAAwB,EAAE,SAAS;oBACnC,aAAa,EAAE,0BAA0B;oBACzC,mBAAmB,EAAE,mBAAmB;oBACxC,oBAAoB,EAAE,yBAAyB;oBAC/C,oBAAoB,EAAE,qBAAqB;iBAC5C;gBACD,wEAAwE;gBACxE,yEAAyE;gBACzE,gDAAgD;gBAChD,kBAAkB;gBAClB,QAAQ,EAAE;;;;;;;;;EASV;aACD;;kFACY,QAAQ"}
|
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format helpers for the file card. Pure functions — UI-agnostic so they can
|
|
3
|
+
* be unit-tested directly.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
/** The unit token a formatted byte count ends in (`B` plus the binary steps). */
|
|
8
|
+
export type SizeUnit = 'B' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB';
|
|
9
|
+
/** A formatted size's displayed number and its unit token, split for `t()`. */
|
|
10
|
+
export interface SizeParts {
|
|
11
|
+
/** The displayed number, rounded the way {@link bytes} displays it. */
|
|
12
|
+
n: string;
|
|
13
|
+
/** The unit token the number counts. */
|
|
14
|
+
unit: SizeUnit;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Split a non-negative byte count into its displayed number and unit token
|
|
18
|
+
* (e.g. `420` + `B`, `1.4` + `KB`, `471` + `MB`) — the two halves
|
|
19
|
+
* {@link bytes} joins, exposed so the card can translate the unit word via
|
|
20
|
+
* `t()` (one literal key per {@link SizeUnit}, as the kind labels do).
|
|
21
|
+
*
|
|
22
|
+
* Uses a 1024 base (binary) and 1 fractional digit for KB+. Returns the
|
|
23
|
+
* `0 B` parts for non-finite or negative inputs so callers do not need to
|
|
24
|
+
* pre-validate.
|
|
25
|
+
*
|
|
26
|
+
* @param value - Byte count (>= 0).
|
|
27
|
+
* @returns The displayed number and unit token.
|
|
28
|
+
*/
|
|
29
|
+
export declare function sizeParts(value: number): SizeParts;
|
|
30
|
+
/**
|
|
31
|
+
* Format a non-negative byte count as a short human-readable string
|
|
32
|
+
* (e.g. `420 B`, `1.4 KB`, `2.3 MB`, `4.7 GB`, `8.1 TB`).
|
|
33
|
+
*
|
|
34
|
+
* The unlocalized join of {@link sizeParts}'s two halves, for callers that
|
|
35
|
+
* want the raw SI shorthand. The card itself renders the unit through `t()`
|
|
36
|
+
* (`file-card.size.<unit>` keys in the locale bond) so a locale switch
|
|
37
|
+
* translates it; the unit token is universal SI shorthand — a language that
|
|
38
|
+
* names bytes differently (French octets, Russian КБ) changes only the token,
|
|
39
|
+
* never the magnitude.
|
|
40
|
+
*
|
|
41
|
+
* @param value - Byte count (>= 0).
|
|
42
|
+
* @returns Formatted size string.
|
|
43
|
+
*/
|
|
44
|
+
export declare function bytes(value: number): string;
|
|
45
|
+
/**
|
|
46
|
+
* A relative-time bucket used to pick a translation key. Higher granularity
|
|
47
|
+
* buckets first; falls through to absolute date when older than ~1 year.
|
|
48
|
+
*/
|
|
49
|
+
export type RelativeBucket = {
|
|
50
|
+
kind: 'just-now';
|
|
51
|
+
} | {
|
|
52
|
+
kind: 'minutes';
|
|
53
|
+
n: number;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'hours';
|
|
56
|
+
n: number;
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'days';
|
|
59
|
+
n: number;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'weeks';
|
|
62
|
+
n: number;
|
|
63
|
+
} | {
|
|
64
|
+
kind: 'months';
|
|
65
|
+
n: number;
|
|
66
|
+
} | {
|
|
67
|
+
kind: 'absolute';
|
|
68
|
+
iso: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Bucket a `Date` (or ISO string / ms timestamp) against `now` into a
|
|
72
|
+
* relative-time bucket. The bucket is purely structural — translation keys
|
|
73
|
+
* and pluralization are applied by the consumer.
|
|
74
|
+
*
|
|
75
|
+
* @param at - Modified-at timestamp (ISO string, ms epoch, or `Date`).
|
|
76
|
+
* @param now - Reference "now" (defaults to `new Date()`). Injected for tests.
|
|
77
|
+
* @returns A `RelativeBucket` describing the offset from `now`.
|
|
78
|
+
*/
|
|
79
|
+
export declare function relativeBucket(at: string | number | Date, now?: Date): RelativeBucket;
|
|
80
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,iFAAiF;AACjF,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAE7D,+EAA+E;AAC/E,MAAM,WAAW,SAAS;IACxB,uEAAuE;IACvE,CAAC,EAAE,MAAM,CAAA;IACT,wCAAwC;IACxC,IAAI,EAAE,QAAQ,CAAA;CACf;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAalD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG3C;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAErC;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,GAAG,GAAE,IAAiB,GAAG,cAAc,CAiBjG"}
|
package/dist/format.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format helpers for the file card. Pure functions — UI-agnostic so they can
|
|
3
|
+
* be unit-tested directly.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Split a non-negative byte count into its displayed number and unit token
|
|
9
|
+
* (e.g. `420` + `B`, `1.4` + `KB`, `471` + `MB`) — the two halves
|
|
10
|
+
* {@link bytes} joins, exposed so the card can translate the unit word via
|
|
11
|
+
* `t()` (one literal key per {@link SizeUnit}, as the kind labels do).
|
|
12
|
+
*
|
|
13
|
+
* Uses a 1024 base (binary) and 1 fractional digit for KB+. Returns the
|
|
14
|
+
* `0 B` parts for non-finite or negative inputs so callers do not need to
|
|
15
|
+
* pre-validate.
|
|
16
|
+
*
|
|
17
|
+
* @param value - Byte count (>= 0).
|
|
18
|
+
* @returns The displayed number and unit token.
|
|
19
|
+
*/
|
|
20
|
+
export function sizeParts(value) {
|
|
21
|
+
if (!Number.isFinite(value) || value < 0)
|
|
22
|
+
return { n: '0', unit: 'B' };
|
|
23
|
+
if (value < 1024)
|
|
24
|
+
return { n: String(Math.round(value)), unit: 'B' };
|
|
25
|
+
const units = ['KB', 'MB', 'GB', 'TB', 'PB'];
|
|
26
|
+
let n = value / 1024;
|
|
27
|
+
let unitIndex = 0;
|
|
28
|
+
while (n >= 1024 && unitIndex < units.length - 1) {
|
|
29
|
+
n /= 1024;
|
|
30
|
+
unitIndex += 1;
|
|
31
|
+
}
|
|
32
|
+
// 1 decimal place when < 100, else round
|
|
33
|
+
const display = n >= 100 ? Math.round(n).toString() : n.toFixed(1).replace(/\.0$/, '');
|
|
34
|
+
return { n: display, unit: units[unitIndex] };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Format a non-negative byte count as a short human-readable string
|
|
38
|
+
* (e.g. `420 B`, `1.4 KB`, `2.3 MB`, `4.7 GB`, `8.1 TB`).
|
|
39
|
+
*
|
|
40
|
+
* The unlocalized join of {@link sizeParts}'s two halves, for callers that
|
|
41
|
+
* want the raw SI shorthand. The card itself renders the unit through `t()`
|
|
42
|
+
* (`file-card.size.<unit>` keys in the locale bond) so a locale switch
|
|
43
|
+
* translates it; the unit token is universal SI shorthand — a language that
|
|
44
|
+
* names bytes differently (French octets, Russian КБ) changes only the token,
|
|
45
|
+
* never the magnitude.
|
|
46
|
+
*
|
|
47
|
+
* @param value - Byte count (>= 0).
|
|
48
|
+
* @returns Formatted size string.
|
|
49
|
+
*/
|
|
50
|
+
export function bytes(value) {
|
|
51
|
+
const { n, unit } = sizeParts(value);
|
|
52
|
+
return `${n} ${unit}`;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Bucket a `Date` (or ISO string / ms timestamp) against `now` into a
|
|
56
|
+
* relative-time bucket. The bucket is purely structural — translation keys
|
|
57
|
+
* and pluralization are applied by the consumer.
|
|
58
|
+
*
|
|
59
|
+
* @param at - Modified-at timestamp (ISO string, ms epoch, or `Date`).
|
|
60
|
+
* @param now - Reference "now" (defaults to `new Date()`). Injected for tests.
|
|
61
|
+
* @returns A `RelativeBucket` describing the offset from `now`.
|
|
62
|
+
*/
|
|
63
|
+
export function relativeBucket(at, now = new Date()) {
|
|
64
|
+
const then = at instanceof Date ? at : new Date(at);
|
|
65
|
+
const ms = now.getTime() - then.getTime();
|
|
66
|
+
if (!Number.isFinite(ms))
|
|
67
|
+
return { kind: 'absolute', iso: String(at) };
|
|
68
|
+
if (ms < 60_000)
|
|
69
|
+
return { kind: 'just-now' };
|
|
70
|
+
const minute = 60_000;
|
|
71
|
+
const hour = 60 * minute;
|
|
72
|
+
const day = 24 * hour;
|
|
73
|
+
const week = 7 * day;
|
|
74
|
+
const month = 30 * day;
|
|
75
|
+
const year = 365 * day;
|
|
76
|
+
if (ms < hour)
|
|
77
|
+
return { kind: 'minutes', n: Math.floor(ms / minute) };
|
|
78
|
+
if (ms < day)
|
|
79
|
+
return { kind: 'hours', n: Math.floor(ms / hour) };
|
|
80
|
+
if (ms < week)
|
|
81
|
+
return { kind: 'days', n: Math.floor(ms / day) };
|
|
82
|
+
if (ms < month)
|
|
83
|
+
return { kind: 'weeks', n: Math.floor(ms / week) };
|
|
84
|
+
if (ms < year)
|
|
85
|
+
return { kind: 'months', n: Math.floor(ms / month) };
|
|
86
|
+
return { kind: 'absolute', iso: then.toISOString().slice(0, 10) };
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular file card primitives — the Angular counterpart of
|
|
3
|
+
* `@molecule/app-file-card-react`: the same props and the same DOM for the
|
|
4
|
+
* same input.
|
|
5
|
+
*
|
|
6
|
+
* Exports:
|
|
7
|
+
* - `<FileCard>` — file representation card (icon/thumbnail + name + size + modified date + optional actions).
|
|
8
|
+
* Two layouts: `'grid'` (square tile, default) and `'row'` (horizontal list line).
|
|
9
|
+
* - `<FileIcon>` — stroke-currentColor SVG glyph keyed by `FileKind`.
|
|
10
|
+
* - `bytes(value)` — pure helper that formats a byte count as `420 B` / `1.4 KB` / `2.3 MB` / etc.
|
|
11
|
+
* - `sizeParts(value)` — the same split as `{ n, unit }`, for rendering the unit through `t()`.
|
|
12
|
+
* - `relativeBucket(at, now?)` — pure helper that buckets a timestamp into `just-now` / `minutes` /
|
|
13
|
+
* `hours` / `days` / `weeks` / `months` / `absolute`.
|
|
14
|
+
* - `FileSummary` / `FileKind` / `SizeParts` types — stable shape for the consumer's domain model.
|
|
15
|
+
*
|
|
16
|
+
* Used by cloud-file-manager (grid + list views), social-media + email-client
|
|
17
|
+
* (attachment previews), and document-collaboration (sidebars).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { Component } from '@angular/core'
|
|
22
|
+
* import { FileCard } from '@molecule/app-file-card-angular'
|
|
23
|
+
*
|
|
24
|
+
* @Component({
|
|
25
|
+
* selector: 'app-attachment',
|
|
26
|
+
* standalone: true,
|
|
27
|
+
* imports: [FileCard],
|
|
28
|
+
* template: `
|
|
29
|
+
* <div mol-file-card [file]="file" [layout]="'grid'" (onClick)="open(file.id)">
|
|
30
|
+
* <button type="button" slot="actions" (click)="menu($event)">⋯</button>
|
|
31
|
+
* </div>
|
|
32
|
+
* `,
|
|
33
|
+
* })
|
|
34
|
+
* export class Attachment {}
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* - All styling routes through `getClassMap()` from `@molecule/app-ui` —
|
|
39
|
+
* swap the ClassMap bond to restyle without touching this package.
|
|
40
|
+
* - All user-visible text routes through `t()` (via `@molecule/app-angular`'s
|
|
41
|
+
* `useTranslation`) and translates via the companion
|
|
42
|
+
* `@molecule/app-locales-file-card` locale bond. English fallbacks are
|
|
43
|
+
* inlined so the card works without the locale bond present.
|
|
44
|
+
* - Node props are projected content: `actions` is selected by
|
|
45
|
+
* `[slot=actions]`, everything else lands in the card body as the default
|
|
46
|
+
* projection.
|
|
47
|
+
*
|
|
48
|
+
* @module
|
|
49
|
+
*/
|
|
50
|
+
export * from './file-card.component.js';
|
|
51
|
+
export * from './file-icon.component.js';
|
|
52
|
+
export * from './format.js';
|
|
53
|
+
export * from './types.js';
|
|
54
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular file card primitives — the Angular counterpart of
|
|
3
|
+
* `@molecule/app-file-card-react`: the same props and the same DOM for the
|
|
4
|
+
* same input.
|
|
5
|
+
*
|
|
6
|
+
* Exports:
|
|
7
|
+
* - `<FileCard>` — file representation card (icon/thumbnail + name + size + modified date + optional actions).
|
|
8
|
+
* Two layouts: `'grid'` (square tile, default) and `'row'` (horizontal list line).
|
|
9
|
+
* - `<FileIcon>` — stroke-currentColor SVG glyph keyed by `FileKind`.
|
|
10
|
+
* - `bytes(value)` — pure helper that formats a byte count as `420 B` / `1.4 KB` / `2.3 MB` / etc.
|
|
11
|
+
* - `sizeParts(value)` — the same split as `{ n, unit }`, for rendering the unit through `t()`.
|
|
12
|
+
* - `relativeBucket(at, now?)` — pure helper that buckets a timestamp into `just-now` / `minutes` /
|
|
13
|
+
* `hours` / `days` / `weeks` / `months` / `absolute`.
|
|
14
|
+
* - `FileSummary` / `FileKind` / `SizeParts` types — stable shape for the consumer's domain model.
|
|
15
|
+
*
|
|
16
|
+
* Used by cloud-file-manager (grid + list views), social-media + email-client
|
|
17
|
+
* (attachment previews), and document-collaboration (sidebars).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { Component } from '@angular/core'
|
|
22
|
+
* import { FileCard } from '@molecule/app-file-card-angular'
|
|
23
|
+
*
|
|
24
|
+
* @Component({
|
|
25
|
+
* selector: 'app-attachment',
|
|
26
|
+
* standalone: true,
|
|
27
|
+
* imports: [FileCard],
|
|
28
|
+
* template: `
|
|
29
|
+
* <div mol-file-card [file]="file" [layout]="'grid'" (onClick)="open(file.id)">
|
|
30
|
+
* <button type="button" slot="actions" (click)="menu($event)">⋯</button>
|
|
31
|
+
* </div>
|
|
32
|
+
* `,
|
|
33
|
+
* })
|
|
34
|
+
* export class Attachment {}
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* - All styling routes through `getClassMap()` from `@molecule/app-ui` —
|
|
39
|
+
* swap the ClassMap bond to restyle without touching this package.
|
|
40
|
+
* - All user-visible text routes through `t()` (via `@molecule/app-angular`'s
|
|
41
|
+
* `useTranslation`) and translates via the companion
|
|
42
|
+
* `@molecule/app-locales-file-card` locale bond. English fallbacks are
|
|
43
|
+
* inlined so the card works without the locale bond present.
|
|
44
|
+
* - Node props are projected content: `actions` is selected by
|
|
45
|
+
* `[slot=actions]`, everything else lands in the card body as the default
|
|
46
|
+
* projection.
|
|
47
|
+
*
|
|
48
|
+
* @module
|
|
49
|
+
*/
|
|
50
|
+
export * from './file-card.component.js';
|
|
51
|
+
export * from './file-icon.component.js';
|
|
52
|
+
export * from './format.js';
|
|
53
|
+
export * from './types.js';
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of `@molecule/app-file-card-angular` — the Angular counterpart of
|
|
3
|
+
* `@molecule/app-file-card-react`, same props and DOM.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Supported file kinds. Drives icon selection and the "<kind>" portion of
|
|
9
|
+
* the aria label translation key (e.g. `file-card.kind.image`).
|
|
10
|
+
*/
|
|
11
|
+
export type FileKind = 'image' | 'video' | 'audio' | 'document' | 'archive' | 'code' | 'folder' | 'other';
|
|
12
|
+
/**
|
|
13
|
+
* Minimal description of a file shown in a `<FileCard>`. Apps map their own
|
|
14
|
+
* domain types onto this shape — there is no required mime field; pass
|
|
15
|
+
* `kind` instead so the icon matches even when only a filename is known.
|
|
16
|
+
*/
|
|
17
|
+
export interface FileSummary {
|
|
18
|
+
/** Stable identifier for the file (parent key + `data-mol-id` suffix). */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Display name (filename including extension). */
|
|
21
|
+
name: string;
|
|
22
|
+
/** Size in bytes. Pass `0` for folders or unknown. */
|
|
23
|
+
size: number;
|
|
24
|
+
/** File kind — drives the icon and the "kind" aria token. */
|
|
25
|
+
kind: FileKind;
|
|
26
|
+
/** Last-modified timestamp (ISO string, ms epoch, or `Date`). Optional. */
|
|
27
|
+
modifiedAt?: string | number | Date;
|
|
28
|
+
/** Optional thumbnail URL. When set, replaces the icon in `'grid'` layout. */
|
|
29
|
+
thumbnail?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Props accepted by `<FileCard>` — the same props
|
|
33
|
+
* `@molecule/app-file-card-react` accepts. Node props (`actions`) are
|
|
34
|
+
* projected content in Angular (an input cannot carry a node), so `actions`
|
|
35
|
+
* is typed `unknown`: pass it in the host template as `[slot=actions]`.
|
|
36
|
+
*/
|
|
37
|
+
export interface FileCardProps {
|
|
38
|
+
/** The file to render. */
|
|
39
|
+
file: FileSummary;
|
|
40
|
+
/** Selected highlight state. */
|
|
41
|
+
selected?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Handler fired when the card body is activated: a click anywhere on it, or
|
|
44
|
+
* Enter / Space on its select button (a transparent button covering the card,
|
|
45
|
+
* with `aria-pressed` for `selected`). Not fired for the actions slot, which
|
|
46
|
+
* sits above that button.
|
|
47
|
+
*/
|
|
48
|
+
onClick?: (file: FileSummary, event: MouseEvent) => void;
|
|
49
|
+
/** Context-menu (right-click) handler. */
|
|
50
|
+
onContextMenu?: (file: FileSummary, event: MouseEvent) => void;
|
|
51
|
+
/** Layout — `'grid'` (default) is a square tile, `'row'` is a horizontal list line. */
|
|
52
|
+
layout?: 'grid' | 'row';
|
|
53
|
+
/** Optional trailing action slot, projected as `[slot=actions]` content. */
|
|
54
|
+
actions?: unknown;
|
|
55
|
+
/** Reference "now" for relative-time formatting. Useful for testing/snapshots. */
|
|
56
|
+
now?: Date;
|
|
57
|
+
/** Extra classes merged onto the root element. */
|
|
58
|
+
className?: string;
|
|
59
|
+
/** Override the root `data-mol-id` (defaults to `file-card-${file.id}`). */
|
|
60
|
+
dataMolId?: string;
|
|
61
|
+
}
|
|
62
|
+
/** Props for `<FileIcon>`. */
|
|
63
|
+
export interface FileIconProps {
|
|
64
|
+
/** File kind — picks the SVG glyph. */
|
|
65
|
+
kind: FileKind;
|
|
66
|
+
/** Pixel size of the rendered SVG (default 24). */
|
|
67
|
+
size?: number;
|
|
68
|
+
/** Optional aria-label. When omitted the icon is `aria-hidden`. */
|
|
69
|
+
ariaLabel?: string;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAClB,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEpF;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,EAAE,EAAE,MAAM,CAAA;IACV,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAA;IACZ,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,IAAI,EAAE,QAAQ,CAAA;IACd,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IACnC,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,IAAI,EAAE,WAAW,CAAA;IACjB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACxD,0CAA0C;IAC1C,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IAC9D,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IACvB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kFAAkF;IAClF,GAAG,CAAC,EAAE,IAAI,CAAA;IACV,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,8BAA8B;AAC9B,MAAM,WAAW,aAAa;IAC5B,uCAAuC;IACvC,IAAI,EAAE,QAAQ,CAAA;IACd,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-file-card-angular",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1-stage",
|
|
4
|
+
"description": "Angular file card primitives — icon, name, size, modified date, actions; grid + row layouts",
|
|
5
|
+
"homepage": "https://www.molecule.dev/packages/app-file-card-angular",
|
|
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": "ngc",
|
|
21
|
+
"dev": "ngc --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"molecule",
|
|
27
|
+
"file-card",
|
|
28
|
+
"attachment",
|
|
29
|
+
"file-tile",
|
|
30
|
+
"angular"
|
|
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/file-card-angular"
|
|
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
|
+
"@angular/common": "^22.0.0",
|
|
48
|
+
"@angular/core": "^22.0.0",
|
|
49
|
+
"@angular/platform-browser": "^22.0.0",
|
|
50
|
+
"@molecule/app-angular": "^3.5.0",
|
|
51
|
+
"@molecule/app-ui": "^1.0.1",
|
|
52
|
+
"@molecule/app-ui-angular": "^1.1.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@angular/common": "22.2.3",
|
|
56
|
+
"@angular/compiler": "22.2.3",
|
|
57
|
+
"@angular/compiler-cli": "22.2.3",
|
|
58
|
+
"@angular/core": "22.2.3",
|
|
59
|
+
"@angular/platform-browser": "22.2.3",
|
|
60
|
+
"@molecule/app-angular": "3.7.2",
|
|
61
|
+
"@molecule/app-framework-conformance": "0.0.0",
|
|
62
|
+
"@molecule/app-i18n": "1.2.2",
|
|
63
|
+
"@molecule/app-icons": "1.0.4",
|
|
64
|
+
"@molecule/app-ui": "1.4.0",
|
|
65
|
+
"@molecule/app-ui-angular": "1.2.1",
|
|
66
|
+
"@types/node": "26.6.5",
|
|
67
|
+
"jsdom": "30.1.3",
|
|
68
|
+
"rxjs": "7.8.2",
|
|
69
|
+
"typescript": "6.0.3",
|
|
70
|
+
"vitest": "4.1.12",
|
|
71
|
+
"zone.js": "0.16.3"
|
|
72
|
+
}
|
|
73
|
+
}
|