inline-style-editor 1.5.6 → 1.5.8

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": "inline-style-editor",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "Update CSS rules or add inline style to elements visualy",
5
5
  "scripts": {
6
6
  "build": "rollup --config",
@@ -262,7 +262,6 @@
262
262
 
263
263
  .overlay-over {
264
264
  fill: #000000A0;
265
- clip-path: url(#overlay-clip);
266
265
  pointer-events: painted;
267
266
  }
268
267
  }
@@ -121,6 +121,7 @@
121
121
  let allCurrentPropDefs = $state({}); // propName => selectorDef
122
122
  let bringableToFront = $state([]); // null = not bringable, true = bringable, false = was bringed
123
123
  let hasDisplayedCustom = $state(false);
124
+ let baseUrl = $state(window.location.href.replace(/#.*$/, ""));
124
125
 
125
126
  // Reactive derived values
126
127
  const currentElement = $derived(targetsToSearch[selectedElemIndex]?.[0]);
@@ -334,6 +335,7 @@
334
335
 
335
336
  export async function open(el, x, y) {
336
337
  clickedElement = el;
338
+ baseUrl = window.location.href.replace(/#.*$/, "");
337
339
  udpatePageDimensions();
338
340
  if (el.classList.contains("overlay-over")) return overlayClicked();
339
341
  else if (self.contains(el)) return;
@@ -401,7 +403,7 @@
401
403
  let matching;
402
404
  if (currentRule === "inline") matching = [currentElement];
403
405
  else {
404
- const selector = currentRule.selectorText.replace(/(:hover)|:focus/g, "");
406
+ const selector = currentRule.selectorText.replace(/(:hover)|:focus|\.hovered/g, "");
405
407
  matching = Array.from(document.querySelectorAll(selector));
406
408
  }
407
409
  const boundingBoxes = matching.map((el) => getBoundingBoxInfos(el, 10));
@@ -561,7 +563,7 @@
561
563
  <clipPath id="overlay-clip" clip-rule="evenodd">
562
564
  <path d={pathWithHoles} />
563
565
  </clipPath>
564
- <rect y="0" x="0" height="100%" width="100%" class="overlay-over" />
566
+ <rect y="0" x="0" height="100%" width="100%" class="overlay-over" style="clip-path: url({baseUrl}#overlay-clip)" />
565
567
  </svg>
566
568
 
567
569
  <div class="ise" bind:this={self}>
@@ -590,7 +592,7 @@
590
592
  <div class="select-tab">
591
593
  <b> Applied to: </b>
592
594
  {#if nbChars(getRuleNamesTransformed(allRules[selectedElemIndex])) > 30}
593
- <select value={selectedRuleIndex} onchange={(e) => selectRule(e.target.value)}>
595
+ <select value={selectedRuleIndex} onchange={(e) => selectRule(+e.target.value)}>
594
596
  {#each getRuleNames(allRules[selectedElemIndex]) as ruleName, ruleIndex}
595
597
  <option value={ruleIndex}>{getCssRuleName(ruleName, clickedElement)}</option>
596
598
  {/each}