@thecodeblogs/blog 0.20.1 → 0.20.3

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.
@@ -4,16 +4,11 @@ import { Injectable, EventEmitter, PLATFORM_ID, Inject, SecurityContext, Compone
4
4
  import * as i1 from '@angular/common/http';
5
5
  import { HttpParams } from '@angular/common/http';
6
6
  import { map, debounceTime } from 'rxjs/operators';
7
- import { Subject, of, Subscription } from 'rxjs';
8
- import { Utility as Utility$1 } from '@blog/services/utility';
7
+ import { Subject, of, debounceTime as debounceTime$1, Subscription } from 'rxjs';
9
8
  import * as i6 from '@angular/common';
10
9
  import { isPlatformBrowser, NgIf, CommonModule } from '@angular/common';
11
10
  import * as i2 from 'ngx-device-detector';
12
11
  import * as i1$1 from '@angular/platform-browser';
13
- import { Entry as Entry$1 } from '@blog/data/entry';
14
- import { Section as Section$1 } from '@blog/data/section';
15
- import { Content as Content$1 } from '@blog/data/content';
16
- import { ContentType as ContentType$1 } from '@blog/data/content-type';
17
12
  import { ENTER, COMMA, TAB } from '@angular/cdk/keycodes';
18
13
  import * as i1$2 from '@angular/material/dialog';
19
14
  import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
@@ -50,11 +45,12 @@ import { provideNativeDateAdapter, MatNativeDateModule } from '@angular/material
50
45
  import * as i1$3 from '@angular/router';
51
46
  import { NavigationEnd, RouterModule } from '@angular/router';
52
47
  import * as i12 from '@angular/cdk/text-field';
48
+ import * as i6$2 from '@angular/material/progress-spinner';
49
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
50
+ import { QuillEditorComponent } from 'ngx-quill';
53
51
  import { trigger, state, transition, style, animate } from '@angular/animations';
54
52
  import * as i4$1 from '@angular/cdk/drag-drop';
55
53
  import { DragDropModule } from '@angular/cdk/drag-drop';
56
- import * as i6$2 from '@angular/material/progress-spinner';
57
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
58
54
  import * as i2$1 from '@angular/material/sidenav';
59
55
  import { MatSidenavModule } from '@angular/material/sidenav';
60
56
  import * as i9$1 from '@angular/material/list';
@@ -270,6 +266,167 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
270
266
  }]
271
267
  }], ctorParameters: () => [{ type: i1.HttpClient }] });
272
268
 
269
+ class Utility {
270
+ static replaceNbsps(str) {
271
+ var re = new RegExp(String.fromCharCode(160), "g");
272
+ return str.replace(re, " ");
273
+ }
274
+ static convertHTMLToType(el) {
275
+ var value = "";
276
+ var contentType = "";
277
+ // First test for custom objects
278
+ var testValue = el.innerText;
279
+ try {
280
+ var obj = JSON.parse(testValue);
281
+ return obj;
282
+ }
283
+ catch (error) {
284
+ //console.error(error);
285
+ }
286
+ //console.log(el.tagName);
287
+ switch (el.tagName.toLowerCase()) {
288
+ case "p":
289
+ if (el.children.length > 0) {
290
+ var child = el.children[0];
291
+ if (child.tagName.toLowerCase() === "a") {
292
+ var c = new Content();
293
+ value = child.href;
294
+ c.value = value;
295
+ c.title = Utility.replaceNbsps(child.innerText);
296
+ c.type = ContentType.URL;
297
+ return c;
298
+ }
299
+ else if (child.tagName.toLowerCase() === 'img') {
300
+ var c = new Content();
301
+ value = child.src;
302
+ c.value = value;
303
+ c.type = ContentType.IMAGE;
304
+ return c;
305
+ }
306
+ }
307
+ else {
308
+ var c = new Content();
309
+ value = Utility.replaceNbsps(el.innerText);
310
+ c.value = value;
311
+ c.type = ContentType.TEXT;
312
+ return c;
313
+ }
314
+ break;
315
+ case "a":
316
+ var c = new Content();
317
+ value = el.href;
318
+ c.value = value;
319
+ c.title = Utility.replaceNbsps(el.innerText);
320
+ c.type = ContentType.URL;
321
+ return c;
322
+ break;
323
+ case "h4":
324
+ var s = new Section();
325
+ value = Utility.replaceNbsps(el.innerText);
326
+ s.subheading = Utility.replaceNbsps(value);
327
+ return s;
328
+ break;
329
+ case "blockquote":
330
+ var c = new Content();
331
+ value = el.innerHTML;
332
+ c.value = "<blockquote>" + value + "</blockquote>";
333
+ c.type = ContentType.HTML;
334
+ return c;
335
+ break;
336
+ default:
337
+ var c = new Content();
338
+ value = el.innerHTML;
339
+ c.value = value;
340
+ c.type = ContentType.HTML;
341
+ return c;
342
+ break;
343
+ }
344
+ }
345
+ static convertHtmlToBlogFormat(entry, html) {
346
+ entry.sections = [];
347
+ var newEntry = new Entry(entry);
348
+ var el = document.createElement('html');
349
+ el.innerHTML = html;
350
+ // Creating the HTML element adds a head and body
351
+ // We hardcode to 1 to reference the body, and its
352
+ // child elements
353
+ var children = el.children[1].children;
354
+ ;
355
+ var section = new Section();
356
+ section.subheading = "";
357
+ for (let i = 0; i < children.length; i++) {
358
+ var child = children[i];
359
+ var thing = Utility.convertHTMLToType(child);
360
+ //console.log('Thing: ' + JSON.stringify(thing));
361
+ //console.log('Typeof: ' + JSON.stringify(typeof(thing)));
362
+ if (thing instanceof Section) {
363
+ section = thing;
364
+ section.order = i * 10;
365
+ entry.sections.push(section);
366
+ }
367
+ else if (thing instanceof Content) {
368
+ if (entry.sections.length === 0) {
369
+ thing.order = i * 10;
370
+ section.contents.push(thing);
371
+ entry.sections.push(section);
372
+ section.order = i * 10;
373
+ }
374
+ else {
375
+ thing.order = i * 10;
376
+ section.contents.push(thing);
377
+ }
378
+ }
379
+ else {
380
+ if (thing !== null && typeof (thing) !== 'undefined') {
381
+ thing.order = i * 10;
382
+ section.contents.push(thing);
383
+ }
384
+ }
385
+ }
386
+ //console.log('E: ' + JSON.stringify(entry));
387
+ return entry;
388
+ }
389
+ static convertTypeToHTML(content) {
390
+ switch (content.type) {
391
+ case ContentType.CODE:
392
+ return '<pre><code class="language-ts">' + content?.value + '</code></pre>';
393
+ break;
394
+ case ContentType.IMAGE:
395
+ return '<img src="' + content?.value + '"/>';
396
+ break;
397
+ case ContentType.MEDIA:
398
+ return '<pre>' + JSON.stringify(content) + '</pre>';
399
+ break;
400
+ case ContentType.HTML:
401
+ return content.value;
402
+ break;
403
+ case ContentType.URL:
404
+ return '<a target="_blank" href="' + content.value + '">' + content.title + '</a><br>';
405
+ break;
406
+ case ContentType.TEXT:
407
+ return '<p>' + content.value + '</p>';
408
+ break;
409
+ default:
410
+ return '<pre>' + JSON.stringify(content) + '</pre>';
411
+ break;
412
+ }
413
+ }
414
+ static convertBlogToHtml(blog) {
415
+ var html = "";
416
+ var sections = blog.sections;
417
+ for (var i = 0; i < sections.length; i++) {
418
+ var section = sections[i];
419
+ html = html + '<h4>' + section.subheading + '</h4>';
420
+ var contents = section.contents;
421
+ for (var j = 0; j < contents.length; j++) {
422
+ var content = contents[j];
423
+ html = html + Utility.convertTypeToHTML(content);
424
+ }
425
+ }
426
+ return html;
427
+ }
428
+ }
429
+
273
430
  class EntryService extends DjangoRestFrameworkEndpointService {
274
431
  handleResponse(obj) {
275
432
  return new Entry(obj);
@@ -358,10 +515,10 @@ class EntryService extends DjangoRestFrameworkEndpointService {
358
515
  return this.http.delete(this.adminEndpoint + entity.id + '/').pipe(map((val) => this.triggerCoreEvent(val, CoreEventType.DELETE)), map(this.handleResponse.bind(this)));
359
516
  }
360
517
  convertHtmlToBlogFormat(entry, html) {
361
- return Utility$1.convertHtmlToBlogFormat(entry, html);
518
+ return Utility.convertHtmlToBlogFormat(entry, html);
362
519
  }
363
520
  convertBlogToHtmlFormat(entry) {
364
- return Utility$1.convertBlogToHtml(entry);
521
+ return Utility.convertBlogToHtml(entry);
365
522
  }
366
523
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: EntryService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
367
524
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: EntryService, providedIn: 'root' }); }
@@ -577,167 +734,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
577
734
  }]
578
735
  }], ctorParameters: () => [{ type: i1.HttpClient }] });
579
736
 
580
- class Utility {
581
- static replaceNbsps(str) {
582
- var re = new RegExp(String.fromCharCode(160), "g");
583
- return str.replace(re, " ");
584
- }
585
- static convertHTMLToType(el) {
586
- var value = "";
587
- var contentType = "";
588
- // First test for custom objects
589
- var testValue = el.innerText;
590
- try {
591
- var obj = JSON.parse(testValue);
592
- return obj;
593
- }
594
- catch (error) {
595
- //console.error(error);
596
- }
597
- //console.log(el.tagName);
598
- switch (el.tagName.toLowerCase()) {
599
- case "p":
600
- if (el.children.length > 0) {
601
- var child = el.children[0];
602
- if (child.tagName.toLowerCase() === "a") {
603
- var c = new Content$1();
604
- value = child.href;
605
- c.value = value;
606
- c.title = Utility.replaceNbsps(child.innerText);
607
- c.type = ContentType$1.URL;
608
- return c;
609
- }
610
- else if (child.tagName.toLowerCase() === 'img') {
611
- var c = new Content$1();
612
- value = child.src;
613
- c.value = value;
614
- c.type = ContentType$1.IMAGE;
615
- return c;
616
- }
617
- }
618
- else {
619
- var c = new Content$1();
620
- value = Utility.replaceNbsps(el.innerText);
621
- c.value = value;
622
- c.type = ContentType$1.TEXT;
623
- return c;
624
- }
625
- break;
626
- case "a":
627
- var c = new Content$1();
628
- value = el.href;
629
- c.value = value;
630
- c.title = Utility.replaceNbsps(el.innerText);
631
- c.type = ContentType$1.URL;
632
- return c;
633
- break;
634
- case "h4":
635
- var s = new Section$1();
636
- value = Utility.replaceNbsps(el.innerText);
637
- s.subheading = Utility.replaceNbsps(value);
638
- return s;
639
- break;
640
- case "blockquote":
641
- var c = new Content$1();
642
- value = el.innerHTML;
643
- c.value = "<blockquote>" + value + "</blockquote>";
644
- c.type = ContentType$1.HTML;
645
- return c;
646
- break;
647
- default:
648
- var c = new Content$1();
649
- value = el.innerHTML;
650
- c.value = value;
651
- c.type = ContentType$1.HTML;
652
- return c;
653
- break;
654
- }
655
- }
656
- static convertHtmlToBlogFormat(entry, html) {
657
- entry.sections = [];
658
- var newEntry = new Entry$1(entry);
659
- var el = document.createElement('html');
660
- el.innerHTML = html;
661
- // Creating the HTML element adds a head and body
662
- // We hardcode to 1 to reference the body, and its
663
- // child elements
664
- var children = el.children[1].children;
665
- ;
666
- var section = new Section$1();
667
- section.subheading = "";
668
- for (let i = 0; i < children.length; i++) {
669
- var child = children[i];
670
- var thing = Utility.convertHTMLToType(child);
671
- //console.log('Thing: ' + JSON.stringify(thing));
672
- //console.log('Typeof: ' + JSON.stringify(typeof(thing)));
673
- if (thing instanceof Section$1) {
674
- section = thing;
675
- section.order = i * 10;
676
- entry.sections.push(section);
677
- }
678
- else if (thing instanceof Content$1) {
679
- if (entry.sections.length === 0) {
680
- thing.order = i * 10;
681
- section.contents.push(thing);
682
- entry.sections.push(section);
683
- section.order = i * 10;
684
- }
685
- else {
686
- thing.order = i * 10;
687
- section.contents.push(thing);
688
- }
689
- }
690
- else {
691
- if (thing !== null && typeof (thing) !== 'undefined') {
692
- thing.order = i * 10;
693
- section.contents.push(thing);
694
- }
695
- }
696
- }
697
- //console.log('E: ' + JSON.stringify(entry));
698
- return entry;
699
- }
700
- static convertTypeToHTML(content) {
701
- switch (content.type) {
702
- case ContentType$1.CODE:
703
- return '<pre><code class="language-ts">' + content?.value + '</code></pre>';
704
- break;
705
- case ContentType$1.IMAGE:
706
- return '<img src="' + content?.value + '"/>';
707
- break;
708
- case ContentType$1.MEDIA:
709
- return '<pre>' + JSON.stringify(content) + '</pre>';
710
- break;
711
- case ContentType$1.HTML:
712
- return content.value;
713
- break;
714
- case ContentType$1.URL:
715
- return '<a target="_blank" href="' + content.value + '">' + content.title + '</a><br>';
716
- break;
717
- case ContentType$1.TEXT:
718
- return '<p>' + content.value + '</p>';
719
- break;
720
- default:
721
- return '<pre>' + JSON.stringify(content) + '</pre>';
722
- break;
723
- }
724
- }
725
- static convertBlogToHtml(blog) {
726
- var html = "";
727
- var sections = blog.sections;
728
- for (var i = 0; i < sections.length; i++) {
729
- var section = sections[i];
730
- html = html + '<h4>' + section.subheading + '</h4>';
731
- var contents = section.contents;
732
- for (var j = 0; j < contents.length; j++) {
733
- var content = contents[j];
734
- html = html + Utility.convertTypeToHTML(content);
735
- }
736
- }
737
- return html;
738
- }
739
- }
740
-
741
737
  class EntrySelectorDialogData {
742
738
  }
743
739
 
@@ -1283,30 +1279,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
1283
1279
  type: Input
1284
1280
  }] } });
1285
1281
 
1286
- class StaticHtmlComponent {
1287
- constructor(staticHtmlService, domSanitizer) {
1288
- this.staticHtmlService = staticHtmlService;
1289
- this.domSanitizer = domSanitizer;
1290
- }
1291
- refreshContent() {
1292
- this.innerHtml = this.domSanitizer.bypassSecurityTrustHtml(this.staticHtmlService.mapStaticHtml(this.value, false));
1293
- }
1294
- ngOnChanges(changes) {
1295
- this.refreshContent();
1296
- }
1297
- ngOnInit() {
1298
- this.refreshContent();
1299
- }
1300
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: StaticHtmlComponent, deps: [{ token: StaticHtmlService }, { token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
1301
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: StaticHtmlComponent, isStandalone: true, selector: "app-static-html", inputs: { value: "value" }, usesOnChanges: true, ngImport: i0, template: "<div [innerHtml]=\"innerHtml\">\n</div>\n", styles: [""] }); }
1302
- }
1303
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: StaticHtmlComponent, decorators: [{
1304
- type: Component,
1305
- args: [{ selector: 'app-static-html', template: "<div [innerHtml]=\"innerHtml\">\n</div>\n" }]
1306
- }], ctorParameters: () => [{ type: StaticHtmlService }, { type: i1$1.DomSanitizer }], propDecorators: { value: [{
1307
- type: Input
1308
- }] } });
1309
-
1310
1282
  class TimeAgoPipe {
1311
1283
  constructor(changeDetectorRef, ngZone) {
1312
1284
  this.changeDetectorRef = changeDetectorRef;
@@ -1405,6 +1377,165 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
1405
1377
  }]
1406
1378
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }] });
1407
1379
 
1380
+ class EntryWysiwygComponent {
1381
+ static { this.CURRENT_ENTRY_KEY = EntryCreatorComponent.CURRENT_ENTRY_KEY; }
1382
+ static { this.DEFAULT_NEW_ENTRY_TITLE = EntryCreatorComponent.DEFAULT_NEW_ENTRY_TITLE; }
1383
+ constructor(router, entryService, tagService, identityService, dialog, sanitizer, fb) {
1384
+ this.router = router;
1385
+ this.entryService = entryService;
1386
+ this.tagService = tagService;
1387
+ this.identityService = identityService;
1388
+ this.dialog = dialog;
1389
+ this.sanitizer = sanitizer;
1390
+ this.fb = fb;
1391
+ this.CURRENT_ENTRY_KEY = EntryWysiwygComponent.CURRENT_ENTRY_KEY;
1392
+ this.DEFAULT_NEW_ENTRY_TITLE = EntryWysiwygComponent.DEFAULT_NEW_ENTRY_TITLE;
1393
+ this.all_tags = ['Angular', 'Bash', 'MacOS', 'Typescript', 'NPM', 'Databases'];
1394
+ this.format = 'html';
1395
+ this.entry = null;
1396
+ this.customScheduleTime = '';
1397
+ this.today = new Date();
1398
+ this.form = this.fb.group({
1399
+ html: new FormControl(''),
1400
+ });
1401
+ const scheduledDate = new Date();
1402
+ this.customScheduleTime = scheduledDate.getHours() + ':' + scheduledDate.getMinutes() + ' AM';
1403
+ }
1404
+ refreshTags() {
1405
+ this.tagService.get().subscribe((response) => {
1406
+ this.all_tags = map$1(response.results, (t) => t.label);
1407
+ /*
1408
+ this.filtered_tags = this.tagCtrl.valueChanges.pipe(
1409
+ startWith(null),
1410
+ map((tag: string | null) => tag ? this._filter(tag) : this.all_tags.slice()));
1411
+ */
1412
+ });
1413
+ }
1414
+ ngOnInit() {
1415
+ this.refreshTags();
1416
+ this.identityService.getMe().subscribe((me) => {
1417
+ this.me = me;
1418
+ });
1419
+ const savedEntry = localStorage.getItem(EntryCreatorComponent.CURRENT_ENTRY_KEY);
1420
+ if (savedEntry) {
1421
+ this.entry = new Entry(JSON.parse(savedEntry));
1422
+ const newValue = {
1423
+ 'html': this.entryService.convertBlogToHtmlFormat(this.entry)
1424
+ };
1425
+ this.form.patchValue(newValue);
1426
+ }
1427
+ else {
1428
+ this.seeEntries();
1429
+ }
1430
+ this.form.get('html').valueChanges
1431
+ .pipe(debounceTime$1(500))
1432
+ .subscribe(value => {
1433
+ var blogPost = value;
1434
+ this.entry = this.entryService.convertHtmlToBlogFormat(this.entry, blogPost);
1435
+ this.entryService.currentlyEditedEntry.next(this.entry);
1436
+ localStorage.setItem(EntryCreatorComponent.CURRENT_ENTRY_KEY, JSON.stringify(this.entry));
1437
+ });
1438
+ }
1439
+ seeEntries() {
1440
+ const dialogRef = this.dialog.open(EntrySelectorDialogComponent, {
1441
+ width: '800px',
1442
+ data: { name: 'test', animal: 'test' }
1443
+ });
1444
+ dialogRef.afterClosed().subscribe((id) => {
1445
+ if (id) {
1446
+ this.entryService.getUnpublishedById(id).subscribe((result) => {
1447
+ const entry = result;
1448
+ this.entryService.currentlyEditedEntry.next(entry);
1449
+ localStorage.setItem(EntryCreatorComponent.CURRENT_ENTRY_KEY, JSON.stringify(entry));
1450
+ this.entry = entry;
1451
+ const newValue = {
1452
+ 'html': this.entryService.convertBlogToHtmlFormat(this.entry)
1453
+ };
1454
+ this.form.patchValue(newValue);
1455
+ });
1456
+ }
1457
+ });
1458
+ }
1459
+ startNew() {
1460
+ const finish = confirm('Are you sure your finished? The JSON and entry displayed will be removed. Make sure you have already copied it.');
1461
+ if (finish) {
1462
+ this.entry = new Entry();
1463
+ this.entry.title = EntryCreatorComponent.DEFAULT_NEW_ENTRY_TITLE;
1464
+ this.entry.published = false;
1465
+ this.entry.version = 1;
1466
+ this.entryService.currentlyEditedEntry.next(this.entry);
1467
+ localStorage.setItem(EntryCreatorComponent.CURRENT_ENTRY_KEY, JSON.stringify(this.entry));
1468
+ this.entryService.create(this.entry).subscribe((next) => {
1469
+ const newValue = {
1470
+ 'html': this.entryService.convertBlogToHtmlFormat(next)
1471
+ };
1472
+ this.form.patchValue(newValue);
1473
+ });
1474
+ }
1475
+ }
1476
+ postPublishCallback() {
1477
+ this.entryService.currentlyEditedEntry.next(null);
1478
+ this.entry = null;
1479
+ this.seeEntries();
1480
+ localStorage.removeItem(EntryCreatorComponent.CURRENT_ENTRY_KEY);
1481
+ this.form.patchValue({ 'html': '' });
1482
+ }
1483
+ publish() {
1484
+ const publish = confirm('Are you sure you want to publish? Once an article is published it is available to everyone.');
1485
+ if (publish) {
1486
+ this.entry.published = true;
1487
+ this.entry.publish_date = new Date();
1488
+ this.entry.edit_date = new Date();
1489
+ this.entryService.updateUnpublishedEntry(this.entry).subscribe(this.postPublishCallback.bind(this));
1490
+ }
1491
+ }
1492
+ routeTo(path) {
1493
+ this.router.navigateByUrl(path).then(() => {
1494
+ });
1495
+ }
1496
+ displayAlert(something) {
1497
+ alert(something);
1498
+ }
1499
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: EntryWysiwygComponent, deps: [{ token: i1$3.Router }, { token: EntryService }, { token: TagService }, { token: IdentityService }, { token: i1$2.MatDialog }, { token: i1$1.DomSanitizer }, { token: i7.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
1500
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: EntryWysiwygComponent, isStandalone: true, selector: "lib-entry-wysiwyg", providers: [provideNativeDateAdapter()], ngImport: i0, template: "<div class=\"container\" style=\"padding: 20px;\">\n <div style=\"padding: 10px;\">\n <button\n style=\"width: 100%;\"\n mat-raised-button\n (click)=\"routeTo('create(left-col:create//right-col:create)')\">V1</button>\n </div>\n <div>\n <div *ngIf=\"entry\">\n <h2>{{entry?.title}}</h2>\n\n <h3>Posted {{entry?.create_date.toString() | timeAgo}} on {{entry?.create_date?.getMonth() + 1}}/{{entry?.create_date?.getDate()}}/{{entry?.create_date?.getFullYear()}}</h3>\n <h5 *ngIf=\"entry?.showEditInformation()\">Article was last edited {{entry?.edit_date.toString() | timeAgo}}</h5>\n <br>\n <p *ngIf=\"entry?.tags?.length > 0\">Tags: <span *ngFor=\"let tag of entry?.tags; let last = last\">{{tag}}<ng-container *ngIf=\"!last\"> |\n </ng-container></span><span *ngIf=\"entry?.views\">, {{entry._friendly_views}} views</span></p>\n </div>\n\n <div style=\"width: 100%; padding: 10px;\">\n <button\n style=\"width: 24%; margin: 5px;\"\n mat-raised-button\n (click)=\"publish()\"\n >Publish</button>\n\n <button\n style=\"width: 24%; margin: 5px;\"\n mat-raised-button\n (click)=\"seeEntries()\"\n >Entries</button>\n\n <button\n style=\"width: 24%; margin: 5px;\"\n mat-raised-button\n (click)=\"displayAlert('One day...')\"\n >Advanced</button>\n\n <button\n style=\"width: 24%; margin: 5px;\"\n mat-raised-button\n (click)=\"startNew()\"\n >New</button>\n </div>\n </div>\n\n <form [formGroup]=\"form\">\n <quill-editor\n style=\"width: 100%;\"\n format=\"{{format}}\"\n formControlName=\"html\"\n theme=\"bubble\"\n ></quill-editor>\n </form>\n</div>\n", styles: [".create-container{margin-left:auto;margin-right:auto;width:80%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i7.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: QuillEditorComponent, selector: "quill-editor" }, { kind: "pipe", type: TimeAgoPipe, name: "timeAgo" }] }); }
1501
+ }
1502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: EntryWysiwygComponent, decorators: [{
1503
+ type: Component,
1504
+ args: [{ selector: 'lib-entry-wysiwyg', providers: [provideNativeDateAdapter()], imports: [
1505
+ CommonModule,
1506
+ FormsModule,
1507
+ ReactiveFormsModule,
1508
+ MatProgressSpinnerModule,
1509
+ MatButtonModule,
1510
+ QuillEditorComponent,
1511
+ TimeAgoPipe,
1512
+ ], template: "<div class=\"container\" style=\"padding: 20px;\">\n <div style=\"padding: 10px;\">\n <button\n style=\"width: 100%;\"\n mat-raised-button\n (click)=\"routeTo('create(left-col:create//right-col:create)')\">V1</button>\n </div>\n <div>\n <div *ngIf=\"entry\">\n <h2>{{entry?.title}}</h2>\n\n <h3>Posted {{entry?.create_date.toString() | timeAgo}} on {{entry?.create_date?.getMonth() + 1}}/{{entry?.create_date?.getDate()}}/{{entry?.create_date?.getFullYear()}}</h3>\n <h5 *ngIf=\"entry?.showEditInformation()\">Article was last edited {{entry?.edit_date.toString() | timeAgo}}</h5>\n <br>\n <p *ngIf=\"entry?.tags?.length > 0\">Tags: <span *ngFor=\"let tag of entry?.tags; let last = last\">{{tag}}<ng-container *ngIf=\"!last\"> |\n </ng-container></span><span *ngIf=\"entry?.views\">, {{entry._friendly_views}} views</span></p>\n </div>\n\n <div style=\"width: 100%; padding: 10px;\">\n <button\n style=\"width: 24%; margin: 5px;\"\n mat-raised-button\n (click)=\"publish()\"\n >Publish</button>\n\n <button\n style=\"width: 24%; margin: 5px;\"\n mat-raised-button\n (click)=\"seeEntries()\"\n >Entries</button>\n\n <button\n style=\"width: 24%; margin: 5px;\"\n mat-raised-button\n (click)=\"displayAlert('One day...')\"\n >Advanced</button>\n\n <button\n style=\"width: 24%; margin: 5px;\"\n mat-raised-button\n (click)=\"startNew()\"\n >New</button>\n </div>\n </div>\n\n <form [formGroup]=\"form\">\n <quill-editor\n style=\"width: 100%;\"\n format=\"{{format}}\"\n formControlName=\"html\"\n theme=\"bubble\"\n ></quill-editor>\n </form>\n</div>\n", styles: [".create-container{margin-left:auto;margin-right:auto;width:80%}\n"] }]
1513
+ }], ctorParameters: () => [{ type: i1$3.Router }, { type: EntryService }, { type: TagService }, { type: IdentityService }, { type: i1$2.MatDialog }, { type: i1$1.DomSanitizer }, { type: i7.FormBuilder }] });
1514
+
1515
+ class StaticHtmlComponent {
1516
+ constructor(staticHtmlService, domSanitizer) {
1517
+ this.staticHtmlService = staticHtmlService;
1518
+ this.domSanitizer = domSanitizer;
1519
+ }
1520
+ refreshContent() {
1521
+ this.innerHtml = this.domSanitizer.bypassSecurityTrustHtml(this.staticHtmlService.mapStaticHtml(this.value, false));
1522
+ }
1523
+ ngOnChanges(changes) {
1524
+ this.refreshContent();
1525
+ }
1526
+ ngOnInit() {
1527
+ this.refreshContent();
1528
+ }
1529
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: StaticHtmlComponent, deps: [{ token: StaticHtmlService }, { token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
1530
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: StaticHtmlComponent, isStandalone: true, selector: "app-static-html", inputs: { value: "value" }, usesOnChanges: true, ngImport: i0, template: "<div [innerHtml]=\"innerHtml\">\n</div>\n", styles: [""] }); }
1531
+ }
1532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: StaticHtmlComponent, decorators: [{
1533
+ type: Component,
1534
+ args: [{ selector: 'app-static-html', template: "<div [innerHtml]=\"innerHtml\">\n</div>\n" }]
1535
+ }], ctorParameters: () => [{ type: StaticHtmlService }, { type: i1$1.DomSanitizer }], propDecorators: { value: [{
1536
+ type: Input
1537
+ }] } });
1538
+
1408
1539
  class EntryRendererComponent {
1409
1540
  constructor(prismService, ngZone, identityService, commentService, router, entryService) {
1410
1541
  this.prismService = prismService;
@@ -2237,5 +2368,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
2237
2368
  * Generated bundle index. Do not edit.
2238
2369
  */
2239
2370
 
2240
- export { Base, CommentService, Content, ContentType, CoreEvent, CoreEventType, CoreModule, DjangoRestFrameworkEndpointService, Entry, EntryCreatorComponent, EntryRendererComponent, EntryRendererWrapperComponent, EntrySelectorDialogComponent, EntryService, EntrySummaryComponent, Guid, IdentityService, Interaction, InteractionService, JsonRendererComponent, LandingPageComponent, LinkyPipe, ListResponse, MainComponent, MediaUploadModalComponent, OutlineViewComponent, PrismService, Routes, Section, SideNavigationComponent, StaticHtmlComponent, StaticHtmlService, TagService, TimeAgoPipe, Upload, UploadService, Utility, View, ViewService, VisitorProfile, VisitorProfileService };
2371
+ export { Base, CommentService, Content, ContentType, CoreEvent, CoreEventType, CoreModule, DjangoRestFrameworkEndpointService, Entry, EntryCreatorComponent, EntryRendererComponent, EntryRendererWrapperComponent, EntrySelectorDialogComponent, EntryService, EntrySummaryComponent, EntryWysiwygComponent, Guid, IdentityService, Interaction, InteractionService, JsonRendererComponent, LandingPageComponent, LinkyPipe, ListResponse, MainComponent, MediaUploadModalComponent, OutlineViewComponent, PrismService, Routes, Section, SideNavigationComponent, StaticHtmlComponent, StaticHtmlService, TagService, TimeAgoPipe, Upload, UploadService, Utility, View, ViewService, VisitorProfile, VisitorProfileService };
2241
2372
  //# sourceMappingURL=thecodeblogs-blog.mjs.map