@lucca-front/ng 22.0.5 → 22.1.0-rc.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.
- package/fesm2022/lucca-front-ng-activity-feed.mjs +12 -9
- package/fesm2022/lucca-front-ng-activity-feed.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-approbation-inbox.mjs +1 -1
- package/fesm2022/lucca-front-ng-approbation-inbox.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-callout.mjs +1 -1
- package/fesm2022/lucca-front-ng-callout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select.mjs +236 -8
- package/fesm2022/lucca-front-ng-core-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core.mjs +5 -1
- package/fesm2022/lucca-front-ng-core.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-data-table.mjs +2 -2
- package/fesm2022/lucca-front-ng-data-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date2.mjs +217 -159
- package/fesm2022/lucca-front-ng-date2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-dialog.mjs +2 -2
- package/fesm2022/lucca-front-ng-dialog.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-fancy-box.mjs +47 -24
- package/fesm2022/lucca-front-ng-fancy-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-file-upload.mjs +1 -1
- package/fesm2022/lucca-front-ng-file-upload.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-filter-pills-core.mjs +55 -0
- package/fesm2022/lucca-front-ng-filter-pills-core.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-filter-pills.mjs +74 -69
- package/fesm2022/lucca-front-ng-filter-pills.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-field.mjs +37 -5
- package/fesm2022/lucca-front-ng-form-field.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-label.mjs +1 -1
- package/fesm2022/lucca-front-ng-form-label.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form.mjs +42 -5
- package/fesm2022/lucca-front-ng-form.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs +3 -3
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms.mjs +12 -6
- package/fesm2022/lucca-front-ng-forms.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-highlight-data.mjs +6 -7
- package/fesm2022/lucca-front-ng-highlight-data.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-impersonation.mjs +19 -4
- package/fesm2022/lucca-front-ng-impersonation.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-link.mjs +8 -3
- package/fesm2022/lucca-front-ng-link.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-markdown.mjs +51 -0
- package/fesm2022/lucca-front-ng-markdown.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-multi-select.mjs +147 -43
- package/fesm2022/lucca-front-ng-multi-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover2.mjs +11 -5
- package/fesm2022/lucca-front-ng-popover2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-priority-levels.mjs +128 -0
- package/fesm2022/lucca-front-ng-priority-levels.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-safe-content.mjs +5 -2
- package/fesm2022/lucca-front-ng-safe-content.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-simple-select.mjs +63 -12
- package/fesm2022/lucca-front-ng-simple-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-software-icon-wrapper.mjs +1 -1
- package/fesm2022/lucca-front-ng-software-icon-wrapper.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user-popover.mjs +3 -2
- package/fesm2022/lucca-front-ng-user-popover.mjs.map +1 -1
- package/package.json +17 -4
- package/src/components/cdk/_overlay.scss +3 -1
- package/types/lucca-front-ng-activity-feed.d.ts +3 -1
- package/types/lucca-front-ng-core-select.d.ts +90 -7
- package/types/lucca-front-ng-core.d.ts +3 -1
- package/types/lucca-front-ng-date2.d.ts +31 -5
- package/types/lucca-front-ng-fancy-box.d.ts +29 -12
- package/types/lucca-front-ng-filter-pills-core.d.ts +69 -0
- package/types/lucca-front-ng-filter-pills.d.ts +28 -55
- package/types/lucca-front-ng-form-field.d.ts +12 -4
- package/types/lucca-front-ng-form.d.ts +7 -1
- package/types/lucca-front-ng-forms.d.ts +7 -2
- package/types/lucca-front-ng-highlight-data.d.ts +1 -2
- package/types/lucca-front-ng-impersonation.d.ts +14 -1
- package/types/lucca-front-ng-link.d.ts +5 -1
- package/types/lucca-front-ng-markdown.d.ts +24 -0
- package/types/lucca-front-ng-multi-select.d.ts +10 -1
- package/types/lucca-front-ng-popover2.d.ts +7 -1
- package/types/lucca-front-ng-priority-levels.d.ts +44 -0
- package/types/lucca-front-ng-simple-select.d.ts +4 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, numberAttribute, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { TextFlowComponent } from '@lucca-front/ng/text-flow';
|
|
4
|
+
import DOMPurify from 'isomorphic-dompurify';
|
|
5
|
+
import { Renderer, Marked } from 'marked';
|
|
6
|
+
|
|
7
|
+
/** Deepest heading level allowed by HTML. */
|
|
8
|
+
const maxHeadingLevel = 6;
|
|
9
|
+
/** Deepest heading utility class provided by Prisme (`pr-u-h5` and `pr-u-h6` are deprecated). */
|
|
10
|
+
const maxHeadingUtilityLevel = 4;
|
|
11
|
+
function renderMarkdown(content, { headingLevel = 1 } = {}) {
|
|
12
|
+
if (!content) {
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
15
|
+
const renderer = new Renderer();
|
|
16
|
+
renderer.heading = function ({ tokens, depth }) {
|
|
17
|
+
const level = Math.min(depth + headingLevel - 1, maxHeadingLevel);
|
|
18
|
+
const utilityClass = `pr-u-h${Math.min(depth, maxHeadingUtilityLevel)}`;
|
|
19
|
+
return `<h${level} class="${utilityClass}">${this.parser.parseInline(tokens)}</h${level}>\n`;
|
|
20
|
+
};
|
|
21
|
+
return DOMPurify.sanitize(new Marked({ renderer }).parse(content, { async: false }));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
class MarkdownComponent {
|
|
25
|
+
constructor() {
|
|
26
|
+
this.content = input.required(/* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.headingLevel = input(1, { ...(ngDevMode ? { debugName: "headingLevel" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
29
|
+
this.html = computed(() => renderMarkdown(this.content(), { headingLevel: this.headingLevel() }), /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "html" }] : /* istanbul ignore next */ []));
|
|
31
|
+
}
|
|
32
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MarkdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
33
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: MarkdownComponent, isStandalone: true, selector: "lu-markdown", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: '<lu-text-flow [innerHTML]="html()" />', isInline: true, dependencies: [{ kind: "component", type: TextFlowComponent, selector: "lu-text-flow" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
34
|
+
}
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MarkdownComponent, decorators: [{
|
|
36
|
+
type: Component,
|
|
37
|
+
args: [{
|
|
38
|
+
selector: 'lu-markdown',
|
|
39
|
+
template: '<lu-text-flow [innerHTML]="html()" />',
|
|
40
|
+
imports: [TextFlowComponent],
|
|
41
|
+
encapsulation: ViewEncapsulation.None,
|
|
42
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
43
|
+
}]
|
|
44
|
+
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], headingLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingLevel", required: false }] }] } });
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Generated bundle index. Do not edit.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
export { MarkdownComponent, renderMarkdown };
|
|
51
|
+
//# sourceMappingURL=lucca-front-ng-markdown.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lucca-front-ng-markdown.mjs","sources":["../../../packages/ng/markdown/render-markdown.ts","../../../packages/ng/markdown/markdown.component.ts","../../../packages/ng/markdown/lucca-front-ng-markdown.ts"],"sourcesContent":["import DOMPurify from 'isomorphic-dompurify';\nimport { Marked, Renderer, Tokens } from 'marked';\n\n/** Deepest heading level allowed by HTML. */\nconst maxHeadingLevel = 6;\n\n/** Deepest heading utility class provided by Prisme (`pr-u-h5` and `pr-u-h6` are deprecated). */\nconst maxHeadingUtilityLevel = 4;\n\nexport interface RenderMarkdownOptions {\n\t/**\n\t * Heading level used for the top-level markdown heading (`# Heading`), the following ones being nested from it.\n\t * Set it to the level that keeps the document outline valid where the markdown is displayed: with `2`,\n\t * `# Heading` renders a `<h2 class=\"pr-u-h1\">`, keeping the heading semantics clean while preserving its style.\n\t *\n\t * @default 1\n\t */\n\theadingLevel?: number;\n}\n\nexport function renderMarkdown(content: string, { headingLevel = 1 }: RenderMarkdownOptions = {}): string {\n\tif (!content) {\n\t\treturn '';\n\t}\n\n\tconst renderer = new Renderer();\n\n\trenderer.heading = function (this: Renderer, { tokens, depth }: Tokens.Heading): string {\n\t\tconst level = Math.min(depth + headingLevel - 1, maxHeadingLevel);\n\t\tconst utilityClass = `pr-u-h${Math.min(depth, maxHeadingUtilityLevel)}`;\n\n\t\treturn `<h${level} class=\"${utilityClass}\">${this.parser.parseInline(tokens)}</h${level}>\\n`;\n\t};\n\n\treturn DOMPurify.sanitize(new Marked({ renderer }).parse(content, { async: false }));\n}\n","import { ChangeDetectionStrategy, Component, computed, input, numberAttribute, ViewEncapsulation } from '@angular/core';\nimport { TextFlowComponent } from '@lucca-front/ng/text-flow';\nimport { renderMarkdown } from './render-markdown';\n\n@Component({\n\tselector: 'lu-markdown',\n\ttemplate: '<lu-text-flow [innerHTML]=\"html()\" />',\n\timports: [TextFlowComponent],\n\tencapsulation: ViewEncapsulation.None,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MarkdownComponent {\n\treadonly content = input.required<string>();\n\n\treadonly headingLevel = input(1, { transform: numberAttribute });\n\n\tprotected html = computed(() => renderMarkdown(this.content(), { headingLevel: this.headingLevel() }));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAGA;AACA,MAAM,eAAe,GAAG,CAAC;AAEzB;AACA,MAAM,sBAAsB,GAAG,CAAC;AAa1B,SAAU,cAAc,CAAC,OAAe,EAAE,EAAE,YAAY,GAAG,CAAC,EAAA,GAA4B,EAAE,EAAA;IAC/F,IAAI,CAAC,OAAO,EAAE;AACb,QAAA,OAAO,EAAE;IACV;AAEA,IAAA,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE;IAE/B,QAAQ,CAAC,OAAO,GAAG,UAA0B,EAAE,MAAM,EAAE,KAAK,EAAkB,EAAA;AAC7E,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,YAAY,GAAG,CAAC,EAAE,eAAe,CAAC;AACjE,QAAA,MAAM,YAAY,GAAG,CAAA,MAAA,EAAS,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAA,CAAE;A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