croco-html 0.1.1 → 0.1.2

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.
Files changed (183) hide show
  1. package/croco-html.d.ts +5 -0
  2. package/esm2020/croco-html.mjs +5 -0
  3. package/esm2020/lib/components/add-files-btn/add-files-btn.component.mjs +53 -0
  4. package/esm2020/lib/components/editor/external-video-block/external-video-block.component.mjs +45 -0
  5. package/esm2020/lib/components/editor/html-raw-editor/html-raw-editor.component.mjs +25 -0
  6. package/esm2020/lib/components/editor/image-editor/image-editor.component.mjs +50 -0
  7. package/esm2020/lib/components/editor/index.mjs +8 -0
  8. package/esm2020/lib/components/editor/main-editor/main-editor.component.mjs +76 -0
  9. package/esm2020/lib/components/editor/main-editor-block/main-editor-block.component.mjs +41 -0
  10. package/esm2020/lib/components/editor/text-editor/text-editor.component.mjs +34 -0
  11. package/esm2020/lib/components/editor/visual-editor/visual-editor.component.mjs +161 -0
  12. package/esm2020/lib/components/file-id-select/file-id-select.component.mjs +62 -0
  13. package/esm2020/lib/components/index.mjs +6 -0
  14. package/esm2020/lib/components/upload-files-btn/upload-files-btn.component.mjs +54 -0
  15. package/esm2020/lib/components/xml-tags/index.mjs +9 -0
  16. package/esm2020/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.mjs +43 -0
  17. package/esm2020/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.mjs +17 -0
  18. package/esm2020/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.mjs +18 -0
  19. package/esm2020/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.mjs +16 -0
  20. package/esm2020/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.mjs +20 -0
  21. package/esm2020/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.mjs +20 -0
  22. package/esm2020/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.mjs +17 -0
  23. package/esm2020/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.mjs +21 -0
  24. package/esm2020/lib/croco-html.module.mjs +90 -0
  25. package/esm2020/lib/extensions/AngularMaterialTableMethods.mjs +64 -0
  26. package/esm2020/lib/extensions/BodyTagsExtensions.mjs +120 -0
  27. package/esm2020/lib/extensions/BootstrapTableMethods.mjs +67 -0
  28. package/esm2020/lib/extensions/HtmlExtractionMethods.mjs +63 -0
  29. package/esm2020/lib/extensions/HtmlRawTagDataConsts.mjs +4 -0
  30. package/esm2020/lib/extensions/ImageMethods.mjs +24 -0
  31. package/esm2020/lib/extensions/InterfaceBlock.mjs +2 -0
  32. package/esm2020/lib/extensions/TableBuilder.mjs +35 -0
  33. package/esm2020/lib/extensions/TableMethods.mjs +108 -0
  34. package/esm2020/lib/extensions/TextMethods.mjs +29 -0
  35. package/esm2020/lib/extensions/TextSimpleMethods.mjs +77 -0
  36. package/esm2020/lib/extensions/VideoMethods.mjs +20 -0
  37. package/esm2020/lib/extensions/XmlExtensions.mjs +26 -0
  38. package/esm2020/lib/extensions/index.mjs +13 -0
  39. package/esm2020/lib/index.mjs +113 -0
  40. package/esm2020/lib/models/models.mjs +2 -0
  41. package/esm2020/lib/pipes/RichTextToHtmlPipe.mjs +26 -0
  42. package/esm2020/lib/pipes/TagToSpanPipe.mjs +16 -0
  43. package/esm2020/lib/pipes/ToHtmlBodyTagsPipe.mjs +17 -0
  44. package/esm2020/lib/pipes/index.mjs +5 -0
  45. package/esm2020/lib/pipes/to-preview.pipe.mjs +17 -0
  46. package/esm2020/lib/services/file-upload.service.mjs +40 -0
  47. package/esm2020/lib/services/files-query.service.mjs +27 -0
  48. package/esm2020/public-api.mjs +8 -0
  49. package/fesm2015/croco-html.mjs +1565 -0
  50. package/fesm2015/croco-html.mjs.map +1 -0
  51. package/fesm2020/croco-html.mjs +1568 -0
  52. package/fesm2020/croco-html.mjs.map +1 -0
  53. package/lib/components/add-files-btn/add-files-btn.component.d.ts +18 -0
  54. package/lib/components/editor/external-video-block/external-video-block.component.d.ts +19 -0
  55. package/lib/components/editor/html-raw-editor/html-raw-editor.component.d.ts +11 -0
  56. package/lib/components/editor/image-editor/image-editor.component.d.ts +20 -0
  57. package/lib/components/editor/index.d.ts +7 -0
  58. package/lib/components/editor/main-editor/main-editor.component.d.ts +28 -0
  59. package/lib/components/editor/main-editor-block/main-editor-block.component.d.ts +16 -0
  60. package/lib/components/editor/text-editor/text-editor.component.d.ts +14 -0
  61. package/lib/components/editor/visual-editor/visual-editor.component.d.ts +43 -0
  62. package/lib/components/file-id-select/file-id-select.component.d.ts +30 -0
  63. package/lib/components/index.d.ts +5 -0
  64. package/lib/components/upload-files-btn/upload-files-btn.component.d.ts +24 -0
  65. package/{src/lib/components/xml-tags/index.ts → lib/components/xml-tags/index.d.ts} +8 -8
  66. package/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.d.ts +17 -0
  67. package/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.d.ts +10 -0
  68. package/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.d.ts +10 -0
  69. package/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.d.ts +7 -0
  70. package/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.d.ts +10 -0
  71. package/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.d.ts +7 -0
  72. package/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.d.ts +10 -0
  73. package/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.d.ts +8 -0
  74. package/lib/croco-html.module.d.ts +60 -0
  75. package/lib/extensions/AngularMaterialTableMethods.d.ts +10 -0
  76. package/lib/extensions/BodyTagsExtensions.d.ts +10 -0
  77. package/lib/extensions/BootstrapTableMethods.d.ts +9 -0
  78. package/lib/extensions/HtmlExtractionMethods.d.ts +69 -0
  79. package/lib/extensions/HtmlRawTagDataConsts.d.ts +3 -0
  80. package/lib/extensions/ImageMethods.d.ts +17 -0
  81. package/lib/extensions/InterfaceBlock.d.ts +4 -0
  82. package/lib/extensions/TableBuilder.d.ts +5 -0
  83. package/lib/extensions/TableMethods.d.ts +58 -0
  84. package/lib/extensions/TextMethods.d.ts +19 -0
  85. package/lib/extensions/TextSimpleMethods.d.ts +23 -0
  86. package/lib/extensions/VideoMethods.d.ts +19 -0
  87. package/lib/extensions/XmlExtensions.d.ts +5 -0
  88. package/lib/extensions/index.d.ts +10 -0
  89. package/lib/index.d.ts +20 -0
  90. package/{src/lib/models/models.ts → lib/models/models.d.ts} +1 -2
  91. package/lib/pipes/RichTextToHtmlPipe.d.ts +8 -0
  92. package/lib/pipes/TagToSpanPipe.d.ts +7 -0
  93. package/lib/pipes/ToHtmlBodyTagsPipe.d.ts +8 -0
  94. package/{src/lib/pipes/index.ts → lib/pipes/index.d.ts} +0 -0
  95. package/lib/pipes/to-preview.pipe.d.ts +8 -0
  96. package/lib/services/file-upload.service.d.ts +23 -0
  97. package/lib/services/files-query.service.d.ts +42 -0
  98. package/package.json +34 -14
  99. package/{src/public-api.ts → public-api.d.ts} +0 -4
  100. package/karma.conf.js +0 -44
  101. package/ng-package.json +0 -7
  102. package/src/lib/components/add-files-btn/add-files-btn.component.css +0 -0
  103. package/src/lib/components/add-files-btn/add-files-btn.component.html +0 -14
  104. package/src/lib/components/add-files-btn/add-files-btn.component.ts +0 -61
  105. package/src/lib/components/editor/external-video-block/external-video-block.component.css +0 -0
  106. package/src/lib/components/editor/external-video-block/external-video-block.component.html +0 -27
  107. package/src/lib/components/editor/external-video-block/external-video-block.component.ts +0 -45
  108. package/src/lib/components/editor/html-raw-editor/html-raw-editor.component.css +0 -0
  109. package/src/lib/components/editor/html-raw-editor/html-raw-editor.component.html +0 -17
  110. package/src/lib/components/editor/html-raw-editor/html-raw-editor.component.ts +0 -22
  111. package/src/lib/components/editor/image-editor/image-editor.component.css +0 -7
  112. package/src/lib/components/editor/image-editor/image-editor.component.html +0 -54
  113. package/src/lib/components/editor/image-editor/image-editor.component.ts +0 -52
  114. package/src/lib/components/editor/index.ts +0 -7
  115. package/src/lib/components/editor/main-editor/main-editor.component.css +0 -48
  116. package/src/lib/components/editor/main-editor/main-editor.component.html +0 -39
  117. package/src/lib/components/editor/main-editor/main-editor.component.ts +0 -71
  118. package/src/lib/components/editor/main-editor-block/main-editor-block.component.css +0 -0
  119. package/src/lib/components/editor/main-editor-block/main-editor-block.component.html +0 -41
  120. package/src/lib/components/editor/main-editor-block/main-editor-block.component.ts +0 -39
  121. package/src/lib/components/editor/text-editor/text-editor.component.css +0 -0
  122. package/src/lib/components/editor/text-editor/text-editor.component.html +0 -39
  123. package/src/lib/components/editor/text-editor/text-editor.component.ts +0 -30
  124. package/src/lib/components/editor/visual-editor/visual-editor.component.css +0 -48
  125. package/src/lib/components/editor/visual-editor/visual-editor.component.html +0 -84
  126. package/src/lib/components/editor/visual-editor/visual-editor.component.ts +0 -180
  127. package/src/lib/components/file-id-select/file-id-select.component.css +0 -0
  128. package/src/lib/components/file-id-select/file-id-select.component.html +0 -39
  129. package/src/lib/components/file-id-select/file-id-select.component.ts +0 -75
  130. package/src/lib/components/index.ts +0 -5
  131. package/src/lib/components/upload-files-btn/upload-files-btn.component.css +0 -0
  132. package/src/lib/components/upload-files-btn/upload-files-btn.component.html +0 -2
  133. package/src/lib/components/upload-files-btn/upload-files-btn.component.ts +0 -57
  134. package/src/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.css +0 -15
  135. package/src/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.html +0 -8
  136. package/src/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.ts +0 -59
  137. package/src/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.css +0 -0
  138. package/src/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.html +0 -18
  139. package/src/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.ts +0 -19
  140. package/src/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.css +0 -0
  141. package/src/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.html +0 -25
  142. package/src/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.ts +0 -19
  143. package/src/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.css +0 -0
  144. package/src/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.html +0 -3
  145. package/src/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.ts +0 -14
  146. package/src/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.css +0 -0
  147. package/src/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.html +0 -2
  148. package/src/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.ts +0 -19
  149. package/src/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.css +0 -0
  150. package/src/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.html +0 -9
  151. package/src/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.ts +0 -15
  152. package/src/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.css +0 -0
  153. package/src/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.html +0 -21
  154. package/src/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.ts +0 -18
  155. package/src/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.css +0 -4
  156. package/src/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.html +0 -44
  157. package/src/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.ts +0 -17
  158. package/src/lib/croco-html.module.ts +0 -22
  159. package/src/lib/extensions/AngularMaterialTableMethods.ts +0 -87
  160. package/src/lib/extensions/BodyTagsExtensions.ts +0 -151
  161. package/src/lib/extensions/BootstrapTableMethods.ts +0 -87
  162. package/src/lib/extensions/HtmlExtractionMethods.ts +0 -78
  163. package/src/lib/extensions/HtmlRawTagDataConsts.ts +0 -3
  164. package/src/lib/extensions/ImageMethods.ts +0 -37
  165. package/src/lib/extensions/InterfaceBlock.ts +0 -5
  166. package/src/lib/extensions/TableBuilder.ts +0 -50
  167. package/src/lib/extensions/TableMethods.ts +0 -175
  168. package/src/lib/extensions/TextMethods.ts +0 -51
  169. package/src/lib/extensions/TextSimpleMethods.ts +0 -120
  170. package/src/lib/extensions/VideoMethods.ts +0 -31
  171. package/src/lib/extensions/XmlExtensions.ts +0 -26
  172. package/src/lib/extensions/index.ts +0 -12
  173. package/src/lib/index.ts +0 -119
  174. package/src/lib/pipes/RichTextToHtmlPipe.ts +0 -25
  175. package/src/lib/pipes/TagToSpanPipe.ts +0 -10
  176. package/src/lib/pipes/ToHtmlBodyTagsPipe.ts +0 -14
  177. package/src/lib/pipes/to-preview.pipe.ts +0 -12
  178. package/src/lib/services/file-upload.service.ts +0 -56
  179. package/src/lib/services/files-query.service.ts +0 -72
  180. package/src/test.ts +0 -28
  181. package/tsconfig.lib.json +0 -20
  182. package/tsconfig.lib.prod.json +0 -10
  183. package/tsconfig.spec.json +0 -17
@@ -0,0 +1,42 @@
1
+ import { HttpClient } from "@angular/common/http";
2
+ import { Observable } from "rxjs";
3
+ import * as i0 from "@angular/core";
4
+ export interface GetListResult<T> {
5
+ totalCount: number;
6
+ list: Array<T>;
7
+ }
8
+ export interface DbFileNoDataWithRelations {
9
+ id: number;
10
+ fileName: string;
11
+ relations: Array<FileRelationModel>;
12
+ }
13
+ export interface FileRelationModel {
14
+ entityTypeFullName: string;
15
+ entityKey: string;
16
+ relationName: string;
17
+ relationValue: string;
18
+ relationCustomData: string;
19
+ }
20
+ export interface SearchFiles {
21
+ fileName: string;
22
+ q: string;
23
+ count: number | null;
24
+ offSet: number;
25
+ }
26
+ export interface GetListSearchModel {
27
+ count: number | null;
28
+ offSet: number;
29
+ }
30
+ export interface FileNameAndIdModel {
31
+ fileId: number;
32
+ fileName: string;
33
+ }
34
+ export declare class FilesQueryService {
35
+ private _httpClient;
36
+ _baseControllerUrl: string;
37
+ constructor(_httpClient: HttpClient, baseUrl: string);
38
+ getFilesWithRelations(model: SearchFiles): Observable<GetListResult<DbFileNoDataWithRelations>>;
39
+ getFiles(model: SearchFiles): Observable<GetListResult<FileNameAndIdModel>>;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<FilesQueryService, never>;
41
+ static ɵprov: i0.ɵɵInjectableDeclaration<FilesQueryService>;
42
+ }
package/package.json CHANGED
@@ -1,15 +1,35 @@
1
- {
2
- "name": "croco-html",
3
- "version": "0.1.1",
4
- "peerDependencies": {
5
- "@angular/common": ">=13.3.11",
6
- "@angular/core": ">=13.3.11",
7
- "@angular/material": ">=13.3.9",
8
- "@angular/cdk": ">=13.3.9",
9
- "ngx-clipboard": ">=15.1.0",
10
- "@ng-select/ng-select": ">=9.0.2"
11
- },
12
- "dependencies": {
13
- "tslib": ">=2.2.0"
14
- }
1
+ {
2
+ "name": "croco-html",
3
+ "version": "0.1.2",
4
+ "peerDependencies": {
5
+ "@angular/common": ">=13.3.11",
6
+ "@angular/core": ">=13.3.11",
7
+ "@angular/material": ">=13.3.9",
8
+ "@angular/cdk": ">=13.3.9",
9
+ "ngx-clipboard": ">=15.1.0",
10
+ "@ng-select/ng-select": ">=9.0.2"
11
+ },
12
+ "dependencies": {
13
+ "tslib": ">=2.2.0"
14
+ },
15
+ "module": "fesm2015/croco-html.mjs",
16
+ "es2020": "fesm2020/croco-html.mjs",
17
+ "esm2020": "esm2020/croco-html.mjs",
18
+ "fesm2020": "fesm2020/croco-html.mjs",
19
+ "fesm2015": "fesm2015/croco-html.mjs",
20
+ "typings": "croco-html.d.ts",
21
+ "exports": {
22
+ "./package.json": {
23
+ "default": "./package.json"
24
+ },
25
+ ".": {
26
+ "types": "./croco-html.d.ts",
27
+ "esm2020": "./esm2020/croco-html.mjs",
28
+ "es2020": "./fesm2020/croco-html.mjs",
29
+ "es2015": "./fesm2015/croco-html.mjs",
30
+ "node": "./fesm2015/croco-html.mjs",
31
+ "default": "./fesm2020/croco-html.mjs"
32
+ }
33
+ },
34
+ "sideEffects": false
15
35
  }
@@ -1,7 +1,3 @@
1
- /*
2
- * Public API Surface of croco-html
3
- */
4
-
5
1
  export * from './lib/components';
6
2
  export * from './lib/pipes';
7
3
  export * from './lib/extensions';
package/karma.conf.js DELETED
@@ -1,44 +0,0 @@
1
- // Karma configuration file, see link for more information
2
- // https://karma-runner.github.io/1.0/config/configuration-file.html
3
-
4
- module.exports = function (config) {
5
- config.set({
6
- basePath: '',
7
- frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
- plugins: [
9
- require('karma-jasmine'),
10
- require('karma-chrome-launcher'),
11
- require('karma-jasmine-html-reporter'),
12
- require('karma-coverage'),
13
- require('@angular-devkit/build-angular/plugins/karma')
14
- ],
15
- client: {
16
- jasmine: {
17
- // you can add configuration options for Jasmine here
18
- // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19
- // for example, you can disable the random execution with `random: false`
20
- // or set a specific seed with `seed: 4321`
21
- },
22
- clearContext: false // leave Jasmine Spec Runner output visible in browser
23
- },
24
- jasmineHtmlReporter: {
25
- suppressAll: true // removes the duplicated traces
26
- },
27
- coverageReporter: {
28
- dir: require('path').join(__dirname, '../../coverage/croco-html'),
29
- subdir: '.',
30
- reporters: [
31
- { type: 'html' },
32
- { type: 'text-summary' }
33
- ]
34
- },
35
- reporters: ['progress', 'kjhtml'],
36
- port: 9876,
37
- colors: true,
38
- logLevel: config.LOG_INFO,
39
- autoWatch: true,
40
- browsers: ['Chrome'],
41
- singleRun: false,
42
- restartOnFileChange: true
43
- });
44
- };
package/ng-package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/croco-html",
4
- "lib": {
5
- "entryFile": "src/public-api.ts"
6
- }
7
- }
@@ -1,14 +0,0 @@
1
- <div [hidden]="true">
2
- <app-upload-files-btn #fakeBtn
3
- (onFilesUploaded)="filesUploadedHandler($event)"
4
- [btnText]="'Добавить изображения'"
5
- [createLocalCopiesNow]="true"
6
- (postFilesStarted)="postFilesStartedEventHandler($event)"
7
- [extAccepts]="'image/*'"></app-upload-files-btn>
8
- </div>
9
-
10
- <div>
11
- <button class="w-100"
12
- (click)="handleClick()"
13
- mat-stroked-button>Добавить изображения</button>
14
- </div>
@@ -1,61 +0,0 @@
1
- import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
2
- import { FileImageTagDataConsts } from '../../extensions/ImageMethods';
3
- import { HtmlBodyTag } from '../../models/models';
4
- import { BaseApiResponseWithFilesIds } from '../../services/file-upload.service';
5
- import { FilePostingStarted, UploadFilesBtnComponent } from '../upload-files-btn/upload-files-btn.component';
6
-
7
- @Component({
8
- selector: 'croco-add-files-btn',
9
- templateUrl: './add-files-btn.component.html',
10
- styleUrls: ['./add-files-btn.component.css']
11
- })
12
- export class AddFilesBtnComponent implements OnInit {
13
-
14
- @Output()
15
- postFilesStarted = new EventEmitter<FilePostingStarted>();
16
-
17
- @ViewChild("fakeBtn")
18
- fakeBtn!: UploadFilesBtnComponent;
19
-
20
- fileIds:number[] = [];
21
-
22
- constructor() { }
23
-
24
- @Output()
25
- filesTagsReady = new EventEmitter<HtmlBodyTag[]>();
26
-
27
- postFilesStartedEventHandler(data: FilePostingStarted){
28
- this.postFilesStarted.emit(data);
29
- }
30
-
31
- filesUploadedHandler(data: BaseApiResponseWithFilesIds){
32
- this.fileIds = data.responseObject;
33
-
34
- let fileTags:HtmlBodyTag[] = [];
35
-
36
- for(let i=0; i < this.fileIds.length; i++){
37
- let fileTag: HtmlBodyTag = {
38
- presentOrEdit: true,
39
- tagDescription: {
40
- tag: FileImageTagDataConsts.TagName,
41
- displayValue: "Изображение"
42
- },
43
- attributes: {
44
- [FileImageTagDataConsts.FileIdAttrName]: this.fileIds[i]
45
- },
46
- innerHtml: ""
47
- };
48
-
49
- fileTags.push(fileTag);
50
- }
51
-
52
- this.filesTagsReady.emit(fileTags);
53
- }
54
-
55
- handleClick(){
56
- this.fakeBtn.clickFileInput();
57
- }
58
-
59
- ngOnInit(): void {
60
- }
61
- }
@@ -1,27 +0,0 @@
1
- <div *ngIf="tag.presentOrEdit">
2
-
3
- <div>
4
- Ссылка на YouTube: {{data.youtubeLink}}
5
- </div>
6
-
7
- <div style="height: 10px;"></div>
8
-
9
- <croco-html-xml-tag-external-video [tagData]="tagData">
10
- </croco-html-xml-tag-external-video>
11
- </div>
12
-
13
- <div *ngIf="!tag.presentOrEdit">
14
- <div>
15
- <form [formGroup]="myForm">
16
- <mat-form-field class="w-100">
17
- <input matInput placeholder="Ссылка на YouTube"
18
- new-autocomplete="off"
19
- autocomplete="off"
20
- formControlName="youtubeLink"
21
- [(ngModel)]="data.youtubeLink"
22
- (ngModelChange)="linkChanged()">
23
- </mat-form-field>
24
- </form>
25
- </div>
26
- </div>
27
-
@@ -1,45 +0,0 @@
1
- import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
- import { FormControl, FormGroup } from '@angular/forms';
3
- import { ExternalVideoTagData, ExternalVideoSupportedTypes } from '../../../extensions/VideoMethods';
4
- import { HtmlBodyTag } from '../../../models/models';
5
-
6
- @Component({
7
- selector: 'croco-html-external-video-block',
8
- templateUrl: './external-video-block.component.html',
9
- styleUrls: ['./external-video-block.component.css']
10
- })
11
- export class ExternalVideoBlockComponent implements OnInit {
12
-
13
- @Input()
14
- tag: HtmlBodyTag;
15
-
16
- @Output()
17
- onTagUpdated = new EventEmitter<HtmlBodyTag>();
18
-
19
- myForm = new FormGroup({
20
- youtubeLink: new FormControl()
21
- });
22
-
23
- defaultLink = "https://youtu.be/jzBneaWSswY";
24
-
25
- data = {
26
- youtubeLink: this.defaultLink
27
- }
28
-
29
- tagData: ExternalVideoTagData = {
30
- link: this.defaultLink,
31
- type: ExternalVideoSupportedTypes.Youtube
32
- };
33
-
34
- linkChanged(){
35
- this.tagData.link = this.data.youtubeLink;
36
- this.tag.attributes = this.tagData;
37
- }
38
-
39
- ngOnInit(): void {
40
- this.linkChanged();
41
-
42
- this.tagData = this.tag.attributes as ExternalVideoTagData;
43
- this.data.youtubeLink = this.tagData.link;
44
- }
45
- }
@@ -1,17 +0,0 @@
1
- <div *ngIf="tag.presentOrEdit">
2
- <div [innerHTML]="tag.innerHtml"></div>
3
- </div>
4
-
5
- <div *ngIf="!tag.presentOrEdit">
6
- <div style="height: 10px;">
7
- </div>
8
- <div>
9
- <mat-form-field class="w-100">
10
- <textarea matInput cdkTextareaAutosize #autosize="cdkTextareaAutosize"
11
- cdkAutosizeMinRows="1"
12
- placeholder="Внутренняя разметка тега"
13
- [(ngModel)]="tag.innerHtml"></textarea>
14
- </mat-form-field>
15
- </div>
16
- </div>
17
-
@@ -1,22 +0,0 @@
1
- import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
- import { HtmlBodyTag } from '../../../models/models';
3
-
4
- @Component({
5
- selector: 'croco-html-html-raw-editor',
6
- templateUrl: './html-raw-editor.component.html',
7
- styleUrls: ['./html-raw-editor.component.css']
8
- })
9
- export class HtmlRawEditorComponent implements OnInit {
10
-
11
- @Input()
12
- tag: HtmlBodyTag;
13
-
14
- @Output()
15
- onTagUpdated = new EventEmitter<HtmlBodyTag>();
16
-
17
- constructor() { }
18
-
19
- ngOnInit(): void {
20
- }
21
-
22
- }
@@ -1,7 +0,0 @@
1
- .error-block{
2
- background-color: rgb(243 35 35);
3
- color: white;
4
- text-align: center;
5
- border-radius: 10px;
6
- padding: 10px;
7
- }
@@ -1,54 +0,0 @@
1
- <div>
2
- <div style="height: 10px;">
3
- </div>
4
-
5
- <div *ngIf="hasImageError" class="error-block">
6
- Изображение не найдено по указанному идентификатору, возможно файл не существует или отсутствует на сервере.
7
- </div>
8
-
9
- <div *ngIf="hasFileId() && !hasImageError">
10
- <img class="mx-auto d-block img-fluid" [src]="getSrc()" (error)="onErrorHandler()"/>
11
- </div>
12
-
13
- <div *ngIf="!hasFileId()">
14
- <h5>[Изображение не выбрано]</h5>
15
- </div>
16
- </div>
17
-
18
- <div *ngIf="!tag.presentOrEdit">
19
- <div style="height: 10px;"></div>
20
-
21
- <div style="overflow-x:auto;">
22
- <mat-button-toggle-group [(ngModel)]="searchOrEdit">
23
- <mat-button-toggle value="search">
24
- Искать файл <mat-icon>search</mat-icon>
25
- </mat-button-toggle>
26
- <mat-button-toggle value="edit">
27
- Указать по идентификатору <mat-icon>settings</mat-icon>
28
- </mat-button-toggle>
29
- </mat-button-toggle-group>
30
- </div>
31
-
32
-
33
- <div style="height: 10px;"></div>
34
-
35
- <div [hidden]="searchOrEdit !== 'search'">
36
- <croco-html-file-id-select
37
- [labelText]="'Выбрать файл'"
38
- [(fileId)]="tag.attributes['file-id']"
39
- (onFileIdChanged)="onFileIdChanged($event)">
40
- </croco-html-file-id-select>
41
- </div>
42
-
43
- <div [hidden]="searchOrEdit !== 'edit'">
44
- <form [formGroup]="myForm">
45
- <mat-form-field class="w-100">
46
- <input matInput placeholder="Идентификатор файла" new-autocomplete="off" autocomplete="off"
47
- formControlName="fileId"
48
- type="number"
49
- [(ngModel)]="tag.attributes['file-id']"
50
- (ngModelChange)="removeImageError()">
51
- </mat-form-field>
52
- </form>
53
- </div>
54
- </div>
@@ -1,52 +0,0 @@
1
- import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
- import { FormControl, FormGroup } from '@angular/forms';
3
- import { ImageMethods, FileImageTagDataConsts } from '../../../extensions/ImageMethods';
4
- import { HtmlBodyTag } from '../../../models/models';
5
-
6
- @Component({
7
- selector: 'croco-html-image-editor',
8
- templateUrl: './image-editor.component.html',
9
- styleUrls: ['./image-editor.component.css']
10
- })
11
- export class ImageEditorComponent implements OnInit {
12
-
13
- hasImageError = false;
14
- searchOrEdit = "search";
15
-
16
- @Input()
17
- tag: HtmlBodyTag;
18
-
19
- myForm = new FormGroup({
20
- fileId:new FormControl()
21
- });
22
-
23
- onErrorHandler(){
24
- this.hasImageError = true;
25
- }
26
-
27
- @Output()
28
- onTagUpdated = new EventEmitter<HtmlBodyTag>();
29
-
30
- constructor() { }
31
-
32
- getSrc(){
33
- return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
34
- }
35
-
36
- hasFileId(){
37
- return this.tag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && !isNaN(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
38
- }
39
-
40
- onFileIdChanged(fileId:number){
41
- this.tag.attributes[FileImageTagDataConsts.FileIdAttrName] = fileId;
42
- this.removeImageError();
43
- }
44
-
45
- removeImageError(){
46
- this.hasImageError = false;
47
- }
48
-
49
- ngOnInit(): void {
50
- }
51
-
52
- }
@@ -1,7 +0,0 @@
1
- export * from './external-video-block/external-video-block.component'
2
- export * from './html-raw-editor/html-raw-editor.component'
3
- export * from './image-editor/image-editor.component'
4
- export * from './main-editor/main-editor.component'
5
- export * from './main-editor-block/main-editor-block.component'
6
- export * from './text-editor/text-editor.component'
7
- export * from './visual-editor/visual-editor.component'
@@ -1,48 +0,0 @@
1
- .example-list {
2
- width: 500px;
3
- max-width: 100%;
4
- border: solid 1px #ccc;
5
- min-height: 60px;
6
- display: block;
7
- background: white;
8
- border-radius: 4px;
9
- overflow: hidden;
10
- }
11
-
12
- .example-box {
13
- padding: 20px 10px;
14
- border-bottom: solid 1px #ccc;
15
- color: rgba(0, 0, 0, 0.87);
16
- display: flex;
17
- flex-direction: row;
18
- align-items: center;
19
- justify-content: space-between;
20
- box-sizing: border-box;
21
- cursor: move;
22
- background: white;
23
- font-size: 14px;
24
- }
25
-
26
- .cdk-drag-preview {
27
- box-sizing: border-box;
28
- border-radius: 4px;
29
- box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
30
- 0 8px 10px 1px rgba(0, 0, 0, 0.14),
31
- 0 3px 14px 2px rgba(0, 0, 0, 0.12);
32
- }
33
-
34
- .cdk-drag-placeholder {
35
- opacity: 0;
36
- }
37
-
38
- .cdk-drag-animating {
39
- transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
40
- }
41
-
42
- .example-box:last-child {
43
- border: none;
44
- }
45
-
46
- .example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder) {
47
- transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
48
- }
@@ -1,39 +0,0 @@
1
- <mat-tab-group>
2
- <mat-tab label="Визуальный редактор">
3
-
4
- <div style="height: 20px;"></div>
5
-
6
- <croco-visual-editor #visualEditor
7
- [useHtmlRaw]="useHtmlRaw"
8
- [html]="html"
9
- (onHtmlChanged)="onHtmlChangedHandler($event)"
10
- (rendered)="visualEditorRenderedHandler()">
11
- </croco-visual-editor>
12
-
13
- <div style="height: 20px;"></div>
14
-
15
- </mat-tab>
16
-
17
- <mat-tab label="Разметка">
18
- <div style="height: 10px;"></div>
19
- <form *ngIf="visualEditorRendered" [formGroup]="myForm">
20
- <mat-form-field class="w-100">
21
- <textarea matInput cdkTextareaAutosize #autosize="cdkTextareaAutosize"
22
- cdkAutosizeMinRows="1"
23
- placeholder="Исходный код" formControlName="html" [(ngModel)]="html"
24
- (ngModelChange)="textAreaModelChangedHandler()"></textarea>
25
- </mat-form-field>
26
- </form>
27
-
28
- <button (click)="copyMarkUp()"
29
- mat-raised-button color="primary">
30
- Копировать разметку
31
- </button>
32
- </mat-tab>
33
- <mat-tab label="Результат">
34
- <mat-card>
35
- <croco-html-xml-tag-view [data]="html | topreview">
36
- </croco-html-xml-tag-view>
37
- </mat-card>
38
- </mat-tab>
39
- </mat-tab-group>
@@ -1,71 +0,0 @@
1
- import { AfterContentChecked, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
2
- import { FormControl, FormGroup } from '@angular/forms';
3
- import { MatSnackBar } from '@angular/material/snack-bar';
4
- import { ClipboardService } from 'ngx-clipboard';
5
- import { VisualEditorComponent } from '../visual-editor/visual-editor.component';
6
-
7
- @Component({
8
- selector: 'croco-html-main-editor',
9
- templateUrl: './main-editor.component.html',
10
- styleUrls: ['./main-editor.component.css']
11
- })
12
- export class MainEditorComponent implements OnInit, AfterContentChecked {
13
-
14
- visualEditorRendered = false;
15
- @ViewChild("visualEditor")
16
- visualEditor!: VisualEditorComponent;
17
-
18
- @Input()
19
- showMarkUp = true;
20
-
21
- @Input()
22
- useHtmlRaw = false;
23
-
24
- myForm = new FormGroup({
25
- "html": new FormControl(),
26
- });
27
-
28
- @Input()
29
- @Output()
30
- html: string = "";
31
-
32
- @Output()
33
- onHtmlChanged = new EventEmitter<string>();
34
-
35
- constructor(private _clipboardService: ClipboardService,
36
- private _snackBar: MatSnackBar,
37
- private _cdref: ChangeDetectorRef) { }
38
-
39
- ngAfterContentChecked(): void {
40
- this._cdref.detectChanges();
41
- }
42
-
43
- visualEditorRenderedHandler(){
44
- this.visualEditorRendered = true;
45
- this.recalculateBodyTags();
46
- }
47
-
48
- onHtmlChangedHandler(html: string) {
49
- this.html = html;
50
- this.onHtmlChanged.emit(html);
51
- }
52
-
53
- textAreaModelChangedHandler(){
54
- this.recalculateBodyTags();
55
- this.onHtmlChangedHandler(this.html);
56
- }
57
-
58
- recalculateBodyTags() {
59
- this.visualEditor.html = this.html;
60
- this.visualEditor.recalculateBodyTags();
61
- }
62
-
63
- copyMarkUp() {
64
- this._snackBar.open("Разметка таблицы скопирована в буфер обмена", "Закрыть", { duration: 1500 });
65
- this._clipboardService.copy(this.html);
66
- }
67
-
68
- ngOnInit(): void {
69
- }
70
-
71
- }