@daffodil/design 0.94.1-rc.0 → 0.95.0

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 (170) hide show
  1. package/README.md +1 -2
  2. package/accordion/src/accordion-theme.scss +4 -4
  3. package/article/README.md +4 -27
  4. package/article/src/article-theme.scss +14 -14
  5. package/badge/src/badge-theme.scss +0 -6
  6. package/button/README.md +0 -4
  7. package/button/src/button/basic/button-theme.scss +17 -42
  8. package/button/src/button/button-base.scss +12 -3
  9. package/button/src/button/flat/flat-theme.scss +14 -12
  10. package/button/src/button/icon/icon-theme.scss +19 -40
  11. package/button/src/button/stroked/stroked-theme.scss +22 -36
  12. package/card/src/card/stroked/stroked-theme.scss +1 -1
  13. package/card/src/card-base.scss +0 -1
  14. package/fesm2022/daffodil-design-accordion.mjs +285 -188
  15. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  16. package/fesm2022/daffodil-design-article.mjs +578 -340
  17. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  18. package/fesm2022/daffodil-design-badge.mjs +166 -84
  19. package/fesm2022/daffodil-design-badge.mjs.map +1 -1
  20. package/fesm2022/daffodil-design-beacon.mjs +109 -47
  21. package/fesm2022/daffodil-design-beacon.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-breadcrumb.mjs +384 -277
  23. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-button.mjs +541 -408
  25. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-callout.mjs +349 -224
  27. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-card.mjs +496 -327
  29. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-checkbox.mjs +373 -313
  31. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-container.mjs +103 -60
  33. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  34. package/fesm2022/daffodil-design-form-field.mjs +441 -352
  35. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-form.mjs +155 -57
  37. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-hero.mjs +349 -234
  39. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-image-lite.mjs +60 -0
  41. package/fesm2022/daffodil-design-image-lite.mjs.map +1 -0
  42. package/fesm2022/daffodil-design-image.mjs +245 -107
  43. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-input.mjs +217 -164
  45. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-list.mjs +308 -170
  47. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-media-gallery.mjs +351 -278
  49. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-menu.mjs +525 -417
  51. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  52. package/fesm2022/daffodil-design-modal.mjs +680 -450
  53. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  54. package/fesm2022/daffodil-design-native-select.mjs +175 -166
  55. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  56. package/fesm2022/daffodil-design-navbar.mjs +145 -68
  57. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  58. package/fesm2022/daffodil-design-notification.mjs +376 -226
  59. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-paginator.mjs +296 -192
  61. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-progress-bar.mjs +243 -157
  63. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  64. package/fesm2022/daffodil-design-radio.mjs +382 -300
  65. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  66. package/fesm2022/daffodil-design-select.mjs +424 -364
  67. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  68. package/fesm2022/daffodil-design-sidebar.mjs +874 -887
  69. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  70. package/fesm2022/daffodil-design-spinner.mjs +156 -99
  71. package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
  72. package/fesm2022/daffodil-design-switch.mjs +176 -106
  73. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  74. package/fesm2022/daffodil-design-tabs.mjs +685 -427
  75. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  76. package/fesm2022/daffodil-design-tag.mjs +251 -133
  77. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  78. package/fesm2022/daffodil-design-testing.mjs +4 -16
  79. package/fesm2022/daffodil-design-testing.mjs.map +1 -1
  80. package/fesm2022/daffodil-design-text-snippet.mjs +140 -54
  81. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  82. package/fesm2022/daffodil-design-textarea.mjs +170 -150
  83. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  84. package/fesm2022/daffodil-design-toast.mjs +658 -481
  85. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  86. package/fesm2022/daffodil-design-tree.mjs +456 -469
  87. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  88. package/fesm2022/daffodil-design-youtube-player.mjs +168 -115
  89. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  90. package/fesm2022/daffodil-design.mjs +1628 -1650
  91. package/fesm2022/daffodil-design.mjs.map +1 -1
  92. package/form-field/README.md +0 -4
  93. package/form-field/src/form-field-theme.scss +12 -4
  94. package/image/README.md +4 -0
  95. package/image-lite/README.md +58 -0
  96. package/image-lite/src/image-theme.scss +18 -0
  97. package/list/src/list-base.scss +3 -4
  98. package/list/src/list-theme.scss +6 -5
  99. package/media-gallery/README.md +1 -1
  100. package/media-gallery/src/media-gallery-theme.scss +3 -3
  101. package/menu/src/menu-theme.scss +6 -2
  102. package/notification/src/notification-theme.scss +10 -10
  103. package/package.json +1 -1
  104. package/scss/global.scss +17 -11
  105. package/scss/theme.scss +2 -18
  106. package/scss/theming/_get-palette.scss +0 -3
  107. package/scss/theming/_index.scss +0 -1
  108. package/scss/theming/_light-dark.scss +2 -2
  109. package/scss/theming/_theme-css-variables.scss +1 -1
  110. package/scss/theming/create-theme/_create-theme.scss +2 -2
  111. package/scss/theming/get-font-colors/_get-font-colors.scss +7 -25
  112. package/scss/theming/get-font-colors/_get-font-colors.spec.scss +0 -12
  113. package/scss/typography/_classes.scss +0 -6
  114. package/scss/typography/_index.scss +0 -1
  115. package/scss/typography/mixins/_sizes.scss +0 -1
  116. package/scss/typography/utilities/_variables.scss +3 -0
  117. package/select/src/select-theme.scss +10 -14
  118. package/switch/src/switch-theme.scss +2 -2
  119. package/tabs/src/tabs-theme.scss +4 -4
  120. package/types/daffodil-design-accordion.d.ts +92 -67
  121. package/types/daffodil-design-article.d.ts +49 -56
  122. package/types/daffodil-design-badge.d.ts +56 -33
  123. package/types/daffodil-design-beacon.d.ts +35 -14
  124. package/types/daffodil-design-breadcrumb.d.ts +89 -85
  125. package/types/daffodil-design-button.d.ts +128 -146
  126. package/types/daffodil-design-callout.d.ts +55 -39
  127. package/types/daffodil-design-card.d.ts +66 -56
  128. package/types/daffodil-design-checkbox.d.ts +211 -167
  129. package/types/daffodil-design-container.d.ts +17 -16
  130. package/types/daffodil-design-form-field.d.ts +273 -240
  131. package/types/daffodil-design-form.d.ts +21 -21
  132. package/types/daffodil-design-hero.d.ts +55 -39
  133. package/types/daffodil-design-image-lite.d.ts +17 -0
  134. package/types/daffodil-design-image.d.ts +89 -55
  135. package/types/daffodil-design-input.d.ts +86 -72
  136. package/types/daffodil-design-list.d.ts +49 -43
  137. package/types/daffodil-design-media-gallery.d.ts +176 -148
  138. package/types/daffodil-design-menu.d.ts +177 -169
  139. package/types/daffodil-design-modal.d.ts +205 -205
  140. package/types/daffodil-design-native-select.d.ts +94 -84
  141. package/types/daffodil-design-navbar.d.ts +34 -24
  142. package/types/daffodil-design-notification.d.ts +82 -67
  143. package/types/daffodil-design-paginator.d.ts +140 -118
  144. package/types/daffodil-design-progress-bar.d.ts +92 -74
  145. package/types/daffodil-design-radio.d.ts +183 -144
  146. package/types/daffodil-design-select.d.ts +207 -178
  147. package/types/daffodil-design-sidebar.d.ts +270 -253
  148. package/types/daffodil-design-spinner.d.ts +49 -36
  149. package/types/daffodil-design-switch.d.ts +77 -46
  150. package/types/daffodil-design-tabs.d.ts +248 -198
  151. package/types/daffodil-design-tag.d.ts +91 -56
  152. package/types/daffodil-design-testing.d.ts +1 -3
  153. package/types/daffodil-design-text-snippet.d.ts +48 -37
  154. package/types/daffodil-design-textarea.d.ts +88 -79
  155. package/types/daffodil-design-toast.d.ts +175 -183
  156. package/types/daffodil-design-tree.d.ts +186 -169
  157. package/types/daffodil-design-youtube-player.d.ts +56 -52
  158. package/types/daffodil-design.d.ts +614 -695
  159. package/button/src/button/raised/raised-theme.scss +0 -92
  160. package/button/src/button/underline/underline-theme.scss +0 -141
  161. package/fesm2022/daffodil-design-link-set.mjs +0 -160
  162. package/fesm2022/daffodil-design-link-set.mjs.map +0 -1
  163. package/fesm2022/daffodil-design-quantity-field.mjs +0 -364
  164. package/fesm2022/daffodil-design-quantity-field.mjs.map +0 -1
  165. package/link-set/README.md +0 -86
  166. package/quantity-field/README.md +0 -63
  167. package/scss/theming/_configure-theme.scss +0 -120
  168. package/scss/typography/mixins/_font-weight.scss +0 -14
  169. package/types/daffodil-design-link-set.d.ts +0 -72
  170. package/types/daffodil-design-quantity-field.d.ts +0 -171
@@ -1,341 +1,579 @@
1
- import { DOCUMENT, isPlatformBrowser, CommonModule } from '@angular/common';
2
- import * as i0 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
- import { FaIconComponent } from '@fortawesome/angular-fontawesome';
5
- import { faCopy, faCheck, faLink } from '@fortawesome/free-solid-svg-icons';
6
- import * as i1 from '@daffodil/design/button';
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';
11
-
12
- /**
13
- * DaffArticleCopyButtonComponent is a button that copies text content to the clipboard.
14
- * It provides visual feedback by changing the icon when content is successfully copied.
15
- *
16
- * @example
17
- * ```html
18
- * <daff-article-copy-button [content]="codeSnippet" />
19
- * ```
20
- */
21
- class DaffArticleCopyButtonComponent {
22
- constructor() {
23
- // Content to be copied to clipboard
24
- this.content = input.required(...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
25
- this.copied = signal(false, ...(ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []));
26
- this.faCopy = faCopy; // default copy icon
27
- this.faCheck = faCheck; // check icon for copied state
28
- this._ngZone = inject(NgZone);
29
- }
30
- ngOnDestroy() {
31
- if (this.timeoutId) {
32
- clearTimeout(this.timeoutId);
33
- }
34
- }
35
- async copyToClipboard() {
36
- try {
37
- // Write content to clipboard
38
- await navigator.clipboard.writeText(this.content());
39
- this.copied.set(true);
40
- clearTimeout(this.timeoutId);
41
- this._ngZone.runOutsideAngular(() => {
42
- this.timeoutId = setTimeout(() => {
43
- this._ngZone.run(() => this.copied.set(false));
44
- }, 1500);
45
- });
46
- }
47
- catch (err) {
48
- console.error('Failed to copy text: ', err);
49
- }
50
- }
51
- get ariaLabel() {
52
- return this.copied() ? 'Copied to clipboard' : 'Copy to clipboard';
53
- }
54
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleCopyButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
55
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", 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 }); }
56
- }
57
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleCopyButtonComponent, decorators: [{
58
- type: Component,
59
- args: [{ selector: 'daff-article-copy-button', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
60
- FaIconComponent,
61
- DAFF_ICON_BUTTON_COMPONENTS,
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"] }]
63
- }], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }] } });
64
-
65
- class DaffArticleCopyButtonService {
66
- constructor() {
67
- this.buttons = [];
68
- }
69
- /**
70
- * Finds all code blocks and adds copy buttons to them.
71
- * Skips code blocks with the `nocopy` attribute.
72
- * @param hostElement - The host element to search for code blocks.
73
- * @param viewContainerRef - The view container to create the copy button components.
74
- */
75
- addCopyButtonsToCodeBlocks(hostElement, viewContainerRef) {
76
- const codeBlocks = hostElement.querySelectorAll('pre');
77
- const encapsulatedElements = Array.from(hostElement.querySelectorAll('.daff-ae'));
78
- codeBlocks.forEach((pre) => {
79
- const code = pre.querySelector('code');
80
- if (!code) {
81
- return;
82
- }
83
- // Skip if nocopy attribute is present
84
- if (pre.hasAttribute('nocopy')) {
85
- return;
86
- }
87
- // Skip if inside an article-encapsulated component
88
- if (encapsulatedElements.some(ee => ee.contains(pre))) {
89
- return;
90
- }
91
- // Skip if already has a copy button
92
- if (pre.querySelector('daff-article-copy-button')) {
93
- return;
94
- }
95
- const textContent = code.textContent || '';
96
- // Create the copy button component
97
- const buttonRef = viewContainerRef.createComponent(DaffArticleCopyButtonComponent);
98
- buttonRef.setInput('content', textContent);
99
- // Insert button into pre before the code element
100
- pre.insertBefore(buttonRef.location.nativeElement, code);
101
- this.buttons.push({
102
- buttonRef,
103
- preElement: pre,
104
- });
105
- });
106
- }
107
- /**
108
- * Cleanup copy button references
109
- */
110
- cleanup() {
111
- this.buttons.forEach(({ buttonRef }) => {
112
- buttonRef.destroy();
113
- });
114
- this.buttons = [];
115
- }
116
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleCopyButtonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
117
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleCopyButtonService }); }
118
- }
119
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleCopyButtonService, decorators: [{
120
- type: Injectable
121
- }] });
122
-
123
- class DaffArticleHeadingLinkComponent {
124
- constructor() {
125
- this.fragment = input.required(...(ngDevMode ? [{ debugName: "fragment" }] : /* istanbul ignore next */ []));
126
- this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
127
- this.copied = signal(false, ...(ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []));
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: "21.2.9", ngImport: i0, type: DaffArticleHeadingLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
166
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", 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}@media(hover:hover){: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: "21.2.9", 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}@media(hover:hover){: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: "21.2.9", ngImport: i0, type: DaffArticleHeadingLinkService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
243
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleHeadingLinkService }); }
244
- }
245
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleHeadingLinkService, decorators: [{
246
- type: Injectable
247
- }] });
248
-
249
- /**
250
- * A component for creating articles within your page.
251
- */
252
- class DaffArticleComponent {
253
- constructor(copyButtonService, headingLinkService) {
254
- this.copyButtonService = copyButtonService;
255
- this.headingLinkService = headingLinkService;
256
- const elementRef = inject((ElementRef));
257
- const viewContainerRef = inject(ViewContainerRef);
258
- afterEveryRender({
259
- write: () => {
260
- this.copyButtonService.addCopyButtonsToCodeBlocks(elementRef.nativeElement, viewContainerRef);
261
- this.headingLinkService.addLinksToHeadings(elementRef.nativeElement, viewContainerRef);
262
- },
263
- });
264
- const destroyRef = inject(DestroyRef);
265
- destroyRef.onDestroy(() => {
266
- this.copyButtonService.cleanup();
267
- this.headingLinkService.cleanup();
268
- });
269
- }
270
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", 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: "21.2.9", 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,:where(.daff-article .daff-ae *)){font-weight:500;text-decoration:none}@media(hover:hover){.daff-article a:not(.daff-ae,:where(.daff-article .daff-ae *)):hover{text-decoration:underline}}.daff-article a:not(.daff-ae,:where(.daff-article .daff-ae *)) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)){font-weight:600;margin-bottom:1rem;overflow-wrap:break-word}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae,:where(.daff-article .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,:where(.daff-article .daff-ae *)){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p{font-size:1.125rem;line-height:1.5rem;font-weight:400}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p code{font-size:1rem;line-height:1rem}@media(min-width:768px){.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p{font-size:1.25rem;font-weight:400;line-height:1.75rem}}.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.75rem;line-height:2rem;margin-top:2.5rem}@media(min-width:768px){.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:2rem;line-height:2.5rem}}.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)):first-child{margin-top:0}.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.5rem;line-height:2rem;margin-top:2.5rem}.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.25rem;line-height:1.5rem;margin-top:2rem}.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.125rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article p:not(.daff-ae,:where(.daff-article .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 }); }
275
- }
276
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleComponent, decorators: [{
277
- type: Component,
278
- args: [{ selector: 'daff-article', template: '<ng-content></ng-content>', host: {
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,:where(.daff-article .daff-ae *)){font-weight:500;text-decoration:none}@media(hover:hover){.daff-article a:not(.daff-ae,:where(.daff-article .daff-ae *)):hover{text-decoration:underline}}.daff-article a:not(.daff-ae,:where(.daff-article .daff-ae *)) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)){font-weight:600;margin-bottom:1rem;overflow-wrap:break-word}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)) code{font-size:.875rem;font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae,:where(.daff-article .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,:where(.daff-article .daff-ae *)){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p{font-size:1.125rem;line-height:1.5rem;font-weight:400}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p code{font-size:1rem;line-height:1rem}@media(min-width:768px){.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p{font-size:1.25rem;font-weight:400;line-height:1.75rem}}.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.75rem;line-height:2rem;margin-top:2.5rem}@media(min-width:768px){.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:2rem;line-height:2.5rem}}.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)):first-child{margin-top:0}.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.5rem;line-height:2rem;margin-top:2.5rem}.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.25rem;line-height:1.5rem;margin-top:2rem}.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.125rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article p:not(.daff-ae,:where(.daff-article .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 }] });
286
-
287
- /* eslint-disable quote-props */
288
- class DaffArticleMetaDirective {
289
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleMetaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
290
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffArticleMetaDirective, isStandalone: true, selector: "[daffArticleMeta]", host: { classAttribute: "daff-article__meta" }, ngImport: i0 }); }
291
- }
292
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleMetaDirective, decorators: [{
293
- type: Directive,
294
- args: [{
295
- selector: '[daffArticleMeta]',
296
- host: {
297
- 'class': 'daff-article__meta',
298
- },
299
- }]
300
- }] });
301
-
302
- /**
303
- * @deprecated in favor of {@link DAFF_ARTICLE_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
304
- */
305
- class DaffArticleModule {
306
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
307
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleModule, imports: [CommonModule,
308
- DaffArticleComponent,
309
- DaffArticleMetaDirective], exports: [DaffArticleComponent,
310
- DaffArticleMetaDirective] }); }
311
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleModule, imports: [CommonModule] }); }
312
- }
313
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleModule, decorators: [{
314
- type: NgModule,
315
- args: [{
316
- imports: [
317
- CommonModule,
318
- DaffArticleComponent,
319
- DaffArticleMetaDirective,
320
- ],
321
- exports: [
322
- DaffArticleComponent,
323
- DaffArticleMetaDirective,
324
- ],
325
- }]
326
- }] });
327
-
328
- /**
329
- * @docs-private
330
- */
331
- const DAFF_ARTICLE_COMPONENTS = [
332
- DaffArticleComponent,
333
- DaffArticleMetaDirective,
334
- ];
335
-
336
- /**
337
- * Generated bundle index. Do not edit.
338
- */
339
-
1
+ import { CommonModule, DOCUMENT, isPlatformBrowser } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, NgModule, NgZone, PLATFORM_ID, ViewContainerRef, ViewEncapsulation, afterEveryRender, inject, input, signal } from "@angular/core";
4
+ import { FaIconComponent } from "@fortawesome/angular-fontawesome";
5
+ import { faCheck, faCopy, faLink } from "@fortawesome/free-solid-svg-icons";
6
+ import * as i1$1 from "@daffodil/design/button";
7
+ import { DAFF_ICON_BUTTON_COMPONENTS } from "@daffodil/design/button";
8
+ import { Router, RouterLink } from "@angular/router";
9
+ import * as i1 from "@daffodil/design";
10
+ import { DaffArticleEncapsulatedDirective } from "@daffodil/design";
11
+ var DaffArticleCopyButtonComponent = class DaffArticleCopyButtonComponent {
12
+ constructor() {
13
+ this.content = input.required(...ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []);
14
+ this.copied = signal(false, ...ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []);
15
+ this.faCopy = faCopy;
16
+ this.faCheck = faCheck;
17
+ this._ngZone = inject(NgZone);
18
+ }
19
+ ngOnDestroy() {
20
+ if (this.timeoutId) clearTimeout(this.timeoutId);
21
+ }
22
+ async copyToClipboard() {
23
+ try {
24
+ await navigator.clipboard.writeText(this.content());
25
+ this.copied.set(true);
26
+ clearTimeout(this.timeoutId);
27
+ this._ngZone.runOutsideAngular(() => {
28
+ this.timeoutId = setTimeout(() => {
29
+ this._ngZone.run(() => this.copied.set(false));
30
+ }, 1500);
31
+ });
32
+ } catch (err) {
33
+ console.error("Failed to copy text: ", err);
34
+ }
35
+ }
36
+ get ariaLabel() {
37
+ return this.copied() ? "Copied to clipboard" : "Copy to clipboard";
38
+ }
39
+ static {
40
+ this.ɵfac = i0.ɵɵngDeclareFactory({
41
+ minVersion: "12.0.0",
42
+ version: "22.2.4",
43
+ ngImport: i0,
44
+ type: DaffArticleCopyButtonComponent,
45
+ deps: [],
46
+ target: i0.ɵɵFactoryTarget.Component
47
+ });
48
+ }
49
+ static {
50
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
51
+ minVersion: "17.0.0",
52
+ version: "22.2.4",
53
+ type: DaffArticleCopyButtonComponent,
54
+ isStandalone: true,
55
+ selector: "daff-article-copy-button",
56
+ inputs: { content: {
57
+ classPropertyName: "content",
58
+ publicName: "content",
59
+ isSignal: true,
60
+ isRequired: true,
61
+ transformFunction: null
62
+ } },
63
+ ngImport: i0,
64
+ 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",
65
+ styles: [":host{display:block;position:absolute;top:.25rem;right:.25rem;z-index:1}\n"],
66
+ dependencies: [{
67
+ kind: "component",
68
+ type: FaIconComponent,
69
+ selector: "fa-icon",
70
+ inputs: [
71
+ "icon",
72
+ "title",
73
+ "animation",
74
+ "mask",
75
+ "flip",
76
+ "size",
77
+ "pull",
78
+ "border",
79
+ "inverse",
80
+ "symbol",
81
+ "rotate",
82
+ "fixedWidth",
83
+ "transform",
84
+ "a11yRole"
85
+ ],
86
+ outputs: [
87
+ "iconChange",
88
+ "titleChange",
89
+ "animationChange",
90
+ "maskChange",
91
+ "flipChange",
92
+ "sizeChange",
93
+ "pullChange",
94
+ "borderChange",
95
+ "inverseChange",
96
+ "symbolChange",
97
+ "rotateChange",
98
+ "fixedWidthChange",
99
+ "transformChange",
100
+ "a11yRoleChange"
101
+ ]
102
+ }, {
103
+ kind: "component",
104
+ type: i1$1.DaffIconButtonComponent,
105
+ selector: "button[daff-icon-button],a[daff-icon-button]"
106
+ }],
107
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
108
+ });
109
+ }
110
+ };
111
+ i0.ɵɵngDeclareClassMetadata({
112
+ minVersion: "12.0.0",
113
+ version: "22.2.4",
114
+ ngImport: i0,
115
+ type: DaffArticleCopyButtonComponent,
116
+ decorators: [{
117
+ type: Component,
118
+ args: [{
119
+ selector: "daff-article-copy-button",
120
+ changeDetection: ChangeDetectionStrategy.OnPush,
121
+ imports: [FaIconComponent, DAFF_ICON_BUTTON_COMPONENTS],
122
+ 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",
123
+ styles: [":host{display:block;position:absolute;top:.25rem;right:.25rem;z-index:1}\n"]
124
+ }]
125
+ }],
126
+ propDecorators: { content: [{
127
+ type: i0.Input,
128
+ args: [{
129
+ isSignal: true,
130
+ alias: "content",
131
+ required: true
132
+ }]
133
+ }] }
134
+ });
135
+ var DaffArticleCopyButtonService = class DaffArticleCopyButtonService {
136
+ constructor() {
137
+ this.buttons = [];
138
+ }
139
+ addCopyButtonsToCodeBlocks(hostElement, viewContainerRef) {
140
+ const codeBlocks = hostElement.querySelectorAll("pre");
141
+ const encapsulatedElements = Array.from(hostElement.querySelectorAll(".daff-ae"));
142
+ codeBlocks.forEach((pre) => {
143
+ const code = pre.querySelector("code");
144
+ if (!code) return;
145
+ if (pre.hasAttribute("nocopy")) return;
146
+ if (encapsulatedElements.some((ee) => ee.contains(pre))) return;
147
+ if (pre.querySelector("daff-article-copy-button")) return;
148
+ const textContent = code.textContent || "";
149
+ const buttonRef = viewContainerRef.createComponent(DaffArticleCopyButtonComponent);
150
+ buttonRef.setInput("content", textContent);
151
+ pre.insertBefore(buttonRef.location.nativeElement, code);
152
+ this.buttons.push({
153
+ buttonRef,
154
+ preElement: pre
155
+ });
156
+ });
157
+ }
158
+ cleanup() {
159
+ this.buttons.forEach(({ buttonRef }) => {
160
+ buttonRef.destroy();
161
+ });
162
+ this.buttons = [];
163
+ }
164
+ static {
165
+ this.ɵfac = i0.ɵɵngDeclareFactory({
166
+ minVersion: "12.0.0",
167
+ version: "22.2.4",
168
+ ngImport: i0,
169
+ type: DaffArticleCopyButtonService,
170
+ deps: [],
171
+ target: i0.ɵɵFactoryTarget.Injectable
172
+ });
173
+ }
174
+ static {
175
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
176
+ minVersion: "12.0.0",
177
+ version: "22.2.4",
178
+ ngImport: i0,
179
+ type: DaffArticleCopyButtonService
180
+ });
181
+ }
182
+ };
183
+ i0.ɵɵngDeclareClassMetadata({
184
+ minVersion: "12.0.0",
185
+ version: "22.2.4",
186
+ ngImport: i0,
187
+ type: DaffArticleCopyButtonService,
188
+ decorators: [{ type: Injectable }]
189
+ });
190
+ var DaffArticleHeadingLinkComponent = class DaffArticleHeadingLinkComponent {
191
+ constructor() {
192
+ this.fragment = input.required(...ngDevMode ? [{ debugName: "fragment" }] : /* istanbul ignore next */ []);
193
+ this.label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
194
+ this.copied = signal(false, ...ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []);
195
+ this.faLink = faLink;
196
+ this.faCheck = faCheck;
197
+ this._ngZone = inject(NgZone);
198
+ this._router = inject(Router);
199
+ this._platformId = inject(PLATFORM_ID);
200
+ this._document = inject(DOCUMENT);
201
+ }
202
+ ngOnDestroy() {
203
+ if (this.timeoutId) clearTimeout(this.timeoutId);
204
+ }
205
+ async copyLink() {
206
+ if (!isPlatformBrowser(this._platformId)) return;
207
+ try {
208
+ const currentUrl = this._router.url.split("#")[0];
209
+ const fullUrl = `${this._document.defaultView?.location.origin || ""}${currentUrl}#${this.fragment()}`;
210
+ await navigator.clipboard.writeText(fullUrl);
211
+ this.copied.set(true);
212
+ clearTimeout(this.timeoutId);
213
+ this._ngZone.runOutsideAngular(() => {
214
+ this.timeoutId = setTimeout(() => {
215
+ this._ngZone.run(() => this.copied.set(false));
216
+ }, 1500);
217
+ });
218
+ } catch (err) {
219
+ console.error("Failed to copy text: ", err);
220
+ }
221
+ }
222
+ get ariaLabel() {
223
+ return this.copied() ? "Copied link to clipboard" : "Copy link to clipboard";
224
+ }
225
+ static {
226
+ this.ɵfac = i0.ɵɵngDeclareFactory({
227
+ minVersion: "12.0.0",
228
+ version: "22.2.4",
229
+ ngImport: i0,
230
+ type: DaffArticleHeadingLinkComponent,
231
+ deps: [],
232
+ target: i0.ɵɵFactoryTarget.Component
233
+ });
234
+ }
235
+ static {
236
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
237
+ minVersion: "17.0.0",
238
+ version: "22.2.4",
239
+ type: DaffArticleHeadingLinkComponent,
240
+ isStandalone: true,
241
+ selector: "daff-article-heading-link",
242
+ inputs: {
243
+ fragment: {
244
+ classPropertyName: "fragment",
245
+ publicName: "fragment",
246
+ isSignal: true,
247
+ isRequired: true,
248
+ transformFunction: null
249
+ },
250
+ label: {
251
+ classPropertyName: "label",
252
+ publicName: "label",
253
+ isSignal: true,
254
+ isRequired: true,
255
+ transformFunction: null
256
+ }
257
+ },
258
+ hostDirectives: [{ directive: i1.DaffArticleEncapsulatedDirective }],
259
+ ngImport: i0,
260
+ template: "<a class=\"daff-article-heading-link__anchor\" routerLink=\".\" [fragment]=\"fragment()\" queryParamsHandling=\"preserve\">\n {{ label() }}\n</a>\n<button class=\"daff-article-heading-link__button\" [attr.aria-label]=\"ariaLabel\" (click)=\"copyLink()\">\n @if (copied()) {\n <fa-icon [icon]=\"faCheck\"></fa-icon>\n } @else {\n <fa-icon [icon]=\"faLink\"></fa-icon>\n }\n</button>\n",
261
+ styles: [":host{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}@media(hover:hover){: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"],
262
+ dependencies: [{
263
+ kind: "directive",
264
+ type: RouterLink,
265
+ selector: "[routerLink]",
266
+ inputs: [
267
+ "target",
268
+ "queryParams",
269
+ "fragment",
270
+ "queryParamsHandling",
271
+ "state",
272
+ "info",
273
+ "relativeTo",
274
+ "preserveFragment",
275
+ "skipLocationChange",
276
+ "replaceUrl",
277
+ "browserUrl",
278
+ "routerLink"
279
+ ]
280
+ }, {
281
+ kind: "component",
282
+ type: FaIconComponent,
283
+ selector: "fa-icon",
284
+ inputs: [
285
+ "icon",
286
+ "title",
287
+ "animation",
288
+ "mask",
289
+ "flip",
290
+ "size",
291
+ "pull",
292
+ "border",
293
+ "inverse",
294
+ "symbol",
295
+ "rotate",
296
+ "fixedWidth",
297
+ "transform",
298
+ "a11yRole"
299
+ ],
300
+ outputs: [
301
+ "iconChange",
302
+ "titleChange",
303
+ "animationChange",
304
+ "maskChange",
305
+ "flipChange",
306
+ "sizeChange",
307
+ "pullChange",
308
+ "borderChange",
309
+ "inverseChange",
310
+ "symbolChange",
311
+ "rotateChange",
312
+ "fixedWidthChange",
313
+ "transformChange",
314
+ "a11yRoleChange"
315
+ ]
316
+ }],
317
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
318
+ });
319
+ }
320
+ };
321
+ i0.ɵɵngDeclareClassMetadata({
322
+ minVersion: "12.0.0",
323
+ version: "22.2.4",
324
+ ngImport: i0,
325
+ type: DaffArticleHeadingLinkComponent,
326
+ decorators: [{
327
+ type: Component,
328
+ args: [{
329
+ selector: "daff-article-heading-link",
330
+ changeDetection: ChangeDetectionStrategy.OnPush,
331
+ hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }],
332
+ imports: [
333
+ RouterLink,
334
+ FaIconComponent,
335
+ DAFF_ICON_BUTTON_COMPONENTS
336
+ ],
337
+ template: "<a class=\"daff-article-heading-link__anchor\" routerLink=\".\" [fragment]=\"fragment()\" queryParamsHandling=\"preserve\">\n {{ label() }}\n</a>\n<button class=\"daff-article-heading-link__button\" [attr.aria-label]=\"ariaLabel\" (click)=\"copyLink()\">\n @if (copied()) {\n <fa-icon [icon]=\"faCheck\"></fa-icon>\n } @else {\n <fa-icon [icon]=\"faLink\"></fa-icon>\n }\n</button>\n",
338
+ styles: [":host{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}@media(hover:hover){: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"]
339
+ }]
340
+ }],
341
+ propDecorators: {
342
+ fragment: [{
343
+ type: i0.Input,
344
+ args: [{
345
+ isSignal: true,
346
+ alias: "fragment",
347
+ required: true
348
+ }]
349
+ }],
350
+ label: [{
351
+ type: i0.Input,
352
+ args: [{
353
+ isSignal: true,
354
+ alias: "label",
355
+ required: true
356
+ }]
357
+ }]
358
+ }
359
+ });
360
+ var DaffArticleHeadingLinkService = class DaffArticleHeadingLinkService {
361
+ constructor() {
362
+ this.links = [];
363
+ }
364
+ addLinksToHeadings(hostElement, viewContainerRef) {
365
+ const headings = hostElement.querySelectorAll("h2, h3, h4");
366
+ const encapsulatedElements = Array.from(hostElement.querySelectorAll(".daff-ae"));
367
+ headings.forEach((heading) => {
368
+ if (heading.querySelector("daff-article-heading-link")) return;
369
+ if (heading.hasAttribute("nolink")) return;
370
+ if (encapsulatedElements.some((ee) => ee.contains(heading))) return;
371
+ const textContent = heading.textContent?.trim() || "";
372
+ const fragment = heading.id || this.generateFragment(textContent);
373
+ if (!heading.id) heading.id = fragment;
374
+ const linkRef = viewContainerRef.createComponent(DaffArticleHeadingLinkComponent);
375
+ linkRef.setInput("fragment", fragment);
376
+ linkRef.setInput("label", textContent);
377
+ heading.innerHTML = "";
378
+ heading.appendChild(linkRef.location.nativeElement);
379
+ this.links.push({
380
+ linkRef,
381
+ headingElement: heading
382
+ });
383
+ });
384
+ }
385
+ cleanup() {
386
+ this.links.forEach(({ linkRef }) => {
387
+ linkRef.destroy();
388
+ });
389
+ this.links = [];
390
+ }
391
+ generateFragment(text) {
392
+ return text.toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").trim();
393
+ }
394
+ static {
395
+ this.ɵfac = i0.ɵɵngDeclareFactory({
396
+ minVersion: "12.0.0",
397
+ version: "22.2.4",
398
+ ngImport: i0,
399
+ type: DaffArticleHeadingLinkService,
400
+ deps: [],
401
+ target: i0.ɵɵFactoryTarget.Injectable
402
+ });
403
+ }
404
+ static {
405
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
406
+ minVersion: "12.0.0",
407
+ version: "22.2.4",
408
+ ngImport: i0,
409
+ type: DaffArticleHeadingLinkService
410
+ });
411
+ }
412
+ };
413
+ i0.ɵɵngDeclareClassMetadata({
414
+ minVersion: "12.0.0",
415
+ version: "22.2.4",
416
+ ngImport: i0,
417
+ type: DaffArticleHeadingLinkService,
418
+ decorators: [{ type: Injectable }]
419
+ });
420
+ var DaffArticleComponent = class DaffArticleComponent {
421
+ constructor(copyButtonService, headingLinkService) {
422
+ this.copyButtonService = copyButtonService;
423
+ this.headingLinkService = headingLinkService;
424
+ const elementRef = inject(ElementRef);
425
+ const viewContainerRef = inject(ViewContainerRef);
426
+ afterEveryRender({ write: () => {
427
+ this.copyButtonService.addCopyButtonsToCodeBlocks(elementRef.nativeElement, viewContainerRef);
428
+ this.headingLinkService.addLinksToHeadings(elementRef.nativeElement, viewContainerRef);
429
+ } });
430
+ inject(DestroyRef).onDestroy(() => {
431
+ this.copyButtonService.cleanup();
432
+ this.headingLinkService.cleanup();
433
+ });
434
+ }
435
+ static {
436
+ this.ɵfac = i0.ɵɵngDeclareFactory({
437
+ minVersion: "12.0.0",
438
+ version: "22.2.4",
439
+ ngImport: i0,
440
+ type: DaffArticleComponent,
441
+ deps: [{ token: DaffArticleCopyButtonService }, { token: DaffArticleHeadingLinkService }],
442
+ target: i0.ɵɵFactoryTarget.Component
443
+ });
444
+ }
445
+ static {
446
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
447
+ minVersion: "14.0.0",
448
+ version: "22.2.4",
449
+ type: DaffArticleComponent,
450
+ isStandalone: true,
451
+ selector: "daff-article",
452
+ host: {
453
+ attributes: { "role": "article" },
454
+ classAttribute: "daff-article"
455
+ },
456
+ providers: [DaffArticleCopyButtonService, DaffArticleHeadingLinkService],
457
+ ngImport: i0,
458
+ template: "<ng-content></ng-content>",
459
+ isInline: true,
460
+ styles: [".daff-article{display:block;overflow:hidden}.daff-article a:not(.daff-ae,:where(.daff-article .daff-ae *)){font-weight:500;text-decoration:none}@media(hover:hover){.daff-article a:not(.daff-ae,:where(.daff-article .daff-ae *)):hover{text-decoration:underline}}.daff-article a:not(.daff-ae,:where(.daff-article .daff-ae *)) code{font-size:var(--daff-font-size-sm);font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)){font-weight:600;margin-bottom:1rem;overflow-wrap:break-word}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)) code{font-size:var(--daff-font-size-sm);font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae,:where(.daff-article .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,:where(.daff-article .daff-ae *)){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p{font-size:1.125rem;line-height:1.5rem;font-weight:400}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p code{font-size:var(--daff-font-size-base);line-height:1rem}@media(min-width:768px){.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p{font-size:1.25rem;font-weight:400;line-height:1.75rem}}.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.75rem;line-height:2rem;margin-top:2.5rem}@media(min-width:768px){.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:2rem;line-height:2.5rem}}.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)):first-child{margin-top:0}.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:var(--daff-font-size-lg);line-height:2rem;margin-top:2.5rem}.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:var(--daff-font-size-md);line-height:1.5rem;margin-top:2rem}.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.125rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:var(--daff-font-size-base);font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article p:not(.daff-ae,:where(.daff-article .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:var(--daff-font-size-sm);overflow-x:auto;padding:1.5rem}.daff-article code{border-radius:.25rem;font-size:var(--daff-font-size-sm);line-height:1rem;padding:.125rem .25rem}.daff-article__meta{font-size:var(--daff-font-size-sm)}.daff-article hr{border:0;height:.0625rem;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"],
461
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
462
+ encapsulation: i0.ViewEncapsulation.None
463
+ });
464
+ }
465
+ };
466
+ i0.ɵɵngDeclareClassMetadata({
467
+ minVersion: "12.0.0",
468
+ version: "22.2.4",
469
+ ngImport: i0,
470
+ type: DaffArticleComponent,
471
+ decorators: [{
472
+ type: Component,
473
+ args: [{
474
+ selector: "daff-article",
475
+ template: "<ng-content></ng-content>",
476
+ host: {
477
+ class: "daff-article",
478
+ role: "article"
479
+ },
480
+ encapsulation: ViewEncapsulation.None,
481
+ changeDetection: ChangeDetectionStrategy.OnPush,
482
+ providers: [DaffArticleCopyButtonService, DaffArticleHeadingLinkService],
483
+ styles: [".daff-article{display:block;overflow:hidden}.daff-article a:not(.daff-ae,:where(.daff-article .daff-ae *)){font-weight:500;text-decoration:none}@media(hover:hover){.daff-article a:not(.daff-ae,:where(.daff-article .daff-ae *)):hover{text-decoration:underline}}.daff-article a:not(.daff-ae,:where(.daff-article .daff-ae *)) code{font-size:var(--daff-font-size-sm);font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)),.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)){font-weight:600;margin-bottom:1rem;overflow-wrap:break-word}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)) code,.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)) code{font-size:var(--daff-font-size-sm);font-weight:600;line-height:.875rem}.daff-article h1:not(.daff-ae,:where(.daff-article .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,:where(.daff-article .daff-ae *)){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p{font-size:1.125rem;line-height:1.5rem;font-weight:400}.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p code{font-size:var(--daff-font-size-base);line-height:1rem}@media(min-width:768px){.daff-article h1:not(.daff-ae,:where(.daff-article .daff-ae *))+p{font-size:1.25rem;font-weight:400;line-height:1.75rem}}.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.75rem;line-height:2rem;margin-top:2.5rem}@media(min-width:768px){.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:2rem;line-height:2.5rem}}.daff-article h2:not(.daff-ae,:where(.daff-article .daff-ae *)):first-child{margin-top:0}.daff-article h3:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:var(--daff-font-size-lg);line-height:2rem;margin-top:2.5rem}.daff-article h4:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:var(--daff-font-size-md);line-height:1.5rem;margin-top:2rem}.daff-article h5:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:1.125rem;font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article h6:not(.daff-ae,:where(.daff-article .daff-ae *)){font-size:var(--daff-font-size-base);font-weight:600;line-height:1.5rem;margin-top:1.5rem}.daff-article p:not(.daff-ae,:where(.daff-article .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:var(--daff-font-size-sm);overflow-x:auto;padding:1.5rem}.daff-article code{border-radius:.25rem;font-size:var(--daff-font-size-sm);line-height:1rem;padding:.125rem .25rem}.daff-article__meta{font-size:var(--daff-font-size-sm)}.daff-article hr{border:0;height:.0625rem;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"]
484
+ }]
485
+ }],
486
+ ctorParameters: () => [{ type: DaffArticleCopyButtonService }, { type: DaffArticleHeadingLinkService }]
487
+ });
488
+ var DaffArticleMetaDirective = class DaffArticleMetaDirective {
489
+ static {
490
+ this.ɵfac = i0.ɵɵngDeclareFactory({
491
+ minVersion: "12.0.0",
492
+ version: "22.2.4",
493
+ ngImport: i0,
494
+ type: DaffArticleMetaDirective,
495
+ deps: [],
496
+ target: i0.ɵɵFactoryTarget.Directive
497
+ });
498
+ }
499
+ static {
500
+ this.ɵdir = i0.ɵɵngDeclareDirective({
501
+ minVersion: "14.0.0",
502
+ version: "22.2.4",
503
+ type: DaffArticleMetaDirective,
504
+ isStandalone: true,
505
+ selector: "[daffArticleMeta]",
506
+ host: { classAttribute: "daff-article__meta" },
507
+ ngImport: i0
508
+ });
509
+ }
510
+ };
511
+ i0.ɵɵngDeclareClassMetadata({
512
+ minVersion: "12.0.0",
513
+ version: "22.2.4",
514
+ ngImport: i0,
515
+ type: DaffArticleMetaDirective,
516
+ decorators: [{
517
+ type: Directive,
518
+ args: [{
519
+ selector: "[daffArticleMeta]",
520
+ host: { "class": "daff-article__meta" }
521
+ }]
522
+ }]
523
+ });
524
+ var DaffArticleModule = class DaffArticleModule {
525
+ static {
526
+ this.ɵfac = i0.ɵɵngDeclareFactory({
527
+ minVersion: "12.0.0",
528
+ version: "22.2.4",
529
+ ngImport: i0,
530
+ type: DaffArticleModule,
531
+ deps: [],
532
+ target: i0.ɵɵFactoryTarget.NgModule
533
+ });
534
+ }
535
+ static {
536
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
537
+ minVersion: "14.0.0",
538
+ version: "22.2.4",
539
+ ngImport: i0,
540
+ type: DaffArticleModule,
541
+ imports: [
542
+ CommonModule,
543
+ DaffArticleComponent,
544
+ DaffArticleMetaDirective
545
+ ],
546
+ exports: [DaffArticleComponent, DaffArticleMetaDirective]
547
+ });
548
+ }
549
+ static {
550
+ this.ɵinj = i0.ɵɵngDeclareInjector({
551
+ minVersion: "12.0.0",
552
+ version: "22.2.4",
553
+ ngImport: i0,
554
+ type: DaffArticleModule,
555
+ imports: [CommonModule]
556
+ });
557
+ }
558
+ };
559
+ i0.ɵɵngDeclareClassMetadata({
560
+ minVersion: "12.0.0",
561
+ version: "22.2.4",
562
+ ngImport: i0,
563
+ type: DaffArticleModule,
564
+ decorators: [{
565
+ type: NgModule,
566
+ args: [{
567
+ imports: [
568
+ CommonModule,
569
+ DaffArticleComponent,
570
+ DaffArticleMetaDirective
571
+ ],
572
+ exports: [DaffArticleComponent, DaffArticleMetaDirective]
573
+ }]
574
+ }]
575
+ });
576
+ const DAFF_ARTICLE_COMPONENTS = [DaffArticleComponent, DaffArticleMetaDirective];
340
577
  export { DAFF_ARTICLE_COMPONENTS, DaffArticleComponent, DaffArticleMetaDirective, DaffArticleModule };
341
- //# sourceMappingURL=daffodil-design-article.mjs.map
578
+
579
+ //# sourceMappingURL=daffodil-design-article.mjs.map