@dotcms/angular 0.0.1-beta.15 → 0.0.1-beta.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/esm2022/lib/deprecated/utils/image_loader.mjs +1 -2
- package/esm2022/next/components/dotcms-block-editor-renderer/blocks/code.component.mjs +49 -0
- package/esm2022/next/components/dotcms-block-editor-renderer/blocks/contentlet.component.mjs +53 -0
- package/esm2022/next/components/dotcms-block-editor-renderer/blocks/image.component.mjs +25 -0
- package/esm2022/next/components/dotcms-block-editor-renderer/blocks/list.component.mjs +66 -0
- package/esm2022/next/components/dotcms-block-editor-renderer/blocks/table.component.mjs +97 -0
- package/esm2022/next/components/dotcms-block-editor-renderer/blocks/text.component.mjs +231 -0
- package/esm2022/next/components/dotcms-block-editor-renderer/blocks/video.components.mjs +48 -0
- package/esm2022/next/components/dotcms-block-editor-renderer/dotcms-block-editor-renderer.component.mjs +46 -0
- package/esm2022/next/components/dotcms-block-editor-renderer/item/dotcms-block-editor-item.component.mjs +43 -0
- package/esm2022/next/public_api.mjs +2 -1
- package/fesm2022/dotcms-angular-next.mjs +634 -4
- package/fesm2022/dotcms-angular-next.mjs.map +1 -1
- package/fesm2022/dotcms-angular.mjs +0 -1
- package/fesm2022/dotcms-angular.mjs.map +1 -1
- package/next/components/dotcms-block-editor-renderer/blocks/code.component.d.ts +10 -0
- package/next/components/dotcms-block-editor-renderer/blocks/code.component.d.ts.map +1 -0
- package/next/components/dotcms-block-editor-renderer/blocks/contentlet.component.d.ts +25 -0
- package/next/components/dotcms-block-editor-renderer/blocks/contentlet.component.d.ts.map +1 -0
- package/next/components/dotcms-block-editor-renderer/blocks/image.component.d.ts +9 -0
- package/next/components/dotcms-block-editor-renderer/blocks/image.component.d.ts.map +1 -0
- package/next/components/dotcms-block-editor-renderer/blocks/list.component.d.ts +14 -0
- package/next/components/dotcms-block-editor-renderer/blocks/list.component.d.ts.map +1 -0
- package/next/components/dotcms-block-editor-renderer/blocks/table.component.d.ts +10 -0
- package/next/components/dotcms-block-editor-renderer/blocks/table.component.d.ts.map +1 -0
- package/next/components/dotcms-block-editor-renderer/blocks/text.component.d.ts +27 -0
- package/next/components/dotcms-block-editor-renderer/blocks/text.component.d.ts.map +1 -0
- package/next/components/dotcms-block-editor-renderer/blocks/video.components.d.ts +10 -0
- package/next/components/dotcms-block-editor-renderer/blocks/video.components.d.ts.map +1 -0
- package/next/components/dotcms-block-editor-renderer/dotcms-block-editor-renderer.component.d.ts +37 -0
- package/next/components/dotcms-block-editor-renderer/dotcms-block-editor-renderer.component.d.ts.map +1 -0
- package/next/components/dotcms-block-editor-renderer/item/dotcms-block-editor-item.component.d.ts +12 -0
- package/next/components/dotcms-block-editor-renderer/item/dotcms-block-editor-item.component.d.ts.map +1 -0
- package/next/public_api.d.ts +1 -0
- package/next/public_api.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ViewContainerRef, TemplateRef, Directive, Input, Renderer2, ElementRef, SecurityContext, Component, ViewChild, HostListener, ChangeDetectionStrategy,
|
|
2
|
+
import { inject, ViewContainerRef, TemplateRef, Directive, Input, Renderer2, ElementRef, SecurityContext, Component, ViewChild, HostListener, ChangeDetectionStrategy, computed, signal, Injectable, HostBinding } from '@angular/core';
|
|
3
3
|
import { getUVEState } from '@dotcms/uve';
|
|
4
4
|
import { UVE_MODE } from '@dotcms/uve/types';
|
|
5
|
-
import { IMAGE_LOADER,
|
|
5
|
+
import { IMAGE_LOADER, NgComponentOutlet, AsyncPipe, NgTemplateOutlet, NgStyle } from '@angular/common';
|
|
6
6
|
import { TINYMCE_SCRIPT_SRC, EditorComponent } from '@tinymce/tinymce-angular';
|
|
7
7
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
8
8
|
import { NOTIFY_CLIENT, isInsideEditor, DotCmsClient, postMessageToEditor, CLIENT_ACTIONS } from '@dotcms/client';
|
|
9
|
-
import { PRODUCTION_MODE, DEVELOPMENT_MODE, EMPTY_CONTAINER_STYLE_ANGULAR, getDotContentletAttributes, CUSTOM_NO_COMPONENT, getDotContainerAttributes, getContainersData, getContentletsInContainer, getColumnPositionClasses, combineClasses } from '@dotcms/uve/internal';
|
|
9
|
+
import { Blocks, isValidBlocks, PRODUCTION_MODE, DEVELOPMENT_MODE, EMPTY_CONTAINER_STYLE_ANGULAR, getDotContentletAttributes, CUSTOM_NO_COMPONENT, getDotContainerAttributes, getContainersData, getContentletsInContainer, getColumnPositionClasses, combineClasses } from '@dotcms/uve/internal';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Directive to show a template when the UVE is in a specific mode.
|
|
@@ -388,6 +388,636 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImpor
|
|
|
388
388
|
args: ['window:message', ['$event']]
|
|
389
389
|
}] } });
|
|
390
390
|
|
|
391
|
+
class DotCodeBlock {
|
|
392
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotCodeBlock, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
393
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: DotCodeBlock, isStandalone: true, selector: "dotcms-block-editor-renderer-code-block", ngImport: i0, template: `
|
|
394
|
+
<pre>
|
|
395
|
+
<code>
|
|
396
|
+
<ng-content />
|
|
397
|
+
</code>
|
|
398
|
+
</pre>
|
|
399
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
400
|
+
}
|
|
401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotCodeBlock, decorators: [{
|
|
402
|
+
type: Component,
|
|
403
|
+
args: [{
|
|
404
|
+
selector: 'dotcms-block-editor-renderer-code-block',
|
|
405
|
+
standalone: true,
|
|
406
|
+
template: `
|
|
407
|
+
<pre>
|
|
408
|
+
<code>
|
|
409
|
+
<ng-content />
|
|
410
|
+
</code>
|
|
411
|
+
</pre>
|
|
412
|
+
`,
|
|
413
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
414
|
+
}]
|
|
415
|
+
}] });
|
|
416
|
+
class DotBlockQuote {
|
|
417
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotBlockQuote, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
418
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: DotBlockQuote, isStandalone: true, selector: "dotcms-block-editor-renderer-block-quote", ngImport: i0, template: `
|
|
419
|
+
<blockquote>
|
|
420
|
+
<ng-content />
|
|
421
|
+
</blockquote>
|
|
422
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
423
|
+
}
|
|
424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotBlockQuote, decorators: [{
|
|
425
|
+
type: Component,
|
|
426
|
+
args: [{
|
|
427
|
+
selector: 'dotcms-block-editor-renderer-block-quote',
|
|
428
|
+
standalone: true,
|
|
429
|
+
template: `
|
|
430
|
+
<blockquote>
|
|
431
|
+
<ng-content />
|
|
432
|
+
</blockquote>
|
|
433
|
+
`,
|
|
434
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
435
|
+
}]
|
|
436
|
+
}] });
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Default component for unknown content type
|
|
440
|
+
*/
|
|
441
|
+
class DotDefaultContentBlock {
|
|
442
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotDefaultContentBlock, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
443
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: DotDefaultContentBlock, selector: "dot-default-content", inputs: { contentlet: "contentlet" }, ngImport: i0, template: '<div>Unknown Content Type: {{ contentlet?.contentType }}</div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
444
|
+
}
|
|
445
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotDefaultContentBlock, decorators: [{
|
|
446
|
+
type: Component,
|
|
447
|
+
args: [{
|
|
448
|
+
selector: 'dot-default-content',
|
|
449
|
+
template: '<div>Unknown Content Type: {{ contentlet?.contentType }}</div>',
|
|
450
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
451
|
+
}]
|
|
452
|
+
}], propDecorators: { contentlet: [{
|
|
453
|
+
type: Input
|
|
454
|
+
}] } });
|
|
455
|
+
/**
|
|
456
|
+
* DotContent component that renders content based on content type
|
|
457
|
+
*/
|
|
458
|
+
class DotContentletBlock {
|
|
459
|
+
constructor() {
|
|
460
|
+
this.$data = computed(() => this.attrs?.['data']);
|
|
461
|
+
}
|
|
462
|
+
ngOnInit() {
|
|
463
|
+
if (!this.$data()) {
|
|
464
|
+
console.error('DotCMSBlockEditorRendererContentlet: No data provided');
|
|
465
|
+
}
|
|
466
|
+
this.contentComponent =
|
|
467
|
+
this.customRenderers?.[this.$data()?.contentType] ??
|
|
468
|
+
Promise.resolve().then(function () { return contentlet_component; }).then((m) => m.DotDefaultContentBlock);
|
|
469
|
+
}
|
|
470
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotContentletBlock, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
471
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: DotContentletBlock, isStandalone: true, selector: "dotcms-block-editor-renderer-contentlet", inputs: { customRenderers: "customRenderers", attrs: "attrs" }, ngImport: i0, template: '<ng-container *ngComponentOutlet="contentComponent | async; inputs: { contentlet: $data() }"></ng-container>', isInline: true, dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
472
|
+
}
|
|
473
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotContentletBlock, decorators: [{
|
|
474
|
+
type: Component,
|
|
475
|
+
args: [{
|
|
476
|
+
selector: 'dotcms-block-editor-renderer-contentlet',
|
|
477
|
+
standalone: true,
|
|
478
|
+
imports: [NgComponentOutlet, AsyncPipe],
|
|
479
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
480
|
+
template: '<ng-container *ngComponentOutlet="contentComponent | async; inputs: { contentlet: $data() }"></ng-container>'
|
|
481
|
+
}]
|
|
482
|
+
}], propDecorators: { customRenderers: [{
|
|
483
|
+
type: Input
|
|
484
|
+
}], attrs: [{
|
|
485
|
+
type: Input
|
|
486
|
+
}] } });
|
|
487
|
+
|
|
488
|
+
var contentlet_component = /*#__PURE__*/Object.freeze({
|
|
489
|
+
__proto__: null,
|
|
490
|
+
DotContentletBlock: DotContentletBlock,
|
|
491
|
+
DotDefaultContentBlock: DotDefaultContentBlock
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
class DotImageBlock {
|
|
495
|
+
constructor() {
|
|
496
|
+
this.$srcURL = computed(() => this.attrs?.['src']);
|
|
497
|
+
}
|
|
498
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotImageBlock, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
499
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: DotImageBlock, isStandalone: true, selector: "dotcms-block-editor-renderer-image", inputs: { attrs: "attrs" }, ngImport: i0, template: `
|
|
500
|
+
<img [alt]="attrs?.['alt']" [src]="$srcURL()" />
|
|
501
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
502
|
+
}
|
|
503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotImageBlock, decorators: [{
|
|
504
|
+
type: Component,
|
|
505
|
+
args: [{
|
|
506
|
+
selector: 'dotcms-block-editor-renderer-image',
|
|
507
|
+
standalone: true,
|
|
508
|
+
template: `
|
|
509
|
+
<img [alt]="attrs?.['alt']" [src]="$srcURL()" />
|
|
510
|
+
`,
|
|
511
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
512
|
+
}]
|
|
513
|
+
}], propDecorators: { attrs: [{
|
|
514
|
+
type: Input
|
|
515
|
+
}] } });
|
|
516
|
+
|
|
517
|
+
class DotBulletList {
|
|
518
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotBulletList, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
519
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: DotBulletList, isStandalone: true, selector: "dotcms-block-editor-renderer-bullet-list", ngImport: i0, template: `
|
|
520
|
+
<ul>
|
|
521
|
+
<ng-content />
|
|
522
|
+
</ul>
|
|
523
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
524
|
+
}
|
|
525
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotBulletList, decorators: [{
|
|
526
|
+
type: Component,
|
|
527
|
+
args: [{
|
|
528
|
+
selector: 'dotcms-block-editor-renderer-bullet-list',
|
|
529
|
+
standalone: true,
|
|
530
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
531
|
+
template: `
|
|
532
|
+
<ul>
|
|
533
|
+
<ng-content />
|
|
534
|
+
</ul>
|
|
535
|
+
`
|
|
536
|
+
}]
|
|
537
|
+
}] });
|
|
538
|
+
class DotOrdererList {
|
|
539
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotOrdererList, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
540
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: DotOrdererList, isStandalone: true, selector: "dotcms-block-editor-renderer-ordered-list", ngImport: i0, template: `
|
|
541
|
+
<ol>
|
|
542
|
+
<ng-content />
|
|
543
|
+
</ol>
|
|
544
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
545
|
+
}
|
|
546
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotOrdererList, decorators: [{
|
|
547
|
+
type: Component,
|
|
548
|
+
args: [{
|
|
549
|
+
selector: 'dotcms-block-editor-renderer-ordered-list',
|
|
550
|
+
standalone: true,
|
|
551
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
552
|
+
template: `
|
|
553
|
+
<ol>
|
|
554
|
+
<ng-content />
|
|
555
|
+
</ol>
|
|
556
|
+
`
|
|
557
|
+
}]
|
|
558
|
+
}] });
|
|
559
|
+
class DotListItem {
|
|
560
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotListItem, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
561
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: DotListItem, isStandalone: true, selector: "dotcms-block-editor-renderer-list-item", ngImport: i0, template: `
|
|
562
|
+
<li>
|
|
563
|
+
<ng-content />
|
|
564
|
+
</li>
|
|
565
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
566
|
+
}
|
|
567
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotListItem, decorators: [{
|
|
568
|
+
type: Component,
|
|
569
|
+
args: [{
|
|
570
|
+
selector: 'dotcms-block-editor-renderer-list-item',
|
|
571
|
+
standalone: true,
|
|
572
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
573
|
+
template: `
|
|
574
|
+
<li>
|
|
575
|
+
<ng-content />
|
|
576
|
+
</li>
|
|
577
|
+
`
|
|
578
|
+
}]
|
|
579
|
+
}] });
|
|
580
|
+
|
|
581
|
+
class DotTableBlock {
|
|
582
|
+
constructor() {
|
|
583
|
+
this.blockEditorItem = DotCMSBlockEditorItemComponent;
|
|
584
|
+
}
|
|
585
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotTableBlock, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
586
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: DotTableBlock, isStandalone: true, selector: "dotcms-block-editor-renderer-table", inputs: { content: "content" }, ngImport: i0, template: `
|
|
587
|
+
<table>
|
|
588
|
+
<thead>
|
|
589
|
+
@for (rowNode of content?.slice(0, 1); track rowNode.type) {
|
|
590
|
+
<tr>
|
|
591
|
+
@for (cellNode of rowNode.content; track cellNode.type) {
|
|
592
|
+
<th
|
|
593
|
+
[attr.colspan]="cellNode.attrs?.['colspan'] || 1"
|
|
594
|
+
[attr.rowspan]="cellNode.attrs?.['rowspan'] || 1">
|
|
595
|
+
<ng-container
|
|
596
|
+
*ngComponentOutlet="
|
|
597
|
+
blockEditorItem;
|
|
598
|
+
inputs: { content: cellNode.content }
|
|
599
|
+
"></ng-container>
|
|
600
|
+
</th>
|
|
601
|
+
}
|
|
602
|
+
</tr>
|
|
603
|
+
}
|
|
604
|
+
</thead>
|
|
605
|
+
<tbody>
|
|
606
|
+
@for (rowNode of content?.slice(1); track rowNode.type) {
|
|
607
|
+
<tr>
|
|
608
|
+
@for (cellNode of rowNode.content; track cellNode.type) {
|
|
609
|
+
<td
|
|
610
|
+
[attr.colspan]="cellNode.attrs?.['colspan'] || 1"
|
|
611
|
+
[attr.rowspan]="cellNode.attrs?.['rowspan'] || 1">
|
|
612
|
+
<ng-container
|
|
613
|
+
*ngComponentOutlet="
|
|
614
|
+
blockEditorItem;
|
|
615
|
+
inputs: { content: cellNode.content }
|
|
616
|
+
"></ng-container>
|
|
617
|
+
</td>
|
|
618
|
+
}
|
|
619
|
+
</tr>
|
|
620
|
+
}
|
|
621
|
+
</tbody>
|
|
622
|
+
</table>
|
|
623
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }] }); }
|
|
624
|
+
}
|
|
625
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotTableBlock, decorators: [{
|
|
626
|
+
type: Component,
|
|
627
|
+
args: [{
|
|
628
|
+
selector: 'dotcms-block-editor-renderer-table',
|
|
629
|
+
standalone: true,
|
|
630
|
+
imports: [NgComponentOutlet],
|
|
631
|
+
template: `
|
|
632
|
+
<table>
|
|
633
|
+
<thead>
|
|
634
|
+
@for (rowNode of content?.slice(0, 1); track rowNode.type) {
|
|
635
|
+
<tr>
|
|
636
|
+
@for (cellNode of rowNode.content; track cellNode.type) {
|
|
637
|
+
<th
|
|
638
|
+
[attr.colspan]="cellNode.attrs?.['colspan'] || 1"
|
|
639
|
+
[attr.rowspan]="cellNode.attrs?.['rowspan'] || 1">
|
|
640
|
+
<ng-container
|
|
641
|
+
*ngComponentOutlet="
|
|
642
|
+
blockEditorItem;
|
|
643
|
+
inputs: { content: cellNode.content }
|
|
644
|
+
"></ng-container>
|
|
645
|
+
</th>
|
|
646
|
+
}
|
|
647
|
+
</tr>
|
|
648
|
+
}
|
|
649
|
+
</thead>
|
|
650
|
+
<tbody>
|
|
651
|
+
@for (rowNode of content?.slice(1); track rowNode.type) {
|
|
652
|
+
<tr>
|
|
653
|
+
@for (cellNode of rowNode.content; track cellNode.type) {
|
|
654
|
+
<td
|
|
655
|
+
[attr.colspan]="cellNode.attrs?.['colspan'] || 1"
|
|
656
|
+
[attr.rowspan]="cellNode.attrs?.['rowspan'] || 1">
|
|
657
|
+
<ng-container
|
|
658
|
+
*ngComponentOutlet="
|
|
659
|
+
blockEditorItem;
|
|
660
|
+
inputs: { content: cellNode.content }
|
|
661
|
+
"></ng-container>
|
|
662
|
+
</td>
|
|
663
|
+
}
|
|
664
|
+
</tr>
|
|
665
|
+
}
|
|
666
|
+
</tbody>
|
|
667
|
+
</table>
|
|
668
|
+
`
|
|
669
|
+
}]
|
|
670
|
+
}], propDecorators: { content: [{
|
|
671
|
+
type: Input
|
|
672
|
+
}] } });
|
|
673
|
+
|
|
674
|
+
class DotParagraphBlock {
|
|
675
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotParagraphBlock, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
676
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: DotParagraphBlock, isStandalone: true, selector: "dotcms-block-editor-renderer-paragraph", ngImport: i0, template: `
|
|
677
|
+
<p>
|
|
678
|
+
<ng-content />
|
|
679
|
+
</p>
|
|
680
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
681
|
+
}
|
|
682
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotParagraphBlock, decorators: [{
|
|
683
|
+
type: Component,
|
|
684
|
+
args: [{
|
|
685
|
+
selector: 'dotcms-block-editor-renderer-paragraph',
|
|
686
|
+
standalone: true,
|
|
687
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
688
|
+
template: `
|
|
689
|
+
<p>
|
|
690
|
+
<ng-content />
|
|
691
|
+
</p>
|
|
692
|
+
`
|
|
693
|
+
}]
|
|
694
|
+
}] });
|
|
695
|
+
class DotHeadingBlock {
|
|
696
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotHeadingBlock, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
697
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: DotHeadingBlock, isStandalone: true, selector: "dotcms-block-editor-renderer-heading", inputs: { level: "level" }, ngImport: i0, template: `
|
|
698
|
+
@switch (level) {
|
|
699
|
+
@case ('1') {
|
|
700
|
+
<h1>
|
|
701
|
+
<ng-content />
|
|
702
|
+
</h1>
|
|
703
|
+
}
|
|
704
|
+
@case ('2') {
|
|
705
|
+
<h2>
|
|
706
|
+
<ng-content />
|
|
707
|
+
</h2>
|
|
708
|
+
}
|
|
709
|
+
@case ('3') {
|
|
710
|
+
<h3>
|
|
711
|
+
<ng-content />
|
|
712
|
+
</h3>
|
|
713
|
+
}
|
|
714
|
+
@case ('4') {
|
|
715
|
+
<h4>
|
|
716
|
+
<ng-content />
|
|
717
|
+
</h4>
|
|
718
|
+
}
|
|
719
|
+
@case ('5') {
|
|
720
|
+
<h5>
|
|
721
|
+
<ng-content />
|
|
722
|
+
</h5>
|
|
723
|
+
}
|
|
724
|
+
@case ('6') {
|
|
725
|
+
<h6>
|
|
726
|
+
<ng-content />
|
|
727
|
+
</h6>
|
|
728
|
+
}
|
|
729
|
+
@default {
|
|
730
|
+
<h1>
|
|
731
|
+
<ng-content />
|
|
732
|
+
</h1>
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
736
|
+
}
|
|
737
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotHeadingBlock, decorators: [{
|
|
738
|
+
type: Component,
|
|
739
|
+
args: [{
|
|
740
|
+
selector: 'dotcms-block-editor-renderer-heading',
|
|
741
|
+
standalone: true,
|
|
742
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
743
|
+
template: `
|
|
744
|
+
@switch (level) {
|
|
745
|
+
@case ('1') {
|
|
746
|
+
<h1>
|
|
747
|
+
<ng-content />
|
|
748
|
+
</h1>
|
|
749
|
+
}
|
|
750
|
+
@case ('2') {
|
|
751
|
+
<h2>
|
|
752
|
+
<ng-content />
|
|
753
|
+
</h2>
|
|
754
|
+
}
|
|
755
|
+
@case ('3') {
|
|
756
|
+
<h3>
|
|
757
|
+
<ng-content />
|
|
758
|
+
</h3>
|
|
759
|
+
}
|
|
760
|
+
@case ('4') {
|
|
761
|
+
<h4>
|
|
762
|
+
<ng-content />
|
|
763
|
+
</h4>
|
|
764
|
+
}
|
|
765
|
+
@case ('5') {
|
|
766
|
+
<h5>
|
|
767
|
+
<ng-content />
|
|
768
|
+
</h5>
|
|
769
|
+
}
|
|
770
|
+
@case ('6') {
|
|
771
|
+
<h6>
|
|
772
|
+
<ng-content />
|
|
773
|
+
</h6>
|
|
774
|
+
}
|
|
775
|
+
@default {
|
|
776
|
+
<h1>
|
|
777
|
+
<ng-content />
|
|
778
|
+
</h1>
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
`
|
|
782
|
+
}]
|
|
783
|
+
}], propDecorators: { level: [{
|
|
784
|
+
type: Input
|
|
785
|
+
}] } });
|
|
786
|
+
class DotTextBlock {
|
|
787
|
+
constructor() {
|
|
788
|
+
this.marks = [];
|
|
789
|
+
this.text = '';
|
|
790
|
+
this.$remainingMarks = computed(() => this.marks?.slice(1));
|
|
791
|
+
this.$currentAttrs = computed(() => {
|
|
792
|
+
const attrs = { ...(this.marks?.[0]?.attrs || {}) };
|
|
793
|
+
if (attrs['class']) {
|
|
794
|
+
attrs['className'] = attrs['class'];
|
|
795
|
+
delete attrs['class'];
|
|
796
|
+
}
|
|
797
|
+
return attrs;
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotTextBlock, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
801
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: DotTextBlock, isStandalone: true, selector: "dotcms-block-editor-renderer-text", inputs: { marks: "marks", text: "text" }, ngImport: i0, template: `
|
|
802
|
+
@switch (marks?.[0]?.type) {
|
|
803
|
+
@case ('link') {
|
|
804
|
+
<a
|
|
805
|
+
[attr.href]="$currentAttrs()['href'] || ''"
|
|
806
|
+
[attr.target]="$currentAttrs()['target'] || ''">
|
|
807
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
808
|
+
</a>
|
|
809
|
+
}
|
|
810
|
+
@case ('bold') {
|
|
811
|
+
<strong>
|
|
812
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
813
|
+
</strong>
|
|
814
|
+
}
|
|
815
|
+
@case ('underline') {
|
|
816
|
+
<u>
|
|
817
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
818
|
+
</u>
|
|
819
|
+
}
|
|
820
|
+
@case ('italic') {
|
|
821
|
+
<em>
|
|
822
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
823
|
+
</em>
|
|
824
|
+
}
|
|
825
|
+
@case ('strike') {
|
|
826
|
+
<s>
|
|
827
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
828
|
+
</s>
|
|
829
|
+
}
|
|
830
|
+
@case ('superscript') {
|
|
831
|
+
<sup>
|
|
832
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
833
|
+
</sup>
|
|
834
|
+
}
|
|
835
|
+
@case ('subscript') {
|
|
836
|
+
<sub>
|
|
837
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
838
|
+
</sub>
|
|
839
|
+
}
|
|
840
|
+
@default {
|
|
841
|
+
{{ text }}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DotTextBlock, selector: "dotcms-block-editor-renderer-text", inputs: ["marks", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
845
|
+
}
|
|
846
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotTextBlock, decorators: [{
|
|
847
|
+
type: Component,
|
|
848
|
+
args: [{
|
|
849
|
+
selector: 'dotcms-block-editor-renderer-text',
|
|
850
|
+
standalone: true,
|
|
851
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
852
|
+
template: `
|
|
853
|
+
@switch (marks?.[0]?.type) {
|
|
854
|
+
@case ('link') {
|
|
855
|
+
<a
|
|
856
|
+
[attr.href]="$currentAttrs()['href'] || ''"
|
|
857
|
+
[attr.target]="$currentAttrs()['target'] || ''">
|
|
858
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
859
|
+
</a>
|
|
860
|
+
}
|
|
861
|
+
@case ('bold') {
|
|
862
|
+
<strong>
|
|
863
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
864
|
+
</strong>
|
|
865
|
+
}
|
|
866
|
+
@case ('underline') {
|
|
867
|
+
<u>
|
|
868
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
869
|
+
</u>
|
|
870
|
+
}
|
|
871
|
+
@case ('italic') {
|
|
872
|
+
<em>
|
|
873
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
874
|
+
</em>
|
|
875
|
+
}
|
|
876
|
+
@case ('strike') {
|
|
877
|
+
<s>
|
|
878
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
879
|
+
</s>
|
|
880
|
+
}
|
|
881
|
+
@case ('superscript') {
|
|
882
|
+
<sup>
|
|
883
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
884
|
+
</sup>
|
|
885
|
+
}
|
|
886
|
+
@case ('subscript') {
|
|
887
|
+
<sub>
|
|
888
|
+
<dotcms-block-editor-renderer-text [marks]="$remainingMarks()" [text]="text" />
|
|
889
|
+
</sub>
|
|
890
|
+
}
|
|
891
|
+
@default {
|
|
892
|
+
{{ text }}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
`
|
|
896
|
+
}]
|
|
897
|
+
}], propDecorators: { marks: [{
|
|
898
|
+
type: Input
|
|
899
|
+
}], text: [{
|
|
900
|
+
type: Input
|
|
901
|
+
}] } });
|
|
902
|
+
|
|
903
|
+
class DotVideoBlock {
|
|
904
|
+
constructor() {
|
|
905
|
+
this.$srcURL = computed(() => this.attrs?.['src']);
|
|
906
|
+
this.$posterURL = computed(() => this.attrs?.['data']?.['thumbnail']);
|
|
907
|
+
}
|
|
908
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotVideoBlock, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
909
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: DotVideoBlock, isStandalone: true, selector: "dotcms-block-editor-renderer-video", inputs: { attrs: "attrs" }, ngImport: i0, template: `
|
|
910
|
+
<video
|
|
911
|
+
[controls]="true"
|
|
912
|
+
preload="metadata"
|
|
913
|
+
[poster]="this.$posterURL()"
|
|
914
|
+
[width]="attrs?.['width']"
|
|
915
|
+
[height]="attrs?.['height']">
|
|
916
|
+
<track default kind="captions" srclang="en" />
|
|
917
|
+
<source [src]="this.$srcURL()" [type]="attrs?.['mimeType']" />
|
|
918
|
+
Your browser does not support the
|
|
919
|
+
<code>video</code>
|
|
920
|
+
element.
|
|
921
|
+
</video>
|
|
922
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
923
|
+
}
|
|
924
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotVideoBlock, decorators: [{
|
|
925
|
+
type: Component,
|
|
926
|
+
args: [{
|
|
927
|
+
selector: 'dotcms-block-editor-renderer-video',
|
|
928
|
+
standalone: true,
|
|
929
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
930
|
+
template: `
|
|
931
|
+
<video
|
|
932
|
+
[controls]="true"
|
|
933
|
+
preload="metadata"
|
|
934
|
+
[poster]="this.$posterURL()"
|
|
935
|
+
[width]="attrs?.['width']"
|
|
936
|
+
[height]="attrs?.['height']">
|
|
937
|
+
<track default kind="captions" srclang="en" />
|
|
938
|
+
<source [src]="this.$srcURL()" [type]="attrs?.['mimeType']" />
|
|
939
|
+
Your browser does not support the
|
|
940
|
+
<code>video</code>
|
|
941
|
+
element.
|
|
942
|
+
</video>
|
|
943
|
+
`
|
|
944
|
+
}]
|
|
945
|
+
}], propDecorators: { attrs: [{
|
|
946
|
+
type: Input
|
|
947
|
+
}] } });
|
|
948
|
+
|
|
949
|
+
class DotCMSBlockEditorItemComponent {
|
|
950
|
+
constructor() {
|
|
951
|
+
this.BLOCKS = Blocks;
|
|
952
|
+
}
|
|
953
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotCMSBlockEditorItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
954
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: DotCMSBlockEditorItemComponent, isStandalone: true, selector: "dotcms-block-editor-renderer-block", inputs: { content: "content", customRenderers: "customRenderers" }, ngImport: i0, template: "@for (node of content; track node) {\n @if (customRenderers?.[node.type]) {\n <ng-container\n *ngTemplateOutlet=\"\n customRender;\n context: { customRender: customRenderers?.[node.type], node: node }\n \"></ng-container>\n } @else {\n @switch (node.type) {\n @case (BLOCKS.PARAGRAPH) {\n <dotcms-block-editor-renderer-paragraph [style]=\"node.attrs\">\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-paragraph>\n }\n\n @case (BLOCKS.TEXT) {\n <dotcms-block-editor-renderer-text [marks]=\"node.marks\" [text]=\"node.text || ''\" />\n }\n\n @case (BLOCKS.HEADING) {\n <dotcms-block-editor-renderer-heading\n [style]=\"node.attrs || {}\"\n [level]=\"node.attrs?.['level'] || '1'\">\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-heading>\n }\n\n @case (BLOCKS.BULLET_LIST) {\n <dotcms-block-editor-renderer-bullet-list>\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-bullet-list>\n }\n\n @case (BLOCKS.ORDERED_LIST) {\n <dotcms-block-editor-renderer-ordered-list>\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-ordered-list>\n }\n\n @case (BLOCKS.LIST_ITEM) {\n <dotcms-block-editor-renderer-list-item>\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-list-item>\n }\n\n @case (BLOCKS.BLOCK_QUOTE) {\n <dotcms-block-editor-renderer-block-quote>\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-block-quote>\n }\n\n @case (BLOCKS.CODE_BLOCK) {\n <dotcms-block-editor-renderer-code-block>\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-code-block>\n }\n\n @case (BLOCKS.HARDBREAK) {\n <br />\n }\n\n @case (BLOCKS.HORIZONTAL_RULE) {\n <hr />\n }\n\n @case (BLOCKS.DOT_IMAGE) {\n <dotcms-block-editor-renderer-image [attrs]=\"node.attrs || {}\" />\n }\n\n @case (BLOCKS.DOT_VIDEO) {\n <dotcms-block-editor-renderer-video [attrs]=\"node.attrs || {}\" />\n }\n\n @case (BLOCKS.TABLE) {\n <dotcms-block-editor-renderer-table [content]=\"node.content\" />\n }\n\n @case (BLOCKS.DOT_CONTENT) {\n <dotcms-block-editor-renderer-contentlet\n [attrs]=\"node.attrs || {}\"\n [customRenderers]=\"customRenderers\" />\n }\n\n @default {\n <div>Unknown Block Type: {{ node.type }}</div>\n }\n }\n }\n}\n\n<ng-template #customRender let-customRender=\"customRender\" let-node=\"node\">\n <ng-container\n *ngComponentOutlet=\"customRender | async; inputs: { content: node }\"></ng-container>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "component", type: DotCMSBlockEditorItemComponent, selector: "dotcms-block-editor-renderer-block", inputs: ["content", "customRenderers"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: DotParagraphBlock, selector: "dotcms-block-editor-renderer-paragraph" }, { kind: "component", type: DotTextBlock, selector: "dotcms-block-editor-renderer-text", inputs: ["marks", "text"] }, { kind: "component", type: DotHeadingBlock, selector: "dotcms-block-editor-renderer-heading", inputs: ["level"] }, { kind: "component", type: DotBulletList, selector: "dotcms-block-editor-renderer-bullet-list" }, { kind: "component", type: DotOrdererList, selector: "dotcms-block-editor-renderer-ordered-list" }, { kind: "component", type: DotListItem, selector: "dotcms-block-editor-renderer-list-item" }, { kind: "component", type: DotCodeBlock, selector: "dotcms-block-editor-renderer-code-block" }, { kind: "component", type: DotBlockQuote, selector: "dotcms-block-editor-renderer-block-quote" }, { kind: "component", type: DotImageBlock, selector: "dotcms-block-editor-renderer-image", inputs: ["attrs"] }, { kind: "component", type: DotVideoBlock, selector: "dotcms-block-editor-renderer-video", inputs: ["attrs"] }, { kind: "component", type: DotTableBlock, selector: "dotcms-block-editor-renderer-table", inputs: ["content"] }, { kind: "component", type: DotContentletBlock, selector: "dotcms-block-editor-renderer-contentlet", inputs: ["customRenderers", "attrs"] }] }); }
|
|
955
|
+
}
|
|
956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotCMSBlockEditorItemComponent, decorators: [{
|
|
957
|
+
type: Component,
|
|
958
|
+
args: [{ selector: 'dotcms-block-editor-renderer-block', standalone: true, imports: [
|
|
959
|
+
NgTemplateOutlet,
|
|
960
|
+
NgComponentOutlet,
|
|
961
|
+
AsyncPipe,
|
|
962
|
+
DotParagraphBlock,
|
|
963
|
+
DotTextBlock,
|
|
964
|
+
DotHeadingBlock,
|
|
965
|
+
DotBulletList,
|
|
966
|
+
DotOrdererList,
|
|
967
|
+
DotListItem,
|
|
968
|
+
DotCodeBlock,
|
|
969
|
+
DotBlockQuote,
|
|
970
|
+
DotImageBlock,
|
|
971
|
+
DotVideoBlock,
|
|
972
|
+
DotTableBlock,
|
|
973
|
+
DotContentletBlock
|
|
974
|
+
], template: "@for (node of content; track node) {\n @if (customRenderers?.[node.type]) {\n <ng-container\n *ngTemplateOutlet=\"\n customRender;\n context: { customRender: customRenderers?.[node.type], node: node }\n \"></ng-container>\n } @else {\n @switch (node.type) {\n @case (BLOCKS.PARAGRAPH) {\n <dotcms-block-editor-renderer-paragraph [style]=\"node.attrs\">\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-paragraph>\n }\n\n @case (BLOCKS.TEXT) {\n <dotcms-block-editor-renderer-text [marks]=\"node.marks\" [text]=\"node.text || ''\" />\n }\n\n @case (BLOCKS.HEADING) {\n <dotcms-block-editor-renderer-heading\n [style]=\"node.attrs || {}\"\n [level]=\"node.attrs?.['level'] || '1'\">\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-heading>\n }\n\n @case (BLOCKS.BULLET_LIST) {\n <dotcms-block-editor-renderer-bullet-list>\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-bullet-list>\n }\n\n @case (BLOCKS.ORDERED_LIST) {\n <dotcms-block-editor-renderer-ordered-list>\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-ordered-list>\n }\n\n @case (BLOCKS.LIST_ITEM) {\n <dotcms-block-editor-renderer-list-item>\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-list-item>\n }\n\n @case (BLOCKS.BLOCK_QUOTE) {\n <dotcms-block-editor-renderer-block-quote>\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-block-quote>\n }\n\n @case (BLOCKS.CODE_BLOCK) {\n <dotcms-block-editor-renderer-code-block>\n <dotcms-block-editor-renderer-block\n [content]=\"node.content\"\n [customRenderers]=\"customRenderers\" />\n </dotcms-block-editor-renderer-code-block>\n }\n\n @case (BLOCKS.HARDBREAK) {\n <br />\n }\n\n @case (BLOCKS.HORIZONTAL_RULE) {\n <hr />\n }\n\n @case (BLOCKS.DOT_IMAGE) {\n <dotcms-block-editor-renderer-image [attrs]=\"node.attrs || {}\" />\n }\n\n @case (BLOCKS.DOT_VIDEO) {\n <dotcms-block-editor-renderer-video [attrs]=\"node.attrs || {}\" />\n }\n\n @case (BLOCKS.TABLE) {\n <dotcms-block-editor-renderer-table [content]=\"node.content\" />\n }\n\n @case (BLOCKS.DOT_CONTENT) {\n <dotcms-block-editor-renderer-contentlet\n [attrs]=\"node.attrs || {}\"\n [customRenderers]=\"customRenderers\" />\n }\n\n @default {\n <div>Unknown Block Type: {{ node.type }}</div>\n }\n }\n }\n}\n\n<ng-template #customRender let-customRender=\"customRender\" let-node=\"node\">\n <ng-container\n *ngComponentOutlet=\"customRender | async; inputs: { content: node }\"></ng-container>\n</ng-template>\n" }]
|
|
975
|
+
}], propDecorators: { content: [{
|
|
976
|
+
type: Input
|
|
977
|
+
}], customRenderers: [{
|
|
978
|
+
type: Input
|
|
979
|
+
}] } });
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* A component that renders content from DotCMS's Block Editor field.
|
|
983
|
+
*
|
|
984
|
+
* This component provides an easy way to render Block Editor content in your Angular applications.
|
|
985
|
+
* It handles the rendering of standard blocks and allows customization through custom renderers.
|
|
986
|
+
*
|
|
987
|
+
* For more information about Block Editor, see {@link https://dev.dotcms.com/docs/block-editor}
|
|
988
|
+
*
|
|
989
|
+
* @example
|
|
990
|
+
* ```html
|
|
991
|
+
* <dotcms-block-editor-renderer
|
|
992
|
+
* [blocks]="myBlockEditorContent"
|
|
993
|
+
* [customRenderers]="myCustomRenderers">
|
|
994
|
+
* </dotcms-block-editor-renderer>
|
|
995
|
+
* ```
|
|
996
|
+
*/
|
|
997
|
+
class DotCMSBlockEditorRendererComponent {
|
|
998
|
+
constructor() {
|
|
999
|
+
this.$blockEditorState = signal({ error: null });
|
|
1000
|
+
this.$isInEditMode = signal(getUVEState()?.mode === UVE_MODE.EDIT);
|
|
1001
|
+
}
|
|
1002
|
+
ngOnInit() {
|
|
1003
|
+
const state = isValidBlocks(this.blocks);
|
|
1004
|
+
if (state.error) {
|
|
1005
|
+
console.error('Error in dotcms-block-editor-renderer: ', state.error);
|
|
1006
|
+
}
|
|
1007
|
+
this.$blockEditorState.set(isValidBlocks(this.blocks));
|
|
1008
|
+
}
|
|
1009
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotCMSBlockEditorRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1010
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.3", type: DotCMSBlockEditorRendererComponent, isStandalone: true, selector: "dotcms-block-editor-renderer", inputs: { blocks: "blocks", customRenderers: "customRenderers" }, ngImport: i0, template: "@if ($blockEditorState().error && $isInEditMode()) {\n <div data-testid=\"invalid-blocks-message\">\n {{ $blockEditorState().error }}\n </div>\n} @else if (!$blockEditorState().error) {\n <dotcms-block-editor-renderer-block\n [content]=\"blocks.content\"\n [customRenderers]=\"customRenderers\" />\n}\n", styles: [""], dependencies: [{ kind: "component", type: DotCMSBlockEditorItemComponent, selector: "dotcms-block-editor-renderer-block", inputs: ["content", "customRenderers"] }] }); }
|
|
1011
|
+
}
|
|
1012
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: DotCMSBlockEditorRendererComponent, decorators: [{
|
|
1013
|
+
type: Component,
|
|
1014
|
+
args: [{ selector: 'dotcms-block-editor-renderer', standalone: true, imports: [DotCMSBlockEditorItemComponent], template: "@if ($blockEditorState().error && $isInEditMode()) {\n <div data-testid=\"invalid-blocks-message\">\n {{ $blockEditorState().error }}\n </div>\n} @else if (!$blockEditorState().error) {\n <dotcms-block-editor-renderer-block\n [content]=\"blocks.content\"\n [customRenderers]=\"customRenderers\" />\n}\n" }]
|
|
1015
|
+
}], propDecorators: { blocks: [{
|
|
1016
|
+
type: Input
|
|
1017
|
+
}], customRenderers: [{
|
|
1018
|
+
type: Input
|
|
1019
|
+
}] } });
|
|
1020
|
+
|
|
391
1021
|
/**
|
|
392
1022
|
* @description This component is used to display a message when a page is missing the required `layout.body` property.
|
|
393
1023
|
* @internal
|
|
@@ -1008,5 +1638,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImpor
|
|
|
1008
1638
|
* Generated bundle index. Do not edit.
|
|
1009
1639
|
*/
|
|
1010
1640
|
|
|
1011
|
-
export { DotCMSEditableTextComponent, DotCMSLayoutBodyComponent, DotCMSShowWhenDirective, provideDotCMSImageLoader };
|
|
1641
|
+
export { DotCMSBlockEditorRendererComponent, DotCMSEditableTextComponent, DotCMSLayoutBodyComponent, DotCMSShowWhenDirective, provideDotCMSImageLoader };
|
|
1012
1642
|
//# sourceMappingURL=dotcms-angular-next.mjs.map
|