@lucca-front/ng 21.3.0-rc.5 → 22.0.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-a11y.mjs +3 -3
- package/fesm2022/lucca-front-ng-activity-feed.mjs +12 -17
- package/fesm2022/lucca-front-ng-activity-feed.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-api.mjs +122 -202
- package/fesm2022/lucca-front-ng-api.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-app-layout.mjs +3 -3
- package/fesm2022/lucca-front-ng-box.mjs +3 -3
- package/fesm2022/lucca-front-ng-breadcrumbs.mjs +6 -6
- package/fesm2022/lucca-front-ng-bubble-icon.mjs +4 -10
- package/fesm2022/lucca-front-ng-bubble-icon.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-bubble-illustration.mjs +5 -10
- package/fesm2022/lucca-front-ng-bubble-illustration.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-callout.mjs +36 -36
- package/fesm2022/lucca-front-ng-callout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-chip.mjs +4 -10
- package/fesm2022/lucca-front-ng-chip.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-clear.mjs +9 -15
- package/fesm2022/lucca-front-ng-clear.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-code.mjs +4 -4
- package/fesm2022/lucca-front-ng-code.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-color.mjs +4 -9
- package/fesm2022/lucca-front-ng-color.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-comment.mjs +12 -17
- package/fesm2022/lucca-front-ng-comment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-container.mjs +4 -9
- package/fesm2022/lucca-front-ng-container.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-api.mjs +29 -45
- package/fesm2022/lucca-front-ng-core-select-api.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-department.mjs +13 -11
- package/fesm2022/lucca-front-ng-core-select-department.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-establishment.mjs +9 -9
- package/fesm2022/lucca-front-ng-core-select-establishment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs +6 -6
- package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-occupation-category.mjs +3 -3
- package/fesm2022/lucca-front-ng-core-select-occupation-category.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-user.mjs +42 -42
- package/fesm2022/lucca-front-ng-core-select-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select.mjs +204 -270
- package/fesm2022/lucca-front-ng-core-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core.mjs +37 -21
- package/fesm2022/lucca-front-ng-core.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-data-table.mjs +61 -60
- package/fesm2022/lucca-front-ng-data-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date.mjs +144 -164
- package/fesm2022/lucca-front-ng-date.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date2.mjs +147 -150
- package/fesm2022/lucca-front-ng-date2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-department.mjs +26 -24
- package/fesm2022/lucca-front-ng-department.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-dialog.mjs +92 -68
- package/fesm2022/lucca-front-ng-dialog.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-divider.mjs +7 -14
- package/fesm2022/lucca-front-ng-divider.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-dropdown.mjs +69 -72
- package/fesm2022/lucca-front-ng-dropdown.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-empty-state.mjs +15 -20
- package/fesm2022/lucca-front-ng-empty-state.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-error-page.mjs +4 -9
- package/fesm2022/lucca-front-ng-error-page.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-establishment.mjs +81 -115
- package/fesm2022/lucca-front-ng-establishment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-fancy-box.mjs +5 -10
- package/fesm2022/lucca-front-ng-fancy-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-file-upload.mjs +33 -52
- package/fesm2022/lucca-front-ng-file-upload.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-filter-pills.mjs +41 -24
- package/fesm2022/lucca-front-ng-filter-pills.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-footer.mjs +4 -10
- package/fesm2022/lucca-front-ng-footer.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-field.mjs +43 -64
- package/fesm2022/lucca-front-ng-form-field.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-header.mjs +4 -9
- package/fesm2022/lucca-front-ng-form-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-label.mjs +4 -9
- package/fesm2022/lucca-front-ng-form-label.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form.mjs +6 -9
- package/fesm2022/lucca-front-ng-form.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-formly.mjs +60 -59
- package/fesm2022/lucca-front-ng-formly.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs +53 -53
- package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-html.mjs +18 -16
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-html.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-markdown.mjs +9 -8
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-markdown.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-plain-text.mjs +8 -6
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-plain-text.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs +64 -57
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms.mjs +51 -109
- package/fesm2022/lucca-front-ng-forms.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-gauge.mjs +3 -3
- package/fesm2022/lucca-front-ng-grid.mjs +9 -21
- package/fesm2022/lucca-front-ng-grid.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-highlight-data.mjs +5 -27
- package/fesm2022/lucca-front-ng-highlight-data.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-horizontal-navigation.mjs +15 -160
- package/fesm2022/lucca-front-ng-horizontal-navigation.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-index-table.mjs +38 -44
- package/fesm2022/lucca-front-ng-index-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-inline-message.mjs +4 -11
- package/fesm2022/lucca-front-ng-inline-message.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-input.mjs +28 -26
- package/fesm2022/lucca-front-ng-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-link.mjs +6 -6
- package/fesm2022/lucca-front-ng-link.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-listbox.mjs +10 -15
- package/fesm2022/lucca-front-ng-listbox.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-listing.mjs +8 -8
- package/fesm2022/lucca-front-ng-listing.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-loading.mjs +4 -9
- package/fesm2022/lucca-front-ng-loading.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-main-layout.mjs +6 -6
- package/fesm2022/lucca-front-ng-mobile-push.mjs +4 -4
- package/fesm2022/lucca-front-ng-mobile-push.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-modal.mjs +36 -40
- package/fesm2022/lucca-front-ng-modal.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-multi-select.mjs +174 -203
- package/fesm2022/lucca-front-ng-multi-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-new-badge.mjs +3 -3
- package/fesm2022/lucca-front-ng-number-format.mjs +22 -25
- package/fesm2022/lucca-front-ng-number-format.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-number.mjs +7 -7
- package/fesm2022/lucca-front-ng-numeric-badge.mjs +4 -9
- package/fesm2022/lucca-front-ng-numeric-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-option.mjs +159 -162
- package/fesm2022/lucca-front-ng-option.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-page-header.mjs +3 -3
- package/fesm2022/lucca-front-ng-page-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-pagination.mjs +5 -10
- package/fesm2022/lucca-front-ng-pagination.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-plg-push.mjs +5 -5
- package/fesm2022/lucca-front-ng-plg-push.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover.mjs +144 -255
- package/fesm2022/lucca-front-ng-popover.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover2.mjs +41 -69
- package/fesm2022/lucca-front-ng-popover2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popup.mjs +11 -11
- package/fesm2022/lucca-front-ng-popup.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-progress-bar.mjs +4 -9
- package/fesm2022/lucca-front-ng-progress-bar.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-progress-stepper.mjs +7 -12
- package/fesm2022/lucca-front-ng-progress-stepper.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-read-more.mjs +5 -10
- package/fesm2022/lucca-front-ng-read-more.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-resource-card.mjs +13 -19
- package/fesm2022/lucca-front-ng-resource-card.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-safe-content.mjs +10 -10
- package/fesm2022/lucca-front-ng-scroll-box.mjs +3 -3
- package/fesm2022/lucca-front-ng-scroll-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-scroll.mjs +7 -7
- package/fesm2022/lucca-front-ng-scroll.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs +8 -14
- package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-segmented-control.mjs +6 -6
- package/fesm2022/lucca-front-ng-select.mjs +92 -138
- package/fesm2022/lucca-front-ng-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-sidepanel.mjs +7 -7
- package/fesm2022/lucca-front-ng-sidepanel.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-simple-select.mjs +43 -41
- package/fesm2022/lucca-front-ng-simple-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-skeleton.mjs +28 -50
- package/fesm2022/lucca-front-ng-skeleton.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-software-icon-wrapper.mjs +6 -6
- package/fesm2022/lucca-front-ng-software-icon.mjs +25 -29
- package/fesm2022/lucca-front-ng-software-icon.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-sortable-list.mjs +6 -6
- package/fesm2022/lucca-front-ng-sortable-list.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-status-badge.mjs +4 -9
- package/fesm2022/lucca-front-ng-status-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-table-of-content.mjs +6 -6
- package/fesm2022/lucca-front-ng-tag.mjs +5 -10
- package/fesm2022/lucca-front-ng-tag.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-text-flow.mjs +4 -4
- package/fesm2022/lucca-front-ng-text-flow.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-time.mjs +68 -316
- package/fesm2022/lucca-front-ng-time.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-title.mjs +10 -10
- package/fesm2022/lucca-front-ng-title.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-toast.mjs +11 -11
- package/fesm2022/lucca-front-ng-toast.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tooltip.mjs +17 -17
- package/fesm2022/lucca-front-ng-tree-select.mjs +17 -16
- package/fesm2022/lucca-front-ng-tree-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user-popover.mjs +27 -32
- package/fesm2022/lucca-front-ng-user-popover.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user.mjs +139 -195
- package/fesm2022/lucca-front-ng-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-vertical-navigation.mjs +12 -12
- package/package.json +5 -13
- package/schematics/lib/local-deps/package-lock.json +79 -17
- package/schematics/lib/local-deps/package.json +1 -1
- package/schematics/palettes/index.js +1 -12
- package/src/components/_picker.scss +1 -2
- package/types/lucca-front-ng-activity-feed.d.ts +1 -8
- package/types/lucca-front-ng-api.d.ts +75 -81
- package/types/lucca-front-ng-bubble-icon.d.ts +1 -10
- package/types/lucca-front-ng-bubble-illustration.d.ts +4 -10
- package/types/lucca-front-ng-callout.d.ts +12 -20
- package/types/lucca-front-ng-chip.d.ts +1 -10
- package/types/lucca-front-ng-clear.d.ts +6 -11
- package/types/lucca-front-ng-color.d.ts +1 -8
- package/types/lucca-front-ng-comment.d.ts +1 -8
- package/types/lucca-front-ng-container.d.ts +1 -8
- package/types/lucca-front-ng-core-select-api.d.ts +28 -28
- package/types/lucca-front-ng-core-select-department.d.ts +10 -10
- package/types/lucca-front-ng-core-select-establishment.d.ts +12 -12
- package/types/lucca-front-ng-core-select-job-qualification.d.ts +6 -6
- package/types/lucca-front-ng-core-select-occupation-category.d.ts +6 -6
- package/types/lucca-front-ng-core-select-user.d.ts +20 -21
- package/types/lucca-front-ng-core-select.d.ts +186 -185
- package/types/lucca-front-ng-core.d.ts +16 -10
- package/types/lucca-front-ng-data-table.d.ts +41 -52
- package/types/lucca-front-ng-date.d.ts +30 -28
- package/types/lucca-front-ng-date2.d.ts +98 -106
- package/types/lucca-front-ng-department.d.ts +2 -2
- package/types/lucca-front-ng-dialog.d.ts +13 -13
- package/types/lucca-front-ng-divider.d.ts +2 -9
- package/types/lucca-front-ng-dropdown.d.ts +5 -4
- package/types/lucca-front-ng-empty-state.d.ts +7 -15
- package/types/lucca-front-ng-error-page.d.ts +4 -9
- package/types/lucca-front-ng-establishment.d.ts +26 -27
- package/types/lucca-front-ng-fancy-box.d.ts +1 -8
- package/types/lucca-front-ng-file-upload.d.ts +24 -39
- package/types/lucca-front-ng-filter-pills.d.ts +37 -32
- package/types/lucca-front-ng-footer.d.ts +2 -11
- package/types/lucca-front-ng-form-field.d.ts +27 -45
- package/types/lucca-front-ng-form-header.d.ts +1 -8
- package/types/lucca-front-ng-form-label.d.ts +1 -8
- package/types/lucca-front-ng-form.d.ts +0 -2
- package/types/lucca-front-ng-forms-phone-number-input.d.ts +19 -26
- package/types/lucca-front-ng-forms-rich-text-input.d.ts +15 -14
- package/types/lucca-front-ng-forms.d.ts +54 -95
- package/types/lucca-front-ng-grid.d.ts +8 -23
- package/types/lucca-front-ng-highlight-data.d.ts +1 -16
- package/types/lucca-front-ng-horizontal-navigation.d.ts +3 -40
- package/types/lucca-front-ng-index-table.d.ts +40 -49
- package/types/lucca-front-ng-inline-message.d.ts +4 -11
- package/types/lucca-front-ng-input.d.ts +8 -8
- package/types/lucca-front-ng-link.d.ts +4 -4
- package/types/lucca-front-ng-listbox.d.ts +1 -8
- package/types/lucca-front-ng-loading.d.ts +1 -8
- package/types/lucca-front-ng-mobile-push.d.ts +1 -1
- package/types/lucca-front-ng-modal.d.ts +12 -12
- package/types/lucca-front-ng-multi-select.d.ts +55 -58
- package/types/lucca-front-ng-number-format.d.ts +2 -2
- package/types/lucca-front-ng-numeric-badge.d.ts +1 -8
- package/types/lucca-front-ng-option.d.ts +26 -26
- package/types/lucca-front-ng-page-header.d.ts +1 -1
- package/types/lucca-front-ng-pagination.d.ts +1 -8
- package/types/lucca-front-ng-popover.d.ts +53 -47
- package/types/lucca-front-ng-popover2.d.ts +33 -31
- package/types/lucca-front-ng-popup.d.ts +8 -8
- package/types/lucca-front-ng-progress-bar.d.ts +1 -8
- package/types/lucca-front-ng-progress-stepper.d.ts +1 -8
- package/types/lucca-front-ng-read-more.d.ts +7 -14
- package/types/lucca-front-ng-resource-card.d.ts +1 -10
- package/types/lucca-front-ng-scroll-box.d.ts +3 -3
- package/types/lucca-front-ng-segmented-control-tabs.d.ts +1 -3
- package/types/lucca-front-ng-segmented-control.d.ts +2 -4
- package/types/lucca-front-ng-select.d.ts +34 -32
- package/types/lucca-front-ng-sidepanel.d.ts +1 -1
- package/types/lucca-front-ng-simple-select.d.ts +16 -17
- package/types/lucca-front-ng-skeleton.d.ts +10 -26
- package/types/lucca-front-ng-software-icon.d.ts +5 -10
- package/types/lucca-front-ng-sortable-list.d.ts +8 -8
- package/types/lucca-front-ng-status-badge.d.ts +1 -8
- package/types/lucca-front-ng-tag.d.ts +1 -8
- package/types/lucca-front-ng-time.d.ts +25 -103
- package/types/lucca-front-ng-title.d.ts +5 -5
- package/types/lucca-front-ng-toast.d.ts +1 -1
- package/types/lucca-front-ng-tree-select.d.ts +11 -11
- package/types/lucca-front-ng-user-popover.d.ts +10 -9
- package/types/lucca-front-ng-user.d.ts +31 -45
- package/fesm2022/lucca-front-ng-highlight-text.mjs +0 -26
- package/fesm2022/lucca-front-ng-highlight-text.mjs.map +0 -1
- package/fesm2022/lucca-front-ng-impersonation.mjs +0 -119
- package/fesm2022/lucca-front-ng-impersonation.mjs.map +0 -1
- package/schematics/package.json +0 -3
- package/types/lucca-front-ng-highlight-text.d.ts +0 -12
- package/types/lucca-front-ng-impersonation.d.ts +0 -33
|
@@ -11,19 +11,21 @@ class HtmlFormatter extends RichTextFormatter {
|
|
|
11
11
|
return registerRichText(editor);
|
|
12
12
|
}
|
|
13
13
|
parse(editor, htmlString) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
if (htmlString) {
|
|
15
|
+
const parser = new DOMParser();
|
|
16
|
+
const dom = parser.parseFromString(DOMPurify.sanitize(htmlString, {
|
|
17
|
+
FORBID_ATTR: ['style', 'class'],
|
|
18
|
+
}), 'text/html');
|
|
19
|
+
editor.update(() => {
|
|
20
|
+
// Once you have the DOM instance it's easy to generate LexicalNodes.
|
|
21
|
+
const nodes = $generateNodesFromDOM(editor, dom);
|
|
22
|
+
// Select the root
|
|
23
|
+
$getRoot().clear();
|
|
24
|
+
$getRoot().select();
|
|
25
|
+
// Insert them at a selection.
|
|
26
|
+
$insertNodes(nodes);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
30
|
format(editor) {
|
|
29
31
|
let result = '';
|
|
@@ -41,10 +43,10 @@ function provideLuRichTextHTMLFormatter() {
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
class HtmlFormatterDirective {
|
|
44
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
45
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
46
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: HtmlFormatterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
47
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: HtmlFormatterDirective, isStandalone: true, selector: "lu-rich-text-input[luWithHtmlFormatter]", providers: [provideLuRichTextHTMLFormatter()], ngImport: i0 }); }
|
|
46
48
|
}
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: HtmlFormatterDirective, decorators: [{
|
|
48
50
|
type: Directive,
|
|
49
51
|
args: [{
|
|
50
52
|
selector: 'lu-rich-text-input[luWithHtmlFormatter]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucca-front-ng-forms-rich-text-input-formatters-html.mjs","sources":["../../../packages/ng/forms/rich-text-input/formatters/html/html-formatter.ts","../../../packages/ng/forms/rich-text-input/formatters/html/html-formatter.directive.ts","../../../packages/ng/forms/rich-text-input/formatters/html/lucca-front-ng-forms-rich-text-input-formatters-html.ts"],"sourcesContent":["import { Provider } from '@angular/core';\nimport { $generateHtmlFromNodes, $generateNodesFromDOM } from '@lexical/html';\nimport { registerRichText } from '@lexical/rich-text';\nimport { RICH_TEXT_FORMATTER, RichTextFormatter } from '@lucca-front/ng/forms/rich-text-input';\nimport DOMPurify from 'isomorphic-dompurify';\nimport { $getRoot, $insertNodes, LexicalEditor } from 'lexical';\n\nexport class HtmlFormatter extends RichTextFormatter {\n\toverride registerTextPlugin(editor: LexicalEditor) {\n\t\treturn registerRichText(editor);\n\t}\n\n\toverride parse(editor: LexicalEditor, htmlString?: string | null): void {\n\t\tconst parser = new DOMParser();\n\t\tconst dom = parser.parseFromString(\n\t\t\tDOMPurify.sanitize(htmlString, {\n\t\t\t\tFORBID_ATTR: ['style', 'class'],\n\t\t\t}),\n\t\t\t'text/html',\n\t\t);\n\
|
|
1
|
+
{"version":3,"file":"lucca-front-ng-forms-rich-text-input-formatters-html.mjs","sources":["../../../packages/ng/forms/rich-text-input/formatters/html/html-formatter.ts","../../../packages/ng/forms/rich-text-input/formatters/html/html-formatter.directive.ts","../../../packages/ng/forms/rich-text-input/formatters/html/lucca-front-ng-forms-rich-text-input-formatters-html.ts"],"sourcesContent":["import { Provider } from '@angular/core';\nimport { $generateHtmlFromNodes, $generateNodesFromDOM } from '@lexical/html';\nimport { registerRichText } from '@lexical/rich-text';\nimport { RICH_TEXT_FORMATTER, RichTextFormatter } from '@lucca-front/ng/forms/rich-text-input';\nimport DOMPurify from 'isomorphic-dompurify';\nimport { $getRoot, $insertNodes, LexicalEditor } from 'lexical';\n\nexport class HtmlFormatter extends RichTextFormatter {\n\toverride registerTextPlugin(editor: LexicalEditor) {\n\t\treturn registerRichText(editor);\n\t}\n\n\toverride parse(editor: LexicalEditor, htmlString?: string | null): void {\n\t\tif (htmlString) {\n\t\t\tconst parser = new DOMParser();\n\t\t\tconst dom = parser.parseFromString(\n\t\t\t\tDOMPurify.sanitize(htmlString, {\n\t\t\t\t\tFORBID_ATTR: ['style', 'class'],\n\t\t\t\t}),\n\t\t\t\t'text/html',\n\t\t\t);\n\t\t\teditor.update(() => {\n\t\t\t\t// Once you have the DOM instance it's easy to generate LexicalNodes.\n\t\t\t\tconst nodes = $generateNodesFromDOM(editor, dom);\n\n\t\t\t\t// Select the root\n\t\t\t\t$getRoot().clear();\n\t\t\t\t$getRoot().select();\n\n\t\t\t\t// Insert them at a selection.\n\t\t\t\t$insertNodes(nodes);\n\t\t\t});\n\t\t}\n\t}\n\n\toverride format(editor: LexicalEditor): string {\n\t\tlet result = '';\n\t\teditor.getEditorState().read(() => (result = $generateHtmlFromNodes(editor)));\n\t\treturn DOMPurify.sanitize(result, {\n\t\t\tFORBID_ATTR: ['style', 'class'],\n\t\t});\n\t}\n}\n\nexport function provideLuRichTextHTMLFormatter(): Provider {\n\treturn {\n\t\tprovide: RICH_TEXT_FORMATTER,\n\t\tuseFactory: () => new HtmlFormatter(),\n\t};\n}\n","import { Directive } from '@angular/core';\nimport { provideLuRichTextHTMLFormatter } from './html-formatter';\n\n@Directive({\n\tselector: 'lu-rich-text-input[luWithHtmlFormatter]',\n\tproviders: [provideLuRichTextHTMLFormatter()],\n})\nexport class HtmlFormatterDirective {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAOM,MAAO,aAAc,SAAQ,iBAAiB,CAAA;AAC1C,IAAA,kBAAkB,CAAC,MAAqB,EAAA;AAChD,QAAA,OAAO,gBAAgB,CAAC,MAAM,CAAC;IAChC;IAES,KAAK,CAAC,MAAqB,EAAE,UAA0B,EAAA;QAC/D,IAA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AAA,EAAA,QAAA,EAAA,yCAAA,EAAA,SAAA,EAFvB,CAAC,8BAA8B,EAAE,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAEjC,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,yCAAyC;AACnD,oBAAA,SAAS,EAAE,CAAC,8BAA8B,EAAE,CAAC;AAC7C,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -2,6 +2,7 @@ import { UNORDERED_LIST, HEADING, ORDERED_LIST, BOLD_ITALIC_STAR, BOLD_ITALIC_UN
|
|
|
2
2
|
import { registerRichText } from '@lexical/rich-text';
|
|
3
3
|
import { mergeRegister } from '@lexical/utils';
|
|
4
4
|
import { RichTextFormatter, RICH_TEXT_FORMATTER, $createTagNode, TagNode } from '@lucca-front/ng/forms/rich-text-input';
|
|
5
|
+
import DOMPurify from 'isomorphic-dompurify';
|
|
5
6
|
import * as i0 from '@angular/core';
|
|
6
7
|
import { Directive } from '@angular/core';
|
|
7
8
|
|
|
@@ -32,13 +33,13 @@ class MarkdownFormatter extends RichTextFormatter {
|
|
|
32
33
|
}
|
|
33
34
|
parse(editor, markdown) {
|
|
34
35
|
editor.update(() => {
|
|
35
|
-
$convertFromMarkdownString(markdown ?? '', this.#transformers, undefined, true);
|
|
36
|
+
$convertFromMarkdownString(DOMPurify.sanitize(markdown ?? ''), this.#transformers, undefined, true);
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
format(editor) {
|
|
39
40
|
let result = '';
|
|
40
41
|
editor.getEditorState().read(() => (result = $convertToMarkdownString(this.#transformers, undefined, true)));
|
|
41
|
-
return result;
|
|
42
|
+
return DOMPurify.sanitize(result);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
function provideLuRichTextMarkdownFormatter(transformers) {
|
|
@@ -70,10 +71,10 @@ const TAGS = {
|
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
class MarkdownFormatterDirective {
|
|
73
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
74
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
74
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: MarkdownFormatterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
75
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: MarkdownFormatterDirective, isStandalone: true, selector: "lu-rich-text-input[luWithMarkdownFormatter]", providers: [provideLuRichTextMarkdownFormatter()], ngImport: i0 }); }
|
|
75
76
|
}
|
|
76
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: MarkdownFormatterDirective, decorators: [{
|
|
77
78
|
type: Directive,
|
|
78
79
|
args: [{
|
|
79
80
|
selector: 'lu-rich-text-input[luWithMarkdownFormatter]',
|
|
@@ -81,10 +82,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
81
82
|
}]
|
|
82
83
|
}] });
|
|
83
84
|
class MarkdownFormatterWithTagsDirective {
|
|
84
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
85
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: MarkdownFormatterWithTagsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
86
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: MarkdownFormatterWithTagsDirective, isStandalone: true, selector: "lu-rich-text-input[luWithMarkdownTagsFormatter]", providers: [provideLuRichTextMarkdownFormatter([...DEFAULT_MARKDOWN_TRANSFORMERS, TAGS])], ngImport: i0 }); }
|
|
86
87
|
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: MarkdownFormatterWithTagsDirective, decorators: [{
|
|
88
89
|
type: Directive,
|
|
89
90
|
args: [{
|
|
90
91
|
selector: 'lu-rich-text-input[luWithMarkdownTagsFormatter]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucca-front-ng-forms-rich-text-input-formatters-markdown.mjs","sources":["../../../packages/ng/forms/rich-text-input/formatters/markdown/markdown-formatter.ts","../../../packages/ng/forms/rich-text-input/formatters/markdown/transformers/tag.transformers.ts","../../../packages/ng/forms/rich-text-input/formatters/markdown/markdown-formatter.directive.ts","../../../packages/ng/forms/rich-text-input/formatters/markdown/lucca-front-ng-forms-rich-text-input-formatters-markdown.ts"],"sourcesContent":["import { Provider } from '@angular/core';\nimport {\n\t$convertFromMarkdownString,\n\t$convertToMarkdownString,\n\tBOLD_ITALIC_STAR,\n\tBOLD_ITALIC_UNDERSCORE,\n\tBOLD_STAR,\n\tBOLD_UNDERSCORE,\n\tHEADING,\n\tINLINE_CODE,\n\tITALIC_STAR,\n\tITALIC_UNDERSCORE,\n\tLINK,\n\tORDERED_LIST,\n\tregisterMarkdownShortcuts,\n\tSTRIKETHROUGH,\n\tTransformer,\n\tUNORDERED_LIST,\n} from '@lexical/markdown';\nimport { registerRichText } from '@lexical/rich-text';\nimport { mergeRegister } from '@lexical/utils';\nimport { RICH_TEXT_FORMATTER, RichTextFormatter } from '@lucca-front/ng/forms/rich-text-input';\nimport { LexicalEditor } from 'lexical';\n\nexport const DEFAULT_MARKDOWN_TRANSFORMERS: Transformer[] = [\n\tUNORDERED_LIST,\n\tHEADING,\n\tORDERED_LIST,\n\tBOLD_ITALIC_STAR,\n\tBOLD_ITALIC_UNDERSCORE,\n\tBOLD_STAR,\n\tBOLD_UNDERSCORE,\n\tINLINE_CODE,\n\tITALIC_STAR,\n\tITALIC_UNDERSCORE,\n\tSTRIKETHROUGH,\n\tLINK,\n];\n\nexport class MarkdownFormatter extends RichTextFormatter {\n\t#transformers: Transformer[] = DEFAULT_MARKDOWN_TRANSFORMERS;\n\n\tconstructor(transformers?: Transformer[]) {\n\t\tsuper();\n\t\tif (transformers) {\n\t\t\tthis.#transformers = transformers;\n\t\t}\n\t}\n\n\toverride registerTextPlugin(editor: LexicalEditor): () => void {\n\t\treturn mergeRegister(registerMarkdownShortcuts(editor, this.#transformers), registerRichText(editor));\n\t}\n\n\toverride parse(editor: LexicalEditor, markdown?: string | null): void {\n\t\teditor.update(() => {\n\t\t\t$convertFromMarkdownString(markdown ?? '', this.#transformers, undefined, true);\n\t\t});\n\t}\n\n\toverride format(editor: LexicalEditor): string {\n\t\tlet result = '';\n\t\teditor.getEditorState().read(() => (result = $convertToMarkdownString(this.#transformers, undefined, true)));\n\t\treturn result;\n\t}\n}\n\nexport function provideLuRichTextMarkdownFormatter(transformers?: Transformer[]): Provider {\n\treturn {\n\t\tprovide: RICH_TEXT_FORMATTER,\n\t\tuseFactory: () => new MarkdownFormatter(transformers),\n\t};\n}\n","import { TextMatchTransformer } from '@lexical/markdown';\nimport { $createTagNode, TagNode } from '@lucca-front/ng/forms/rich-text-input';\n\n/**\n * Transformer for tag nodes\n * It will match the following pattern `{{Tag}}` and create a TagNode (using `replace` function).\n * It will export the tag node to markdown (as `{{Tag}}`) using the `export` function.\n *\n * @docs https://github.com/facebook/lexical/tree/main/packages/lexical-markdown#transformers\n */\nexport const TAGS: TextMatchTransformer = {\n\tdependencies: [TagNode],\n\texport: (node) => (node instanceof TagNode ? `{{${node.getTagKey()}}}` : null),\n\timportRegExp: /{{(\\w+)}}/,\n\tregExp: /{{(\\w+)}}/,\n\treplace: (textNode, match) => {\n\t\tif (match[1]) {\n\t\t\ttextNode.replace($createTagNode(match[1].trim()));\n\t\t}\n\t},\n\ttype: 'text-match',\n\ttrigger: '{{',\n};\n","import { Directive } from '@angular/core';\nimport { DEFAULT_MARKDOWN_TRANSFORMERS, provideLuRichTextMarkdownFormatter } from './markdown-formatter';\nimport { TAGS } from './transformers';\n\n@Directive({\n\tselector: 'lu-rich-text-input[luWithMarkdownFormatter]',\n\tproviders: [provideLuRichTextMarkdownFormatter()],\n})\nexport class MarkdownFormatterDirective {}\n\n@Directive({\n\tselector: 'lu-rich-text-input[luWithMarkdownTagsFormatter]',\n\tproviders: [provideLuRichTextMarkdownFormatter([...DEFAULT_MARKDOWN_TRANSFORMERS, TAGS])],\n})\nexport class MarkdownFormatterWithTagsDirective {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lucca-front-ng-forms-rich-text-input-formatters-markdown.mjs","sources":["../../../packages/ng/forms/rich-text-input/formatters/markdown/markdown-formatter.ts","../../../packages/ng/forms/rich-text-input/formatters/markdown/transformers/tag.transformers.ts","../../../packages/ng/forms/rich-text-input/formatters/markdown/markdown-formatter.directive.ts","../../../packages/ng/forms/rich-text-input/formatters/markdown/lucca-front-ng-forms-rich-text-input-formatters-markdown.ts"],"sourcesContent":["import { Provider } from '@angular/core';\nimport {\n\t$convertFromMarkdownString,\n\t$convertToMarkdownString,\n\tBOLD_ITALIC_STAR,\n\tBOLD_ITALIC_UNDERSCORE,\n\tBOLD_STAR,\n\tBOLD_UNDERSCORE,\n\tHEADING,\n\tINLINE_CODE,\n\tITALIC_STAR,\n\tITALIC_UNDERSCORE,\n\tLINK,\n\tORDERED_LIST,\n\tregisterMarkdownShortcuts,\n\tSTRIKETHROUGH,\n\tTransformer,\n\tUNORDERED_LIST,\n} from '@lexical/markdown';\nimport { registerRichText } from '@lexical/rich-text';\nimport { mergeRegister } from '@lexical/utils';\nimport { RICH_TEXT_FORMATTER, RichTextFormatter } from '@lucca-front/ng/forms/rich-text-input';\nimport DOMPurify from 'isomorphic-dompurify';\nimport { LexicalEditor } from 'lexical';\n\nexport const DEFAULT_MARKDOWN_TRANSFORMERS: Transformer[] = [\n\tUNORDERED_LIST,\n\tHEADING,\n\tORDERED_LIST,\n\tBOLD_ITALIC_STAR,\n\tBOLD_ITALIC_UNDERSCORE,\n\tBOLD_STAR,\n\tBOLD_UNDERSCORE,\n\tINLINE_CODE,\n\tITALIC_STAR,\n\tITALIC_UNDERSCORE,\n\tSTRIKETHROUGH,\n\tLINK,\n];\n\nexport class MarkdownFormatter extends RichTextFormatter {\n\t#transformers: Transformer[] = DEFAULT_MARKDOWN_TRANSFORMERS;\n\n\tconstructor(transformers?: Transformer[]) {\n\t\tsuper();\n\t\tif (transformers) {\n\t\t\tthis.#transformers = transformers;\n\t\t}\n\t}\n\n\toverride registerTextPlugin(editor: LexicalEditor): () => void {\n\t\treturn mergeRegister(registerMarkdownShortcuts(editor, this.#transformers), registerRichText(editor));\n\t}\n\n\toverride parse(editor: LexicalEditor, markdown?: string | null): void {\n\t\teditor.update(() => {\n\t\t\t$convertFromMarkdownString(DOMPurify.sanitize(markdown ?? ''), this.#transformers, undefined, true);\n\t\t});\n\t}\n\n\toverride format(editor: LexicalEditor): string {\n\t\tlet result = '';\n\t\teditor.getEditorState().read(() => (result = $convertToMarkdownString(this.#transformers, undefined, true)));\n\t\treturn DOMPurify.sanitize(result);\n\t}\n}\n\nexport function provideLuRichTextMarkdownFormatter(transformers?: Transformer[]): Provider {\n\treturn {\n\t\tprovide: RICH_TEXT_FORMATTER,\n\t\tuseFactory: () => new MarkdownFormatter(transformers),\n\t};\n}\n","import { TextMatchTransformer } from '@lexical/markdown';\nimport { $createTagNode, TagNode } from '@lucca-front/ng/forms/rich-text-input';\n\n/**\n * Transformer for tag nodes\n * It will match the following pattern `{{Tag}}` and create a TagNode (using `replace` function).\n * It will export the tag node to markdown (as `{{Tag}}`) using the `export` function.\n *\n * @docs https://github.com/facebook/lexical/tree/main/packages/lexical-markdown#transformers\n */\nexport const TAGS: TextMatchTransformer = {\n\tdependencies: [TagNode],\n\texport: (node) => (node instanceof TagNode ? `{{${node.getTagKey()}}}` : null),\n\timportRegExp: /{{(\\w+)}}/,\n\tregExp: /{{(\\w+)}}/,\n\treplace: (textNode, match) => {\n\t\tif (match[1]) {\n\t\t\ttextNode.replace($createTagNode(match[1].trim()));\n\t\t}\n\t},\n\ttype: 'text-match',\n\ttrigger: '{{',\n};\n","import { Directive } from '@angular/core';\nimport { DEFAULT_MARKDOWN_TRANSFORMERS, provideLuRichTextMarkdownFormatter } from './markdown-formatter';\nimport { TAGS } from './transformers';\n\n@Directive({\n\tselector: 'lu-rich-text-input[luWithMarkdownFormatter]',\n\tproviders: [provideLuRichTextMarkdownFormatter()],\n})\nexport class MarkdownFormatterDirective {}\n\n@Directive({\n\tselector: 'lu-rich-text-input[luWithMarkdownTagsFormatter]',\n\tproviders: [provideLuRichTextMarkdownFormatter([...DEFAULT_MARKDOWN_TRANSFORMERS, TAGS])],\n})\nexport class MarkdownFormatterWithTagsDirective {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAyBO,MAAM,6BAA6B,GAAkB;IAC3D,cAAc;IACd,OAAO;IACP,YAAY;IACZ,gBAAgB;IAChB,sBAAsB;IACtB,SAAS;IACT,eAAe;IACf,WAAW;IACX,WAAW;IACX,iBAAiB;IACjB,aAAa;IACb,IAAI;;AAGC,MAAO,iBAAkB,SAAQ,iBAAiB,CAAA;IACvD,aAAa,GAAkB,6BAA6B;AAE5D,IAAA,WAAA,CAAY,YAA4B,EAAA;AACvC,QAAA,KAAK,EAAE;QACP,IAAI,YAAY,EAAE;AACjB,YAAA,IAAI,CAAC,aAAa,GAAG,YAAY;QAClC;IACD;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,CAAC,CAAC,GAAG,6BAA6B,EAAE,IAAI,CAAC,CAAC,CAAC;AACzF,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { registerPlainText } from '@lexical/plain-text';
|
|
2
|
+
import { $rootTextContent } from '@lexical/text';
|
|
1
3
|
import { $createTagNode, RichTextFormatter, RICH_TEXT_FORMATTER } from '@lucca-front/ng/forms/rich-text-input';
|
|
2
4
|
import { $getRoot, $createParagraphNode, $createTextNode } from 'lexical';
|
|
3
|
-
import { $rootTextContent } from '@lexical/text';
|
|
4
|
-
import { registerPlainText } from '@lexical/plain-text';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
6
|
import { Directive } from '@angular/core';
|
|
7
7
|
|
|
@@ -56,7 +56,9 @@ class PlainTextFormatter extends RichTextFormatter {
|
|
|
56
56
|
}
|
|
57
57
|
const startIndex = match.index || 0;
|
|
58
58
|
const endIndex = startIndex + match[0].length;
|
|
59
|
-
let transformedNode
|
|
59
|
+
let transformedNode = undefined;
|
|
60
|
+
let nodeAfter = undefined;
|
|
61
|
+
let nodeBefore = undefined;
|
|
60
62
|
if (startIndex === 0) {
|
|
61
63
|
[transformedNode, nodeAfter] = textNode.splitText(endIndex);
|
|
62
64
|
}
|
|
@@ -84,10 +86,10 @@ function provideLuRichTextPlainTextFormatter(transformers) {
|
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
class PlainTextFormatterWithTagsDirective {
|
|
87
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
88
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
89
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PlainTextFormatterWithTagsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
90
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: PlainTextFormatterWithTagsDirective, isStandalone: true, selector: "lu-rich-text-input[luWithPlainTextTagsFormatter]", providers: [provideLuRichTextPlainTextFormatter()], ngImport: i0 }); }
|
|
89
91
|
}
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PlainTextFormatterWithTagsDirective, decorators: [{
|
|
91
93
|
type: Directive,
|
|
92
94
|
args: [{
|
|
93
95
|
selector: 'lu-rich-text-input[luWithPlainTextTagsFormatter]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucca-front-ng-forms-rich-text-input-formatters-plain-text.mjs","sources":["../../../packages/ng/forms/rich-text-input/formatters/plain-text/transformers/tag.transformers.ts","../../../packages/ng/forms/rich-text-input/formatters/plain-text/plain-text-formatter.ts","../../../packages/ng/forms/rich-text-input/formatters/plain-text/plain-text-formatter.directive.ts","../../../packages/ng/forms/rich-text-input/formatters/plain-text/lucca-front-ng-forms-rich-text-input-formatters-plain-text.ts"],"sourcesContent":["import { $createTagNode } from '@lucca-front/ng/forms/rich-text-input';\nimport { PlainTextTransformer } from './plain-text-transformer';\n\n/**\n * Transformer for tag nodes\n * It will match the following pattern `{{Tag}}` and create a TagNode (using `replace` function).\n *\n */\nexport const PLAINTEXT_TAGS: PlainTextTransformer = {\n\tregExp: /{{(\\w+)}}/,\n\treplace: (textNode, match) => {\n\t\tif (match[1]) {\n\t\t\ttextNode.replace($createTagNode(match[1].trim()));\n\t\t}\n\t},\n};\n","import { Provider } from '@angular/core';\nimport { RICH_TEXT_FORMATTER, RichTextFormatter } from '@lucca-front/ng/forms/rich-text-input';\nimport { $createParagraphNode, $createTextNode, $getRoot, LexicalEditor, TextNode } from 'lexical';\nimport {
|
|
1
|
+
{"version":3,"file":"lucca-front-ng-forms-rich-text-input-formatters-plain-text.mjs","sources":["../../../packages/ng/forms/rich-text-input/formatters/plain-text/transformers/tag.transformers.ts","../../../packages/ng/forms/rich-text-input/formatters/plain-text/plain-text-formatter.ts","../../../packages/ng/forms/rich-text-input/formatters/plain-text/plain-text-formatter.directive.ts","../../../packages/ng/forms/rich-text-input/formatters/plain-text/lucca-front-ng-forms-rich-text-input-formatters-plain-text.ts"],"sourcesContent":["import { $createTagNode } from '@lucca-front/ng/forms/rich-text-input';\nimport { PlainTextTransformer } from './plain-text-transformer';\n\n/**\n * Transformer for tag nodes\n * It will match the following pattern `{{Tag}}` and create a TagNode (using `replace` function).\n *\n */\nexport const PLAINTEXT_TAGS: PlainTextTransformer = {\n\tregExp: /{{(\\w+)}}/,\n\treplace: (textNode, match) => {\n\t\tif (match[1]) {\n\t\t\ttextNode.replace($createTagNode(match[1].trim()));\n\t\t}\n\t},\n};\n","import { Provider } from '@angular/core';\nimport { registerPlainText } from '@lexical/plain-text';\nimport { $rootTextContent } from '@lexical/text';\nimport { RICH_TEXT_FORMATTER, RichTextFormatter } from '@lucca-front/ng/forms/rich-text-input';\nimport { $createParagraphNode, $createTextNode, $getRoot, LexicalEditor, TextNode } from 'lexical';\nimport { PLAINTEXT_TAGS, PlainTextTransformer } from './transformers';\n\nexport class PlainTextFormatter extends RichTextFormatter {\n\t#transformers: PlainTextTransformer[] = [PLAINTEXT_TAGS];\n\n\tconstructor(transformers?: PlainTextTransformer[]) {\n\t\tsuper();\n\t\tif (transformers) {\n\t\t\tthis.#transformers = transformers;\n\t\t}\n\t}\n\n\toverride registerTextPlugin(editor: LexicalEditor) {\n\t\treturn registerPlainText(editor);\n\t}\n\n\toverride parse(editor: LexicalEditor, text?: string | null): void {\n\t\teditor.update(() => {\n\t\t\tconst rootNode = $getRoot();\n\t\t\trootNode.clear();\n\t\t\tif (text) {\n\t\t\t\tconst paragraphNode = $createParagraphNode();\n\t\t\t\tconst textNode = $createTextNode(text);\n\t\t\t\tparagraphNode.append(textNode);\n\t\t\t\trootNode.append(paragraphNode);\n\t\t\t\tthis.#applyTransformers(textNode);\n\t\t\t}\n\t\t});\n\t}\n\n\toverride format(editor: LexicalEditor): string {\n\t\tlet result = '';\n\t\teditor.getEditorState().read(() => (result = $rootTextContent()));\n\t\treturn result;\n\t}\n\n\t#applyTransformers(textNode: TextNode): void {\n\t\tfor (const t of this.#transformers) {\n\t\t\tconst match = textNode.getTextContent().match(t.regExp);\n\n\t\t\tif (!match) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst startIndex = match.index || 0;\n\t\t\tconst endIndex = startIndex + match[0].length;\n\n\t\t\tlet transformedNode: TextNode | undefined = undefined;\n\t\t\tlet nodeAfter: TextNode | undefined = undefined;\n\t\t\tlet nodeBefore: TextNode | undefined = undefined;\n\n\t\t\tif (startIndex === 0) {\n\t\t\t\t[transformedNode, nodeAfter] = textNode.splitText(endIndex);\n\t\t\t} else {\n\t\t\t\t[nodeBefore, transformedNode, nodeAfter] = textNode.splitText(startIndex, endIndex);\n\t\t\t}\n\t\t\tif (transformedNode) {\n\t\t\t\tt.replace(transformedNode, match);\n\t\t\t}\n\t\t\tif (nodeAfter) {\n\t\t\t\tthis.#applyTransformers(nodeAfter);\n\t\t\t}\n\t\t\tif (nodeBefore) {\n\t\t\t\tthis.#applyTransformers(nodeBefore);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nexport function provideLuRichTextPlainTextFormatter(transformers?: PlainTextTransformer[]): Provider {\n\treturn {\n\t\tprovide: RICH_TEXT_FORMATTER,\n\t\tuseFactory: () => new PlainTextFormatter(transformers),\n\t};\n}\n","import { Directive } from '@angular/core';\nimport { provideLuRichTextPlainTextFormatter } from './plain-text-formatter';\n\n@Directive({\n\tselector: 'lu-rich-text-input[luWithPlainTextTagsFormatter]',\n\tproviders: [provideLuRichTextPlainTextFormatter()],\n})\nexport class PlainTextFormatterWithTagsDirective {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],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