@rxap/pipes 22.0.0-dev.0 โ†’ 22.0.0-dev.2

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 (107) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +5 -3
  3. package/compodoc/architecture.html +222 -0
  4. package/compodoc/changelog.html +74 -5
  5. package/compodoc/dependencies.html +92 -19
  6. package/compodoc/index.html +50 -8
  7. package/compodoc/js/architecture-graph.js +288 -0
  8. package/compodoc/js/libs/bootstrap-native.js +4 -2
  9. package/compodoc/js/libs/jszip.min.js +13 -0
  10. package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
  11. package/compodoc/js/libs/tablesort.min.js +3 -3
  12. package/compodoc/js/libs/tablesort.number.min.js +3 -3
  13. package/compodoc/js/libs/vis-network.min.js +78 -0
  14. package/compodoc/js/menu-wc.js +26 -13
  15. package/compodoc/js/menu.js +10 -11
  16. package/compodoc/js/routes/routes_index.js +1 -0
  17. package/compodoc/js/routes.js +142 -34
  18. package/compodoc/js/search/search-lunr.js +6 -8
  19. package/compodoc/js/search/search.js +118 -66
  20. package/compodoc/js/search/search_index.js +2 -2
  21. package/compodoc/js/tabs.js +98 -15
  22. package/compodoc/js/tree.js +44 -7
  23. package/compodoc/license.html +48 -6
  24. package/compodoc/llms.txt +110 -0
  25. package/compodoc/miscellaneous/functions.html +129 -6
  26. package/compodoc/miscellaneous/variables.html +51 -4
  27. package/compodoc/modules.html +44 -3
  28. package/compodoc/overview.html +55 -4
  29. package/compodoc/pipes/DeleteIdentifierPipe.html +89 -12
  30. package/compodoc/pipes/EscapeQuotationMarkPipe.html +89 -11
  31. package/compodoc/pipes/GetFromObjectPipe.html +86 -10
  32. package/compodoc/pipes/JoinPipe.html +86 -10
  33. package/compodoc/pipes/LimitPipe.html +88 -11
  34. package/compodoc/pipes/ReplacePipe.html +87 -10
  35. package/compodoc/pipes/RxapCurrencyPipe.html +87 -10
  36. package/compodoc/pipes/SlicePipe.html +88 -11
  37. package/compodoc/pipes/ToDisplayPipe.html +87 -10
  38. package/compodoc/pipes/TruncatePipe.html +86 -10
  39. package/compodoc/properties.html +45 -4
  40. package/compodoc/routes.html +227 -0
  41. package/compodoc/styles/compodoc.css +365 -44
  42. package/compodoc/styles/dark.css +16 -0
  43. package/compodoc/template-playground/default-templates.json +192 -0
  44. package/compodoc/template-playground/hbs-render.service.ts +217 -0
  45. package/compodoc/template-playground/main.ts +9 -0
  46. package/compodoc/template-playground/template-editor.service.ts +173 -0
  47. package/compodoc/template-playground/template-playground.component.ts +614 -0
  48. package/compodoc/template-playground/template-playground.module.ts +29 -0
  49. package/compodoc/template-playground/zip-export.service.ts +86 -0
  50. package/compodoc/template-playground-app/app.js +1389 -0
  51. package/compodoc/template-playground-app/index.html +462 -0
  52. package/compodoc/todo.html +45 -136
  53. package/docs/documentation.json +224 -124
  54. package/docs/html/assets/highlight.css +1 -1
  55. package/docs/html/assets/icons.js +1 -1
  56. package/docs/html/assets/icons.svg +1 -1
  57. package/docs/html/assets/main.js +5 -5
  58. package/docs/html/assets/search.js +1 -1
  59. package/docs/html/assets/style.css +265 -228
  60. package/docs/html/classes/DeleteIdentifierPipe.html +87 -3
  61. package/docs/html/classes/EscapeQuotationMarkPipe.html +84 -3
  62. package/docs/html/classes/GetFromObjectPipe.html +84 -3
  63. package/docs/html/classes/JoinPipe.html +84 -3
  64. package/docs/html/classes/LimitPipe.html +88 -3
  65. package/docs/html/classes/ReplacePipe.html +85 -3
  66. package/docs/html/classes/RxapCurrencyPipe.html +97 -8
  67. package/docs/html/classes/SlicePipe.html +89 -3
  68. package/docs/html/classes/ToDisplayPipe.html +84 -3
  69. package/docs/html/classes/TruncatePipe.html +85 -3
  70. package/docs/html/hierarchy.html +29 -0
  71. package/docs/html/index.html +44 -7
  72. package/docs/html/modules.html +36 -1
  73. package/docs/markdown/README.md +6 -4
  74. package/docs/markdown/classes/DeleteIdentifierPipe.md +12 -10
  75. package/docs/markdown/classes/EscapeQuotationMarkPipe.md +8 -8
  76. package/docs/markdown/classes/GetFromObjectPipe.md +6 -6
  77. package/docs/markdown/classes/JoinPipe.md +7 -7
  78. package/docs/markdown/classes/LimitPipe.md +9 -7
  79. package/docs/markdown/classes/ReplacePipe.md +6 -6
  80. package/docs/markdown/classes/RxapCurrencyPipe.md +10 -10
  81. package/docs/markdown/classes/SlicePipe.md +10 -8
  82. package/docs/markdown/classes/ToDisplayPipe.md +8 -8
  83. package/docs/markdown/classes/TruncatePipe.md +8 -8
  84. package/docs/markdown/globals.md +2 -2
  85. package/docs/wiki/Class.DeleteIdentifierPipe.md +11 -9
  86. package/docs/wiki/Class.EscapeQuotationMarkPipe.md +7 -7
  87. package/docs/wiki/Class.GetFromObjectPipe.md +5 -5
  88. package/docs/wiki/Class.JoinPipe.md +6 -6
  89. package/docs/wiki/Class.LimitPipe.md +8 -6
  90. package/docs/wiki/Class.ReplacePipe.md +5 -5
  91. package/docs/wiki/Class.RxapCurrencyPipe.md +9 -9
  92. package/docs/wiki/Class.SlicePipe.md +9 -7
  93. package/docs/wiki/Class.ToDisplayPipe.md +7 -7
  94. package/docs/wiki/Class.TruncatePipe.md +7 -7
  95. package/docs/wiki/Home.md +5 -3
  96. package/docs/wiki/globals.md +1 -1
  97. package/generators.json +16 -0
  98. package/package.json +10 -12
  99. package/src/generators/init/generator.js +120 -0
  100. package/src/generators/init/index.js +6 -0
  101. package/src/generators/init/schema.json +8 -0
  102. package/src/generators/package.json +3 -0
  103. package/compodoc/js/libs/vis.min.js +0 -47
  104. package/compodoc/js/menu-wc_es5.js +0 -40
  105. package/compodoc/modules/CurrencyPipeModule/dependencies.svg +0 -66
  106. package/compodoc/modules/CurrencyPipeModule.html +0 -390
  107. package/theme.css +0 -1
@@ -61,6 +61,20 @@
61
61
  }
62
62
  toggleDarkMode(darkModeState);
63
63
  </script>
64
+ <script>
65
+ // --- Iframe navigation tracking for Template Playground ---
66
+ function sendCurrentUrlToParent() {
67
+ if (window.parent && window.parent !== window) {
68
+ window.parent.postMessage({
69
+ type: 'compodoc-iframe-navigate',
70
+ url: window.location.pathname + window.location.hash
71
+ }, '*');
72
+ }
73
+ }
74
+ window.addEventListener('hashchange', sendCurrentUrlToParent, false);
75
+ window.addEventListener('popstate', sendCurrentUrlToParent, false);
76
+ window.addEventListener('DOMContentLoaded', sendCurrentUrlToParent, false);
77
+ </script>
64
78
 
65
79
  <div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
66
80
  <div class="d-flex">
@@ -70,7 +84,14 @@
70
84
  </div>
71
85
 
72
86
  <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>
87
+ <div id="book-search-input" role="search">
88
+ <input type="text" placeholder="Type to search">
89
+ <button type="button"
90
+ class="search-input-clear"
91
+ aria-label="Clear search"
92
+ data-search-input-clear>&times;</button>
93
+ </div>
94
+ <compodoc-menu></compodoc-menu>
74
95
  </div>
75
96
 
76
97
  <div class="container-fluid main">
@@ -79,140 +100,12 @@
79
100
  <compodoc-menu mode="normal"></compodoc-menu>
80
101
  </div>
81
102
  <!-- START CONTENT -->
82
- <div class="content getting-started">
103
+ <div class="content todo">
83
104
  <div class="content-data">
84
105
 
85
- <h1>TODO: Angular Pipes Package Audit &amp; Improvements</h1>
86
- <p>This document lists the findings and recommended fixes resulting from the audit of the <code>@rxap/pipes</code> package (located at <code>packages/angular/pipes</code>). </p>
87
- <hr>
88
- <h2>๐Ÿšจ Critical Functional Bugs &amp; Logic Errors</h2>
89
- <h3>1. Runtime Crash Risks (Null/Undefined Vulnerabilities)</h3>
90
- <ul>
91
- <li><strong>Files:</strong> <ul>
92
- <li><a href="file:///mnt/mmuenker/Projects/rxap/packages/packages/angular/pipes/src/lib/join.pipe.ts#L13-L15">join.pipe.ts</a></li>
93
- <li><a href="file:///mnt/mmuenker/Projects/rxap/packages/packages/angular/pipes/src/lib/limit.pipe.ts#L12-L14">limit.pipe.ts</a></li>
94
- <li><a href="file:///mnt/mmuenker/Projects/rxap/packages/packages/angular/pipes/src/lib/slice.pipe.ts#L12-L14">slice.pipe.ts</a></li>
95
- </ul>
96
- </li>
97
- <li><strong>Problem:</strong>
98
- These pipes directly call prototype methods (<code>list.join()</code>, <code>value.slice()</code>) without guarding against <code>null</code> or <code>undefined</code> inputs.</li>
99
- <li><strong>Impact:</strong>
100
- Since Angular templates often deal with asynchronous data streams (e.g., <code>observable$ | async | join</code>), values can start as <code>null</code> or <code>undefined</code> before resolving. These pipes will cause immediate runtime application crashes.</li>
101
- <li><strong>Recommended Fix:</strong>
102
- Implement safe optional-chaining and fallbacks:<b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">// join.pipe.ts
103
- transform(list: any[] | null | undefined, separator?: string): string {
104
- return list ? list.join(separator) : &#39;&#39;;
105
- }
106
-
107
- // limit.pipe.ts &amp; slice.pipe.ts
108
- transform&lt;T&gt;(value: readonly T[] | null | undefined, limit: number): T[] {
109
- return value ? value.slice(0, limit) : [];
110
- }</code></pre></div></li>
111
- </ul>
112
- <hr>
113
- <h2>๐Ÿ›๏ธ Architectural Debt &amp; Design Patterns</h2>
114
- <h3>1. Missing DI Provider in Standalone <code>RxapCurrencyPipe</code></h3>
115
- <ul>
116
- <li><strong>File:</strong> <a href="file:///mnt/mmuenker/Projects/rxap/packages/packages/angular/pipes/src/lib/currency.pipe.ts#L12-L68">currency.pipe.ts</a></li>
117
- <li><strong>Problem:</strong>
118
- <code>RxapCurrencyPipe</code> is marked as a standalone pipe and injects <code>CurrencyPipe</code> (from <code>@angular/common</code>) into its constructor. However, <code>CurrencyPipe</code> is only registered in the <code>providers</code> array of <code>CurrencyPipeModule</code>.</li>
119
- <li><strong>Impact:</strong>
120
- If a developer attempts to import <code>RxapCurrencyPipe</code> directly into a standalone component (the modern Angular 19 convention), the application will crash with a runtime DI error: <code>No provider for CurrencyPipe!</code>.</li>
121
- <li><strong>Recommended Fix:</strong>
122
- Add <code>CurrencyPipe</code> directly to the <code>providers</code> of the pipe&#39;s <code>@Pipe</code> decorator:<b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">&#64;Pipe({
123
- name: &#39;currency&#39;,
124
- standalone: true,
125
- providers: [ CurrencyPipe ] // Ensure it is provided locally
126
- })
127
- export class RxapCurrencyPipe implements PipeTransform { ... }</code></pre></div></li>
128
- </ul>
129
- <h3>2. Duplicate &amp; Conflicting Pipe Name (<code>slice</code>)</h3>
130
- <ul>
131
- <li><strong>File:</strong> <a href="file:///mnt/mmuenker/Projects/rxap/packages/packages/angular/pipes/src/lib/slice.pipe.ts#L7">slice.pipe.ts</a></li>
132
- <li><strong>Problem:</strong>
133
- This pipe is registered with the selector name <code>slice</code>. However, Angular&#39;s <code>@angular/common</code> package already includes a standard <code>SlicePipe</code> registered as <code>slice</code>.</li>
134
- <li><strong>Impact:</strong>
135
- Name clashes in templates make imports and template compilation extremely confusing and error-prone. Additionally, Angular&#39;s built-in <code>slice</code> supports both arrays and strings, while this custom one only types <code>readonly T[]</code>.</li>
136
- <li><strong>Recommended Fix:</strong>
137
- Either rename the pipe selector to a unique name (e.g., <code>rxapSlice</code>), or deprecate and remove the pipe if it is redundant with the standard Angular <code>slice</code> pipe.</li>
138
- </ul>
139
- <h3>3. Typo in Public API Sub-Package (<code>santization</code>)</h3>
140
- <ul>
141
- <li><strong>Files/Directories:</strong> <ul>
142
- <li><code>packages/angular/pipes/santization</code></li>
143
- <li><code>santization.pipe.ts</code></li>
144
- <li><code>santization.service.ts</code></li>
145
- <li><code>SantizationService</code> / <code>SantizationPipe</code></li>
146
- </ul>
147
- </li>
148
- <li><strong>Problem:</strong>
149
- The word <strong>Sanitization</strong> is misspelled as <strong>Santization</strong> (missing the &quot;i&quot; after &quot;t&quot;) across all directory names, filenames, class names, and selectors.</li>
150
- <li><strong>Impact:</strong>
151
- This affects the public entry point import: <code>@rxap/pipes/santization</code>. Misspelled APIs lead to a poor developer experience and autocomplete confusion.</li>
152
- <li><strong>Recommended Fix:</strong>
153
- Rename the package entrypoint, classes, and files to <code>sanitization</code>. To prevent breaking downstream users:<ol>
154
- <li>Create a deprecated entry point / alias <code>santization</code> pointing to <code>sanitization</code>.</li>
155
- <li>Deprecate the old names and plan to remove them in the next major version.</li>
156
- </ol>
157
- </li>
158
- </ul>
159
- <h3>4. Direct Pipe Instantiation Anti-pattern</h3>
160
- <ul>
161
- <li><strong>File:</strong> <a href="file:///mnt/mmuenker/Projects/rxap/packages/packages/angular/pipes/src/lib/escape-quotation-mark.pipe.ts#L15-L17">escape-quotation-mark.pipe.ts</a></li>
162
- <li><strong>Problem:</strong>
163
- <code>EscapeQuotationMarkPipe</code> instantiates <code>new ReplacePipe()</code> directly inside its <code>transform</code> method on every call. </li>
164
- <li><strong>Impact:</strong>
165
- Bypasses Angular&#39;s DI system and is highly inefficient during rapid template change detection cycles.</li>
166
- <li><strong>Recommended Fix:</strong>
167
- Replace direct instantiation with standard string replacement or utility calls, or inject the <code>ReplacePipe</code> properly if needed.</li>
168
- </ul>
169
- <h3>5. <code>SantizationService</code> Input Checks</h3>
170
- <ul>
171
- <li><strong>File:</strong> <a href="file:///mnt/mmuenker/Projects/rxap/packages/packages/angular/pipes/santization/src/lib/santization.service.ts#L23-L25">santization.service.ts</a></li>
172
- <li><strong>Problem:</strong>
173
- The service guards against <code>value === null</code> but does not handle <code>undefined</code>. If <code>value</code> is <code>undefined</code>, it bypasses the null-check and attempts to call <code>bypassSecurityTrust...</code> on an undefined value.</li>
174
- <li><strong>Recommended Fix:</strong>
175
- Ensure both <code>null</code> and <code>undefined</code> are caught and early-returned as <code>null</code>:<b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">if (value === null || value === undefined) {
176
- return null;
177
- }</code></pre></div></li>
178
- </ul>
179
- <hr>
180
- <h2>๐Ÿงช Test Coverage &amp; Test Suite Quality</h2>
181
- <h3>1. Extremely Low Test Coverage</h3>
182
- <ul>
183
- <li><strong>Status:</strong>
184
- Out of 11 pipes/services, <strong>only 4 have spec files</strong>.</li>
185
- <li><strong>Uncovered Code:</strong> <ul>
186
- <li><code>currency.pipe.ts</code> (0% coverage)</li>
187
- <li><code>get-from-object.pipe.ts</code> (0% coverage)</li>
188
- <li><code>join.pipe.ts</code> (0% coverage)</li>
189
- <li><code>limit.pipe.ts</code> (0% coverage)</li>
190
- <li><code>slice.pipe.ts</code> (0% coverage)</li>
191
- <li><code>truncate.pipe.ts</code> (0% coverage)</li>
192
- <li><code>santization</code> (both Pipe and Service have 0% coverage)</li>
193
- </ul>
194
- </li>
195
- <li><strong>Action Required:</strong>
196
- Write basic tests for all untargeted files, particularly verifying edge cases like <code>null</code>, <code>undefined</code>, empty inputs, and standard transforms.</li>
197
- </ul>
198
- <h3>2. Copy-Paste Error in Test Descriptions</h3>
199
- <ul>
200
- <li><strong>File:</strong> <a href="file:///mnt/mmuenker/Projects/rxap/packages/packages/angular/pipes/src/lib/replace.pipe.spec.ts#L3">replace.pipe.spec.ts</a></li>
201
- <li><strong>Problem:</strong>
202
- The test suite is described as <code>describe(&#39;EscapePipe&#39;, ...)</code> instead of <code>describe(&#39;ReplacePipe&#39;, ...)</code>.</li>
203
- <li><strong>Action Required:</strong>
204
- Update the description string to match the class under test.</li>
205
- </ul>
206
- <hr>
207
- <h2>๐Ÿ“‹ Comprehensive Checklist for Next Steps</h2>
208
- <ul>
209
- <li><input disabled="" type="checkbox"> <strong>Add Null guards in pipes:</strong> Add safety checks in <code>JoinPipe</code>, <code>LimitPipe</code>, and <code>SlicePipe</code>.</li>
210
- <li><input disabled="" type="checkbox"> <strong>Add DI providers in CurrencyPipe:</strong> Put <code>CurrencyPipe</code> under <code>providers</code> of <code>RxapCurrencyPipe</code>.</li>
211
- <li><input disabled="" type="checkbox"> <strong>Rename/Deprecate <code>slice</code> pipe:</strong> Resolve naming collision with standard Angular <code>slice</code> pipe.</li>
212
- <li><input disabled="" type="checkbox"> <strong>Initiate API Renaming of <code>santization</code>:</strong> Transition public APIs to <code>sanitization</code>.</li>
213
- <li><input disabled="" type="checkbox"> <strong>Improve test coverage:</strong> Add <code>.spec.ts</code> files for the remaining 7 uncovered files and write positive/negative/edge cases.</li>
214
- <li><input disabled="" type="checkbox"> <strong>Fix test description typo:</strong> Update <code>replace.pipe.spec.ts</code> description.</li>
215
- </ul>
106
+
107
+
108
+
216
109
 
217
110
 
218
111
 
@@ -259,13 +152,31 @@ Update the description string to match the class under test.</li>
259
152
 
260
153
  <script>
261
154
  var COMPODOC_CURRENT_PAGE_DEPTH = 0;
262
- var COMPODOC_CURRENT_PAGE_CONTEXT = 'getting-started';
155
+ var COMPODOC_CURRENT_PAGE_CONTEXT = 'todo';
263
156
  var COMPODOC_CURRENT_PAGE_URL = 'todo.html';
264
157
  var MAX_SEARCH_RESULTS = 15;
265
158
  </script>
266
159
 
267
160
  <script>
268
161
  $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
162
+ var updateDarkModeSwitchOffset = function () {
163
+ var content = document.querySelector('.content');
164
+ var scrollbarWidth = 0;
165
+
166
+ if (content) {
167
+ scrollbarWidth = Math.max(0, content.offsetWidth - content.clientWidth);
168
+ }
169
+
170
+ document.documentElement.style.setProperty(
171
+ '--content-scrollbar-width',
172
+ scrollbarWidth + 'px'
173
+ );
174
+ };
175
+
176
+ updateDarkModeSwitchOffset();
177
+ requestAnimationFrame(updateDarkModeSwitchOffset);
178
+ window.addEventListener('resize', updateDarkModeSwitchOffset);
179
+
269
180
  checkToggle(darkModeState);
270
181
  if ($darkModeToggleSwitchers.length > 0) {
271
182
  for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
@@ -281,14 +192,12 @@ Update the description string to match the class under test.</li>
281
192
  <script src="./js/libs/lit-html.js"></script>
282
193
 
283
194
  <script src="./js/menu-wc.js" defer></script>
284
- <script nomodule src="./js/menu-wc_es5.js" defer></script>
285
195
 
286
196
  <script src="./js/libs/bootstrap-native.js"></script>
287
197
 
288
198
  <script src="./js/libs/es6-shim.min.js"></script>
289
199
  <script src="./js/libs/EventDispatcher.js"></script>
290
200
  <script src="./js/libs/promise.min.js"></script>
291
- <script src="./js/libs/zepto.min.js"></script>
292
201
 
293
202
  <script src="./js/compodoc.js"></script>
294
203