Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Jun 12, 2024
1 parent c6162bf commit 5735fd0
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 35 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 5 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
'<p style="color: red;"> HELLO <iframe//src=JavaScript:alert&lpar;1)></ifrAMe><br>goodbye</p>';
Expand Down
2 changes: 1 addition & 1 deletion projects/demo/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -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: [
Expand Down
2 changes: 1 addition & 1 deletion projects/demo/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
content="ie=edge"
http-equiv="X-UA-Compatible"
/>
<title>@tinkoff/ng-dompurify demo</title>
<title>@taiga-ui/dompurify demo</title>
</head>
<body>
<my-app>loading</my-app>
Expand Down
22 changes: 11 additions & 11 deletions projects/ng-dompurify/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand All @@ -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],
Expand All @@ -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 {
Expand All @@ -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({
Expand All @@ -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({
Expand Down Expand Up @@ -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({
// ...
Expand All @@ -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({
// ...
Expand Down Expand Up @@ -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/)

Expand Down
2 changes: 1 addition & 1 deletion projects/ng-dompurify/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@tinkoff/ng-dompurify",
"name": "@taiga-ui/dompurify",
"version": "4.0.0",
"description": "Inclusive Angular API for DOMPurify",
"keywords": [
Expand Down
10 changes: 5 additions & 5 deletions projects/ng-dompurify/tests/ng-dompurify.pipe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -38,11 +38,11 @@ describe('NgDompurifyPipe', () => {
})
class TestComponent {
@ViewChild('element')
protected readonly element!: ElementRef<HTMLElement>;
public readonly element!: ElementRef<HTMLElement>;

protected content = '';
protected context?: SecurityContext = SecurityContext.HTML;
protected config? = {};
public content = '';
public context?: SecurityContext = SecurityContext.HTML;
public config? = {};

protected get html(): boolean {
return (
Expand Down
8 changes: 2 additions & 6 deletions projects/ng-dompurify/tests/ng-dompurify.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}
}

0 comments on commit 5735fd0

Please sign in to comment.