@mk-kit/mcp 0.56.0 → 0.58.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/data/api.json +558 -1
- package/data/llms-full.txt +456 -2
- package/data/llms.txt +2 -1
- package/package.json +1 -1
package/data/api.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@mk-kit/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"site": "https://mk-kit.dev",
|
|
5
5
|
"entries": [
|
|
6
6
|
{
|
|
@@ -85,6 +85,39 @@
|
|
|
85
85
|
"queries": [],
|
|
86
86
|
"docs": "/core-services"
|
|
87
87
|
},
|
|
88
|
+
{
|
|
89
|
+
"name": "MkAccentService",
|
|
90
|
+
"description": "Runtime accent — the user picks one of `MK_ACCENTS` and every kit\ncontrol recolours: the service writes the `--mk-primary` family\n(`primary`, `-hover`, `-active`, `-subtle`, `-subtle-hover`,\n`-subtle-text`), `--mk-focus-ring`, `--mk-selected-bg` / `-text` and three\naccent tokens of its own — `--mk-accent`, `--mk-accent-ink`,\n`--mk-accent-glow` — onto `<html>`, and mirrors the key as\n`data-mk-accent`. Hover / active are a touch darker in light and a touch\nlighter in dark (it follows `MkThemeService`). The choice persists\nin `localStorage` (`mk-kit-accent`); nothing is written until `set()` is\ncalled, so an app that never picks keeps the preset's own primary.\n\n```ts\nreadonly accent = inject(MkAccentService);\naccent.set('coral'); // every button, ring and chip turns coral\naccent.key(); // 'coral'\nmkAccentSwatch(accent.key()); // for the picker\n```",
|
|
91
|
+
"file": "projects/mk-kit/core/theme/accent.service.ts",
|
|
92
|
+
"kind": "service",
|
|
93
|
+
"providedIn": "root",
|
|
94
|
+
"methods": [
|
|
95
|
+
{
|
|
96
|
+
"name": "set",
|
|
97
|
+
"signature": "(key: MkAccentKey): void",
|
|
98
|
+
"description": "Pick an accent; persisted."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "reset",
|
|
102
|
+
"signature": "(): void",
|
|
103
|
+
"description": "Back to the preset's own primary; the stored choice is cleared."
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"properties": [
|
|
107
|
+
{
|
|
108
|
+
"name": "key",
|
|
109
|
+
"type": "Signal<MkAccentKey | null>",
|
|
110
|
+
"description": "The chosen accent, or `null` while the preset's own primary is in use.",
|
|
111
|
+
"readonly": true
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "accent",
|
|
115
|
+
"type": "Signal<MkAccent>",
|
|
116
|
+
"description": "The chosen accent's definition (indigo when none is chosen).",
|
|
117
|
+
"readonly": true
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
88
121
|
{
|
|
89
122
|
"name": "MkBreakpointService",
|
|
90
123
|
"description": "Reactive viewport breakpoints, one `matchMedia` listener per step.\n\n```ts\nprivate readonly bp = inject(MkBreakpointService);\nreadonly compact = this.bp.down('md'); // Signal<boolean>\nreadonly columns = computed(() => this.bp.resolve({ xs: 1, md: 2, xl: 4 }));\n```\n\nOn the server (no `window`) everything reports `xs`.",
|
|
@@ -373,6 +406,15 @@
|
|
|
373
406
|
}
|
|
374
407
|
]
|
|
375
408
|
},
|
|
409
|
+
{
|
|
410
|
+
"name": "mkAccentSwatch",
|
|
411
|
+
"description": "The swatch a picker shows for an accent (bumblebee is the black / yellow split).",
|
|
412
|
+
"file": "projects/mk-kit/core/theme/accent.service.ts",
|
|
413
|
+
"kind": "function",
|
|
414
|
+
"signatures": [
|
|
415
|
+
"(key: MkAccentKey): string"
|
|
416
|
+
]
|
|
417
|
+
},
|
|
376
418
|
{
|
|
377
419
|
"name": "mkBodyLevelAncestor",
|
|
378
420
|
"description": "The direct child of `document.body` an overlay-root descendant lives under,\ncrossing shadow boundaries on the way up — `null` when the node is not under\n`body` at all. The overlay service uses it to keep the overlay's own host\nout of the elements it makes `inert` behind a modal.",
|
|
@@ -427,6 +469,15 @@
|
|
|
427
469
|
"(root: HTMLElement): HTMLElement[]"
|
|
428
470
|
]
|
|
429
471
|
},
|
|
472
|
+
{
|
|
473
|
+
"name": "mkHexAlpha",
|
|
474
|
+
"description": "`#rrggbb` → `rgba(r,g,b,a)`.",
|
|
475
|
+
"file": "projects/mk-kit/core/theme/accent.service.ts",
|
|
476
|
+
"kind": "function",
|
|
477
|
+
"signatures": [
|
|
478
|
+
"(hex: string, alpha: number): string"
|
|
479
|
+
]
|
|
480
|
+
},
|
|
430
481
|
{
|
|
431
482
|
"name": "mkHighlight",
|
|
432
483
|
"description": "Highlight `src` for `language`, falling back to escaped plain text.",
|
|
@@ -627,6 +678,20 @@
|
|
|
627
678
|
"kind": "token",
|
|
628
679
|
"type": "InjectionToken<MkOverlayRootFn>"
|
|
629
680
|
},
|
|
681
|
+
{
|
|
682
|
+
"name": "MK_ACCENT_ORDER",
|
|
683
|
+
"description": "Picker order.",
|
|
684
|
+
"file": "projects/mk-kit/core/theme/accent.service.ts",
|
|
685
|
+
"kind": "const",
|
|
686
|
+
"type": "readonly MkAccentKey[]"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"name": "MK_ACCENTS",
|
|
690
|
+
"description": "High-saturation, distinct, energising accents — the set the `momentum` preset was designed around.",
|
|
691
|
+
"file": "projects/mk-kit/core/theme/accent.service.ts",
|
|
692
|
+
"kind": "const",
|
|
693
|
+
"type": "Record<MkAccentKey, MkAccent>"
|
|
694
|
+
},
|
|
630
695
|
{
|
|
631
696
|
"name": "MK_DEFAULT_BREAKPOINTS",
|
|
632
697
|
"description": "The default scale (same numbers as Tailwind, so mental models transfer).",
|
|
@@ -676,6 +741,29 @@
|
|
|
676
741
|
"kind": "const",
|
|
677
742
|
"type": "ReadonlySet<MkQueryOperator>"
|
|
678
743
|
},
|
|
744
|
+
{
|
|
745
|
+
"name": "MkAccent",
|
|
746
|
+
"description": "`fill` = bars, rings and buttons · `ink` = small accent text on a light ground.",
|
|
747
|
+
"file": "projects/mk-kit/core/theme/accent.service.ts",
|
|
748
|
+
"kind": "interface",
|
|
749
|
+
"members": [
|
|
750
|
+
{
|
|
751
|
+
"name": "fill",
|
|
752
|
+
"type": "string",
|
|
753
|
+
"description": ""
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"name": "ink",
|
|
757
|
+
"type": "string",
|
|
758
|
+
"description": ""
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"name": "name",
|
|
762
|
+
"type": "string",
|
|
763
|
+
"description": ""
|
|
764
|
+
}
|
|
765
|
+
]
|
|
766
|
+
},
|
|
679
767
|
{
|
|
680
768
|
"name": "MkAnchoredPosition",
|
|
681
769
|
"description": "Resolved coordinates (viewport-relative, for `position: fixed`).",
|
|
@@ -1547,6 +1635,46 @@
|
|
|
1547
1635
|
"type": "string",
|
|
1548
1636
|
"description": ""
|
|
1549
1637
|
},
|
|
1638
|
+
{
|
|
1639
|
+
"name": "sessionExpiryTitle",
|
|
1640
|
+
"type": "string",
|
|
1641
|
+
"description": "Session-expiry dialog (`@mk-kit/ui/attention`)."
|
|
1642
|
+
},
|
|
1643
|
+
{
|
|
1644
|
+
"name": "sessionExpiryExtend",
|
|
1645
|
+
"type": "string",
|
|
1646
|
+
"description": ""
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
"name": "sessionExpiryExtending",
|
|
1650
|
+
"type": "string",
|
|
1651
|
+
"description": ""
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
"name": "sessionExpiryLogout",
|
|
1655
|
+
"type": "string",
|
|
1656
|
+
"description": ""
|
|
1657
|
+
},
|
|
1658
|
+
{
|
|
1659
|
+
"name": "sessionExpiryBody",
|
|
1660
|
+
"type": "(countdown: string) => string",
|
|
1661
|
+
"description": ""
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
"name": "scannerTitle",
|
|
1665
|
+
"type": "string",
|
|
1666
|
+
"description": "Barcode scanner (`@mk-kit/ui/media/scanner`)."
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
"name": "scannerHint",
|
|
1670
|
+
"type": "string",
|
|
1671
|
+
"description": ""
|
|
1672
|
+
},
|
|
1673
|
+
{
|
|
1674
|
+
"name": "scannerCameraError",
|
|
1675
|
+
"type": "string",
|
|
1676
|
+
"description": ""
|
|
1677
|
+
},
|
|
1550
1678
|
{
|
|
1551
1679
|
"name": "resultsCount",
|
|
1552
1680
|
"type": "(count: number) => string",
|
|
@@ -3266,6 +3394,13 @@
|
|
|
3266
3394
|
}
|
|
3267
3395
|
]
|
|
3268
3396
|
},
|
|
3397
|
+
{
|
|
3398
|
+
"name": "MkAccentKey",
|
|
3399
|
+
"description": "One of the eight kit accents (the Momentum palette).",
|
|
3400
|
+
"file": "projects/mk-kit/core/theme/accent.service.ts",
|
|
3401
|
+
"kind": "type",
|
|
3402
|
+
"definition": "'indigo' | 'blue' | 'teal' | 'violet' | 'coral' | 'lime' | 'pink' | 'bumblebee'"
|
|
3403
|
+
},
|
|
3269
3404
|
{
|
|
3270
3405
|
"name": "MkAriaLivePoliteness",
|
|
3271
3406
|
"description": "",
|
|
@@ -18562,6 +18697,314 @@
|
|
|
18562
18697
|
}
|
|
18563
18698
|
]
|
|
18564
18699
|
},
|
|
18700
|
+
{
|
|
18701
|
+
"name": "attention",
|
|
18702
|
+
"import": "@mk-kit/ui/attention",
|
|
18703
|
+
"exports": [
|
|
18704
|
+
{
|
|
18705
|
+
"name": "MkSessionExpiryDialog",
|
|
18706
|
+
"description": "Last call before a session ends: counts down and offers to extend.\nReaching zero ends the session, so doing nothing still produces a definite,\nvisible outcome. Opened by `MkSessionExpiry`; usable on its own.",
|
|
18707
|
+
"file": "projects/mk-kit/attention/session-expiry.ts",
|
|
18708
|
+
"kind": "component",
|
|
18709
|
+
"selector": "mk-session-expiry-dialog",
|
|
18710
|
+
"selectors": [
|
|
18711
|
+
"mk-session-expiry-dialog"
|
|
18712
|
+
],
|
|
18713
|
+
"inputs": [],
|
|
18714
|
+
"outputs": [],
|
|
18715
|
+
"methods": [],
|
|
18716
|
+
"properties": [],
|
|
18717
|
+
"queries": [],
|
|
18718
|
+
"docs": "/components/attention"
|
|
18719
|
+
},
|
|
18720
|
+
{
|
|
18721
|
+
"name": "MkNotificationSound",
|
|
18722
|
+
"description": "Alert sounds for incoming work (orders, messages, tickets) with the\nbrowser's autoplay rules handled: an `AudioContext` stays suspended until a\nuser gesture, so a sound fired by a WebSocket message would be silent. The\ncontext is unlocked when the user enables sound (a click) and lazily on the\nfirst interaction anywhere in the app. The default sound is synthesised\n(a short C–E–G chime) — nothing to ship, no CORS, lowest latency; file\npresets are fetched and decoded once and fall back to the chime when they\nfail. The on/off preference lives in localStorage under a configurable key.\n\n```ts\nprovideMkNotificationSound({ presets: [MK_CHIME_PRESET, { id: 'ding', label: 'Ding', url: '/assets/ding.wav' }] })\nsound.primeOnFirstInteraction(); // at app start\nsound.play(settings.newOrderSound); // on an event, honours the device mute\nsound.preview('ding'); // settings page test button\n```",
|
|
18723
|
+
"file": "projects/mk-kit/attention/notification-sound.ts",
|
|
18724
|
+
"kind": "service",
|
|
18725
|
+
"providedIn": "root",
|
|
18726
|
+
"methods": [
|
|
18727
|
+
{
|
|
18728
|
+
"name": "isEnabled",
|
|
18729
|
+
"signature": "(): boolean",
|
|
18730
|
+
"description": "Whether the device has sound on."
|
|
18731
|
+
},
|
|
18732
|
+
{
|
|
18733
|
+
"name": "hasBeenAsked",
|
|
18734
|
+
"signature": "(): boolean",
|
|
18735
|
+
"description": "Whether the user ever answered the \"enable sound?\" question on this device."
|
|
18736
|
+
},
|
|
18737
|
+
{
|
|
18738
|
+
"name": "setEnabled",
|
|
18739
|
+
"signature": "(enabled: boolean): void",
|
|
18740
|
+
"description": "Persist the preference; call from a click so audio unlocks at once."
|
|
18741
|
+
},
|
|
18742
|
+
{
|
|
18743
|
+
"name": "primeOnFirstInteraction",
|
|
18744
|
+
"signature": "(): void",
|
|
18745
|
+
"description": "Arm a one-time listener so the first pointer/key interaction unlocks audio."
|
|
18746
|
+
},
|
|
18747
|
+
{
|
|
18748
|
+
"name": "chime",
|
|
18749
|
+
"signature": "(): void",
|
|
18750
|
+
"description": "The default chime, if the device has sound on."
|
|
18751
|
+
},
|
|
18752
|
+
{
|
|
18753
|
+
"name": "play",
|
|
18754
|
+
"signature": "(soundId: string, customUrl?: string | null): void",
|
|
18755
|
+
"description": "Play the sound configured for an event: a preset id, `custom` (with\n`customUrl`) or `none` (silent). Unknown ids and failed loads fall back\nto the chime. Honours the device mute."
|
|
18756
|
+
},
|
|
18757
|
+
{
|
|
18758
|
+
"name": "preview",
|
|
18759
|
+
"signature": "(soundId: string, customUrl?: string | null): void",
|
|
18760
|
+
"description": "Same as `play()` but ignores the device mute — for settings test buttons."
|
|
18761
|
+
}
|
|
18762
|
+
],
|
|
18763
|
+
"properties": [
|
|
18764
|
+
{
|
|
18765
|
+
"name": "presets",
|
|
18766
|
+
"type": "MkSoundPreset[]",
|
|
18767
|
+
"description": "The selectable presets (always includes the chime).",
|
|
18768
|
+
"readonly": true
|
|
18769
|
+
}
|
|
18770
|
+
],
|
|
18771
|
+
"docs": "/components/attention"
|
|
18772
|
+
},
|
|
18773
|
+
{
|
|
18774
|
+
"name": "MkSessionExpiry",
|
|
18775
|
+
"description": "Watches `expiresAt()` and warns BEFORE the session lapses, so a session\nnever ends silently: the dialog offers to extend, or signs out at zero.\nRe-arms itself whenever `expiresAt()` changes (every token rotation),\nruns the timer outside the Angular zone and only in the browser. Started\nautomatically by `provideMkSessionExpiry`.",
|
|
18776
|
+
"file": "projects/mk-kit/attention/session-expiry.ts",
|
|
18777
|
+
"kind": "service",
|
|
18778
|
+
"providedIn": "root",
|
|
18779
|
+
"methods": [
|
|
18780
|
+
{
|
|
18781
|
+
"name": "start",
|
|
18782
|
+
"signature": "(): void",
|
|
18783
|
+
"description": "Begin watching. Idempotent; called by the provider's initializer."
|
|
18784
|
+
}
|
|
18785
|
+
],
|
|
18786
|
+
"properties": [
|
|
18787
|
+
{
|
|
18788
|
+
"name": "open",
|
|
18789
|
+
"type": "WritableSignal<boolean>",
|
|
18790
|
+
"description": "Whether the dialog is currently open.",
|
|
18791
|
+
"readonly": true
|
|
18792
|
+
}
|
|
18793
|
+
],
|
|
18794
|
+
"docs": "/components/attention"
|
|
18795
|
+
},
|
|
18796
|
+
{
|
|
18797
|
+
"name": "MkTabAttention",
|
|
18798
|
+
"description": "Messenger-style tab attention: while unhandled work exists the favicon\ncarries a red counter badge, and — only while the tab is hidden — the\ntitle alternates with \"(N) label\" so a pinned tab flashes in the tab strip.\nFocusing the tab stops the blinking (someone is looking) but keeps the\nbadge until the count reaches zero. SSR-safe: every entry point bails\nwithout a `document`; the blink timer runs outside the Angular zone.\n\n```ts\nprivate attention = inject(MkTabAttention);\neffect(() => this.attention.set(this.pending().length, 'new orders'));\n```",
|
|
18799
|
+
"file": "projects/mk-kit/attention/tab-attention.ts",
|
|
18800
|
+
"kind": "service",
|
|
18801
|
+
"providedIn": "root",
|
|
18802
|
+
"methods": [
|
|
18803
|
+
{
|
|
18804
|
+
"name": "set",
|
|
18805
|
+
"signature": "(count: number, label?: string): void",
|
|
18806
|
+
"description": "Update the pending count and the label used in the blinking title."
|
|
18807
|
+
},
|
|
18808
|
+
{
|
|
18809
|
+
"name": "clear",
|
|
18810
|
+
"signature": "(): void",
|
|
18811
|
+
"description": "Drop the badge and the blinking entirely and stop listening."
|
|
18812
|
+
}
|
|
18813
|
+
],
|
|
18814
|
+
"properties": [
|
|
18815
|
+
{
|
|
18816
|
+
"name": "count",
|
|
18817
|
+
"type": "WritableSignal<number>",
|
|
18818
|
+
"description": "The count currently shown (0 = nothing pending).",
|
|
18819
|
+
"readonly": true
|
|
18820
|
+
}
|
|
18821
|
+
],
|
|
18822
|
+
"docs": "/components/attention"
|
|
18823
|
+
},
|
|
18824
|
+
{
|
|
18825
|
+
"name": "provideMkNotificationSound",
|
|
18826
|
+
"description": "Register presets / storage key for `MkNotificationSound`. Optional.",
|
|
18827
|
+
"file": "projects/mk-kit/attention/notification-sound.ts",
|
|
18828
|
+
"kind": "function",
|
|
18829
|
+
"signatures": [
|
|
18830
|
+
"(config: MkNotificationSoundConfig): { provide: InjectionToken<MkNotificationSoundConfig>; useValue: MkNotificationSoundConfig; }"
|
|
18831
|
+
]
|
|
18832
|
+
},
|
|
18833
|
+
{
|
|
18834
|
+
"name": "provideMkSessionExpiry",
|
|
18835
|
+
"description": "Register the session-expiry watcher; it starts with the application.\n\n```ts\nprovideMkSessionExpiry({\n expiresAt: () => auth.tokenExpiresAt(),\n extend: () => firstValueFrom(auth.refresh()),\n onExpire: () => auth.logout(),\n warnBeforeMs: 2 * 60_000,\n})\n```",
|
|
18836
|
+
"file": "projects/mk-kit/attention/session-expiry.ts",
|
|
18837
|
+
"kind": "function",
|
|
18838
|
+
"signatures": [
|
|
18839
|
+
"(config: MkSessionExpiryConfig): EnvironmentProviders"
|
|
18840
|
+
]
|
|
18841
|
+
},
|
|
18842
|
+
{
|
|
18843
|
+
"name": "provideMkTabAttention",
|
|
18844
|
+
"description": "Register options for `MkTabAttention`. Optional — the defaults work.",
|
|
18845
|
+
"file": "projects/mk-kit/attention/tab-attention.ts",
|
|
18846
|
+
"kind": "function",
|
|
18847
|
+
"signatures": [
|
|
18848
|
+
"(config: MkTabAttentionConfig): { provide: InjectionToken<MkTabAttentionConfig>; useValue: MkTabAttentionConfig; }"
|
|
18849
|
+
]
|
|
18850
|
+
},
|
|
18851
|
+
{
|
|
18852
|
+
"name": "MK_NOTIFICATION_SOUND_CONFIG",
|
|
18853
|
+
"description": "",
|
|
18854
|
+
"file": "projects/mk-kit/attention/notification-sound.ts",
|
|
18855
|
+
"kind": "token",
|
|
18856
|
+
"type": "InjectionToken<MkNotificationSoundConfig>"
|
|
18857
|
+
},
|
|
18858
|
+
{
|
|
18859
|
+
"name": "MK_SESSION_EXPIRY_CONFIG",
|
|
18860
|
+
"description": "",
|
|
18861
|
+
"file": "projects/mk-kit/attention/session-expiry.ts",
|
|
18862
|
+
"kind": "token",
|
|
18863
|
+
"type": "InjectionToken<MkSessionExpiryConfig>"
|
|
18864
|
+
},
|
|
18865
|
+
{
|
|
18866
|
+
"name": "MK_TAB_ATTENTION_CONFIG",
|
|
18867
|
+
"description": "",
|
|
18868
|
+
"file": "projects/mk-kit/attention/tab-attention.ts",
|
|
18869
|
+
"kind": "token",
|
|
18870
|
+
"type": "InjectionToken<MkTabAttentionConfig>"
|
|
18871
|
+
},
|
|
18872
|
+
{
|
|
18873
|
+
"name": "MK_CHIME_PRESET",
|
|
18874
|
+
"description": "The always-available synthesised sound.",
|
|
18875
|
+
"file": "projects/mk-kit/attention/notification-sound.ts",
|
|
18876
|
+
"kind": "const",
|
|
18877
|
+
"type": "MkSoundPreset"
|
|
18878
|
+
},
|
|
18879
|
+
{
|
|
18880
|
+
"name": "MkNotificationSoundConfig",
|
|
18881
|
+
"description": "Options for `MkNotificationSound`.",
|
|
18882
|
+
"file": "projects/mk-kit/attention/notification-sound.ts",
|
|
18883
|
+
"kind": "interface",
|
|
18884
|
+
"members": [
|
|
18885
|
+
{
|
|
18886
|
+
"name": "presets",
|
|
18887
|
+
"type": "MkSoundPreset[] | undefined",
|
|
18888
|
+
"description": "Selectable sounds; the ids `custom` and `none` are reserved. Default: the chime only.",
|
|
18889
|
+
"optional": true
|
|
18890
|
+
},
|
|
18891
|
+
{
|
|
18892
|
+
"name": "storageKey",
|
|
18893
|
+
"type": "(() => string) | undefined",
|
|
18894
|
+
"description": "localStorage key for the on/off preference — a function so it can vary per tenant / user.",
|
|
18895
|
+
"optional": true
|
|
18896
|
+
},
|
|
18897
|
+
{
|
|
18898
|
+
"name": "volume",
|
|
18899
|
+
"type": "number | undefined",
|
|
18900
|
+
"description": "Output gain for file presets (0–1). Default `0.8`.",
|
|
18901
|
+
"optional": true
|
|
18902
|
+
}
|
|
18903
|
+
]
|
|
18904
|
+
},
|
|
18905
|
+
{
|
|
18906
|
+
"name": "MkSessionExpiryConfig",
|
|
18907
|
+
"description": "Options for `provideMkSessionExpiry`.",
|
|
18908
|
+
"file": "projects/mk-kit/attention/session-expiry.ts",
|
|
18909
|
+
"kind": "interface",
|
|
18910
|
+
"members": [
|
|
18911
|
+
{
|
|
18912
|
+
"name": "expiresAt",
|
|
18913
|
+
"type": "() => number | null",
|
|
18914
|
+
"description": "Epoch ms when the session lapses, or `null` when there is none. Read reactively."
|
|
18915
|
+
},
|
|
18916
|
+
{
|
|
18917
|
+
"name": "warnBeforeMs",
|
|
18918
|
+
"type": "number | undefined",
|
|
18919
|
+
"description": "How long before the lapse the dialog appears. Default 2 minutes.",
|
|
18920
|
+
"optional": true
|
|
18921
|
+
},
|
|
18922
|
+
{
|
|
18923
|
+
"name": "extend",
|
|
18924
|
+
"type": "() => Promise<unknown>",
|
|
18925
|
+
"description": "Extend the session (refresh the token). Resolve = extended, reject = nothing to extend."
|
|
18926
|
+
},
|
|
18927
|
+
{
|
|
18928
|
+
"name": "onExpire",
|
|
18929
|
+
"type": "() => void",
|
|
18930
|
+
"description": "End the session (sign out, navigate)."
|
|
18931
|
+
},
|
|
18932
|
+
{
|
|
18933
|
+
"name": "enabled",
|
|
18934
|
+
"type": "(() => boolean) | undefined",
|
|
18935
|
+
"description": "Read reactively; `false` suspends the watcher (a kiosk / PIN mode, say).",
|
|
18936
|
+
"optional": true
|
|
18937
|
+
}
|
|
18938
|
+
]
|
|
18939
|
+
},
|
|
18940
|
+
{
|
|
18941
|
+
"name": "MkSessionExpiryDialogData",
|
|
18942
|
+
"description": "Data handed to `MkSessionExpiryDialog`.",
|
|
18943
|
+
"file": "projects/mk-kit/attention/session-expiry.ts",
|
|
18944
|
+
"kind": "interface",
|
|
18945
|
+
"members": [
|
|
18946
|
+
{
|
|
18947
|
+
"name": "expiresAt",
|
|
18948
|
+
"type": "number",
|
|
18949
|
+
"description": ""
|
|
18950
|
+
},
|
|
18951
|
+
{
|
|
18952
|
+
"name": "extend",
|
|
18953
|
+
"type": "() => Promise<unknown>",
|
|
18954
|
+
"description": ""
|
|
18955
|
+
},
|
|
18956
|
+
{
|
|
18957
|
+
"name": "onExpire",
|
|
18958
|
+
"type": "() => void",
|
|
18959
|
+
"description": ""
|
|
18960
|
+
}
|
|
18961
|
+
]
|
|
18962
|
+
},
|
|
18963
|
+
{
|
|
18964
|
+
"name": "MkSoundPreset",
|
|
18965
|
+
"description": "One selectable alert sound. `url: null` = the synthesised chime.",
|
|
18966
|
+
"file": "projects/mk-kit/attention/notification-sound.ts",
|
|
18967
|
+
"kind": "interface",
|
|
18968
|
+
"members": [
|
|
18969
|
+
{
|
|
18970
|
+
"name": "id",
|
|
18971
|
+
"type": "string",
|
|
18972
|
+
"description": ""
|
|
18973
|
+
},
|
|
18974
|
+
{
|
|
18975
|
+
"name": "label",
|
|
18976
|
+
"type": "string",
|
|
18977
|
+
"description": ""
|
|
18978
|
+
},
|
|
18979
|
+
{
|
|
18980
|
+
"name": "url",
|
|
18981
|
+
"type": "string | null",
|
|
18982
|
+
"description": ""
|
|
18983
|
+
}
|
|
18984
|
+
]
|
|
18985
|
+
},
|
|
18986
|
+
{
|
|
18987
|
+
"name": "MkTabAttentionConfig",
|
|
18988
|
+
"description": "Options for `MkTabAttention`, set with `provideMkTabAttention`.",
|
|
18989
|
+
"file": "projects/mk-kit/attention/tab-attention.ts",
|
|
18990
|
+
"kind": "interface",
|
|
18991
|
+
"members": [
|
|
18992
|
+
{
|
|
18993
|
+
"name": "badgeColor",
|
|
18994
|
+
"type": "string | undefined",
|
|
18995
|
+
"description": "Badge fill colour (any CSS colour). Default `#e53935`.",
|
|
18996
|
+
"optional": true
|
|
18997
|
+
},
|
|
18998
|
+
{
|
|
18999
|
+
"name": "blinkMs",
|
|
19000
|
+
"type": "number | undefined",
|
|
19001
|
+
"description": "Title blink period in ms while the tab is hidden. Default `1200`.",
|
|
19002
|
+
"optional": true
|
|
19003
|
+
}
|
|
19004
|
+
]
|
|
19005
|
+
}
|
|
19006
|
+
]
|
|
19007
|
+
},
|
|
18565
19008
|
{
|
|
18566
19009
|
"name": "feedback",
|
|
18567
19010
|
"import": "@mk-kit/ui/feedback",
|
|
@@ -23852,6 +24295,120 @@
|
|
|
23852
24295
|
}
|
|
23853
24296
|
]
|
|
23854
24297
|
},
|
|
24298
|
+
{
|
|
24299
|
+
"name": "media/scanner",
|
|
24300
|
+
"import": "@mk-kit/ui/media/scanner",
|
|
24301
|
+
"exports": [
|
|
24302
|
+
{
|
|
24303
|
+
"name": "MkBarcodeScanner",
|
|
24304
|
+
"description": "Camera barcode / QR reader. Starts the rear camera when it appears, emits\n`scanned` once with the first decoded text and stops. The decoder\n(`html5-qrcode`, an optional peer dependency) is loaded on demand, so pages\nthat only *offer* scanning ship nothing extra until a scan starts. Use\ninline, or through `MkBarcodeScannerDialog`.\n\n```html\n<mk-barcode-scanner (scanned)=\"onCode($event)\" (failed)=\"show($event)\" />\n```",
|
|
24305
|
+
"file": "projects/mk-kit/media/scanner/barcode-scanner.ts",
|
|
24306
|
+
"kind": "component",
|
|
24307
|
+
"selector": "mk-barcode-scanner",
|
|
24308
|
+
"selectors": [
|
|
24309
|
+
"mk-barcode-scanner"
|
|
24310
|
+
],
|
|
24311
|
+
"inputs": [
|
|
24312
|
+
{
|
|
24313
|
+
"name": "formats",
|
|
24314
|
+
"type": "MkBarcodeFormat[]",
|
|
24315
|
+
"description": "Symbologies to decode. Default: QR + the retail 1-D codes.",
|
|
24316
|
+
"default": "MK_BARCODE_DEFAULT_FORMATS"
|
|
24317
|
+
},
|
|
24318
|
+
{
|
|
24319
|
+
"name": "fps",
|
|
24320
|
+
"type": "number",
|
|
24321
|
+
"description": "Frames per second offered to the decoder. Default 10.",
|
|
24322
|
+
"default": "10"
|
|
24323
|
+
},
|
|
24324
|
+
{
|
|
24325
|
+
"name": "hint",
|
|
24326
|
+
"type": "boolean",
|
|
24327
|
+
"description": "Show the built-in hint line above the viewfinder. Default `true`.",
|
|
24328
|
+
"default": "true"
|
|
24329
|
+
},
|
|
24330
|
+
{
|
|
24331
|
+
"name": "continuous",
|
|
24332
|
+
"type": "boolean",
|
|
24333
|
+
"description": "Keep scanning after a hit instead of stopping. Default `false`.",
|
|
24334
|
+
"default": "false"
|
|
24335
|
+
}
|
|
24336
|
+
],
|
|
24337
|
+
"outputs": [
|
|
24338
|
+
{
|
|
24339
|
+
"name": "scanned",
|
|
24340
|
+
"type": "string",
|
|
24341
|
+
"description": "Decoded text."
|
|
24342
|
+
},
|
|
24343
|
+
{
|
|
24344
|
+
"name": "failed",
|
|
24345
|
+
"type": "string",
|
|
24346
|
+
"description": "The camera could not start (permission, no device, insecure context)."
|
|
24347
|
+
}
|
|
24348
|
+
],
|
|
24349
|
+
"methods": [
|
|
24350
|
+
{
|
|
24351
|
+
"name": "stop",
|
|
24352
|
+
"signature": "(): Promise<void>",
|
|
24353
|
+
"description": "Stop the camera and release it. Safe to call twice."
|
|
24354
|
+
}
|
|
24355
|
+
],
|
|
24356
|
+
"properties": [],
|
|
24357
|
+
"queries": [],
|
|
24358
|
+
"docs": "/components/images"
|
|
24359
|
+
},
|
|
24360
|
+
{
|
|
24361
|
+
"name": "MkBarcodeScannerDialog",
|
|
24362
|
+
"description": "The scanner in a dialog: resolves with the decoded text, or `null` when\ncancelled. Open it with `MkDialogService`:\n\n```ts\nconst code = await dialog.open<MkBarcodeScannerDialog, string | null>(MkBarcodeScannerDialog, { size: 'sm' }).afterClosed;\nif (code) this.search.setValue(code);\n```",
|
|
24363
|
+
"file": "projects/mk-kit/media/scanner/barcode-scanner-dialog.ts",
|
|
24364
|
+
"kind": "component",
|
|
24365
|
+
"selector": "mk-barcode-scanner-dialog",
|
|
24366
|
+
"selectors": [
|
|
24367
|
+
"mk-barcode-scanner-dialog"
|
|
24368
|
+
],
|
|
24369
|
+
"inputs": [],
|
|
24370
|
+
"outputs": [],
|
|
24371
|
+
"methods": [],
|
|
24372
|
+
"properties": [],
|
|
24373
|
+
"queries": [],
|
|
24374
|
+
"docs": "/components/images"
|
|
24375
|
+
},
|
|
24376
|
+
{
|
|
24377
|
+
"name": "MK_BARCODE_DEFAULT_FORMATS",
|
|
24378
|
+
"description": "",
|
|
24379
|
+
"file": "projects/mk-kit/media/scanner/barcode-scanner.ts",
|
|
24380
|
+
"kind": "const",
|
|
24381
|
+
"type": "MkBarcodeFormat[]"
|
|
24382
|
+
},
|
|
24383
|
+
{
|
|
24384
|
+
"name": "MkBarcodeScannerDialogData",
|
|
24385
|
+
"description": "Optional data for `MkBarcodeScannerDialog`.",
|
|
24386
|
+
"file": "projects/mk-kit/media/scanner/barcode-scanner-dialog.ts",
|
|
24387
|
+
"kind": "interface",
|
|
24388
|
+
"members": [
|
|
24389
|
+
{
|
|
24390
|
+
"name": "title",
|
|
24391
|
+
"type": "string | undefined",
|
|
24392
|
+
"description": "",
|
|
24393
|
+
"optional": true
|
|
24394
|
+
},
|
|
24395
|
+
{
|
|
24396
|
+
"name": "formats",
|
|
24397
|
+
"type": "MkBarcodeFormat[] | undefined",
|
|
24398
|
+
"description": "",
|
|
24399
|
+
"optional": true
|
|
24400
|
+
}
|
|
24401
|
+
]
|
|
24402
|
+
},
|
|
24403
|
+
{
|
|
24404
|
+
"name": "MkBarcodeFormat",
|
|
24405
|
+
"description": "Symbologies the scanner reads; names follow `Html5QrcodeSupportedFormats`.",
|
|
24406
|
+
"file": "projects/mk-kit/media/scanner/barcode-scanner.ts",
|
|
24407
|
+
"kind": "type",
|
|
24408
|
+
"definition": "| 'QR_CODE' | 'EAN_13' | 'EAN_8' | 'CODE_128' | 'CODE_39' | 'UPC_A' | 'UPC_E' | 'DATA_MATRIX' | 'ITF' | 'CODABAR'"
|
|
24409
|
+
}
|
|
24410
|
+
]
|
|
24411
|
+
},
|
|
23855
24412
|
{
|
|
23856
24413
|
"name": "testing",
|
|
23857
24414
|
"import": "@mk-kit/ui/testing",
|
package/data/llms-full.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @mk-kit/ui 0.
|
|
1
|
+
# @mk-kit/ui 0.58.0 — full API reference
|
|
2
2
|
|
|
3
3
|
Generated from the library sources. Browsable version: https://mk-kit.dev/api · JSON: https://mk-kit.dev/api.json · Guides: https://mk-kit.dev/llms.txt
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ Every component and directive below is standalone — import the class from its
|
|
|
12
12
|
|
|
13
13
|
## @mk-kit/ui/core
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
87 exports. `import { … } from '@mk-kit/ui/core';`
|
|
16
16
|
|
|
17
17
|
### MkAnchoredPanel (directive)
|
|
18
18
|
|
|
@@ -66,6 +66,42 @@ Methods:
|
|
|
66
66
|
| --- | --- |
|
|
67
67
|
| `position(track?: boolean): void` | Recompute and apply the panel position. Safe to call at any time. With `track` (scroll-driven), the panel follows the anchor unclamped and dismisses once the anchor leaves the viewport (matching the CDK's reposition-with-auto-close scroll behaviour). |
|
|
68
68
|
|
|
69
|
+
### MkAccentService (service)
|
|
70
|
+
|
|
71
|
+
Import: `import { MkAccentService } from '@mk-kit/ui/core';`
|
|
72
|
+
|
|
73
|
+
Runtime accent — the user picks one of `MK_ACCENTS` and every kit
|
|
74
|
+
control recolours: the service writes the `--mk-primary` family
|
|
75
|
+
(`primary`, `-hover`, `-active`, `-subtle`, `-subtle-hover`,
|
|
76
|
+
`-subtle-text`), `--mk-focus-ring`, `--mk-selected-bg` / `-text` and three
|
|
77
|
+
accent tokens of its own — `--mk-accent`, `--mk-accent-ink`,
|
|
78
|
+
`--mk-accent-glow` — onto `<html>`, and mirrors the key as
|
|
79
|
+
`data-mk-accent`. Hover / active are a touch darker in light and a touch
|
|
80
|
+
lighter in dark (it follows `MkThemeService`). The choice persists
|
|
81
|
+
in `localStorage` (`mk-kit-accent`); nothing is written until `set()` is
|
|
82
|
+
called, so an app that never picks keeps the preset's own primary.
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
readonly accent = inject(MkAccentService);
|
|
86
|
+
accent.set('coral'); // every button, ring and chip turns coral
|
|
87
|
+
accent.key(); // 'coral'
|
|
88
|
+
mkAccentSwatch(accent.key()); // for the picker
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Methods:
|
|
92
|
+
|
|
93
|
+
| Signature | Description |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| `set(key: MkAccentKey): void` | Pick an accent; persisted. |
|
|
96
|
+
| `reset(): void` | Back to the preset's own primary; the stored choice is cleared. |
|
|
97
|
+
|
|
98
|
+
Properties:
|
|
99
|
+
|
|
100
|
+
| Name | Type | Description |
|
|
101
|
+
| --- | --- | --- |
|
|
102
|
+
| `key` | `Signal<MkAccentKey \| null>` | The chosen accent, or `null` while the preset's own primary is in use. |
|
|
103
|
+
| `accent` | `Signal<MkAccent>` | The chosen accent's definition (indigo when none is chosen). |
|
|
104
|
+
|
|
69
105
|
### MkBreakpointService (service)
|
|
70
106
|
|
|
71
107
|
Docs: https://mk-kit.dev/core-services
|
|
@@ -250,6 +286,16 @@ Properties:
|
|
|
250
286
|
| `afterClosed` | `Promise<TResult \| undefined>` | Resolves with the close result when the overlay is dismissed. |
|
|
251
287
|
| `closed$` | `Observable<TResult \| undefined>` | Emits the close result once, then completes. Subscribing after the overlay has already closed replays the result immediately, so a late subscriber never hangs. |
|
|
252
288
|
|
|
289
|
+
### mkAccentSwatch (function)
|
|
290
|
+
|
|
291
|
+
Import: `import { mkAccentSwatch } from '@mk-kit/ui/core';`
|
|
292
|
+
|
|
293
|
+
The swatch a picker shows for an accent (bumblebee is the black / yellow split).
|
|
294
|
+
|
|
295
|
+
```ts
|
|
296
|
+
function mkAccentSwatch(key: MkAccentKey): string
|
|
297
|
+
```
|
|
298
|
+
|
|
253
299
|
### mkBodyLevelAncestor (function)
|
|
254
300
|
|
|
255
301
|
Import: `import { mkBodyLevelAncestor } from '@mk-kit/ui/core';`
|
|
@@ -324,6 +370,16 @@ Returns the tabbable elements inside `root`, in DOM order.
|
|
|
324
370
|
function mkGetFocusable(root: HTMLElement): HTMLElement[]
|
|
325
371
|
```
|
|
326
372
|
|
|
373
|
+
### mkHexAlpha (function)
|
|
374
|
+
|
|
375
|
+
Import: `import { mkHexAlpha } from '@mk-kit/ui/core';`
|
|
376
|
+
|
|
377
|
+
`#rrggbb` → `rgba(r,g,b,a)`.
|
|
378
|
+
|
|
379
|
+
```ts
|
|
380
|
+
function mkHexAlpha(hex: string, alpha: number): string
|
|
381
|
+
```
|
|
382
|
+
|
|
327
383
|
### mkHighlight (function)
|
|
328
384
|
|
|
329
385
|
Import: `import { mkHighlight } from '@mk-kit/ui/core';`
|
|
@@ -618,6 +674,26 @@ elements stay isolated from the host page's stylesheet:
|
|
|
618
674
|
const MK_OVERLAY_ROOT: InjectionToken<MkOverlayRootFn>;
|
|
619
675
|
```
|
|
620
676
|
|
|
677
|
+
### MK_ACCENT_ORDER (const)
|
|
678
|
+
|
|
679
|
+
Import: `import { MK_ACCENT_ORDER } from '@mk-kit/ui/core';`
|
|
680
|
+
|
|
681
|
+
Picker order.
|
|
682
|
+
|
|
683
|
+
```ts
|
|
684
|
+
const MK_ACCENT_ORDER: readonly MkAccentKey[];
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
### MK_ACCENTS (const)
|
|
688
|
+
|
|
689
|
+
Import: `import { MK_ACCENTS } from '@mk-kit/ui/core';`
|
|
690
|
+
|
|
691
|
+
High-saturation, distinct, energising accents — the set the `momentum` preset was designed around.
|
|
692
|
+
|
|
693
|
+
```ts
|
|
694
|
+
const MK_ACCENTS: Record<MkAccentKey, MkAccent>;
|
|
695
|
+
```
|
|
696
|
+
|
|
621
697
|
### MK_DEFAULT_BREAKPOINTS (const)
|
|
622
698
|
|
|
623
699
|
Import: `import { MK_DEFAULT_BREAKPOINTS } from '@mk-kit/ui/core';`
|
|
@@ -688,6 +764,20 @@ Operators that take no value.
|
|
|
688
764
|
const MK_QUERY_UNARY: ReadonlySet<MkQueryOperator>;
|
|
689
765
|
```
|
|
690
766
|
|
|
767
|
+
### MkAccent (interface)
|
|
768
|
+
|
|
769
|
+
Import: `import { MkAccent } from '@mk-kit/ui/core';`
|
|
770
|
+
|
|
771
|
+
`fill` = bars, rings and buttons · `ink` = small accent text on a light ground.
|
|
772
|
+
|
|
773
|
+
Members:
|
|
774
|
+
|
|
775
|
+
| Name | Type | Description |
|
|
776
|
+
| --- | --- | --- |
|
|
777
|
+
| `fill` | `string` | |
|
|
778
|
+
| `ink` | `string` | |
|
|
779
|
+
| `name` | `string` | |
|
|
780
|
+
|
|
691
781
|
### MkAnchoredPosition (interface)
|
|
692
782
|
|
|
693
783
|
Import: `import { MkAnchoredPosition } from '@mk-kit/ui/core';`
|
|
@@ -911,6 +1001,14 @@ Members:
|
|
|
911
1001
|
| `translationEditorReset` | `string` | |
|
|
912
1002
|
| `translationEditorExport` | `string` | |
|
|
913
1003
|
| `translationEditorKeys` | `string` | |
|
|
1004
|
+
| `sessionExpiryTitle` | `string` | Session-expiry dialog (`@mk-kit/ui/attention`). |
|
|
1005
|
+
| `sessionExpiryExtend` | `string` | |
|
|
1006
|
+
| `sessionExpiryExtending` | `string` | |
|
|
1007
|
+
| `sessionExpiryLogout` | `string` | |
|
|
1008
|
+
| `sessionExpiryBody` | `(countdown: string) => string` | |
|
|
1009
|
+
| `scannerTitle` | `string` | Barcode scanner (`@mk-kit/ui/media/scanner`). |
|
|
1010
|
+
| `scannerHint` | `string` | |
|
|
1011
|
+
| `scannerCameraError` | `string` | |
|
|
914
1012
|
| `resultsCount` | `(count: number) => string` | Announced when a filterable list updates (autocomplete, multi-select, command palette). |
|
|
915
1013
|
| `previousPage` | `string` | Pagination: previous page control. |
|
|
916
1014
|
| `nextPage` | `string` | Pagination: next page control. |
|
|
@@ -1348,6 +1446,16 @@ Members:
|
|
|
1348
1446
|
| `register` | `(fn: () => void): void` | Store the callback Angular hands to `registerOnValidatorChange`. |
|
|
1349
1447
|
| `notify` | `(): void` | Ask the bound control to re-run `validate()` now. |
|
|
1350
1448
|
|
|
1449
|
+
### MkAccentKey (type)
|
|
1450
|
+
|
|
1451
|
+
Import: `import { MkAccentKey } from '@mk-kit/ui/core';`
|
|
1452
|
+
|
|
1453
|
+
One of the eight kit accents (the Momentum palette).
|
|
1454
|
+
|
|
1455
|
+
```ts
|
|
1456
|
+
type MkAccentKey = 'indigo' | 'blue' | 'teal' | 'violet' | 'coral' | 'lime' | 'pink' | 'bumblebee';
|
|
1457
|
+
```
|
|
1458
|
+
|
|
1351
1459
|
### MkAriaLivePoliteness (type)
|
|
1352
1460
|
|
|
1353
1461
|
Import: `import { MkAriaLivePoliteness } from '@mk-kit/ui/core';`
|
|
@@ -12327,6 +12435,261 @@ Values interpolated into `{{name}}` placeholders.
|
|
|
12327
12435
|
type MkTranslateParams = Record<string, unknown>;
|
|
12328
12436
|
```
|
|
12329
12437
|
|
|
12438
|
+
## @mk-kit/ui/attention
|
|
12439
|
+
|
|
12440
|
+
16 exports. `import { … } from '@mk-kit/ui/attention';`
|
|
12441
|
+
|
|
12442
|
+
### MkSessionExpiryDialog (component)
|
|
12443
|
+
|
|
12444
|
+
Selector: `mk-session-expiry-dialog`
|
|
12445
|
+
|
|
12446
|
+
Docs: https://mk-kit.dev/components/attention
|
|
12447
|
+
|
|
12448
|
+
Import: `import { MkSessionExpiryDialog } from '@mk-kit/ui/attention';`
|
|
12449
|
+
|
|
12450
|
+
Last call before a session ends: counts down and offers to extend.
|
|
12451
|
+
Reaching zero ends the session, so doing nothing still produces a definite,
|
|
12452
|
+
visible outcome. Opened by `MkSessionExpiry`; usable on its own.
|
|
12453
|
+
|
|
12454
|
+
### MkNotificationSound (service)
|
|
12455
|
+
|
|
12456
|
+
Docs: https://mk-kit.dev/components/attention
|
|
12457
|
+
|
|
12458
|
+
Import: `import { MkNotificationSound } from '@mk-kit/ui/attention';`
|
|
12459
|
+
|
|
12460
|
+
Alert sounds for incoming work (orders, messages, tickets) with the
|
|
12461
|
+
browser's autoplay rules handled: an `AudioContext` stays suspended until a
|
|
12462
|
+
user gesture, so a sound fired by a WebSocket message would be silent. The
|
|
12463
|
+
context is unlocked when the user enables sound (a click) and lazily on the
|
|
12464
|
+
first interaction anywhere in the app. The default sound is synthesised
|
|
12465
|
+
(a short C–E–G chime) — nothing to ship, no CORS, lowest latency; file
|
|
12466
|
+
presets are fetched and decoded once and fall back to the chime when they
|
|
12467
|
+
fail. The on/off preference lives in localStorage under a configurable key.
|
|
12468
|
+
|
|
12469
|
+
```ts
|
|
12470
|
+
provideMkNotificationSound({ presets: [MK_CHIME_PRESET, { id: 'ding', label: 'Ding', url: '/assets/ding.wav' }] })
|
|
12471
|
+
sound.primeOnFirstInteraction(); // at app start
|
|
12472
|
+
sound.play(settings.newOrderSound); // on an event, honours the device mute
|
|
12473
|
+
sound.preview('ding'); // settings page test button
|
|
12474
|
+
```
|
|
12475
|
+
|
|
12476
|
+
Methods:
|
|
12477
|
+
|
|
12478
|
+
| Signature | Description |
|
|
12479
|
+
| --- | --- |
|
|
12480
|
+
| `isEnabled(): boolean` | Whether the device has sound on. |
|
|
12481
|
+
| `hasBeenAsked(): boolean` | Whether the user ever answered the "enable sound?" question on this device. |
|
|
12482
|
+
| `setEnabled(enabled: boolean): void` | Persist the preference; call from a click so audio unlocks at once. |
|
|
12483
|
+
| `primeOnFirstInteraction(): void` | Arm a one-time listener so the first pointer/key interaction unlocks audio. |
|
|
12484
|
+
| `chime(): void` | The default chime, if the device has sound on. |
|
|
12485
|
+
| `play(soundId: string, customUrl?: string \| null): void` | Play the sound configured for an event: a preset id, `custom` (with `customUrl`) or `none` (silent). Unknown ids and failed loads fall back to the chime. Honours the device mute. |
|
|
12486
|
+
| `preview(soundId: string, customUrl?: string \| null): void` | Same as `play()` but ignores the device mute — for settings test buttons. |
|
|
12487
|
+
|
|
12488
|
+
Properties:
|
|
12489
|
+
|
|
12490
|
+
| Name | Type | Description |
|
|
12491
|
+
| --- | --- | --- |
|
|
12492
|
+
| `presets` | `MkSoundPreset[]` | The selectable presets (always includes the chime). |
|
|
12493
|
+
|
|
12494
|
+
### MkSessionExpiry (service)
|
|
12495
|
+
|
|
12496
|
+
Docs: https://mk-kit.dev/components/attention
|
|
12497
|
+
|
|
12498
|
+
Import: `import { MkSessionExpiry } from '@mk-kit/ui/attention';`
|
|
12499
|
+
|
|
12500
|
+
Watches `expiresAt()` and warns BEFORE the session lapses, so a session
|
|
12501
|
+
never ends silently: the dialog offers to extend, or signs out at zero.
|
|
12502
|
+
Re-arms itself whenever `expiresAt()` changes (every token rotation),
|
|
12503
|
+
runs the timer outside the Angular zone and only in the browser. Started
|
|
12504
|
+
automatically by `provideMkSessionExpiry`.
|
|
12505
|
+
|
|
12506
|
+
Methods:
|
|
12507
|
+
|
|
12508
|
+
| Signature | Description |
|
|
12509
|
+
| --- | --- |
|
|
12510
|
+
| `start(): void` | Begin watching. Idempotent; called by the provider's initializer. |
|
|
12511
|
+
|
|
12512
|
+
Properties:
|
|
12513
|
+
|
|
12514
|
+
| Name | Type | Description |
|
|
12515
|
+
| --- | --- | --- |
|
|
12516
|
+
| `open` | `WritableSignal<boolean>` | Whether the dialog is currently open. |
|
|
12517
|
+
|
|
12518
|
+
### MkTabAttention (service)
|
|
12519
|
+
|
|
12520
|
+
Docs: https://mk-kit.dev/components/attention
|
|
12521
|
+
|
|
12522
|
+
Import: `import { MkTabAttention } from '@mk-kit/ui/attention';`
|
|
12523
|
+
|
|
12524
|
+
Messenger-style tab attention: while unhandled work exists the favicon
|
|
12525
|
+
carries a red counter badge, and — only while the tab is hidden — the
|
|
12526
|
+
title alternates with "(N) label" so a pinned tab flashes in the tab strip.
|
|
12527
|
+
Focusing the tab stops the blinking (someone is looking) but keeps the
|
|
12528
|
+
badge until the count reaches zero. SSR-safe: every entry point bails
|
|
12529
|
+
without a `document`; the blink timer runs outside the Angular zone.
|
|
12530
|
+
|
|
12531
|
+
```ts
|
|
12532
|
+
private attention = inject(MkTabAttention);
|
|
12533
|
+
effect(() => this.attention.set(this.pending().length, 'new orders'));
|
|
12534
|
+
```
|
|
12535
|
+
|
|
12536
|
+
Methods:
|
|
12537
|
+
|
|
12538
|
+
| Signature | Description |
|
|
12539
|
+
| --- | --- |
|
|
12540
|
+
| `set(count: number, label?: string): void` | Update the pending count and the label used in the blinking title. |
|
|
12541
|
+
| `clear(): void` | Drop the badge and the blinking entirely and stop listening. |
|
|
12542
|
+
|
|
12543
|
+
Properties:
|
|
12544
|
+
|
|
12545
|
+
| Name | Type | Description |
|
|
12546
|
+
| --- | --- | --- |
|
|
12547
|
+
| `count` | `WritableSignal<number>` | The count currently shown (0 = nothing pending). |
|
|
12548
|
+
|
|
12549
|
+
### provideMkNotificationSound (function)
|
|
12550
|
+
|
|
12551
|
+
Import: `import { provideMkNotificationSound } from '@mk-kit/ui/attention';`
|
|
12552
|
+
|
|
12553
|
+
Register presets / storage key for `MkNotificationSound`. Optional.
|
|
12554
|
+
|
|
12555
|
+
```ts
|
|
12556
|
+
function provideMkNotificationSound(config: MkNotificationSoundConfig): { provide: InjectionToken<MkNotificationSoundConfig>; useValue: MkNotificationSoundConfig; }
|
|
12557
|
+
```
|
|
12558
|
+
|
|
12559
|
+
### provideMkSessionExpiry (function)
|
|
12560
|
+
|
|
12561
|
+
Import: `import { provideMkSessionExpiry } from '@mk-kit/ui/attention';`
|
|
12562
|
+
|
|
12563
|
+
Register the session-expiry watcher; it starts with the application.
|
|
12564
|
+
|
|
12565
|
+
```ts
|
|
12566
|
+
provideMkSessionExpiry({
|
|
12567
|
+
expiresAt: () => auth.tokenExpiresAt(),
|
|
12568
|
+
extend: () => firstValueFrom(auth.refresh()),
|
|
12569
|
+
onExpire: () => auth.logout(),
|
|
12570
|
+
warnBeforeMs: 2 * 60_000,
|
|
12571
|
+
})
|
|
12572
|
+
```
|
|
12573
|
+
|
|
12574
|
+
```ts
|
|
12575
|
+
function provideMkSessionExpiry(config: MkSessionExpiryConfig): EnvironmentProviders
|
|
12576
|
+
```
|
|
12577
|
+
|
|
12578
|
+
### provideMkTabAttention (function)
|
|
12579
|
+
|
|
12580
|
+
Import: `import { provideMkTabAttention } from '@mk-kit/ui/attention';`
|
|
12581
|
+
|
|
12582
|
+
Register options for `MkTabAttention`. Optional — the defaults work.
|
|
12583
|
+
|
|
12584
|
+
```ts
|
|
12585
|
+
function provideMkTabAttention(config: MkTabAttentionConfig): { provide: InjectionToken<MkTabAttentionConfig>; useValue: MkTabAttentionConfig; }
|
|
12586
|
+
```
|
|
12587
|
+
|
|
12588
|
+
### MK_NOTIFICATION_SOUND_CONFIG (token)
|
|
12589
|
+
|
|
12590
|
+
Import: `import { MK_NOTIFICATION_SOUND_CONFIG } from '@mk-kit/ui/attention';`
|
|
12591
|
+
|
|
12592
|
+
```ts
|
|
12593
|
+
const MK_NOTIFICATION_SOUND_CONFIG: InjectionToken<MkNotificationSoundConfig>;
|
|
12594
|
+
```
|
|
12595
|
+
|
|
12596
|
+
### MK_SESSION_EXPIRY_CONFIG (token)
|
|
12597
|
+
|
|
12598
|
+
Import: `import { MK_SESSION_EXPIRY_CONFIG } from '@mk-kit/ui/attention';`
|
|
12599
|
+
|
|
12600
|
+
```ts
|
|
12601
|
+
const MK_SESSION_EXPIRY_CONFIG: InjectionToken<MkSessionExpiryConfig>;
|
|
12602
|
+
```
|
|
12603
|
+
|
|
12604
|
+
### MK_TAB_ATTENTION_CONFIG (token)
|
|
12605
|
+
|
|
12606
|
+
Import: `import { MK_TAB_ATTENTION_CONFIG } from '@mk-kit/ui/attention';`
|
|
12607
|
+
|
|
12608
|
+
```ts
|
|
12609
|
+
const MK_TAB_ATTENTION_CONFIG: InjectionToken<MkTabAttentionConfig>;
|
|
12610
|
+
```
|
|
12611
|
+
|
|
12612
|
+
### MK_CHIME_PRESET (const)
|
|
12613
|
+
|
|
12614
|
+
Import: `import { MK_CHIME_PRESET } from '@mk-kit/ui/attention';`
|
|
12615
|
+
|
|
12616
|
+
The always-available synthesised sound.
|
|
12617
|
+
|
|
12618
|
+
```ts
|
|
12619
|
+
const MK_CHIME_PRESET: MkSoundPreset;
|
|
12620
|
+
```
|
|
12621
|
+
|
|
12622
|
+
### MkNotificationSoundConfig (interface)
|
|
12623
|
+
|
|
12624
|
+
Import: `import { MkNotificationSoundConfig } from '@mk-kit/ui/attention';`
|
|
12625
|
+
|
|
12626
|
+
Options for `MkNotificationSound`.
|
|
12627
|
+
|
|
12628
|
+
Members:
|
|
12629
|
+
|
|
12630
|
+
| Name | Type | Description |
|
|
12631
|
+
| --- | --- | --- |
|
|
12632
|
+
| `presets`? | `MkSoundPreset[] \| undefined` | Selectable sounds; the ids `custom` and `none` are reserved. Default: the chime only. |
|
|
12633
|
+
| `storageKey`? | `(() => string) \| undefined` | localStorage key for the on/off preference — a function so it can vary per tenant / user. |
|
|
12634
|
+
| `volume`? | `number \| undefined` | Output gain for file presets (0–1). Default `0.8`. |
|
|
12635
|
+
|
|
12636
|
+
### MkSessionExpiryConfig (interface)
|
|
12637
|
+
|
|
12638
|
+
Import: `import { MkSessionExpiryConfig } from '@mk-kit/ui/attention';`
|
|
12639
|
+
|
|
12640
|
+
Options for `provideMkSessionExpiry`.
|
|
12641
|
+
|
|
12642
|
+
Members:
|
|
12643
|
+
|
|
12644
|
+
| Name | Type | Description |
|
|
12645
|
+
| --- | --- | --- |
|
|
12646
|
+
| `expiresAt` | `() => number \| null` | Epoch ms when the session lapses, or `null` when there is none. Read reactively. |
|
|
12647
|
+
| `warnBeforeMs`? | `number \| undefined` | How long before the lapse the dialog appears. Default 2 minutes. |
|
|
12648
|
+
| `extend` | `() => Promise<unknown>` | Extend the session (refresh the token). Resolve = extended, reject = nothing to extend. |
|
|
12649
|
+
| `onExpire` | `() => void` | End the session (sign out, navigate). |
|
|
12650
|
+
| `enabled`? | `(() => boolean) \| undefined` | Read reactively; `false` suspends the watcher (a kiosk / PIN mode, say). |
|
|
12651
|
+
|
|
12652
|
+
### MkSessionExpiryDialogData (interface)
|
|
12653
|
+
|
|
12654
|
+
Import: `import { MkSessionExpiryDialogData } from '@mk-kit/ui/attention';`
|
|
12655
|
+
|
|
12656
|
+
Data handed to `MkSessionExpiryDialog`.
|
|
12657
|
+
|
|
12658
|
+
Members:
|
|
12659
|
+
|
|
12660
|
+
| Name | Type | Description |
|
|
12661
|
+
| --- | --- | --- |
|
|
12662
|
+
| `expiresAt` | `number` | |
|
|
12663
|
+
| `extend` | `() => Promise<unknown>` | |
|
|
12664
|
+
| `onExpire` | `() => void` | |
|
|
12665
|
+
|
|
12666
|
+
### MkSoundPreset (interface)
|
|
12667
|
+
|
|
12668
|
+
Import: `import { MkSoundPreset } from '@mk-kit/ui/attention';`
|
|
12669
|
+
|
|
12670
|
+
One selectable alert sound. `url: null` = the synthesised chime.
|
|
12671
|
+
|
|
12672
|
+
Members:
|
|
12673
|
+
|
|
12674
|
+
| Name | Type | Description |
|
|
12675
|
+
| --- | --- | --- |
|
|
12676
|
+
| `id` | `string` | |
|
|
12677
|
+
| `label` | `string` | |
|
|
12678
|
+
| `url` | `string \| null` | |
|
|
12679
|
+
|
|
12680
|
+
### MkTabAttentionConfig (interface)
|
|
12681
|
+
|
|
12682
|
+
Import: `import { MkTabAttentionConfig } from '@mk-kit/ui/attention';`
|
|
12683
|
+
|
|
12684
|
+
Options for `MkTabAttention`, set with `provideMkTabAttention`.
|
|
12685
|
+
|
|
12686
|
+
Members:
|
|
12687
|
+
|
|
12688
|
+
| Name | Type | Description |
|
|
12689
|
+
| --- | --- | --- |
|
|
12690
|
+
| `badgeColor`? | `string \| undefined` | Badge fill colour (any CSS colour). Default `#e53935`. |
|
|
12691
|
+
| `blinkMs`? | `number \| undefined` | Title blink period in ms while the tab is hidden. Default `1200`. |
|
|
12692
|
+
|
|
12330
12693
|
## @mk-kit/ui/feedback
|
|
12331
12694
|
|
|
12332
12695
|
55 exports. `import { … } from '@mk-kit/ui/feedback';`
|
|
@@ -16243,6 +16606,97 @@ Ukrainian validation messages rendered by `mk-form-field`.
|
|
|
16243
16606
|
const MK_UK_VALIDATION: MkValidationStrings;
|
|
16244
16607
|
```
|
|
16245
16608
|
|
|
16609
|
+
## @mk-kit/ui/media/scanner
|
|
16610
|
+
|
|
16611
|
+
5 exports. `import { … } from '@mk-kit/ui/media/scanner';`
|
|
16612
|
+
|
|
16613
|
+
### MkBarcodeScanner (component)
|
|
16614
|
+
|
|
16615
|
+
Selector: `mk-barcode-scanner`
|
|
16616
|
+
|
|
16617
|
+
Docs: https://mk-kit.dev/components/images
|
|
16618
|
+
|
|
16619
|
+
Import: `import { MkBarcodeScanner } from '@mk-kit/ui/media/scanner';`
|
|
16620
|
+
|
|
16621
|
+
Camera barcode / QR reader. Starts the rear camera when it appears, emits
|
|
16622
|
+
`scanned` once with the first decoded text and stops. The decoder
|
|
16623
|
+
(`html5-qrcode`, an optional peer dependency) is loaded on demand, so pages
|
|
16624
|
+
that only *offer* scanning ship nothing extra until a scan starts. Use
|
|
16625
|
+
inline, or through `MkBarcodeScannerDialog`.
|
|
16626
|
+
|
|
16627
|
+
```html
|
|
16628
|
+
<mk-barcode-scanner (scanned)="onCode($event)" (failed)="show($event)" />
|
|
16629
|
+
```
|
|
16630
|
+
|
|
16631
|
+
Inputs:
|
|
16632
|
+
|
|
16633
|
+
| Name | Type | Default | Description |
|
|
16634
|
+
| --- | --- | --- | --- |
|
|
16635
|
+
| `formats` | `MkBarcodeFormat[]` | `MK_BARCODE_DEFAULT_FORMATS` | Symbologies to decode. Default: QR + the retail 1-D codes. |
|
|
16636
|
+
| `fps` | `number` | `10` | Frames per second offered to the decoder. Default 10. |
|
|
16637
|
+
| `hint` | `boolean` | `true` | Show the built-in hint line above the viewfinder. Default `true`. |
|
|
16638
|
+
| `continuous` | `boolean` | `false` | Keep scanning after a hit instead of stopping. Default `false`. |
|
|
16639
|
+
|
|
16640
|
+
Outputs:
|
|
16641
|
+
|
|
16642
|
+
| Name | Type | Description |
|
|
16643
|
+
| --- | --- | --- |
|
|
16644
|
+
| `scanned` | `string` | Decoded text. |
|
|
16645
|
+
| `failed` | `string` | The camera could not start (permission, no device, insecure context). |
|
|
16646
|
+
|
|
16647
|
+
Methods:
|
|
16648
|
+
|
|
16649
|
+
| Signature | Description |
|
|
16650
|
+
| --- | --- |
|
|
16651
|
+
| `stop(): Promise<void>` | Stop the camera and release it. Safe to call twice. |
|
|
16652
|
+
|
|
16653
|
+
### MkBarcodeScannerDialog (component)
|
|
16654
|
+
|
|
16655
|
+
Selector: `mk-barcode-scanner-dialog`
|
|
16656
|
+
|
|
16657
|
+
Docs: https://mk-kit.dev/components/images
|
|
16658
|
+
|
|
16659
|
+
Import: `import { MkBarcodeScannerDialog } from '@mk-kit/ui/media/scanner';`
|
|
16660
|
+
|
|
16661
|
+
The scanner in a dialog: resolves with the decoded text, or `null` when
|
|
16662
|
+
cancelled. Open it with `MkDialogService`:
|
|
16663
|
+
|
|
16664
|
+
```ts
|
|
16665
|
+
const code = await dialog.open<MkBarcodeScannerDialog, string | null>(MkBarcodeScannerDialog, { size: 'sm' }).afterClosed;
|
|
16666
|
+
if (code) this.search.setValue(code);
|
|
16667
|
+
```
|
|
16668
|
+
|
|
16669
|
+
### MK_BARCODE_DEFAULT_FORMATS (const)
|
|
16670
|
+
|
|
16671
|
+
Import: `import { MK_BARCODE_DEFAULT_FORMATS } from '@mk-kit/ui/media/scanner';`
|
|
16672
|
+
|
|
16673
|
+
```ts
|
|
16674
|
+
const MK_BARCODE_DEFAULT_FORMATS: MkBarcodeFormat[];
|
|
16675
|
+
```
|
|
16676
|
+
|
|
16677
|
+
### MkBarcodeScannerDialogData (interface)
|
|
16678
|
+
|
|
16679
|
+
Import: `import { MkBarcodeScannerDialogData } from '@mk-kit/ui/media/scanner';`
|
|
16680
|
+
|
|
16681
|
+
Optional data for `MkBarcodeScannerDialog`.
|
|
16682
|
+
|
|
16683
|
+
Members:
|
|
16684
|
+
|
|
16685
|
+
| Name | Type | Description |
|
|
16686
|
+
| --- | --- | --- |
|
|
16687
|
+
| `title`? | `string \| undefined` | |
|
|
16688
|
+
| `formats`? | `MkBarcodeFormat[] \| undefined` | |
|
|
16689
|
+
|
|
16690
|
+
### MkBarcodeFormat (type)
|
|
16691
|
+
|
|
16692
|
+
Import: `import { MkBarcodeFormat } from '@mk-kit/ui/media/scanner';`
|
|
16693
|
+
|
|
16694
|
+
Symbologies the scanner reads; names follow `Html5QrcodeSupportedFormats`.
|
|
16695
|
+
|
|
16696
|
+
```ts
|
|
16697
|
+
type MkBarcodeFormat = | 'QR_CODE' | 'EAN_13' | 'EAN_8' | 'CODE_128' | 'CODE_39' | 'UPC_A' | 'UPC_E' | 'DATA_MATRIX' | 'ITF' | 'CODABAR';
|
|
16698
|
+
```
|
|
16699
|
+
|
|
16246
16700
|
## @mk-kit/ui/testing
|
|
16247
16701
|
|
|
16248
16702
|
23 exports. `import { … } from '@mk-kit/ui/testing';`
|
package/data/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# mk-kit
|
|
2
2
|
|
|
3
|
-
> Themable, accessible Angular 22 component library for admin dashboards and UIs. Signals-based, WCAG 2.1 AA, controlled entirely through CSS variables with light/dark out of the box. — `@mk-kit/ui` 0.
|
|
3
|
+
> Themable, accessible Angular 22 component library for admin dashboards and UIs. Signals-based, WCAG 2.1 AA, controlled entirely through CSS variables with light/dark out of the box. — `@mk-kit/ui` 0.58.0. 177 components, 45 directives, 21 services and 157 helper functions across 37 tree-shakeable entry points. MIT licensed, zero runtime dependencies beyond Angular. Standalone components, signals, OnPush, zoneless-ready, SSR-safe, RTL and i18n via `provideMkI18n`.
|
|
4
4
|
|
|
5
5
|
Install with `ng add @mk-kit/ui` (or `npm i @mk-kit/ui` + import `@mk-kit/ui/styles/mk-kit.css`). Import from the group entry points (`@mk-kit/ui/forms`, `@mk-kit/ui/table`, …) so each lazy chunk only carries what it uses; the root `@mk-kit/ui` entry re-exports everything. Every component is standalone: add the class to a component's `imports`. Theme with `--mk-*` CSS custom properties; `MkThemeService` switches light/dark/system and density.
|
|
6
6
|
|
|
@@ -35,6 +35,7 @@ Install with `ng add @mk-kit/ui` (or `npm i @mk-kit/ui` + import `@mk-kit/ui/sty
|
|
|
35
35
|
- [Sliders & rating](https://mk-kit.dev/components/sliders)
|
|
36
36
|
- [Tooltips & popovers](https://mk-kit.dev/components/popovers)
|
|
37
37
|
- [Dialogs](https://mk-kit.dev/components/dialogs)
|
|
38
|
+
- [Attention](https://mk-kit.dev/components/attention)
|
|
38
39
|
- [Translate](https://mk-kit.dev/components/translate)
|
|
39
40
|
- [Status & notifications](https://mk-kit.dev/components/status)
|
|
40
41
|
- [Proportion & KPI charts](https://mk-kit.dev/components/proportion-charts)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mk-kit/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"description": "MCP server for @mk-kit/ui — lets AI coding assistants look up every component, directive, service and helper of the mk-kit Angular library (inputs, outputs, methods, import paths, docs links).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|