@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.
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +3158 -3344
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +7616 -4772
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.date.mjs +321 -702
- package/fesm2022/arsedizioni-ars-utils-core.date.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs +445 -590
- package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.mjs +1735 -2370
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +1280 -1470
- package/fesm2022/arsedizioni-ars-utils-core.validators.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +1097 -1528
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs +198 -294
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs +115 -117
- package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs +1607 -613
- package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs +840 -367
- package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +1634 -651
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +1255 -792
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +1410 -357
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +2401 -944
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs +1553 -741
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs +901 -430
- package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.help.mjs +737 -530
- package/fesm2022/arsedizioni-ars-utils-ui.help.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.mjs +6638 -1755
- package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs +1479 -1207
- package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs +1003 -270
- package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +497 -278
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs +48 -52
- package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs +464 -704
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs +724 -657
- package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils.mjs +3 -19
- package/fesm2022/arsedizioni-ars-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-clipper.common.d.ts +1151 -1163
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts +1588 -1426
- package/types/arsedizioni-ars-utils-core.d.ts +1169 -1172
- package/types/arsedizioni-ars-utils-core.date.d.ts +204 -208
- package/types/arsedizioni-ars-utils-core.markdown.d.ts +128 -126
- package/types/arsedizioni-ars-utils-core.validators.d.ts +270 -236
- package/types/arsedizioni-ars-utils-evolution.common.d.ts +1054 -1067
- package/types/arsedizioni-ars-utils-support.common.d.ts +225 -234
- package/types/arsedizioni-ars-utils-ui.controls.d.ts +440 -278
- package/types/arsedizioni-ars-utils-ui.controls.date.d.ts +24 -28
- package/types/arsedizioni-ars-utils-ui.controls.tree.d.ts +172 -136
- package/types/arsedizioni-ars-utils-ui.d.ts +2035 -821
- package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts +327 -322
- package/types/arsedizioni-ars-utils-ui.dialogs.d.ts +343 -347
- package/types/arsedizioni-ars-utils-ui.dialogs.prompt.d.ts +167 -167
- package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +373 -367
- package/types/arsedizioni-ars-utils-ui.files.d.ts +335 -283
- package/types/arsedizioni-ars-utils-ui.filters.d.ts +232 -160
- package/types/arsedizioni-ars-utils-ui.help.d.ts +204 -211
- package/types/arsedizioni-ars-utils-ui.navigation.d.ts +811 -646
- package/types/arsedizioni-ars-utils-ui.notifications.d.ts +74 -78
- package/types/arsedizioni-ars-utils-ui.oauth.d.ts +102 -62
- package/types/arsedizioni-ars-utils-ui.paginator.d.ts +19 -22
- package/types/arsedizioni-ars-utils-ui.shell.d.ts +376 -382
- package/types/arsedizioni-ars-utils-ui.tinymce.d.ts +244 -231
- package/types/arsedizioni-ars-utils.d.ts +1 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { PipeTransform } from
|
|
3
|
-
import { SafeHtml } from
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
export interface MarkdownOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Escape raw HTML found in the source as entities (default: false).
|
|
33
|
+
* When false (default) no &/</>/" 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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
+
}
|