@ngstarter-ui/components 1.0.27 → 1.0.30
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/ngstarter-ui-components-action-required.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-alert.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-announcement.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-avatar.mjs +8 -8
- package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-badge.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-block-loader.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs +4 -4
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-card.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-checkbox.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-chips.mjs +6 -6
- package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-picker.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-command-bar.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs +34 -21
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-Bk6QTli8.mjs → ngstarter-ui-components-content-editor-code-block.component-CpZ5gJOc.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-Bk6QTli8.mjs.map → ngstarter-ui-components-content-editor-code-block.component-CpZ5gJOc.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-BbkC_t86.mjs → ngstarter-ui-components-content-editor-embed-block-ghm0_0AF.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-BbkC_t86.mjs.map → ngstarter-ui-components-content-editor-embed-block-ghm0_0AF.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-D9_CxTY1.mjs → ngstarter-ui-components-content-editor-heading-block.component-C1FH89Sj.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-D9_CxTY1.mjs.map → ngstarter-ui-components-content-editor-heading-block.component-C1FH89Sj.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-image-block.component-B4zJyUg1.mjs → ngstarter-ui-components-content-editor-image-block.component-ahCIfpvQ.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-image-block.component-B4zJyUg1.mjs.map → ngstarter-ui-components-content-editor-image-block.component-ahCIfpvQ.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-Cv6wx5Xe.mjs → ngstarter-ui-components-content-editor-list-block.component-guhW_EyK.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-Cv6wx5Xe.mjs.map → ngstarter-ui-components-content-editor-list-block.component-guhW_EyK.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-1Zi2nAX5.mjs → ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-DNLTNGYa.mjs} +15 -15
- package/fesm2022/{ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-1Zi2nAX5.mjs.map → ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-DNLTNGYa.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-C9bQvDYU.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-DjgGUc7s.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-C9bQvDYU.mjs.map → ngstarter-ui-components-content-editor-paragraph-block.component-DjgGUc7s.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-BbHds2r2.mjs → ngstarter-ui-components-content-editor-quote-block.component-B3pek1H6.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-BbHds2r2.mjs.map → ngstarter-ui-components-content-editor-quote-block.component-B3pek1H6.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-DlDh7Fnn.mjs → ngstarter-ui-components-content-editor-table-block.component-bgBNjf4d.mjs} +6 -6
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-DlDh7Fnn.mjs.map → ngstarter-ui-components-content-editor-table-block.component-bgBNjf4d.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-m4DTihP2.mjs → ngstarter-ui-components-content-editor-video-block.component-DPlYe-_8.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-m4DTihP2.mjs.map → ngstarter-ui-components-content-editor-video-block.component-DPlYe-_8.mjs.map} +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-content-fade.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-content-fade.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-core.mjs +137 -34
- package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-country-select.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-datepicker.mjs +10 -10
- package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-dialog.mjs +8 -8
- package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-divider.mjs +4 -4
- package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-drawer.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-empty-state.mjs +4 -4
- package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-expand.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-expansion.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-field.mjs +4 -4
- package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
- package/fesm2022/{ngstarter-ui-components-form-renderer-divider-content-CwGzDCZv.mjs → ngstarter-ui-components-form-renderer-divider-content-D8Sffofu.mjs} +3 -3
- package/fesm2022/{ngstarter-ui-components-form-renderer-divider-content-CwGzDCZv.mjs.map → ngstarter-ui-components-form-renderer-divider-content-D8Sffofu.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-form-renderer-radio-group-field-Cv3AGpoq.mjs → ngstarter-ui-components-form-renderer-radio-group-field-DUCSU3iT.mjs} +3 -3
- package/fesm2022/{ngstarter-ui-components-form-renderer-radio-group-field-Cv3AGpoq.mjs.map → ngstarter-ui-components-form-renderer-radio-group-field-DUCSU3iT.mjs.map} +1 -1
- package/fesm2022/ngstarter-ui-components-form-renderer.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-gauge.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-grid.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs +4 -4
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-incidents.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kbd.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-list.mjs +10 -10
- package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-logo.mjs +8 -8
- package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +8 -8
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs +10 -10
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-navigation.mjs +8 -8
- package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-notifications.mjs +8 -8
- package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-number-input.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-option.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-paginator.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-password-strength.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-popover.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio-card.mjs +4 -4
- package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs +4 -4
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +6 -6
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-segmented.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-select.mjs +8 -8
- package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-side-panel.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sidebar.mjs +14 -14
- package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sidenav.mjs +4 -4
- package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-skeleton.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slider.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-spinner.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-split.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-stepper.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-suggestions.mjs +4 -4
- package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-table.mjs +6 -6
- package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tabs.mjs +6 -6
- package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-text-editor.mjs +10 -10
- package/fesm2022/ngstarter-ui-components-text-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tiles.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timeline.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timepicker.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-toolbar.mjs +4 -4
- package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tooltip.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-upload.mjs +10 -10
- package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
- package/package.json +15 -3
- package/schematics/collection.json +10 -0
- package/schematics/migrations.json +11 -0
- package/schematics/ng-add/index.d.ts +6 -0
- package/schematics/ng-add/index.js +14 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/schema.json +17 -0
- package/schematics/ng-update/index.d.ts +6 -0
- package/schematics/ng-update/index.js +14 -0
- package/schematics/ng-update/index.js.map +1 -0
- package/schematics/ng-update/schema.json +17 -0
- package/schematics/utils.d.ts +8 -0
- package/schematics/utils.js +305 -0
- package/schematics/utils.js.map +1 -0
- package/styles/_common.scss +84 -390
- package/styles/_global.scss +12 -12
- package/styles/_tokens.scss +1041 -0
- package/styles/themes/compact.scss +9 -0
- package/styles/themes/enterprise.scss +349 -0
- package/styles/themes/modern.scss +352 -0
- package/types/ngstarter-ui-components-comment-editor.d.ts +10 -2
- package/types/ngstarter-ui-components-core.d.ts +41 -5
|
@@ -4,7 +4,7 @@ import { UploadArea, UploadTriggerDirective } from '@ngstarter-ui/components/upl
|
|
|
4
4
|
import { ProgressBar } from '@ngstarter-ui/components/progress-bar';
|
|
5
5
|
import { Button } from '@ngstarter-ui/components/button';
|
|
6
6
|
import { Icon } from '@ngstarter-ui/components/icon';
|
|
7
|
-
import { C as ContentBuilderStore, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-
|
|
7
|
+
import { C as ContentBuilderStore, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-DNLTNGYa.mjs';
|
|
8
8
|
import { FormField, Label } from '@ngstarter-ui/components/form-field';
|
|
9
9
|
import { Input } from '@ngstarter-ui/components/input';
|
|
10
10
|
import * as i1 from '@angular/forms';
|
|
@@ -172,4 +172,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
172
172
|
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], _caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "_caption", required: false }] }, { type: i0.Output, args: ["_captionChange"] }], _settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "_settings", required: false }] }, { type: i0.Output, args: ["_settingsChange"] }], videoElement: [{ type: i0.ViewChild, args: ['videoPlayer', { isSignal: true }] }] } });
|
|
173
173
|
|
|
174
174
|
export { VideoBlockComponent };
|
|
175
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-video-block.component-
|
|
175
|
+
//# sourceMappingURL=ngstarter-ui-components-content-editor-video-block.component-DPlYe-_8.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-content-editor-video-block.component-m4DTihP2.mjs","sources":["../../../projects/components/content-editor/src/_builder/video-block/video-block.component.ts","../../../projects/components/content-editor/src/_builder/video-block/video-block.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, forwardRef, inject, input, model, OnInit, signal, viewChild, ElementRef } from '@angular/core';\nimport { UploadArea, UploadFileSelectedEvent, UploadTriggerDirective } from '@ngstarter-ui/components/upload';\nimport { ProgressBar } from '@ngstarter-ui/components/progress-bar';\nimport { Button } from '@ngstarter-ui/components/button';\nimport { Icon } from '@ngstarter-ui/components/icon';\nimport {\n CONTENT_BUILDER,\n CONTENT_EDITOR_BLOCK, ContentEditorDataBlock,\n ContentEditorVideoBlockSettings,\n ContentEditorVideoContent\n} from '../../types';\nimport { FormField, Label } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\nimport { FormsModule } from '@angular/forms';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\nimport { ResizableContainer } from '@ngstarter-ui/components/resizable-container';\n\n@Component({\n selector: 'ngs-video-block',\n imports: [\n UploadArea,\n UploadTriggerDirective,\n ProgressBar,\n Button,\n Icon,\n FormField,\n Input,\n FormsModule,\n Label,\n ResizableContainer\n ],\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: forwardRef(() => VideoBlockComponent),\n multi: true\n }\n ],\n templateUrl: './video-block.component.html',\n styleUrl: './video-block.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(keypress)': 'handleKeyPress($event)',\n 'class': 'block'\n }\n})\nexport class VideoBlockComponent implements OnInit, ContentEditorDataBlock {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n\n id = input.required<string>();\n content = input.required<ContentEditorVideoContent>();\n settings = input.required<ContentEditorVideoBlockSettings>();\n index = input.required<number>();\n\n uploading = signal(false);\n selectedVideo = signal<string>('');\n\n protected _src = signal<string>('');\n protected _caption = model<string>('');\n protected _orientation = signal<'portrait' | 'landscape'>('landscape');\n protected _settings = model<ContentEditorVideoBlockSettings>({});\n readonly initialized = signal(false);\n\n readonly videoElement = viewChild<ElementRef<HTMLVideoElement>>('videoPlayer');\n\n private _aspectRatio = 16 / 9;\n\n ngOnInit() {\n this._src.set(this.content().src);\n this._caption.set(this.content().caption);\n this._orientation.set(this.content().orientation || 'landscape');\n this._settings.set(this.settings() || {});\n this.initialized.set(true);\n }\n\n focus() {\n if (this._src()) {\n this._contentBuilder.focusBlock(this.id());\n }\n }\n\n getData(): any {\n return {\n content: {\n src: this._src(),\n caption: this._caption(),\n orientation: this._orientation()\n },\n settings: {\n ...this._settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n const src = this.getData().content.src;\n return typeof src === 'string' ? src.trim().length === 0 : !src;\n }\n\n protected cancelUploading() {\n this.uploading.set(false);\n }\n\n protected onFileSelected(event: UploadFileSelectedEvent): void {\n this.uploading.set(true);\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n this.selectedVideo.set(reader.result as string);\n\n const video = document.createElement('video');\n video.preload = 'metadata';\n video.onloadedmetadata = () => {\n window.URL.revokeObjectURL(video.src);\n const orientation = video.videoWidth > video.videoHeight ? 'landscape' : 'portrait';\n this._orientation.set(orientation);\n this._aspectRatio = video.videoWidth / video.videoHeight;\n\n let width = video.videoWidth;\n let height = video.videoHeight;\n\n if (width > 704) {\n width = 704;\n height = Math.round(width / this._aspectRatio);\n }\n\n if (height > 1000) {\n width = Math.round(width / 2);\n height = Math.round(height / 2);\n }\n\n // Initial settings based on video metadata\n this._settings.update(s => ({\n ...s,\n actualWidth: video.videoWidth,\n actualHeight: video.videoHeight,\n width,\n height\n }));\n };\n video.src = URL.createObjectURL(event.files[0]);\n\n const uploadFn = this._contentBuilder.getBlockDefOption('video', 'uploadFn');\n uploadFn(event.files[0], reader.result)\n .then((url: string) => {\n if (!this.uploading()) {\n this.selectedVideo.set('');\n return;\n }\n\n this._src.set(url);\n this.selectedVideo.set('');\n this.uploading.set(false);\n this.update();\n this.focus();\n });\n }, false);\n reader.readAsDataURL(event.files[0]);\n }\n\n protected _onCaptionChange() {\n this.update();\n }\n\n protected _onVideoResized(event: { width: number }) {\n let width = event.width;\n if (width > 704) {\n width = 704;\n }\n const height = Math.round(width / this._aspectRatio);\n\n this._settings.update(s => ({\n ...s,\n width,\n height\n }));\n\n this.update();\n }\n\n protected _onVideoLoaded(event: any) {\n const video = event.target as HTMLVideoElement;\n this._aspectRatio = video.videoWidth / video.videoHeight;\n }\n\n protected handleKeyPress(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n }\n\n private update() {\n this._store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","@if (uploading()) {\n <div class=\"relative flex items-center justify-center overflow-hidden\">\n <div class=\"absolute inset-0 z-10 flex items-center justify-center bg-white/80\">\n <div class=\"absolute top-0 start-0 end-0 z-20\">\n <ngs-progress-bar mode=\"indeterminate\"/>\n </div>\n <div class=\"absolute end-2 top-4 w-max z-30\">\n <button ngsButton (click)=\"cancelUploading()\">\n <ngs-icon name=\"fluent:delete-24-regular\"/>\n </button>\n </div>\n <div class=\"bg-white px-3 text-sm py-1.5 rounded-lg border border-border\">Loading...</div>\n </div>\n <div [style.width.px]=\"_settings().width || null\"\n [style.height.px]=\"_settings().height || null\"\n [class.max-w-full]=\"!_settings().width\">\n <video [src]=\"selectedVideo()\" muted class=\"w-full h-auto block\"></video>\n </div>\n </div>\n} @else if (_src()) {\n <div class=\"flex items-center justify-center overflow-hidden\">\n <ngs-resizable-container (resized)=\"_onVideoResized($event)\"\n [style.width.px]=\"_settings().width || null\"\n [style.height.px]=\"_settings().height || null\"\n [class.max-w-full]=\"!_settings().width\">\n <video #videoPlayer\n [src]=\"_src()\"\n class=\"w-full h-auto block\"\n (loadedmetadata)=\"_onVideoLoaded($event)\"\n controls></video>\n </ngs-resizable-container>\n </div>\n <ngs-form-field class=\"w-full mt-5\">\n <ngs-label>Caption</ngs-label>\n <input ngsInput [(ngModel)]=\"_caption\" (ngModelChange)=\"_onCaptionChange()\">\n </ngs-form-field>\n} @else {\n <ngs-upload-area #uploadArea=\"ngsUploadArea\"\n ngsUploadTrigger accept=\"video/*\"\n (fileSelected)=\"onFileSelected($event)\" multiple=\"false\"\n class=\"cursor-pointer hover:outline-2 hover:outline-[var(--color-primary)]\">\n @if (!uploadArea.api.isDropActive) {\n Drag & drop video here or click to upload\n } @else {\n <div class=\"font-medium\">Drop video here</div>\n }\n </ngs-upload-area>\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;MA+Ca,mBAAmB,CAAA;AACtB,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpC,IAAA,eAAe,GAAG,MAAM,CAA0B,eAAe,CAAC;AAE1E,IAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,wEAAU;AAC7B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAA6B;AACrD,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,8EAAmC;AAC5D,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;AAEhC,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,gFAAC;AACzB,IAAA,aAAa,GAAG,MAAM,CAAS,EAAE,oFAAC;AAExB,IAAA,IAAI,GAAG,MAAM,CAAS,EAAE,2EAAC;AACzB,IAAA,QAAQ,GAAG,KAAK,CAAS,EAAE,+EAAC;AAC5B,IAAA,YAAY,GAAG,MAAM,CAA2B,WAAW,mFAAC;AAC5D,IAAA,SAAS,GAAG,KAAK,CAAkC,EAAE,gFAAC;AACvD,IAAA,WAAW,GAAG,MAAM,CAAC,KAAK,kFAAC;AAE3B,IAAA,YAAY,GAAG,SAAS,CAA+B,aAAa,mFAAC;AAEtE,IAAA,YAAY,GAAG,EAAE,GAAG,CAAC;IAE7B,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,IAA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AA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-editor-video-block.component-DPlYe-_8.mjs","sources":["../../../projects/components/content-editor/src/_builder/video-block/video-block.component.ts","../../../projects/components/content-editor/src/_builder/video-block/video-block.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, forwardRef, inject, input, model, OnInit, signal, viewChild, ElementRef } from '@angular/core';\nimport { UploadArea, UploadFileSelectedEvent, UploadTriggerDirective } from '@ngstarter-ui/components/upload';\nimport { ProgressBar } from '@ngstarter-ui/components/progress-bar';\nimport { Button } from '@ngstarter-ui/components/button';\nimport { Icon } from '@ngstarter-ui/components/icon';\nimport {\n CONTENT_BUILDER,\n CONTENT_EDITOR_BLOCK, ContentEditorDataBlock,\n ContentEditorVideoBlockSettings,\n ContentEditorVideoContent\n} from '../../types';\nimport { FormField, Label } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\nimport { FormsModule } from '@angular/forms';\nimport { ContentBuilderStore } from '../../content-builder.store';\nimport { ContentBuilderComponent } from '../../content-builder/content-builder.component';\nimport { ResizableContainer } from '@ngstarter-ui/components/resizable-container';\n\n@Component({\n selector: 'ngs-video-block',\n imports: [\n UploadArea,\n UploadTriggerDirective,\n ProgressBar,\n Button,\n Icon,\n FormField,\n Input,\n FormsModule,\n Label,\n ResizableContainer\n ],\n providers: [\n {\n provide: CONTENT_EDITOR_BLOCK,\n useExisting: forwardRef(() => VideoBlockComponent),\n multi: true\n }\n ],\n templateUrl: './video-block.component.html',\n styleUrl: './video-block.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(keypress)': 'handleKeyPress($event)',\n 'class': 'block'\n }\n})\nexport class VideoBlockComponent implements OnInit, ContentEditorDataBlock {\n private _store = inject(ContentBuilderStore);\n private _contentBuilder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n\n id = input.required<string>();\n content = input.required<ContentEditorVideoContent>();\n settings = input.required<ContentEditorVideoBlockSettings>();\n index = input.required<number>();\n\n uploading = signal(false);\n selectedVideo = signal<string>('');\n\n protected _src = signal<string>('');\n protected _caption = model<string>('');\n protected _orientation = signal<'portrait' | 'landscape'>('landscape');\n protected _settings = model<ContentEditorVideoBlockSettings>({});\n readonly initialized = signal(false);\n\n readonly videoElement = viewChild<ElementRef<HTMLVideoElement>>('videoPlayer');\n\n private _aspectRatio = 16 / 9;\n\n ngOnInit() {\n this._src.set(this.content().src);\n this._caption.set(this.content().caption);\n this._orientation.set(this.content().orientation || 'landscape');\n this._settings.set(this.settings() || {});\n this.initialized.set(true);\n }\n\n focus() {\n if (this._src()) {\n this._contentBuilder.focusBlock(this.id());\n }\n }\n\n getData(): any {\n return {\n content: {\n src: this._src(),\n caption: this._caption(),\n orientation: this._orientation()\n },\n settings: {\n ...this._settings(),\n }\n };\n }\n\n isEmpty(): boolean {\n const src = this.getData().content.src;\n return typeof src === 'string' ? src.trim().length === 0 : !src;\n }\n\n protected cancelUploading() {\n this.uploading.set(false);\n }\n\n protected onFileSelected(event: UploadFileSelectedEvent): void {\n this.uploading.set(true);\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n this.selectedVideo.set(reader.result as string);\n\n const video = document.createElement('video');\n video.preload = 'metadata';\n video.onloadedmetadata = () => {\n window.URL.revokeObjectURL(video.src);\n const orientation = video.videoWidth > video.videoHeight ? 'landscape' : 'portrait';\n this._orientation.set(orientation);\n this._aspectRatio = video.videoWidth / video.videoHeight;\n\n let width = video.videoWidth;\n let height = video.videoHeight;\n\n if (width > 704) {\n width = 704;\n height = Math.round(width / this._aspectRatio);\n }\n\n if (height > 1000) {\n width = Math.round(width / 2);\n height = Math.round(height / 2);\n }\n\n // Initial settings based on video metadata\n this._settings.update(s => ({\n ...s,\n actualWidth: video.videoWidth,\n actualHeight: video.videoHeight,\n width,\n height\n }));\n };\n video.src = URL.createObjectURL(event.files[0]);\n\n const uploadFn = this._contentBuilder.getBlockDefOption('video', 'uploadFn');\n uploadFn(event.files[0], reader.result)\n .then((url: string) => {\n if (!this.uploading()) {\n this.selectedVideo.set('');\n return;\n }\n\n this._src.set(url);\n this.selectedVideo.set('');\n this.uploading.set(false);\n this.update();\n this.focus();\n });\n }, false);\n reader.readAsDataURL(event.files[0]);\n }\n\n protected _onCaptionChange() {\n this.update();\n }\n\n protected _onVideoResized(event: { width: number }) {\n let width = event.width;\n if (width > 704) {\n width = 704;\n }\n const height = Math.round(width / this._aspectRatio);\n\n this._settings.update(s => ({\n ...s,\n width,\n height\n }));\n\n this.update();\n }\n\n protected _onVideoLoaded(event: any) {\n const video = event.target as HTMLVideoElement;\n this._aspectRatio = video.videoWidth / video.videoHeight;\n }\n\n protected handleKeyPress(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n this._contentBuilder.insertEmptyBlock(this.index());\n }\n }\n\n private update() {\n this._store.updateBlock(this.id(), {...this.getData(), isEmpty: this.isEmpty()});\n this._contentBuilder.emitContentChangeEvent();\n }\n}\n","@if (uploading()) {\n <div class=\"relative flex items-center justify-center overflow-hidden\">\n <div class=\"absolute inset-0 z-10 flex items-center justify-center bg-white/80\">\n <div class=\"absolute top-0 start-0 end-0 z-20\">\n <ngs-progress-bar mode=\"indeterminate\"/>\n </div>\n <div class=\"absolute end-2 top-4 w-max z-30\">\n <button ngsButton (click)=\"cancelUploading()\">\n <ngs-icon name=\"fluent:delete-24-regular\"/>\n </button>\n </div>\n <div class=\"bg-white px-3 text-sm py-1.5 rounded-lg border border-border\">Loading...</div>\n </div>\n <div [style.width.px]=\"_settings().width || null\"\n [style.height.px]=\"_settings().height || null\"\n [class.max-w-full]=\"!_settings().width\">\n <video [src]=\"selectedVideo()\" muted class=\"w-full h-auto block\"></video>\n </div>\n </div>\n} @else if (_src()) {\n <div class=\"flex items-center justify-center overflow-hidden\">\n <ngs-resizable-container (resized)=\"_onVideoResized($event)\"\n [style.width.px]=\"_settings().width || null\"\n [style.height.px]=\"_settings().height || null\"\n [class.max-w-full]=\"!_settings().width\">\n <video #videoPlayer\n [src]=\"_src()\"\n class=\"w-full h-auto block\"\n (loadedmetadata)=\"_onVideoLoaded($event)\"\n controls></video>\n </ngs-resizable-container>\n </div>\n <ngs-form-field class=\"w-full mt-5\">\n <ngs-label>Caption</ngs-label>\n <input ngsInput [(ngModel)]=\"_caption\" (ngModelChange)=\"_onCaptionChange()\">\n </ngs-form-field>\n} @else {\n <ngs-upload-area #uploadArea=\"ngsUploadArea\"\n ngsUploadTrigger accept=\"video/*\"\n (fileSelected)=\"onFileSelected($event)\" multiple=\"false\"\n class=\"cursor-pointer hover:outline-2 hover:outline-[var(--color-primary)]\">\n @if (!uploadArea.api.isDropActive) {\n Drag & drop video here or click to upload\n } @else {\n <div class=\"font-medium\">Drop video here</div>\n }\n </ngs-upload-area>\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;MA+Ca,mBAAmB,CAAA;AACtB,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpC,IAAA,eAAe,GAAG,MAAM,CAA0B,eAAe,CAAC;AAE1E,IAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,wEAAU;AAC7B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAA6B;AACrD,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,8EAAmC;AAC5D,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;AAEhC,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,gFAAC;AACzB,IAAA,aAAa,GAAG,MAAM,CAAS,EAAE,oFAAC;AAExB,IAAA,IAAI,GAAG,MAAM,CAAS,EAAE,2EAAC;AACzB,IAAA,QAAQ,GAAG,KAAK,CAAS,EAAE,+EAAC;AAC5B,IAAA,YAAY,GAAG,MAAM,CAA2B,WAAW,mFAAC;AAC5D,IAAA,SAAS,GAAG,KAAK,CAAkC,EAAE,gFAAC;AACvD,IAAA,WAAW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A,EACzC;AACJ,wBAAA,YAAY,EAAE,wBAAwB;AACtC,wBAAA,OAAO,EAAE;AACV,qBAAA,EAAA,QAAA,EAAA,wpEAAA,EAAA,MAAA,EAAA,CAAA,+MAAA,CAAA,EAAA;mtBAoB+D,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { B as BlockSelectionDirective, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK, c as CommandBarComponent, d as ContentBuilderComponent, e as ContentViewerComponent, T as TextSelectionPopupDirective } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-
|
|
1
|
+
export { B as BlockSelectionDirective, a as CONTENT_BUILDER, b as CONTENT_EDITOR_BLOCK, c as CommandBarComponent, d as ContentBuilderComponent, e as ContentViewerComponent, T as TextSelectionPopupDirective } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-DNLTNGYa.mjs';
|
|
2
2
|
//# sourceMappingURL=ngstarter-ui-components-content-editor.mjs.map
|
|
@@ -15,7 +15,7 @@ class ContentFade {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ContentFade, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: ContentFade, isStandalone: true, selector: "ngs-content-fade", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.position-both": "position() === \"both\"", "class.position-start": "position() === \"start\"", "class.position-end": "position() === \"end\"" }, classAttribute: "ngs-content-fade" }, exportAs: ["ngsContentFade"], usesOnChanges: true, ngImport: i0, template: "<ng-content/>\n", styles: [":host{--ngs-content-fade-color: var(--color-background);--ngs-content-fade-width: 20%;display:block;position:relative}:host.position-both:before,:host.position-start:before{content:\"\";position:absolute;left:0;top:0;bottom:0;width:var(--ngs-content-fade-width);background:linear-gradient(to left,transparent,var(--ngs-content-fade-color))}:host.position-both:after,:host.position-end:after{content:\"\";position:absolute;top:0;bottom:0;right:0;width:var(--ngs-content-fade-width);background:linear-gradient(to right,transparent,var(--ngs-content-fade-color))}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] });
|
|
18
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: ContentFade, isStandalone: true, selector: "ngs-content-fade", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.position-both": "position() === \"both\"", "class.position-start": "position() === \"start\"", "class.position-end": "position() === \"end\"" }, classAttribute: "ngs-content-fade" }, exportAs: ["ngsContentFade"], usesOnChanges: true, ngImport: i0, template: "<ng-content/>\n", styles: [":host{--ngs-content-fade-color: var(--ngs-color-background);--ngs-content-fade-width: 20%;display:block;position:relative}:host.position-both:before,:host.position-start:before{content:\"\";position:absolute;left:0;top:0;bottom:0;width:var(--ngs-content-fade-width);background:linear-gradient(to left,transparent,var(--ngs-content-fade-color))}:host.position-both:after,:host.position-end:after{content:\"\";position:absolute;top:0;bottom:0;right:0;width:var(--ngs-content-fade-width);background:linear-gradient(to right,transparent,var(--ngs-content-fade-color))}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] });
|
|
19
19
|
}
|
|
20
20
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ContentFade, decorators: [{
|
|
21
21
|
type: Component,
|
|
@@ -24,7 +24,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
24
24
|
'[class.position-both]': 'position() === "both"',
|
|
25
25
|
'[class.position-start]': 'position() === "start"',
|
|
26
26
|
'[class.position-end]': 'position() === "end"',
|
|
27
|
-
}, template: "<ng-content/>\n", styles: [":host{--ngs-content-fade-color: var(--color-background);--ngs-content-fade-width: 20%;display:block;position:relative}:host.position-both:before,:host.position-start:before{content:\"\";position:absolute;left:0;top:0;bottom:0;width:var(--ngs-content-fade-width);background:linear-gradient(to left,transparent,var(--ngs-content-fade-color))}:host.position-both:after,:host.position-end:after{content:\"\";position:absolute;top:0;bottom:0;right:0;width:var(--ngs-content-fade-width);background:linear-gradient(to right,transparent,var(--ngs-content-fade-color))}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
27
|
+
}, template: "<ng-content/>\n", styles: [":host{--ngs-content-fade-color: var(--ngs-color-background);--ngs-content-fade-width: 20%;display:block;position:relative}:host.position-both:before,:host.position-start:before{content:\"\";position:absolute;left:0;top:0;bottom:0;width:var(--ngs-content-fade-width);background:linear-gradient(to left,transparent,var(--ngs-content-fade-color))}:host.position-both:after,:host.position-end:after{content:\"\";position:absolute;top:0;bottom:0;right:0;width:var(--ngs-content-fade-width);background:linear-gradient(to right,transparent,var(--ngs-content-fade-color))}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
28
28
|
}], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }] } });
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-content-fade.mjs","sources":["../../../projects/components/content-fade/src/content-fade/content-fade.ts","../../../projects/components/content-fade/src/content-fade/content-fade.html","../../../projects/components/content-fade/ngstarter-ui-components-content-fade.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n inject,\n input,\n OnChanges,\n SimpleChanges\n} from '@angular/core';\nimport { ContentFadePosition } from '../types';\n\n@Component({\n selector: 'ngs-content-fade',\n exportAs: 'ngsContentFade',\n templateUrl: './content-fade.html',\n styleUrl: './content-fade.scss',\n host: {\n 'class': 'ngs-content-fade',\n '[class.position-both]': 'position() === \"both\"',\n '[class.position-start]': 'position() === \"start\"',\n '[class.position-end]': 'position() === \"end\"',\n }\n})\nexport class ContentFade implements OnChanges {\n private _elementRef = inject(ElementRef);\n\n color = input();\n width = input();\n position = input<ContentFadePosition>('both');\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['width']) {\n (this._elementRef.nativeElement as HTMLElement).style.setProperty('--ngs-content-fade-width', changes['width'].currentValue, 'important');\n }\n\n if (changes['color']) {\n (this._elementRef.nativeElement as HTMLElement).style.setProperty('--ngs-content-fade-color', changes['color'].currentValue, 'important');\n }\n }\n}\n","<ng-content/>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAsBa,WAAW,CAAA;AACd,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;IAExC,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAE;IACf,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAE;AACf,IAAA,QAAQ,GAAG,KAAK,CAAsB,MAAM,+EAAC;AAE7C,IAAA,WAAW,CAAC,OAAsB,EAAA;AAChC,QAAA,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACnB,IAAI,CAAC,WAAW,CAAC,aAA6B,CAAC,KAAK,CAAC,WAAW,CAAC,0BAA0B,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC;QAC3I;AAEA,QAAA,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACnB,IAAI,CAAC,WAAW,CAAC,aAA6B,CAAC,KAAK,CAAC,WAAW,CAAC,0BAA0B,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC;QAC3I;IACF;uGAfW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAX,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,WAAW,gtBCtBxB,iBACA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-content-fade.mjs","sources":["../../../projects/components/content-fade/src/content-fade/content-fade.ts","../../../projects/components/content-fade/src/content-fade/content-fade.html","../../../projects/components/content-fade/ngstarter-ui-components-content-fade.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n inject,\n input,\n OnChanges,\n SimpleChanges\n} from '@angular/core';\nimport { ContentFadePosition } from '../types';\n\n@Component({\n selector: 'ngs-content-fade',\n exportAs: 'ngsContentFade',\n templateUrl: './content-fade.html',\n styleUrl: './content-fade.scss',\n host: {\n 'class': 'ngs-content-fade',\n '[class.position-both]': 'position() === \"both\"',\n '[class.position-start]': 'position() === \"start\"',\n '[class.position-end]': 'position() === \"end\"',\n }\n})\nexport class ContentFade implements OnChanges {\n private _elementRef = inject(ElementRef);\n\n color = input();\n width = input();\n position = input<ContentFadePosition>('both');\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['width']) {\n (this._elementRef.nativeElement as HTMLElement).style.setProperty('--ngs-content-fade-width', changes['width'].currentValue, 'important');\n }\n\n if (changes['color']) {\n (this._elementRef.nativeElement as HTMLElement).style.setProperty('--ngs-content-fade-color', changes['color'].currentValue, 'important');\n }\n }\n}\n","<ng-content/>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAsBa,WAAW,CAAA;AACd,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;IAExC,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAE;IACf,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAE;AACf,IAAA,QAAQ,GAAG,KAAK,CAAsB,MAAM,+EAAC;AAE7C,IAAA,WAAW,CAAC,OAAsB,EAAA;AAChC,QAAA,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACnB,IAAI,CAAC,WAAW,CAAC,aAA6B,CAAC,KAAK,CAAC,WAAW,CAAC,0BAA0B,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC;QAC3I;AAEA,QAAA,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACnB,IAAI,CAAC,WAAW,CAAC,aAA6B,CAAC,KAAK,CAAC,WAAW,CAAC,0BAA0B,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC;QAC3I;IACF;uGAfW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAX,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,WAAW,gtBCtBxB,iBACA,EAAA,MAAA,EAAA,CAAA,2nBAAA,CAAA,EAAA,CAAA;;2FDqBa,WAAW,EAAA,UAAA,EAAA,CAAA;kBAZvB,SAAS;+BACE,kBAAkB,EAAA,QAAA,EAClB,gBAAgB,EAAA,IAAA,EAGpB;AACJ,wBAAA,OAAO,EAAE,kBAAkB;AAC3B,wBAAA,uBAAuB,EAAE,uBAAuB;AAChD,wBAAA,wBAAwB,EAAE,wBAAwB;AAClD,wBAAA,sBAAsB,EAAE,sBAAsB;AAC/C,qBAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,2nBAAA,CAAA,EAAA;;;AEpBH;;AAEG;;;;"}
|
|
@@ -55,13 +55,13 @@ class CookiePopup {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CookiePopup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
58
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.4", type: CookiePopup, isStandalone: true, selector: "ngs-cookie-popup", inputs: { cookiePolicyUrl: { classPropertyName: "cookiePolicyUrl", publicName: "cookiePolicyUrl", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cookieAccepted: "cookieAccepted" }, viewQueries: [{ propertyName: "_contentRef", first: true, predicate: ["contentRef"], descendants: true, isSignal: true }], exportAs: ["ngsCookiePopup"], ngImport: i0, template: "<ng-template #contentRef>\n <div class=\"ngs-cookie-popup\">\n <h4 class=\"title\">\n <ng-content select=\"[ngsCookiePopupTitle]\"/>\n </h4>\n <div class=\"message\">\n <ng-content/>\n </div>\n <div class=\"controls\">\n <button ngsButton=\"outlined\" class=\"control\" (click)=\"acceptNecessaryCookiesOnly()\">\n <ng-content select=\"[ngsCookiePopupAcceptNecessaryOnlyButton]\"/>\n </button>\n <button ngsButton=\"filled\" class=\"control\" (click)=\"acceptAllCookies()\">\n <ng-content select=\"[ngsCookiePopupAcceptAllButton]\"/>\n </button>\n </div>\n </div>\n</ng-template>\n", styles: [":host{display:none;z-index:-99999;opacity:0}.ngs-cookie-popup{width:400px;border-radius:
|
|
58
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.4", type: CookiePopup, isStandalone: true, selector: "ngs-cookie-popup", inputs: { cookiePolicyUrl: { classPropertyName: "cookiePolicyUrl", publicName: "cookiePolicyUrl", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cookieAccepted: "cookieAccepted" }, viewQueries: [{ propertyName: "_contentRef", first: true, predicate: ["contentRef"], descendants: true, isSignal: true }], exportAs: ["ngsCookiePopup"], ngImport: i0, template: "<ng-template #contentRef>\n <div class=\"ngs-cookie-popup\">\n <h4 class=\"title\">\n <ng-content select=\"[ngsCookiePopupTitle]\"/>\n </h4>\n <div class=\"message\">\n <ng-content/>\n </div>\n <div class=\"controls\">\n <button ngsButton=\"outlined\" class=\"control\" (click)=\"acceptNecessaryCookiesOnly()\">\n <ng-content select=\"[ngsCookiePopupAcceptNecessaryOnlyButton]\"/>\n </button>\n <button ngsButton=\"filled\" class=\"control\" (click)=\"acceptAllCookies()\">\n <ng-content select=\"[ngsCookiePopupAcceptAllButton]\"/>\n </button>\n </div>\n </div>\n</ng-template>\n", styles: [":host{display:none;z-index:-99999;opacity:0}.ngs-cookie-popup{width:400px;border-radius:var(--ngs-radius-xl);box-shadow:var(--ngs-shadow-lg);background:var(--ngs-color-surface-container-lowest);padding:calc(var(--spacing, .25rem) * 4)}.ngs-cookie-popup .title{margin-bottom:calc(var(--spacing, .25rem) * 3);font-weight:700}.ngs-cookie-popup .message{font-size:var(--ngs-font-size-sm);margin-bottom:calc(var(--spacing, .25rem) * 4)}.ngs-cookie-popup .controls{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2)}.ngs-cookie-popup .control{width:100%}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }] });
|
|
59
59
|
}
|
|
60
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CookiePopup, decorators: [{
|
|
61
61
|
type: Component,
|
|
62
62
|
args: [{ selector: 'ngs-cookie-popup', exportAs: 'ngsCookiePopup', imports: [
|
|
63
63
|
Button
|
|
64
|
-
], template: "<ng-template #contentRef>\n <div class=\"ngs-cookie-popup\">\n <h4 class=\"title\">\n <ng-content select=\"[ngsCookiePopupTitle]\"/>\n </h4>\n <div class=\"message\">\n <ng-content/>\n </div>\n <div class=\"controls\">\n <button ngsButton=\"outlined\" class=\"control\" (click)=\"acceptNecessaryCookiesOnly()\">\n <ng-content select=\"[ngsCookiePopupAcceptNecessaryOnlyButton]\"/>\n </button>\n <button ngsButton=\"filled\" class=\"control\" (click)=\"acceptAllCookies()\">\n <ng-content select=\"[ngsCookiePopupAcceptAllButton]\"/>\n </button>\n </div>\n </div>\n</ng-template>\n", styles: [":host{display:none;z-index:-99999;opacity:0}.ngs-cookie-popup{width:400px;border-radius:
|
|
64
|
+
], template: "<ng-template #contentRef>\n <div class=\"ngs-cookie-popup\">\n <h4 class=\"title\">\n <ng-content select=\"[ngsCookiePopupTitle]\"/>\n </h4>\n <div class=\"message\">\n <ng-content/>\n </div>\n <div class=\"controls\">\n <button ngsButton=\"outlined\" class=\"control\" (click)=\"acceptNecessaryCookiesOnly()\">\n <ng-content select=\"[ngsCookiePopupAcceptNecessaryOnlyButton]\"/>\n </button>\n <button ngsButton=\"filled\" class=\"control\" (click)=\"acceptAllCookies()\">\n <ng-content select=\"[ngsCookiePopupAcceptAllButton]\"/>\n </button>\n </div>\n </div>\n</ng-template>\n", styles: [":host{display:none;z-index:-99999;opacity:0}.ngs-cookie-popup{width:400px;border-radius:var(--ngs-radius-xl);box-shadow:var(--ngs-shadow-lg);background:var(--ngs-color-surface-container-lowest);padding:calc(var(--spacing, .25rem) * 4)}.ngs-cookie-popup .title{margin-bottom:calc(var(--spacing, .25rem) * 3);font-weight:700}.ngs-cookie-popup .message{font-size:var(--ngs-font-size-sm);margin-bottom:calc(var(--spacing, .25rem) * 4)}.ngs-cookie-popup .controls{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2)}.ngs-cookie-popup .control{width:100%}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
65
65
|
}], ctorParameters: () => [], propDecorators: { _contentRef: [{ type: i0.ViewChild, args: ['contentRef', { isSignal: true }] }], cookiePolicyUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "cookiePolicyUrl", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], cookieAccepted: [{ type: i0.Output, args: ["cookieAccepted"] }] } });
|
|
66
66
|
|
|
67
67
|
class CookiePopupTitleDirective {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-cookie-popup.mjs","sources":["../../../projects/components/cookie-popup/src/cookie-popup/cookie-popup.ts","../../../projects/components/cookie-popup/src/cookie-popup/cookie-popup.html","../../../projects/components/cookie-popup/src/cookie-popup-title.directive.ts","../../../projects/components/cookie-popup/src/cookie-popup-accept-all-button.directive.ts","../../../projects/components/cookie-popup/src/cookie-popup-accept-necessary-only-button.directive.ts","../../../projects/components/cookie-popup/ngstarter-ui-components-cookie-popup.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component, effect,\n inject,\n Injector,\n input, output,\n TemplateRef,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { CookiePopupAcceptType } from '../types';\nimport { Button } from '@ngstarter-ui/components/button';\n\n@Component({\n selector: 'ngs-cookie-popup',\n exportAs: 'ngsCookiePopup',\n imports: [\n Button\n ],\n templateUrl: './cookie-popup.html',\n styleUrl: './cookie-popup.scss'\n})\nexport class CookiePopup {\n private _overlay = inject(Overlay);\n private _viewContainerRef = inject(ViewContainerRef);\n private _injector = inject(Injector);\n\n private _contentRef = viewChild.required<TemplateRef<any>>('contentRef');\n\n cookiePolicyUrl = input('');\n visible = input(true, {\n transform: booleanAttribute\n });\n\n private _overlayRef: OverlayRef | null = null;\n\n readonly cookieAccepted = output<CookiePopupAcceptType>();\n\n constructor() {\n effect(() => {\n if (this.visible()) {\n this._show();\n } else {\n this._hide();\n }\n });\n }\n\n acceptNecessaryCookiesOnly() {\n this.cookieAccepted.emit('necessary');\n this._hide();\n }\n\n acceptAllCookies() {\n this.cookieAccepted.emit('all');\n this._hide();\n }\n\n private _show() {\n if (this._overlayRef) {\n return;\n }\n\n const overlayPositionStrategy = this._overlay\n .position()\n .global()\n .start('20px')\n .bottom('20px')\n ;\n this._overlayRef = this._overlay.create({\n hasBackdrop: false,\n positionStrategy: overlayPositionStrategy,\n scrollStrategy: this._overlay.scrollStrategies.reposition(),\n });\n this._overlayRef.attach(new TemplatePortal(\n this._contentRef(),\n this._viewContainerRef,\n null,\n this._injector\n ));\n }\n\n private _hide() {\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._overlayRef.detach();\n this._overlayRef = null;\n }\n }\n}\n","<ng-template #contentRef>\n <div class=\"ngs-cookie-popup\">\n <h4 class=\"title\">\n <ng-content select=\"[ngsCookiePopupTitle]\"/>\n </h4>\n <div class=\"message\">\n <ng-content/>\n </div>\n <div class=\"controls\">\n <button ngsButton=\"outlined\" class=\"control\" (click)=\"acceptNecessaryCookiesOnly()\">\n <ng-content select=\"[ngsCookiePopupAcceptNecessaryOnlyButton]\"/>\n </button>\n <button ngsButton=\"filled\" class=\"control\" (click)=\"acceptAllCookies()\">\n <ng-content select=\"[ngsCookiePopupAcceptAllButton]\"/>\n </button>\n </div>\n </div>\n</ng-template>\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[ngsCookiePopupTitle]'\n})\nexport class CookiePopupTitleDirective {\n\n constructor() { }\n\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[ngsCookiePopupAcceptAllButton]'\n})\nexport class CookiePopupAcceptAllButtonDirective {\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[ngsCookiePopupAcceptNecessaryOnlyButton]'\n})\nexport class CookiePopupAcceptNecessaryOnlyButtonDirective {\n\n constructor() { }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAwBa,WAAW,CAAA;AACd,IAAA,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC;AAC1B,IAAA,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC5C,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAE5B,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAmB,YAAY,CAAC;AAExE,IAAA,eAAe,GAAG,KAAK,CAAC,EAAE,sFAAC;IAC3B,OAAO,GAAG,KAAK,CAAC,IAAI,+EAClB,SAAS,EAAE,gBAAgB,EAAA,CAC3B;IAEM,WAAW,GAAsB,IAAI;IAEpC,cAAc,GAAG,MAAM,EAAyB;AAEzD,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;AACV,YAAA,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;gBAClB,IAAI,CAAC,KAAK,EAAE;YACd;iBAAO;gBACL,IAAI,CAAC,KAAK,EAAE;YACd;AACF,QAAA,CAAC,CAAC;IACJ;IAEA,0BAA0B,GAAA;AACxB,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC;QACrC,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AA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,aAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,YAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECxBxB,soBAkBA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-cookie-popup.mjs","sources":["../../../projects/components/cookie-popup/src/cookie-popup/cookie-popup.ts","../../../projects/components/cookie-popup/src/cookie-popup/cookie-popup.html","../../../projects/components/cookie-popup/src/cookie-popup-title.directive.ts","../../../projects/components/cookie-popup/src/cookie-popup-accept-all-button.directive.ts","../../../projects/components/cookie-popup/src/cookie-popup-accept-necessary-only-button.directive.ts","../../../projects/components/cookie-popup/ngstarter-ui-components-cookie-popup.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component, effect,\n inject,\n Injector,\n input, output,\n TemplateRef,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { CookiePopupAcceptType } from '../types';\nimport { Button } from '@ngstarter-ui/components/button';\n\n@Component({\n selector: 'ngs-cookie-popup',\n exportAs: 'ngsCookiePopup',\n imports: [\n Button\n ],\n templateUrl: './cookie-popup.html',\n styleUrl: './cookie-popup.scss'\n})\nexport class CookiePopup {\n private _overlay = inject(Overlay);\n private _viewContainerRef = inject(ViewContainerRef);\n private _injector = inject(Injector);\n\n private _contentRef = viewChild.required<TemplateRef<any>>('contentRef');\n\n cookiePolicyUrl = input('');\n visible = input(true, {\n transform: booleanAttribute\n });\n\n private _overlayRef: OverlayRef | null = null;\n\n readonly cookieAccepted = output<CookiePopupAcceptType>();\n\n constructor() {\n effect(() => {\n if (this.visible()) {\n this._show();\n } else {\n this._hide();\n }\n });\n }\n\n acceptNecessaryCookiesOnly() {\n this.cookieAccepted.emit('necessary');\n this._hide();\n }\n\n acceptAllCookies() {\n this.cookieAccepted.emit('all');\n this._hide();\n }\n\n private _show() {\n if (this._overlayRef) {\n return;\n }\n\n const overlayPositionStrategy = this._overlay\n .position()\n .global()\n .start('20px')\n .bottom('20px')\n ;\n this._overlayRef = this._overlay.create({\n hasBackdrop: false,\n positionStrategy: overlayPositionStrategy,\n scrollStrategy: this._overlay.scrollStrategies.reposition(),\n });\n this._overlayRef.attach(new TemplatePortal(\n this._contentRef(),\n this._viewContainerRef,\n null,\n this._injector\n ));\n }\n\n private _hide() {\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._overlayRef.detach();\n this._overlayRef = null;\n }\n }\n}\n","<ng-template #contentRef>\n <div class=\"ngs-cookie-popup\">\n <h4 class=\"title\">\n <ng-content select=\"[ngsCookiePopupTitle]\"/>\n </h4>\n <div class=\"message\">\n <ng-content/>\n </div>\n <div class=\"controls\">\n <button ngsButton=\"outlined\" class=\"control\" (click)=\"acceptNecessaryCookiesOnly()\">\n <ng-content select=\"[ngsCookiePopupAcceptNecessaryOnlyButton]\"/>\n </button>\n <button ngsButton=\"filled\" class=\"control\" (click)=\"acceptAllCookies()\">\n <ng-content select=\"[ngsCookiePopupAcceptAllButton]\"/>\n </button>\n </div>\n </div>\n</ng-template>\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[ngsCookiePopupTitle]'\n})\nexport class CookiePopupTitleDirective {\n\n constructor() { }\n\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[ngsCookiePopupAcceptAllButton]'\n})\nexport class CookiePopupAcceptAllButtonDirective {\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[ngsCookiePopupAcceptNecessaryOnlyButton]'\n})\nexport class CookiePopupAcceptNecessaryOnlyButtonDirective {\n\n constructor() { }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAwBa,WAAW,CAAA;AACd,IAAA,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC;AAC1B,IAAA,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC5C,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAE5B,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAmB,YAAY,CAAC;AAExE,IAAA,eAAe,GAAG,KAAK,CAAC,EAAE,sFAAC;IAC3B,OAAO,GAAG,KAAK,CAAC,IAAI,+EAClB,SAAS,EAAE,gBAAgB,EAAA,CAC3B;IAEM,WAAW,GAAsB,IAAI;IAEpC,cAAc,GAAG,MAAM,EAAyB;AAEzD,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;AACV,YAAA,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;gBAClB,IAAI,CAAC,KAAK,EAAE;YACd;iBAAO;gBACL,IAAI,CAAC,KAAK,EAAE;YACd;AACF,QAAA,CAAC,CAAC;IACJ;IAEA,0BAA0B,GAAA;AACxB,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC;QACrC,IAAI,CAAC,KAAK,EAAE;IACd;IAEA,gBAAgB,GAAA;AACd,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;QAC/B,IAAI,CAAC,KAAK,EAAE;IACd;IAEQ,KAAK,GAAA;AACX,QAAA,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB;QACF;AAEA,QAAA,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAClC,a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1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, PLATFORM_ID, ElementRef, input, Directive, booleanAttribute, output, DestroyRef, afterNextRender, numberAttribute, forwardRef, NgZone, model, effect, Pipe, Injectable, DOCUMENT, isDevMode, EventEmitter } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, PLATFORM_ID, ElementRef, input, Directive, booleanAttribute, output, DestroyRef, afterNextRender, numberAttribute, forwardRef, NgZone, model, effect, Pipe, Injectable, DOCUMENT, isDevMode, EventEmitter, signal } from '@angular/core';
|
|
3
3
|
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
|
|
4
4
|
import { FocusMonitor, isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader } from '@angular/cdk/a11y';
|
|
5
5
|
import { fromEvent, filter, merge, debounceTime, Observable, Subscription } from 'rxjs';
|
|
@@ -1120,12 +1120,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1120
1120
|
}]
|
|
1121
1121
|
}] });
|
|
1122
1122
|
|
|
1123
|
-
const
|
|
1123
|
+
const NGS_THEME_OPTIONS = new InjectionToken('NGS_THEME_OPTIONS', {
|
|
1124
|
+
factory: () => ({
|
|
1125
|
+
theme: 'default',
|
|
1126
|
+
colorScheme: 'auto',
|
|
1127
|
+
density: 'comfortable',
|
|
1128
|
+
radius: 'medium',
|
|
1129
|
+
persist: true,
|
|
1130
|
+
storageKey: 'ngs-admin',
|
|
1131
|
+
}),
|
|
1132
|
+
});
|
|
1133
|
+
function provideNgsTheme(options = {}) {
|
|
1134
|
+
return {
|
|
1135
|
+
provide: NGS_THEME_OPTIONS,
|
|
1136
|
+
useValue: {
|
|
1137
|
+
theme: 'default',
|
|
1138
|
+
colorScheme: 'auto',
|
|
1139
|
+
density: 'comfortable',
|
|
1140
|
+
radius: 'medium',
|
|
1141
|
+
persist: true,
|
|
1142
|
+
storageKey: 'ngs-admin',
|
|
1143
|
+
...options,
|
|
1144
|
+
},
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1124
1148
|
class ThemeManagerService {
|
|
1125
1149
|
_document = inject(DOCUMENT);
|
|
1126
1150
|
_window = this._document.defaultView;
|
|
1127
|
-
|
|
1151
|
+
_options = inject(NGS_THEME_OPTIONS);
|
|
1152
|
+
_theme = signal('default', ...(ngDevMode ? [{ debugName: "_theme" }] : /* istanbul ignore next */ []));
|
|
1153
|
+
_colorScheme = signal('light', ...(ngDevMode ? [{ debugName: "_colorScheme" }] : /* istanbul ignore next */ []));
|
|
1154
|
+
_density = signal('comfortable', ...(ngDevMode ? [{ debugName: "_density" }] : /* istanbul ignore next */ []));
|
|
1155
|
+
_radius = signal('medium', ...(ngDevMode ? [{ debugName: "_radius" }] : /* istanbul ignore next */ []));
|
|
1156
|
+
_primaryColor = signal(null, ...(ngDevMode ? [{ debugName: "_primaryColor" }] : /* istanbul ignore next */ []));
|
|
1157
|
+
theme = this._theme.asReadonly();
|
|
1158
|
+
colorScheme = this._colorScheme.asReadonly();
|
|
1159
|
+
density = this._density.asReadonly();
|
|
1160
|
+
radius = this._radius.asReadonly();
|
|
1161
|
+
primaryColor = this._primaryColor.asReadonly();
|
|
1128
1162
|
constructor() {
|
|
1163
|
+
this.applyTheme(this._getInitialState());
|
|
1164
|
+
effect(() => {
|
|
1165
|
+
this._syncDocumentAttributes();
|
|
1166
|
+
});
|
|
1129
1167
|
afterNextRender(() => {
|
|
1130
1168
|
if (this._window !== null && this._window.matchMedia) {
|
|
1131
1169
|
this._window
|
|
@@ -1133,14 +1171,14 @@ class ThemeManagerService {
|
|
|
1133
1171
|
.addEventListener('change', () => {
|
|
1134
1172
|
const storedColorScheme = this._getStoredColorScheme();
|
|
1135
1173
|
if (storedColorScheme !== 'light' && storedColorScheme !== 'dark') {
|
|
1136
|
-
this.setColorScheme(this.getPreferredColorScheme());
|
|
1174
|
+
this.setColorScheme(this.getPreferredColorScheme(), false);
|
|
1137
1175
|
}
|
|
1138
1176
|
});
|
|
1139
1177
|
}
|
|
1140
1178
|
});
|
|
1141
1179
|
}
|
|
1142
1180
|
getColorScheme() {
|
|
1143
|
-
return this._colorScheme;
|
|
1181
|
+
return this._colorScheme();
|
|
1144
1182
|
}
|
|
1145
1183
|
toggleColorScheme() {
|
|
1146
1184
|
if (this._getStoredColorScheme() === 'dark') {
|
|
@@ -1151,29 +1189,75 @@ class ThemeManagerService {
|
|
|
1151
1189
|
}
|
|
1152
1190
|
}
|
|
1153
1191
|
changeColorScheme(colorScheme) {
|
|
1154
|
-
this._colorScheme = colorScheme;
|
|
1155
|
-
this._setStoredColorScheme(colorScheme);
|
|
1156
1192
|
this.setColorScheme(colorScheme);
|
|
1157
1193
|
}
|
|
1194
|
+
setTheme(theme, persist = true) {
|
|
1195
|
+
this._theme.set(theme);
|
|
1196
|
+
this._persist({ theme }, persist);
|
|
1197
|
+
}
|
|
1198
|
+
setDensity(density, persist = true) {
|
|
1199
|
+
this._density.set(density);
|
|
1200
|
+
this._persist({ density }, persist);
|
|
1201
|
+
}
|
|
1202
|
+
setRadius(radius, persist = true) {
|
|
1203
|
+
this._radius.set(radius);
|
|
1204
|
+
this._persist({ radius }, persist);
|
|
1205
|
+
}
|
|
1206
|
+
setPrimaryColor(primaryColor, persist = true) {
|
|
1207
|
+
this._primaryColor.set(primaryColor);
|
|
1208
|
+
this._persist({ primaryColor: primaryColor || undefined }, persist);
|
|
1209
|
+
}
|
|
1210
|
+
applyTheme(options, persist = false) {
|
|
1211
|
+
if (options.theme) {
|
|
1212
|
+
this._theme.set(options.theme);
|
|
1213
|
+
}
|
|
1214
|
+
if (options.density) {
|
|
1215
|
+
this._density.set(options.density);
|
|
1216
|
+
}
|
|
1217
|
+
if (options.radius) {
|
|
1218
|
+
this._radius.set(options.radius);
|
|
1219
|
+
}
|
|
1220
|
+
if (options.primaryColor !== undefined) {
|
|
1221
|
+
this._primaryColor.set(options.primaryColor || null);
|
|
1222
|
+
}
|
|
1223
|
+
this.setColorScheme(options.colorScheme || 'auto', persist);
|
|
1224
|
+
this._persist(options, persist);
|
|
1225
|
+
}
|
|
1158
1226
|
_getStoredColorScheme() {
|
|
1159
|
-
|
|
1160
|
-
|
|
1227
|
+
return this._getStoredState().colorScheme;
|
|
1228
|
+
}
|
|
1229
|
+
;
|
|
1230
|
+
_getStoredState() {
|
|
1231
|
+
if (!this._options.persist || typeof localStorage === 'undefined') {
|
|
1232
|
+
return {};
|
|
1233
|
+
}
|
|
1234
|
+
const rawValue = localStorage.getItem(this._storageKey);
|
|
1235
|
+
if (!rawValue) {
|
|
1236
|
+
return {};
|
|
1237
|
+
}
|
|
1238
|
+
try {
|
|
1239
|
+
return JSON.parse(rawValue);
|
|
1240
|
+
}
|
|
1241
|
+
catch {
|
|
1242
|
+
return {};
|
|
1161
1243
|
}
|
|
1162
|
-
return JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY) ?? '{}').colorScheme;
|
|
1163
1244
|
}
|
|
1164
1245
|
;
|
|
1165
|
-
|
|
1166
|
-
if (typeof localStorage === 'undefined') {
|
|
1246
|
+
_persist(state, persist = true) {
|
|
1247
|
+
if (!persist || !this._options.persist || typeof localStorage === 'undefined') {
|
|
1167
1248
|
return;
|
|
1168
1249
|
}
|
|
1169
|
-
const meta =
|
|
1170
|
-
|
|
1171
|
-
|
|
1250
|
+
const meta = this._getStoredState();
|
|
1251
|
+
localStorage.setItem(this._storageKey, JSON.stringify({ ...meta, ...state }));
|
|
1252
|
+
}
|
|
1253
|
+
;
|
|
1254
|
+
_setStoredColorScheme(colorScheme) {
|
|
1255
|
+
this._persist({ colorScheme: colorScheme });
|
|
1172
1256
|
}
|
|
1173
1257
|
;
|
|
1174
1258
|
getPreferredColorScheme() {
|
|
1175
1259
|
const storedTheme = this._getStoredColorScheme();
|
|
1176
|
-
if (storedTheme) {
|
|
1260
|
+
if (storedTheme === 'light' || storedTheme === 'dark') {
|
|
1177
1261
|
return storedTheme;
|
|
1178
1262
|
}
|
|
1179
1263
|
if (this._window !== null && this._window.matchMedia) {
|
|
@@ -1182,26 +1266,45 @@ class ThemeManagerService {
|
|
|
1182
1266
|
return 'light';
|
|
1183
1267
|
}
|
|
1184
1268
|
;
|
|
1185
|
-
setColorScheme(colorScheme) {
|
|
1186
|
-
if (
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
this._colorScheme = 'dark';
|
|
1195
|
-
this._document.documentElement.classList.add('dark');
|
|
1196
|
-
}
|
|
1197
|
-
else {
|
|
1198
|
-
this._colorScheme = 'light';
|
|
1199
|
-
this._document.documentElement.classList.remove('dark');
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1269
|
+
setColorScheme(colorScheme, persist = true) {
|
|
1270
|
+
if (colorScheme === 'auto') {
|
|
1271
|
+
this._colorScheme.set(this.getPreferredColorScheme());
|
|
1272
|
+
}
|
|
1273
|
+
else {
|
|
1274
|
+
this._colorScheme.set(colorScheme);
|
|
1275
|
+
}
|
|
1276
|
+
if (persist) {
|
|
1277
|
+
this._setStoredColorScheme(colorScheme);
|
|
1202
1278
|
}
|
|
1203
1279
|
}
|
|
1204
1280
|
;
|
|
1281
|
+
_getInitialState() {
|
|
1282
|
+
return {
|
|
1283
|
+
...this._options,
|
|
1284
|
+
...this._getStoredState(),
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
_syncDocumentAttributes() {
|
|
1288
|
+
const root = this._document.documentElement;
|
|
1289
|
+
const primaryColor = this._primaryColor();
|
|
1290
|
+
if (!root) {
|
|
1291
|
+
return;
|
|
1292
|
+
}
|
|
1293
|
+
root.classList?.toggle('dark', this._colorScheme() === 'dark');
|
|
1294
|
+
root.setAttribute('data-ngs-theme', this._theme());
|
|
1295
|
+
root.setAttribute('data-ngs-color-scheme', this._colorScheme());
|
|
1296
|
+
root.setAttribute('data-ngs-density', this._density());
|
|
1297
|
+
root.setAttribute('data-ngs-radius', this._radius());
|
|
1298
|
+
if (primaryColor && root.style) {
|
|
1299
|
+
root.style.setProperty('--ngs-color-primary', primaryColor);
|
|
1300
|
+
}
|
|
1301
|
+
else if (root.style) {
|
|
1302
|
+
root.style.removeProperty('--ngs-color-primary');
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
get _storageKey() {
|
|
1306
|
+
return this._options.storageKey || 'ngs-admin';
|
|
1307
|
+
}
|
|
1205
1308
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ThemeManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1206
1309
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ThemeManagerService, providedIn: 'root' });
|
|
1207
1310
|
}
|
|
@@ -1326,5 +1429,5 @@ function typedFromEvent(target, event, options) {
|
|
|
1326
1429
|
* Generated bundle index. Do not edit.
|
|
1327
1430
|
*/
|
|
1328
1431
|
|
|
1329
|
-
export { AUTOFOCUSABLE, AnalyticsService, AutoFocusDirective, DebounceTimeDirective, ENVIRONMENT, EnvironmentService, ErrorStateMatcher, FilterByPropertyPipe, FocusElementDirective, FormatFileSizePipe, GlobalStore, InactivityTrackerService, InitialsPipe, MutationObserverService, OrderByPipe, PageTitleStrategyService, RIPPLE_GLOBAL_OPTIONS, ResizeObserverService, Ripple, RippleRef, RippleRenderer, RippleState, SafeHtmlPipe, SafeResourceUrlPipe, ScreenLoaderService, SearchByPropertyPipe, SeoService, ShowOnDirtyErrorStateMatcher, SoundEffectDirective, TextareaAutoSize, ThemeManagerService, arrayShallowEquals, defaultRippleAnimationConfig, getActualTarget, injectElement, isElement, px, typedFromEvent, zonefreeScheduler };
|
|
1432
|
+
export { AUTOFOCUSABLE, AnalyticsService, AutoFocusDirective, DebounceTimeDirective, ENVIRONMENT, EnvironmentService, ErrorStateMatcher, FilterByPropertyPipe, FocusElementDirective, FormatFileSizePipe, GlobalStore, InactivityTrackerService, InitialsPipe, MutationObserverService, NGS_THEME_OPTIONS, OrderByPipe, PageTitleStrategyService, RIPPLE_GLOBAL_OPTIONS, ResizeObserverService, Ripple, RippleRef, RippleRenderer, RippleState, SafeHtmlPipe, SafeResourceUrlPipe, ScreenLoaderService, SearchByPropertyPipe, SeoService, ShowOnDirtyErrorStateMatcher, SoundEffectDirective, TextareaAutoSize, ThemeManagerService, arrayShallowEquals, defaultRippleAnimationConfig, getActualTarget, injectElement, isElement, provideNgsTheme, px, typedFromEvent, zonefreeScheduler };
|
|
1330
1433
|
//# sourceMappingURL=ngstarter-ui-components-core.mjs.map
|