@mk-kit/mcp 0.46.0 → 0.47.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@mk-kit/ui",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "site": "https://mk-kit.dev",
5
5
  "entries": [
6
6
  {
@@ -373,6 +373,15 @@
373
373
  }
374
374
  ]
375
375
  },
376
+ {
377
+ "name": "mkBodyLevelAncestor",
378
+ "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.",
379
+ "file": "projects/mk-kit/core/overlay/overlay-root.ts",
380
+ "kind": "function",
381
+ "signatures": [
382
+ "(node: Node, body: HTMLElement): Element | null"
383
+ ]
384
+ },
376
385
  {
377
386
  "name": "mkComputeAnchoredPosition",
378
387
  "description": "Pure viewport-positioning maths shared by every anchored overlay\n(`MkAnchoredPanel` and the tooltip). Given the anchor rect, the panel\nsize and the viewport size, returns the top/left for a `position: fixed`\npanel — flipping to the opposite side when it would overflow and clamping\nback inside the viewport.",
@@ -620,6 +629,13 @@
620
629
  "kind": "token",
621
630
  "type": "InjectionToken<unknown>"
622
631
  },
632
+ {
633
+ "name": "MK_OVERLAY_ROOT",
634
+ "description": "Where mk-kit mounts everything that leaves the component tree: overlay\ncontainers (dialogs), anchored panels (selects, menus, tooltips), toast /\nsnackbar containers and the tour surfaces. Defaults to `document.body`.\n\nOverride it to confine those surfaces to another element — `@mk-kit/ui/embed`\npoints it at a themed shadow-DOM host so overlays opened by embedded custom\nelements stay isolated from the host page's stylesheet:\n\n```ts\n{ provide: MK_OVERLAY_ROOT, useValue: () => myOverlayHost }\n```",
635
+ "file": "projects/mk-kit/core/overlay/overlay-root.ts",
636
+ "kind": "token",
637
+ "type": "InjectionToken<MkOverlayRootFn>"
638
+ },
623
639
  {
624
640
  "name": "MK_DEFAULT_BREAKPOINTS",
625
641
  "description": "The default scale (same numbers as Tailwind, so mental models transfer).",
@@ -3140,6 +3156,13 @@
3140
3156
  "kind": "type",
3141
3157
  "definition": "Partial< Omit<MkI18nStrings, 'dateNames' | 'blockEditor' | 'validation'> > & { dateNames?: Partial<MkDateNames>; blockEditor?: Partial<MkBlockEditorStrings>; validation?: Partial<MkValidationStrings>; }"
3142
3158
  },
3159
+ {
3160
+ "name": "MkOverlayRootFn",
3161
+ "description": "Resolves the element overlay surfaces are appended to. A function (not an\nelement) because the root may be created lazily, after DI is set up.",
3162
+ "file": "projects/mk-kit/core/overlay/overlay-root.ts",
3163
+ "kind": "type",
3164
+ "definition": "() => HTMLElement"
3165
+ },
3143
3166
  {
3144
3167
  "name": "MkPlacement",
3145
3168
  "description": "Common placement values for overlays (menus, tooltips, popovers).",
@@ -22459,6 +22482,85 @@
22459
22482
  }
22460
22483
  ]
22461
22484
  },
22485
+ {
22486
+ "name": "embed",
22487
+ "import": "@mk-kit/ui/embed",
22488
+ "exports": [
22489
+ {
22490
+ "name": "MkEmbedApp",
22491
+ "description": "One shared embed application. Create it with `mkEmbed`.",
22492
+ "file": "projects/mk-kit/embed/embed.ts",
22493
+ "kind": "class",
22494
+ "methods": [
22495
+ {
22496
+ "name": "element",
22497
+ "signature": "(tag: string, component: Type<unknown>): this",
22498
+ "description": "Defines `tag` as a custom element rendering `component`. Chainable; a\nno-op when the tag is already defined (hot reload, duplicate script) or\noutside a browser."
22499
+ },
22500
+ {
22501
+ "name": "ready",
22502
+ "signature": "(): Promise<void>",
22503
+ "description": "Resolves when the shared application is running (created on demand)."
22504
+ },
22505
+ {
22506
+ "name": "whenStable",
22507
+ "signature": "(): Promise<void>",
22508
+ "description": "Resolves when the application has no pending change detection."
22509
+ },
22510
+ {
22511
+ "name": "destroy",
22512
+ "signature": "(): void",
22513
+ "description": "Destroys the shared application, every mounted component and the overlay\nhost. Defined tags remain registered (the platform cannot undefine them)\nbut render nothing afterwards."
22514
+ }
22515
+ ],
22516
+ "properties": []
22517
+ },
22518
+ {
22519
+ "name": "mkEmbed",
22520
+ "description": "Creates an embed application: a factory for custom elements that render\nmk-kit-based Angular components behind shadow DOM.\n\n- **Lazy**: `element()` only defines the tag; the Angular application is\n created on the first element actually connected to a document.\n- **Shared**: every element of one `mkEmbed()` call runs in one zoneless\n `ApplicationRef` with one provider set.\n- **Isolated but themable**: the host page's CSS cannot reach the widget\n internals, while `--mk-*` custom properties still inherit through the\n shadow boundary — set them on the element (or any ancestor) to theme it.\n- **Styled**: Angular routes each component's own styles into the shadow\n root it renders in; the `styles` option supplies the token/theme layer.\n\n```ts\nimport { mkEmbed, mkShadowCss } from '@mk-kit/ui/embed';\nimport themeCss from '@mk-kit/ui/styles.css' with { type: 'text' };\n\nmkEmbed({ styles: mkShadowCss(themeCss) })\n .element('acme-reviews', ReviewsWidget)\n .element('acme-signup', SignupWidget);\n```\n\n```html\n<acme-reviews product-id=\"42\" style=\"--mk-primary: #7c3aed\"></acme-reviews>\n```\n\nInputs are exposed as dash-cased attributes (string values go through the\ninput's `transform`, so `booleanAttribute` / `numberAttribute` inputs coerce\nas usual) and as camel-cased element properties (any value); outputs become\nbubbling, composed `CustomEvent`s named after the output, with the emitted\nvalue as `detail`.",
22521
+ "file": "projects/mk-kit/embed/embed.ts",
22522
+ "kind": "function",
22523
+ "signatures": [
22524
+ "(init?: MkEmbedInit): MkEmbedApp"
22525
+ ]
22526
+ },
22527
+ {
22528
+ "name": "mkShadowCss",
22529
+ "description": "Rewrites a document-level stylesheet for adoption into a shadow root:\n`:root` never matches inside one, so token blocks like mk-kit's\n`:root { --mk-primary: … }` are retargeted to `:host`. Theme opt-ins keep\nworking — `:root:not([data-mk-theme='light'])` becomes\n`:host:not([data-mk-theme='light'])`, so `<my-widget data-mk-theme=\"dark\">`\nswitches one embedded element to the dark palette.\n\n```ts\nimport themeCss from '@mk-kit/ui/styles.css' with { type: 'text' };\nmkEmbed({ styles: mkShadowCss(themeCss) });\n```",
22530
+ "file": "projects/mk-kit/embed/shadow-css.ts",
22531
+ "kind": "function",
22532
+ "signatures": [
22533
+ "(css: string): string"
22534
+ ]
22535
+ },
22536
+ {
22537
+ "name": "MkEmbedInit",
22538
+ "description": "Options for `mkEmbed`.",
22539
+ "file": "projects/mk-kit/embed/embed.ts",
22540
+ "kind": "interface",
22541
+ "members": [
22542
+ {
22543
+ "name": "styles",
22544
+ "type": "string | readonly string[] | undefined",
22545
+ "description": "CSS text adopted into every element's shadow root (and the overlay host).\nPass the mk-kit theme through `mkShadowCss` so its `:root` token\nblocks target `:host`; append your own widget CSS after it. Shared as\nconstructable stylesheets when the browser supports them (one parse for\nany number of instances), `<style>` elements otherwise.",
22546
+ "optional": true
22547
+ },
22548
+ {
22549
+ "name": "providers",
22550
+ "type": "(Provider | EnvironmentProviders)[] | undefined",
22551
+ "description": "Extra providers for the shared application — `provideMkI18n(…)`,\n`provideMkExtendedIcons()`, `provideHttpClient()`, your services.",
22552
+ "optional": true
22553
+ },
22554
+ {
22555
+ "name": "overlays",
22556
+ "type": "boolean | undefined",
22557
+ "description": "Mount mk-kit overlays (dialogs, anchored panels, toasts, tours) inside a\npage-level shadow host that carries the same `styles`, instead of bare\n`document.body`. Default `true`; set `false` to keep the application\ndefault (overlays styled by the page's own stylesheets).",
22558
+ "optional": true
22559
+ }
22560
+ ]
22561
+ }
22562
+ ]
22563
+ },
22462
22564
  {
22463
22565
  "name": "locales/pl",
22464
22566
  "import": "@mk-kit/ui/locales/pl",
@@ -1,4 +1,4 @@
1
- # @mk-kit/ui 0.46.0 — full API reference
1
+ # @mk-kit/ui 0.47.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
- 76 exports. `import { … } from '@mk-kit/ui/core';`
15
+ 79 exports. `import { … } from '@mk-kit/ui/core';`
16
16
 
17
17
  ### MkAnchoredPanel (directive)
18
18
 
@@ -250,6 +250,19 @@ Properties:
250
250
  | `afterClosed` | `Promise<TResult \| undefined>` | Resolves with the close result when the overlay is dismissed. |
251
251
  | `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
252
 
253
+ ### mkBodyLevelAncestor (function)
254
+
255
+ Import: `import { mkBodyLevelAncestor } from '@mk-kit/ui/core';`
256
+
257
+ The direct child of `document.body` an overlay-root descendant lives under,
258
+ crossing shadow boundaries on the way up — `null` when the node is not under
259
+ `body` at all. The overlay service uses it to keep the overlay's own host
260
+ out of the elements it makes `inert` behind a modal.
261
+
262
+ ```ts
263
+ function mkBodyLevelAncestor(node: Node, body: HTMLElement): Element | null
264
+ ```
265
+
253
266
  ### mkComputeAnchoredPosition (function)
254
267
 
255
268
  Import: `import { mkComputeAnchoredPosition } from '@mk-kit/ui/core';`
@@ -618,6 +631,26 @@ Injection token exposing the data passed to an overlay component.
618
631
  const MK_OVERLAY_DATA: InjectionToken<unknown>;
619
632
  ```
620
633
 
634
+ ### MK_OVERLAY_ROOT (token)
635
+
636
+ Import: `import { MK_OVERLAY_ROOT } from '@mk-kit/ui/core';`
637
+
638
+ Where mk-kit mounts everything that leaves the component tree: overlay
639
+ containers (dialogs), anchored panels (selects, menus, tooltips), toast /
640
+ snackbar containers and the tour surfaces. Defaults to `document.body`.
641
+
642
+ Override it to confine those surfaces to another element — `@mk-kit/ui/embed`
643
+ points it at a themed shadow-DOM host so overlays opened by embedded custom
644
+ elements stay isolated from the host page's stylesheet:
645
+
646
+ ```ts
647
+ { provide: MK_OVERLAY_ROOT, useValue: () => myOverlayHost }
648
+ ```
649
+
650
+ ```ts
651
+ const MK_OVERLAY_ROOT: InjectionToken<MkOverlayRootFn>;
652
+ ```
653
+
621
654
  ### MK_DEFAULT_BREAKPOINTS (const)
622
655
 
623
656
  Import: `import { MK_DEFAULT_BREAKPOINTS } from '@mk-kit/ui/core';`
@@ -1390,6 +1423,17 @@ and `validation` groups may be partial too (they are merged deeply).
1390
1423
  type MkI18nOverrides = Partial< Omit<MkI18nStrings, 'dateNames' | 'blockEditor' | 'validation'> > & { dateNames?: Partial<MkDateNames>; blockEditor?: Partial<MkBlockEditorStrings>; validation?: Partial<MkValidationStrings>; };
1391
1424
  ```
1392
1425
 
1426
+ ### MkOverlayRootFn (type)
1427
+
1428
+ Import: `import { MkOverlayRootFn } from '@mk-kit/ui/core';`
1429
+
1430
+ Resolves the element overlay surfaces are appended to. A function (not an
1431
+ element) because the root may be created lazily, after DI is set up.
1432
+
1433
+ ```ts
1434
+ type MkOverlayRootFn = () => HTMLElement;
1435
+ ```
1436
+
1393
1437
  ### MkPlacement (type)
1394
1438
 
1395
1439
  Import: `import { MkPlacement } from '@mk-kit/ui/core';`
@@ -15001,6 +15045,99 @@ Load lifecycle of an `MkImage`.
15001
15045
  type MkImageState = 'loading' | 'loaded' | 'error';
15002
15046
  ```
15003
15047
 
15048
+ ## @mk-kit/ui/embed
15049
+
15050
+ 4 exports. `import { … } from '@mk-kit/ui/embed';`
15051
+
15052
+ ### MkEmbedApp (class)
15053
+
15054
+ Import: `import { MkEmbedApp } from '@mk-kit/ui/embed';`
15055
+
15056
+ One shared embed application. Create it with `mkEmbed`.
15057
+
15058
+ Methods:
15059
+
15060
+ | Signature | Description |
15061
+ | --- | --- |
15062
+ | `element(tag: string, component: Type<unknown>): this` | Defines `tag` as a custom element rendering `component`. Chainable; a no-op when the tag is already defined (hot reload, duplicate script) or outside a browser. |
15063
+ | `ready(): Promise<void>` | Resolves when the shared application is running (created on demand). |
15064
+ | `whenStable(): Promise<void>` | Resolves when the application has no pending change detection. |
15065
+ | `destroy(): void` | Destroys the shared application, every mounted component and the overlay host. Defined tags remain registered (the platform cannot undefine them) but render nothing afterwards. |
15066
+
15067
+ ### mkEmbed (function)
15068
+
15069
+ Import: `import { mkEmbed } from '@mk-kit/ui/embed';`
15070
+
15071
+ Creates an embed application: a factory for custom elements that render
15072
+ mk-kit-based Angular components behind shadow DOM.
15073
+
15074
+ - **Lazy**: `element()` only defines the tag; the Angular application is
15075
+ created on the first element actually connected to a document.
15076
+ - **Shared**: every element of one `mkEmbed()` call runs in one zoneless
15077
+ `ApplicationRef` with one provider set.
15078
+ - **Isolated but themable**: the host page's CSS cannot reach the widget
15079
+ internals, while `--mk-*` custom properties still inherit through the
15080
+ shadow boundary — set them on the element (or any ancestor) to theme it.
15081
+ - **Styled**: Angular routes each component's own styles into the shadow
15082
+ root it renders in; the `styles` option supplies the token/theme layer.
15083
+
15084
+ ```ts
15085
+ import { mkEmbed, mkShadowCss } from '@mk-kit/ui/embed';
15086
+ import themeCss from '@mk-kit/ui/styles.css' with { type: 'text' };
15087
+
15088
+ mkEmbed({ styles: mkShadowCss(themeCss) })
15089
+ .element('acme-reviews', ReviewsWidget)
15090
+ .element('acme-signup', SignupWidget);
15091
+ ```
15092
+
15093
+ ```html
15094
+ <acme-reviews product-id="42" style="--mk-primary: #7c3aed"></acme-reviews>
15095
+ ```
15096
+
15097
+ Inputs are exposed as dash-cased attributes (string values go through the
15098
+ input's `transform`, so `booleanAttribute` / `numberAttribute` inputs coerce
15099
+ as usual) and as camel-cased element properties (any value); outputs become
15100
+ bubbling, composed `CustomEvent`s named after the output, with the emitted
15101
+ value as `detail`.
15102
+
15103
+ ```ts
15104
+ function mkEmbed(init?: MkEmbedInit): MkEmbedApp
15105
+ ```
15106
+
15107
+ ### mkShadowCss (function)
15108
+
15109
+ Import: `import { mkShadowCss } from '@mk-kit/ui/embed';`
15110
+
15111
+ Rewrites a document-level stylesheet for adoption into a shadow root:
15112
+ `:root` never matches inside one, so token blocks like mk-kit's
15113
+ `:root { --mk-primary: … }` are retargeted to `:host`. Theme opt-ins keep
15114
+ working — `:root:not([data-mk-theme='light'])` becomes
15115
+ `:host:not([data-mk-theme='light'])`, so `<my-widget data-mk-theme="dark">`
15116
+ switches one embedded element to the dark palette.
15117
+
15118
+ ```ts
15119
+ import themeCss from '@mk-kit/ui/styles.css' with { type: 'text' };
15120
+ mkEmbed({ styles: mkShadowCss(themeCss) });
15121
+ ```
15122
+
15123
+ ```ts
15124
+ function mkShadowCss(css: string): string
15125
+ ```
15126
+
15127
+ ### MkEmbedInit (interface)
15128
+
15129
+ Import: `import { MkEmbedInit } from '@mk-kit/ui/embed';`
15130
+
15131
+ Options for `mkEmbed`.
15132
+
15133
+ Members:
15134
+
15135
+ | Name | Type | Description |
15136
+ | --- | --- | --- |
15137
+ | `styles`? | `string \| readonly string[] \| undefined` | CSS text adopted into every element's shadow root (and the overlay host). Pass the mk-kit theme through `mkShadowCss` so its `:root` token blocks target `:host`; append your own widget CSS after it. Shared as constructable stylesheets when the browser supports them (one parse for any number of instances), `<style>` elements otherwise. |
15138
+ | `providers`? | `(Provider \| EnvironmentProviders)[] \| undefined` | Extra providers for the shared application — `provideMkI18n(…)`, `provideMkExtendedIcons()`, `provideHttpClient()`, your services. |
15139
+ | `overlays`? | `boolean \| undefined` | Mount mk-kit overlays (dialogs, anchored panels, toasts, tours) inside a page-level shadow host that carries the same `styles`, instead of bare `document.body`. Default `true`; set `false` to keep the application default (overlays styled by the page's own stylesheets). |
15140
+
15004
15141
  ## @mk-kit/ui/locales/pl
15005
15142
 
15006
15143
  6 exports. `import { … } from '@mk-kit/ui/locales/pl';`
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.46.0. 170 components, 41 directives, 16 services and 133 helper functions across 24 tree-shakeable entry points. MIT licensed, zero runtime dependencies beyond Angular. Standalone components, signals, OnPush, zoneless-ready, SSR-safe, RTL and i18n via `provideMkI18n`.
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.47.0. 170 components, 41 directives, 16 services and 136 helper functions across 25 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mk-kit/mcp",
3
- "version": "0.46.0",
3
+ "version": "0.47.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",