engramma 0.1.1 → 0.1.2

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 CHANGED
@@ -61,6 +61,9 @@ Add the web component to any HTML page using a dialog to avoid affecting your pa
61
61
  border: 0;
62
62
  box-shadow: 0 0 10px rgb(0 0 0 / 30%);
63
63
  }
64
+ #engramma-dialog::backdrop {
65
+ display: none;
66
+ }
64
67
  </style>
65
68
  </head>
66
69
  <body>
package/dist/engramma.js CHANGED
@@ -20893,20 +20893,23 @@ body {
20893
20893
  }
20894
20894
  `, Mk = "code[class*=language-],pre[class*=language-]{color:#ccc;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}", Ak = () => {
20895
20895
  let e = "";
20896
- const t = document.documentElement;
20897
- if (t.computedStyleMap) {
20898
- for (const [n, r] of t.computedStyleMap())
20899
- if (n.startsWith("--"))
20900
- for (const o of r)
20901
- e += `${n}: ${o.toString()};
20902
- `;
20903
- } else {
20904
- const n = getComputedStyle(t);
20896
+ for (const t of document.styleSheets) {
20897
+ let n;
20898
+ try {
20899
+ n = t.cssRules;
20900
+ } catch {
20901
+ continue;
20902
+ }
20905
20903
  for (const r of n)
20906
- if (r.startsWith("--")) {
20907
- const o = n.getPropertyValue(r);
20908
- e += `${r}: ${o};
20904
+ if (r instanceof CSSStyleRule) {
20905
+ if (!r.selectorText.split(",").map((a) => a.trim()).some((a) => a === ":root" || a === "html"))
20906
+ continue;
20907
+ for (const a of r.style)
20908
+ if (a.startsWith("--")) {
20909
+ const i = r.style.getPropertyValue(a);
20910
+ e += `${a}: ${i};
20909
20911
  `;
20912
+ }
20910
20913
  }
20911
20914
  }
20912
20915
  return e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "engramma",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Web component to add Engramma on your website",
5
5
  "keywords": [],
6
6
  "author": "Bogdan Chadkin <opensource@trysound.io>",