@rxap/directives 19.1.0 → 19.2.0-dev.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 (106) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/compodoc/changelog.html +27 -0
  3. package/compodoc/dependencies.html +4 -4
  4. package/compodoc/directives/AvatarBackgroundImageDirective.html +5 -5
  5. package/compodoc/directives/BackgroundImageDirective.html +20 -15
  6. package/compodoc/directives/ContenteditableDirective.html +15 -5
  7. package/compodoc/directives/IfTruthyDirective.html +5 -2
  8. package/compodoc/interfaces/ContenteditableEvent.html +15 -5
  9. package/compodoc/interfaces/IfTruthyDirectiveTemplateContext.html +3 -0
  10. package/compodoc/js/menu-wc.js +5 -0
  11. package/compodoc/js/menu-wc_es5.js +1 -1
  12. package/compodoc/js/search/search_index.js +2 -2
  13. package/compodoc/properties.html +1 -1
  14. package/compodoc/todo.html +269 -0
  15. package/docs/documentation.json +854 -854
  16. package/docs/html/classes/AvatarBackgroundImageDirective.html +4 -4
  17. package/docs/html/classes/BackgroundImageDirective.html +4 -4
  18. package/docs/html/classes/ConfirmClick.html +2 -2
  19. package/docs/html/classes/ContenteditableDirective.html +2 -2
  20. package/docs/html/classes/FullWidthDirective.html +2 -2
  21. package/docs/html/classes/IfTruthyDirective.html +4 -4
  22. package/docs/html/classes/IsDevModeDirective.html +4 -4
  23. package/docs/html/classes/MethodDirective.html +4 -4
  24. package/docs/html/classes/MethodTemplateDirective.html +5 -5
  25. package/docs/html/classes/MovableDividerDirective.html +4 -4
  26. package/docs/html/classes/PreventDefaultDirective.html +2 -2
  27. package/docs/html/classes/ShareButtonDirective.html +2 -2
  28. package/docs/html/classes/ShareService.html +2 -2
  29. package/docs/html/classes/StopImmediatePropagationDirective.html +2 -2
  30. package/docs/html/classes/StopPropagationDirective.html +2 -2
  31. package/docs/html/enums/BackgroundPositionOptions.html +2 -2
  32. package/docs/html/enums/BackgroundRepeatOptions.html +2 -2
  33. package/docs/html/enums/BackgroundSizeOptions.html +2 -2
  34. package/docs/html/enums/GlobalStyleOptions.html +2 -2
  35. package/docs/html/hierarchy.html +1 -1
  36. package/docs/html/index.html +2 -2
  37. package/docs/html/interfaces/ContenteditableEvent.html +2 -2
  38. package/docs/html/interfaces/IfTruthyDirectiveTemplateContext.html +2 -2
  39. package/docs/html/interfaces/MethodTemplateDirectiveContext.html +2 -2
  40. package/docs/html/interfaces/MethodTemplateDirectiveErrorContext.html +2 -2
  41. package/docs/html/interfaces/ShareData.html +2 -2
  42. package/docs/html/modules.html +1 -1
  43. package/docs/html/types/BackgroundPosition.html +1 -1
  44. package/docs/html/types/BackgroundRepeat.html +1 -1
  45. package/docs/html/types/BackgroundSize.html +1 -1
  46. package/docs/markdown/README.md +1 -1
  47. package/docs/markdown/classes/AvatarBackgroundImageDirective.md +11 -11
  48. package/docs/markdown/classes/BackgroundImageDirective.md +10 -10
  49. package/docs/markdown/classes/ConfirmClick.md +6 -6
  50. package/docs/markdown/classes/ContenteditableDirective.md +11 -11
  51. package/docs/markdown/classes/FullWidthDirective.md +3 -3
  52. package/docs/markdown/classes/IfTruthyDirective.md +10 -10
  53. package/docs/markdown/classes/IsDevModeDirective.md +5 -5
  54. package/docs/markdown/classes/MethodDirective.md +19 -19
  55. package/docs/markdown/classes/MethodTemplateDirective.md +27 -27
  56. package/docs/markdown/classes/MovableDividerDirective.md +10 -10
  57. package/docs/markdown/classes/PreventDefaultDirective.md +3 -3
  58. package/docs/markdown/classes/ShareButtonDirective.md +9 -9
  59. package/docs/markdown/classes/ShareService.md +4 -4
  60. package/docs/markdown/classes/StopImmediatePropagationDirective.md +3 -3
  61. package/docs/markdown/classes/StopPropagationDirective.md +3 -3
  62. package/docs/markdown/enumerations/BackgroundPositionOptions.md +4 -4
  63. package/docs/markdown/enumerations/BackgroundRepeatOptions.md +3 -3
  64. package/docs/markdown/enumerations/BackgroundSizeOptions.md +5 -5
  65. package/docs/markdown/enumerations/GlobalStyleOptions.md +4 -4
  66. package/docs/markdown/globals.md +2 -2
  67. package/docs/markdown/interfaces/ContenteditableEvent.md +4 -4
  68. package/docs/markdown/interfaces/IfTruthyDirectiveTemplateContext.md +3 -3
  69. package/docs/markdown/interfaces/MethodTemplateDirectiveContext.md +3 -3
  70. package/docs/markdown/interfaces/MethodTemplateDirectiveErrorContext.md +4 -4
  71. package/docs/markdown/interfaces/ShareData.md +6 -6
  72. package/docs/markdown/type-aliases/BackgroundPosition.md +2 -2
  73. package/docs/markdown/type-aliases/BackgroundRepeat.md +2 -2
  74. package/docs/markdown/type-aliases/BackgroundSize.md +2 -2
  75. package/docs/wiki/Class.AvatarBackgroundImageDirective.md +10 -10
  76. package/docs/wiki/Class.BackgroundImageDirective.md +9 -9
  77. package/docs/wiki/Class.ConfirmClick.md +5 -5
  78. package/docs/wiki/Class.ContenteditableDirective.md +10 -10
  79. package/docs/wiki/Class.FullWidthDirective.md +2 -2
  80. package/docs/wiki/Class.IfTruthyDirective.md +9 -9
  81. package/docs/wiki/Class.IsDevModeDirective.md +4 -4
  82. package/docs/wiki/Class.MethodDirective.md +18 -18
  83. package/docs/wiki/Class.MethodTemplateDirective.md +26 -26
  84. package/docs/wiki/Class.MovableDividerDirective.md +9 -9
  85. package/docs/wiki/Class.PreventDefaultDirective.md +2 -2
  86. package/docs/wiki/Class.ShareButtonDirective.md +8 -8
  87. package/docs/wiki/Class.ShareService.md +3 -3
  88. package/docs/wiki/Class.StopImmediatePropagationDirective.md +2 -2
  89. package/docs/wiki/Class.StopPropagationDirective.md +2 -2
  90. package/docs/wiki/Enumeration.BackgroundPositionOptions.md +3 -3
  91. package/docs/wiki/Enumeration.BackgroundRepeatOptions.md +2 -2
  92. package/docs/wiki/Enumeration.BackgroundSizeOptions.md +4 -4
  93. package/docs/wiki/Enumeration.GlobalStyleOptions.md +3 -3
  94. package/docs/wiki/Interface.ContenteditableEvent.md +3 -3
  95. package/docs/wiki/Interface.IfTruthyDirectiveTemplateContext.md +2 -2
  96. package/docs/wiki/Interface.MethodTemplateDirectiveContext.md +2 -2
  97. package/docs/wiki/Interface.MethodTemplateDirectiveErrorContext.md +3 -3
  98. package/docs/wiki/Interface.ShareData.md +5 -5
  99. package/docs/wiki/TypeAlias.BackgroundPosition.md +1 -1
  100. package/docs/wiki/TypeAlias.BackgroundRepeat.md +1 -1
  101. package/docs/wiki/TypeAlias.BackgroundSize.md +1 -1
  102. package/docs/wiki/globals.md +1 -1
  103. package/fesm2022/rxap-directives.mjs +30 -13
  104. package/fesm2022/rxap-directives.mjs.map +1 -1
  105. package/lib/background-image.directive.d.ts +1 -0
  106. package/package.json +9 -10
@@ -102,7 +102,7 @@
102
102
  </ol>
103
103
  <ul class="properties-list">
104
104
  <li>
105
- <b>Version</b> : 19.1.0</li>
105
+ <b>Version</b> : 19.2.0-dev.0</li>
106
106
  <li>
107
107
  <b>Description</b> : This package provides a set of Angular directives to simplify common tasks such as setting background images, confirming clicks, making elements contenteditable, and more. It includes directives for handling UI interactions, applying styles, and managing asynchronous operations. These directives aim to reduce boilerplate code and improve the reusability of components in Angular applications.
108
108
  </li>
@@ -0,0 +1,269 @@
1
+ <!doctype html>
2
+ <html class="no-js" lang="">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
6
+ <title>angular-directives</title>
7
+ <meta name="description" content="">
8
+ <meta name="viewport" content="width=device-width, initial-scale=1">
9
+
10
+ <link rel="icon" type="image/x-icon" href="./images/favicon.ico">
11
+ <link rel="stylesheet" href="./styles/style.css">
12
+ <link rel="stylesheet" href="./styles/dark.css">
13
+ </head>
14
+ <body>
15
+ <script>
16
+ // Blocking script to avoid flickering dark mode
17
+ // Dark mode toggle button
18
+ var useDark = window.matchMedia('(prefers-color-scheme: dark)');
19
+ var darkModeState = useDark.matches;
20
+ var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
21
+ var $darkModeToggles = document.querySelectorAll('.dark-mode-switch');
22
+ var darkModeStateLocal = localStorage.getItem('compodoc_darkmode-state');
23
+
24
+ function checkToggle(check) {
25
+ for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
26
+ $darkModeToggleSwitchers[i].checked = check;
27
+ }
28
+ }
29
+
30
+ function toggleDarkMode(state) {
31
+ if (window.localStorage) {
32
+ localStorage.setItem('compodoc_darkmode-state', state);
33
+ }
34
+
35
+ checkToggle(state);
36
+
37
+ const hasClass = document.body.classList.contains('dark');
38
+
39
+ if (state) {
40
+ for (var i = 0; i < $darkModeToggles.length; i++) {
41
+ $darkModeToggles[i].classList.add('dark');
42
+ }
43
+ if (!hasClass) {
44
+ document.body.classList.add('dark');
45
+ }
46
+ } else {
47
+ for (var i = 0; i < $darkModeToggles.length; i++) {
48
+ $darkModeToggles[i].classList.remove('dark');
49
+ }
50
+ if (hasClass) {
51
+ document.body.classList.remove('dark');
52
+ }
53
+ }
54
+ }
55
+
56
+ useDark.addEventListener('change', function (evt) {
57
+ toggleDarkMode(evt.matches);
58
+ });
59
+ if (darkModeStateLocal) {
60
+ darkModeState = darkModeStateLocal === 'true';
61
+ }
62
+ toggleDarkMode(darkModeState);
63
+ </script>
64
+
65
+ <div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
66
+ <div class="d-flex">
67
+ <a href="./" class="navbar-brand">angular-directives</a>
68
+ <button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
69
+ </div>
70
+ </div>
71
+
72
+ <div class="xs-menu menu" id="mobile-menu">
73
+ <div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
74
+ </div>
75
+
76
+ <div class="container-fluid main">
77
+ <div class="row main">
78
+ <div class="d-none d-md-block menu">
79
+ <compodoc-menu mode="normal"></compodoc-menu>
80
+ </div>
81
+ <!-- START CONTENT -->
82
+ <div class="content getting-started">
83
+ <div class="content-data">
84
+
85
+ <h1>TODO: angular-directives Auditing &amp; Improvements</h1>
86
+ <p>This file lists the critical bugs, architectural debt, performance bottlenecks, and test coverage improvements identified during the project audit of <code>@rxap/directives</code>.</p>
87
+ <hr>
88
+ <h2>🚨 Critical &amp; Severe Bugs</h2>
89
+ <h3>1. <code>ContenteditableDirective</code> — Hardcoded Length Restriction</h3>
90
+ <ul>
91
+ <li><strong>File</strong>: <code>packages/angular/directives/src/lib/contenteditable.directive.ts</code> (Lines 53-55)</li>
92
+ <li><strong>Issue</strong>: The guard <code>if (value &amp;&amp; value.length &gt;= 2)</code> prevents any updates or saving if the value is cleared (length 0) or consists of a single character. This makes it impossible for users to delete their content or write short text.</li>
93
+ <li><strong>Recommended Fix</strong>: Make this length guard configurable (via an <code>@Input()</code>) or remove the arbitrary <code>length &gt;= 2</code> restriction.</li>
94
+ </ul>
95
+ <h3>2. <code>ShareService</code> — Non-SSR-Safe direct <code>navigator</code> reference (Server Crash Risk)</h3>
96
+ <ul>
97
+ <li><strong>File</strong>: <code>packages/angular/directives/src/lib/share-button.directive.ts</code> (Line 20)</li>
98
+ <li><strong>Issue</strong>: Class property <code>readonly isSupported = &#39;share&#39; in navigator &amp;&amp; ...</code> references the global <code>navigator</code> directly during instantiation. When running in Angular Server-Side Rendering (SSR) or Prerendering (Universal), <code>navigator</code> is <code>undefined</code>, causing a fatal crash of the rendering process.</li>
99
+ <li><strong>Recommended Fix</strong>: Use a getter or wrap the <code>navigator</code> check with a safe check for the platform type or existence of <code>navigator</code>:<b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">get isSupported(): boolean {
100
+ return typeof navigator !== &#39;undefined&#39; &amp;&amp; &#39;share&#39; in navigator &amp;&amp; &#39;canShare&#39; in navigator;
101
+ }</code></pre></div></li>
102
+ </ul>
103
+ <hr>
104
+ <h2>📐 Architectural &amp; Design Debt</h2>
105
+ <h3>1. Directive Selector Collision (<code>[rxapMethod]</code>)</h3>
106
+ <ul>
107
+ <li><strong>Files</strong>:<ul>
108
+ <li><code>packages/angular/directives/src/lib/method.directive.ts</code></li>
109
+ <li><code>packages/angular/directives/src/lib/method-template.directive.ts</code></li>
110
+ </ul>
111
+ </li>
112
+ <li><strong>Issue</strong>: Both <code>MethodDirective</code> and <code>MethodTemplateDirective</code> share the identical selector <code>[rxapMethod]</code> and exportAs <code>rxapMethod</code>. This can cause Angular&#39;s compiler to apply both directives simultaneously to an element, leading to unintended side-effects and confusion.</li>
113
+ <li><strong>Recommended Fix</strong>: Give them unique, expressive selectors (e.g. <code>[rxapMethod]</code> and <code>[rxapMethodTemplate]</code>).</li>
114
+ </ul>
115
+ <h3>2. <code>MovableDividerDirective</code> — Huge <code>mousemove</code> Change Detection Overhead</h3>
116
+ <ul>
117
+ <li><strong>File</strong>: <code>packages/angular/directives/src/lib/movable-divider.directive.ts</code> (Lines 56-87)</li>
118
+ <li><strong>Issue</strong>: It subscribes to <code>mousemove</code> on the <code>containerElement</code> inside Angular&#39;s zone for its entire lifecycle. This triggers application-wide Angular change detection on <em>every single mouse movement</em> inside that container, even when the user is not actively dragging the divider!</li>
119
+ <li><strong>Recommended Fix</strong>: Either run the events outside Angular zone using <code>NgZone.runOutsideAngular</code> or register the <code>mousemove</code> and <code>mouseup</code> subscriptions dynamically inside the <code>mousedown</code> handler, and unsubscribe immediately upon <code>mouseup</code>:<b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">&#64;HostListener(&#39;mousedown&#39;)
120
+ public onMousedown() {
121
+ this._moveDivider = true;
122
+
123
+ // Dynamically register dragging listeners outside Angular Zone
124
+ this.ngZone.runOutsideAngular(() =&gt; {
125
+ const moveSub = fromEvent&lt;MouseEvent&gt;(this.containerElement, &#39;mousemove&#39;).subscribe(($event) =&gt; {
126
+ if (this._moveDivider) {
127
+ // ... calculate width ...
128
+ this.renderer.setStyle(this.fixedElement, &#39;max-width&#39;, width);
129
+ }
130
+ });
131
+
132
+ const upSub = fromEvent(this.containerElement, &#39;mouseup&#39;).subscribe(() =&gt; {
133
+ this._moveDivider = false;
134
+ moveSub.unsubscribe();
135
+ upSub.unsubscribe();
136
+ });
137
+ });
138
+ }</code></pre></div></li>
139
+ </ul>
140
+ <h3>3. Dead Code in <code>MethodTemplateDirective</code></h3>
141
+ <ul>
142
+ <li><strong>File</strong>: <code>packages/angular/directives/src/lib/method-template.directive.ts</code></li>
143
+ <li><strong>Issue</strong>: <code>@Input() public immediately = false;</code> is declared but never referenced or implemented in the class.</li>
144
+ <li><strong>Recommended Fix</strong>: Either implement the immediate execution logic in <code>ngOnInit</code> or remove the dead property.</li>
145
+ </ul>
146
+ <h3>4. Incorrect Decorator on Base Class <code>ConfirmClick</code></h3>
147
+ <ul>
148
+ <li><strong>File</strong>: <code>packages/angular/directives/src/lib/confirm-click.ts</code></li>
149
+ <li><strong>Issue</strong>: <code>ConfirmClick</code> is an abstract base class declaring Angular features (inputs, host listeners) but is decorated with <code>@Injectable()</code> instead of <code>@Directive()</code>.</li>
150
+ <li><strong>Recommended Fix</strong>: Change <code>@Injectable()</code> to <code>@Directive()</code> (with no selector) to comply with Ivy inheritance guidelines:<b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">import { Directive } from &#39;&#64;angular/core&#39;;
151
+ // ...
152
+ &#64;Directive()
153
+ export abstract class ConfirmClick { ... }</code></pre></div></li>
154
+ </ul>
155
+ <hr>
156
+ <h2>🧪 Test Coverage Debt</h2>
157
+ <ul>
158
+ <li><strong>Status (2026-06)</strong>: Improving. <code>ContenteditableDirective</code> (revert-on-save) and
159
+ <code>IfTruthyDirective</code> (track-by churn) now have specs, and <code>background-image.directive.spec.ts</code>
160
+ gained coverage for clearing and the load race condition.</li>
161
+ <li><strong>Remaining Actions</strong>:<ol>
162
+ <li>Un-skip and fix the disabled test in <code>background-image.directive.spec.ts</code>
163
+ (<code>xit(&#39;should add background image to element&#39;</code>).</li>
164
+ <li>Implement unit test suites for the remaining directives:<ul>
165
+ <li><code>AvatarBackgroundImageDirective</code></li>
166
+ <li><code>IsDevModeDirective</code></li>
167
+ <li><code>MethodTemplateDirective</code></li>
168
+ <li><code>MethodDirective</code></li>
169
+ <li><code>MovableDividerDirective</code></li>
170
+ <li><code>ShareButtonDirective</code></li>
171
+ <li><code>StopPropagationDirective</code> / <code>StopImmediatePropagationDirective</code> / <code>PreventDefaultDirective</code></li>
172
+ </ul>
173
+ </li>
174
+ </ol>
175
+ </li>
176
+ </ul>
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+ </div><div class="search-results">
199
+ <div class="has-results">
200
+ <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
201
+ <ul class="search-results-list"></ul>
202
+ </div>
203
+ <div class="no-results">
204
+ <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
205
+ </div>
206
+ </div>
207
+ </div>
208
+ <!-- END CONTENT -->
209
+ </div>
210
+ </div>
211
+
212
+ <label class="dark-mode-switch">
213
+ <input type="checkbox">
214
+ <span class="slider">
215
+ <svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
216
+ <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
217
+ </svg>
218
+ </span>
219
+ </label>
220
+
221
+ <script>
222
+ var COMPODOC_CURRENT_PAGE_DEPTH = 0;
223
+ var COMPODOC_CURRENT_PAGE_CONTEXT = 'getting-started';
224
+ var COMPODOC_CURRENT_PAGE_URL = 'todo.html';
225
+ var MAX_SEARCH_RESULTS = 15;
226
+ </script>
227
+
228
+ <script>
229
+ $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
230
+ checkToggle(darkModeState);
231
+ if ($darkModeToggleSwitchers.length > 0) {
232
+ for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
233
+ $darkModeToggleSwitchers[i].addEventListener('change', function (event) {
234
+ darkModeState = !darkModeState;
235
+ toggleDarkMode(darkModeState);
236
+ });
237
+ }
238
+ }
239
+ </script>
240
+
241
+ <script src="./js/libs/custom-elements.min.js"></script>
242
+ <script src="./js/libs/lit-html.js"></script>
243
+
244
+ <script src="./js/menu-wc.js" defer></script>
245
+ <script nomodule src="./js/menu-wc_es5.js" defer></script>
246
+
247
+ <script src="./js/libs/bootstrap-native.js"></script>
248
+
249
+ <script src="./js/libs/es6-shim.min.js"></script>
250
+ <script src="./js/libs/EventDispatcher.js"></script>
251
+ <script src="./js/libs/promise.min.js"></script>
252
+ <script src="./js/libs/zepto.min.js"></script>
253
+
254
+ <script src="./js/compodoc.js"></script>
255
+
256
+ <script src="./js/tabs.js"></script>
257
+ <script src="./js/menu.js"></script>
258
+ <script src="./js/libs/clipboard.min.js"></script>
259
+ <script src="./js/libs/prism.js"></script>
260
+ <script src="./js/sourceCode.js"></script>
261
+ <script src="./js/search/search.js"></script>
262
+ <script src="./js/search/lunr.min.js"></script>
263
+ <script src="./js/search/search-lunr.js"></script>
264
+ <script src="./js/search/search_index.js"></script>
265
+ <script src="./js/lazy-load-graphs.js"></script>
266
+
267
+
268
+ </body>
269
+ </html>