inline-style-editor 1.2.15 → 1.2.16
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 -0
- 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 +284 -221
- package/dist/inline-style-editor.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/style.scss +3 -0
- package/src/components/InlineStyleEditor.svelte +10 -0
- package/src/n +1621 -0
- package/stats.html +1 -1
- package/test.html +6 -2
package/package.json
CHANGED
package/src/assets/style.scss
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
export let listenOnClick = false;
|
|
35
35
|
export let onStyleChanged = () => {};
|
|
36
36
|
export let customProps = {};
|
|
37
|
+
export let inlineDeletable = () => true;
|
|
37
38
|
|
|
38
39
|
const typeText = "text";
|
|
39
40
|
const typeBorder = "border";
|
|
@@ -371,6 +372,10 @@
|
|
|
371
372
|
onStyleChanged(currentElement, currentRule, 'bringtofront', null);
|
|
372
373
|
}
|
|
373
374
|
|
|
375
|
+
function deleteElem() {
|
|
376
|
+
currentElement.remove();
|
|
377
|
+
close();
|
|
378
|
+
}
|
|
374
379
|
function deleteProp(propName) {
|
|
375
380
|
if (currentRule === 'inline') {
|
|
376
381
|
currentElement.style.removeProperty(propName)
|
|
@@ -479,6 +484,11 @@ on:click={overlayClicked}>
|
|
|
479
484
|
Bring to front
|
|
480
485
|
</div>
|
|
481
486
|
{/if}
|
|
487
|
+
{#if currentRule === 'inline' && inlineDeletable(currentElement)}
|
|
488
|
+
<div class="btn delete-elem" on:click="{deleteElem}">
|
|
489
|
+
Delete element
|
|
490
|
+
</div>
|
|
491
|
+
{/if}
|
|
482
492
|
</div>
|
|
483
493
|
{/if}
|
|
484
494
|
</div>
|