@daffodil/design 0.91.0 → 0.92.3-rc.1

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.
Files changed (142) hide show
  1. package/accordion/README.md +26 -38
  2. package/accordion/index.d.ts +2 -2
  3. package/article/README.md +66 -46
  4. package/article/index.d.ts +22 -1
  5. package/article/src/article-theme.scss +12 -0
  6. package/breadcrumb/README.md +6 -1
  7. package/breadcrumb/index.d.ts +65 -11
  8. package/breadcrumb/src/breadcrumb-theme.scss +1 -1
  9. package/button/README.md +36 -33
  10. package/button/index.d.ts +26 -5
  11. package/button/src/button/basic/button-theme.scss +4 -2
  12. package/button/src/button/button-base.scss +26 -3
  13. package/button/src/button/icon/icon-theme.scss +10 -6
  14. package/button/src/button/raised/raised-theme.scss +4 -2
  15. package/callout/README.md +15 -27
  16. package/card/README.md +36 -61
  17. package/container/README.md +18 -23
  18. package/fesm2022/daffodil-design-accordion.mjs +13 -13
  19. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  20. package/fesm2022/daffodil-design-article.mjs +168 -26
  21. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-breadcrumb.mjs +180 -28
  23. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-button.mjs +83 -42
  25. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-callout.mjs +23 -23
  27. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-card.mjs +33 -33
  29. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-checkbox.mjs +13 -13
  31. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-container.mjs +8 -8
  33. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  34. package/fesm2022/daffodil-design-form-field.mjs +26 -26
  35. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-form.mjs +9 -9
  37. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-hero.mjs +23 -23
  39. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-image.mjs +8 -8
  41. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  42. package/fesm2022/daffodil-design-input.mjs +18 -14
  43. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-link-set.mjs +25 -17
  45. package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-list.mjs +16 -16
  47. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-loading-icon.mjs +8 -8
  49. package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
  51. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  52. package/fesm2022/daffodil-design-menu.mjs +223 -60
  53. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  54. package/fesm2022/daffodil-design-modal.mjs +33 -29
  55. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  56. package/fesm2022/daffodil-design-native-select.mjs +47 -41
  57. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  58. package/fesm2022/daffodil-design-navbar.mjs +25 -21
  59. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-notification.mjs +16 -16
  61. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-paginator.mjs +7 -7
  63. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  64. package/fesm2022/daffodil-design-progress-bar.mjs +10 -10
  65. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  66. package/fesm2022/daffodil-design-quantity-field.mjs +17 -14
  67. package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
  68. package/fesm2022/daffodil-design-radio.mjs +16 -16
  69. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  70. package/fesm2022/daffodil-design-select.mjs +6 -6
  71. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  72. package/fesm2022/daffodil-design-sidebar.mjs +25 -25
  73. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  74. package/fesm2022/daffodil-design-spinner.mjs +99 -0
  75. package/fesm2022/daffodil-design-spinner.mjs.map +1 -0
  76. package/fesm2022/daffodil-design-switch.mjs +3 -3
  77. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  78. package/fesm2022/daffodil-design-tabs.mjs +15 -15
  79. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  80. package/fesm2022/daffodil-design-tag.mjs +7 -7
  81. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  82. package/fesm2022/daffodil-design-text-snippet.mjs +6 -8
  83. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  84. package/fesm2022/daffodil-design-textarea.mjs +6 -3
  85. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  86. package/fesm2022/daffodil-design-toast.mjs +23 -25
  87. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  88. package/fesm2022/daffodil-design-tree.mjs +152 -103
  89. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  90. package/fesm2022/daffodil-design-youtube-player.mjs +6 -6
  91. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  92. package/fesm2022/daffodil-design.mjs +385 -326
  93. package/fesm2022/daffodil-design.mjs.map +1 -1
  94. package/form-field/README.md +50 -85
  95. package/form-field/index.d.ts +11 -9
  96. package/hero/README.md +5 -5
  97. package/image/README.md +2 -2
  98. package/index.d.ts +184 -270
  99. package/input/README.md +4 -4
  100. package/input/index.d.ts +4 -3
  101. package/link-set/index.d.ts +9 -1
  102. package/list/README.md +2 -2
  103. package/loading-icon/README.md +1 -1
  104. package/loading-icon/index.d.ts +1 -1
  105. package/media-gallery/README.md +3 -3
  106. package/menu/README.md +107 -10
  107. package/menu/index.d.ts +143 -11
  108. package/modal/README.md +1 -1
  109. package/modal/index.d.ts +23 -15
  110. package/native-select/README.md +4 -4
  111. package/native-select/index.d.ts +8 -7
  112. package/navbar/README.md +23 -17
  113. package/navbar/index.d.ts +12 -2
  114. package/navbar/src/navbar-theme.scss +4 -46
  115. package/notification/README.md +4 -4
  116. package/package.json +1 -1
  117. package/paginator/README.md +42 -6
  118. package/paginator/index.d.ts +4 -2
  119. package/progress-bar/README.md +3 -3
  120. package/quantity-field/README.md +4 -4
  121. package/quantity-field/index.d.ts +4 -1
  122. package/radio/README.md +1 -1
  123. package/scss/theme.scss +7 -1
  124. package/scss/theming/_color-palettes.scss +0 -6
  125. package/select/README.md +4 -4
  126. package/sidebar/README.md +6 -6
  127. package/spinner/README.md +57 -0
  128. package/spinner/index.d.ts +53 -0
  129. package/spinner/src/spinner-theme.scss +62 -0
  130. package/switch/README.md +4 -4
  131. package/switch/index.d.ts +2 -2
  132. package/tabs/README.md +1 -1
  133. package/tabs/index.d.ts +2 -2
  134. package/tag/README.md +24 -30
  135. package/tag/index.d.ts +1 -1
  136. package/text-snippet/README.md +1 -1
  137. package/text-snippet/src/text-snippet-theme.scss +12 -0
  138. package/textarea/README.md +4 -4
  139. package/textarea/index.d.ts +4 -4
  140. package/toast/README.md +4 -4
  141. package/tree/README.md +39 -22
  142. package/tree/index.d.ts +57 -90
@@ -1,10 +1,13 @@
1
- import { CommonModule } from '@angular/common';
1
+ import { DOCUMENT, isPlatformBrowser, CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { input, signal, inject, NgZone, ChangeDetectionStrategy, Component, Injectable, ElementRef, ViewContainerRef, afterEveryRender, DestroyRef, ViewEncapsulation, Directive, NgModule } from '@angular/core';
3
+ import { input, signal, inject, NgZone, ChangeDetectionStrategy, Component, Injectable, PLATFORM_ID, ElementRef, ViewContainerRef, afterEveryRender, DestroyRef, ViewEncapsulation, Directive, NgModule } from '@angular/core';
4
4
  import { FaIconComponent } from '@fortawesome/angular-fontawesome';
5
- import { faCopy, faCheck } from '@fortawesome/free-solid-svg-icons';
5
+ import { faCopy, faCheck, faLink } from '@fortawesome/free-solid-svg-icons';
6
6
  import * as i1 from '@daffodil/design/button';
7
7
  import { DAFF_ICON_BUTTON_COMPONENTS } from '@daffodil/design/button';
8
+ import { Router, RouterLink } from '@angular/router';
9
+ import * as i1$1 from '@daffodil/design';
10
+ import { DaffArticleEncapsulatedDirective } from '@daffodil/design';
8
11
 
9
12
  /**
10
13
  * DaffArticleCopyButtonComponent is a button that copies text content to the clipboard.
@@ -48,16 +51,16 @@ class DaffArticleCopyButtonComponent {
48
51
  get ariaLabel() {
49
52
  return this.copied() ? 'Copied to clipboard' : 'Copy to clipboard';
50
53
  }
51
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleCopyButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
52
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: DaffArticleCopyButtonComponent, isStandalone: true, selector: "daff-article-copy-button", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<button\n daff-icon-button\n class=\"daff-article__copy-button\"\n size=\"sm\"\n type=\"button\"\n [attr.aria-label]=\"ariaLabel\"\n (click)=\"copyToClipboard()\">\n @if (copied()) {\n <fa-icon [icon]=\"faCheck\" />\n } @else {\n <fa-icon [icon]=\"faCopy\" />\n }\n</button>\n", styles: [":host{display:block;position:absolute;top:.25rem;right:.25rem;z-index:1}\n"], dependencies: [{ kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }, { kind: "component", type: i1.DaffIconButtonComponent, selector: "button[daff-icon-button],a[daff-icon-button]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
54
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleCopyButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
55
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffArticleCopyButtonComponent, isStandalone: true, selector: "daff-article-copy-button", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<button\n daff-icon-button\n class=\"daff-article__copy-button\"\n size=\"sm\"\n type=\"button\"\n [attr.aria-label]=\"ariaLabel\"\n (click)=\"copyToClipboard()\">\n @if (copied()) {\n <fa-icon [icon]=\"faCheck\" />\n } @else {\n <fa-icon [icon]=\"faCopy\" />\n }\n</button>\n", styles: [":host{display:block;position:absolute;top:.25rem;right:.25rem;z-index:1}\n"], dependencies: [{ kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }, { kind: "component", type: i1.DaffIconButtonComponent, selector: "button[daff-icon-button],a[daff-icon-button]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
53
56
  }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleCopyButtonComponent, decorators: [{
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleCopyButtonComponent, decorators: [{
55
58
  type: Component,
56
59
  args: [{ selector: 'daff-article-copy-button', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
57
60
  FaIconComponent,
58
61
  DAFF_ICON_BUTTON_COMPONENTS,
59
62
  ], template: "<button\n daff-icon-button\n class=\"daff-article__copy-button\"\n size=\"sm\"\n type=\"button\"\n [attr.aria-label]=\"ariaLabel\"\n (click)=\"copyToClipboard()\">\n @if (copied()) {\n <fa-icon [icon]=\"faCheck\" />\n } @else {\n <fa-icon [icon]=\"faCopy\" />\n }\n</button>\n", styles: [":host{display:block;position:absolute;top:.25rem;right:.25rem;z-index:1}\n"] }]
60
- }] });
63
+ }], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }] } });
61
64
 
62
65
  class DaffArticleCopyButtonService {
63
66
  constructor() {
@@ -71,6 +74,7 @@ class DaffArticleCopyButtonService {
71
74
  */
72
75
  addCopyButtonsToCodeBlocks(hostElement, viewContainerRef) {
73
76
  const codeBlocks = hostElement.querySelectorAll('pre');
77
+ const encapsulatedElements = Array.from(hostElement.querySelectorAll('.daff-ae'));
74
78
  codeBlocks.forEach((pre) => {
75
79
  const code = pre.querySelector('code');
76
80
  if (!code) {
@@ -80,6 +84,10 @@ class DaffArticleCopyButtonService {
80
84
  if (pre.hasAttribute('nocopy')) {
81
85
  return;
82
86
  }
87
+ // Skip if inside an article-encapsulated component
88
+ if (encapsulatedElements.some(ee => ee.contains(pre))) {
89
+ return;
90
+ }
83
91
  // Skip if already has a copy button
84
92
  if (pre.querySelector('daff-article-copy-button')) {
85
93
  return;
@@ -105,49 +113,183 @@ class DaffArticleCopyButtonService {
105
113
  });
106
114
  this.buttons = [];
107
115
  }
108
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleCopyButtonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
109
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleCopyButtonService }); }
116
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleCopyButtonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
117
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleCopyButtonService }); }
110
118
  }
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleCopyButtonService, decorators: [{
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleCopyButtonService, decorators: [{
120
+ type: Injectable
121
+ }] });
122
+
123
+ class DaffArticleHeadingLinkComponent {
124
+ constructor() {
125
+ this.fragment = input.required(...(ngDevMode ? [{ debugName: "fragment" }] : []));
126
+ this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
127
+ this.copied = signal(false, ...(ngDevMode ? [{ debugName: "copied" }] : []));
128
+ this.faLink = faLink; // default link icon
129
+ this.faCheck = faCheck; // check icon for copied state
130
+ this._ngZone = inject(NgZone);
131
+ this._router = inject(Router);
132
+ this._platformId = inject(PLATFORM_ID);
133
+ this._document = inject(DOCUMENT);
134
+ }
135
+ ngOnDestroy() {
136
+ if (this.timeoutId) {
137
+ clearTimeout(this.timeoutId);
138
+ }
139
+ }
140
+ async copyLink() {
141
+ if (!isPlatformBrowser(this._platformId)) {
142
+ return;
143
+ }
144
+ try {
145
+ // Get the URL to fragment
146
+ const currentUrl = this._router.url.split('#')[0]; // Remove existing fragment if any
147
+ const fullUrl = `${this._document.defaultView?.location.origin || ''}${currentUrl}#${this.fragment()}`;
148
+ // Write full URL to clipboard
149
+ await navigator.clipboard.writeText(fullUrl);
150
+ this.copied.set(true);
151
+ clearTimeout(this.timeoutId);
152
+ this._ngZone.runOutsideAngular(() => {
153
+ this.timeoutId = setTimeout(() => {
154
+ this._ngZone.run(() => this.copied.set(false));
155
+ }, 1500);
156
+ });
157
+ }
158
+ catch (err) {
159
+ console.error('Failed to copy text: ', err);
160
+ }
161
+ }
162
+ get ariaLabel() {
163
+ return this.copied() ? 'Copied link to clipboard' : 'Copy link to clipboard';
164
+ }
165
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleHeadingLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
166
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffArticleHeadingLinkComponent, isStandalone: true, selector: "daff-article-heading-link", inputs: { fragment: { classPropertyName: "fragment", publicName: "fragment", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: i1$1.DaffArticleEncapsulatedDirective }], ngImport: i0, template: "<a class=\"daff-article-heading-link__anchor\" routerLink=\".\" [fragment]=\"fragment()\" queryParamsHandling=\"preserve\">\n\t{{ label() }}\n</a>\n<button class=\"daff-article-heading-link__button\" [attr.aria-label]=\"ariaLabel\" (click)=\"copyLink()\">\n\t@if (copied()) {\n\t\t<fa-icon [icon]=\"faCheck\"></fa-icon>\n\t} @else {\n\t\t<fa-icon [icon]=\"faLink\"></fa-icon>\n\t}\n</button>\n", styles: [":host{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}:host:hover .daff-article-heading-link__button{opacity:1}.daff-article-heading-link__anchor{text-decoration:none}.daff-article-heading-link__button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;background:none;border:none;font-size:1rem;opacity:0;margin:0;padding:0;height:1.5rem;width:1.5rem;transition:opacity .2s ease}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
167
+ }
168
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleHeadingLinkComponent, decorators: [{
169
+ type: Component,
170
+ args: [{ selector: 'daff-article-heading-link', changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
171
+ { directive: DaffArticleEncapsulatedDirective },
172
+ ], imports: [
173
+ RouterLink,
174
+ FaIconComponent,
175
+ DAFF_ICON_BUTTON_COMPONENTS,
176
+ ], template: "<a class=\"daff-article-heading-link__anchor\" routerLink=\".\" [fragment]=\"fragment()\" queryParamsHandling=\"preserve\">\n\t{{ label() }}\n</a>\n<button class=\"daff-article-heading-link__button\" [attr.aria-label]=\"ariaLabel\" (click)=\"copyLink()\">\n\t@if (copied()) {\n\t\t<fa-icon [icon]=\"faCheck\"></fa-icon>\n\t} @else {\n\t\t<fa-icon [icon]=\"faLink\"></fa-icon>\n\t}\n</button>\n", styles: [":host{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}:host:hover .daff-article-heading-link__button{opacity:1}.daff-article-heading-link__anchor{text-decoration:none}.daff-article-heading-link__button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;background:none;border:none;font-size:1rem;opacity:0;margin:0;padding:0;height:1.5rem;width:1.5rem;transition:opacity .2s ease}\n"] }]
177
+ }], propDecorators: { fragment: [{ type: i0.Input, args: [{ isSignal: true, alias: "fragment", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
178
+
179
+ class DaffArticleHeadingLinkService {
180
+ constructor() {
181
+ this.links = [];
182
+ }
183
+ /**
184
+ * Finds all h2, h3, and h4 elements and wraps their text content with heading link components.
185
+ * @param hostElement - The host element to search for heading elements.
186
+ * @param viewContainerRef - The view container to create the heading link components.
187
+ */
188
+ addLinksToHeadings(hostElement, viewContainerRef) {
189
+ const headings = hostElement.querySelectorAll('h2, h3, h4');
190
+ const encapsulatedElements = Array.from(hostElement.querySelectorAll('.daff-ae'));
191
+ headings.forEach((heading) => {
192
+ if (heading.querySelector('daff-article-heading-link')) {
193
+ return;
194
+ }
195
+ // Skip if nolink attribute is present
196
+ if (heading.hasAttribute('nolink')) {
197
+ return;
198
+ }
199
+ // Skip if inside an article-encapsulated component
200
+ if (encapsulatedElements.some(ee => ee.contains(heading))) {
201
+ return;
202
+ }
203
+ const textContent = heading.textContent?.trim() || '';
204
+ const fragment = heading.id || this.generateFragment(textContent);
205
+ // Set the id on the heading if it doesn't have one
206
+ if (!heading.id) {
207
+ heading.id = fragment;
208
+ }
209
+ // Create the heading link component and set its inputs
210
+ const linkRef = viewContainerRef.createComponent(DaffArticleHeadingLinkComponent);
211
+ linkRef.setInput('fragment', fragment);
212
+ linkRef.setInput('label', textContent);
213
+ // Clear the heading's content and append the link component
214
+ heading.innerHTML = '';
215
+ heading.appendChild(linkRef.location.nativeElement);
216
+ this.links.push({
217
+ linkRef,
218
+ headingElement: heading,
219
+ });
220
+ });
221
+ }
222
+ /**
223
+ * Cleanup heading link references
224
+ */
225
+ cleanup() {
226
+ this.links.forEach(({ linkRef }) => {
227
+ linkRef.destroy();
228
+ });
229
+ this.links = [];
230
+ }
231
+ /**
232
+ * Generates a URL-friendly fragment from heading text
233
+ */
234
+ generateFragment(text) {
235
+ return text
236
+ .toLowerCase()
237
+ .replace(/[^\w\s-]/g, '')
238
+ .replace(/\s+/g, '-')
239
+ .replace(/-+/g, '-')
240
+ .trim();
241
+ }
242
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleHeadingLinkService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
243
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleHeadingLinkService }); }
244
+ }
245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleHeadingLinkService, decorators: [{
112
246
  type: Injectable
113
247
  }] });
114
248
 
115
- /* eslint-disable quote-props */
116
249
  /**
117
250
  * A component for creating articles within your page.
118
251
  */
119
252
  class DaffArticleComponent {
120
- constructor(copyButtonService) {
253
+ constructor(copyButtonService, headingLinkService) {
121
254
  this.copyButtonService = copyButtonService;
255
+ this.headingLinkService = headingLinkService;
122
256
  const elementRef = inject((ElementRef));
123
257
  const viewContainerRef = inject(ViewContainerRef);
124
258
  afterEveryRender({
125
259
  write: () => {
126
260
  this.copyButtonService.addCopyButtonsToCodeBlocks(elementRef.nativeElement, viewContainerRef);
261
+ this.headingLinkService.addLinksToHeadings(elementRef.nativeElement, viewContainerRef);
127
262
  },
128
263
  });
129
264
  const destroyRef = inject(DestroyRef);
130
265
  destroyRef.onDestroy(() => {
131
266
  this.copyButtonService.cleanup();
267
+ this.headingLinkService.cleanup();
132
268
  });
133
269
  }
134
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleComponent, deps: [{ token: DaffArticleCopyButtonService }], target: i0.ɵɵFactoryTarget.Component }); }
135
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffArticleComponent, isStandalone: true, selector: "daff-article", host: { attributes: { "role": "article" }, classAttribute: "daff-article" }, providers: [DaffArticleCopyButtonService], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [".daff-article{display:block;overflow:hidden}.daff-article a:not(.daff-ae *,.daff-ae){font-weight:500;text-decoration:none}.daff-article a:not(.daff-ae *,.daff-ae):hover{text-decoration:underline}.daff-article a:not(.daff-ae *,.daff-ae) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae *,.daff-ae),.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){font-weight:600;margin-bottom:1rem;word-wrap:break-word}.daff-article h1:not(.daff-ae *,.daff-ae) code,.daff-article h2:not(.daff-ae *,.daff-ae) code,.daff-article h3:not(.daff-ae *,.daff-ae) code,.daff-article h4:not(.daff-ae *,.daff-ae) code,.daff-article h5:not(.daff-ae *,.daff-ae) code,.daff-article h6:not(.daff-ae *,.daff-ae) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae *,.daff-ae){word-break:break-all;font-size:2rem;font-weight:600;line-height:2.25rem}@media (min-width: 768px){.daff-article h1:not(.daff-ae *,.daff-ae){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.125rem;line-height:1.5rem;font-weight:400}.daff-article h1:not(.daff-ae *,.daff-ae)+p code{font-size:1rem;line-height:1rem}@media (min-width: 768px){.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.25rem;font-weight:400;line-height:1.75rem}}.daff-article h2:not(.daff-ae *,.daff-ae){font-size:1.75rem;line-height:2rem;margin-top:2.5rem}@media (min-width: 768px){.daff-article h2:not(.daff-ae *,.daff-ae){font-size:2rem;line-height:2.5rem}}.daff-article h3:not(.daff-ae *,.daff-ae){font-size:1.5rem;line-height:2rem;margin-top:2.5rem}.daff-article h4:not(.daff-ae *,.daff-ae){font-size:1.25rem;line-height:1.5rem;margin-top:2rem}.daff-article h5:not(.daff-ae *,.daff-ae){font-size:1.125rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article h6:not(.daff-ae *,.daff-ae){font-size:1rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article p:not(.daff-ae *,.daff-ae){margin:0 0 1rem}.daff-article strong{font-weight:600}.daff-article pre{border-radius:.25rem;position:relative}.daff-article pre:last-child{margin-bottom:0}.daff-article pre code{display:block;line-height:1.5rem;font-size:.875rem;overflow-x:auto;padding:1.5rem}.daff-article code{border-radius:.25rem;font-size:.875rem;line-height:1rem;padding:.125rem .25rem}.daff-article__meta{font-size:.875rem}.daff-article hr{border:0;height:1px;margin:2rem 0}.daff-article blockquote{border-radius:.25rem;margin:1.5rem 0;padding:1rem}@media (min-width: 768px){.daff-article blockquote{padding:1rem 1.5rem}}.daff-article blockquote:last-child{margin-bottom:0}.daff-article blockquote cite{font-size:.875rem;font-weight:400;line-height:1.25rem;display:block;margin-top:1rem}.daff-article blockquote p:last-of-type{margin:0}.daff-article table{display:table;border-collapse:separate;border-spacing:0;border-radius:.25rem;font-size:1rem;line-height:1.25rem;margin:1.5rem 0;overflow:hidden}.daff-article table:last-child{margin-bottom:0}.daff-article table th{font-weight:600;outline:0;padding:1rem;text-align:left;vertical-align:top;box-sizing:border-box}.daff-article table td{padding:1rem;vertical-align:top;box-sizing:border-box}.daff-article table td p:only-child,.daff-article table td p:last-child{margin:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
270
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleComponent, deps: [{ token: DaffArticleCopyButtonService }, { token: DaffArticleHeadingLinkService }], target: i0.ɵɵFactoryTarget.Component }); }
271
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffArticleComponent, isStandalone: true, selector: "daff-article", host: { attributes: { "role": "article" }, classAttribute: "daff-article" }, providers: [
272
+ DaffArticleCopyButtonService,
273
+ DaffArticleHeadingLinkService,
274
+ ], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [".daff-article{display:block;overflow:hidden}.daff-article a:not(.daff-ae *,.daff-ae){font-weight:500;text-decoration:none}.daff-article a:not(.daff-ae *,.daff-ae):hover{text-decoration:underline}.daff-article a:not(.daff-ae *,.daff-ae) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae *,.daff-ae),.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){font-weight:600;margin-bottom:1rem;overflow-wrap:break-word}.daff-article h1:not(.daff-ae *,.daff-ae) code,.daff-article h2:not(.daff-ae *,.daff-ae) code,.daff-article h3:not(.daff-ae *,.daff-ae) code,.daff-article h4:not(.daff-ae *,.daff-ae) code,.daff-article h5:not(.daff-ae *,.daff-ae) code,.daff-article h6:not(.daff-ae *,.daff-ae) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae *,.daff-ae){word-break:break-all;font-size:2rem;font-weight:600;line-height:2.25rem}@media(min-width:768px){.daff-article h1:not(.daff-ae *,.daff-ae){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.125rem;line-height:1.5rem;font-weight:400}.daff-article h1:not(.daff-ae *,.daff-ae)+p code{font-size:1rem;line-height:1rem}@media(min-width:768px){.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.25rem;font-weight:400;line-height:1.75rem}}.daff-article h2:not(.daff-ae *,.daff-ae){font-size:1.75rem;line-height:2rem;margin-top:2.5rem}@media(min-width:768px){.daff-article h2:not(.daff-ae *,.daff-ae){font-size:2rem;line-height:2.5rem}}.daff-article h2:not(.daff-ae *,.daff-ae):first-child{margin-top:0}.daff-article h3:not(.daff-ae *,.daff-ae){font-size:1.5rem;line-height:2rem;margin-top:2.5rem}.daff-article h4:not(.daff-ae *,.daff-ae){font-size:1.25rem;line-height:1.5rem;margin-top:2rem}.daff-article h5:not(.daff-ae *,.daff-ae){font-size:1.125rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article h6:not(.daff-ae *,.daff-ae){font-size:1rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article p:not(.daff-ae *,.daff-ae){margin:0 0 1rem}.daff-article strong{font-weight:600}.daff-article pre{border-radius:.5rem;position:relative}.daff-article pre:last-child{margin-bottom:0}.daff-article pre code{display:block;line-height:1.5rem;font-size:.875rem;overflow-x:auto;padding:1.5rem}.daff-article code{border-radius:.25rem;font-size:.875rem;line-height:1rem;padding:.125rem .25rem}.daff-article__meta{font-size:.875rem}.daff-article hr{border:0;height:1px;margin:2rem 0}.daff-article blockquote{border-radius:.25rem;margin:1.5rem 0;padding:1rem}@media(min-width:768px){.daff-article blockquote{padding:1rem 1.5rem}}.daff-article blockquote:last-child{margin-bottom:0}.daff-article blockquote cite{font-size:.875rem;font-weight:400;line-height:1.25rem;display:block;margin-top:1rem}.daff-article blockquote p:last-of-type{margin:0}.daff-article table{display:table;border-collapse:separate;border-spacing:0;border-radius:.25rem;font-size:1rem;line-height:1.25rem;margin:1.5rem 0;overflow:hidden}.daff-article table:last-child{margin-bottom:0}.daff-article table th{font-weight:600;outline:0;padding:1rem;text-align:left;vertical-align:top;box-sizing:border-box}.daff-article table td{padding:1rem;vertical-align:top;box-sizing:border-box}.daff-article table td p:only-child,.daff-article table td p:last-child{margin:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
136
275
  }
137
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleComponent, decorators: [{
276
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleComponent, decorators: [{
138
277
  type: Component,
139
278
  args: [{ selector: 'daff-article', template: '<ng-content></ng-content>', host: {
140
- 'class': 'daff-article',
141
- 'role': 'article',
142
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [DaffArticleCopyButtonService], styles: [".daff-article{display:block;overflow:hidden}.daff-article a:not(.daff-ae *,.daff-ae){font-weight:500;text-decoration:none}.daff-article a:not(.daff-ae *,.daff-ae):hover{text-decoration:underline}.daff-article a:not(.daff-ae *,.daff-ae) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae *,.daff-ae),.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){font-weight:600;margin-bottom:1rem;word-wrap:break-word}.daff-article h1:not(.daff-ae *,.daff-ae) code,.daff-article h2:not(.daff-ae *,.daff-ae) code,.daff-article h3:not(.daff-ae *,.daff-ae) code,.daff-article h4:not(.daff-ae *,.daff-ae) code,.daff-article h5:not(.daff-ae *,.daff-ae) code,.daff-article h6:not(.daff-ae *,.daff-ae) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae *,.daff-ae){word-break:break-all;font-size:2rem;font-weight:600;line-height:2.25rem}@media (min-width: 768px){.daff-article h1:not(.daff-ae *,.daff-ae){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.125rem;line-height:1.5rem;font-weight:400}.daff-article h1:not(.daff-ae *,.daff-ae)+p code{font-size:1rem;line-height:1rem}@media (min-width: 768px){.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.25rem;font-weight:400;line-height:1.75rem}}.daff-article h2:not(.daff-ae *,.daff-ae){font-size:1.75rem;line-height:2rem;margin-top:2.5rem}@media (min-width: 768px){.daff-article h2:not(.daff-ae *,.daff-ae){font-size:2rem;line-height:2.5rem}}.daff-article h3:not(.daff-ae *,.daff-ae){font-size:1.5rem;line-height:2rem;margin-top:2.5rem}.daff-article h4:not(.daff-ae *,.daff-ae){font-size:1.25rem;line-height:1.5rem;margin-top:2rem}.daff-article h5:not(.daff-ae *,.daff-ae){font-size:1.125rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article h6:not(.daff-ae *,.daff-ae){font-size:1rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article p:not(.daff-ae *,.daff-ae){margin:0 0 1rem}.daff-article strong{font-weight:600}.daff-article pre{border-radius:.25rem;position:relative}.daff-article pre:last-child{margin-bottom:0}.daff-article pre code{display:block;line-height:1.5rem;font-size:.875rem;overflow-x:auto;padding:1.5rem}.daff-article code{border-radius:.25rem;font-size:.875rem;line-height:1rem;padding:.125rem .25rem}.daff-article__meta{font-size:.875rem}.daff-article hr{border:0;height:1px;margin:2rem 0}.daff-article blockquote{border-radius:.25rem;margin:1.5rem 0;padding:1rem}@media (min-width: 768px){.daff-article blockquote{padding:1rem 1.5rem}}.daff-article blockquote:last-child{margin-bottom:0}.daff-article blockquote cite{font-size:.875rem;font-weight:400;line-height:1.25rem;display:block;margin-top:1rem}.daff-article blockquote p:last-of-type{margin:0}.daff-article table{display:table;border-collapse:separate;border-spacing:0;border-radius:.25rem;font-size:1rem;line-height:1.25rem;margin:1.5rem 0;overflow:hidden}.daff-article table:last-child{margin-bottom:0}.daff-article table th{font-weight:600;outline:0;padding:1rem;text-align:left;vertical-align:top;box-sizing:border-box}.daff-article table td{padding:1rem;vertical-align:top;box-sizing:border-box}.daff-article table td p:only-child,.daff-article table td p:last-child{margin:0}\n"] }]
143
- }], ctorParameters: () => [{ type: DaffArticleCopyButtonService }] });
279
+ class: 'daff-article',
280
+ role: 'article',
281
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
282
+ DaffArticleCopyButtonService,
283
+ DaffArticleHeadingLinkService,
284
+ ], styles: [".daff-article{display:block;overflow:hidden}.daff-article a:not(.daff-ae *,.daff-ae){font-weight:500;text-decoration:none}.daff-article a:not(.daff-ae *,.daff-ae):hover{text-decoration:underline}.daff-article a:not(.daff-ae *,.daff-ae) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae *,.daff-ae),.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){font-weight:600;margin-bottom:1rem;overflow-wrap:break-word}.daff-article h1:not(.daff-ae *,.daff-ae) code,.daff-article h2:not(.daff-ae *,.daff-ae) code,.daff-article h3:not(.daff-ae *,.daff-ae) code,.daff-article h4:not(.daff-ae *,.daff-ae) code,.daff-article h5:not(.daff-ae *,.daff-ae) code,.daff-article h6:not(.daff-ae *,.daff-ae) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae *,.daff-ae){word-break:break-all;font-size:2rem;font-weight:600;line-height:2.25rem}@media(min-width:768px){.daff-article h1:not(.daff-ae *,.daff-ae){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.125rem;line-height:1.5rem;font-weight:400}.daff-article h1:not(.daff-ae *,.daff-ae)+p code{font-size:1rem;line-height:1rem}@media(min-width:768px){.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.25rem;font-weight:400;line-height:1.75rem}}.daff-article h2:not(.daff-ae *,.daff-ae){font-size:1.75rem;line-height:2rem;margin-top:2.5rem}@media(min-width:768px){.daff-article h2:not(.daff-ae *,.daff-ae){font-size:2rem;line-height:2.5rem}}.daff-article h2:not(.daff-ae *,.daff-ae):first-child{margin-top:0}.daff-article h3:not(.daff-ae *,.daff-ae){font-size:1.5rem;line-height:2rem;margin-top:2.5rem}.daff-article h4:not(.daff-ae *,.daff-ae){font-size:1.25rem;line-height:1.5rem;margin-top:2rem}.daff-article h5:not(.daff-ae *,.daff-ae){font-size:1.125rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article h6:not(.daff-ae *,.daff-ae){font-size:1rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article p:not(.daff-ae *,.daff-ae){margin:0 0 1rem}.daff-article strong{font-weight:600}.daff-article pre{border-radius:.5rem;position:relative}.daff-article pre:last-child{margin-bottom:0}.daff-article pre code{display:block;line-height:1.5rem;font-size:.875rem;overflow-x:auto;padding:1.5rem}.daff-article code{border-radius:.25rem;font-size:.875rem;line-height:1rem;padding:.125rem .25rem}.daff-article__meta{font-size:.875rem}.daff-article hr{border:0;height:1px;margin:2rem 0}.daff-article blockquote{border-radius:.25rem;margin:1.5rem 0;padding:1rem}@media(min-width:768px){.daff-article blockquote{padding:1rem 1.5rem}}.daff-article blockquote:last-child{margin-bottom:0}.daff-article blockquote cite{font-size:.875rem;font-weight:400;line-height:1.25rem;display:block;margin-top:1rem}.daff-article blockquote p:last-of-type{margin:0}.daff-article table{display:table;border-collapse:separate;border-spacing:0;border-radius:.25rem;font-size:1rem;line-height:1.25rem;margin:1.5rem 0;overflow:hidden}.daff-article table:last-child{margin-bottom:0}.daff-article table th{font-weight:600;outline:0;padding:1rem;text-align:left;vertical-align:top;box-sizing:border-box}.daff-article table td{padding:1rem;vertical-align:top;box-sizing:border-box}.daff-article table td p:only-child,.daff-article table td p:last-child{margin:0}\n"] }]
285
+ }], ctorParameters: () => [{ type: DaffArticleCopyButtonService }, { type: DaffArticleHeadingLinkService }] });
144
286
 
145
287
  /* eslint-disable quote-props */
146
288
  class DaffArticleMetaDirective {
147
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleMetaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
148
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffArticleMetaDirective, isStandalone: true, selector: "[daffArticleMeta]", host: { classAttribute: "daff-article__meta" }, ngImport: i0 }); }
289
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleMetaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
290
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffArticleMetaDirective, isStandalone: true, selector: "[daffArticleMeta]", host: { classAttribute: "daff-article__meta" }, ngImport: i0 }); }
149
291
  }
150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleMetaDirective, decorators: [{
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleMetaDirective, decorators: [{
151
293
  type: Directive,
152
294
  args: [{
153
295
  selector: '[daffArticleMeta]',
@@ -161,14 +303,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
161
303
  * @deprecated in favor of {@link DAFF_ARTICLE_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
162
304
  */
163
305
  class DaffArticleModule {
164
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
165
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleModule, imports: [CommonModule,
306
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
307
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleModule, imports: [CommonModule,
166
308
  DaffArticleComponent,
167
309
  DaffArticleMetaDirective], exports: [DaffArticleComponent,
168
310
  DaffArticleMetaDirective] }); }
169
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleModule, imports: [CommonModule] }); }
311
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleModule, imports: [CommonModule] }); }
170
312
  }
171
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleModule, decorators: [{
313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleModule, decorators: [{
172
314
  type: NgModule,
173
315
  args: [{
174
316
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-design-article.mjs","sources":["../../../libs/design/article/src/article-copy-button/copy-button/copy-button.component.ts","../../../libs/design/article/src/article-copy-button/copy-button/copy-button.component.html","../../../libs/design/article/src/article-copy-button/service/copy-button.service.ts","../../../libs/design/article/src/article/article.component.ts","../../../libs/design/article/src/article-meta/article-meta.directive.ts","../../../libs/design/article/src/article.module.ts","../../../libs/design/article/src/article.ts","../../../libs/design/article/src/daffodil-design-article.ts"],"sourcesContent":["import {\n Component,\n NgZone,\n ChangeDetectionStrategy,\n input,\n signal,\n OnDestroy,\n inject,\n} from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faCheck,\n faCopy,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport { DAFF_ICON_BUTTON_COMPONENTS } from '@daffodil/design/button';\n\n/**\n * DaffArticleCopyButtonComponent is a button that copies text content to the clipboard.\n * It provides visual feedback by changing the icon when content is successfully copied.\n *\n * @example\n * ```html\n * <daff-article-copy-button [content]=\"codeSnippet\" />\n * ```\n */\n@Component({\n selector: 'daff-article-copy-button',\n templateUrl: './copy-button.component.html',\n styleUrls: ['./copy-button.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n FaIconComponent,\n DAFF_ICON_BUTTON_COMPONENTS,\n ],\n})\nexport class DaffArticleCopyButtonComponent implements OnDestroy {\n private timeoutId?: ReturnType<typeof setTimeout>;\n\n // Content to be copied to clipboard\n content = input.required<string>();\n\n protected copied = signal(false);\n\n protected readonly faCopy = faCopy; // default copy icon\n protected readonly faCheck = faCheck; // check icon for copied state\n private _ngZone = inject(NgZone);\n\n ngOnDestroy() {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n }\n\n async copyToClipboard(): Promise<void> {\n try {\n // Write content to clipboard\n await navigator.clipboard.writeText(this.content());\n this.copied.set(true);\n clearTimeout(this.timeoutId);\n this._ngZone.runOutsideAngular(() => {\n this.timeoutId = setTimeout(() => {\n this._ngZone.run(() => this.copied.set(false));\n }, 1500);\n });\n } catch (err) {\n console.error('Failed to copy text: ', err);\n }\n }\n\n get ariaLabel() {\n return this.copied() ? 'Copied to clipboard' : 'Copy to clipboard';\n }\n}\n","<button\n daff-icon-button\n class=\"daff-article__copy-button\"\n size=\"sm\"\n type=\"button\"\n [attr.aria-label]=\"ariaLabel\"\n (click)=\"copyToClipboard()\">\n @if (copied()) {\n <fa-icon [icon]=\"faCheck\" />\n } @else {\n <fa-icon [icon]=\"faCopy\" />\n }\n</button>\n","import {\n Injectable,\n ComponentRef,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { DaffArticleCopyButtonComponent } from '../copy-button/copy-button.component';\n\ninterface ButtonEntry {\n buttonRef: ComponentRef<DaffArticleCopyButtonComponent>;\n preElement: HTMLPreElement;\n}\n\n@Injectable()\nexport class DaffArticleCopyButtonService {\n private buttons: Array<ButtonEntry> = [];\n\n /**\n * Finds all code blocks and adds copy buttons to them.\n * Skips code blocks with the `nocopy` attribute.\n * @param hostElement - The host element to search for code blocks.\n * @param viewContainerRef - The view container to create the copy button components.\n */\n addCopyButtonsToCodeBlocks(\n hostElement: HTMLElement,\n viewContainerRef: ViewContainerRef,\n ): void {\n const codeBlocks = hostElement.querySelectorAll('pre');\n\n codeBlocks.forEach((pre: HTMLPreElement) => {\n const code = pre.querySelector('code');\n if (!code) {\n return;\n }\n\n // Skip if nocopy attribute is present\n if (pre.hasAttribute('nocopy')) {\n return;\n }\n\n // Skip if already has a copy button\n if (pre.querySelector('daff-article-copy-button')) {\n return;\n }\n\n const textContent = code.textContent || '';\n\n // Create the copy button component\n const buttonRef = viewContainerRef.createComponent(DaffArticleCopyButtonComponent);\n buttonRef.setInput('content', textContent);\n\n // Insert button into pre before the code element\n pre.insertBefore(buttonRef.location.nativeElement, code);\n\n this.buttons.push({\n buttonRef,\n preElement: pre,\n });\n });\n }\n\n /**\n * Cleanup copy button references\n */\n cleanup(): void {\n this.buttons.forEach(({ buttonRef }) => {\n buttonRef.destroy();\n });\n this.buttons = [];\n }\n}\n","/* eslint-disable quote-props */\nimport {\n Component,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n ElementRef,\n ViewContainerRef,\n inject,\n DestroyRef,\n afterEveryRender,\n} from '@angular/core';\n\nimport { DaffArticleCopyButtonService } from '../article-copy-button/service/copy-button.service';\n\n/**\n * A component for creating articles within your page.\n */\n@Component({\n selector: 'daff-article',\n template: '<ng-content></ng-content>',\n styleUrls: ['./article.component.scss'],\n host: {\n 'class': 'daff-article',\n 'role': 'article',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [DaffArticleCopyButtonService],\n})\nexport class DaffArticleComponent {\n constructor(\n private copyButtonService: DaffArticleCopyButtonService,\n ) {\n const elementRef = inject(ElementRef<HTMLElement>);\n const viewContainerRef = inject(ViewContainerRef);\n\n afterEveryRender({\n write: () => {\n this.copyButtonService.addCopyButtonsToCodeBlocks(elementRef.nativeElement, viewContainerRef);\n },\n });\n\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(() => {\n this.copyButtonService.cleanup();\n });\n }\n}\n","/* eslint-disable quote-props */\nimport { Directive } from '@angular/core';\n\n@Directive({\n selector: '[daffArticleMeta]',\n host: {\n 'class': 'daff-article__meta',\n },\n})\nexport class DaffArticleMetaDirective {}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffArticleComponent } from './article/article.component';\nimport { DaffArticleMetaDirective } from './article-meta/article-meta.directive';\n\n/**\n * @deprecated in favor of {@link DAFF_ARTICLE_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffArticleComponent,\n DaffArticleMetaDirective,\n ],\n exports: [\n DaffArticleComponent,\n DaffArticleMetaDirective,\n ],\n})\nexport class DaffArticleModule { }\n","import { DaffArticleComponent } from './article/article.component';\nimport { DaffArticleMetaDirective } from './article-meta/article-meta.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_ARTICLE_COMPONENTS = <const> [\n DaffArticleComponent,\n DaffArticleMetaDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffArticleCopyButtonService"],"mappings":";;;;;;;;AAiBA;;;;;;;;AAQG;MAWU,8BAA8B,CAAA;AAV3C,IAAA,WAAA,GAAA;;AAcE,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,kDAAU;AAExB,QAAA,IAAA,C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AA,iBAAiB,YAT1B,YAAY;YACZ,oBAAoB;AACpB,YAAA,wBAAwB,aAGxB,oBAAoB;YACpB,wBAAwB,CAAA,EAAA,CAAA,CAAA;AAGf,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAT1B,YAAY,CAAA,EAAA,CAAA,CAAA;;2FASH,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAX7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,oBAAoB;wBACpB,wBAAwB;AACzB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;wBACpB,wBAAwB;AACzB,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;AACI,MAAM,uBAAuB,GAAW;IAC7C,oBAAoB;IACpB,wBAAwB;;;ACR1B;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-design-article.mjs","sources":["../../../libs/design/article/src/article-copy-button/copy-button/copy-button.component.ts","../../../libs/design/article/src/article-copy-button/copy-button/copy-button.component.html","../../../libs/design/article/src/article-copy-button/service/copy-button.service.ts","../../../libs/design/article/src/article-heading-link/heading-link/heading-link.component.ts","../../../libs/design/article/src/article-heading-link/heading-link/heading-link.component.html","../../../libs/design/article/src/article-heading-link/service/heading-link.service.ts","../../../libs/design/article/src/article/article.component.ts","../../../libs/design/article/src/article-meta/article-meta.directive.ts","../../../libs/design/article/src/article.module.ts","../../../libs/design/article/src/article.ts","../../../libs/design/article/src/daffodil-design-article.ts"],"sourcesContent":["import {\n Component,\n NgZone,\n ChangeDetectionStrategy,\n input,\n signal,\n OnDestroy,\n inject,\n} from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faCheck,\n faCopy,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport { DAFF_ICON_BUTTON_COMPONENTS } from '@daffodil/design/button';\n\n/**\n * DaffArticleCopyButtonComponent is a button that copies text content to the clipboard.\n * It provides visual feedback by changing the icon when content is successfully copied.\n *\n * @example\n * ```html\n * <daff-article-copy-button [content]=\"codeSnippet\" />\n * ```\n */\n@Component({\n selector: 'daff-article-copy-button',\n templateUrl: './copy-button.component.html',\n styleUrl: './copy-button.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n FaIconComponent,\n DAFF_ICON_BUTTON_COMPONENTS,\n ],\n})\nexport class DaffArticleCopyButtonComponent implements OnDestroy {\n private timeoutId?: ReturnType<typeof setTimeout>;\n\n // Content to be copied to clipboard\n content = input.required<string>();\n\n protected copied = signal(false);\n\n protected readonly faCopy = faCopy; // default copy icon\n protected readonly faCheck = faCheck; // check icon for copied state\n private _ngZone = inject(NgZone);\n\n ngOnDestroy() {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n }\n\n async copyToClipboard(): Promise<void> {\n try {\n // Write content to clipboard\n await navigator.clipboard.writeText(this.content());\n this.copied.set(true);\n clearTimeout(this.timeoutId);\n this._ngZone.runOutsideAngular(() => {\n this.timeoutId = setTimeout(() => {\n this._ngZone.run(() => this.copied.set(false));\n }, 1500);\n });\n } catch (err) {\n console.error('Failed to copy text: ', err);\n }\n }\n\n get ariaLabel() {\n return this.copied() ? 'Copied to clipboard' : 'Copy to clipboard';\n }\n}\n","<button\n daff-icon-button\n class=\"daff-article__copy-button\"\n size=\"sm\"\n type=\"button\"\n [attr.aria-label]=\"ariaLabel\"\n (click)=\"copyToClipboard()\">\n @if (copied()) {\n <fa-icon [icon]=\"faCheck\" />\n } @else {\n <fa-icon [icon]=\"faCopy\" />\n }\n</button>\n","import {\n Injectable,\n ComponentRef,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { DaffArticleCopyButtonComponent } from '../copy-button/copy-button.component';\n\ninterface ButtonEntry {\n buttonRef: ComponentRef<DaffArticleCopyButtonComponent>;\n preElement: HTMLPreElement;\n}\n\n@Injectable()\nexport class DaffArticleCopyButtonService {\n private buttons: Array<ButtonEntry> = [];\n\n /**\n * Finds all code blocks and adds copy buttons to them.\n * Skips code blocks with the `nocopy` attribute.\n * @param hostElement - The host element to search for code blocks.\n * @param viewContainerRef - The view container to create the copy button components.\n */\n addCopyButtonsToCodeBlocks(\n hostElement: HTMLElement,\n viewContainerRef: ViewContainerRef,\n ): void {\n const codeBlocks = hostElement.querySelectorAll('pre');\n const encapsulatedElements = Array.from(hostElement.querySelectorAll('.daff-ae'));\n\n codeBlocks.forEach((pre: HTMLPreElement) => {\n const code = pre.querySelector('code');\n if (!code) {\n return;\n }\n\n // Skip if nocopy attribute is present\n if (pre.hasAttribute('nocopy')) {\n return;\n }\n\n // Skip if inside an article-encapsulated component\n if (encapsulatedElements.some(ee => ee.contains(pre))) {\n return;\n }\n\n // Skip if already has a copy button\n if (pre.querySelector('daff-article-copy-button')) {\n return;\n }\n\n const textContent = code.textContent || '';\n\n // Create the copy button component\n const buttonRef = viewContainerRef.createComponent(DaffArticleCopyButtonComponent);\n buttonRef.setInput('content', textContent);\n\n // Insert button into pre before the code element\n pre.insertBefore(buttonRef.location.nativeElement, code);\n\n this.buttons.push({\n buttonRef,\n preElement: pre,\n });\n });\n }\n\n /**\n * Cleanup copy button references\n */\n cleanup(): void {\n this.buttons.forEach(({ buttonRef }) => {\n buttonRef.destroy();\n });\n this.buttons = [];\n }\n}\n","import {\n DOCUMENT,\n isPlatformBrowser,\n} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n NgZone,\n OnDestroy,\n signal,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n Router,\n RouterLink,\n} from '@angular/router';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faLink,\n faCheck,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport { DaffArticleEncapsulatedDirective } from '@daffodil/design';\nimport { DAFF_ICON_BUTTON_COMPONENTS } from '@daffodil/design/button';\n\n@Component({\n selector: 'daff-article-heading-link',\n templateUrl: './heading-link.component.html',\n styleUrl: './heading-link.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n { directive: DaffArticleEncapsulatedDirective },\n ],\n imports: [\n RouterLink,\n FaIconComponent,\n DAFF_ICON_BUTTON_COMPONENTS,\n ],\n})\nexport class DaffArticleHeadingLinkComponent implements OnDestroy {\n fragment = input.required<string>();\n label = input.required<string>();\n\n private timeoutId?: ReturnType<typeof setTimeout>;\n\n protected copied = signal(false);\n\n protected readonly faLink = faLink; // default link icon\n protected readonly faCheck = faCheck; // check icon for copied state\n private _ngZone = inject(NgZone);\n private _router = inject(Router);\n private _platformId = inject(PLATFORM_ID);\n private _document = inject(DOCUMENT);\n\n ngOnDestroy() {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n }\n\n async copyLink(): Promise<void> {\n if (!isPlatformBrowser(this._platformId)) {\n return;\n }\n\n try {\n // Get the URL to fragment\n const currentUrl = this._router.url.split('#')[0]; // Remove existing fragment if any\n const fullUrl = `${this._document.defaultView?.location.origin || ''}${currentUrl}#${this.fragment()}`;\n\n // Write full URL to clipboard\n await navigator.clipboard.writeText(fullUrl);\n this.copied.set(true);\n clearTimeout(this.timeoutId);\n this._ngZone.runOutsideAngular(() => {\n this.timeoutId = setTimeout(() => {\n this._ngZone.run(() => this.copied.set(false));\n }, 1500);\n });\n } catch (err) {\n console.error('Failed to copy text: ', err);\n }\n }\n\n get ariaLabel() {\n return this.copied() ? 'Copied link to clipboard' : 'Copy link to clipboard';\n }\n}\n","<a class=\"daff-article-heading-link__anchor\" routerLink=\".\" [fragment]=\"fragment()\" queryParamsHandling=\"preserve\">\n\t{{ label() }}\n</a>\n<button class=\"daff-article-heading-link__button\" [attr.aria-label]=\"ariaLabel\" (click)=\"copyLink()\">\n\t@if (copied()) {\n\t\t<fa-icon [icon]=\"faCheck\"></fa-icon>\n\t} @else {\n\t\t<fa-icon [icon]=\"faLink\"></fa-icon>\n\t}\n</button>\n","import {\n Injectable,\n ComponentRef,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { DaffArticleHeadingLinkComponent } from '../heading-link/heading-link.component';\n\ninterface LinkEntry {\n linkRef: ComponentRef<DaffArticleHeadingLinkComponent>;\n headingElement: HTMLHeadingElement;\n}\n\n@Injectable()\nexport class DaffArticleHeadingLinkService {\n private links: Array<LinkEntry> = [];\n\n /**\n * Finds all h2, h3, and h4 elements and wraps their text content with heading link components.\n * @param hostElement - The host element to search for heading elements.\n * @param viewContainerRef - The view container to create the heading link components.\n */\n addLinksToHeadings(\n hostElement: HTMLElement,\n viewContainerRef: ViewContainerRef,\n ): void {\n const headings = hostElement.querySelectorAll('h2, h3, h4');\n const encapsulatedElements = Array.from(hostElement.querySelectorAll('.daff-ae'));\n\n headings.forEach((heading: HTMLHeadingElement) => {\n if (heading.querySelector('daff-article-heading-link')) {\n return;\n }\n\n // Skip if nolink attribute is present\n if (heading.hasAttribute('nolink')) {\n return;\n }\n\n // Skip if inside an article-encapsulated component\n if (encapsulatedElements.some(ee => ee.contains(heading))) {\n return;\n }\n\n const textContent = heading.textContent?.trim() || '';\n const fragment = heading.id || this.generateFragment(textContent);\n\n // Set the id on the heading if it doesn't have one\n if (!heading.id) {\n heading.id = fragment;\n }\n\n // Create the heading link component and set its inputs\n const linkRef = viewContainerRef.createComponent(DaffArticleHeadingLinkComponent);\n linkRef.setInput('fragment', fragment);\n linkRef.setInput('label', textContent);\n\n // Clear the heading's content and append the link component\n heading.innerHTML = '';\n heading.appendChild(linkRef.location.nativeElement);\n\n this.links.push({\n linkRef,\n headingElement: heading,\n });\n });\n }\n\n /**\n * Cleanup heading link references\n */\n cleanup(): void {\n this.links.forEach(({ linkRef }) => {\n linkRef.destroy();\n });\n this.links = [];\n }\n\n /**\n * Generates a URL-friendly fragment from heading text\n */\n private generateFragment(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^\\w\\s-]/g, '')\n .replace(/\\s+/g, '-')\n .replace(/-+/g, '-')\n .trim();\n }\n}\n","import {\n Component,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n ElementRef,\n ViewContainerRef,\n inject,\n DestroyRef,\n afterEveryRender,\n} from '@angular/core';\n\nimport { DaffArticleCopyButtonService } from '../article-copy-button/service/copy-button.service';\nimport { DaffArticleHeadingLinkService } from '../article-heading-link/service/heading-link.service';\n\n/**\n * A component for creating articles within your page.\n */\n@Component({\n selector: 'daff-article',\n template: '<ng-content></ng-content>',\n styleUrl: './article.component.scss',\n host: {\n class: 'daff-article',\n role: 'article',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n DaffArticleCopyButtonService,\n DaffArticleHeadingLinkService,\n ],\n})\nexport class DaffArticleComponent {\n constructor(\n private copyButtonService: DaffArticleCopyButtonService,\n private headingLinkService: DaffArticleHeadingLinkService,\n ) {\n const elementRef = inject(ElementRef<HTMLElement>);\n const viewContainerRef = inject(ViewContainerRef);\n\n afterEveryRender({\n write: () => {\n this.copyButtonService.addCopyButtonsToCodeBlocks(elementRef.nativeElement, viewContainerRef);\n this.headingLinkService.addLinksToHeadings(elementRef.nativeElement, viewContainerRef);\n },\n });\n\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(() => {\n this.copyButtonService.cleanup();\n this.headingLinkService.cleanup();\n });\n }\n}\n","/* eslint-disable quote-props */\nimport { Directive } from '@angular/core';\n\n@Directive({\n selector: '[daffArticleMeta]',\n host: {\n 'class': 'daff-article__meta',\n },\n})\nexport class DaffArticleMetaDirective {}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffArticleComponent } from './article/article.component';\nimport { DaffArticleMetaDirective } from './article-meta/article-meta.directive';\n\n/**\n * @deprecated in favor of {@link DAFF_ARTICLE_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffArticleComponent,\n DaffArticleMetaDirective,\n ],\n exports: [\n DaffArticleComponent,\n DaffArticleMetaDirective,\n ],\n})\nexport class DaffArticleModule { }\n","import { DaffArticleComponent } from './article/article.component';\nimport { DaffArticleMetaDirective } from './article-meta/article-meta.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_ARTICLE_COMPONENTS = <const> [\n DaffArticleComponent,\n DaffArticleMetaDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i1.DaffArticleCopyButtonService","i2.DaffArticleHeadingLinkService"],"mappings":";;;;;;;;;;;AAiBA;;;;;;;;AAQG;MAWU,8BAA8B,CAAA;AAV3C,IAAA,WAAA,GAAA;;AAcE,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,kDAAU;AAExB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,KAAK,kDAAC;AAEb,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC;AAChB,QAAA,IAAA,CAAA,OAAO,GAAG,OAAO,CAAC;AAC7B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;AA2BjC,IAAA;IAzBC,WAAW,GAAA;AACT,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;AAClB,YAAA,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC;QAC9B;IACF;AAEA,IAAA,MAAM,eAAe,GAAA;AACnB,QAAA,IAAI;;YAEF,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;AACnD,YAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;AACrB,YAAA,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC;AAC5B,YAAA,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAK;AAClC,gBAAA,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,MAAK;AAC/B,oBAAA,IAA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