@arsedizioni/ars-utils 22.6.86 → 22.6.88

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 (79) hide show
  1. package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +3158 -3344
  2. package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
  3. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +7616 -4772
  4. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
  5. package/fesm2022/arsedizioni-ars-utils-core.date.mjs +321 -702
  6. package/fesm2022/arsedizioni-ars-utils-core.date.mjs.map +1 -1
  7. package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs +445 -590
  8. package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs.map +1 -1
  9. package/fesm2022/arsedizioni-ars-utils-core.mjs +1735 -2370
  10. package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
  11. package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +1280 -1470
  12. package/fesm2022/arsedizioni-ars-utils-core.validators.mjs.map +1 -1
  13. package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +1097 -1528
  14. package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs.map +1 -1
  15. package/fesm2022/arsedizioni-ars-utils-support.common.mjs +198 -294
  16. package/fesm2022/arsedizioni-ars-utils-support.common.mjs.map +1 -1
  17. package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs +115 -117
  18. package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs.map +1 -1
  19. package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs +1607 -613
  20. package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs.map +1 -1
  21. package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs +840 -367
  22. package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs.map +1 -1
  23. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +1634 -651
  24. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -1
  25. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +1255 -792
  26. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs.map +1 -1
  27. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +1410 -357
  28. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs.map +1 -1
  29. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +2401 -944
  30. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -1
  31. package/fesm2022/arsedizioni-ars-utils-ui.files.mjs +1553 -741
  32. package/fesm2022/arsedizioni-ars-utils-ui.files.mjs.map +1 -1
  33. package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs +901 -430
  34. package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs.map +1 -1
  35. package/fesm2022/arsedizioni-ars-utils-ui.help.mjs +737 -530
  36. package/fesm2022/arsedizioni-ars-utils-ui.help.mjs.map +1 -1
  37. package/fesm2022/arsedizioni-ars-utils-ui.mjs +6638 -1755
  38. package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
  39. package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs +1479 -1207
  40. package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs.map +1 -1
  41. package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs +1003 -270
  42. package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs.map +1 -1
  43. package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +497 -278
  44. package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs.map +1 -1
  45. package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs +48 -52
  46. package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs.map +1 -1
  47. package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs +464 -704
  48. package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs.map +1 -1
  49. package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs +724 -657
  50. package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs.map +1 -1
  51. package/fesm2022/arsedizioni-ars-utils.mjs +3 -19
  52. package/fesm2022/arsedizioni-ars-utils.mjs.map +1 -1
  53. package/package.json +1 -1
  54. package/types/arsedizioni-ars-utils-clipper.common.d.ts +1151 -1163
  55. package/types/arsedizioni-ars-utils-clipper.ui.d.ts +1588 -1426
  56. package/types/arsedizioni-ars-utils-core.d.ts +1169 -1172
  57. package/types/arsedizioni-ars-utils-core.date.d.ts +204 -208
  58. package/types/arsedizioni-ars-utils-core.markdown.d.ts +128 -126
  59. package/types/arsedizioni-ars-utils-core.validators.d.ts +270 -236
  60. package/types/arsedizioni-ars-utils-evolution.common.d.ts +1054 -1067
  61. package/types/arsedizioni-ars-utils-support.common.d.ts +225 -234
  62. package/types/arsedizioni-ars-utils-ui.controls.d.ts +440 -278
  63. package/types/arsedizioni-ars-utils-ui.controls.date.d.ts +24 -28
  64. package/types/arsedizioni-ars-utils-ui.controls.tree.d.ts +172 -136
  65. package/types/arsedizioni-ars-utils-ui.d.ts +2035 -821
  66. package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts +327 -322
  67. package/types/arsedizioni-ars-utils-ui.dialogs.d.ts +343 -347
  68. package/types/arsedizioni-ars-utils-ui.dialogs.prompt.d.ts +167 -167
  69. package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +373 -367
  70. package/types/arsedizioni-ars-utils-ui.files.d.ts +335 -283
  71. package/types/arsedizioni-ars-utils-ui.filters.d.ts +232 -160
  72. package/types/arsedizioni-ars-utils-ui.help.d.ts +204 -211
  73. package/types/arsedizioni-ars-utils-ui.navigation.d.ts +811 -646
  74. package/types/arsedizioni-ars-utils-ui.notifications.d.ts +74 -78
  75. package/types/arsedizioni-ars-utils-ui.oauth.d.ts +102 -62
  76. package/types/arsedizioni-ars-utils-ui.paginator.d.ts +19 -22
  77. package/types/arsedizioni-ars-utils-ui.shell.d.ts +376 -382
  78. package/types/arsedizioni-ars-utils-ui.tinymce.d.ts +244 -231
  79. package/types/arsedizioni-ars-utils.d.ts +1 -3
@@ -1,7 +1,6 @@
1
- import * as i0 from '@angular/core';
2
- import { PipeTransform } from '@angular/core';
3
- import { SafeHtml } from '@angular/platform-browser';
4
-
1
+ import * as i0 from "@angular/core";
2
+ import { PipeTransform } from "@angular/core";
3
+ import { SafeHtml } from "@angular/platform-browser";
5
4
  /**
6
5
  * Zero-dependency Markdown to HTML converter.
7
6
  *
@@ -28,132 +27,135 @@ import { SafeHtml } from '@angular/platform-browser';
28
27
  * - Setext headings (=== / ---) are not supported, use # syntax.
29
28
  * - Reference-style links [text][ref] are not supported.
30
29
  */
31
- interface MarkdownOptions {
32
- /**
33
- * Escape raw HTML found in the source as entities (default: false).
34
- * When false (default) no &/</>/" entities are ever produced:
35
- * the text is emitted as-is. Enable ONLY when rendering untrusted input,
36
- * since raw HTML in the source would otherwise reach the DOM (XSS).
37
- */
38
- escapeHtml?: boolean;
39
- /** Render single newlines inside paragraphs as <br> (default: true). */
40
- breaks?: boolean;
30
+ export interface MarkdownOptions {
31
+ /**
32
+ * Escape raw HTML found in the source as entities (default: false).
33
+ * When false (default) no &amp;/&lt;/&gt;/&quot; entities are ever produced:
34
+ * the text is emitted as-is. Enable ONLY when rendering untrusted input,
35
+ * since raw HTML in the source would otherwise reach the DOM (XSS).
36
+ */
37
+ escapeHtml?: boolean;
38
+ /** Render single newlines inside paragraphs as <br> (default: true). */
39
+ breaks?: boolean;
41
40
  }
42
- declare class MarkdownUtils {
43
- private static readonly cache;
44
- private static readonly CACHE_MAX;
45
- /** Clears the internal result cache. */
46
- static clearCache(): void;
47
- /**
48
- * Convert markdown to HTML.
49
- * @param markdown : the markdown source
50
- * @param options : conversion options
51
- * @returns : the HTML string ('' when input is falsy)
52
- */
53
- static toHtml(markdown?: string, options?: MarkdownOptions): string;
54
- /** Block-level HTML tags that start a raw HTML block (passthrough, no <p>/<br>). */
55
- private static readonly htmlBlockTags;
56
- /** Void/self-contained tags: a single tag, no closing tag expected. */
57
- private static readonly htmlVoidTags;
58
- /**
59
- * Precompiled: first block-level tag occurrence anywhere in a line.
60
- * Anchored on the '<' literal, so scanning is cheap; the lookahead
61
- * prevents partial matches ('<td' must not match inside '<tdx').
62
- */
63
- private static readonly htmlBlockScanRe;
64
- /** Result of scanning a line for the start of a raw HTML block. */
65
- private static findHtmlBlockStart;
66
- /** True when `index` falls inside an inline code span (odd backtick count before it). */
67
- private static insideCodeSpan;
68
- /**
69
- * indexOf-based depth scanner (no regex, no allocations): walks `text`
70
- * adjusting `depth` for <tag ...> / </tag> occurrences of the SAME tag.
71
- * Self-closing <tag ... /> forms do not alter depth.
72
- * @returns [newDepth, endIndex] where endIndex is the position right after
73
- * the '>' that balanced the element, or -1 when still open.
74
- */
75
- private static scanHtmlDepth;
76
- /** A tag token must be followed by whitespace, '/', '>' or end of line. */
77
- private static isTagBoundary;
78
- /**
79
- * Re-injects the remainder of a partially consumed line so the main loop
80
- * processes it as markdown. Returns the index the loop should resume from.
81
- */
82
- private static pushBack;
83
- /**
84
- * Emits a raw HTML block starting at `hit.index` of lines[i], consuming
85
- * following lines until the element is balanced. Text after the block on
86
- * the closing line is pushed back for markdown processing.
87
- * @returns the index of the last consumed line
88
- */
89
- private static emitHtmlBlock;
90
- private static parseBlocks;
91
- /** Matches "- item", "* item", "+ item", "1. item", "1) item" with leading indent. */
92
- private static readonly listItemRe;
93
- /**
94
- * Gathers the contiguous list block starting at `start`, builds it (with
95
- * nesting) and returns [html, indexOfLastConsumedLine].
96
- */
97
- private static parseList;
98
- private static buildList;
99
- private static tableAligns;
100
- private static tableRow;
101
- /**
102
- * Applies inline markdown to a single text segment.
103
- * Generated HTML (code, links, images, autolinks) is stashed behind \u0000
104
- * placeholders so later regex passes can never corrupt it.
105
- */
106
- private static inline;
107
- /** Escapes quotes for safe interpolation inside a double-quoted HTML attribute. */
108
- private static escapeAttr;
109
- /** Escapes &, <, > and " for safe HTML interpolation. */
110
- private static escape;
111
- /**
112
- * Returns a sanitized URL or undefined when the scheme is dangerous.
113
- * Blocks javascript:, vbscript: and data: (also when obfuscated with
114
- * whitespace/control characters, e.g. "java\tscript:").
115
- */
116
- private static safeUrl;
117
- /**
118
- * Copies markdown content to the clipboard in two flavors:
119
- * - text/html : the rendered HTML (rich paste into Word, Outlook, Gmail...)
120
- * - text/plain : the original markdown source (paste into editors, IDEs...)
121
- * @param markdown : the markdown source
122
- * @param options : conversion options for the HTML flavor
123
- * @returns : true on success
124
- */
125
- static copyToClipboard(markdown?: string, options?: MarkdownOptions): Promise<boolean>;
126
- /**
127
- * Copies plain text (e.g. the content of a single code block) to the clipboard.
128
- * @param text : the text to copy
129
- * @returns : true on success
130
- */
131
- static copyText(text?: string): Promise<boolean>;
132
- /**
133
- * Extracts the visible plain text from a rendered element
134
- * (what the user sees, entities already decoded by the browser).
135
- * @param element : the element hosting the rendered markdown
136
- * @returns : the plain text
137
- */
138
- static elementToText(element: HTMLElement): string;
41
+ export declare class MarkdownUtils {
42
+ private static readonly cache;
43
+ private static readonly CACHE_MAX;
44
+ /** Clears the internal result cache. */
45
+ static clearCache(): void;
46
+ /**
47
+ * Convert markdown to HTML.
48
+ * @param markdown : the markdown source
49
+ * @param options : conversion options
50
+ * @returns : the HTML string ('' when input is falsy)
51
+ */
52
+ static toHtml(markdown?: string, options?: MarkdownOptions): string;
53
+ /** Block-level HTML tags that start a raw HTML block (passthrough, no <p>/<br>). */
54
+ private static readonly htmlBlockTags;
55
+ /** Void/self-contained tags: a single tag, no closing tag expected. */
56
+ private static readonly htmlVoidTags;
57
+ /**
58
+ * Precompiled: first block-level tag occurrence anywhere in a line.
59
+ * Anchored on the '<' literal, so scanning is cheap; the lookahead
60
+ * prevents partial matches ('<td' must not match inside '<tdx').
61
+ */
62
+ private static readonly htmlBlockScanRe;
63
+ /** Result of scanning a line for the start of a raw HTML block. */
64
+ private static findHtmlBlockStart;
65
+ /** True when `index` falls inside an inline code span (odd backtick count before it). */
66
+ private static insideCodeSpan;
67
+ /**
68
+ * indexOf-based depth scanner (no regex, no allocations): walks `text`
69
+ * adjusting `depth` for <tag ...> / </tag> occurrences of the SAME tag.
70
+ * Self-closing <tag ... /> forms do not alter depth.
71
+ * @returns [newDepth, endIndex] where endIndex is the position right after
72
+ * the '>' that balanced the element, or -1 when still open.
73
+ */
74
+ private static scanHtmlDepth;
75
+ /** A tag token must be followed by whitespace, '/', '>' or end of line. */
76
+ private static isTagBoundary;
77
+ /**
78
+ * Re-injects the remainder of a partially consumed line so the main loop
79
+ * processes it as markdown. Returns the index the loop should resume from.
80
+ */
81
+ private static pushBack;
82
+ /**
83
+ * Emits a raw HTML block starting at `hit.index` of lines[i], consuming
84
+ * following lines until the element is balanced. Text after the block on
85
+ * the closing line is pushed back for markdown processing.
86
+ * @returns the index of the last consumed line
87
+ */
88
+ private static emitHtmlBlock;
89
+ private static parseBlocks;
90
+ /** Matches "- item", "* item", "+ item", "1. item", "1) item" with leading indent. */
91
+ private static readonly listItemRe;
92
+ /**
93
+ * Gathers the contiguous list block starting at `start`, builds it (with
94
+ * nesting) and returns [html, indexOfLastConsumedLine].
95
+ */
96
+ private static parseList;
97
+ private static buildList;
98
+ private static tableAligns;
99
+ private static tableRow;
100
+ /**
101
+ * Applies inline markdown to a single text segment.
102
+ * Generated HTML (code, links, images, autolinks) is stashed behind \u0000
103
+ * placeholders so later regex passes can never corrupt it.
104
+ */
105
+ private static inline;
106
+ /** Escapes quotes for safe interpolation inside a double-quoted HTML attribute. */
107
+ private static escapeAttr;
108
+ /** Escapes &, <, > and " for safe HTML interpolation. */
109
+ private static escape;
110
+ /**
111
+ * Returns a sanitized URL or undefined when the scheme is dangerous.
112
+ * Blocks javascript:, vbscript: and data: (also when obfuscated with
113
+ * whitespace/control characters, e.g. "java\tscript:").
114
+ */
115
+ private static safeUrl;
116
+ /**
117
+ * Copies markdown content to the clipboard in two flavors:
118
+ * - text/html : the rendered HTML (rich paste into Word, Outlook, Gmail...)
119
+ * - text/plain : the original markdown source (paste into editors, IDEs...)
120
+ * @param markdown : the markdown source
121
+ * @param options : conversion options for the HTML flavor
122
+ * @returns : true on success
123
+ */
124
+ static copyToClipboard(markdown?: string, options?: MarkdownOptions): Promise<boolean>;
125
+ /**
126
+ * Copies plain text (e.g. the content of a single code block) to the clipboard.
127
+ * @param text : the text to copy
128
+ * @returns : true on success
129
+ */
130
+ static copyText(text?: string): Promise<boolean>;
131
+ /**
132
+ * Extracts the visible plain text from a rendered element
133
+ * (what the user sees, entities already decoded by the browser).
134
+ * @param element : the element hosting the rendered markdown
135
+ * @returns : the plain text
136
+ */
137
+ static elementToText(element: HTMLElement): string;
139
138
  }
140
-
141
139
  /**
142
140
  * Pipe that converts a Markdown string to sanitized HTML using `MarkdownUtils.toHtml`.
143
141
  *
144
142
  * Usage: `{{ text | formatMarkdown }}`
143
+ *
144
+ * The Markdown is converted with raw HTML blocks passed through -- a table written as HTML stays a
145
+ * table -- and the result goes through Angular's HTML sanitizer BEFORE it is marked as trusted:
146
+ * scripts, event handlers, `javascript:` URLs and inline styles are stripped, the safe elements and
147
+ * their safe attributes (`class` included) are kept. Without that step the pipe trusted whatever the
148
+ * Markdown carried, and Markdown is often somebody else's text: the answer of an assistant quoting
149
+ * a record a user typed, a comment, a description.
145
150
  */
146
- declare class FormatMarkdownPipe implements PipeTransform {
147
- private readonly sanitizer;
148
- /**
149
- * Transforms a Markdown string into sanitized HTML.
150
- * @param value - The Markdown input to convert. Treated as an empty string when `undefined`.
151
- * @returns A `SafeHtml` value that can be rendered with `[innerHTML]`.
152
- */
153
- transform(value?: string): SafeHtml;
154
- static ɵfac: i0.ɵɵFactoryDeclaration<FormatMarkdownPipe, never>;
155
- static ɵpipe: i0.ɵɵPipeDeclaration<FormatMarkdownPipe, "formatMarkdown", true>;
156
- }
157
-
158
- export { FormatMarkdownPipe, MarkdownUtils };
159
- export type { MarkdownOptions };
151
+ export declare class FormatMarkdownPipe implements PipeTransform {
152
+ private readonly sanitizer;
153
+ /**
154
+ * Transforms a Markdown string into sanitized HTML.
155
+ * @param value - The Markdown input to convert. Treated as an empty string when `undefined`.
156
+ * @returns A `SafeHtml` value that can be rendered with `[innerHTML]`.
157
+ */
158
+ transform(value?: string): SafeHtml;
159
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormatMarkdownPipe, never>;
160
+ static ɵpipe: i0.ɵɵPipeDeclaration<FormatMarkdownPipe, "formatMarkdown", true>;
161
+ }