@magicx-eng/ai-autocomplete-vanilla 0.23.1 → 0.23.3
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/README.md +1 -4
- package/dist/index.d.mts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/index.js +108 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +108 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -736,7 +736,7 @@ Styles are auto-injected at runtime (Tier 1 and Tier 2). No CSS import needed. T
|
|
|
736
736
|
|
|
737
737
|
Every class name the core emits is namespaced — `magicx-aia-*` (plus the bare `magicx-aia` root) and `aia-*` for the layout primitives — so nothing it renders can match a `.container`, `.pill` or `.dropdown` rule in your own stylesheet, and none of its rules can reach your elements.
|
|
738
738
|
|
|
739
|
-
**Page CSS stops at the widget's edge.** Everything inside the input wrapper (`[data-aia-input-wrapper]`) and the dropdown (`[data-aia-dropdown]`) is reset to browser defaults before the SDK's own styles apply, so element and universal rules in your stylesheet — `button { … }`, `a { … }`, `* { … }`, a CSS reset, a framework's preflight — never reach it, and inherited typography adjustments from the page (line-height, letter-spacing, text-transform, text-align, …) are pinned at those two roots. Font family, size, weight and text colour still inherit from your page; a submit button you provide is left to your own stylesheet; and nothing the SDK ships styles elements outside its own subtree. The reset sits at specificity (0,0,5), below any rule that names a class, attribute or id — your overrides on the `data-aia-*` hooks work exactly as before, and so does a page rule like `.sidebar button { … }`, which names a class: scope rules like that to your own markup. For complete isolation, including rules like that, mount the widget in a shadow root — see [Shadow DOM](#shadow-dom).
|
|
739
|
+
**Page CSS stops at the widget's edge.** Everything inside the input wrapper (`[data-aia-input-wrapper]`) and the dropdown (`[data-aia-dropdown]`) is reset to browser defaults before the SDK's own styles apply, so element and universal rules in your stylesheet — `button { … }`, `a { … }`, `* { … }`, a CSS reset, a framework's preflight — never reach it, and inherited typography adjustments from the page (line-height, letter-spacing, text-transform, text-align, …) are pinned at those two roots. Font family, size, weight and text colour still inherit from your page; a submit button you provide is left to your own stylesheet; and nothing the SDK ships styles elements outside its own subtree. The SDK's inline icons are covered too: a page's `svg { display: block; max-width: 100%; margin: … }` or `svg { width: 100%; fill: currentColor }` leaves the submit arrow, the scroll chevron and the option icons as drawn. The reset sits at specificity (0,0,5), below any rule that names a class, attribute or id — your overrides on the `data-aia-*` hooks work exactly as before, and so does a page rule like `.sidebar button { … }`, which names a class: scope rules like that to your own markup. For complete isolation, including rules like that, mount the widget in a shadow root — see [Shadow DOM](#shadow-dom).
|
|
740
740
|
|
|
741
741
|
### Shadow DOM
|
|
742
742
|
|
|
@@ -791,10 +791,7 @@ Override these on the container element. The variables are declared with `:where
|
|
|
791
791
|
| `--aia-product-bg` | `transparent` | `transparent` | Product card background. |
|
|
792
792
|
| `--aia-product-bg-active` | `--aia-option-bg` | `--aia-option-bg` | Product card background on hover. |
|
|
793
793
|
| `--aia-product-media-bg` | `--aia-skeleton-bg` | `--aia-skeleton-bg` | Fill behind the product image, and of the placeholder tile when a product has no image. |
|
|
794
|
-
| `--aia-scroll-arrow-bg` | `--aia-surface` | `--aia-surface` | Fill of the "more below" arrow — the round button that fades in at the bottom of the option list while there is more to scroll to, and out while it scrolls. |
|
|
795
794
|
| `--aia-scroll-arrow-color` | `--aia-option-color` | `--aia-option-color` | Chevron color of the arrow (`--aia-scroll-arrow-color-hover` on hover). |
|
|
796
|
-
| `--aia-scroll-arrow-border` | `--aia-dropdown-border` | `--aia-dropdown-border` | Hairline around the arrow. |
|
|
797
|
-
| `--aia-scroll-arrow-shadow` | `0 2px 8px rgba(0,0,0,0.12)` | `0 2px 8px rgba(0,0,0,0.12)` | Elevation of the arrow. |
|
|
798
795
|
| `--aia-placeholder-fade` | `120ms` | `120ms` | Fade-out of the outgoing placeholder phrase when the starting-state placeholder changes (the incoming one types itself in). |
|
|
799
796
|
| `--aia-product-placeholder-image` | storefront pictogram | storefront pictogram | The image drawn on the placeholder tile when a product has no `imageUrl`: a two-tone storefront pictogram, inlined as a data URI. Set it to any `url(...)` to swap the pictogram; it is drawn centered and contained inside the tile, over `--aia-product-media-bg`. |
|
|
800
797
|
| `--aia-product-title-color` | `--aia-option-color-selected` | `--aia-option-color-selected` | Product title text. Follows the option colors by default, so theming the panel moves suggestions and products together. |
|
package/dist/index.d.mts
CHANGED
|
@@ -1656,10 +1656,11 @@ declare function renderEditableContent(args: RenderEditableArgs): void;
|
|
|
1656
1656
|
/**
|
|
1657
1657
|
* The "more below" arrow for the options grid.
|
|
1658
1658
|
*
|
|
1659
|
-
* When the option list is taller than its scroll box, a
|
|
1660
|
-
*
|
|
1661
|
-
*
|
|
1662
|
-
* place, SCROLL_ARROW_FADE_MS long
|
|
1659
|
+
* When the option list is taller than its scroll box, a bare down chevron
|
|
1660
|
+
* sits at the bottom-centre of the list and scrolls it a page on click. It
|
|
1661
|
+
* never travels with the scroll — every appearance is an opacity fade in
|
|
1662
|
+
* place, SCROLL_ARROW_FADE_MS long, and its only motion is the stylesheets'
|
|
1663
|
+
* slow idle bob of a few pixels (the stylesheets own both curves):
|
|
1663
1664
|
*
|
|
1664
1665
|
* - At rest with more below (the list just opened, or scrolling has stopped
|
|
1665
1666
|
* short of the end), it fades in.
|
|
@@ -1668,9 +1669,10 @@ declare function renderEditableContent(args: RenderEditableArgs): void;
|
|
|
1668
1669
|
* - Once scrolling has been quiet for SCROLL_ARROW_SCROLL_IDLE_MS it fades
|
|
1669
1670
|
* back in — unless the list is now at its bottom, where it stays out.
|
|
1670
1671
|
*
|
|
1671
|
-
* Earlier versions rose from behind the footer and
|
|
1672
|
-
* read as the disc travelling with the scroll
|
|
1673
|
-
* fade-only rule
|
|
1672
|
+
* Earlier versions were a white disc that rose from behind the footer and
|
|
1673
|
+
* slid or shrank away; each read as the disc travelling with the scroll
|
|
1674
|
+
* (2026-09-03/04), hence the fade-only rule, and on 2026-09-05 the disc was
|
|
1675
|
+
* dropped for a plain chevron. The stylesheets key everything off one attribute,
|
|
1674
1676
|
* `data-aia-visible`: present → opacity 1, absent → opacity 0, both
|
|
1675
1677
|
* transitioned.
|
|
1676
1678
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1656,10 +1656,11 @@ declare function renderEditableContent(args: RenderEditableArgs): void;
|
|
|
1656
1656
|
/**
|
|
1657
1657
|
* The "more below" arrow for the options grid.
|
|
1658
1658
|
*
|
|
1659
|
-
* When the option list is taller than its scroll box, a
|
|
1660
|
-
*
|
|
1661
|
-
*
|
|
1662
|
-
* place, SCROLL_ARROW_FADE_MS long
|
|
1659
|
+
* When the option list is taller than its scroll box, a bare down chevron
|
|
1660
|
+
* sits at the bottom-centre of the list and scrolls it a page on click. It
|
|
1661
|
+
* never travels with the scroll — every appearance is an opacity fade in
|
|
1662
|
+
* place, SCROLL_ARROW_FADE_MS long, and its only motion is the stylesheets'
|
|
1663
|
+
* slow idle bob of a few pixels (the stylesheets own both curves):
|
|
1663
1664
|
*
|
|
1664
1665
|
* - At rest with more below (the list just opened, or scrolling has stopped
|
|
1665
1666
|
* short of the end), it fades in.
|
|
@@ -1668,9 +1669,10 @@ declare function renderEditableContent(args: RenderEditableArgs): void;
|
|
|
1668
1669
|
* - Once scrolling has been quiet for SCROLL_ARROW_SCROLL_IDLE_MS it fades
|
|
1669
1670
|
* back in — unless the list is now at its bottom, where it stays out.
|
|
1670
1671
|
*
|
|
1671
|
-
* Earlier versions rose from behind the footer and
|
|
1672
|
-
* read as the disc travelling with the scroll
|
|
1673
|
-
* fade-only rule
|
|
1672
|
+
* Earlier versions were a white disc that rose from behind the footer and
|
|
1673
|
+
* slid or shrank away; each read as the disc travelling with the scroll
|
|
1674
|
+
* (2026-09-03/04), hence the fade-only rule, and on 2026-09-05 the disc was
|
|
1675
|
+
* dropped for a plain chevron. The stylesheets key everything off one attribute,
|
|
1674
1676
|
* `data-aia-visible`: present → opacity 1, absent → opacity 0, both
|
|
1675
1677
|
* transitioned.
|
|
1676
1678
|
*
|