Browse Source

Update editor again.

pull/1041/head
Sebastian 3 years ago
parent
commit
e9afb664db
  1. 1
      backend/i18n/frontend_en.json
  2. 1
      backend/i18n/frontend_fr.json
  3. 1
      backend/i18n/frontend_it.json
  4. 1
      backend/i18n/frontend_nl.json
  5. 1
      backend/i18n/frontend_pt.json
  6. 1
      backend/i18n/frontend_zh.json
  7. 1
      backend/i18n/source/frontend_en.json
  8. 2
      backend/src/Squidex/wwwroot/editor/squidex-editor.css
  9. 454
      backend/src/Squidex/wwwroot/editor/squidex-editor.js
  10. 2
      frontend/src/app/features/content/shared/forms/iframe-editor.component.html
  11. 12
      frontend/src/app/features/content/shared/forms/iframe-editor.component.ts
  12. 2
      frontend/src/app/features/content/shared/references/references-editor.component.html
  13. 2
      frontend/src/app/shared/components/forms/rich-editor.component.html
  14. 4
      frontend/src/app/shared/components/references/content-selector.component.html
  15. 13
      frontend/src/app/shared/components/references/content-selector.component.ts
  16. 2
      frontend/src/app/shared/components/references/reference-input.component.html

1
backend/i18n/frontend_en.json

@ -503,6 +503,7 @@
"contents.referencesCreateNew": "Add New",
"contents.referencesCreatePublish": "Create and Publish",
"contents.referencesLink": "Link selected contents ({count})",
"contents.referencesNoSchema": "No Schema",
"contents.referencesSelectExisting": "Select Existing",
"contents.referencesSelectSchema": "Select {schema}",
"contents.refreshTooltip": "Refresh Contents",

1
backend/i18n/frontend_fr.json

@ -503,6 +503,7 @@
"contents.referencesCreateNew": "Ajouter nouveau",
"contents.referencesCreatePublish": "Créer et publier",
"contents.referencesLink": "Lier le contenu sélectionné ({count})",
"contents.referencesNoSchema": "No Schema",
"contents.referencesSelectExisting": "Sélectionnez existant",
"contents.referencesSelectSchema": "Sélectionner {schema}",
"contents.refreshTooltip": "Actualiser le contenu",

1
backend/i18n/frontend_it.json

@ -503,6 +503,7 @@
"contents.referencesCreateNew": "Aggiungi nuovo",
"contents.referencesCreatePublish": "Crea e pubblica",
"contents.referencesLink": "Collega i contenuti selezionati ({count})",
"contents.referencesNoSchema": "No Schema",
"contents.referencesSelectExisting": "Seleziona da contenuti esistenti",
"contents.referencesSelectSchema": "Seleziona {schema}",
"contents.refreshTooltip": "Aggiorna i contenuti",

1
backend/i18n/frontend_nl.json

@ -503,6 +503,7 @@
"contents.referencesCreateNew": "Nieuwe toevoegen",
"contents.referencesCreatePublish": "Maken en publiceren",
"contents.referencesLink": "Link geselecteerde inhoud ({count})",
"contents.referencesNoSchema": "No Schema",
"contents.referencesSelectExisting": "Selecteer bestaande",
"contents.referencesSelectSchema": "Selecteer {schema}",
"contents.refreshTooltip": "Ververs inhoud",

1
backend/i18n/frontend_pt.json

@ -503,6 +503,7 @@
"contents.referencesCreateNew": "Adicionar Novo",
"contents.referencesCreatePublish": "Criar e Publicar",
"contents.referencesLink": "Link conteúdo selecionado ({count})",
"contents.referencesNoSchema": "No Schema",
"contents.referencesSelectExisting": "Selecione Existente",
"contents.referencesSelectSchema": "Selecione {schema}",
"contents.refreshTooltip": "Atualizar conteúdos",

1
backend/i18n/frontend_zh.json

@ -503,6 +503,7 @@
"contents.referencesCreateNew": "新增",
"contents.referencesCreatePublish": "创建和发布",
"contents.referencesLink": "链接所选内容 ({count})",
"contents.referencesNoSchema": "No Schema",
"contents.referencesSelectExisting": "选择现有",
"contents.referencesSelectSchema": "选择 {schema}",
"contents.refreshTooltip": "刷新内容",

1
backend/i18n/source/frontend_en.json

@ -503,6 +503,7 @@
"contents.referencesCreateNew": "Add New",
"contents.referencesCreatePublish": "Create and Publish",
"contents.referencesLink": "Link selected contents ({count})",
"contents.referencesNoSchema": "No Schema",
"contents.referencesSelectExisting": "Select Existing",
"contents.referencesSelectSchema": "Select {schema}",
"contents.refreshTooltip": "Refresh Contents",

2
backend/src/Squidex/wwwroot/editor/squidex-editor.css

@ -1 +1 @@
.remirror-theme{width:100%}.remirror-theme{position:relative}.remirror-theme *{box-sizing:border-box}.remirror-editor{min-height:300px!important;max-height:500px}.MuiStack-root>.MuiBox-root{margin-right:5px}.MuiBox-root>.MuiButtonBase-root{border-color:#dedfe3!important;border-radius:0}.MuiBox-root>.MuiButtonBase-root{border-left-width:0!important}.MuiBox-root>.MuiBox-root:first-child>.MuiButtonBase-root{border-left-width:1px!important}.MuiStack-root>.MuiBox-root>.MuiButtonBase-root:first-child{border-left-width:1px!important}.MuiButtonBase-root.Mui-selected:hover{background-color:#3284f4!important}.remirror-editor-wrapper{padding-top:0!important}.custom-icon path{fill:#0000008a}.remirror-theme div.ProseMirror{border:1px solid #dedfe3!important;border-radius:0!important;box-shadow:none!important}.MuiTooltip-popper>div{background-color:#1a2129;border-radius:0;font-size:85%;font-weight:400;padding:.5rem}.MuiMenu-paper{transform:none!important}.squidex-editor-disabled{pointer-events:none}.squidex-editor-menu{border:1px solid #dedfe3;border-bottom:0;padding:5px}.squidex-editor-counter{border:1px solid #dedfe3;border-top:0;font-size:85%;font-weight:400;opacity:.8;padding:4px 10px 4px 4px;text-align:right}.squidex-editor-image-view{border:1px solid #dedfe3;border-radius:0;display:inline-block;margin-top:15px;margin-bottom:15px;overflow:hidden}.squidex-editor-image-buttons{bottom:10px;left:10px;position:absolute}.squidex-editor-image-element{display:block;max-width:400px;max-height:400px}.squidex-editor-image-info{left:10px;top:10px;position:absolute;background-color:#3284f4;color:#fff;font-size:85%;font-weight:400;padding:2px 6px}.squidex-editor-content-link{align-items:center;border-radius:2px;border:1px solid #dedfe3;padding:10px;display:flex;flex-direction:row;flex-wrap:nowrap;margin-top:10px;margin-bottom:10px}.squidex-editor-content-schema{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;border-right:1px solid #c2c4cc;color:#8b8f9d;flex-shrink:0;padding-left:10px;padding-right:10px;width:200px}.squidex-editor-content-name{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;padding-left:10px;padding-right:0}.squidex-editor-html{margin-bottom:10px;margin-top:10px;position:relative}.squidex-editor-html-label{left:6px;top:0;position:absolute;color:#8b8f9d;font-size:85%;font-weight:400}.squidex-editor-html textarea{font-family:monospace;padding:30px 20px 20px}.squidex-editor-button{align-items:center;background-color:#fff;border-radius:0;border:1px solid #dedfe3;bottom:10px;display:inline-flex;font-size:85%;font-weight:400;margin-right:5px;padding:6px 12px}.squidex-editor-button:hover{background-color:#f5f5f5}.squidex-editor-input{border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;height:30px;margin-left:0;margin-right:5px;outline:none;padding:6px 12px}.squidex-editor-input:active{border-color:#3284f4}.squidex-editor-floating{border:1px solid #dedfe3}.squidex-editor-floating .MuiBox-root{margin-right:0!important}.squidex-editor-floating .MuiButtonBase-root{height:30px}.squidex-editor-modal-wrapper,.squidex-editor-modal-backdrop{bottom:0;left:0;right:0;top:0;position:absolute}.squidex-editor-modal-backdrop{background-color:#00000003}.squidex-editor-modal-window{left:50%;top:50%;background-color:#fff;border:0;border-radius:.25rem;box-sizing:border-box;box-shadow:0 3px 16px #0003;margin-top:-50px;margin-left:-150px;position:absolute;width:350px}.squidex-editor-modal-body{display:flex;flex-direction:row;flex-grow:1;padding-top:0!important}.squidex-editor-modal-body,.squidex-editor-modal-title{padding:15px}.squidex-editor-modal-title{font-size:85%}.squidex-editor-modal-window input{flex-grow:1}.b:before{content:"<a>";font-family:monospace;font-size:90%}.b:after{content:"</a>";font-family:monospace;font-size:90%}
.remirror-theme{width:100%}.remirror-theme{position:relative}.remirror-theme *{box-sizing:border-box}.remirror-theme .ProseMirror p{margin-bottom:1rem!important}.remirror-editor{min-height:300px!important;max-height:500px}.MuiStack-root>.MuiBox-root{margin-right:5px}.MuiBox-root>.MuiButtonBase-root{border-color:#dedfe3!important;border-radius:0}.MuiBox-root>.MuiButtonBase-root{border-left-width:0!important}.MuiBox-root>.MuiBox-root:first-child>.MuiButtonBase-root{border-left-width:1px!important}.MuiStack-root>.MuiBox-root>.MuiButtonBase-root:first-child{border-left-width:1px!important}.MuiButtonBase-root.Mui-selected:hover{background-color:#3284f4!important}.remirror-editor-wrapper{padding-top:0!important}.custom-icon path{fill:#0000008a}.remirror-theme div.ProseMirror{border:1px solid #dedfe3!important;border-radius:0!important;box-shadow:none!important}.MuiTooltip-popper>div{background-color:#1a2129;border-radius:0;font-size:85%;font-weight:400;padding:.5rem}.MuiMenu-paper{transform:none!important}.squidex-editor-disabled{pointer-events:none}.squidex-editor-menu{border:1px solid #dedfe3;border-bottom:0;padding:5px}.squidex-editor-counter{border:1px solid #dedfe3;border-top:0;font-size:85%;font-weight:400;opacity:.8;padding:4px 10px 4px 4px;text-align:right}.squidex-editor-image-view{border:1px solid #dedfe3;border-radius:0;display:inline-block;margin-top:15px;margin-bottom:15px;overflow:hidden}.squidex-editor-image-buttons{bottom:10px;left:10px;position:absolute}.squidex-editor-image-element{display:block;max-width:400px;max-height:400px}.squidex-editor-image-info{left:10px;top:10px;position:absolute;background-color:#3284f4;color:#fff;font-size:85%;font-weight:400;padding:2px 6px}.squidex-editor-content-link{align-items:center;border-radius:2px;border:1px solid #dedfe3;padding:10px;display:flex;flex-direction:row;flex-wrap:nowrap;margin-top:10px;margin-bottom:10px}.squidex-editor-content-schema{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;border-right:1px solid #c2c4cc;color:#8b8f9d;flex-shrink:0;padding-left:10px;padding-right:10px;width:200px}.squidex-editor-content-name{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;padding-left:10px;padding-right:0}.squidex-editor-html{margin-bottom:10px;margin-top:10px;position:relative}.squidex-editor-html-label{left:6px;top:0;position:absolute;color:#8b8f9d;font-size:85%;font-weight:400}.squidex-editor-html textarea{font-family:monospace;padding:30px 20px 20px}.squidex-editor-button{align-items:center;background-color:#fff;border-radius:0;border:1px solid #dedfe3;bottom:10px;display:inline-flex;font-size:85%;font-weight:400;margin-right:5px;padding:6px 12px}.squidex-editor-button:hover{background-color:#f5f5f5}.squidex-editor-input{border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;height:30px;margin-left:0;margin-right:5px;outline:none;padding:6px 12px}.squidex-editor-input:active{border-color:#3284f4}.squidex-editor-floating{border:1px solid #dedfe3}.squidex-editor-floating .MuiBox-root{margin-right:0!important}.squidex-editor-floating .MuiButtonBase-root{height:30px}.squidex-editor-modal-wrapper,.squidex-editor-modal-backdrop{bottom:0;left:0;right:0;top:0;position:absolute}.squidex-editor-modal-backdrop{background-color:#00000003}.squidex-editor-modal-window{left:50%;top:50%;background-color:#fff;border:0;border-radius:.25rem;box-sizing:border-box;box-shadow:0 3px 16px #0003;margin-top:-50px;margin-left:-150px;position:absolute;width:350px}.squidex-editor-modal-body{display:flex;flex-direction:row;flex-grow:1;padding-top:0!important}.squidex-editor-modal-body,.squidex-editor-modal-title{padding:15px}.squidex-editor-modal-title{font-size:85%}.squidex-editor-modal-window input{flex-grow:1}.b:before{content:"<a>";font-family:monospace;font-size:90%}.b:after{content:"</a>";font-family:monospace;font-size:90%}

454
backend/src/Squidex/wwwroot/editor/squidex-editor.js

File diff suppressed because one or more lines are too long

2
frontend/src/app/features/content/shared/forms/iframe-editor.component.html

@ -14,5 +14,5 @@
[query]="contentsQuery"
[language]="language"
[languages]="languages"
[schemaNames]="contentsSchemas">
[schemaIdentifiers]="contentsSchemas">
</sqx-content-selector>

12
frontend/src/app/features/content/shared/forms/iframe-editor.component.ts

@ -211,16 +211,26 @@ export class IFrameEditorComponent extends StatefulComponent<State> implements O
if (correlationId) {
this.assetsCorrelationId = correlationId;
this.assetsDialog.show();
this.detectChanges();
}
} else if (type === 'pickContents') {
const { correlationId, schemas, query, selectedIds } = event.data;
if (correlationId) {
let schemaIds: ReadonlyArray<string> | undefined = undefined;
if (this.schemaIds && this.schemaIds.length > 0) {
schemaIds = this.schemaIds;
} else if (Types.isArrayOfString(schemas) && schemas.length > 0) {
schemaIds = schemas;
}
this.contentsQuery = query;
this.contentsCorrelationId = correlationId;
this.contentsSelectedIds = Types.isArrayOfString(selectedIds) ? selectedIds : undefined;
this.contentsSchemas = this.schemaIds && this.schemaIds.length > 0 ? this.schemaIds : Types.isArrayOfString(schemas) ? schemas : undefined;
this.contentsSchemas = schemaIds;
this.contentsDialog.show();
this.detectChanges();
}
}

2
frontend/src/app/features/content/shared/references/references-editor.component.html

@ -53,5 +53,5 @@
[language]="language"
[languages]="languages"
[query]="query"
[schemaIds]="schemaIds">
[schemaIdentifiers]="schemaIds">
</sqx-content-selector>

2
frontend/src/app/shared/components/forms/rich-editor.component.html

@ -12,7 +12,7 @@
(contentSelect)="insertContents($event)"
[language]="language"
[languages]="languages"
[schemaIds]="schemaIds">
[schemaIdentifiers]="schemaIds">
</sqx-content-selector>
<sqx-chat-dialog *sqxModal="chatDialog" showFormatHint="false"

4
frontend/src/app/shared/components/references/content-selector.component.html

@ -13,6 +13,10 @@
<div *ngIf="schemas.length === 1">
{{ 'contents.referencesSelectSchema' | sqxTranslate: { schema: schemas[0].displayName } }}
</div>
<div *ngIf="schemas.length === 0">
{{ 'contents.referencesNoSchema' | sqxTranslate }}
</div>
</ng-container>
<ng-container tabs>

13
frontend/src/app/shared/components/references/content-selector.component.ts

@ -34,10 +34,7 @@ export class ContentSelectorComponent implements OnInit {
public schemaName?: string | null;
@Input()
public schemaIds?: ReadonlyArray<string>;
@Input()
public schemaNames?: ReadonlyArray<string>;
public schemaIdentifiers?: ReadonlyArray<string>;
@Input()
public query?: string;
@ -97,12 +94,8 @@ export class ContentSelectorComponent implements OnInit {
this.schemas = this.schemasState.snapshot.schemas.filter(x => x.type === 'Default' && x.canReadContents);
if (this.schemaIds && this.schemaIds.length > 0) {
this.schemas = this.schemas.filter(x => this.schemaIds!.includes(x.id));
}
if (this.schemaNames && this.schemaNames.length > 0) {
this.schemas = this.schemas.filter(x => this.schemaNames!.includes(x.name));
if (this.schemaIdentifiers && this.schemaIdentifiers.length > 0) {
this.schemas = this.schemas.filter(x => this.schemaIdentifiers!.includes(x.id) || this.schemaIdentifiers!.includes(x.name));
}
this.selectSchema(this.schemas[0]);

2
frontend/src/app/shared/components/references/reference-input.component.html

@ -11,6 +11,6 @@
[language]="language"
[languages]="languages"
[query]="query"
[schemaIds]="schemaIds"
[schemaIdentifiers]="schemaIds"
maxItems="1">
</sqx-content-selector>
Loading…
Cancel
Save