@tinymce/tinymce-svelte 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/CHANGELOG.md +4 -0
- package/README.md +18 -0
- package/dist/component/Editor.svelte +2 -1
- package/dist/index.mjs +43 -34
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +43 -34
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/ts/component/Editor.svelte +2 -1
- package/package.json +1 -1
- package/src/main/component/Editor.svelte +2 -1
package/dist/index.umd.js
CHANGED
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
},
|
|
367
367
|
m(target, anchor) {
|
|
368
368
|
insert(target, textarea, anchor);
|
|
369
|
-
/*textarea_binding*/ ctx[
|
|
369
|
+
/*textarea_binding*/ ctx[17](textarea);
|
|
370
370
|
},
|
|
371
371
|
p(ctx, dirty) {
|
|
372
372
|
if (dirty & /*id*/ 1) {
|
|
@@ -375,12 +375,12 @@
|
|
|
375
375
|
},
|
|
376
376
|
d(detaching) {
|
|
377
377
|
if (detaching) detach(textarea);
|
|
378
|
-
/*textarea_binding*/ ctx[
|
|
378
|
+
/*textarea_binding*/ ctx[17](null);
|
|
379
379
|
}
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
-
// (
|
|
383
|
+
// (121:2) {#if inline}
|
|
384
384
|
function create_if_block(ctx) {
|
|
385
385
|
let div;
|
|
386
386
|
|
|
@@ -391,7 +391,7 @@
|
|
|
391
391
|
},
|
|
392
392
|
m(target, anchor) {
|
|
393
393
|
insert(target, div, anchor);
|
|
394
|
-
/*div_binding*/ ctx[
|
|
394
|
+
/*div_binding*/ ctx[16](div);
|
|
395
395
|
},
|
|
396
396
|
p(ctx, dirty) {
|
|
397
397
|
if (dirty & /*id*/ 1) {
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
},
|
|
401
401
|
d(detaching) {
|
|
402
402
|
if (detaching) detach(div);
|
|
403
|
-
/*div_binding*/ ctx[
|
|
403
|
+
/*div_binding*/ ctx[16](null);
|
|
404
404
|
}
|
|
405
405
|
};
|
|
406
406
|
}
|
|
@@ -420,11 +420,12 @@
|
|
|
420
420
|
c() {
|
|
421
421
|
div = element("div");
|
|
422
422
|
if_block.c();
|
|
423
|
+
attr(div, "class", /*cssClass*/ ctx[2]);
|
|
423
424
|
},
|
|
424
425
|
m(target, anchor) {
|
|
425
426
|
insert(target, div, anchor);
|
|
426
427
|
if_block.m(div, null);
|
|
427
|
-
/*div_binding_1*/ ctx[
|
|
428
|
+
/*div_binding_1*/ ctx[18](div);
|
|
428
429
|
},
|
|
429
430
|
p(ctx, [dirty]) {
|
|
430
431
|
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
|
|
@@ -438,13 +439,17 @@
|
|
|
438
439
|
if_block.m(div, null);
|
|
439
440
|
}
|
|
440
441
|
}
|
|
442
|
+
|
|
443
|
+
if (dirty & /*cssClass*/ 4) {
|
|
444
|
+
attr(div, "class", /*cssClass*/ ctx[2]);
|
|
445
|
+
}
|
|
441
446
|
},
|
|
442
447
|
i: noop,
|
|
443
448
|
o: noop,
|
|
444
449
|
d(detaching) {
|
|
445
450
|
if (detaching) detach(div);
|
|
446
451
|
if_block.d();
|
|
447
|
-
/*div_binding_1*/ ctx[
|
|
452
|
+
/*div_binding_1*/ ctx[18](null);
|
|
448
453
|
}
|
|
449
454
|
};
|
|
450
455
|
}
|
|
@@ -507,6 +512,7 @@
|
|
|
507
512
|
let { modelEvents = 'change input undo redo' } = $$props;
|
|
508
513
|
let { value = '' } = $$props;
|
|
509
514
|
let { text = '' } = $$props;
|
|
515
|
+
let { cssClass = 'tinymce-wrapper' } = $$props;
|
|
510
516
|
let container;
|
|
511
517
|
let element;
|
|
512
518
|
let editorRef;
|
|
@@ -532,18 +538,18 @@
|
|
|
532
538
|
: conf.inline !== undefined ? conf.inline : false,
|
|
533
539
|
readonly: disabled,
|
|
534
540
|
setup: editor => {
|
|
535
|
-
$$invalidate(
|
|
541
|
+
$$invalidate(13, editorRef = editor);
|
|
536
542
|
|
|
537
543
|
editor.on('init', () => {
|
|
538
544
|
editor.setContent(value);
|
|
539
545
|
|
|
540
546
|
// bind model events
|
|
541
547
|
editor.on(modelEvents, () => {
|
|
542
|
-
$$invalidate(
|
|
548
|
+
$$invalidate(14, lastVal = editor.getContent());
|
|
543
549
|
|
|
544
550
|
if (lastVal !== value) {
|
|
545
|
-
$$invalidate(
|
|
546
|
-
$$invalidate(
|
|
551
|
+
$$invalidate(5, value = lastVal);
|
|
552
|
+
$$invalidate(6, text = editor.getContent({ format: 'text' }));
|
|
547
553
|
}
|
|
548
554
|
});
|
|
549
555
|
});
|
|
@@ -556,7 +562,7 @@
|
|
|
556
562
|
}
|
|
557
563
|
});
|
|
558
564
|
|
|
559
|
-
$$invalidate(
|
|
565
|
+
$$invalidate(4, element.style.visibility = '', element);
|
|
560
566
|
getTinymce().init(finalInit);
|
|
561
567
|
};
|
|
562
568
|
|
|
@@ -587,47 +593,48 @@
|
|
|
587
593
|
function div_binding($$value) {
|
|
588
594
|
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
589
595
|
element = $$value;
|
|
590
|
-
$$invalidate(
|
|
596
|
+
$$invalidate(4, element);
|
|
591
597
|
});
|
|
592
598
|
}
|
|
593
599
|
|
|
594
600
|
function textarea_binding($$value) {
|
|
595
601
|
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
596
602
|
element = $$value;
|
|
597
|
-
$$invalidate(
|
|
603
|
+
$$invalidate(4, element);
|
|
598
604
|
});
|
|
599
605
|
}
|
|
600
606
|
|
|
601
607
|
function div_binding_1($$value) {
|
|
602
608
|
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
603
609
|
container = $$value;
|
|
604
|
-
$$invalidate(
|
|
610
|
+
$$invalidate(3, container);
|
|
605
611
|
});
|
|
606
612
|
}
|
|
607
613
|
|
|
608
614
|
$$self.$$set = $$props => {
|
|
609
615
|
if ('id' in $$props) $$invalidate(0, id = $$props.id);
|
|
610
616
|
if ('inline' in $$props) $$invalidate(1, inline = $$props.inline);
|
|
611
|
-
if ('disabled' in $$props) $$invalidate(
|
|
612
|
-
if ('apiKey' in $$props) $$invalidate(
|
|
613
|
-
if ('channel' in $$props) $$invalidate(
|
|
614
|
-
if ('scriptSrc' in $$props) $$invalidate(
|
|
615
|
-
if ('conf' in $$props) $$invalidate(
|
|
616
|
-
if ('modelEvents' in $$props) $$invalidate(
|
|
617
|
-
if ('value' in $$props) $$invalidate(
|
|
618
|
-
if ('text' in $$props) $$invalidate(
|
|
617
|
+
if ('disabled' in $$props) $$invalidate(7, disabled = $$props.disabled);
|
|
618
|
+
if ('apiKey' in $$props) $$invalidate(8, apiKey = $$props.apiKey);
|
|
619
|
+
if ('channel' in $$props) $$invalidate(9, channel = $$props.channel);
|
|
620
|
+
if ('scriptSrc' in $$props) $$invalidate(10, scriptSrc = $$props.scriptSrc);
|
|
621
|
+
if ('conf' in $$props) $$invalidate(11, conf = $$props.conf);
|
|
622
|
+
if ('modelEvents' in $$props) $$invalidate(12, modelEvents = $$props.modelEvents);
|
|
623
|
+
if ('value' in $$props) $$invalidate(5, value = $$props.value);
|
|
624
|
+
if ('text' in $$props) $$invalidate(6, text = $$props.text);
|
|
625
|
+
if ('cssClass' in $$props) $$invalidate(2, cssClass = $$props.cssClass);
|
|
619
626
|
};
|
|
620
627
|
|
|
621
628
|
$$self.$$.update = () => {
|
|
622
|
-
if ($$self.$$.dirty & /*editorRef, lastVal, value, disabled, disablindCache*/
|
|
629
|
+
if ($$self.$$.dirty & /*editorRef, lastVal, value, disabled, disablindCache*/ 57504) {
|
|
623
630
|
{
|
|
624
631
|
if (editorRef && lastVal !== value) {
|
|
625
632
|
editorRef.setContent(value);
|
|
626
|
-
$$invalidate(
|
|
633
|
+
$$invalidate(6, text = editorRef.getContent({ format: 'text' }));
|
|
627
634
|
}
|
|
628
635
|
|
|
629
636
|
if (editorRef && disabled !== disablindCache) {
|
|
630
|
-
$$invalidate(
|
|
637
|
+
$$invalidate(15, disablindCache = disabled);
|
|
631
638
|
editorRef.setMode(disabled ? 'readonly' : 'design');
|
|
632
639
|
}
|
|
633
640
|
}
|
|
@@ -637,6 +644,7 @@
|
|
|
637
644
|
return [
|
|
638
645
|
id,
|
|
639
646
|
inline,
|
|
647
|
+
cssClass,
|
|
640
648
|
container,
|
|
641
649
|
element,
|
|
642
650
|
value,
|
|
@@ -663,14 +671,15 @@
|
|
|
663
671
|
init(this, options, instance, create_fragment, safe_not_equal, {
|
|
664
672
|
id: 0,
|
|
665
673
|
inline: 1,
|
|
666
|
-
disabled:
|
|
667
|
-
apiKey:
|
|
668
|
-
channel:
|
|
669
|
-
scriptSrc:
|
|
670
|
-
conf:
|
|
671
|
-
modelEvents:
|
|
672
|
-
value:
|
|
673
|
-
text:
|
|
674
|
+
disabled: 7,
|
|
675
|
+
apiKey: 8,
|
|
676
|
+
channel: 9,
|
|
677
|
+
scriptSrc: 10,
|
|
678
|
+
conf: 11,
|
|
679
|
+
modelEvents: 12,
|
|
680
|
+
value: 5,
|
|
681
|
+
text: 6,
|
|
682
|
+
cssClass: 2
|
|
674
683
|
});
|
|
675
684
|
}
|
|
676
685
|
}
|