@dignite-ng/expand.ck-editor 3.0.0-rc.1 → 3.0.0-rc.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.
@@ -8,4 +8,5 @@ export * from './lib/enums/languages-map';
8
8
  export * from './lib/object/ck-editor-object';
9
9
  export * from './lib/adapter';
10
10
  export * from './lib/pipes';
11
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2NrLWVkaXRvci9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxnQ0FBZ0MsQ0FBQztBQUMvQyxjQUFjLHVDQUF1QyxDQUFDO0FBQ3RELGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLGFBQWEsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2YgY2stZWRpdG9yXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9saWIvY2stZWRpdG9yLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9jay1lZGl0b3Itcm91dGluZy5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZHluYW1pYy1mb3JtL2Zvcm0tY29udHJvbC1ncm91cCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9lbnVtcy9sYW5ndWFnZXMtbWFwJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL29iamVjdC9jay1lZGl0b3Itb2JqZWN0JztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2FkYXB0ZXInO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvcGlwZXMnO1xuIl19
11
+ export * from './lib/services';
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2NrLWVkaXRvci9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxnQ0FBZ0MsQ0FBQztBQUMvQyxjQUFjLHVDQUF1QyxDQUFDO0FBQ3RELGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLGdCQUFnQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBjay1lZGl0b3JcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jay1lZGl0b3IubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2NrLWVkaXRvci1yb3V0aW5nLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9keW5hbWljLWZvcm0vZm9ybS1jb250cm9sLWdyb3VwJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2VudW1zL2xhbmd1YWdlcy1tYXAnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvb2JqZWN0L2NrLWVkaXRvci1vYmplY3QnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvYWRhcHRlcic7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9waXBlcyc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zZXJ2aWNlcyc7XG4iXX0=
@@ -1,25 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Component, NgModule, Input, ViewChild, Pipe } from '@angular/core';
2
+ import { Injectable, inject, Component, NgModule, Input, ViewChild, Pipe } from '@angular/core';
3
3
  import * as i1$1 from '@angular/router';
4
4
  import { RouterModule } from '@angular/router';
5
5
  import { AccessibilityHelp, Alignment, Autoformat, AutoImage, Autosave, Base64UploadAdapter, BlockQuote, Bold, CloudServices, Code, Essentials, FontBackgroundColor, FontColor, FontFamily, FontSize, GeneralHtmlSupport, Heading, Highlight, HorizontalLine, ImageBlock, ImageCaption, ImageInline, ImageInsert, ImageInsertViaUrl, ImageResize, ImageStyle, ImageTextAlternative, ImageToolbar, ImageUpload, Indent, IndentBlock, Italic, Link, LinkImage, List, ListProperties, MediaEmbed, Paragraph, PasteFromOffice, RemoveFormat, SelectAll, SpecialCharacters, SpecialCharactersArrows, SpecialCharactersCurrency, SpecialCharactersEssentials, SpecialCharactersLatin, SpecialCharactersMathematical, SpecialCharactersText, Strikethrough, Style, Subscript, Superscript, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, TextTransformation, TodoList, Underline, Undo, ClassicEditor } from 'ckeditor5';
6
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/zh-cn';
7
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/de-ch';
8
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/en-gb';
9
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/pt-br';
10
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/zh';
11
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/de';
12
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/ar';
13
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/cs';
14
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/hi';
15
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/fi';
16
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/hu';
17
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/fr';
18
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/it';
19
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/sk';
20
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/ja';
21
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/es';
22
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/vi';
23
6
  import * as i2$1 from '@abp/ng.core';
24
7
  import { ConfigStateService, LazyLoadService, SubscriptionService, LOADING_STRATEGY, RestService, CoreModule } from '@abp/ng.core';
25
8
  import * as i1 from '@angular/forms';
@@ -923,7 +906,7 @@ var LanguagesMap;
923
906
  (function (LanguagesMap) {
924
907
  LanguagesMap["ar"] = "ar";
925
908
  LanguagesMap["cs"] = "cs";
926
- LanguagesMap["en"] = "en";
909
+ LanguagesMap["en"] = "en-gb";
927
910
  LanguagesMap["hi"] = "hi";
928
911
  LanguagesMap["fi"] = "fi";
929
912
  LanguagesMap["hu"] = "hu";
@@ -941,11 +924,31 @@ var LanguagesMap;
941
924
  LanguagesMap["vi"] = "vi";
942
925
  })(LanguagesMap || (LanguagesMap = {}));
943
926
 
927
+ class SetCkEditorConfigsService {
928
+ constructor() { }
929
+ async get(input) {
930
+ let { language } = input;
931
+ return new Promise(async (resolve, rejects) => {
932
+ let configs = CkEditorTypesObject['easy'];
933
+ configs.language = LanguagesMap[language];
934
+ await import(`@ckeditor/ckeditor5-build-decoupled-document/build/translations/${LanguagesMap[language]}`);
935
+ resolve(configs);
936
+ });
937
+ }
938
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkEditorConfigsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
939
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkEditorConfigsService, providedIn: 'root' }); }
940
+ }
941
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkEditorConfigsService, decorators: [{
942
+ type: Injectable,
943
+ args: [{
944
+ providedIn: 'root',
945
+ }]
946
+ }], ctorParameters: () => [] });
947
+
944
948
  class CkEditorDomeComponent {
945
949
  constructor() {
946
950
  this.config = inject(ConfigStateService);
947
951
  this.currentCulture = this.config.getOne('localization')?.currentCulture?.name;
948
- // CkEditorTypesObject = CkEditorTypesObject
949
952
  this.Editor = ClassicEditor;
950
953
  this._config = {
951
954
  plugins: [Bold, Essentials, Italic, Paragraph, Undo],
@@ -953,7 +956,7 @@ class CkEditorDomeComponent {
953
956
  };
954
957
  this.configType = 'default';
955
958
  this.editorValue = '<p>12233</p>';
956
- this.languagesMap = LanguagesMap;
959
+ this._SetCkEditorConfigsService = inject(SetCkEditorConfigsService);
957
960
  this.lazyLoadService = inject(LazyLoadService);
958
961
  this.subscriptionService = inject(SubscriptionService);
959
962
  this._config_ck = CkEditorTypesObject['full'];
@@ -962,11 +965,11 @@ class CkEditorDomeComponent {
962
965
  switchType(type) {
963
966
  this.configType = type;
964
967
  this._config_ck = '';
965
- setTimeout(() => {
968
+ setTimeout(async () => {
966
969
  this.loadStyle();
967
- let configs = CkEditorTypesObject[type];
968
- configs.language = this.languagesMap[this.currentCulture];
969
- // configs.translations= [coreTranslations]
970
+ let configs = await this._SetCkEditorConfigsService.get({
971
+ language: this.currentCulture,
972
+ });
970
973
  this._config_ck = configs;
971
974
  }, 0);
972
975
  }
@@ -1145,12 +1148,12 @@ class CkEditorControlComponent {
1145
1148
  this.ckEditorValue = '';
1146
1149
  /**系统语言 */
1147
1150
  this.currentCulture = this.config.getOne('localization')?.currentCulture?.name;
1148
- /** 语言目录,匹配系统语言,设置ckeditor的语言 */
1149
- this.languagesMap = LanguagesMap;
1150
1151
  this.Editor = ClassicEditor;
1151
1152
  this.fb = inject(FormBuilder);
1152
1153
  /**字段配置列表 */
1153
1154
  this._fields = '';
1155
+ this.languagesMap = LanguagesMap;
1156
+ this._SetCkEditorConfigsService = inject(SetCkEditorConfigsService);
1154
1157
  this.lazyLoadService = inject(LazyLoadService);
1155
1158
  this.subscriptionService = inject(SubscriptionService);
1156
1159
  this.invalidfeedback = false;
@@ -1191,16 +1194,21 @@ class CkEditorControlComponent {
1191
1194
  async dataLoaded() {
1192
1195
  if (this._fields && this._entity) {
1193
1196
  await this.AfterInit();
1194
- this.ckEditorValue = this._selected || this._fields.field.formConfiguration['Ckeditor.InitialContent'];
1197
+ this.ckEditorValue =
1198
+ this._selected || this._fields.field.formConfiguration['Ckeditor.InitialContent'];
1195
1199
  this.setckeditorInput(this.ckEditorValue);
1196
1200
  this.submitclick.nativeElement.click();
1197
1201
  }
1198
1202
  }
1199
1203
  loadckeditor() {
1200
- this.loadStyle();
1201
- let configs = CkEditorTypesObject['default'];
1202
- configs.language = this.languagesMap[this.currentCulture];
1203
- this.ckOptions = configs;
1204
+ return new Promise(async (resolve) => {
1205
+ this.loadStyle();
1206
+ let configs = await this._SetCkEditorConfigsService.get({
1207
+ language: this.currentCulture,
1208
+ });
1209
+ this.ckOptions = configs;
1210
+ resolve(true);
1211
+ });
1204
1212
  }
1205
1213
  loadStyle() {
1206
1214
  const loaded$ = this.lazyLoadService.load(LOADING_STRATEGY.AppendAnonymousStyleToHead('ckeditor5.css'));
@@ -1221,20 +1229,19 @@ class CkEditorControlComponent {
1221
1229
  ? this._selected
1222
1230
  : this._fields.field.formConfiguration['Ckeditor.InitialContent'], ValidatorsArray);
1223
1231
  this.extraProperties.setControl(this._fields.field.name, newControl);
1224
- this.imagesContainerName =
1225
- this._fields.field.formConfiguration['Ckeditor.ImagesContainerName'];
1232
+ this.imagesContainerName = this._fields.field.formConfiguration['Ckeditor.ImagesContainerName'];
1226
1233
  if (!this.imagesContainerName) {
1227
- this.ckOptions.toolbar.items.splice(this.ckOptions.toolbar.items.indexOf('insertImage'), 1);
1234
+ this.ckOptions?.toolbar?.items?.splice(this.ckOptions?.toolbar?.items?.indexOf('insertImage'), 1);
1228
1235
  }
1229
1236
  resolve(true);
1230
1237
  });
1231
1238
  }
1232
1239
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1233
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorControlComponent, selector: "ck-editor-control", inputs: { fields: "fields", parentFiledName: "parentFiledName", selected: "selected", entity: "entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ckeditor [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\" [formControlName]=\"_fields.field.name\">\n </ckeditor>\n <!-- <ng-container *ngIf=\"ckeditorInput?.errors?.required&&invalidfeedback\">\n <div class=\"text-danger \">\n {{'DigniteAbpForms::Validate:Required' | abpLocalization:' '}}\n </div>\n </ng-container> -->\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i4.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }] }); }
1240
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorControlComponent, selector: "ck-editor-control", inputs: { fields: "fields", parentFiledName: "parentFiledName", selected: "selected", entity: "entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"ckOptions\">\n\n <ckeditor [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\"\n [formControlName]=\"_fields.field.name\">\n </ckeditor>\n </ng-container>\n <small class=\"form-text text-muted d-block\"\n *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i4.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }] }); }
1234
1241
  }
1235
1242
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, decorators: [{
1236
1243
  type: Component,
1237
- args: [{ selector: 'ck-editor-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ckeditor [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\" [formControlName]=\"_fields.field.name\">\n </ckeditor>\n <!-- <ng-container *ngIf=\"ckeditorInput?.errors?.required&&invalidfeedback\">\n <div class=\"text-danger \">\n {{'DigniteAbpForms::Validate:Required' | abpLocalization:' '}}\n </div>\n </ng-container> -->\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
1244
+ args: [{ selector: 'ck-editor-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"ckOptions\">\n\n <ckeditor [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\"\n [formControlName]=\"_fields.field.name\">\n </ckeditor>\n </ng-container>\n <small class=\"form-text text-muted d-block\"\n *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
1238
1245
  }], ctorParameters: () => [], propDecorators: { fields: [{
1239
1246
  type: Input
1240
1247
  }], parentFiledName: [{
@@ -1396,5 +1403,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1396
1403
  * Generated bundle index. Do not edit.
1397
1404
  */
1398
1405
 
1399
- export { AddFieldControlGroup, CkEditorModule, CkEditorRoutingModule, CkEditorTypesObject, LanguagesMap, SetCkeditorContentPipe, ckEditorFieldControlGroup, defaults, easy, full, getExcludeAssignControl, isBase64UploadAdapter, standard };
1406
+ export { AddFieldControlGroup, CkEditorModule, CkEditorRoutingModule, CkEditorTypesObject, LanguagesMap, SetCkEditorConfigsService, SetCkeditorContentPipe, ckEditorFieldControlGroup, defaults, easy, full, getExcludeAssignControl, isBase64UploadAdapter, standard };
1400
1407
  //# sourceMappingURL=dignite-ng-expand.ck-editor.mjs.map