@ngstarter-ui/components 22.3.5 → 22.4.1
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/README.md +27 -0
- package/ai/component-registry.json +186 -101
- package/fesm2022/attachment-block-BK9QxVjq.mjs +163 -0
- package/fesm2022/attachment-block-BK9QxVjq.mjs.map +1 -0
- package/fesm2022/callout-block-Bl4GZYz8.mjs +196 -0
- package/fesm2022/callout-block-Bl4GZYz8.mjs.map +1 -0
- package/fesm2022/code-block.component-DCRD-9iP.mjs +393 -0
- package/fesm2022/code-block.component-DCRD-9iP.mjs.map +1 -0
- package/fesm2022/content-builder.store-D622mHxt.mjs +328 -0
- package/fesm2022/content-builder.store-D622mHxt.mjs.map +1 -0
- package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs +1110 -0
- package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs.map +1 -0
- package/fesm2022/cursor-controller-DKfBII1n.mjs +55 -0
- package/fesm2022/cursor-controller-DKfBII1n.mjs.map +1 -0
- package/fesm2022/default-converters-9oSKDsXP.mjs +140 -0
- package/fesm2022/default-converters-9oSKDsXP.mjs.map +1 -0
- package/fesm2022/divider-block.component-Dvgeq_D0.mjs +148 -0
- package/fesm2022/divider-block.component-Dvgeq_D0.mjs.map +1 -0
- package/fesm2022/embed-block-CYkOv4Wt.mjs +565 -0
- package/fesm2022/embed-block-CYkOv4Wt.mjs.map +1 -0
- package/fesm2022/extra-block-defs-Cn_hfM3c.mjs +122 -0
- package/fesm2022/extra-block-defs-Cn_hfM3c.mjs.map +1 -0
- package/fesm2022/gallery-block-DT3uIURY.mjs +365 -0
- package/fesm2022/gallery-block-DT3uIURY.mjs.map +1 -0
- package/fesm2022/grid-block-ZVDT3m8-.mjs +504 -0
- package/fesm2022/grid-block-ZVDT3m8-.mjs.map +1 -0
- package/fesm2022/heading-block.component-iCpJGTMh.mjs +274 -0
- package/fesm2022/heading-block.component-iCpJGTMh.mjs.map +1 -0
- package/fesm2022/html-utils-DywL8gGa.mjs +24 -0
- package/fesm2022/html-utils-DywL8gGa.mjs.map +1 -0
- package/fesm2022/image-block.component-DJ7-HCR8.mjs +285 -0
- package/fesm2022/image-block.component-DJ7-HCR8.mjs.map +1 -0
- package/fesm2022/list-block.component-qFIebEBO.mjs +312 -0
- package/fesm2022/list-block.component-qFIebEBO.mjs.map +1 -0
- package/fesm2022/nested-blocks-CXhgXJ1H.mjs +345 -0
- package/fesm2022/nested-blocks-CXhgXJ1H.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-action-required.mjs +150 -45
- package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-alert.mjs +318 -133
- package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-announcement.mjs +280 -88
- package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs +647 -386
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-avatar.mjs +715 -482
- package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-badge.mjs +308 -97
- package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-block-loader.mjs +164 -47
- package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +278 -315
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +707 -205
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs +518 -175
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button.mjs +294 -68
- package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-calendar.mjs +442 -250
- package/fesm2022/ngstarter-ui-components-calendar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs +159 -47
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-card.mjs +619 -194
- package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-carousel.mjs +1012 -634
- package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-checkbox.mjs +715 -308
- package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-chips.mjs +1397 -667
- package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +519 -357
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-picker.mjs +1218 -604
- package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs +265 -134
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs +190 -71
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-command-bar.mjs +197 -58
- package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs +2212 -1128
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +269 -183
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-confirm.mjs +164 -86
- package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +6240 -2
- package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +244 -108
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-core.mjs +2110 -1592
- package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-country-select.mjs +1970 -588
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-crop.mjs +249 -191
- package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-currency-select.mjs +1658 -452
- package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +4538 -2497
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs +357 -157
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-datepicker.mjs +2587 -1264
- package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-dialog.mjs +681 -385
- package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-digit-roller.mjs +1000 -750
- package/fesm2022/ngstarter-ui-components-digit-roller.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-divider.mjs +164 -41
- package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-drawer.mjs +218 -143
- package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +345 -247
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-empty-state.mjs +244 -74
- package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-events.mjs +467 -126
- package/fesm2022/ngstarter-ui-components-events.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-expand.mjs +191 -59
- package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-expansion.mjs +529 -193
- package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-file-type.mjs +270 -171
- package/fesm2022/ngstarter-ui-components-file-type.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +741 -352
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-builder.mjs +9032 -6964
- package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-field.mjs +741 -276
- package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-gauge.mjs +155 -43
- package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-grid.mjs +197 -81
- package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs +881 -740
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs +3573 -3656
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +277 -204
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-icon.mjs +209 -182
- package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +5096 -4066
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +45 -19
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs +333 -154
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs +564 -358
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +246 -167
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-incidents.mjs +732 -258
- package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +244 -182
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input-mask.mjs +314 -174
- package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input-validator.mjs +45 -69
- package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input.mjs +303 -161
- package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +504 -159
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kbd.mjs +86 -30
- package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-layout.mjs +681 -220
- package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-list.mjs +968 -281
- package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-logo.mjs +181 -51
- package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-marquee.mjs +226 -147
- package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +1686 -1091
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs +1541 -943
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-navigation.mjs +1035 -455
- package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-notifications.mjs +678 -230
- package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-number-input.mjs +616 -316
- package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-option.mjs +405 -163
- package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-overlay.mjs +107 -111
- package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +131 -76
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-paginator.mjs +543 -295
- package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-password-strength.mjs +785 -340
- package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +3705 -2695
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-signer.mjs +1179 -851
- package/fesm2022/ngstarter-ui-components-pdf-signer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +2973 -2070
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +2081 -770
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pin-input.mjs +366 -198
- package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-popover.mjs +558 -308
- package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs +178 -73
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio-card.mjs +301 -105
- package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio.mjs +417 -157
- package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs +208 -88
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs +123 -74
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs +197 -95
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +383 -245
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +705 -581
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-segmented.mjs +422 -220
- package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-select.mjs +1862 -1159
- package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-side-panel.mjs +313 -118
- package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sidebar.mjs +1239 -470
- package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sidenav.mjs +664 -354
- package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1092 -643
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-skeleton.mjs +153 -43
- package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +425 -108
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slider.mjs +645 -487
- package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs +372 -354
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sort.mjs +378 -147
- package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-spinner.mjs +242 -76
- package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs +142 -91
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-split.mjs +1067 -929
- package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-step-tracker.mjs +617 -331
- package/fesm2022/ngstarter-ui-components-step-tracker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-stepper.mjs +357 -126
- package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-suggestions.mjs +259 -72
- package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs +674 -267
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-table.mjs +1144 -662
- package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tabs.mjs +1236 -615
- package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +414 -216
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tiles.mjs +939 -647
- package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timeline.mjs +418 -122
- package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timepicker.mjs +870 -508
- package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs +651 -371
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-toolbar.mjs +727 -320
- package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tooltip.mjs +601 -521
- package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tree-select.mjs +1197 -434
- package/fesm2022/ngstarter-ui-components-tree-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tree.mjs +1821 -1262
- package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-upload.mjs +1059 -345
- package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-video-player.mjs +763 -533
- package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs +630 -229
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs +40 -17
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-whiteboard.mjs +3039 -1803
- package/fesm2022/ngstarter-ui-components-whiteboard.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components.mjs +3 -5
- package/fesm2022/ngstarter-ui-components.mjs.map +1 -1
- package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs +264 -0
- package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs.map +1 -0
- package/fesm2022/plain-text-settings-BnxCxLhA.mjs +354 -0
- package/fesm2022/plain-text-settings-BnxCxLhA.mjs.map +1 -0
- package/fesm2022/quote-block.component-tRmrU97F.mjs +309 -0
- package/fesm2022/quote-block.component-tRmrU97F.mjs.map +1 -0
- package/fesm2022/table-block.component-BuzRRggv.mjs +1859 -0
- package/fesm2022/table-block.component-BuzRRggv.mjs.map +1 -0
- package/fesm2022/toggle-block-C5Jo2YDf.mjs +150 -0
- package/fesm2022/toggle-block-C5Jo2YDf.mjs.map +1 -0
- package/fesm2022/upload-status-tZ0x0BUB.mjs +107 -0
- package/fesm2022/upload-status-tZ0x0BUB.mjs.map +1 -0
- package/fesm2022/video-block.component-CpAXibm6.mjs +312 -0
- package/fesm2022/video-block.component-CpAXibm6.mjs.map +1 -0
- package/package.json +11 -10
- package/styles/_tokens.scss +1 -0
- package/types/ngstarter-ui-components-action-required.d.ts +34 -14
- package/types/ngstarter-ui-components-alert.d.ts +53 -44
- package/types/ngstarter-ui-components-announcement.d.ts +74 -53
- package/types/ngstarter-ui-components-autocomplete.d.ts +141 -84
- package/types/ngstarter-ui-components-avatar.d.ts +113 -66
- package/types/ngstarter-ui-components-badge.d.ts +73 -37
- package/types/ngstarter-ui-components-block-loader.d.ts +32 -20
- package/types/ngstarter-ui-components-bottom-sheet.d.ts +125 -132
- package/types/ngstarter-ui-components-breadcrumbs.d.ts +93 -88
- package/types/ngstarter-ui-components-button-toggle.d.ts +124 -54
- package/types/ngstarter-ui-components-button.d.ts +69 -27
- package/types/ngstarter-ui-components-calendar.d.ts +123 -71
- package/types/ngstarter-ui-components-card-overlay.d.ts +31 -19
- package/types/ngstarter-ui-components-card.d.ts +75 -71
- package/types/ngstarter-ui-components-carousel.d.ts +115 -69
- package/types/ngstarter-ui-components-checkbox.d.ts +183 -86
- package/types/ngstarter-ui-components-chips.d.ts +288 -195
- package/types/ngstarter-ui-components-code-highlighter.d.ts +71 -28
- package/types/ngstarter-ui-components-color-picker.d.ts +140 -89
- package/types/ngstarter-ui-components-color-scheme.d.ts +43 -52
- package/types/ngstarter-ui-components-color-switcher.d.ts +46 -26
- package/types/ngstarter-ui-components-command-bar.d.ts +40 -26
- package/types/ngstarter-ui-components-comment-editor.d.ts +311 -235
- package/types/ngstarter-ui-components-comparison-slider.d.ts +41 -40
- package/types/ngstarter-ui-components-confirm.d.ts +24 -29
- package/types/ngstarter-ui-components-content-editor.d.ts +1482 -998
- package/types/ngstarter-ui-components-cookie-popup.d.ts +43 -38
- package/types/ngstarter-ui-components-core.d.ts +513 -467
- package/types/ngstarter-ui-components-country-select.d.ts +170 -97
- package/types/ngstarter-ui-components-crop.d.ts +67 -52
- package/types/ngstarter-ui-components-currency-select.d.ts +127 -90
- package/types/ngstarter-ui-components-data-view.d.ts +811 -567
- package/types/ngstarter-ui-components-date-format-select.d.ts +90 -58
- package/types/ngstarter-ui-components-datepicker.d.ts +589 -373
- package/types/ngstarter-ui-components-dialog.d.ts +138 -116
- package/types/ngstarter-ui-components-digit-roller.d.ts +228 -131
- package/types/ngstarter-ui-components-divider.d.ts +29 -17
- package/types/ngstarter-ui-components-drawer.d.ts +39 -30
- package/types/ngstarter-ui-components-emoji-picker.d.ts +69 -47
- package/types/ngstarter-ui-components-empty-state.d.ts +20 -28
- package/types/ngstarter-ui-components-events.d.ts +73 -57
- package/types/ngstarter-ui-components-expand.d.ts +55 -25
- package/types/ngstarter-ui-components-expansion.d.ts +93 -64
- package/types/ngstarter-ui-components-file-type.d.ts +53 -27
- package/types/ngstarter-ui-components-filter-builder.d.ts +131 -100
- package/types/ngstarter-ui-components-form-builder.d.ts +1094 -881
- package/types/ngstarter-ui-components-form-field.d.ts +116 -105
- package/types/ngstarter-ui-components-gauge.d.ts +32 -20
- package/types/ngstarter-ui-components-grid.d.ts +66 -50
- package/types/ngstarter-ui-components-guided-tour.d.ts +250 -222
- package/types/ngstarter-ui-components-headless-editor.d.ts +708 -658
- package/types/ngstarter-ui-components-headless-stepper.d.ts +84 -64
- package/types/ngstarter-ui-components-icon.d.ts +39 -38
- package/types/ngstarter-ui-components-image-designer.d.ts +422 -341
- package/types/ngstarter-ui-components-image-placeholder.d.ts +5 -8
- package/types/ngstarter-ui-components-image-resizer.d.ts +40 -33
- package/types/ngstarter-ui-components-image-viewer.d.ts +67 -54
- package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +29 -33
- package/types/ngstarter-ui-components-incidents.d.ts +97 -104
- package/types/ngstarter-ui-components-inline-text-edit.d.ts +54 -39
- package/types/ngstarter-ui-components-input-mask.d.ts +54 -34
- package/types/ngstarter-ui-components-input-validator.d.ts +7 -11
- package/types/ngstarter-ui-components-input.d.ts +82 -54
- package/types/ngstarter-ui-components-kanban-board.d.ts +76 -63
- package/types/ngstarter-ui-components-kbd.d.ts +8 -12
- package/types/ngstarter-ui-components-layout.d.ts +131 -87
- package/types/ngstarter-ui-components-list.d.ts +123 -88
- package/types/ngstarter-ui-components-logo.d.ts +21 -21
- package/types/ngstarter-ui-components-marquee.d.ts +41 -34
- package/types/ngstarter-ui-components-menu.d.ts +329 -221
- package/types/ngstarter-ui-components-micro-chart.d.ts +385 -186
- package/types/ngstarter-ui-components-navigation.d.ts +186 -125
- package/types/ngstarter-ui-components-notifications.d.ts +104 -89
- package/types/ngstarter-ui-components-number-input.d.ts +138 -96
- package/types/ngstarter-ui-components-option.d.ts +102 -68
- package/types/ngstarter-ui-components-overlay.d.ts +7 -12
- package/types/ngstarter-ui-components-page-loading-bar.d.ts +23 -20
- package/types/ngstarter-ui-components-paginator.d.ts +171 -129
- package/types/ngstarter-ui-components-password-strength.d.ts +217 -102
- package/types/ngstarter-ui-components-pdf-builder.d.ts +717 -649
- package/types/ngstarter-ui-components-pdf-signer.d.ts +202 -142
- package/types/ngstarter-ui-components-pdf-viewer.d.ts +544 -385
- package/types/ngstarter-ui-components-phone-input.d.ts +175 -115
- package/types/ngstarter-ui-components-pin-input.d.ts +83 -45
- package/types/ngstarter-ui-components-popover.d.ts +128 -89
- package/types/ngstarter-ui-components-progress-bar.d.ts +49 -30
- package/types/ngstarter-ui-components-radio-card.d.ts +50 -34
- package/types/ngstarter-ui-components-radio.d.ts +100 -47
- package/types/ngstarter-ui-components-rail-nav.d.ts +36 -29
- package/types/ngstarter-ui-components-resizable-container.d.ts +30 -25
- package/types/ngstarter-ui-components-screen-loader.d.ts +38 -32
- package/types/ngstarter-ui-components-scroll-spy.d.ts +56 -60
- package/types/ngstarter-ui-components-scrollbar-area.d.ts +116 -86
- package/types/ngstarter-ui-components-segmented.d.ts +93 -61
- package/types/ngstarter-ui-components-select.d.ts +366 -266
- package/types/ngstarter-ui-components-side-panel.d.ts +59 -40
- package/types/ngstarter-ui-components-sidebar.d.ts +208 -154
- package/types/ngstarter-ui-components-sidenav.d.ts +136 -78
- package/types/ngstarter-ui-components-signature-pad.d.ts +165 -92
- package/types/ngstarter-ui-components-skeleton.d.ts +18 -17
- package/types/ngstarter-ui-components-slide-toggle.d.ts +113 -44
- package/types/ngstarter-ui-components-slider.d.ts +123 -82
- package/types/ngstarter-ui-components-snack-bar.d.ts +126 -134
- package/types/ngstarter-ui-components-sort.d.ts +99 -63
- package/types/ngstarter-ui-components-spinner.d.ts +49 -27
- package/types/ngstarter-ui-components-splash-screen.d.ts +34 -29
- package/types/ngstarter-ui-components-split.d.ts +276 -195
- package/types/ngstarter-ui-components-step-tracker.d.ts +102 -83
- package/types/ngstarter-ui-components-stepper.d.ts +57 -43
- package/types/ngstarter-ui-components-suggestions.d.ts +41 -28
- package/types/ngstarter-ui-components-tab-panel.d.ts +110 -83
- package/types/ngstarter-ui-components-table.d.ts +256 -228
- package/types/ngstarter-ui-components-tabs.d.ts +231 -138
- package/types/ngstarter-ui-components-thumbnail-maker.d.ts +40 -34
- package/types/ngstarter-ui-components-tiles.d.ts +166 -104
- package/types/ngstarter-ui-components-timeline.d.ts +45 -57
- package/types/ngstarter-ui-components-timepicker.d.ts +166 -111
- package/types/ngstarter-ui-components-timezone-select.d.ts +110 -70
- package/types/ngstarter-ui-components-toolbar.d.ts +89 -72
- package/types/ngstarter-ui-components-tooltip.d.ts +89 -52
- package/types/ngstarter-ui-components-tree-select.d.ts +182 -105
- package/types/ngstarter-ui-components-tree.d.ts +355 -229
- package/types/ngstarter-ui-components-upload.d.ts +216 -131
- package/types/ngstarter-ui-components-video-player.d.ts +130 -67
- package/types/ngstarter-ui-components-video-viewer.d.ts +140 -91
- package/types/ngstarter-ui-components-visual-builder.d.ts +5 -8
- package/types/ngstarter-ui-components-whiteboard.d.ts +412 -339
- package/types/ngstarter-ui-components.d.ts +2 -2
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-8OmuepvH.mjs +0 -35
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-8OmuepvH.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Dp5tISk3.mjs +0 -26
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Dp5tISk3.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbBs-R_y.mjs +0 -220
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbBs-R_y.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +0 -99
- package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs +0 -40
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGCCeU-Y.mjs +0 -375
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGCCeU-Y.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-BJfRgtaA.mjs +0 -80
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-BJfRgtaA.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-C_L7hF2G.mjs +0 -65
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-C_L7hF2G.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-durrPUhm.mjs +0 -137
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-durrPUhm.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-BoL1jZpT.mjs +0 -113
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-BoL1jZpT.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-ChZpgXO5.mjs +0 -235
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-ChZpgXO5.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DwyNFnII.mjs +0 -117
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DwyNFnII.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-BWpJv6CO.mjs +0 -4464
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-BWpJv6CO.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-BvNvkqTO.mjs +0 -132
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-BvNvkqTO.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-tgNKltfK.mjs +0 -171
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-tgNKltfK.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-BcAlqmh8.mjs +0 -1653
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-BcAlqmh8.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-S474I51r.mjs +0 -20
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-S474I51r.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +0 -19
- package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-Dj82fxTI.mjs +0 -134
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-Dj82fxTI.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs +0 -159
- package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs.map +0 -1
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { f as contentEditorText, i as cloneContentEditorValue, n as CONTENT_BUILDER, r as CONTENT_EDITOR_BLOCK, t as ContentBuilderStore } from "./content-builder.store-D622mHxt.mjs";
|
|
2
|
+
import { t as ContentEditorContentEditableDirective } from "./content-editor-content-editable.directive-WzD9_71s.mjs";
|
|
3
|
+
import { t as CursorController } from "./cursor-controller-DKfBII1n.mjs";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, input, signal, untracked, viewChild } from "@angular/core";
|
|
6
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
7
|
+
var HeadingBlockComponent = class HeadingBlockComponent {
|
|
8
|
+
_store = inject(ContentBuilderStore);
|
|
9
|
+
_contentBuilder = inject(CONTENT_BUILDER);
|
|
10
|
+
_destroyRef = inject(DestroyRef);
|
|
11
|
+
_contentRef = viewChild.required("contentRef", ...ngDevMode ? [{ debugName: "_contentRef" }] : /* istanbul ignore next */ []);
|
|
12
|
+
id = input.required(...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
13
|
+
content = input.required(...ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []);
|
|
14
|
+
settings = input.required(...ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []);
|
|
15
|
+
props = input([], ...ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []);
|
|
16
|
+
index = input.required(...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
|
|
17
|
+
placeholder = input("Heading", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
18
|
+
_content = signal([], ...ngDevMode ? [{ debugName: "_content" }] : /* istanbul ignore next */ []);
|
|
19
|
+
_isEmpty = signal(true, ...ngDevMode ? [{ debugName: "_isEmpty" }] : /* istanbul ignore next */ []);
|
|
20
|
+
_props = signal([], ...ngDevMode ? [{ debugName: "_props" }] : /* istanbul ignore next */ []);
|
|
21
|
+
initialized = signal(false, ...ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []);
|
|
22
|
+
constructor() {
|
|
23
|
+
effect(() => {
|
|
24
|
+
const content = this.content();
|
|
25
|
+
const props = this.props();
|
|
26
|
+
untracked(() => {
|
|
27
|
+
this._content.set(content);
|
|
28
|
+
this._props.set(cloneContentEditorValue(props));
|
|
29
|
+
this._isEmpty.set(!contentEditorText(content).trim());
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
ngOnInit() {
|
|
34
|
+
this._content.set(this.content());
|
|
35
|
+
this._props.set(this.props());
|
|
36
|
+
this._isEmpty.set(!contentEditorText(this.content()).trim());
|
|
37
|
+
this._contentBuilder.focusChanged.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
|
|
38
|
+
if (this._store.focusedBlockId() === this.id()) this.focus();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
focus() {
|
|
42
|
+
const element = this._contentRef().nativeElement;
|
|
43
|
+
new CursorController(element).setToEnd();
|
|
44
|
+
}
|
|
45
|
+
onPropsChanged(props) {
|
|
46
|
+
this._props.set(props);
|
|
47
|
+
this.update();
|
|
48
|
+
}
|
|
49
|
+
getData() {
|
|
50
|
+
return {
|
|
51
|
+
content: this._content(),
|
|
52
|
+
props: this._props(),
|
|
53
|
+
settings: { ...this.settings() }
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
isEmpty() {
|
|
57
|
+
return !contentEditorText(this._content()).trim();
|
|
58
|
+
}
|
|
59
|
+
onContentChanged(content) {
|
|
60
|
+
if (!this.initialized()) return;
|
|
61
|
+
this._content.set(content);
|
|
62
|
+
this._isEmpty.set(!contentEditorText(content).trim());
|
|
63
|
+
this.update();
|
|
64
|
+
}
|
|
65
|
+
onPressedEnter(event) {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
event.stopPropagation();
|
|
68
|
+
this._contentBuilder.insertEmptyBlock(this.index());
|
|
69
|
+
}
|
|
70
|
+
onContentEditableInitialized() {
|
|
71
|
+
if (this._store.focusedBlockId() === this.id()) this.focus();
|
|
72
|
+
this.initialized.set(true);
|
|
73
|
+
}
|
|
74
|
+
_onKeyDown(event) {
|
|
75
|
+
if (event.key === "Backspace" && !contentEditorText(this._content())) this._contentBuilder.deleteBlock(this.id());
|
|
76
|
+
}
|
|
77
|
+
update() {
|
|
78
|
+
this._store.updateBlock(this.id(), {
|
|
79
|
+
...this.getData(),
|
|
80
|
+
isEmpty: this.isEmpty()
|
|
81
|
+
});
|
|
82
|
+
this._contentBuilder.emitContentChangeEvent();
|
|
83
|
+
}
|
|
84
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
85
|
+
minVersion: "12.0.0",
|
|
86
|
+
version: "22.3.0",
|
|
87
|
+
ngImport: i0,
|
|
88
|
+
type: HeadingBlockComponent,
|
|
89
|
+
deps: [],
|
|
90
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
91
|
+
});
|
|
92
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
93
|
+
minVersion: "17.2.0",
|
|
94
|
+
version: "22.3.0",
|
|
95
|
+
type: HeadingBlockComponent,
|
|
96
|
+
isStandalone: true,
|
|
97
|
+
selector: "ngs-heading-block",
|
|
98
|
+
inputs: {
|
|
99
|
+
id: {
|
|
100
|
+
classPropertyName: "id",
|
|
101
|
+
publicName: "id",
|
|
102
|
+
isSignal: true,
|
|
103
|
+
isRequired: true,
|
|
104
|
+
transformFunction: null
|
|
105
|
+
},
|
|
106
|
+
content: {
|
|
107
|
+
classPropertyName: "content",
|
|
108
|
+
publicName: "content",
|
|
109
|
+
isSignal: true,
|
|
110
|
+
isRequired: true,
|
|
111
|
+
transformFunction: null
|
|
112
|
+
},
|
|
113
|
+
settings: {
|
|
114
|
+
classPropertyName: "settings",
|
|
115
|
+
publicName: "settings",
|
|
116
|
+
isSignal: true,
|
|
117
|
+
isRequired: true,
|
|
118
|
+
transformFunction: null
|
|
119
|
+
},
|
|
120
|
+
props: {
|
|
121
|
+
classPropertyName: "props",
|
|
122
|
+
publicName: "props",
|
|
123
|
+
isSignal: true,
|
|
124
|
+
isRequired: false,
|
|
125
|
+
transformFunction: null
|
|
126
|
+
},
|
|
127
|
+
index: {
|
|
128
|
+
classPropertyName: "index",
|
|
129
|
+
publicName: "index",
|
|
130
|
+
isSignal: true,
|
|
131
|
+
isRequired: true,
|
|
132
|
+
transformFunction: null
|
|
133
|
+
},
|
|
134
|
+
placeholder: {
|
|
135
|
+
classPropertyName: "placeholder",
|
|
136
|
+
publicName: "placeholder",
|
|
137
|
+
isSignal: true,
|
|
138
|
+
isRequired: false,
|
|
139
|
+
transformFunction: null
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
host: { properties: {
|
|
143
|
+
"class.is-empty": "_isEmpty()",
|
|
144
|
+
"class.level-1": "settings().level === 1",
|
|
145
|
+
"class.level-2": "settings().level === 2",
|
|
146
|
+
"class.level-3": "settings().level === 3",
|
|
147
|
+
"class.level-6": "settings().level === 6",
|
|
148
|
+
"class.level-5": "settings().level === 5",
|
|
149
|
+
"class.level-4": "settings().level === 4"
|
|
150
|
+
} },
|
|
151
|
+
providers: [{
|
|
152
|
+
provide: CONTENT_EDITOR_BLOCK,
|
|
153
|
+
useExisting: HeadingBlockComponent,
|
|
154
|
+
multi: true
|
|
155
|
+
}],
|
|
156
|
+
viewQueries: [{
|
|
157
|
+
propertyName: "_contentRef",
|
|
158
|
+
first: true,
|
|
159
|
+
predicate: ["contentRef"],
|
|
160
|
+
descendants: true,
|
|
161
|
+
isSignal: true
|
|
162
|
+
}],
|
|
163
|
+
ngImport: i0,
|
|
164
|
+
template: "<div #contentRef\n class=\"content\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"_content()\"\n [props]=\"props()\"\n (propsChanged)=\"onPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (keydown)=\"_onKeyDown($event)\"\n (initialized)=\"onContentEditableInitialized()\"></div>\n",
|
|
165
|
+
styles: [":host{display:block}:host .content{margin:0;outline:none;font-weight:var(--ngs-content-editor-heading-weight, 650);line-height:var(--ngs-content-editor-heading-line-height, 1.2)}:host.level-1 .content{font-size:var(--ngs-content-editor-heading-1-size, 2.5rem)}:host.level-2 .content{font-size:var(--ngs-content-editor-heading-2-size, 2rem)}:host.level-3 .content{font-size:var(--ngs-content-editor-heading-3-size, 1.5rem)}:host.level-4 .content{font-size:var(--ngs-content-editor-heading-4-size, 1.25rem)}:host.level-5 .content{font-size:var(--ngs-content-editor-heading-5-size, 1.125rem)}:host.level-6 .content{font-size:var(--ngs-content-editor-heading-6-size, 1rem)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
166
|
+
dependencies: [{
|
|
167
|
+
kind: "directive",
|
|
168
|
+
type: ContentEditorContentEditableDirective,
|
|
169
|
+
selector: "[ngsContentEditorContentEditable]",
|
|
170
|
+
inputs: [
|
|
171
|
+
"ngsContentEditorContentEditable",
|
|
172
|
+
"settings",
|
|
173
|
+
"props",
|
|
174
|
+
"singleLine"
|
|
175
|
+
],
|
|
176
|
+
outputs: [
|
|
177
|
+
"contentChanged",
|
|
178
|
+
"propsChanged",
|
|
179
|
+
"pressedEnter",
|
|
180
|
+
"initialized"
|
|
181
|
+
],
|
|
182
|
+
exportAs: ["ngsContentEditorContentEditable"]
|
|
183
|
+
}],
|
|
184
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
188
|
+
minVersion: "12.0.0",
|
|
189
|
+
version: "22.3.0",
|
|
190
|
+
ngImport: i0,
|
|
191
|
+
type: HeadingBlockComponent,
|
|
192
|
+
decorators: [{
|
|
193
|
+
type: Component,
|
|
194
|
+
args: [{
|
|
195
|
+
selector: "ngs-heading-block",
|
|
196
|
+
imports: [ContentEditorContentEditableDirective],
|
|
197
|
+
providers: [{
|
|
198
|
+
provide: CONTENT_EDITOR_BLOCK,
|
|
199
|
+
useExisting: HeadingBlockComponent,
|
|
200
|
+
multi: true
|
|
201
|
+
}],
|
|
202
|
+
host: {
|
|
203
|
+
"[class.is-empty]": "_isEmpty()",
|
|
204
|
+
"[class.level-1]": "settings().level === 1",
|
|
205
|
+
"[class.level-2]": "settings().level === 2",
|
|
206
|
+
"[class.level-3]": "settings().level === 3",
|
|
207
|
+
"[class.level-6]": "settings().level === 6",
|
|
208
|
+
"[class.level-5]": "settings().level === 5",
|
|
209
|
+
"[class.level-4]": "settings().level === 4"
|
|
210
|
+
},
|
|
211
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
212
|
+
template: "<div #contentRef\n class=\"content\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"_content()\"\n [props]=\"props()\"\n (propsChanged)=\"onPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (keydown)=\"_onKeyDown($event)\"\n (initialized)=\"onContentEditableInitialized()\"></div>\n",
|
|
213
|
+
styles: [":host{display:block}:host .content{margin:0;outline:none;font-weight:var(--ngs-content-editor-heading-weight, 650);line-height:var(--ngs-content-editor-heading-line-height, 1.2)}:host.level-1 .content{font-size:var(--ngs-content-editor-heading-1-size, 2.5rem)}:host.level-2 .content{font-size:var(--ngs-content-editor-heading-2-size, 2rem)}:host.level-3 .content{font-size:var(--ngs-content-editor-heading-3-size, 1.5rem)}:host.level-4 .content{font-size:var(--ngs-content-editor-heading-4-size, 1.25rem)}:host.level-5 .content{font-size:var(--ngs-content-editor-heading-5-size, 1.125rem)}:host.level-6 .content{font-size:var(--ngs-content-editor-heading-6-size, 1rem)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
214
|
+
}]
|
|
215
|
+
}],
|
|
216
|
+
ctorParameters: () => [],
|
|
217
|
+
propDecorators: {
|
|
218
|
+
_contentRef: [{
|
|
219
|
+
type: i0.ViewChild,
|
|
220
|
+
args: ["contentRef", { isSignal: true }]
|
|
221
|
+
}],
|
|
222
|
+
id: [{
|
|
223
|
+
type: i0.Input,
|
|
224
|
+
args: [{
|
|
225
|
+
isSignal: true,
|
|
226
|
+
alias: "id",
|
|
227
|
+
required: true
|
|
228
|
+
}]
|
|
229
|
+
}],
|
|
230
|
+
content: [{
|
|
231
|
+
type: i0.Input,
|
|
232
|
+
args: [{
|
|
233
|
+
isSignal: true,
|
|
234
|
+
alias: "content",
|
|
235
|
+
required: true
|
|
236
|
+
}]
|
|
237
|
+
}],
|
|
238
|
+
settings: [{
|
|
239
|
+
type: i0.Input,
|
|
240
|
+
args: [{
|
|
241
|
+
isSignal: true,
|
|
242
|
+
alias: "settings",
|
|
243
|
+
required: true
|
|
244
|
+
}]
|
|
245
|
+
}],
|
|
246
|
+
props: [{
|
|
247
|
+
type: i0.Input,
|
|
248
|
+
args: [{
|
|
249
|
+
isSignal: true,
|
|
250
|
+
alias: "props",
|
|
251
|
+
required: false
|
|
252
|
+
}]
|
|
253
|
+
}],
|
|
254
|
+
index: [{
|
|
255
|
+
type: i0.Input,
|
|
256
|
+
args: [{
|
|
257
|
+
isSignal: true,
|
|
258
|
+
alias: "index",
|
|
259
|
+
required: true
|
|
260
|
+
}]
|
|
261
|
+
}],
|
|
262
|
+
placeholder: [{
|
|
263
|
+
type: i0.Input,
|
|
264
|
+
args: [{
|
|
265
|
+
isSignal: true,
|
|
266
|
+
alias: "placeholder",
|
|
267
|
+
required: false
|
|
268
|
+
}]
|
|
269
|
+
}]
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
export { HeadingBlockComponent };
|
|
273
|
+
|
|
274
|
+
//# sourceMappingURL=heading-block.component-iCpJGTMh.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading-block.component-iCpJGTMh.mjs","names":[],"sources":["../../../projects/components/content-editor/src/_builder/heading-block/heading-block.component.ts","../../../projects/components/content-editor/src/_builder/heading-block/heading-block.component.html"],"sourcesContent":["import { NgsHeadlessEditorText } from '@ngstarter-ui/components/headless-editor';\nimport { contentEditorText, cloneContentEditorValue } from '../../document';\nimport {\n ChangeDetectionStrategy,\n Component, effect, untracked,\n DestroyRef,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n viewChild\n} from '@angular/core';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport {\n CONTENT_BUILDER,\n CONTENT_EDITOR_BLOCK,\n ContentEditorDataBlock,\n ContentEditorHeadingBlockSettings,\n ContentEditorItemProperty\n} from '../../types';\nimport { ContentEditorContentEditableDirective } from '../../content-editor-content-editable.directive';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\nimport { CursorController } from '../../utils/cursor-controller';\n\n@Component({\n selector: 'ngs-heading-block',\n imports: [\n ContentEditorContentEditableDirective\n ],\n templateUrl: './heading-block.component.html',\n styleUrl: './heading-block.component.scss',\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: HeadingBlockComponent,\n multi: true\n }\n ],\n host: {\n '[class.is-empty]': '_isEmpty()',\n '[class.level-1]': 'settings().level === 1',\n '[class.level-2]': 'settings().level === 2',\n '[class.level-3]': 'settings().level === 3',\n '[class.level-6]': 'settings().level === 6',\n '[class.level-5]': 'settings().level === 5',\n '[class.level-4]': 'settings().level === 4',\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class HeadingBlockComponent implements OnInit, ContentEditorDataBlock {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n private _destroyRef = inject(DestroyRef);\n\n private _contentRef = viewChild.required<ElementRef<HTMLParagraphElement>>('contentRef');\n\n id = input.required<string>();\n content = input.required<readonly NgsHeadlessEditorText[]>();\n settings = input.required<ContentEditorHeadingBlockSettings>();\n props = input<ContentEditorItemProperty[]>([]);\n index = input.required<number>();\n placeholder = input('Heading');\n\n protected _content = signal<readonly NgsHeadlessEditorText[]>([])\n protected _isEmpty = signal<boolean>(true);\n protected _props = signal<ContentEditorItemProperty[]>([]);\n readonly initialized = signal(false);\n\n constructor() {\n effect(() => {\n const content = this.content();\n const props = this.props();\n untracked(() => {\n this._content.set(content);\n this._props.set(cloneContentEditorValue(props));\n this._isEmpty.set(!contentEditorText(content).trim());\n });\n });\n }\n\n ngOnInit() {\n this._content.set(this.content());\n this._props.set(this.props());\n this._isEmpty.set(!contentEditorText(this.content()).trim());\n this._contentBuilder\n .focusChanged\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n });\n }\n\n focus() {\n const element = this._contentRef().nativeElement;\n const cursorController = new CursorController(element);\n cursorController.setToEnd();\n }\n\n onPropsChanged(props: ContentEditorItemProperty[]) {\n this._props.set(props);\n this.update();\n }\n\n getData(): any {\n return {\n content: this._content(),\n props: this._props(),\n settings: {\n ...this.settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n return !contentEditorText(this._content()).trim();\n }\n\n protected onContentChanged(content: readonly NgsHeadlessEditorText[]) {\n if (!this.initialized()) {\n return;\n }\n\n this._content.set(content);\n this._isEmpty.set(!contentEditorText(content).trim());\n\n this.update();\n }\n\n protected onPressedEnter(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n\n protected onContentEditableInitialized() {\n if (this._store.focusedBlockId() === this.id()) {\n this.focus();\n }\n\n this.initialized.set(true);\n }\n\n protected _onKeyDown(event: KeyboardEvent) {\n if (event.key === 'Backspace' && !contentEditorText(this._content())) {\n this._contentBuilder.deleteBlock(this.id());\n }\n }\n\n private update() {\n this._store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","<div #contentRef\n class=\"content\"\n [singleLine]=\"true\"\n [ngsContentEditorContentEditable]=\"_content()\"\n [props]=\"props()\"\n (propsChanged)=\"onPropsChanged($event)\"\n [attr.data-empty-placeholder]=\"placeholder()\"\n (contentChanged)=\"onContentChanged($event)\"\n (pressedEnter)=\"onPressedEnter($event)\"\n (keydown)=\"_onKeyDown($event)\"\n (initialized)=\"onContentEditableInitialized()\"></div>\n"],"mappings":";;;;;;AAmDA,IAAa,wBAAb,MAAa,sBAAqB;CACxB,SAAS,OAAO,mBAAmB;CACnC,kBAAkB,OAAgC,eAAe;CACjE,cAAc,OAAO,UAAU;CAE/B,cAAc,UAAU,SAA2C,cAAa,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAExF,KAAK,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,UAAU,MAAM,SAA4C,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC5D,WAAW,MAAM,SAA6C,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAC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} from "@ngstarter-ui/components/headless-editor";
|
|
2
|
+
function escapeContentEditorHtml(value) {
|
|
3
|
+
return String(value ?? "").replace(/[&<>"']/g, (character) => ({
|
|
4
|
+
"&": "&",
|
|
5
|
+
"<": "<",
|
|
6
|
+
">": ">",
|
|
7
|
+
"\"": """,
|
|
8
|
+
"'": "'"
|
|
9
|
+
})[character]);
|
|
10
|
+
}
|
|
11
|
+
function safeContentEditorHtmlUrl(value, kind = "link") {
|
|
12
|
+
if (typeof value !== "string") return null;
|
|
13
|
+
const url = value.trim();
|
|
14
|
+
if (!url || /[\u0000-\u0020\u007f]/.test(url)) return null;
|
|
15
|
+
if (kind === "link") return normalizeNgsHeadlessEditorLink(url);
|
|
16
|
+
if (/^https?:/i.test(url) || !/^[a-z][a-z\d+.-]*:/i.test(url)) return url;
|
|
17
|
+
if (kind !== "embed" && /^blob:https?:\/\//i.test(url)) return url;
|
|
18
|
+
if (kind === "attachment" && /^(mailto:|tel:)/i.test(url)) return url;
|
|
19
|
+
const mime = kind === "image" ? "image/[a-z0-9.+-]+" : kind === "media" ? "(?:audio|video)/[a-z0-9.+-]+" : kind === "attachment" ? "(?:application/(?!xhtml\\+xml|xml|javascript)[a-z0-9.+-]+|text/(?:plain|csv)|(?:image|audio|video)/[a-z0-9.+-]+)" : null;
|
|
20
|
+
return mime && new RegExp(`^data:${mime};base64,[a-z0-9+/=]${kind === "attachment" ? "*" : "+"}$`, "i").test(url) ? url : null;
|
|
21
|
+
}
|
|
22
|
+
export { safeContentEditorHtmlUrl as n, escapeContentEditorHtml as t };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=html-utils-DywL8gGa.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-utils-DywL8gGa.mjs","names":[],"sources":["../../../projects/components/content-editor/src/html/html-utils.ts"],"sourcesContent":["import { normalizeNgsHeadlessEditorLink } from '@ngstarter-ui/components/headless-editor';\nimport { ContentEditorHtmlUrlKind } from './types';\n\nexport function escapeContentEditorHtml(value: unknown): string {\n return String(value ?? '').replace(/[&<>\"']/g, character => ({\n '&': '&', '<': '<', '>': '>', '\"': '"', \"'\": '''\n })[character]!);\n}\n\nexport function safeContentEditorHtmlUrl(value: unknown, kind: ContentEditorHtmlUrlKind = 'link'): string | null {\n if (typeof value !== 'string') return null;\n const url = value.trim();\n if (!url || /[\\u0000-\\u0020\\u007f]/.test(url)) return null;\n if (kind === 'link') return normalizeNgsHeadlessEditorLink(url);\n if (/^https?:/i.test(url) || !/^[a-z][a-z\\d+.-]*:/i.test(url)) return url;\n if (kind !== 'embed' && /^blob:https?:\\/\\//i.test(url)) return url;\n if (kind === 'attachment' && /^(mailto:|tel:)/i.test(url)) return url;\n const mime = kind === 'image' ? 'image/[a-z0-9.+-]+' : kind === 'media'\n ? '(?:audio|video)/[a-z0-9.+-]+' : kind === 'attachment'\n ? '(?:application/(?!xhtml\\\\+xml|xml|javascript)[a-z0-9.+-]+|text/(?:plain|csv)|(?:image|audio|video)/[a-z0-9.+-]+)' : null;\n return mime && new RegExp(`^data:${mime};base64,[a-z0-9+/=]${kind === 'attachment' ? '*' : '+'}$`, 'i').test(url) ? url : null;\n}\n"],"mappings":";AAGA,SAAgB,wBAAwB,OAAc;CACpD,OAAO,OAAO,SAAS,EAAE,CAAC,CAAC,QAAQ,aAAY,eAAc;EAC3D,KAAK;EAAS,KAAK;EAAQ,KAAK;EAAQ,MAAK;EAAU,KAAK;CAC7D,EAAA,CAAE,UAAW;AAChB;AAEA,SAAgB,yBAAyB,OAAgB,OAAiC,QAAM;CAC9F,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,MAAM,MAAM,MAAM,KAAI;CACtB,IAAI,CAAC,OAAO,wBAAwB,KAAK,GAAG,GAAG,OAAO;CACtD,IAAI,SAAS,QAAQ,OAAO,+BAA+B,GAAG;CAC9D,IAAI,YAAY,KAAK,GAAG,KAAK,CAAC,sBAAsB,KAAK,GAAG,GAAG,OAAO;CACtE,IAAI,SAAS,WAAW,qBAAqB,KAAK,GAAG,GAAG,OAAO;CAC/D,IAAI,SAAS,gBAAgB,mBAAmB,KAAK,GAAG,GAAG,OAAO;CAClE,MAAM,OAAO,SAAS,UAAU,uBAAuB,SAAS,UAC5D,iCAAiC,SAAS,eACxC,qHAAqH;CAC3H,OAAO,QAAQ,IAAI,OAAO,SAAS,KAAI,qBAAsB,SAAS,eAAe,MAAM,IAAG,IAAK,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,MAAM;AAC5H"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { ContentEditorUploadBlockBase } from "./ngstarter-ui-components-content-editor.mjs";
|
|
2
|
+
import { t as ContentEditorUploadStatus } from "./upload-status-tZ0x0BUB.mjs";
|
|
3
|
+
import { r as CONTENT_EDITOR_BLOCK } from "./content-builder.store-D622mHxt.mjs";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { ChangeDetectionStrategy, Component, effect, forwardRef, model, signal, untracked } from "@angular/core";
|
|
6
|
+
import { FormField, Label } from "@ngstarter-ui/components/form-field";
|
|
7
|
+
import * as i1 from "@angular/forms";
|
|
8
|
+
import { FormsModule } from "@angular/forms";
|
|
9
|
+
import { Input as Input$1 } from "@ngstarter-ui/components/input";
|
|
10
|
+
import { UploadArea, UploadTriggerDirective } from "@ngstarter-ui/components/upload";
|
|
11
|
+
import { ImageResizer, ImageResizerImageDirective } from "@ngstarter-ui/components/image-resizer";
|
|
12
|
+
var ImageBlockComponent = class ImageBlockComponent extends ContentEditorUploadBlockBase {
|
|
13
|
+
_src = signal("", ...ngDevMode ? [{ debugName: "_src" }] : /* istanbul ignore next */ []);
|
|
14
|
+
_alt = model("", ...ngDevMode ? [{ debugName: "_alt" }] : /* istanbul ignore next */ []);
|
|
15
|
+
_settings = model({}, ...ngDevMode ? [{ debugName: "_settings" }] : /* istanbul ignore next */ []);
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
effect(() => {
|
|
19
|
+
const content = this.content();
|
|
20
|
+
const settings = this.settings();
|
|
21
|
+
untracked(() => {
|
|
22
|
+
this._src.set(content.src);
|
|
23
|
+
this._alt.set(content.alt);
|
|
24
|
+
this._settings.set({ ...settings });
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
ngOnInit() {
|
|
29
|
+
this._src.set(this.content().src);
|
|
30
|
+
this._alt.set(this.content().alt);
|
|
31
|
+
this._settings.set(this.settings() || {});
|
|
32
|
+
}
|
|
33
|
+
focus() {
|
|
34
|
+
if (this._src()) this.builder.focusBlock(this.id());
|
|
35
|
+
}
|
|
36
|
+
getData() {
|
|
37
|
+
return {
|
|
38
|
+
content: {
|
|
39
|
+
src: this._src(),
|
|
40
|
+
alt: this._alt()
|
|
41
|
+
},
|
|
42
|
+
settings: { ...this._settings() }
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
isEmpty() {
|
|
46
|
+
const src = this.getData().content.src;
|
|
47
|
+
return typeof src === "string" ? src.trim().length === 0 : !src;
|
|
48
|
+
}
|
|
49
|
+
onFileSelected(event) {
|
|
50
|
+
return this.uploadFiles("image", {
|
|
51
|
+
files: event.files.slice(0, 1),
|
|
52
|
+
accept: (file) => file.type.startsWith("image/"),
|
|
53
|
+
apply: (results) => {
|
|
54
|
+
this._src.set(results[0].url);
|
|
55
|
+
this.update();
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
_onAltChange() {
|
|
60
|
+
this.update();
|
|
61
|
+
}
|
|
62
|
+
_onImageResized(options) {
|
|
63
|
+
this._settings.set(options);
|
|
64
|
+
this.update();
|
|
65
|
+
}
|
|
66
|
+
handleKeyPress(event) {
|
|
67
|
+
if (event.key === "Enter") {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
event.stopPropagation();
|
|
70
|
+
this.builder.insertEmptyBlock(this.index());
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
update() {
|
|
74
|
+
this.store.updateBlock(this.id(), {
|
|
75
|
+
...this.getData(),
|
|
76
|
+
isEmpty: this.isEmpty()
|
|
77
|
+
});
|
|
78
|
+
this.builder.emitContentChangeEvent();
|
|
79
|
+
}
|
|
80
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
81
|
+
minVersion: "12.0.0",
|
|
82
|
+
version: "22.3.0",
|
|
83
|
+
ngImport: i0,
|
|
84
|
+
type: ImageBlockComponent,
|
|
85
|
+
deps: [],
|
|
86
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
87
|
+
});
|
|
88
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
89
|
+
minVersion: "17.0.0",
|
|
90
|
+
version: "22.3.0",
|
|
91
|
+
type: ImageBlockComponent,
|
|
92
|
+
isStandalone: true,
|
|
93
|
+
selector: "ngs-image-block",
|
|
94
|
+
inputs: {
|
|
95
|
+
_alt: {
|
|
96
|
+
classPropertyName: "_alt",
|
|
97
|
+
publicName: "_alt",
|
|
98
|
+
isSignal: true,
|
|
99
|
+
isRequired: false,
|
|
100
|
+
transformFunction: null
|
|
101
|
+
},
|
|
102
|
+
_settings: {
|
|
103
|
+
classPropertyName: "_settings",
|
|
104
|
+
publicName: "_settings",
|
|
105
|
+
isSignal: true,
|
|
106
|
+
isRequired: false,
|
|
107
|
+
transformFunction: null
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
outputs: {
|
|
111
|
+
_alt: "_altChange",
|
|
112
|
+
_settings: "_settingsChange"
|
|
113
|
+
},
|
|
114
|
+
host: { listeners: { "keypress": "handleKeyPress($event)" } },
|
|
115
|
+
providers: [{
|
|
116
|
+
provide: CONTENT_EDITOR_BLOCK,
|
|
117
|
+
useExisting: forwardRef(() => ImageBlockComponent),
|
|
118
|
+
multi: true
|
|
119
|
+
}],
|
|
120
|
+
usesInheritance: true,
|
|
121
|
+
ngImport: i0,
|
|
122
|
+
template: "<ngs-content-editor-upload-status [task]=\"uploadTask\"/>\n@if (_src()) {\n <div class=\"flex w-full items-center justify-center\">\n <ngs-image-resizer (imageResized)=\"_onImageResized($event)\" [imageMaxWidth]=\"704\">\n <img [src]=\"_src()\" [alt]=\"_alt()\" ngsImageResizerImage [style.width.px]=\"_settings().width || null\">\n </ngs-image-resizer>\n </div>\n <ngs-form-field class=\"w-full mt-5\">\n <ngs-label>Alt text</ngs-label>\n <input ngsInput [(ngModel)]=\"_alt\" (ngModelChange)=\"_onAltChange()\">\n </ngs-form-field>\n} @else if (!uploading()) {\n <ngs-upload-area #uploadArea=\"ngsUploadArea\"\n ngsUploadTrigger accept=\"image/*\"\n (fileSelected)=\"onFileSelected($event)\"\n multiple=\"false\" class=\"upload-area\">\n @if (!uploadArea.api.isDropActive) {\n Drag & drop image here or click to upload\n } @else {\n <div class=\"font-medium\">Drop image here</div>\n }\n </ngs-upload-area>\n}\n",
|
|
123
|
+
styles: [":host{display:block;min-width:0}:host ngs-upload-area{--ngs-upload-area-padding: calc(var(--spacing, .25rem) * 6) calc(var(--spacing, .25rem) * 10)}:host img{max-width:100%}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
124
|
+
dependencies: [
|
|
125
|
+
{
|
|
126
|
+
kind: "component",
|
|
127
|
+
type: ContentEditorUploadStatus,
|
|
128
|
+
selector: "ngs-content-editor-upload-status",
|
|
129
|
+
inputs: ["task"]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
kind: "component",
|
|
133
|
+
type: UploadArea,
|
|
134
|
+
selector: "ngs-upload-area",
|
|
135
|
+
inputs: [
|
|
136
|
+
"accept",
|
|
137
|
+
"allowHover",
|
|
138
|
+
"multiple"
|
|
139
|
+
],
|
|
140
|
+
outputs: ["fileSelected"],
|
|
141
|
+
exportAs: ["ngsUploadArea"]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
kind: "directive",
|
|
145
|
+
type: UploadTriggerDirective,
|
|
146
|
+
selector: "[ngsUploadTrigger]",
|
|
147
|
+
inputs: ["accept", "multiple"],
|
|
148
|
+
outputs: ["fileSelected"],
|
|
149
|
+
exportAs: ["ngsUploadTrigger"]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
kind: "component",
|
|
153
|
+
type: ImageResizer,
|
|
154
|
+
selector: "ngs-image-resizer",
|
|
155
|
+
inputs: ["imageMaxWidth", "imageMinWidth"],
|
|
156
|
+
outputs: ["imageResized"],
|
|
157
|
+
exportAs: ["ngsImageResizer"]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
kind: "component",
|
|
161
|
+
type: FormField,
|
|
162
|
+
selector: "ngs-form-field",
|
|
163
|
+
inputs: [
|
|
164
|
+
"labelMode",
|
|
165
|
+
"subscriptHiddenIfEmpty",
|
|
166
|
+
"sameHeightAsButton"
|
|
167
|
+
],
|
|
168
|
+
exportAs: ["ngsFormField"]
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
kind: "directive",
|
|
172
|
+
type: Input$1,
|
|
173
|
+
selector: "input[ngsInput], textarea[ngsInput]",
|
|
174
|
+
inputs: [
|
|
175
|
+
"id",
|
|
176
|
+
"placeholder",
|
|
177
|
+
"required",
|
|
178
|
+
"disabled",
|
|
179
|
+
"readonly",
|
|
180
|
+
"errorStateMatcher"
|
|
181
|
+
],
|
|
182
|
+
exportAs: ["ngsInput"]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
kind: "ngmodule",
|
|
186
|
+
type: FormsModule
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
kind: "directive",
|
|
190
|
+
type: i1.DefaultValueAccessor,
|
|
191
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
kind: "directive",
|
|
195
|
+
type: i1.NgControlStatus,
|
|
196
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
kind: "directive",
|
|
200
|
+
type: i1.NgModel,
|
|
201
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
202
|
+
inputs: [
|
|
203
|
+
"name",
|
|
204
|
+
"disabled",
|
|
205
|
+
"ngModel",
|
|
206
|
+
"ngModelOptions"
|
|
207
|
+
],
|
|
208
|
+
outputs: ["ngModelChange"],
|
|
209
|
+
exportAs: ["ngModel"]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
kind: "directive",
|
|
213
|
+
type: ImageResizerImageDirective,
|
|
214
|
+
selector: "[ngsImageResizerImage]",
|
|
215
|
+
exportAs: ["ngsImageResizerImage"]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
kind: "component",
|
|
219
|
+
type: Label,
|
|
220
|
+
selector: "ngs-label"
|
|
221
|
+
}
|
|
222
|
+
],
|
|
223
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
227
|
+
minVersion: "12.0.0",
|
|
228
|
+
version: "22.3.0",
|
|
229
|
+
ngImport: i0,
|
|
230
|
+
type: ImageBlockComponent,
|
|
231
|
+
decorators: [{
|
|
232
|
+
type: Component,
|
|
233
|
+
args: [{
|
|
234
|
+
selector: "ngs-image-block",
|
|
235
|
+
imports: [
|
|
236
|
+
ContentEditorUploadStatus,
|
|
237
|
+
UploadArea,
|
|
238
|
+
UploadTriggerDirective,
|
|
239
|
+
ImageResizer,
|
|
240
|
+
FormField,
|
|
241
|
+
Input$1,
|
|
242
|
+
FormsModule,
|
|
243
|
+
ImageResizerImageDirective,
|
|
244
|
+
Label
|
|
245
|
+
],
|
|
246
|
+
providers: [{
|
|
247
|
+
provide: CONTENT_EDITOR_BLOCK,
|
|
248
|
+
useExisting: forwardRef(() => ImageBlockComponent),
|
|
249
|
+
multi: true
|
|
250
|
+
}],
|
|
251
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
252
|
+
host: { "(keypress)": "handleKeyPress($event)" },
|
|
253
|
+
template: "<ngs-content-editor-upload-status [task]=\"uploadTask\"/>\n@if (_src()) {\n <div class=\"flex w-full items-center justify-center\">\n <ngs-image-resizer (imageResized)=\"_onImageResized($event)\" [imageMaxWidth]=\"704\">\n <img [src]=\"_src()\" [alt]=\"_alt()\" ngsImageResizerImage [style.width.px]=\"_settings().width || null\">\n </ngs-image-resizer>\n </div>\n <ngs-form-field class=\"w-full mt-5\">\n <ngs-label>Alt text</ngs-label>\n <input ngsInput [(ngModel)]=\"_alt\" (ngModelChange)=\"_onAltChange()\">\n </ngs-form-field>\n} @else if (!uploading()) {\n <ngs-upload-area #uploadArea=\"ngsUploadArea\"\n ngsUploadTrigger accept=\"image/*\"\n (fileSelected)=\"onFileSelected($event)\"\n multiple=\"false\" class=\"upload-area\">\n @if (!uploadArea.api.isDropActive) {\n Drag & drop image here or click to upload\n } @else {\n <div class=\"font-medium\">Drop image here</div>\n }\n </ngs-upload-area>\n}\n",
|
|
254
|
+
styles: [":host{display:block;min-width:0}:host ngs-upload-area{--ngs-upload-area-padding: calc(var(--spacing, .25rem) * 6) calc(var(--spacing, .25rem) * 10)}:host img{max-width:100%}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
255
|
+
}]
|
|
256
|
+
}],
|
|
257
|
+
ctorParameters: () => [],
|
|
258
|
+
propDecorators: {
|
|
259
|
+
_alt: [{
|
|
260
|
+
type: i0.Input,
|
|
261
|
+
args: [{
|
|
262
|
+
isSignal: true,
|
|
263
|
+
alias: "_alt",
|
|
264
|
+
required: false
|
|
265
|
+
}]
|
|
266
|
+
}, {
|
|
267
|
+
type: i0.Output,
|
|
268
|
+
args: ["_altChange"]
|
|
269
|
+
}],
|
|
270
|
+
_settings: [{
|
|
271
|
+
type: i0.Input,
|
|
272
|
+
args: [{
|
|
273
|
+
isSignal: true,
|
|
274
|
+
alias: "_settings",
|
|
275
|
+
required: false
|
|
276
|
+
}]
|
|
277
|
+
}, {
|
|
278
|
+
type: i0.Output,
|
|
279
|
+
args: ["_settingsChange"]
|
|
280
|
+
}]
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
export { ImageBlockComponent };
|
|
284
|
+
|
|
285
|
+
//# sourceMappingURL=image-block.component-DJ7-HCR8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-block.component-DJ7-HCR8.mjs","names":["Input"],"sources":["../../../projects/components/content-editor/src/_builder/image-block/image-block.component.ts","../../../projects/components/content-editor/src/_builder/image-block/image-block.component.html"],"sourcesContent":["import { ContentEditorUploadBlockBase } from '../upload-block-base';\nimport { ContentEditorUploadStatus } from '../upload-status/upload-status';\nimport { ChangeDetectionStrategy, Component, effect, untracked, forwardRef, model, OnInit, signal } from '@angular/core';\nimport { UploadArea, UploadFileSelectedEvent, UploadTriggerDirective } from '@ngstarter-ui/components/upload';\nimport {\n CONTENT_EDITOR_BLOCK,\n ContentEditorImageBlockSettings,\n ContentEditorImageContent\n} from '../../types';\nimport { ImageResizer, ImageResizerImageDirective } from '@ngstarter-ui/components/image-resizer';\nimport { FormField, Label } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\nimport { FormsModule } from '@angular/forms';\n\n@Component({\n selector: 'ngs-image-block',\n imports: [\n ContentEditorUploadStatus,\n UploadArea,\n UploadTriggerDirective,\n ImageResizer,\n FormField,\n Input,\n FormsModule,\n ImageResizerImageDirective,\n Label\n ],\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: forwardRef(() => ImageBlockComponent),\n multi: true\n }\n ],\n templateUrl: './image-block.component.html',\n styleUrl: './image-block.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(keypress)': 'handleKeyPress($event)',\n }\n})\nexport class ImageBlockComponent extends ContentEditorUploadBlockBase<ContentEditorImageContent, ContentEditorImageBlockSettings> implements OnInit {\n\n protected _src = signal<string>('');\n protected _alt = model<string>('');\n protected _settings = model<ContentEditorImageBlockSettings>({});\n\n constructor() {\n super();\n effect(() => {\n const content = this.content();\n const settings = this.settings();\n untracked(() => {\n this._src.set(content.src);\n this._alt.set(content.alt);\n this._settings.set({ ...settings });\n });\n });\n }\n\n ngOnInit() {\n this._src.set(this.content().src);\n this._alt.set(this.content().alt);\n this._settings.set(this.settings() || {});\n }\n\n override focus() {\n if (this._src()) {\n this.builder.focusBlock(this.id());\n }\n }\n\n override getData(): any {\n return {\n content: {\n src: this._src(),\n alt: this._alt()\n },\n settings: {\n ...this._settings(),\n }\n };\n }\n\n override isEmpty(): boolean {\n const src = this.getData().content.src;\n return typeof src === 'string' ? src.trim().length === 0 : !src;\n }\n\n protected onFileSelected(event: UploadFileSelectedEvent): Promise<void> {\n return this.uploadFiles('image', { files: event.files.slice(0, 1), accept: file => file.type.startsWith('image/'), apply: results => {\n this._src.set(results[0].url);\n this.update();\n } });\n }\n\n protected _onAltChange() {\n this.update();\n }\n\n protected _onImageResized(options: any) {\n this._settings.set(options);\n this.update();\n }\n\n protected handleKeyPress(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n this.builder.insertEmptyBlock(this.index());\n }\n }\n\n private update() {\n this.store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this.builder.emitContentChangeEvent();\n }\n}\n","<ngs-content-editor-upload-status [task]=\"uploadTask\"/>\n@if (_src()) {\n <div class=\"flex w-full items-center justify-center\">\n <ngs-image-resizer (imageResized)=\"_onImageResized($event)\" [imageMaxWidth]=\"704\">\n <img [src]=\"_src()\" [alt]=\"_alt()\" ngsImageResizerImage [style.width.px]=\"_settings().width || null\">\n </ngs-image-resizer>\n </div>\n <ngs-form-field class=\"w-full mt-5\">\n <ngs-label>Alt text</ngs-label>\n <input ngsInput [(ngModel)]=\"_alt\" (ngModelChange)=\"_onAltChange()\">\n </ngs-form-field>\n} @else if (!uploading()) {\n <ngs-upload-area #uploadArea=\"ngsUploadArea\"\n ngsUploadTrigger accept=\"image/*\"\n (fileSelected)=\"onFileSelected($event)\"\n multiple=\"false\" class=\"upload-area\">\n @if (!uploadArea.api.isDropActive) {\n Drag & drop image here or click to upload\n } @else {\n <div class=\"font-medium\">Drop image here</div>\n }\n </ngs-upload-area>\n}\n"],"mappings":";;;;;;;;;;;AAyCA,IAAa,sBAAb,MAAa,4BAA4B,6BAAwF;CAErH,OAAO,OAAe,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,OAAO,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACxB,YAAY,MAAuC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAEhE,cAAA;EACE,MAAK;EACL,aAAY;GACV,MAAM,UAAU,KAAK,QAAO;GAC5B,MAAM,WAAW,KAAK,SAAQ;GAC9B,gBAAe;IACb,KAAK,KAAK,IAAI,QAAQ,GAAG;IACzB,KAAK,KAAK,IAAI,QAAQ,GAAG;IACzB,KAAK,UAAU,IAAI,EAAE,GAAG,SAAQ,CAAE;GACpC,CAAC;EACH,CAAC;CACH;CAEA,WAAQ;EACN,KAAK,KAAK,IAAI,KAAK,QAAO,CAAE,CAAC,GAAG;EAChC,KAAK,KAAK,IAAI,KAAK,QAAO,CAAE,CAAC,GAAG;EAChC,KAAK,UAAU,IAAI,KAAK,SAAQ,KAAM,CAAA,CAAE;CAC1C;CAES,QAAK;EACZ,IAAI,KAAK,KAAI,GACX,KAAK,QAAQ,WAAW,KAAK,GAAE,CAAE;CAErC;CAES,UAAO;EACd,OAAO;GACL,SAAS;IACP,KAAK,KAAK,KAAI;IACd,KAAK,KAAK,KAAI;GACf;GACD,UAAU,EACR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