@dotcms/angular 1.5.4 → 1.5.5-next.2176
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 +17 -15
- package/fesm2022/dotcms-angular.mjs +319 -62
- package/fesm2022/dotcms-angular.mjs.map +1 -1
- package/lib/components/dotcms-block-editor-renderer/blocks/table.component.d.ts +6 -1
- package/lib/components/dotcms-block-editor-renderer/blocks/table.component.d.ts.map +1 -1
- package/lib/components/dotcms-block-editor-renderer/dotcms-block-editor-renderer.component.d.ts +9 -0
- package/lib/components/dotcms-block-editor-renderer/dotcms-block-editor-renderer.component.d.ts.map +1 -1
- package/lib/components/dotcms-block-editor-renderer-semantic/blocks/semantic-blocks.component.d.ts +40 -0
- package/lib/components/dotcms-block-editor-renderer-semantic/blocks/semantic-blocks.component.d.ts.map +1 -0
- package/lib/components/dotcms-block-editor-renderer-semantic/dotcms-block-editor-renderer-native.component.d.ts +73 -0
- package/lib/components/dotcms-block-editor-renderer-semantic/dotcms-block-editor-renderer-native.component.d.ts.map +1 -0
- package/package.json +2 -2
- package/public_api.d.ts +1 -0
- package/public_api.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ The `@dotcms/angular` SDK is the DotCMS official Angular library. It empowers An
|
|
|
17
17
|
- [SDK Reference](#sdk-reference)
|
|
18
18
|
- [DotCMSLayoutBody](#dotcmslayoutbody)
|
|
19
19
|
- [DotCMSEditableText](#dotcmseditabletext)
|
|
20
|
-
- [
|
|
20
|
+
- [DotCMSBlockEditorRendererNative](#dotcmsblockeditorrenderernative)
|
|
21
21
|
- [DotCMSShowWhen](#dotcmsshowwhen)
|
|
22
22
|
- [DotCMSEditablePageService](#dotcmseditablepageservice)
|
|
23
23
|
- [Troubleshooting](#troubleshooting)
|
|
@@ -537,22 +537,28 @@ export class MyBannerComponent {
|
|
|
537
537
|
- Detects UVE edit mode and enables inline TinyMCE editing
|
|
538
538
|
- Triggers a `Save` [workflow action](https://dev.dotcms.com/docs/workflows) on blur without needing full content dialog.
|
|
539
539
|
|
|
540
|
-
###
|
|
540
|
+
### DotCMSBlockEditorRendererNative
|
|
541
541
|
|
|
542
|
-
`
|
|
542
|
+
`DotCMSBlockEditorRendererNative` is the recommended renderer for [Block Editor](https://dev.dotcms.com/docs/block-editor) content. It emits **clean semantic HTML** — `<ul><li><p>…</p></li></ul>` — with no custom wrapper elements between semantic tags.
|
|
543
|
+
|
|
544
|
+
> The original `DotCMSBlockEditorRenderer` is deprecated and retained for backward compatibility. See the component's TSDoc and [`MIGRATION.md`](./MIGRATION.md#migrating-to-the-semantic-block-editor-renderer) for the migration path — it's a one-line swap.
|
|
545
|
+
|
|
546
|
+
#### Why it matters
|
|
547
|
+
|
|
548
|
+
The host element is the real semantic tag (`<ul>`, `<li>`, `<p>`, `<h1>`–`<h6>`, ...) and recursion is done through `ng-template` outlets that render as HTML comment nodes (invisible to the accessibility tree), so `<li>` stays a true DOM child of `<ul>` — the relationship the HTML spec and assistive technology require, and that accessibility scanners flag when broken. This applies inside table cells and grid columns too: `<td><ul><li>…` stays intact.
|
|
543
549
|
|
|
544
550
|
| Input | Type | Required | Description |
|
|
545
551
|
|-------------------|----------------------|----------|------------------------------------------------------------------------------------------------------------|
|
|
546
|
-
| `blocks` | `
|
|
547
|
-
| `customRenderers` | `CustomRenderer`
|
|
548
|
-
| `
|
|
549
|
-
| `style` | `
|
|
552
|
+
| `blocks` | `BlockEditorNode` | ✅ | The [Block Editor](https://dev.dotcms.com/docs/block-editor) content to render |
|
|
553
|
+
| `customRenderers` | `CustomRenderer` | ❌ | Custom rendering functions for specific [block types](https://dev.dotcms.com/docs/block-editor#BlockTypes) |
|
|
554
|
+
| `class` | `string` | ❌ | CSS class to apply to the container |
|
|
555
|
+
| `style` | `string \| Record<string, string>` | ❌ | Inline styles for the container |
|
|
550
556
|
|
|
551
557
|
#### Usage
|
|
552
558
|
|
|
553
559
|
```typescript
|
|
554
560
|
import { DotCMSBasicContentlet } from '@dotcms/types';
|
|
555
|
-
import {
|
|
561
|
+
import { DotCMSBlockEditorRendererNativeComponent } from '@dotcms/angular';
|
|
556
562
|
|
|
557
563
|
const CUSTOM_RENDERERS = {
|
|
558
564
|
customBlock: import('./custom-block.component').then((c) => c.CustomBlockComponent),
|
|
@@ -561,9 +567,9 @@ const CUSTOM_RENDERERS = {
|
|
|
561
567
|
|
|
562
568
|
@Component({
|
|
563
569
|
selector: 'app-your-component',
|
|
564
|
-
imports: [
|
|
570
|
+
imports: [DotCMSBlockEditorRendererNativeComponent],
|
|
565
571
|
template: `
|
|
566
|
-
<dotcms-block-editor-renderer
|
|
572
|
+
<dotcms-block-editor-renderer-native
|
|
567
573
|
[blocks]="contentlet.myBlockEditorField"
|
|
568
574
|
[customRenderers]="customRenderers()" />
|
|
569
575
|
`
|
|
@@ -576,12 +582,8 @@ export class MyBannerComponent {
|
|
|
576
582
|
|
|
577
583
|
#### Recommendations
|
|
578
584
|
|
|
579
|
-
- Should not be used with [`DotCMSEditableText`](#dotcmseditabletext)
|
|
585
|
+
- Should not be used with [`DotCMSEditableText`](#dotcmseditabletext).
|
|
580
586
|
- Take into account the CSS cascade can affect the look and feel of your blocks.
|
|
581
|
-
- `DotCMSBlockEditorRenderer` only works with [Block Editor fields](https://dev.dotcms.com/docs/block-editor). For other fields, use [`DotCMSEditableText`](#dotcmseditabletext).
|
|
582
|
-
|
|
583
|
-
📘 For advanced examples, customization options, and best practices, refer to the [DotCMSBlockEditorRenderer README](https://github.com/dotCMS/core/tree/master/core-web/libs/sdk/angular/src/lib/components/DotCMSBlockEditorRenderer).
|
|
584
|
-
|
|
585
587
|
|
|
586
588
|
### DotCMSShowWhen
|
|
587
589
|
|