@koobiq/components 21.0.0 → 21.1.0
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/badge/_badge-theme.scss +31 -0
- package/breadcrumbs/breadcrumbs.scss +5 -1
- package/checkbox/_checkbox-theme.scss +0 -17
- package/checkbox/checkbox-tokens.scss +0 -4
- package/code-block/_code-block-theme.scss +7 -6
- package/code-block/code-block-tokens.scss +8 -4
- package/code-block/code-block.scss +54 -32
- package/content-panel/content-panel-header.scss +2 -3
- package/content-panel/content-panel.scss +3 -0
- package/core/selection/pseudo-checkbox/pseudo-checkbox-tokens.scss +0 -2
- package/fesm2022/koobiq-components-accordion.mjs +4 -4
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs +10 -2
- package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +2 -2
- package/fesm2022/koobiq-components-badge.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +2 -2
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-checkbox.mjs +18 -8
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-clamped-text.mjs +78 -10
- package/fesm2022/koobiq-components-clamped-text.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +106 -394
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +4 -4
- package/fesm2022/koobiq-components-content-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +300 -37
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +151 -60
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs +3 -3
- package/fesm2022/koobiq-components-divider.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +3 -3
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-file-upload.mjs +17 -8
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +124 -41
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-flag.mjs +3 -3
- package/fesm2022/koobiq-components-flag.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +90 -27
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +38 -17
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +19 -2
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +76 -17
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +1 -1
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +3 -3
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +86 -25
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +4 -4
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-overflow-items.mjs +116 -38
- package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +86 -7
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-radio.mjs +41 -19
- package/fesm2022/koobiq-components-radio.mjs.map +1 -1
- package/fesm2022/koobiq-components-search-expandable.mjs +29 -17
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +49 -12
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidepanel.mjs +198 -186
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-splitter.mjs +49 -25
- package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +30 -11
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +1 -1
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +28 -11
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +2 -2
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +71 -16
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +2 -2
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-toast.mjs +2 -2
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +25 -9
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +90 -17
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +27 -7
- package/fesm2022/koobiq-components-top-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +24 -9
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +288 -109
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/file-upload/_file-upload-theme.scss +0 -12
- package/file-upload/file-upload-tokens.scss +0 -1
- package/file-upload/file-upload.scss +0 -1
- package/filter-bar/_filter-bar-theme.scss +7 -8
- package/filter-bar/filter-bar.scss +0 -1
- package/filter-bar/pipes/base-pipe.scss +36 -2
- package/filter-bar/pipes/pipe-multi-tree-select.scss +27 -0
- package/form-field/_fieldset-theme.scss +2 -7
- package/form-field/_form-field-theme.scss +9 -22
- package/form-field/_hint-theme.scss +20 -0
- package/form-field/fieldset-tokens.scss +0 -1
- package/form-field/fieldset.scss +0 -3
- package/form-field/form-field-tokens.scss +1 -1
- package/form-field/form-field.scss +9 -0
- package/form-field/hint-tokens.scss +3 -0
- package/modal/modal.scss +2 -0
- package/navbar/_navbar-item_vertical.scss +48 -2
- package/navbar/_navbar-theme.scss +11 -3
- package/navbar/navbar-item.scss +17 -0
- package/navbar/navbar-tokens.scss +3 -0
- package/package.json +4 -4
- package/popover/popover.scss +1 -1
- package/radio/_radio-theme.scss +0 -30
- package/radio/radio-tokens.scss +0 -2
- package/schematics/collection.json +94 -89
- package/schematics/migrations/accordion-state-saving-default/{index.js → index.cjs} +5 -4
- package/schematics/migrations/actions-panel-overlay-container/{index.js → index.cjs} +5 -4
- package/schematics/migrations/alert-signals/{index.js → index.cjs} +14 -13
- package/schematics/migrations/angular-animations-removal/index.cjs +21 -0
- package/schematics/migrations/app-switcher-signals/{index.js → index.cjs} +7 -6
- package/schematics/migrations/autocomplete-panel-width-auto/{index.js → index.cjs} +6 -5
- package/schematics/migrations/autocomplete-signals/{index.js → index.cjs} +7 -6
- package/schematics/migrations/badge-signals/{index.js → index.cjs} +7 -6
- package/schematics/migrations/button-state-and-styles/{index.js → index.cjs} +7 -6
- package/schematics/migrations/button-supported-colors/{index.js → index.cjs} +7 -6
- package/schematics/migrations/button-toggle-signals-and-aria/{index.js → index.cjs} +7 -6
- package/schematics/migrations/button-truncation/{index.js → index.cjs} +7 -6
- package/schematics/migrations/checkbox-signals/{index.js → index.cjs} +9 -8
- package/schematics/migrations/clamped-text-disclosure/{index.js → index.cjs} +5 -4
- package/schematics/migrations/code-block-highlight-js-core/README.md +53 -0
- package/schematics/migrations/code-block-highlight-js-core/data.cjs +64 -0
- package/schematics/migrations/code-block-highlight-js-core/index.cjs +319 -0
- package/schematics/migrations/code-block-highlight-js-core/schema.json +20 -0
- package/schematics/migrations/code-block-signals/{index.js → index.cjs} +7 -6
- package/schematics/migrations/color-signals/index.cjs +20 -0
- package/schematics/migrations/core-mixins-removal/index.cjs +18 -0
- package/schematics/migrations/css-selectors/{index.js → index.cjs} +4 -3
- package/schematics/migrations/datepicker-signals/index.cjs +18 -0
- package/schematics/migrations/deprecated-icons/README.md +21 -5
- package/schematics/migrations/deprecated-icons/{index.js → index.cjs} +15 -28
- package/schematics/migrations/deprecated-icons/schema.json +1 -1
- package/schematics/migrations/design-tokens-v4/{index.js → index.cjs} +3 -2
- package/schematics/migrations/divider-signals-and-aria/{index.js → index.cjs} +5 -4
- package/schematics/migrations/dl-attribute-coercion/{index.js → index.cjs} +7 -6
- package/schematics/migrations/dl-standalone-names/{index.js → index.cjs} +11 -10
- package/schematics/migrations/dropdown-demote-overlay/{index.js → index.cjs} +7 -6
- package/schematics/migrations/dropdown-signals/index.cjs +20 -0
- package/schematics/migrations/empty-state-error-color/{index.js → index.cjs} +5 -4
- package/schematics/migrations/empty-state-size-attr/{index.js → index.cjs} +6 -5
- package/schematics/migrations/file-upload-cva-and-primitives/{index.js → index.cjs} +5 -4
- package/schematics/migrations/file-upload-deprecated-outputs/{index.js → index.cjs} +5 -4
- package/schematics/migrations/filter-bar-rename-action/{index.js → index.cjs} +5 -4
- package/schematics/migrations/filter-bar-signals/{index.js → index.cjs} +16 -15
- package/schematics/migrations/filter-bar-state-saving-default/{index.js → index.cjs} +5 -4
- package/schematics/migrations/flag-inner-html/{index.js → index.cjs} +5 -4
- package/schematics/migrations/form-field-signals/{index.js → index.cjs} +18 -17
- package/schematics/migrations/icon-semantics-and-api/{data.js → data.cjs} +4 -4
- package/schematics/migrations/icon-semantics-and-api/{index.js → index.cjs} +6 -5
- package/schematics/migrations/icons-replacement/README.md +16 -2
- package/schematics/migrations/icons-replacement/{index.js → index.cjs} +21 -18
- package/schematics/migrations/icons-replacement/schema.json +12 -3
- package/schematics/migrations/inline-edit-a11y-and-types/{index.js → index.cjs} +5 -4
- package/schematics/migrations/input-number-surface/{index.js → index.cjs} +5 -4
- package/schematics/migrations/input-signals/index.cjs +18 -0
- package/schematics/migrations/link-deprecated-path/{index.js → index.cjs} +4 -3
- package/schematics/migrations/link-signals/{index.js → index.cjs} +5 -4
- package/schematics/migrations/list-signals/index.cjs +18 -0
- package/schematics/migrations/list-tree-multiple-input/{index.js → index.cjs} +7 -6
- package/schematics/migrations/loader-overlay-signals/{index.js → index.cjs} +7 -6
- package/schematics/migrations/loader-overlay-size-attr/{index.js → index.cjs} +6 -5
- package/schematics/migrations/locale-configuration-providers/{index.js → index.cjs} +5 -4
- package/schematics/migrations/mandatory-peer-dependencies/{index.js → index.cjs} +3 -2
- package/schematics/migrations/markdown-signals/{index.js → index.cjs} +7 -6
- package/schematics/migrations/modal-dialog-semantics/{index.js → index.cjs} +5 -4
- package/schematics/migrations/modal-signals/index.cjs +20 -0
- package/schematics/migrations/navbar-signals-and-aria/{index.js → index.cjs} +7 -6
- package/schematics/migrations/new-icons-pack/README.md +37 -25
- package/schematics/migrations/new-icons-pack/{index.js → index.cjs} +29 -38
- package/schematics/migrations/new-icons-pack/replacement.json +2 -14
- package/schematics/migrations/new-icons-pack/schema.json +3 -3
- package/schematics/migrations/notification-center-signals/{index.js → index.cjs} +5 -4
- package/schematics/migrations/option-signals/index.cjs +20 -0
- package/schematics/migrations/popover-leave-delay/{index.js → index.cjs} +5 -4
- package/schematics/migrations/progress-bar-percentage-and-aria/{index.js → index.cjs} +5 -4
- package/schematics/migrations/progress-spinner-signals/{index.js → index.cjs} +7 -6
- package/schematics/migrations/query-list-signals/index.cjs +18 -0
- package/schematics/migrations/radio-signals-and-aria/{index.js → index.cjs} +9 -8
- package/schematics/migrations/read-state-dwell-handlers/{index.js → index.cjs} +5 -4
- package/schematics/migrations/scrollbar-deprecated-path/{index.js → index.cjs} +4 -3
- package/schematics/migrations/select-signal-inputs/{index.js → index.cjs} +5 -4
- package/schematics/migrations/sidepanel-non-modal-behavior/{index.js → index.cjs} +5 -4
- package/schematics/migrations/signal-inputs-subclasses/index.cjs +18 -0
- package/schematics/migrations/split-button-optional-disabled/{index.js → index.cjs} +5 -4
- package/schematics/migrations/splitter-deprecated-path/{index.js → index.cjs} +4 -3
- package/schematics/migrations/state-saving-default/{index.js → index.cjs} +5 -4
- package/schematics/migrations/table-cell-content/{index.js → index.cjs} +5 -4
- package/schematics/migrations/tabs-signals-and-aria/{index.js → index.cjs} +5 -4
- package/schematics/migrations/tag-list-cleaner/{index.js → index.cjs} +7 -6
- package/schematics/migrations/tag-slots/{index.js → index.cjs} +6 -5
- package/schematics/migrations/tags-signals/{index.js → index.cjs} +7 -6
- package/schematics/migrations/textarea-signals/{index.js → index.cjs} +7 -6
- package/schematics/migrations/time-range-title-for/{index.js → index.cjs} +5 -4
- package/schematics/migrations/timepicker-signals/{index.js → index.cjs} +7 -6
- package/schematics/migrations/timezone-grouping-utils/{index.js → index.cjs} +5 -4
- package/schematics/migrations/title-encapsulation/{index.js → index.cjs} +5 -4
- package/schematics/migrations/toast-stack-and-defaults/{index.js → index.cjs} +5 -4
- package/schematics/migrations/tooltip-pointer-events-and-types/{index.js → index.cjs} +5 -4
- package/schematics/migrations/top-bar-container-selectors/{index.js → index.cjs} +5 -4
- package/schematics/migrations/tree-select-signals/{index.js → index.cjs} +5 -4
- package/schematics/migrations/tree-signals/{index.js → index.cjs} +5 -4
- package/schematics/migrations/tree-state-saving-default/{index.js → index.cjs} +5 -4
- package/schematics/migrations/username-pipe-injection/{index.js → index.cjs} +5 -4
- package/schematics/migrations/v20-upgrade/{data.js → data.cjs} +7 -7
- package/schematics/migrations/v20-upgrade/index.cjs +19 -0
- package/schematics/migrations/v21-upgrade/{data.js → data.cjs} +22 -22
- package/schematics/migrations/v21-upgrade/{index.js → index.cjs} +11 -10
- package/schematics/migrations/zoneless-change-detection/index.cjs +21 -0
- package/schematics/migrations.json +87 -82
- package/schematics/ng-add/{index.js → index.cjs} +15 -289
- package/schematics/utils/{angular-parsing.js → angular-parsing.cjs} +2 -2
- package/schematics/utils/custom-data.cjs +64 -0
- package/schematics/utils/{deprecated-path-migration.js → deprecated-path-migration.cjs} +4 -3
- package/schematics/utils/html-config.cjs +148 -0
- package/schematics/utils/{icon-migration.js → icon-migration.cjs} +11 -5
- package/schematics/utils/list-item-pattern.cjs +16 -0
- package/schematics/utils/{messages.js → messages.cjs} +4 -0
- package/schematics/utils/package-config.cjs +99 -0
- package/schematics/utils/project-files.cjs +25 -0
- package/schematics/utils/replacement-driver.cjs +337 -0
- package/schematics/utils/safe-rule.cjs +23 -0
- package/schematics/utils/signal-members-migration.cjs +779 -0
- package/schematics/utils/tag-patterns.cjs +21 -0
- package/schematics/utils/template-ref-access.cjs +155 -0
- package/schematics/utils/{typescript.js → typescript.cjs} +1 -1
- package/schematics/utils/warn-only-migration.cjs +52 -0
- package/schematics/utils/workspace-styles.cjs +123 -0
- package/select/select.scss +7 -0
- package/tabs/_tabs-common.scss +23 -0
- package/textarea/textarea-tokens.scss +4 -1
- package/toast/toast.component.scss +1 -0
- package/toggle/_toggle-theme.scss +0 -17
- package/tooltip/tooltip.scss +1 -1
- package/top-bar/top-bar-tokens.scss +1 -0
- package/top-bar/top-bar.scss +10 -0
- package/types/koobiq-components-accordion.d.ts +25 -0
- package/types/koobiq-components-button-toggle.d.ts +6 -0
- package/types/koobiq-components-checkbox.d.ts +30 -0
- package/types/koobiq-components-clamped-text.d.ts +16 -3
- package/types/koobiq-components-code-block.d.ts +55 -14
- package/types/koobiq-components-core.d.ts +226 -13
- package/types/koobiq-components-datepicker.d.ts +28 -1
- package/types/koobiq-components-divider.d.ts +28 -10
- package/types/koobiq-components-dropdown.d.ts +19 -0
- package/types/koobiq-components-filter-bar.d.ts +79 -6
- package/types/koobiq-components-flag.d.ts +18 -0
- package/types/koobiq-components-form-field.d.ts +87 -6
- package/types/koobiq-components-icon.d.ts +15 -0
- package/types/koobiq-components-inline-edit.d.ts +8 -1
- package/types/koobiq-components-input.d.ts +22 -3
- package/types/koobiq-components-list.d.ts +6 -0
- package/types/koobiq-components-modal.d.ts +7 -0
- package/types/koobiq-components-navbar.d.ts +71 -7
- package/types/koobiq-components-notification-center.d.ts +13 -0
- package/types/koobiq-components-overflow-items.d.ts +26 -2
- package/types/koobiq-components-popover.d.ts +38 -3
- package/types/koobiq-components-radio.d.ts +30 -0
- package/types/koobiq-components-search-expandable.d.ts +10 -0
- package/types/koobiq-components-select.d.ts +36 -4
- package/types/koobiq-components-sidepanel.d.ts +52 -1
- package/types/koobiq-components-splitter.d.ts +13 -4
- package/types/koobiq-components-tabs.d.ts +4 -0
- package/types/koobiq-components-tags.d.ts +6 -0
- package/types/koobiq-components-textarea.d.ts +9 -2
- package/types/koobiq-components-timepicker.d.ts +15 -0
- package/types/koobiq-components-toggle.d.ts +30 -0
- package/types/koobiq-components-tooltip.d.ts +55 -10
- package/types/koobiq-components-top-bar.d.ts +11 -3
- package/types/koobiq-components-tree-select.d.ts +23 -8
- package/types/koobiq-components-tree.d.ts +144 -60
- package/schematics/migrations/angular-animations-removal/index.js +0 -20
- package/schematics/migrations/color-signals/index.js +0 -19
- package/schematics/migrations/core-mixins-removal/index.js +0 -17
- package/schematics/migrations/datepicker-signals/index.js +0 -17
- package/schematics/migrations/dropdown-signals/index.js +0 -19
- package/schematics/migrations/input-signals/index.js +0 -17
- package/schematics/migrations/list-signals/index.js +0 -17
- package/schematics/migrations/modal-signals/index.js +0 -19
- package/schematics/migrations/option-signals/index.js +0 -19
- package/schematics/migrations/query-list-signals/index.js +0 -17
- package/schematics/migrations/signal-inputs-subclasses/index.js +0 -17
- package/schematics/migrations/v20-upgrade/index.js +0 -18
- package/schematics/migrations/zoneless-change-detection/index.js +0 -20
- package/schematics/utils/package-config.js +0 -13
- /package/schematics/migrations/accordion-state-saving-default/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/actions-panel-overlay-container/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/alert-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/angular-animations-removal/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/app-switcher-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/autocomplete-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/badge-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/button-state-and-styles/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/button-supported-colors/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/button-toggle-signals-and-aria/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/button-truncation/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/checkbox-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/clamped-text-disclosure/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/code-block-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/color-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/core-mixins-removal/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/css-selectors/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/datepicker-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/deprecated-icons/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/divider-signals-and-aria/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/dl-attribute-coercion/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/dl-standalone-names/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/dropdown-demote-overlay/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/dropdown-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/empty-state-error-color/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/file-upload-cva-and-primitives/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/file-upload-deprecated-outputs/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/filter-bar-rename-action/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/filter-bar-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/filter-bar-state-saving-default/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/flag-inner-html/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/form-field-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/icons-replacement/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/inline-edit-a11y-and-types/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/input-number-surface/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/input-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/link-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/list-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/list-tree-multiple-input/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/loader-overlay-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/locale-configuration-providers/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/markdown-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/modal-dialog-semantics/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/modal-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/navbar-signals-and-aria/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/new-icons-pack/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/notification-center-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/option-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/popover-leave-delay/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/progress-bar-percentage-and-aria/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/progress-spinner-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/query-list-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/radio-signals-and-aria/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/read-state-dwell-handlers/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/select-signal-inputs/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/sidepanel-non-modal-behavior/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/signal-inputs-subclasses/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/split-button-optional-disabled/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/state-saving-default/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/table-cell-content/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/tabs-signals-and-aria/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/tag-list-cleaner/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/tags-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/textarea-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/time-range-title-for/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/timepicker-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/timezone-grouping-utils/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/title-encapsulation/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/toast-stack-and-defaults/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/tooltip-pointer-events-and-types/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/top-bar-container-selectors/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/tree-select-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/tree-signals/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/tree-state-saving-default/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/username-pipe-injection/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/zoneless-change-detection/{data.js → data.cjs} +0 -0
- /package/schematics/utils/{ast.js → ast.cjs} +0 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var schematics = require('@angular-devkit/schematics');
|
|
6
|
+
var utility = require('@schematics/angular/utility');
|
|
7
|
+
var ts$1 = require('typescript');
|
|
8
|
+
var utils_messages = require('../../utils/messages.cjs');
|
|
9
|
+
var utils_packageConfig = require('../../utils/package-config.cjs');
|
|
10
|
+
var utils_projectFiles = require('../../utils/project-files.cjs');
|
|
11
|
+
var utils_safeRule = require('../../utils/safe-rule.cjs');
|
|
12
|
+
var migrations_codeBlockHighlightJsCore_data = require('./data.cjs');
|
|
13
|
+
var ts = require('@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript');
|
|
14
|
+
var astUtils = require('@schematics/angular/utility/ast-utils');
|
|
15
|
+
var ngAstUtils = require('@schematics/angular/utility/ng-ast-utils');
|
|
16
|
+
var app_config = require('@schematics/angular/utility/standalone/app_config');
|
|
17
|
+
var util = require('@schematics/angular/utility/standalone/util');
|
|
18
|
+
require('rxjs');
|
|
19
|
+
|
|
20
|
+
// `@schematics/angular`'s own bundled copy of the TypeScript compiler, not the `typescript` package: the nodes its
|
|
21
|
+
// utilities return were created by it, and `SyntaxKind` values differ between versions.
|
|
22
|
+
const nameOf$1 = (node) => {
|
|
23
|
+
if (ts.isIdentifier(node))
|
|
24
|
+
return node.text;
|
|
25
|
+
if (ts.isPropertyAccessExpression(node))
|
|
26
|
+
return node.name.text;
|
|
27
|
+
return undefined;
|
|
28
|
+
};
|
|
29
|
+
const isNamed = (property, name) => !!property.name &&
|
|
30
|
+
(ts.isIdentifier(property.name) || ts.isStringLiteral(property.name)) &&
|
|
31
|
+
property.name.text === name;
|
|
32
|
+
/**
|
|
33
|
+
* The elements of the `providers` of a configuration or `@NgModule`, none when it declares no providers, or `null` when
|
|
34
|
+
* `addRootProvider` cannot add one to them safely: it would declare `providers` a second time next to a value that is
|
|
35
|
+
* not an array literal, leave an `@NgModule` alone, or override the providers of a spread.
|
|
36
|
+
*/
|
|
37
|
+
function providersOf(literal) {
|
|
38
|
+
if (literal.properties.some(ts.isSpreadAssignment))
|
|
39
|
+
return null;
|
|
40
|
+
const providers = literal.properties.find((property) => isNamed(property, 'providers'));
|
|
41
|
+
if (!providers)
|
|
42
|
+
return [];
|
|
43
|
+
return ts.isPropertyAssignment(providers) && ts.isArrayLiteralExpression(providers.initializer)
|
|
44
|
+
? providers.initializer.elements
|
|
45
|
+
: null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The root providers of an application, where `addRootProvider` adds one: `null` when it cannot add one there safely,
|
|
49
|
+
* since it throws on a bootstrap it cannot analyze only after adding the import, and breaks the configuration or does
|
|
50
|
+
* nothing on providers it cannot extend.
|
|
51
|
+
*/
|
|
52
|
+
async function findRootProviders(tree, project) {
|
|
53
|
+
try {
|
|
54
|
+
const mainFilePath = await util.getMainFilePath(tree, project);
|
|
55
|
+
if (ngAstUtils.isStandaloneApp(tree, mainFilePath)) {
|
|
56
|
+
const bootstrapCall = util.findBootstrapApplicationCall(tree, mainFilePath);
|
|
57
|
+
const appConfig = app_config.findAppConfig(bootstrapCall, tree, mainFilePath);
|
|
58
|
+
// Without a configuration it can read, `addRootProvider` adds one to `bootstrapApplication(App)` only.
|
|
59
|
+
if (!appConfig)
|
|
60
|
+
return bootstrapCall.arguments.length === 1 ? [] : null;
|
|
61
|
+
return providersOf(appConfig.node);
|
|
62
|
+
}
|
|
63
|
+
const modulePath = ngAstUtils.getAppModulePath(tree, mainFilePath);
|
|
64
|
+
const [metadata] = astUtils.getDecoratorMetadata(util.getSourceFile(tree, modulePath), 'NgModule', '@angular/core');
|
|
65
|
+
return metadata && ts.isObjectLiteralExpression(metadata) ? providersOf(metadata) : null;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/** Whether a root provider is a highlight.js configuration of the code block. */
|
|
72
|
+
function isHighlightJsConfig(provider) {
|
|
73
|
+
if (ts.isCallExpression(provider))
|
|
74
|
+
return nameOf$1(provider.expression) === migrations_codeBlockHighlightJsCore_data.CONFIG_PROVIDER;
|
|
75
|
+
return (ts.isObjectLiteralExpression(provider) &&
|
|
76
|
+
provider.properties.some((property) => isNamed(property, 'provide') &&
|
|
77
|
+
ts.isPropertyAssignment(property) &&
|
|
78
|
+
nameOf$1(property.initializer) === migrations_codeBlockHighlightJsCore_data.CONFIG_TOKEN));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const LABEL = '[code-block-highlight-js-core]';
|
|
82
|
+
const TS_EXT = '.ts';
|
|
83
|
+
/** Files that render code blocks outside the application, with providers of their own. */
|
|
84
|
+
const TEST_FILE = /\.(spec|test|stories|cy)\.ts$/;
|
|
85
|
+
/** The name of a callee or of a referenced token: `x` for `x` and `ns.x`. */
|
|
86
|
+
const nameOf = (node) => {
|
|
87
|
+
if (ts$1.isIdentifier(node))
|
|
88
|
+
return node.text;
|
|
89
|
+
if (ts$1.isPropertyAccessExpression(node))
|
|
90
|
+
return node.name.text;
|
|
91
|
+
return undefined;
|
|
92
|
+
};
|
|
93
|
+
/** The name of a property, `undefined` for a computed one other than a string literal. */
|
|
94
|
+
const propertyName = (property) => {
|
|
95
|
+
const name = property.name;
|
|
96
|
+
if (!name)
|
|
97
|
+
return undefined;
|
|
98
|
+
if (ts$1.isIdentifier(name) || ts$1.isStringLiteral(name))
|
|
99
|
+
return name.text;
|
|
100
|
+
if (ts$1.isComputedPropertyName(name) && ts$1.isStringLiteralLike(name.expression))
|
|
101
|
+
return name.expression.text;
|
|
102
|
+
return undefined;
|
|
103
|
+
};
|
|
104
|
+
const findProperty = (literal, name) => literal.properties.find((property) => propertyName(property) === name);
|
|
105
|
+
/** The names a file gives to an export of the code block: its own, and those of `import { name as alias }`. */
|
|
106
|
+
function localNames(sourceFile, exported) {
|
|
107
|
+
const names = new Set([exported]);
|
|
108
|
+
for (const statement of sourceFile.statements) {
|
|
109
|
+
if (!ts$1.isImportDeclaration(statement) || !ts$1.isStringLiteral(statement.moduleSpecifier))
|
|
110
|
+
continue;
|
|
111
|
+
if (statement.moduleSpecifier.text !== migrations_codeBlockHighlightJsCore_data.CODE_BLOCK_PACKAGE)
|
|
112
|
+
continue;
|
|
113
|
+
const bindings = statement.importClause?.namedBindings;
|
|
114
|
+
if (!bindings || !ts$1.isNamedImports(bindings))
|
|
115
|
+
continue;
|
|
116
|
+
for (const element of bindings.elements) {
|
|
117
|
+
if ((element.propertyName ?? element.name).text === exported)
|
|
118
|
+
names.add(element.name.text);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return names;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Adds `core: () => import('highlight.js')` to every highlight.js configuration written as an object literal without
|
|
125
|
+
* `core` - the argument of `kbqCodeBlockHighlightJsConfigProvider` and the `useValue` of a provider of
|
|
126
|
+
* `KBQ_CODE_BLOCK_HIGHLIGHT_JS_CONFIG` - since the code block loaded the full bundle for it. A configuration it
|
|
127
|
+
* cannot read, such as a variable, a spread or a factory, is reported rather than guessed at.
|
|
128
|
+
*/
|
|
129
|
+
function migrateSource(content, fileName) {
|
|
130
|
+
const sourceFile = ts$1.createSourceFile(fileName, content, ts$1.ScriptTarget.Latest, true, ts$1.ScriptKind.TS);
|
|
131
|
+
const newline = content.includes('\r\n') ? '\r\n' : '\n';
|
|
132
|
+
const providerNames = localNames(sourceFile, migrations_codeBlockHighlightJsCore_data.CONFIG_PROVIDER);
|
|
133
|
+
const tokenNames = localNames(sourceFile, migrations_codeBlockHighlightJsCore_data.CONFIG_TOKEN);
|
|
134
|
+
const edits = [];
|
|
135
|
+
const unreadLines = [];
|
|
136
|
+
let configs = 0;
|
|
137
|
+
const report = (node) => {
|
|
138
|
+
unreadLines.push(sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1);
|
|
139
|
+
};
|
|
140
|
+
const isToken = (node) => !!node && tokenNames.has(nameOf(node) ?? '');
|
|
141
|
+
const addCore = (config, site) => {
|
|
142
|
+
configs++;
|
|
143
|
+
if (!config || !ts$1.isObjectLiteralExpression(config))
|
|
144
|
+
return report(config ?? site);
|
|
145
|
+
if (findProperty(config, 'core'))
|
|
146
|
+
return;
|
|
147
|
+
// A spread or a computed name may hold `core`.
|
|
148
|
+
if (config.properties.some((property) => ts$1.isSpreadAssignment(property) || !propertyName(property))) {
|
|
149
|
+
return report(config);
|
|
150
|
+
}
|
|
151
|
+
const [first] = config.properties;
|
|
152
|
+
const open = config.getStart() + 1;
|
|
153
|
+
if (!first) {
|
|
154
|
+
const inner = content.slice(open, config.getEnd() - 1);
|
|
155
|
+
if (!inner.trim()) {
|
|
156
|
+
edits.push({ start: config.getStart(), end: config.getEnd(), text: `{ ${migrations_codeBlockHighlightJsCore_data.FULL_BUNDLE_CORE} }` });
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
// A comment is all the literal holds: `core` goes above it.
|
|
160
|
+
const indent = /\n([ \t]*)\S/.exec(inner)?.[1];
|
|
161
|
+
edits.push({
|
|
162
|
+
start: open,
|
|
163
|
+
end: open,
|
|
164
|
+
text: indent === undefined ? ` ${migrations_codeBlockHighlightJsCore_data.FULL_BUNDLE_CORE}` : `${newline}${indent}${migrations_codeBlockHighlightJsCore_data.FULL_BUNDLE_CORE}`
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
// Above the comments of the first property, which describe it.
|
|
170
|
+
const [comment] = ts$1.getLeadingCommentRanges(content, first.getFullStart()) ?? [];
|
|
171
|
+
const start = comment?.pos ?? first.getStart();
|
|
172
|
+
const indent = content.slice(content.lastIndexOf('\n', start - 1) + 1, start);
|
|
173
|
+
const separator = /^[ \t]*$/.test(indent) ? `,${newline}${indent}` : ', ';
|
|
174
|
+
edits.push({ start, end: start, text: migrations_codeBlockHighlightJsCore_data.FULL_BUNDLE_CORE + separator });
|
|
175
|
+
};
|
|
176
|
+
// The `useValue` of a provider object; `TestBed.overrideProvider` takes one without `provide`.
|
|
177
|
+
const addCoreToProvider = (provider, site) => {
|
|
178
|
+
const useValue = provider && ts$1.isObjectLiteralExpression(provider) && findProperty(provider, 'useValue');
|
|
179
|
+
addCore(useValue && ts$1.isPropertyAssignment(useValue) ? useValue.initializer : undefined, site);
|
|
180
|
+
};
|
|
181
|
+
const visit = (node) => {
|
|
182
|
+
if (ts$1.isCallExpression(node)) {
|
|
183
|
+
const callee = nameOf(node.expression);
|
|
184
|
+
if (callee && providerNames.has(callee)) {
|
|
185
|
+
addCore(node.arguments[0], node);
|
|
186
|
+
}
|
|
187
|
+
else if (callee === 'overrideProvider' && isToken(node.arguments[0])) {
|
|
188
|
+
addCoreToProvider(node.arguments[1], node);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
else if (ts$1.isObjectLiteralExpression(node)) {
|
|
192
|
+
const provide = findProperty(node, 'provide');
|
|
193
|
+
if (provide && ts$1.isPropertyAssignment(provide) && isToken(provide.initializer)) {
|
|
194
|
+
addCoreToProvider(node, node);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
ts$1.forEachChild(node, visit);
|
|
198
|
+
};
|
|
199
|
+
visit(sourceFile);
|
|
200
|
+
let result = content;
|
|
201
|
+
for (const { start, end, text } of edits.sort((a, b) => b.start - a.start)) {
|
|
202
|
+
result = result.slice(0, start) + text + result.slice(end);
|
|
203
|
+
}
|
|
204
|
+
return { content: result, changed: result !== content, unreadLines, configs };
|
|
205
|
+
}
|
|
206
|
+
/** The directory of a project's sources, as the paths `visitProjectFiles` passes start: `/src`, or `/` for the root. */
|
|
207
|
+
const sourceDir = (project) => `/${(project.sourceRoot ?? project.root).replace(/^\/+|\/+$/g, '')}`;
|
|
208
|
+
const isInside = (path, dir) => dir === '/' || path.startsWith(`${dir}/`);
|
|
209
|
+
const fullBundleProviderRule = (project) => utility.addRootProvider(project, ({ code, external }) => {
|
|
210
|
+
const provider = external(migrations_codeBlockHighlightJsCore_data.CONFIG_PROVIDER, migrations_codeBlockHighlightJsCore_data.CODE_BLOCK_PACKAGE);
|
|
211
|
+
return code `${provider}({ ${migrations_codeBlockHighlightJsCore_data.FULL_BUNDLE_CORE} })`;
|
|
212
|
+
});
|
|
213
|
+
/**
|
|
214
|
+
* Keeps the full highlight.js bundle where the code block loaded it by default: in the root providers of an
|
|
215
|
+
* application that renders code blocks with no configuration there, and in every configuration without `core`.
|
|
216
|
+
*/
|
|
217
|
+
function codeBlockHighlightJsCore(options) {
|
|
218
|
+
return async (tree, context) => {
|
|
219
|
+
// `ng update` invokes migrations with no options at all, and migrations.json declares no schema, so the
|
|
220
|
+
// schema default never reaches us - applying the fix is the intended behaviour there.
|
|
221
|
+
const fix = options.fix ?? true;
|
|
222
|
+
const projectDefinition = await utils_packageConfig.setupOptions(options.project, tree);
|
|
223
|
+
// The source root rather than the root: the root of the first application can be the workspace root.
|
|
224
|
+
const rootDir = projectDefinition ? tree.getDir(sourceDir(projectDefinition)) : tree.root;
|
|
225
|
+
const providerRules = [];
|
|
226
|
+
let projects = [];
|
|
227
|
+
let consumers = 0;
|
|
228
|
+
let touched = 0;
|
|
229
|
+
try {
|
|
230
|
+
const workspace = await utility.readWorkspace(tree);
|
|
231
|
+
projects = [...workspace.projects].map(([name, definition]) => ({
|
|
232
|
+
name,
|
|
233
|
+
definition,
|
|
234
|
+
dir: sourceDir(definition)
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
// The configurations are migrated all the same.
|
|
239
|
+
utils_messages.logMessage(context.logger, [LABEL, ...migrations_codeBlockHighlightJsCore_data.noWorkspaceMessage()]);
|
|
240
|
+
}
|
|
241
|
+
const usingCodeBlock = new Set();
|
|
242
|
+
const configured = new Set();
|
|
243
|
+
utils_projectFiles.visitProjectFiles(rootDir, (filePath, entry) => {
|
|
244
|
+
if (!filePath.endsWith(TS_EXT))
|
|
245
|
+
return;
|
|
246
|
+
// The innermost project: one whose sources sit at the workspace root holds the others too.
|
|
247
|
+
const containing = projects.filter(({ dir }) => isInside(filePath, dir));
|
|
248
|
+
const depth = Math.max(...containing.map(({ dir }) => dir.length));
|
|
249
|
+
const owners = containing.filter(({ dir }) => dir.length === depth).map(({ name }) => name);
|
|
250
|
+
if (options.project && !owners.includes(options.project))
|
|
251
|
+
return;
|
|
252
|
+
const original = entry.content.toString();
|
|
253
|
+
const isTest = TEST_FILE.test(filePath);
|
|
254
|
+
if (!isTest && original.includes(migrations_codeBlockHighlightJsCore_data.CODE_BLOCK_PACKAGE))
|
|
255
|
+
owners.forEach((name) => usingCodeBlock.add(name));
|
|
256
|
+
if (!original.includes(migrations_codeBlockHighlightJsCore_data.CONFIG_PROVIDER) && !original.includes(migrations_codeBlockHighlightJsCore_data.CONFIG_TOKEN))
|
|
257
|
+
return;
|
|
258
|
+
const { content, changed, unreadLines, configs } = migrateSource(original, filePath);
|
|
259
|
+
if (!isTest && configs)
|
|
260
|
+
owners.forEach((name) => configured.add(name));
|
|
261
|
+
for (const line of unreadLines) {
|
|
262
|
+
utils_messages.logMessage(context.logger, [`${LABEL} ${filePath}`, ` ${migrations_codeBlockHighlightJsCore_data.unreadConfigMessage(line)}`]);
|
|
263
|
+
}
|
|
264
|
+
if (!changed)
|
|
265
|
+
return;
|
|
266
|
+
touched++;
|
|
267
|
+
if (fix) {
|
|
268
|
+
tree.overwrite(filePath, content);
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
utils_messages.logMessage(context.logger, [`${LABEL} would update ${filePath} (run with --fix to apply)`]);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
for (const { name, definition } of projects) {
|
|
275
|
+
if (!usingCodeBlock.has(name) || (options.project && name !== options.project))
|
|
276
|
+
continue;
|
|
277
|
+
consumers++;
|
|
278
|
+
if (definition.extensions['projectType'] !== 'application') {
|
|
279
|
+
if (!configured.has(name))
|
|
280
|
+
utils_messages.logMessage(context.logger, [LABEL, ...migrations_codeBlockHighlightJsCore_data.libraryMessage(name)]);
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
const rootProviders = await findRootProviders(tree, name);
|
|
284
|
+
if (!rootProviders) {
|
|
285
|
+
utils_messages.logMessage(context.logger, [LABEL, ...migrations_codeBlockHighlightJsCore_data.rootProviderFallback(name)]);
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
// A configuration in the root providers reaches every code block, and has its `core` by now.
|
|
289
|
+
if (rootProviders.some(isHighlightJsConfig))
|
|
290
|
+
continue;
|
|
291
|
+
const messages = [
|
|
292
|
+
...migrations_codeBlockHighlightJsCore_data.addedRootProviderMessage(name, fix),
|
|
293
|
+
...(configured.has(name) ? migrations_codeBlockHighlightJsCore_data.otherConfigsMessage(name) : [])
|
|
294
|
+
];
|
|
295
|
+
if (!fix) {
|
|
296
|
+
utils_messages.logMessage(context.logger, [LABEL, ...messages]);
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
providerRules.push(utils_safeRule.safeRule(schematics.chain([
|
|
300
|
+
fullBundleProviderRule(name),
|
|
301
|
+
(_, ruleContext) => utils_messages.logMessage(ruleContext.logger, [LABEL, ...messages])
|
|
302
|
+
]), migrations_codeBlockHighlightJsCore_data.rootProviderFallback(name)));
|
|
303
|
+
}
|
|
304
|
+
// Nothing here renders code blocks, so the summary would only be noise.
|
|
305
|
+
if (!consumers && !touched)
|
|
306
|
+
return;
|
|
307
|
+
// After the root providers, which say what they added only once it is there.
|
|
308
|
+
return schematics.chain([
|
|
309
|
+
...providerRules,
|
|
310
|
+
(_, ruleContext) => utils_messages.logMessage(ruleContext.logger, [
|
|
311
|
+
`${LABEL} ${fix ? 'updated' : 'would update'} ${touched} highlight.js configuration file(s).`,
|
|
312
|
+
...migrations_codeBlockHighlightJsCore_data.SUMMARY
|
|
313
|
+
])
|
|
314
|
+
]);
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
exports.default = codeBlockHighlightJsCore;
|
|
319
|
+
exports.migrateSource = migrateSource;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "koobiq-components-code-block-highlight-js-core",
|
|
4
|
+
"title": "Koobiq components code block highlight.js core migration",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"project": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Name of the project to migrate. If omitted, the migration runs over the whole tree.",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "projectName"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"fix": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": true,
|
|
17
|
+
"description": "When true, applies the rewrites. When false, prints what would change without writing."
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var ts = require('typescript');
|
|
6
|
-
var utils_ast = require('../../utils/ast.
|
|
7
|
-
var utils_messages = require('../../utils/messages.
|
|
8
|
-
var utils_packageConfig = require('../../package-config
|
|
9
|
-
var
|
|
10
|
-
var
|
|
6
|
+
var utils_ast = require('../../utils/ast.cjs');
|
|
7
|
+
var utils_messages = require('../../utils/messages.cjs');
|
|
8
|
+
var utils_packageConfig = require('../../utils/package-config.cjs');
|
|
9
|
+
var utils_projectFiles = require('../../utils/project-files.cjs');
|
|
10
|
+
var utils_typescript = require('../../utils/typescript.cjs');
|
|
11
|
+
var migrations_codeBlockSignals_data = require('./data.cjs');
|
|
11
12
|
require('@angular-devkit/schematics');
|
|
12
13
|
require('@schematics/angular/utility');
|
|
13
14
|
|
|
@@ -627,7 +628,7 @@ function codeBlockSignals(options) {
|
|
|
627
628
|
const rootDir = root ? tree.getDir(root) : tree.root;
|
|
628
629
|
const tsPaths = [];
|
|
629
630
|
const htmlPaths = [];
|
|
630
|
-
|
|
631
|
+
utils_projectFiles.visitProjectFiles(rootDir, (filePath) => {
|
|
631
632
|
if (filePath.endsWith(TS_EXT))
|
|
632
633
|
tsPaths.push(filePath);
|
|
633
634
|
else if (filePath.endsWith(HTML_EXT))
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var utils_signalMembersMigration = require('../../utils/signal-members-migration.cjs');
|
|
6
|
+
var migrations_colorSignals_data = require('./data.cjs');
|
|
7
|
+
require('typescript');
|
|
8
|
+
require('../../utils/ast.cjs');
|
|
9
|
+
require('../../utils/messages.cjs');
|
|
10
|
+
require('../../utils/package-config.cjs');
|
|
11
|
+
require('@angular-devkit/schematics');
|
|
12
|
+
require('@schematics/angular/utility');
|
|
13
|
+
require('../../utils/project-files.cjs');
|
|
14
|
+
require('../../utils/typescript.cjs');
|
|
15
|
+
|
|
16
|
+
function colorSignals(options) {
|
|
17
|
+
return utils_signalMembersMigration.signalMembersRule(migrations_colorSignals_data.config, options);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.default = colorSignals;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var utils_warnOnlyMigration = require('../../utils/warn-only-migration.cjs');
|
|
6
|
+
var migrations_coreMixinsRemoval_data = require('./data.cjs');
|
|
7
|
+
require('../../utils/messages.cjs');
|
|
8
|
+
require('../../utils/package-config.cjs');
|
|
9
|
+
require('@angular-devkit/schematics');
|
|
10
|
+
require('@schematics/angular/utility');
|
|
11
|
+
require('../../utils/project-files.cjs');
|
|
12
|
+
|
|
13
|
+
/** Reports the uses of the removed `mixinDisabled` and `mixinTabIndex`. Never writes. */
|
|
14
|
+
function coreMixinsRemoval(options) {
|
|
15
|
+
return utils_warnOnlyMigration.warnOnlyRule({ label: '[core-mixins-removal]', warnPatterns: migrations_coreMixinsRemoval_data.warnPatterns, summary: migrations_coreMixinsRemoval_data.SUMMARY }, options);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.default = coreMixinsRemoval;
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var path = require('path');
|
|
6
|
-
var utils_packageConfig = require('../../package-config
|
|
7
|
-
var migrations_cssSelectors_data = require('./data.
|
|
6
|
+
var utils_packageConfig = require('../../utils/package-config.cjs');
|
|
7
|
+
var migrations_cssSelectors_data = require('./data.cjs');
|
|
8
8
|
require('@angular-devkit/schematics');
|
|
9
9
|
require('@schematics/angular/utility');
|
|
10
|
-
require('../../utils/messages.
|
|
10
|
+
require('../../utils/messages.cjs');
|
|
11
|
+
require('../../utils/project-files.cjs');
|
|
11
12
|
|
|
12
13
|
function _interopNamespaceDefault(e) {
|
|
13
14
|
var n = Object.create(null);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var utils_warnOnlyMigration = require('../../utils/warn-only-migration.cjs');
|
|
6
|
+
var migrations_datepickerSignals_data = require('./data.cjs');
|
|
7
|
+
require('../../utils/messages.cjs');
|
|
8
|
+
require('../../utils/package-config.cjs');
|
|
9
|
+
require('@angular-devkit/schematics');
|
|
10
|
+
require('@schematics/angular/utility');
|
|
11
|
+
require('../../utils/project-files.cjs');
|
|
12
|
+
|
|
13
|
+
/** Reports subclasses of the datepicker classes and direct calls of their `ngOnChanges`. Never writes. */
|
|
14
|
+
function datepickerSignals(options) {
|
|
15
|
+
return utils_warnOnlyMigration.warnOnlyRule({ label: '[datepicker-signals]', warnPatterns: migrations_datepickerSignals_data.warnPatterns, summary: migrations_datepickerSignals_data.SUMMARY }, options);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.default = datepickerSignals;
|
|
@@ -22,12 +22,24 @@ word/selector-boundary-safe regex rather than real selector parsing — this cor
|
|
|
22
22
|
directly preceded by `.`, like a real class selector), but a genuine selector spelled out inside a comment is
|
|
23
23
|
still indistinguishable from one that isn't and can still be rewritten.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
On an element without an icon directive, the bare `pt-icons` class is renamed to `kbq`, the base class of the
|
|
26
|
+
icon font, so an icon written with classes alone keeps its styles. On an element with `kbq-icon`,
|
|
27
|
+
`kbq-icon-button` or `kbq-icon-item` (plain, bound or valueless) the class is dropped, since the directive adds
|
|
28
|
+
`kbq` itself:
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<!-- before -->
|
|
32
|
+
<i class="pt-icons pt-icons-comment_16 layout-margin-right-s"></i>
|
|
33
|
+
<i kbq-icon="pt-icons-comment_16" class="pt-icons layout-margin-right-s"></i>
|
|
34
|
+
<!-- after -->
|
|
35
|
+
<i class="kbq kbq-message_16 layout-margin-right-s"></i>
|
|
36
|
+
<i kbq-icon="kbq-message_16" class="layout-margin-right-s"></i>
|
|
37
|
+
```
|
|
26
38
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
A `[class.pt-icons]` binding follows the same rule: dropped on an icon directive's element, `[class.kbq]`
|
|
40
|
+
elsewhere. Outside templates, where there is no element to look at, the class is renamed: a component's
|
|
41
|
+
`host` class, a string literal (`'pt-icons word-wrap_16'` becomes `'kbq wrap-text_16'`) and a stylesheet
|
|
42
|
+
selector.
|
|
31
43
|
|
|
32
44
|
`fix: false` (the default) never mutates any file — it only reports what it found.
|
|
33
45
|
|
|
@@ -37,8 +49,12 @@ Usage for Angular Cli:
|
|
|
37
49
|
|
|
38
50
|
```shell
|
|
39
51
|
ng g @koobiq/components:deprecated-icons --fix=true --project "<your project>"
|
|
52
|
+
ng g @koobiq/components:deprecated-icons --fix=true --project ./libs
|
|
40
53
|
```
|
|
41
54
|
|
|
55
|
+
`--project` takes a project name or a folder; without it the whole workspace is migrated. `node_modules` and
|
|
56
|
+
`dist` are always skipped.
|
|
57
|
+
|
|
42
58
|
Usage for Nx:
|
|
43
59
|
|
|
44
60
|
```shell
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var path = require('path');
|
|
6
|
-
var utils_angularParsing = require('../../utils/angular-parsing.
|
|
7
|
-
var utils_iconMigration = require('../../utils/icon-migration.
|
|
8
|
-
var utils_messages = require('../../utils/messages.
|
|
9
|
-
var utils_packageConfig = require('../../package-config
|
|
10
|
-
var
|
|
6
|
+
var utils_angularParsing = require('../../utils/angular-parsing.cjs');
|
|
7
|
+
var utils_iconMigration = require('../../utils/icon-migration.cjs');
|
|
8
|
+
var utils_messages = require('../../utils/messages.cjs');
|
|
9
|
+
var utils_packageConfig = require('../../utils/package-config.cjs');
|
|
10
|
+
var utils_projectFiles = require('../../utils/project-files.cjs');
|
|
11
|
+
var migrations_deprecatedIcons_data = require('./data.cjs');
|
|
11
12
|
require('typescript');
|
|
12
|
-
require('../../utils/ast.
|
|
13
|
-
require('../../utils/typescript.
|
|
13
|
+
require('../../utils/ast.cjs');
|
|
14
|
+
require('../../utils/typescript.cjs');
|
|
14
15
|
require('@angular-devkit/schematics');
|
|
15
16
|
require('@schematics/angular/utility');
|
|
16
17
|
|
|
@@ -37,30 +38,20 @@ const iconsFontImportRule = "@use '@koobiq/icons/fonts/kbq-icons';";
|
|
|
37
38
|
const migrationData = {
|
|
38
39
|
valueAttrs: ['kbq-icon', 'kbq-icon-item', 'kbq-icon-button'],
|
|
39
40
|
scope: migrations_deprecatedIcons_data.scope,
|
|
40
|
-
scopeClassInList: '
|
|
41
|
+
scopeClassInList: 'rename',
|
|
42
|
+
scopeClassOnIconHost: 'remove',
|
|
41
43
|
icons: migrations_deprecatedIcons_data.iconsMapping.map(({ replace, replaceWith }) => ({ from: replace, to: replaceWith })),
|
|
42
44
|
rescopeUnknownValues: true
|
|
43
45
|
};
|
|
44
46
|
function deprecatedIcons(options) {
|
|
45
|
-
let targetDir;
|
|
46
47
|
return async (tree, context) => {
|
|
47
48
|
const { project, fix, stylesExt } = options;
|
|
48
|
-
|
|
49
|
-
const projectDefinition = await utils_packageConfig.setupOptions(project, tree);
|
|
50
|
-
targetDir = projectDefinition ? tree.getDir(projectDefinition.root) : tree;
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
targetDir = tree;
|
|
54
|
-
}
|
|
49
|
+
const targetDir = await utils_packageConfig.resolveTargetDir(project, tree);
|
|
55
50
|
const { logger } = context;
|
|
56
51
|
const tokenMap = utils_iconMigration.buildIconTokenMap(migrationData);
|
|
57
|
-
// Unlike a `class` list (where the bare scope token is simply dropped, e.g.
|
|
58
|
-
// `class="pt-icons"` -> `class=""`), a stylesheet selector renames the scope class itself
|
|
59
|
-
// (e.g. `.pt-icons` -> `.kbq`) rather than removing it.
|
|
60
|
-
const styleTokenMap = new Map(tokenMap).set(migrationData.scope.from, migrationData.scope.to);
|
|
61
52
|
// Precompiled once and reused across every .ts/style file below, instead of rebuilding
|
|
62
53
|
// every regex per file.
|
|
63
|
-
const stylePatterns = utils_iconMigration.buildIconTokenPatterns(
|
|
54
|
+
const stylePatterns = utils_iconMigration.buildIconTokenPatterns(tokenMap, migrationData.scope.from);
|
|
64
55
|
const onFound = (filePath, found) => {
|
|
65
56
|
const parsedFilePath = path__namespace.relative(__dirname, `.${filePath}`).replace(/\\/g, '/');
|
|
66
57
|
utils_messages.logMessage(logger, [
|
|
@@ -73,11 +64,7 @@ function deprecatedIcons(options) {
|
|
|
73
64
|
const templatePaths = [];
|
|
74
65
|
const tsPaths = [];
|
|
75
66
|
const stylePaths = [];
|
|
76
|
-
|
|
77
|
-
targetDir.visit((filePath) => {
|
|
78
|
-
if (filePath.includes('node_modules') || filePath.includes('/dist/')) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
67
|
+
utils_projectFiles.visitProjectFiles(targetDir, (filePath) => {
|
|
81
68
|
if (filePath.endsWith('.html')) {
|
|
82
69
|
templatePaths.push(filePath);
|
|
83
70
|
}
|
|
@@ -109,8 +96,8 @@ function deprecatedIcons(options) {
|
|
|
109
96
|
}
|
|
110
97
|
}
|
|
111
98
|
// check if icon styles from new scope should be included in styles file
|
|
112
|
-
|
|
113
|
-
if (filePath.endsWith(stylesExt) && !entry
|
|
99
|
+
utils_projectFiles.visitProjectFiles(targetDir, (filePath, entry) => {
|
|
100
|
+
if (filePath.endsWith(stylesExt) && !entry.content.toString()?.includes(iconsFontImportRule)) {
|
|
114
101
|
const parsedFilePath = path__namespace.relative(__dirname, `.${filePath}`).replace(/\\/g, '/');
|
|
115
102
|
utils_messages.logMessage(logger, [
|
|
116
103
|
parsedFilePath,
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tasks = require('@angular-devkit/schematics/tasks');
|
|
6
|
-
var utils_messages = require('../../utils/messages.
|
|
7
|
-
var utils_packageConfig = require('../../package-config
|
|
6
|
+
var utils_messages = require('../../utils/messages.cjs');
|
|
7
|
+
var utils_packageConfig = require('../../utils/package-config.cjs');
|
|
8
8
|
require('@angular-devkit/schematics');
|
|
9
9
|
require('@schematics/angular/utility');
|
|
10
|
+
require('../../utils/project-files.cjs');
|
|
10
11
|
|
|
11
12
|
const PACKAGE = '@koobiq/design-tokens';
|
|
12
13
|
/** Writes `version` over the entry the project already has, wherever it declared it. */
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var ts = require('typescript');
|
|
6
|
-
var utils_messages = require('../../utils/messages.
|
|
7
|
-
var utils_packageConfig = require('../../package-config
|
|
8
|
-
var
|
|
6
|
+
var utils_messages = require('../../utils/messages.cjs');
|
|
7
|
+
var utils_packageConfig = require('../../utils/package-config.cjs');
|
|
8
|
+
var utils_projectFiles = require('../../utils/project-files.cjs');
|
|
9
|
+
var migrations_dividerSignalsAndAria_data = require('./data.cjs');
|
|
9
10
|
require('@angular-devkit/schematics');
|
|
10
11
|
require('@schematics/angular/utility');
|
|
11
12
|
|
|
@@ -183,7 +184,7 @@ function dividerSignalsAndAria(options) {
|
|
|
183
184
|
const rootDir = root ? tree.getDir(root) : tree.root;
|
|
184
185
|
let consumers = 0;
|
|
185
186
|
let reported = 0;
|
|
186
|
-
|
|
187
|
+
utils_projectFiles.visitProjectFiles(rootDir, (filePath, entry) => {
|
|
187
188
|
const isTs = filePath.endsWith(TS_EXT);
|
|
188
189
|
const isHtml = filePath.endsWith(HTML_EXT);
|
|
189
190
|
if (!isTs && !isHtml)
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var ts = require('typescript');
|
|
6
|
-
var utils_ast = require('../../utils/ast.
|
|
7
|
-
var utils_messages = require('../../utils/messages.
|
|
8
|
-
var utils_packageConfig = require('../../package-config
|
|
9
|
-
var
|
|
10
|
-
var
|
|
6
|
+
var utils_ast = require('../../utils/ast.cjs');
|
|
7
|
+
var utils_messages = require('../../utils/messages.cjs');
|
|
8
|
+
var utils_packageConfig = require('../../utils/package-config.cjs');
|
|
9
|
+
var utils_projectFiles = require('../../utils/project-files.cjs');
|
|
10
|
+
var utils_typescript = require('../../utils/typescript.cjs');
|
|
11
|
+
var migrations_dlAttributeCoercion_data = require('./data.cjs');
|
|
11
12
|
require('@angular-devkit/schematics');
|
|
12
13
|
require('@schematics/angular/utility');
|
|
13
14
|
|
|
@@ -126,7 +127,7 @@ function dlAttributeCoercion(options) {
|
|
|
126
127
|
const root = projectDefinition?.root ?? '';
|
|
127
128
|
const rootDir = root ? tree.getDir(root) : tree.root;
|
|
128
129
|
const paths = [];
|
|
129
|
-
|
|
130
|
+
utils_projectFiles.visitProjectFiles(rootDir, (filePath) => {
|
|
130
131
|
if (filePath.endsWith(TS_EXT) || filePath.endsWith(HTML_EXT))
|
|
131
132
|
paths.push(filePath);
|
|
132
133
|
});
|