From 5735fd0727514111577abffdc4ccd35ea46b277a Mon Sep 17 00:00:00 2001 From: splincode Date: Wed, 12 Jun 2024 20:19:42 +0300 Subject: [PATCH] chore: fixup --- README.md | 4 ++-- package-lock.json | 11 +++++----- projects/demo/src/app/app.component.ts | 2 +- projects/demo/src/app/app.config.ts | 2 +- projects/demo/src/index.html | 2 +- projects/ng-dompurify/README.md | 22 +++++++++---------- projects/ng-dompurify/package.json | 2 +- .../tests/ng-dompurify.pipe.spec.ts | 10 ++++----- .../tests/ng-dompurify.service.spec.ts | 8 ++----- tsconfig.json | 2 +- 10 files changed, 30 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 31aae70..f8c5260 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # NgDompurify -[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@tinkoff/ng-dompurify)](https://bundlephobia.com/result?p=@tinkoff/ng-dompurify) -[![npm version](https://img.shields.io/npm/v/@tinkoff/ng-dompurify.svg?style=flat-square)](https://npmjs.com/package/@tinkoff/ng-dompurify) +[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@taiga-ui/dompurify)](https://bundlephobia.com/result?p=@taiga-ui/dompurify) +[![npm version](https://img.shields.io/npm/v/@taiga-ui/dompurify.svg?style=flat-square)](https://npmjs.com/package/@taiga-ui/dompurify) [![code style: @tinkoff/linters](https://img.shields.io/badge/code%20style-%40tinkoff%2Flinters-blue?style=flat-square)](https://github.com/taiga-family/linters) > This library implements `DOMPurify` as Angular `Sanitizer` or `Pipe`. It delegates sanitizing to `DOMPurify` and diff --git a/package-lock.json b/package-lock.json index 666dac9..ad98dd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8253,6 +8253,10 @@ "@commitlint/config-conventional": "^19.2.2" } }, + "node_modules/@taiga-ui/dompurify": { + "resolved": "projects/ng-dompurify", + "link": true + }, "node_modules/@taiga-ui/eslint-plugin-experience": { "version": "0.98.0", "resolved": "https://registry.npmjs.org/@taiga-ui/eslint-plugin-experience/-/eslint-plugin-experience-0.98.0.tgz", @@ -8328,10 +8332,6 @@ "integrity": "sha512-v3gWrkYLoid9CFV3nudWYaJGdPZAG0nlYhsSWkQ2wghZjwhdboWrAODZk8uaWpF/xlGA7blX1lvyPiTV8nhMzA==", "dev": true }, - "node_modules/@tinkoff/ng-dompurify": { - "resolved": "projects/ng-dompurify", - "link": true - }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -8682,7 +8682,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", "dev": true, - "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } @@ -33112,7 +33111,7 @@ "version": "4.0.0" }, "projects/ng-dompurify": { - "name": "@tinkoff/ng-dompurify", + "name": "@taiga-ui/dompurify", "version": "4.0.0", "license": "Apache-2.0", "peerDependencies": { diff --git a/projects/demo/src/app/app.component.ts b/projects/demo/src/app/app.component.ts index 99b1a0d..c484b2c 100644 --- a/projects/demo/src/app/app.component.ts +++ b/projects/demo/src/app/app.component.ts @@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, inject, SecurityContext} from '@angu import {FormsModule} from '@angular/forms'; import type {SafeValue} from '@angular/platform-browser'; import {DomSanitizer} from '@angular/platform-browser'; -import {NgDompurifyPipe} from '@tinkoff/ng-dompurify'; +import {NgDompurifyPipe} from '@taiga-ui/dompurify'; const dirtyHtml = '

HELLO
goodbye

'; diff --git a/projects/demo/src/app/app.config.ts b/projects/demo/src/app/app.config.ts index cc249a7..20ee5e8 100644 --- a/projects/demo/src/app/app.config.ts +++ b/projects/demo/src/app/app.config.ts @@ -1,7 +1,7 @@ import type {ApplicationConfig} from '@angular/core'; import {Sanitizer} from '@angular/core'; import {provideAnimations} from '@angular/platform-browser/animations'; -import {NgDompurifySanitizer} from '@tinkoff/ng-dompurify'; +import {NgDompurifySanitizer} from '@taiga-ui/dompurify'; export const appConfig: ApplicationConfig = { providers: [ diff --git a/projects/demo/src/index.html b/projects/demo/src/index.html index ef11487..95fdd24 100644 --- a/projects/demo/src/index.html +++ b/projects/demo/src/index.html @@ -10,7 +10,7 @@ content="ie=edge" http-equiv="X-UA-Compatible" /> - @tinkoff/ng-dompurify demo + @taiga-ui/dompurify demo loading diff --git a/projects/ng-dompurify/README.md b/projects/ng-dompurify/README.md index 772de66..9157c18 100644 --- a/projects/ng-dompurify/README.md +++ b/projects/ng-dompurify/README.md @@ -1,7 +1,7 @@ # NgDompurify -[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@tinkoff/ng-dompurify)](https://bundlephobia.com/result?p=@tinkoff/ng-dompurify) -[![npm version](https://img.shields.io/npm/v/@tinkoff/ng-dompurify.svg?style=flat-square)](https://npmjs.com/package/@tinkoff/ng-dompurify) +[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@taiga-ui/dompurify)](https://bundlephobia.com/result?p=@taiga-ui/dompurify) +[![npm version](https://img.shields.io/npm/v/@taiga-ui/dompurify.svg?style=flat-square)](https://npmjs.com/package/@taiga-ui/dompurify) [![code style: @tinkoff/linters](https://img.shields.io/badge/code%20style-%40tinkoff%2Flinters-blue?style=flat-square)](https://github.com/taiga-family/linters) > This library implements `DOMPurify` as Angular `Sanitizer` or `Pipe`. It delegates sanitizing to `DOMPurify` and @@ -13,7 +13,7 @@ Read more about Sanitization in Angular and how ng-dompurify works in ## Install ``` -npm install @tinkoff/ng-dompurify +npm install @taiga-ui/dompurify ``` If you do not have `dompurify` in your package, install also: @@ -28,7 +28,7 @@ npm install --save-dev @types/dompurify Either use pipe to sanitize your content when binding to `[innerHTML]` or use `NgDompurifySanitizer` service manually. ```typescript -import {NgDompurifyModule} from '@tinkoff/ng-dompurify'; +import {NgDompurifyModule} from '@taiga-ui/dompurify'; @NgModule({ imports: [NgDompurifyModule], @@ -46,7 +46,7 @@ As a service: ```typescript import {SecurityContext} from '@angular/core'; -import {NgDompurifySanitizer} from '@tinkoff/ng-dompurify'; +import {NgDompurifySanitizer} from '@taiga-ui/dompurify'; @Component({}) export class MyComponent { @@ -62,7 +62,7 @@ You can also substitute Angular `Sanitizer` with `DOMPurify` so it is automatica ```typescript import {NgModule, Sanitizer} from '@angular/core'; -import {NgDompurifySanitizer} from '@tinkoff/ng-dompurify'; +import {NgDompurifySanitizer} from '@taiga-ui/dompurify'; // ... @NgModule({ @@ -85,7 +85,7 @@ Config for `NgDompurifySanitizer` or `NgDompurifyDomSanitizer` can be provided u ```typescript import {NgModule, Sanitizer} from '@angular/core'; -import {NgDompurifySanitizer, DOMPURIFY_CONFIG} from '@tinkoff/ng-dompurify'; +import {NgDompurifySanitizer, DOMPURIFY_CONFIG} from '@taiga-ui/dompurify'; // ... @NgModule({ @@ -113,7 +113,7 @@ to: ```typescript import {NgModule, Sanitizer} from '@angular/core'; -import {NgDompurifySanitizer, SANITIZE_STYLE} from '@tinkoff/ng-dompurify'; +import {NgDompurifySanitizer, SANITIZE_STYLE} from '@taiga-ui/dompurify'; @NgModule({ // ... @@ -138,7 +138,7 @@ DOMPurify supports various hooks. You can provide them using `DOMPURIFY_HOOKS` t ```typescript import {NgModule, Sanitizer} from '@angular/core'; -import {NgDompurifySanitizer, DOMPURIFY_HOOKS, SANITIZE_STYLE} from '@tinkoff/ng-dompurify'; +import {NgDompurifySanitizer, DOMPURIFY_HOOKS, SANITIZE_STYLE} from '@taiga-ui/dompurify'; @NgModule({ // ... @@ -170,14 +170,14 @@ export class AppModule {} ## Maintained -**@tinkoff/ng-dompurify** is a part of [Taiga UI](https://github.com/taiga-family/taiga-ui) libraries family which is +**@taiga-ui/dompurify** is a part of [Taiga UI](https://github.com/taiga-family/taiga-ui) libraries family which is backed and used by a large enterprise. This means you can rely on timely support and continuous development. ## License 🆓 Feel free to use our library in your commercial and private applications -All **@tinkoff/ng-dompurify** packages are covered by [Apache 2.0](/LICENSE) +All **@taiga-ui/dompurify** packages are covered by [Apache 2.0](/LICENSE) Read more about this license [here](https://choosealicense.com/licenses/apache-2.0/) diff --git a/projects/ng-dompurify/package.json b/projects/ng-dompurify/package.json index d2f951f..f498be3 100644 --- a/projects/ng-dompurify/package.json +++ b/projects/ng-dompurify/package.json @@ -1,5 +1,5 @@ { - "name": "@tinkoff/ng-dompurify", + "name": "@taiga-ui/dompurify", "version": "4.0.0", "description": "Inclusive Angular API for DOMPurify", "keywords": [ diff --git a/projects/ng-dompurify/tests/ng-dompurify.pipe.spec.ts b/projects/ng-dompurify/tests/ng-dompurify.pipe.spec.ts index 9bb91f8..2e3a37e 100644 --- a/projects/ng-dompurify/tests/ng-dompurify.pipe.spec.ts +++ b/projects/ng-dompurify/tests/ng-dompurify.pipe.spec.ts @@ -4,7 +4,7 @@ import {Component, SecurityContext, ViewChild} from '@angular/core'; import type {ComponentFixture} from '@angular/core/testing'; import {TestBed} from '@angular/core/testing'; import {afterEach, beforeEach, describe, expect, it} from '@jest/globals'; -import {NgDompurifyPipe, SANITIZE_STYLE} from '@tinkoff/ng-dompurify'; +import {NgDompurifyPipe, SANITIZE_STYLE} from '@taiga-ui/dompurify'; import {removeAllHooks} from 'dompurify'; import {cleanHtml, dirtyHtml} from './test-samples/html'; @@ -38,11 +38,11 @@ describe('NgDompurifyPipe', () => { }) class TestComponent { @ViewChild('element') - protected readonly element!: ElementRef; + public readonly element!: ElementRef; - protected content = ''; - protected context?: SecurityContext = SecurityContext.HTML; - protected config? = {}; + public content = ''; + public context?: SecurityContext = SecurityContext.HTML; + public config? = {}; protected get html(): boolean { return ( diff --git a/projects/ng-dompurify/tests/ng-dompurify.service.spec.ts b/projects/ng-dompurify/tests/ng-dompurify.service.spec.ts index 1edb5ba..c79c108 100644 --- a/projects/ng-dompurify/tests/ng-dompurify.service.spec.ts +++ b/projects/ng-dompurify/tests/ng-dompurify.service.spec.ts @@ -2,12 +2,8 @@ import {APP_BASE_HREF} from '@angular/common'; import {SecurityContext} from '@angular/core'; import {TestBed} from '@angular/core/testing'; import {afterEach, beforeEach, describe, expect, it} from '@jest/globals'; -import type {NgDompurifyHook} from '@tinkoff/ng-dompurify'; -import { - DOMPURIFY_HOOKS, - NgDompurifySanitizer, - SANITIZE_STYLE, -} from '@tinkoff/ng-dompurify'; +import type {NgDompurifyHook} from '@taiga-ui/dompurify'; +import {DOMPURIFY_HOOKS, NgDompurifySanitizer, SANITIZE_STYLE} from '@taiga-ui/dompurify'; import {removeAllHooks} from 'dompurify'; import {cleanHtml, dirtyHtml} from './test-samples/html'; diff --git a/tsconfig.json b/tsconfig.json index b21e2cf..f49e7b4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,7 @@ "typeRoots": ["node_modules/@types"], "types": ["jest", "node"], "paths": { - "@tinkoff/ng-dompurify": ["./projects/ng-dompurify/lib"] + "@taiga-ui/dompurify": ["./projects/ng-dompurify/lib"] } } }