From c294c82c6d6ab9ddc93a0f5c444c6f8ee7d05ba8 Mon Sep 17 00:00:00 2001 From: Vladimir Potekhin <46284632+vladimirpotekhin@users.noreply.github.com> Date: Wed, 28 Jun 2023 15:48:38 +0300 Subject: [PATCH 1/3] fix(addon-table): fix z-index for 2-dimensional sticky tables (#4796) --- projects/addon-table/components/table/th/th.style.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/addon-table/components/table/th/th.style.less b/projects/addon-table/components/table/th/th.style.less index 130bba719494..d5e4fbec9a67 100644 --- a/projects/addon-table/components/table/th/th.style.less +++ b/projects/addon-table/components/table/th/th.style.less @@ -20,7 +20,8 @@ border-left: none; } - &._sticky { + &._sticky, + :host-context(._stuck) &._sticky { position: sticky; z-index: 30; From c0d2bfb5a362f5cb5c76eb5e7f3c7e87f69a13dd Mon Sep 17 00:00:00 2001 From: Vladimir Potekhin <46284632+vladimirpotekhin@users.noreply.github.com> Date: Wed, 28 Jun 2023 15:50:58 +0300 Subject: [PATCH 2/3] fix(cdk): `ng-add` fix adding providers in standalone app with config (nx 16+ default) (#4794) --- .../ng-add/steps/add-taiga-modules.ts | 20 +++++- .../tests/schematic-ng-add-standalone.spec.ts | 61 +++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/projects/cdk/schematics/ng-add/steps/add-taiga-modules.ts b/projects/cdk/schematics/ng-add/steps/add-taiga-modules.ts index b5b55cdb2ab2..c365343fbfed 100644 --- a/projects/cdk/schematics/ng-add/steps/add-taiga-modules.ts +++ b/projects/cdk/schematics/ng-add/steps/add-taiga-modules.ts @@ -9,11 +9,13 @@ import { ClassDeclaration, createProject, getMainModule, + Identifier, Node, ObjectLiteralExpression, PropertyAssignment, saveActiveProject, setActiveProject, + SyntaxKind, } from 'ng-morph'; import {ALL_FILES} from '../../constants'; @@ -145,9 +147,13 @@ function addTuiEntitiesToStandalone({ const mainClass = getComponentFromIdentifier(rootComponentIdentifier); + const optionsObject = getOptionsObject( + bootstrapOptions as Identifier | ObjectLiteralExpression, + ); + if (mainClass) { addMainModuleToRootComponent({mainClass, options, context}); - addRootTuiProvidersToBootstrapFn(bootstrapOptions as ObjectLiteralExpression); + addRootTuiProvidersToBootstrapFn(optionsObject); addExtraTuiProvidersToRootComponent({mainClass, options, standalone: true}); } } @@ -230,3 +236,15 @@ function getModules( ...(options.addAlertModule ? ALERT_MODULES : []), ]; } + +function getOptionsObject( + options: Identifier | ObjectLiteralExpression, +): ObjectLiteralExpression { + if (Node.isObjectLiteralExpression(options)) { + return options; + } + + const definition = options.getDefinitionNodes()[0]; + + return definition.getChildrenOfKind(SyntaxKind.ObjectLiteralExpression)[0]; +} diff --git a/projects/cdk/schematics/ng-add/tests/schematic-ng-add-standalone.spec.ts b/projects/cdk/schematics/ng-add/tests/schematic-ng-add-standalone.spec.ts index b8520ed31a8e..d192421e45f8 100644 --- a/projects/cdk/schematics/ng-add/tests/schematic-ng-add-standalone.spec.ts +++ b/projects/cdk/schematics/ng-add/tests/schematic-ng-add-standalone.spec.ts @@ -334,6 +334,34 @@ bootstrapApplication(AppComponent, { `); }); + it(`[Standalone] Should add main providers to bootstrap fn (appConfig)`, async () => { + createMainWithConfig(); + saveActiveProject(); + + const tree = await runner + .runSchematicAsync( + `ng-add-setup-project`, + {'skip-logs': process.env[`TUI_CI`] === `true`} as Partial, + host, + ) + .toPromise(); + + expect(tree.readContent(`test/app/app.config.ts`)) + .toEqual(`import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { TuiRootModule } from "@taiga-ui/core"; + +import { ApplicationConfig, importProvidersFrom } from '@angular/core'; +import { + provideRouter, + withEnabledBlockingInitialNavigation, +} from '@angular/router'; +import { appRoutes } from './app.routes'; + +export const appConfig: ApplicationConfig = { + providers: [provideRouter(appRoutes, withEnabledBlockingInitialNavigation()), importProvidersFrom(TuiRootModule, BrowserAnimationsModule)], +};`); + }); + afterEach(() => { resetActiveProject(); }); @@ -375,3 +403,36 @@ export class AppComponent { createSourceFile(`test/app/app.template.html`, ``); } + +function createMainWithConfig(): void { + createSourceFile( + `test/main.ts`, + `import { bootstrapApplication } from '@angular/platform-browser'; +import { + provideRouter, + withEnabledBlockingInitialNavigation, +} from '@angular/router'; +import { appRoutes } from './app/app.routes'; +import { AppComponent } from './app/app.component'; +import { appConfig } from './app/app.config'; + +bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err)); +`, + {overwrite: true}, + ); + + createSourceFile( + `test/app/app.config.ts`, + ` +import { ApplicationConfig } from '@angular/core'; +import { + provideRouter, + withEnabledBlockingInitialNavigation, +} from '@angular/router'; +import { appRoutes } from './app.routes'; + +export const appConfig: ApplicationConfig = { + providers: [provideRouter(appRoutes, withEnabledBlockingInitialNavigation())], +};`, + ); +} From c8df8d89cf6a8afc2138c25ab06973976debecc0 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Wed, 28 Jun 2023 16:42:48 +0300 Subject: [PATCH 3/3] fix(addon-editor): blinking caret doesn't appear in first item in list (#4785) --- .cspell.json | 1 + .../components/editor-socket/styles/list.less | 7 +++++-- .../demo-integrations/cypress/support/editor/html.ts | 2 ++ .../cypress/tests/addon-editor/editor-api.cy.ts | 10 ++++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.cspell.json b/.cspell.json index 54dd4d177d3d..dc93b9f5eb32 100644 --- a/.cspell.json +++ b/.cspell.json @@ -29,6 +29,7 @@ "**/cspell/**", "**/assets/**", "**/node_modules/**", + "**/support/editor/html.ts", "*.{log,svg,snap,png,ogv,yml}", "**/projects/i18n/languages/**" ] diff --git a/projects/addon-editor/components/editor-socket/styles/list.less b/projects/addon-editor/components/editor-socket/styles/list.less index e956511fd1b7..b5887c85ca4b 100644 --- a/projects/addon-editor/components/editor-socket/styles/list.less +++ b/projects/addon-editor/components/editor-socket/styles/list.less @@ -18,7 +18,7 @@ li > p { } ul li > p { - display: inline-block; + display: block; } li:before { @@ -40,6 +40,7 @@ ul > li:before { background-color: var(--tui-primary); vertical-align: top; box-sizing: border-box; + float: left; } li ul > li:before { @@ -60,9 +61,11 @@ ol { ol > li:before { content: counters(item, '.') '.'; - width: 1.5rem; + display: block; margin: 0 0.75rem 0 -1.5rem; counter-increment: item; color: var(--tui-base-05); vertical-align: top; + float: left; + white-space: nowrap; } diff --git a/projects/demo-integrations/cypress/support/editor/html.ts b/projects/demo-integrations/cypress/support/editor/html.ts index 55e9afdcdc81..018aace48010 100644 --- a/projects/demo-integrations/cypress/support/editor/html.ts +++ b/projects/demo-integrations/cypress/support/editor/html.ts @@ -16,6 +16,8 @@ export const HTML_EDITOR_EXAMPLE_TABLE = `

<%2Fp>
  • 1
    • 2
      • 3
      • 4
  • 5
    1. 1
      1. 2
        1. 3
        2. 4
    2. 5
    `; +export const HTML_EDITOR_EXAMPLE_NESTED_UL_OL = `
    1. Lorem ipsu

      • ipsimk12j3j12j3i1j2'3lj;1i2oj3;o12ij3op12;ji3po12;ij3o1;2j3o12j3oi1j23oi1j2io3j12oj3o1i2j3oi12j3oi1j23oi1j23oij12oi3j12oi3j1oi2j3oi1i2j3io1j23oij123oj12o3j1o2j3o1i2j3oi12j3oi12j3

        • Hello

          1. 121212121212312eqlwjdjqwejqiwejqwijeoiqwjeoiqjweoijqwoiejqwoiejoqiwjeoiqwjeoiqjwejqwiojeoiqwjeoiqwjeoiqwjeoiqjwoiejqw

          2. 13jahdoasdqwdjqwpejpqwjepjqwpoejqpowjepoqwjepoqjwepojqwopejqwpoejqpowjeqowjeopqwjepoqwje123123jo12ij3oi12jo3kl123

            1. 121231231;lje;kqjhs;dklqs

              1. 123123ijo

                1. 23

                2. 123123123123123123123123mklna;sdasd

                3. 123123123

                4. 123123

                5. 123

                6. 123

                7. 12

                8. 3

                  1. 123

                    1. 213

                      1. 123312

                      2. 1232

        • 123123123
          123123j['2
          123k123

      • 123123123
        !23213123123123

    2. 123

    3. 2

    4. 32

      1. 123312

      2. 23

      3. 23

      4. 213123123

      5. 12312312312

      6. 3

      7. 123

      8. 12

      9. 31

      10. 23

      11. 123123123123j12[joj;elda

      12. sasd1k23p]12

    5. 3

    6. 123

    7. 1

    8. 23

    9. 123

    10. 123

    11. 123

    12. 123

    13. 123

    14. 123

    `; + export const HTML_EDITOR_EXAMPLE_LONG_WORD_UL = `

    • 122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222

    • 122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222

    • 122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222


    1. 122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222

    2. 122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222

      1. 2

        1. 123

          1. 23

            1. 213

            2. 122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222

    3. 122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222

    `; export const HTML_EDITOR_EXAMPLE_NESTED_OL_UL = `
    • Lorem

      1. Ipsum

      2. is simply

      3. dummy text of

        • the printing

          • and typesetting

            • industry

    1. Lorem

      • Ipsum

        • has been

          1. the industry's

          2. standard dummy

    2. text ever since the 1500s

    `; diff --git a/projects/demo-integrations/cypress/tests/addon-editor/editor-api.cy.ts b/projects/demo-integrations/cypress/tests/addon-editor/editor-api.cy.ts index 542295b089dc..5f7dde4490da 100644 --- a/projects/demo-integrations/cypress/tests/addon-editor/editor-api.cy.ts +++ b/projects/demo-integrations/cypress/tests/addon-editor/editor-api.cy.ts @@ -23,6 +23,7 @@ import { HTML_EDITOR_EXAMPLE_LONG_WORD_UL, HTML_EDITOR_EXAMPLE_NESTED_OL_UL, HTML_EDITOR_EXAMPLE_NESTED_UL, + HTML_EDITOR_EXAMPLE_NESTED_UL_OL, HTML_EDITOR_EXAMPLE_PRE_CODE, HTML_EDITOR_EXAMPLE_TABLE, HTML_EDITOR_EXAMPLE_UL, @@ -147,6 +148,15 @@ describe(`Editor API`, () => { .matchImageSnapshot(`5-1-bullet-and-ordered-nested-list`); }); + it(`nested ul and ol`, () => { + tuiVisitEditorApiPage({content: HTML_EDITOR_EXAMPLE_NESTED_UL_OL}); + + tuiGetDemoContent() + .find(`tui-editor-socket.tui-example`) + .tuiWaitBeforeScreenshot() + .matchImageSnapshot(`5-1-bullet-and-ordered-nested--ol-ul-list`); + }); + it(`long words`, () => { tuiVisitEditorApiPage({content: HTML_EDITOR_EXAMPLE_LONG_WORD_UL});