anentrypoint-design 0.0.109 → 0.0.111

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anentrypoint-design",
3
- "version": "0.0.109",
3
+ "version": "0.0.111",
4
4
  "description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
5
5
  "type": "module",
6
6
  "main": "./dist/247420.js",
package/src/index.js CHANGED
@@ -36,7 +36,9 @@ export function mount(rootEl, viewFn, { autoScope = true } = {}) {
36
36
  if (!rootEl) throw new Error('mount: rootEl required');
37
37
  if (typeof viewFn !== 'function') throw new Error('mount: viewFn required');
38
38
  if (autoScope && rootEl.classList && !rootEl.classList.contains(scope.slice(1))) {
39
- rootEl.classList.add(scope.slice(1));
39
+ const cls = scope.slice(1);
40
+ const inheritedFromAncestor = rootEl.closest && rootEl.closest('.' + cls);
41
+ if (!inheritedFromAncestor) rootEl.classList.add(cls);
40
42
  }
41
43
  // Auto-inject styles (idempotent) so single-line consumers don't need
42
44
  // to remember installStyles() before mount.