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/dist/inline-style-editor.css +1 -1
- package/dist/inline-style-editor.js +2 -2
- package/dist/inline-style-editor.js.map +1 -1
- package/dist/inline-style-editor.mjs +45 -2
- package/dist/inline-style-editor.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/style.scss +0 -1
- package/src/components/InlineStyleEditor.svelte +5 -3
package/package.json
CHANGED
package/src/assets/style.scss
CHANGED
|
@@ -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}
|