diff --git a/.gitattributes b/.gitattributes index 31a0c994dec29d7fc7c75a56ce8980aeae03d474..0654e70912b5a6ce50798a0b00cbdddae2950f34 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,6 +33,3 @@ *.t3s text eol=lf *.txt text eol=lf /typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/codesnippet/lib/highlight/LICENSE text eol=lf -/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/AUTHORS text eol=lf -/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/LICENSE text eol=lf -/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/bin/source-highlight text eol=lf diff --git a/Build/Gruntfile.js b/Build/Gruntfile.js index 13876b08e5773b799ed13556642098d48273079e..a20d305e61220dc1c915d587d98bee2788f65a38 100644 --- a/Build/Gruntfile.js +++ b/Build/Gruntfile.js @@ -118,7 +118,6 @@ module.exports = function (grunt) { linkvalidator: '<%= paths.sysext %>linkvalidator/Resources/', backend: '<%= paths.sysext %>backend/Resources/', styleguide: '<%= paths.sysext %>styleguide/Resources/', - t3editor: '<%= paths.sysext %>t3editor/Resources/', workspaces: '<%= paths.sysext %>workspaces/Resources/', ckeditor: '<%= paths.sysext %>rte_ckeditor/Resources/', core: '<%= paths.sysext %>core/Resources/', @@ -268,9 +267,6 @@ module.exports = function (grunt) { styleguide: { src: '<%= paths.styleguide %>Public/Css/*.css' }, - t3editor: { - src: '<%= paths.t3editor %>Public/Css/**/*.css' - }, workspaces: { src: '<%= paths.workspaces %>Public/Css/*.css' } @@ -443,36 +439,36 @@ module.exports = function (grunt) { { expand: true, cwd: '<%= paths.node_modules %>@codemirror', - dest: '<%= paths.t3editor %>Public/JavaScript/Contrib/@codemirror/', + dest: '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/', rename: (dest, src) => dest + src.replace('/dist/index', ''), src: ['*/dist/index.js'] }, { expand: true, cwd: '<%= paths.node_modules %>@lezer', - dest: '<%= paths.t3editor %>Public/JavaScript/Contrib/@lezer/', + dest: '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/', rename: (dest, src) => dest + src.replace('/dist/index.es', ''), src: ['*/dist/index.es.js'] }, { src: '<%= paths.node_modules %>@lezer/lr/dist/index.js', - dest: '<%= paths.t3editor %>Public/JavaScript/Contrib/@lezer/lr.js' + dest: '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/lr.js' }, { src: '<%= paths.node_modules %>@lezer/common/dist/index.js', - dest: '<%= paths.t3editor %>Public/JavaScript/Contrib/@lezer/common.js' + dest: '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/common.js' }, { src: '<%= paths.node_modules %>crelt/index.es.js', - dest: '<%= paths.t3editor %>Public/JavaScript/Contrib/crelt.js' + dest: '<%= paths.backend %>Public/JavaScript/Contrib/crelt.js' }, { src: '<%= paths.node_modules %>style-mod/src/style-mod.js', - dest: '<%= paths.t3editor %>Public/JavaScript/Contrib/style-mod.js' + dest: '<%= paths.backend %>Public/JavaScript/Contrib/style-mod.js' }, { src: '<%= paths.node_modules %>w3c-keyname/index.es.js', - dest: '<%= paths.t3editor %>Public/JavaScript/Contrib/w3c-keyname.js' + dest: '<%= paths.backend %>Public/JavaScript/Contrib/w3c-keyname.js' }, ] } @@ -769,6 +765,33 @@ module.exports = function (grunt) { }, thirdparty: { files: { + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/autocomplete.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/autocomplete.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/commands.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/commands.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-css.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-css.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-html.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-html.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-javascript.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-javascript.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-json.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-json.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-php.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-php.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-sql.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-sql.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/language.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/language.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-xml.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lang-xml.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lint.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/lint.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/search.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/search.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/state.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/state.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/theme-one-dark.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/theme-one-dark.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/view.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@codemirror/view.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/common.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@lezer/common.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/css.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@lezer/css.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/highlight.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@lezer/highlight.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/html.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@lezer/html.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/javascript.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@lezer/javascript.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/json.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@lezer/json.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/lr.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@lezer/lr.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/php.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@lezer/php.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/@lezer/xml.js': ['<%= paths.backend %>Public/JavaScript/Contrib/@lezer/xml.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/crelt.js': ['<%= paths.backend %>Public/JavaScript/Contrib/crelt.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/style-mod.js': ['<%= paths.backend %>Public/JavaScript/Contrib/style-mod.js'], + '<%= paths.backend %>Public/JavaScript/Contrib/w3c-keyname.js': ['<%= paths.backend %>Public/JavaScript/Contrib/w3c-keyname.js'], '<%= paths.core %>Public/JavaScript/Contrib/cropperjs.js': ['<%= paths.core %>Public/JavaScript/Contrib/cropperjs.js'], '<%= paths.core %>Public/JavaScript/Contrib/flatpickr/flatpickr.min.js': ['<%= paths.core %>Public/JavaScript/Contrib/flatpickr/flatpickr.min.js'], '<%= paths.core %>Public/JavaScript/Contrib/flatpickr/locales.js': ['<%= paths.core %>Public/JavaScript/Contrib/flatpickr/locales.js'], @@ -778,21 +801,6 @@ module.exports = function (grunt) { '<%= paths.core %>Public/JavaScript/Contrib/taboverride.js': ['<%= paths.core %>Public/JavaScript/Contrib/taboverride.js'] } }, - t3editor: { - files: [ - { - expand: true, - src: [ - '<%= paths.t3editor %>Public/JavaScript/Contrib/**/*.js' - ], - dest: '<%= paths.t3editor %>Public/JavaScript/Contrib', - cwd: '.', - rename: function (dest, src) { - return src; - } - } - ] - }, typescript: { options: { output: { @@ -830,7 +838,7 @@ module.exports = function (grunt) { lint: ['eslint', 'stylelint', 'exec:lintspaces'], compile_assets: ['scripts', 'css'], compile_flags: ['flags-build'], - minify_assets: ['terser:thirdparty', 'terser:t3editor'], + minify_assets: ['terser:thirdparty'], copy_static: ['copy:core_icons', 'copy:install_icons', 'copy:module_icons', 'copy:extension_icons', 'copy:fonts', 'copy-lit', 'copy:t3editor'], build: ['copy:core_icons', 'copy:install_icons', 'copy:module_icons', 'copy:extension_icons', 'copy:fonts', 'copy:t3editor'], }, diff --git a/Build/Sources/TypeScript/t3editor/autocomplete/completion-result.ts b/Build/Sources/TypeScript/backend/code-editor/autocomplete/completion-result.ts similarity index 95% rename from Build/Sources/TypeScript/t3editor/autocomplete/completion-result.ts rename to Build/Sources/TypeScript/backend/code-editor/autocomplete/completion-result.ts index 2eb7118076ad0b8c84952d31682dbca15475c0e5..c64c8ea25ac8776159692b2baf7cd2f8f376f62f 100644 --- a/Build/Sources/TypeScript/t3editor/autocomplete/completion-result.ts +++ b/Build/Sources/TypeScript/backend/code-editor/autocomplete/completion-result.ts @@ -11,8 +11,8 @@ * The TYPO3 project - inspiring people to share! */ -import type { TsRef, TsRefType } from '@typo3/t3editor/autocomplete/ts-ref'; -import type { TreeNode } from '@typo3/t3editor/autocomplete/ts-parser'; +import type { TsRef, TsRefType } from './ts-ref'; +import type { TreeNode } from './ts-parser'; export type Proposal = { type: string, diff --git a/Build/Sources/TypeScript/t3editor/autocomplete/ts-code-completion.ts b/Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-code-completion.ts similarity index 90% rename from Build/Sources/TypeScript/t3editor/autocomplete/ts-code-completion.ts rename to Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-code-completion.ts index 346731bfdb68c5564367400bd94d433fabb5eb52..b438e57e37e09d0da94a7185690f665e7a7a9b2f 100644 --- a/Build/Sources/TypeScript/t3editor/autocomplete/ts-code-completion.ts +++ b/Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-code-completion.ts @@ -12,15 +12,15 @@ */ /** - * Module: @typo3/t3editor/autocomplete/ts-code-completion + * Module: ./ts-code-completion * Contains the TsCodeCompletion class */ import AjaxRequest from '@typo3/core/ajax/ajax-request'; -import { TsRef } from '@typo3/t3editor/autocomplete/ts-ref'; -import { TsParser } from '@typo3/t3editor/autocomplete/ts-parser'; -import { CompletionResult, Proposal } from '@typo3/t3editor/autocomplete/completion-result'; +import { TsRef } from './ts-ref'; +import { TsParser } from './ts-parser'; +import { CompletionResult, Proposal } from './completion-result'; -import type { CodeMirror5CompatibleCompletionState } from '@typo3/t3editor/language/typoscript'; +import type { CodeMirror5CompatibleCompletionState } from '../language/typoscript'; export type ContentObjectIdentifier = string; @@ -77,7 +77,7 @@ export class TsCodeCompletion { if (Number.isNaN(id) || id === 0) { return null; } - new AjaxRequest(TYPO3.settings.ajaxUrls.t3editor_codecompletion_loadtemplates) + new AjaxRequest(TYPO3.settings.ajaxUrls.codeeditor_codecompletion_loadtemplates) .withQueryArguments({ pageId: id }) .get() .then(async (response) => { diff --git a/Build/Sources/TypeScript/t3editor/autocomplete/ts-parser.ts b/Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-parser.ts similarity index 98% rename from Build/Sources/TypeScript/t3editor/autocomplete/ts-parser.ts rename to Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-parser.ts index c893bad5db998d28c05c4808c25e7c908c280bc2..9b48fd22c0db588639aaadddf7f4f2508ef65b3a 100644 --- a/Build/Sources/TypeScript/t3editor/autocomplete/ts-parser.ts +++ b/Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-parser.ts @@ -11,9 +11,9 @@ * The TYPO3 project - inspiring people to share! */ -import type { TsRef } from '@typo3/t3editor/autocomplete/ts-ref'; -import type { TsObjTree } from '@typo3/t3editor/autocomplete/ts-code-completion'; -import type { CodeMirror5CompatibleCompletionState } from '@typo3/t3editor/language/typoscript'; +import type { TsRef } from './ts-ref'; +import type { TsObjTree } from './ts-code-completion'; +import type { CodeMirror5CompatibleCompletionState } from '../language/typoscript'; export class TreeNode { public value: string; diff --git a/Build/Sources/TypeScript/t3editor/autocomplete/ts-ref.ts b/Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-ref.ts similarity index 99% rename from Build/Sources/TypeScript/t3editor/autocomplete/ts-ref.ts rename to Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-ref.ts index f9a47cb9ac0cd270b0ab3a9890c18258abad7a53..e51a09addfb280ecd855f813836dec50e7aa8ee1 100644 --- a/Build/Sources/TypeScript/t3editor/autocomplete/ts-ref.ts +++ b/Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-ref.ts @@ -63,7 +63,7 @@ export class TsRef { * Load available TypoScript reference */ public async loadTsrefAsync(): Promise<void> { - const response = await new AjaxRequest(TYPO3.settings.ajaxUrls.t3editor_tsref).get(); + const response = await new AjaxRequest(TYPO3.settings.ajaxUrls.codeeditor_tsref).get(); this.doc = await response.resolve(); this.buildTree(); } diff --git a/Build/Sources/TypeScript/t3editor/element/code-mirror-element.ts b/Build/Sources/TypeScript/backend/code-editor/element/code-mirror-element.ts similarity index 94% rename from Build/Sources/TypeScript/t3editor/element/code-mirror-element.ts rename to Build/Sources/TypeScript/backend/code-editor/element/code-mirror-element.ts index fae36389b74338e19382caf628e3019f761acc5a..d2b12c319e8eb2841d95f656ae4244faf409734a 100644 --- a/Build/Sources/TypeScript/t3editor/element/code-mirror-element.ts +++ b/Build/Sources/TypeScript/backend/code-editor/element/code-mirror-element.ts @@ -31,7 +31,7 @@ import { executeJavaScriptModuleInstruction, loadModule, resolveSubjectRef, Java import '@typo3/backend/element/spinner-element'; /** - * Module: @typo3/t3editor/element/code-mirror-element + * Module: @typo3/backend/code-editor/element/code-mirror-element * Renders CodeMirror into FormEngine */ @customElement('typo3-t3editor-codemirror') @@ -161,6 +161,28 @@ export class CodeMirrorElement extends LitElement { observer.observe(this); } + /** + * @internal + */ + public setContent(newContent: string): void { + if (this.editorView !== null) { + this.editorView.dispatch({ + changes: { + from: 0, + to: this.editorView.state.doc.length, + insert: newContent + } + }); + } + } + + /** + * @internal + */ + public getContent(): string { + return this.editorView.state.doc.toString(); + } + private onKeydown(event: KeyboardEvent): void { if (event.ctrlKey && event.altKey && event.key === 'f') { event.preventDefault(); diff --git a/Build/Sources/TypeScript/t3editor/language/typoscript.ts b/Build/Sources/TypeScript/backend/code-editor/language/typoscript.ts similarity index 96% rename from Build/Sources/TypeScript/t3editor/language/typoscript.ts rename to Build/Sources/TypeScript/backend/code-editor/language/typoscript.ts index d14857f36f6a75afbc2e50f6ce3d65183a80ac66..b675f2e38cdc0d6277db573b225d807c8e25fe68 100644 --- a/Build/Sources/TypeScript/t3editor/language/typoscript.ts +++ b/Build/Sources/TypeScript/backend/code-editor/language/typoscript.ts @@ -1,8 +1,8 @@ import DocumentService from '@typo3/core/document-service'; import { StreamLanguage, LanguageSupport } from '@codemirror/language'; import { CompletionContext, CompletionResult } from '@codemirror/autocomplete'; -import { TypoScriptStreamParserFactory } from '@typo3/t3editor/stream-parser/typoscript'; -import { TsCodeCompletion } from '@typo3/t3editor/autocomplete/ts-code-completion'; +import { TypoScriptStreamParserFactory } from '../stream-parser/typoscript'; +import { TsCodeCompletion } from '../autocomplete/ts-code-completion'; import { syntaxTree } from '@codemirror/language'; import type { SyntaxNodeRef } from '@lezer/common'; @@ -23,7 +23,7 @@ export interface CodeMirror5CompatibleCompletionState { } /** - * Module: @typo3/t3editor/language/typoscript + * Module: @typo3/backend/code-editor/language/typoscript * * Entry Point module for CodeMirror v6 language highlighting and code completion for TypoScript. * This module combines our CodeMirror v5 style typoscript parser (via the StreamLanguage shim) and diff --git a/Build/Sources/TypeScript/t3editor/stream-parser/typoscript.ts b/Build/Sources/TypeScript/backend/code-editor/stream-parser/typoscript.ts similarity index 100% rename from Build/Sources/TypeScript/t3editor/stream-parser/typoscript.ts rename to Build/Sources/TypeScript/backend/code-editor/stream-parser/typoscript.ts diff --git a/Build/Sources/TypeScript/backend/grid-editor.ts b/Build/Sources/TypeScript/backend/grid-editor.ts index c1fe1b5fd346e35fc01719c9c85f0883a6880275..dfae9dd4955f78efdfc6d7e47eff4459a022e779 100644 --- a/Build/Sources/TypeScript/backend/grid-editor.ts +++ b/Build/Sources/TypeScript/backend/grid-editor.ts @@ -20,7 +20,7 @@ import { html, LitElement, nothing, TemplateResult } from 'lit'; import { classMap } from 'lit/directives/class-map'; import { StyleInfo, styleMap } from 'lit/directives/style-map'; import { ref, Ref, createRef } from 'lit/directives/ref'; -import { CodeMirrorElement } from '@typo3/t3editor/element/code-mirror-element'; +import { CodeMirrorElement } from '@typo3/backend/code-editor/element/code-mirror-element'; type Cell = { spanned: number, rowspan: number, colspan: number, name: string, colpos: string, column: number } diff --git a/Build/Sources/TypeScript/backend/pagetsconfig/pagetsconfig-includes.ts b/Build/Sources/TypeScript/backend/pagetsconfig/pagetsconfig-includes.ts index 63d54180e595a73a15d82dbac72304b39e3d53a7..399289ce1089036106dc9934168196c75359d4d3 100644 --- a/Build/Sources/TypeScript/backend/pagetsconfig/pagetsconfig-includes.ts +++ b/Build/Sources/TypeScript/backend/pagetsconfig/pagetsconfig-includes.ts @@ -52,13 +52,13 @@ class PageTsConfigIncludes { private async fetchModalContent(url: string): Promise<TemplateResult> { // no `await` purpose (webcomponents initialize lazily) - topLevelModuleImport('@typo3/t3editor/element/code-mirror-element.js'); + topLevelModuleImport('@typo3/backend/code-editor/element/code-mirror-element.js'); const response: AjaxResponse = await (new AjaxRequest(url)).get(); const source: string = await response.resolve(); const mode: JavaScriptItemPayload = { - name: '@typo3/t3editor/language/typoscript.js', + name: '@typo3/backend/code-editor/language/typoscript.js', flags: 2 /* FLAG_USE_IMPORTMAP */, exportName: 'typoscript', items: [ diff --git a/Build/Sources/TypeScript/tstemplate/template-analyzer.ts b/Build/Sources/TypeScript/tstemplate/template-analyzer.ts index 7a97ec41c71a11a4529765c0ca35b193e252c33c..9ca647265811980b7dd006dcedefbb0ac0bed06d 100644 --- a/Build/Sources/TypeScript/tstemplate/template-analyzer.ts +++ b/Build/Sources/TypeScript/tstemplate/template-analyzer.ts @@ -52,13 +52,13 @@ class TemplateAnalyzer { private async fetchModalContent(url: string): Promise<TemplateResult> { // no `await` purpose (webcomponents initialize lazily) - topLevelModuleImport('@typo3/t3editor/element/code-mirror-element.js'); + topLevelModuleImport('@typo3/backend/code-editor/element/code-mirror-element.js'); const response: AjaxResponse = await (new AjaxRequest(url)).get(); const source: string = await response.resolve(); const mode: JavaScriptItemPayload = { - name: '@typo3/t3editor/language/typoscript.js', + name: '@typo3/backend/code-editor/language/typoscript.js', flags: 2 /* FLAG_USE_IMPORTMAP */, exportName: 'typoscript', items: [ diff --git a/Build/tsconfig.json b/Build/tsconfig.json index ec982534e9c2eb01c5245433d60e792316c65a76..e61ea0d675fbfcd3d5ee555b104fe80a62bb92bf 100644 --- a/Build/tsconfig.json +++ b/Build/tsconfig.json @@ -84,9 +84,6 @@ "@typo3/styleguide/*": [ "styleguide/*" ], - "@typo3/t3editor/*": [ - "t3editor/*" - ], "@typo3/tstemplate/*": [ "tstemplate/*" ], diff --git a/Build/web-test-runner.config.mjs b/Build/web-test-runner.config.mjs index 20ff56bbf559b92ead8240b845ce74146998055a..9aa7d819e127386a5515c24d04643da9e1d32992 100644 --- a/Build/web-test-runner.config.mjs +++ b/Build/web-test-runner.config.mjs @@ -198,46 +198,46 @@ export default { '@typo3/lowlevel/': './typo3/sysext/lowlevel/Resources/Public/JavaScript/', '@typo3/opendocs/': './typo3/sysext/opendocs/Resources/Public/JavaScript/', - '@typo3/t3editor/': './typo3/sysext/t3editor/Resources/Public/JavaScript/', - 'crelt': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/crelt.js', - 'style-mod': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/style-mod.js', - 'w3c-keyname': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/w3c-keyname.js', - '@lezer/common': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/common.js', - '@lezer/css': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/css.js', - '@lezer/html': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/html.js', - '@lezer/javascript': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/javascript.js', - '@lezer/json': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/json.js', - '@lezer/php': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/php.js', - '@lezer/xml': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/xml.js', - '@lezer/lr': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/lr.js', - '@lezer/highlight': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/highlight.js', - '@codemirror/autocomplete': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/autocomplete.js', - '@codemirror/closebrackets': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/closebrackets.js', - '@codemirror/commands': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/commands.js', - '@codemirror/comment': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/comment.js', - '@codemirror/fold': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/fold.js', - '@codemirror/gutter': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/gutter.js', - '@codemirror/highlight': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/highlight.js', - '@codemirror/history': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/history.js', - '@codemirror/language': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/language.js', - '@codemirror/lang-css': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-css.js', - '@codemirror/lang-html': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-html.js', - '@codemirror/lang-javascript': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-javascript.js', - '@codemirror/lang-json': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-json.js', - '@codemirror/lang-php': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-php.js', - '@codemirror/lang-sql': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-sql.js', - '@codemirror/lang-xml': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-xml.js', - '@codemirror/lint': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lint.js', - '@codemirror/matchbrackets': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/matchbrackets.js', - '@codemirror/panel': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/panel.js', - '@codemirror/rangeset': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/rangeset.js', - '@codemirror/rectangular-selection': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/rectangular-selection.js', - '@codemirror/search': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/search.js', - '@codemirror/state': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/state.js', - '@codemirror/text': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/text.js', - '@codemirror/tooltip': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/tooltip.js', - '@codemirror/theme-one-dark': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/theme-one-dark.js', - '@codemirror/view': './typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/view.js', + '@typo3/t3editor/': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/', + 'crelt': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/crelt.js', + 'style-mod': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/style-mod.js', + 'w3c-keyname': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/w3c-keyname.js', + '@lezer/common': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@lezer/common.js', + '@lezer/css': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@lezer/css.js', + '@lezer/html': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@lezer/html.js', + '@lezer/javascript': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@lezer/javascript.js', + '@lezer/json': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@lezer/json.js', + '@lezer/php': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@lezer/php.js', + '@lezer/xml': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@lezer/xml.js', + '@lezer/lr': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@lezer/lr.js', + '@lezer/highlight': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@lezer/highlight.js', + '@codemirror/autocomplete': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/autocomplete.js', + '@codemirror/closebrackets': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/closebrackets.js', + '@codemirror/commands': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/commands.js', + '@codemirror/comment': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/comment.js', + '@codemirror/fold': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/fold.js', + '@codemirror/gutter': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/gutter.js', + '@codemirror/highlight': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/highlight.js', + '@codemirror/history': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/history.js', + '@codemirror/language': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/language.js', + '@codemirror/lang-css': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-css.js', + '@codemirror/lang-html': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-html.js', + '@codemirror/lang-javascript': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-javascript.js', + '@codemirror/lang-json': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-json.js', + '@codemirror/lang-php': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-php.js', + '@codemirror/lang-sql': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-sql.js', + '@codemirror/lang-xml': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-xml.js', + '@codemirror/lint': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/lint.js', + '@codemirror/matchbrackets': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/matchbrackets.js', + '@codemirror/panel': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/panel.js', + '@codemirror/rangeset': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/rangeset.js', + '@codemirror/rectangular-selection': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/rectangular-selection.js', + '@codemirror/search': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/search.js', + '@codemirror/state': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/state.js', + '@codemirror/text': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/text.js', + '@codemirror/tooltip': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/tooltip.js', + '@codemirror/theme-one-dark': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/theme-one-dark.js', + '@codemirror/view': './typo3/sysext/backend/code-editor/Resources/Public/JavaScript/Contrib/@codemirror/view.js', '@typo3/tstemplate/': './typo3/sysext/tstemplate/Resources/Public/JavaScript/', '@typo3/viewpage/': './typo3/sysext/viewpage/Resources/Public/JavaScript/', diff --git a/composer.json b/composer.json index 6ccc1266025b39d3bd9432ae1283f74522241286..3ed530c79e8fca24ed03fe9e71511567657a9447 100644 --- a/composer.json +++ b/composer.json @@ -210,7 +210,6 @@ "typo3/cms-setup": "self.version", "typo3/cms-styleguide": "self.version", "typo3/cms-sys-note": "self.version", - "typo3/cms-t3editor": "self.version", "typo3/cms-tstemplate": "self.version", "typo3/cms-viewpage": "self.version", "typo3/cms-webhooks": "self.version", @@ -249,7 +248,6 @@ "TYPO3\\CMS\\Setup\\": "typo3/sysext/setup/Classes/", "TYPO3\\CMS\\Styleguide\\": "typo3/sysext/styleguide/Classes/", "TYPO3\\CMS\\SysNote\\": "typo3/sysext/sys_note/Classes/", - "TYPO3\\CMS\\T3editor\\": "typo3/sysext/t3editor/Classes/", "TYPO3\\CMS\\Tstemplate\\": "typo3/sysext/tstemplate/Classes/", "TYPO3\\CMS\\Viewpage\\": "typo3/sysext/viewpage/Classes/", "TYPO3\\CMS\\Webhooks\\": "typo3/sysext/webhooks/Classes/", @@ -297,7 +295,6 @@ "TYPO3\\CMS\\Webhooks\\Tests\\": "typo3/sysext/webhooks/Tests/", "TYPO3\\CMS\\Workspaces\\Tests\\": "typo3/sysext/workspaces/Tests/", "TYPO3\\CMS\\Recycler\\Tests\\": "typo3/sysext/recycler/Tests/", - "TYPO3\\CMS\\T3editor\\Tests\\": "typo3/sysext/t3editor/Tests/", "TYPO3Tests\\ActionControllerArgumentTest\\": "typo3/sysext/extbase/Tests/Functional/Mvc/Controller/Fixture/Extension/action_controller_argument_test/Classes/", "TYPO3Tests\\ActionControllerTest\\": "typo3/sysext/extbase/Tests/Functional/Mvc/Controller/Fixture/Extension/action_controller_test/Classes/", "TYPO3Tests\\BlogExample\\": "typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/", diff --git a/composer.lock b/composer.lock index a7656243d2cd7d20e92601b68dc1f9bb195e0a10..18395b81046dfacc98b702dd15666d6da7c9b3a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2220edce56b7861d31cf5b5c4b223a7f", + "content-hash": "f2d56574283e2c7cac53e10db857e541", "packages": [ { "name": "bacon/bacon-qr-code", diff --git a/typo3/sysext/adminpanel/Documentation/Settings.cfg b/typo3/sysext/adminpanel/Documentation/Settings.cfg index 876bf2008789445bbadcce3fc28052f2c5442685..3d784f056f8c0dd121f528ba79e797f7aedc1d7c 100644 --- a/typo3/sysext/adminpanel/Documentation/Settings.cfg +++ b/typo3/sysext/adminpanel/Documentation/Settings.cfg @@ -68,5 +68,4 @@ t3tsref = https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/t3editor/Classes/Addon.php b/typo3/sysext/backend/Classes/CodeEditor/Addon.php similarity index 97% rename from typo3/sysext/t3editor/Classes/Addon.php rename to typo3/sysext/backend/Classes/CodeEditor/Addon.php index ad13538124da1dc04819cc4f066ed562bda7bb3a..87b3a073ae0477e22826143c10c4e40da09b97ce 100644 --- a/typo3/sysext/t3editor/Classes/Addon.php +++ b/typo3/sysext/backend/Classes/CodeEditor/Addon.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor; +namespace TYPO3\CMS\Backend\CodeEditor; use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; diff --git a/typo3/sysext/t3editor/Classes/T3editor.php b/typo3/sysext/backend/Classes/CodeEditor/CodeEditor.php similarity index 88% rename from typo3/sysext/t3editor/Classes/T3editor.php rename to typo3/sysext/backend/Classes/CodeEditor/CodeEditor.php index 49544c00d049afde514b105c85fbce73442823c2..aa2486de6e8085615220c8a08fe4ee52e6d3ad93 100644 --- a/typo3/sysext/t3editor/Classes/T3editor.php +++ b/typo3/sysext/backend/Classes/CodeEditor/CodeEditor.php @@ -15,35 +15,32 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor; +namespace TYPO3\CMS\Backend\CodeEditor; +use TYPO3\CMS\Backend\CodeEditor\Registry\AddonRegistry; +use TYPO3\CMS\Backend\CodeEditor\Registry\ModeRegistry; use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Package\Cache\PackageDependentCacheIdentifier; use TYPO3\CMS\Core\Package\PackageManager; use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\T3editor\Registry\AddonRegistry; -use TYPO3\CMS\T3editor\Registry\ModeRegistry; /** - * Provides necessary code to setup a t3editor instance in FormEngine + * Provides necessary code to set up a code editor instance in FormEngine * @internal * @todo: refactor to use DI */ -class T3editor implements SingletonInterface +class CodeEditor implements SingletonInterface { - /** - * @var array - */ - protected $configuration; + protected ?array $configuration = null; /** * Registers the configuration and bootstraps the modes / addons. * * @throws \InvalidArgumentException */ - public function registerConfiguration() + public function registerConfiguration(): void { $configuration = $this->buildConfiguration(); @@ -83,7 +80,7 @@ class T3editor implements SingletonInterface } /** - * Compiles the configuration for t3editor. Configuration is stored in caching framework. + * Compiles the configuration for code editor. Configuration is stored in caching framework. * * @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException * @throws \TYPO3\CMS\Core\Cache\Exception\InvalidDataException @@ -113,7 +110,7 @@ class T3editor implements SingletonInterface $configurationPath = $package->getPackagePath() . 'Configuration/Backend/T3editor'; $modesFileNameForPackage = $configurationPath . '/Modes.php'; if (is_file($modesFileNameForPackage)) { - $definedModes = require_once $modesFileNameForPackage; + $definedModes = require $modesFileNameForPackage; if (is_array($definedModes)) { $this->configuration['modes'] = array_merge($this->configuration['modes'], $definedModes); } @@ -121,7 +118,7 @@ class T3editor implements SingletonInterface $addonsFileNameForPackage = $configurationPath . '/Addons.php'; if (is_file($addonsFileNameForPackage)) { - $definedAddons = require_once $addonsFileNameForPackage; + $definedAddons = require $addonsFileNameForPackage; if (is_array($definedAddons)) { $this->configuration['addons'] = array_merge($this->configuration['addons'], $definedAddons); } diff --git a/typo3/sysext/t3editor/Classes/Exception/InvalidModeException.php b/typo3/sysext/backend/Classes/CodeEditor/Exception/InvalidModeException.php similarity index 92% rename from typo3/sysext/t3editor/Classes/Exception/InvalidModeException.php rename to typo3/sysext/backend/Classes/CodeEditor/Exception/InvalidModeException.php index 3a8167472504dce4e8909e686309dfb81925a329..9435a78ef01b80990ce24bf92214cfe884ea2e40 100644 --- a/typo3/sysext/t3editor/Classes/Exception/InvalidModeException.php +++ b/typo3/sysext/backend/Classes/CodeEditor/Exception/InvalidModeException.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor\Exception; +namespace TYPO3\CMS\Backend\CodeEditor\Exception; use TYPO3\CMS\Core\Exception; diff --git a/typo3/sysext/t3editor/Classes/Mode.php b/typo3/sysext/backend/Classes/CodeEditor/Mode.php similarity index 97% rename from typo3/sysext/t3editor/Classes/Mode.php rename to typo3/sysext/backend/Classes/CodeEditor/Mode.php index 52e32cfc9966e100aa7adc2c8ac7cc4c6bcbc2f2..a0ba4cc450646dfce910e9a33932e488414012f3 100644 --- a/typo3/sysext/t3editor/Classes/Mode.php +++ b/typo3/sysext/backend/Classes/CodeEditor/Mode.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor; +namespace TYPO3\CMS\Backend\CodeEditor; use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; diff --git a/typo3/sysext/t3editor/Classes/Registry/AddonRegistry.php b/typo3/sysext/backend/Classes/CodeEditor/Registry/AddonRegistry.php similarity index 86% rename from typo3/sysext/t3editor/Classes/Registry/AddonRegistry.php rename to typo3/sysext/backend/Classes/CodeEditor/Registry/AddonRegistry.php index f2d5eff2f3a2881659471891c56a84721615a205..f4f89726841076739389a9bbfdea970512c9e942 100644 --- a/typo3/sysext/t3editor/Classes/Registry/AddonRegistry.php +++ b/typo3/sysext/backend/Classes/CodeEditor/Registry/AddonRegistry.php @@ -15,13 +15,13 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor\Registry; +namespace TYPO3\CMS\Backend\CodeEditor\Registry; +use TYPO3\CMS\Backend\CodeEditor\Addon; use TYPO3\CMS\Core\SingletonInterface; -use TYPO3\CMS\T3editor\Addon; /** - * Registers and holds t3editor modes + * Registers and holds code editor modes * @internal */ class AddonRegistry implements SingletonInterface @@ -32,7 +32,7 @@ class AddonRegistry implements SingletonInterface protected $registeredAddons = []; /** - * Registers addons for global use in t3editor + * Registers addons for global use in code editor */ public function register(Addon $addon): AddonRegistry { diff --git a/typo3/sysext/t3editor/Classes/Registry/ModeRegistry.php b/typo3/sysext/backend/Classes/CodeEditor/Registry/ModeRegistry.php similarity index 85% rename from typo3/sysext/t3editor/Classes/Registry/ModeRegistry.php rename to typo3/sysext/backend/Classes/CodeEditor/Registry/ModeRegistry.php index e42cd0d7d4e3b064203e54fd47c698af2d8d3f40..0366fea7ee1fba974afebc92758edd510e8a40b6 100644 --- a/typo3/sysext/t3editor/Classes/Registry/ModeRegistry.php +++ b/typo3/sysext/backend/Classes/CodeEditor/Registry/ModeRegistry.php @@ -15,14 +15,14 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor\Registry; +namespace TYPO3\CMS\Backend\CodeEditor\Registry; +use TYPO3\CMS\Backend\CodeEditor\Exception\InvalidModeException; +use TYPO3\CMS\Backend\CodeEditor\Mode; use TYPO3\CMS\Core\SingletonInterface; -use TYPO3\CMS\T3editor\Exception\InvalidModeException; -use TYPO3\CMS\T3editor\Mode; /** - * Registers and holds t3editor modes + * Registers and holds code editor modes * @internal */ class ModeRegistry implements SingletonInterface @@ -30,15 +30,12 @@ class ModeRegistry implements SingletonInterface /** * @var Mode[] */ - protected $registeredModes = []; + protected array $registeredModes = []; - /** - * @var Mode - */ - protected $defaultMode; + protected Mode $defaultMode; /** - * Registers modes for t3editor + * Registers modes for code editor */ public function register(Mode $mode): ModeRegistry { @@ -78,7 +75,7 @@ class ModeRegistry implements SingletonInterface } } - throw new InvalidModeException('Tried to get unregistered t3editor mode by format code "' . $formatCode . '"', 1499710203); + throw new InvalidModeException('Tried to get unregistered code editor mode by format code "' . $formatCode . '"', 1499710203); } /** diff --git a/typo3/sysext/t3editor/Classes/Controller/CodeCompletionController.php b/typo3/sysext/backend/Classes/Controller/CodeEditor/CodeCompletionController.php similarity index 90% rename from typo3/sysext/t3editor/Classes/Controller/CodeCompletionController.php rename to typo3/sysext/backend/Classes/Controller/CodeEditor/CodeCompletionController.php index 17ef7b66e467afe0d3fcd2e2941929e383942d8f..17fd106245c41ba565e8cfada32113f0888846a7 100644 --- a/typo3/sysext/t3editor/Classes/Controller/CodeCompletionController.php +++ b/typo3/sysext/backend/Classes/Controller/CodeEditor/CodeCompletionController.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor\Controller; +namespace TYPO3\CMS\Backend\Controller\CodeEditor; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -33,7 +33,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\RootlineUtility; /** - * Code completion for t3editor + * Code completion for code editor * * @internal This is a specific Backend Controller implementation and is not considered part of the Public TYPO3 API. */ @@ -49,18 +49,18 @@ class CodeCompletionController /** * Loads all templates up to a given page id (walking the rootline) and - * cleans parts that are not required for the t3editor code-completion. + * cleans parts that are not required for the code editor code-completion. */ public function loadCompletions(ServerRequestInterface $request): ResponseInterface { // Check whether access is granted (only admin have access to sys_template records): if (!$GLOBALS['BE_USER']->isAdmin()) { - return new HtmlResponse($this->getLanguageService()->sL('LLL:EXT:t3editor/Resources/Private/Language/locallang.xlf:noPermission'), 500); + return new HtmlResponse($this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_codeeditor.xlf:noPermission'), 500); } $pageId = (int)($request->getParsedBody()['pageId'] ?? $request->getQueryParams()['pageId']); // Check whether there is a pageId given: if (!$pageId) { - return new HtmlResponse($this->getLanguageService()->sL('LLL:EXT:t3editor/Resources/Private/Language/locallang.xlf:pageIDInteger'), 500); + return new HtmlResponse($this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_codeeditor.xlf:pageIDInteger'), 500); } // Fetch the templates return new JsonResponse($this->getMergedTemplates($pageId, $request)); @@ -68,7 +68,7 @@ class CodeCompletionController /** * Gets merged templates by walking the rootline to a given page id. - * This is loaded once via ajax when a t3editor in typoscript mode is fired. + * This is loaded once via ajax when a code editor in typoscript mode is fired. * JS then knows the object types and can auto-complete on CTRL+space. * * @return array Setup part of merged template records @@ -83,8 +83,7 @@ class CodeCompletionController $setupAstBuilderVisitor = GeneralUtility::makeInstance(IncludeTreeAstBuilderVisitor::class); $this->treeTraverser->traverse($setupIncludeTree, [$setupAstBuilderVisitor]); $setupAst = $setupAstBuilderVisitor->getAst(); - $result = $this->treeWalkCleanup($setupAst->toArray()); - return $result; + return $this->treeWalkCleanup($setupAst->toArray()); } /** diff --git a/typo3/sysext/t3editor/Classes/Controller/TypoScriptReferenceController.php b/typo3/sysext/backend/Classes/Controller/CodeEditor/TypoScriptReferenceController.php similarity index 96% rename from typo3/sysext/t3editor/Classes/Controller/TypoScriptReferenceController.php rename to typo3/sysext/backend/Classes/Controller/CodeEditor/TypoScriptReferenceController.php index 343fa0709fb3a2cef822348db4c34d8077bba86b..bbf5899e8f97fbee2a44750ce0647aa620444f5d 100644 --- a/typo3/sysext/t3editor/Classes/Controller/TypoScriptReferenceController.php +++ b/typo3/sysext/backend/Classes/Controller/CodeEditor/TypoScriptReferenceController.php @@ -15,7 +15,7 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor\Controller; +namespace TYPO3\CMS\Backend\Controller\CodeEditor; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -39,7 +39,7 @@ class TypoScriptReferenceController public function loadReference(ServerRequestInterface $request): ResponseInterface { // Load the TSref XML information: - $this->loadFile(GeneralUtility::getFileAbsFileName('EXT:t3editor/Resources/Private/tsref.xml')); + $this->loadFile(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/tsref.xml')); return new JsonResponse($this->getTypes()); } diff --git a/typo3/sysext/t3editor/Classes/EventListener/InitializeT3editorInEditFileForm.php b/typo3/sysext/backend/Classes/EventListener/InitializeCodeEditorInEditFileForm.php similarity index 69% rename from typo3/sysext/t3editor/Classes/EventListener/InitializeT3editorInEditFileForm.php rename to typo3/sysext/backend/Classes/EventListener/InitializeCodeEditorInEditFileForm.php index 0c8c1210e54018f0d02673752635e944210e79ef..3e289c7d0d9ea5c102000c2abda681d1057db6ed 100644 --- a/typo3/sysext/t3editor/Classes/EventListener/InitializeT3editorInEditFileForm.php +++ b/typo3/sysext/backend/Classes/EventListener/InitializeCodeEditorInEditFileForm.php @@ -15,28 +15,28 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor\EventListener; +namespace TYPO3\CMS\Backend\EventListener; +use TYPO3\CMS\Backend\CodeEditor\CodeEditor; +use TYPO3\CMS\Backend\CodeEditor\Exception\InvalidModeException; +use TYPO3\CMS\Backend\CodeEditor\Registry\ModeRegistry; use TYPO3\CMS\Core\Attribute\AsEventListener; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Filelist\Event\ModifyEditFileFormDataEvent; -use TYPO3\CMS\T3editor\Exception\InvalidModeException; -use TYPO3\CMS\T3editor\Registry\ModeRegistry; -use TYPO3\CMS\T3editor\T3editor; /** - * Listener which modifies the form data to initialize t3editor with + * Listener which modifies the form data to initialize code editor with * the resolved format option (based on the file extension). */ -final class InitializeT3editorInEditFileForm +final class InitializeCodeEditorInEditFileForm { public function __construct(private readonly ModeRegistry $modeRegistry) {} - #[AsEventListener('typo3-t3editor/initialize-t3editor-in-edit-file-form')] + #[AsEventListener('typo3-code editor/initialize-code-editor-in-edit-file-form')] public function __invoke(ModifyEditFileFormDataEvent $event): void { - // Compile and register t3editor configuration - GeneralUtility::makeInstance(T3editor::class)->registerConfiguration(); + // Compile and register code editor configuration + GeneralUtility::makeInstance(CodeEditor::class)->registerConfiguration(); $fileExtension = $event->getFile()->getExtension(); @@ -47,7 +47,7 @@ final class InitializeT3editorInEditFileForm } $formData = $event->getFormData(); - $formData['processedTca']['columns']['data']['config']['renderType'] = 't3editor'; + $formData['processedTca']['columns']['data']['config']['renderType'] = 'codeEditor'; $formData['processedTca']['columns']['data']['config']['format'] = $mode->getFormatCode(); $event->setFormData($formData); } diff --git a/typo3/sysext/backend/Classes/Form/Element/BackendLayoutWizardElement.php b/typo3/sysext/backend/Classes/Form/Element/BackendLayoutWizardElement.php index 3d607c940d4aab395c81e040cce12cfc86586a4c..2099e73a981b77d50d714a99b6af9ad21f4d713e 100644 --- a/typo3/sysext/backend/Classes/Form/Element/BackendLayoutWizardElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/BackendLayoutWizardElement.php @@ -21,7 +21,6 @@ use TYPO3\CMS\Core\EventDispatcher\NoopEventDispatcher; use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; use TYPO3\CMS\Core\TypoScript\AST\AstBuilder; use TYPO3\CMS\Core\TypoScript\TypoScriptStringFactory; -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -83,20 +82,16 @@ class BackendLayoutWizardElement extends AbstractFormElement $fieldWizardHtml = $fieldWizardResult['html']; $resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $fieldWizardResult, false); - $codeMirrorConfig = []; - // Use CodeMirror if available - if (ExtensionManagementUtility::isLoaded('t3editor')) { - $codeMirrorConfig = [ - 'label' => $lang->sL('LLL:EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf:buttons.pageTsConfig'), - 'panel' => 'top', - 'mode' => GeneralUtility::jsonEncodeForHtmlAttribute(JavaScriptModuleInstruction::create('@typo3/t3editor/language/typoscript.js', 'typoscript')->invoke(), false), - 'nolazyload' => 'true', - 'readonly' => 'true', - ]; - - $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@typo3/t3editor/element/code-mirror-element.js'); - } + $codeMirrorConfig = [ + 'label' => $lang->sL('LLL:EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf:buttons.pageTsConfig'), + 'panel' => 'top', + 'mode' => GeneralUtility::jsonEncodeForHtmlAttribute(JavaScriptModuleInstruction::create('@typo3/backend/code-editor/language/typoscript.js', 'typoscript')->invoke(), false), + 'nolazyload' => 'true', + 'readonly' => 'true', + ]; + + $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@typo3/backend/code-editor/element/code-mirror-element.js'); $json = (string)json_encode($this->rows, JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS); $codeMirrorConfig = (string)json_encode($codeMirrorConfig, JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS); diff --git a/typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php b/typo3/sysext/backend/Classes/Form/Element/CodeEditorElement.php similarity index 90% rename from typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php rename to typo3/sysext/backend/Classes/Form/Element/CodeEditorElement.php index d8ebcd4033d9648a010546b72a5bc0807ff233b1..9cec1d81d317627d7a11174862eafde47b4208d6 100644 --- a/typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/CodeEditorElement.php @@ -15,33 +15,25 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor\Form\Element; +namespace TYPO3\CMS\Backend\Form\Element; -use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; +use TYPO3\CMS\Backend\CodeEditor\CodeEditor; +use TYPO3\CMS\Backend\CodeEditor\Exception\InvalidModeException; +use TYPO3\CMS\Backend\CodeEditor\Mode; +use TYPO3\CMS\Backend\CodeEditor\Registry\AddonRegistry; +use TYPO3\CMS\Backend\CodeEditor\Registry\ModeRegistry; use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; -use TYPO3\CMS\T3editor\Exception\InvalidModeException; -use TYPO3\CMS\T3editor\Mode; -use TYPO3\CMS\T3editor\Registry\AddonRegistry; -use TYPO3\CMS\T3editor\Registry\ModeRegistry; -use TYPO3\CMS\T3editor\T3editor; /** - * t3editor FormEngine widget + * CodeEditor FormEngine widget * @internal */ -class T3editorElement extends AbstractFormElement +class CodeEditorElement extends AbstractFormElement { - /** - * @var array - */ - protected $resultArray; - - /** - * @var string - */ - protected $mode = ''; + protected array $resultArray = []; + protected string $mode = ''; /** * Default field information enabled for this element. @@ -78,20 +70,20 @@ class T3editorElement extends AbstractFormElement ]; /** - * Render t3editor element + * Render code editor element * * @return array As defined in initializeResultArray() of AbstractNode - * @throws \TYPO3\CMS\T3editor\Exception\InvalidModeException + * @throws InvalidModeException * @throws \InvalidArgumentException * @throws \BadFunctionCallException */ public function render(): array { $this->resultArray = $this->initializeResultArray(); - $this->resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@typo3/t3editor/element/code-mirror-element.js'); + $this->resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@typo3/backend/code-editor/element/code-mirror-element.js'); - // Compile and register t3editor configuration - GeneralUtility::makeInstance(T3editor::class)->registerConfiguration(); + // Compile and register code editor configuration + GeneralUtility::makeInstance(CodeEditor::class)->registerConfiguration(); $addonRegistry = GeneralUtility::makeInstance(AddonRegistry::class); $registeredAddons = $addonRegistry->getAddons(); @@ -178,7 +170,7 @@ class T3editorElement extends AbstractFormElement * @param array $attributes Any additional editor parameters * * @return string Generated HTML code for editor - * @throws \TYPO3\CMS\T3editor\Exception\InvalidModeException + * @throws \TYPO3\CMS\Backend\CodeEditor\Exception\InvalidModeException */ protected function getHTMLCodeForEditor( string $name, @@ -212,6 +204,7 @@ class T3editorElement extends AbstractFormElement } } $codeMirrorConfig = [ + 'name' => $name, 'mode' => GeneralUtility::jsonEncodeForHtmlAttribute($mode->getModule(), false), 'addons' => GeneralUtility::jsonEncodeForHtmlAttribute($addons, false), 'keymaps' => GeneralUtility::jsonEncodeForHtmlAttribute($keymaps, false), diff --git a/typo3/sysext/backend/Classes/Form/Element/JsonElement.php b/typo3/sysext/backend/Classes/Form/Element/JsonElement.php index b04fd2a65639748707ab70cf72db7c6de57d692c..2e876883579024ef7db9182753d7d2364e12bd29 100644 --- a/typo3/sysext/backend/Classes/Form/Element/JsonElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/JsonElement.php @@ -17,14 +17,13 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\Form\Element; +use TYPO3\CMS\Backend\CodeEditor\CodeEditor; +use TYPO3\CMS\Backend\CodeEditor\Registry\AddonRegistry; +use TYPO3\CMS\Backend\CodeEditor\Registry\ModeRegistry; use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Utility\StringUtility; -use TYPO3\CMS\T3editor\Registry\AddonRegistry; -use TYPO3\CMS\T3editor\Registry\ModeRegistry; -use TYPO3\CMS\T3editor\T3editor; /** * Handles type=json elements. @@ -75,7 +74,7 @@ class JsonElement extends AbstractFormElement $config = $parameterArray['fieldConf']['config']; $readOnly = (bool)($config['readOnly'] ?? false); $placeholder = trim((string)($config['placeholder'] ?? '')); - $enableCodeEditor = ($config['enableCodeEditor'] ?? true) && ExtensionManagementUtility::isLoaded('t3editor'); + $enableCodeEditor = $config['enableCodeEditor'] ?? true; $itemValue = ''; if (!empty($parameterArray['itemFormElValue'])) { @@ -108,7 +107,6 @@ class JsonElement extends AbstractFormElement $fieldInformationHtml = $fieldInformationResult['html']; $resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $fieldInformationResult, false); - // Early return readonly display in case t3editor is not available if ($readOnly && !$enableCodeEditor) { $html = []; $html[] = $this->renderLabel($fieldId); @@ -148,8 +146,8 @@ class JsonElement extends AbstractFormElement // Use CodeMirror if available if ($enableCodeEditor) { - // Compile and register t3editor configuration - GeneralUtility::makeInstance(T3editor::class)->registerConfiguration(); + // Compile and register code editor configuration + GeneralUtility::makeInstance(CodeEditor::class)->registerConfiguration(); $modeRegistry = GeneralUtility::makeInstance(ModeRegistry::class); $mode = $modeRegistry->isRegistered('json') @@ -186,7 +184,7 @@ class JsonElement extends AbstractFormElement $codeMirrorConfig['keymaps'] = GeneralUtility::jsonEncodeForHtmlAttribute($keymaps, false); } - $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@typo3/t3editor/element/code-mirror-element.js'); + $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@typo3/backend/code-editor/element/code-mirror-element.js'); $editorHtml = ' <typo3-t3editor-codemirror ' . GeneralUtility::implodeAttributes($codeMirrorConfig, true, true) . '> <textarea ' . GeneralUtility::implodeAttributes($attributes, true, true) . '>' . htmlspecialchars($itemValue) . '</textarea> diff --git a/typo3/sysext/backend/Classes/Form/NodeFactory.php b/typo3/sysext/backend/Classes/Form/NodeFactory.php index d47427ac6b8377220c98ee7a6ea7d13922f7edaa..62af8046aca0f027e3df4e1fd5bcfbe84a0ab335 100644 --- a/typo3/sysext/backend/Classes/Form/NodeFactory.php +++ b/typo3/sysext/backend/Classes/Form/NodeFactory.php @@ -90,8 +90,7 @@ class NodeFactory 'selectSingle' => Element\SelectSingleElement::class, 'selectSingleBox' => Element\SelectSingleBoxElement::class, 'color' => Element\ColorElement::class, - // t3editor is defined with a fallback so extensions can use it even if ext:t3editor is not loaded - 't3editor' => Element\TextElement::class, + 'codeEditor' => Element\CodeEditorElement::class, 'text' => Element\TextElement::class, 'textTable' => Element\TextTableElement::class, 'unknown' => Element\UnknownElement::class, diff --git a/typo3/sysext/backend/Configuration/Backend/AjaxRoutes.php b/typo3/sysext/backend/Configuration/Backend/AjaxRoutes.php index c0f6cfa9ad36ff41ca9e26232ea9b3f7906a0bec..9f48f395ced486dea732e11ddd15cd46c85601e1 100644 --- a/typo3/sysext/backend/Configuration/Backend/AjaxRoutes.php +++ b/typo3/sysext/backend/Configuration/Backend/AjaxRoutes.php @@ -401,4 +401,16 @@ return [ 'path' => '/sudo-mode/verify', 'target' => Controller\Security\SudoModeController::class . '::verifyAction', ], + + // Get TSRef + 'codeeditor_tsref' => [ + 'path' => '/code-editor/tsref', + 'target' => \TYPO3\CMS\Backend\Controller\CodeEditor\TypoScriptReferenceController::class . '::loadReference', + ], + + // Load code completion templates + 'codeeditor_codecompletion_loadtemplates' => [ + 'path' => '/code-editor/codecompletion/load-templates', + 'target' => \TYPO3\CMS\Backend\Controller\CodeEditor\CodeCompletionController::class . '::loadCompletions', + ], ]; diff --git a/typo3/sysext/t3editor/Configuration/Backend/T3editor/Addons.php b/typo3/sysext/backend/Configuration/Backend/T3editor/Addons.php similarity index 99% rename from typo3/sysext/t3editor/Configuration/Backend/T3editor/Addons.php rename to typo3/sysext/backend/Configuration/Backend/T3editor/Addons.php index 4022859d9ed409b9169a02731a49b1d7193ae994..4dca915722ebf8b8135000d163f65076651fea28 100644 --- a/typo3/sysext/t3editor/Configuration/Backend/T3editor/Addons.php +++ b/typo3/sysext/backend/Configuration/Backend/T3editor/Addons.php @@ -3,7 +3,7 @@ use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; /** - * Addons for t3editor + * Addons for code editor */ return [ 'highlightActiveLineGutter' => [ diff --git a/typo3/sysext/t3editor/Configuration/Backend/T3editor/Modes.php b/typo3/sysext/backend/Configuration/Backend/T3editor/Modes.php similarity index 92% rename from typo3/sysext/t3editor/Configuration/Backend/T3editor/Modes.php rename to typo3/sysext/backend/Configuration/Backend/T3editor/Modes.php index 8db36582ffc6d2e13779aa4af08843ce56486e2e..07b893f6692178132b2ecb1471b76534c2fcdc75 100644 --- a/typo3/sysext/t3editor/Configuration/Backend/T3editor/Modes.php +++ b/typo3/sysext/backend/Configuration/Backend/T3editor/Modes.php @@ -3,7 +3,7 @@ use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; /** - * Mode definitions for t3editor + * Mode definitions for code editor */ return [ 'css' => [ @@ -32,7 +32,7 @@ return [ 'extensions' => ['sql'], ], 'typoscript' => [ - 'module' => JavaScriptModuleInstruction::create('@typo3/t3editor/language/typoscript.js', 'typoscript')->invoke(), + 'module' => JavaScriptModuleInstruction::create('@typo3/backend/code-editor/language/typoscript.js', 'typoscript')->invoke(), 'extensions' => ['ts', 'typoscript', 'tsconfig'], ], 'xml' => [ diff --git a/typo3/sysext/backend/Configuration/JavaScriptModules.php b/typo3/sysext/backend/Configuration/JavaScriptModules.php index 06d31e79604c49485ca75a7b60af1bdf32d1d369..725020f631f4532517f2759ed1304389c3b12d51 100644 --- a/typo3/sysext/backend/Configuration/JavaScriptModules.php +++ b/typo3/sysext/backend/Configuration/JavaScriptModules.php @@ -16,6 +16,49 @@ return [ 'EXT:backend/Resources/Public/JavaScript/Contrib/', ], ], + '@typo3/t3editor/' => [ + // @deprecated since TYPO3 v13, will be removed in TYPO3 v14 + 'path' => 'EXT:backend/Resources/Public/JavaScript/code-editor', + ], + 'crelt' => 'EXT:backend/Resources/Public/JavaScript/Contrib/crelt.js', + 'style-mod' => 'EXT:backend/Resources/Public/JavaScript/Contrib/style-mod.js', + 'w3c-keyname' => 'EXT:backend/Resources/Public/JavaScript/Contrib/w3c-keyname.js', + '@lezer/common' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@lezer/common.js', + '@lezer/css' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@lezer/css.js', + '@lezer/html' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@lezer/html.js', + '@lezer/javascript' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@lezer/javascript.js', + '@lezer/json' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@lezer/json.js', + '@lezer/php' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@lezer/php.js', + '@lezer/xml' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@lezer/xml.js', + '@lezer/lr' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@lezer/lr.js', + '@lezer/highlight' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@lezer/highlight.js', + '@codemirror/autocomplete' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/autocomplete.js', + '@codemirror/closebrackets' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/closebrackets.js', + '@codemirror/commands' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/commands.js', + '@codemirror/comment' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/comment.js', + '@codemirror/fold' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/fold.js', + '@codemirror/gutter' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/gutter.js', + '@codemirror/highlight' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/highlight.js', + '@codemirror/history' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/history.js', + '@codemirror/language' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/language.js', + '@codemirror/lang-css' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-css.js', + '@codemirror/lang-html' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-html.js', + '@codemirror/lang-javascript' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-javascript.js', + '@codemirror/lang-json' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-json.js', + '@codemirror/lang-php' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-php.js', + '@codemirror/lang-sql' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-sql.js', + '@codemirror/lang-xml' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-xml.js', + '@codemirror/lint' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/lint.js', + '@codemirror/matchbrackets' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/matchbrackets.js', + '@codemirror/panel' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/panel.js', + '@codemirror/rangeset' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/rangeset.js', + '@codemirror/rectangular-selection' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/rectangular-selection.js', + '@codemirror/search' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/search.js', + '@codemirror/state' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/state.js', + '@codemirror/text' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/text.js', + '@codemirror/tooltip' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/tooltip.js', + '@codemirror/theme-one-dark' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/theme-one-dark.js', + '@codemirror/view' => 'EXT:backend/Resources/Public/JavaScript/Contrib/@codemirror/view.js', '@typo3/backend/contrib/mark.js' => 'EXT:backend/Resources/Public/JavaScript/Contrib/mark.js', 'alwan' => 'EXT:backend/Resources/Public/JavaScript/Contrib/alwan.js', 'lodash-es' => 'EXT:backend/Resources/Public/JavaScript/Contrib/lodash-es.js', diff --git a/typo3/sysext/t3editor/Configuration/TCA/Overrides/be_groups.php b/typo3/sysext/backend/Configuration/TCA/Overrides/be_groups.php similarity index 77% rename from typo3/sysext/t3editor/Configuration/TCA/Overrides/be_groups.php rename to typo3/sysext/backend/Configuration/TCA/Overrides/be_groups.php index 022ce270cb3a2d3f65a18ff8b29e020073095fdb..972c1cf317e325bfb3df61a6c724386f20e54047 100644 --- a/typo3/sysext/t3editor/Configuration/TCA/Overrides/be_groups.php +++ b/typo3/sysext/backend/Configuration/TCA/Overrides/be_groups.php @@ -2,8 +2,8 @@ defined('TYPO3') or die(); -// Activate t3editor for be_groups TSconfig +// Activate code editor for be_groups TSconfig if (is_array($GLOBALS['TCA']['be_groups']['columns']['TSconfig']['config'])) { - $GLOBALS['TCA']['be_groups']['columns']['TSconfig']['config']['renderType'] = 't3editor'; + $GLOBALS['TCA']['be_groups']['columns']['TSconfig']['config']['renderType'] = 'codeEditor'; $GLOBALS['TCA']['be_groups']['columns']['TSconfig']['config']['format'] = 'typoscript'; } diff --git a/typo3/sysext/t3editor/Configuration/TCA/Overrides/be_users.php b/typo3/sysext/backend/Configuration/TCA/Overrides/be_users.php similarity index 77% rename from typo3/sysext/t3editor/Configuration/TCA/Overrides/be_users.php rename to typo3/sysext/backend/Configuration/TCA/Overrides/be_users.php index 615c48ce2dcda8d8eeab9f62aaeadbdfc37a05f7..ad252ddd99f7797432a706afc99fa31211062cee 100644 --- a/typo3/sysext/t3editor/Configuration/TCA/Overrides/be_users.php +++ b/typo3/sysext/backend/Configuration/TCA/Overrides/be_users.php @@ -2,8 +2,8 @@ defined('TYPO3') or die(); -// Activate t3editor for be_users TSconfig +// Activate code editor for be_users TSconfig if (is_array($GLOBALS['TCA']['be_users']['columns']['TSconfig']['config'])) { - $GLOBALS['TCA']['be_users']['columns']['TSconfig']['config']['renderType'] = 't3editor'; + $GLOBALS['TCA']['be_users']['columns']['TSconfig']['config']['renderType'] = 'codeEditor'; $GLOBALS['TCA']['be_users']['columns']['TSconfig']['config']['format'] = 'typoscript'; } diff --git a/typo3/sysext/t3editor/Configuration/TCA/Overrides/pages.php b/typo3/sysext/backend/Configuration/TCA/Overrides/pages.php similarity index 78% rename from typo3/sysext/t3editor/Configuration/TCA/Overrides/pages.php rename to typo3/sysext/backend/Configuration/TCA/Overrides/pages.php index c548fbeaac5404090911e38307f88be0228f2e74..386852803ca198f984cb64340029e7b9d68d1242 100644 --- a/typo3/sysext/t3editor/Configuration/TCA/Overrides/pages.php +++ b/typo3/sysext/backend/Configuration/TCA/Overrides/pages.php @@ -2,8 +2,8 @@ defined('TYPO3') or die(); -// Activate t3editor for pages TSconfig +// Activate code editor for pages TSconfig if (is_array($GLOBALS['TCA']['pages']['columns']['TSconfig']['config'])) { - $GLOBALS['TCA']['pages']['columns']['TSconfig']['config']['renderType'] = 't3editor'; + $GLOBALS['TCA']['pages']['columns']['TSconfig']['config']['renderType'] = 'codeEditor'; $GLOBALS['TCA']['pages']['columns']['TSconfig']['config']['format'] = 'typoscript'; } diff --git a/typo3/sysext/t3editor/Configuration/TCA/Overrides/sys_template.php b/typo3/sysext/backend/Configuration/TCA/Overrides/sys_template.php similarity index 75% rename from typo3/sysext/t3editor/Configuration/TCA/Overrides/sys_template.php rename to typo3/sysext/backend/Configuration/TCA/Overrides/sys_template.php index 2a6e3054af82c0ec00482b1d0a24046e5553942b..5eb79624664edc3c8748cbd69f953f70117b87fe 100644 --- a/typo3/sysext/t3editor/Configuration/TCA/Overrides/sys_template.php +++ b/typo3/sysext/backend/Configuration/TCA/Overrides/sys_template.php @@ -2,14 +2,14 @@ defined('TYPO3') or die(); -// Activate t3editor for sys_template constants +// Activate code editor for sys_template constants if (is_array($GLOBALS['TCA']['sys_template']['columns']['constants']['config'])) { - $GLOBALS['TCA']['sys_template']['columns']['constants']['config']['renderType'] = 't3editor'; + $GLOBALS['TCA']['sys_template']['columns']['constants']['config']['renderType'] = 'codeEditor'; $GLOBALS['TCA']['sys_template']['columns']['constants']['config']['format'] = 'typoscript'; } -// Activate t3editor for sys_template config +// Activate code editor for sys_template config if (is_array($GLOBALS['TCA']['sys_template']['columns']['config']['config'])) { - $GLOBALS['TCA']['sys_template']['columns']['config']['config']['renderType'] = 't3editor'; + $GLOBALS['TCA']['sys_template']['columns']['config']['config']['renderType'] = 'codeEditor'; $GLOBALS['TCA']['sys_template']['columns']['config']['config']['format'] = 'typoscript'; } diff --git a/typo3/sysext/backend/Configuration/TCA/Overrides/tt_content.php b/typo3/sysext/backend/Configuration/TCA/Overrides/tt_content.php new file mode 100644 index 0000000000000000000000000000000000000000..9d77cef3909faa3486b09aef1660c92d0f952583 --- /dev/null +++ b/typo3/sysext/backend/Configuration/TCA/Overrides/tt_content.php @@ -0,0 +1,19 @@ +<?php + +defined('TYPO3') or die(); + +// Activate codeEditor for tt_content type HTML if this type exists +if (is_array($GLOBALS['TCA']['tt_content']['types']['html'] ?? null)) { + $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides'] = array_replace_recursive( + $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides'] ?? [], + [ + 'bodytext' => [ + 'config' => [ + 'renderType' => 'codeEditor', + 'wrap' => 'off', + 'format' => 'html', + ], + ], + ] + ); +} diff --git a/typo3/sysext/backend/Resources/Private/Language/locallang_codeeditor.xlf b/typo3/sysext/backend/Resources/Private/Language/locallang_codeeditor.xlf new file mode 100644 index 0000000000000000000000000000000000000000..b739f22aa0e58f16f4e93801703ff0b7aa72084d --- /dev/null +++ b/typo3/sysext/backend/Resources/Private/Language/locallang_codeeditor.xlf @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> + <file source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_codeeditor.xlf" date="2023-11-20T10:56:42Z" product-name="backend"> + <header/> + <body> + <trans-unit id="pageIDInteger" resname="pageIDInteger"> + <source>Syntax error: Parameter pageID must be a valid integer.</source> + </trans-unit> + <trans-unit id="noPermission" resname="noPermission"> + <source>Access denied: No permission to template records.</source> + </trans-unit> + </body> + </file> +</xliff> diff --git a/typo3/sysext/t3editor/Resources/Private/tsref.xml b/typo3/sysext/backend/Resources/Private/tsref.xml similarity index 100% rename from typo3/sysext/t3editor/Resources/Private/tsref.xml rename to typo3/sysext/backend/Resources/Private/tsref.xml diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/autocomplete.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/autocomplete.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/autocomplete.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/autocomplete.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/commands.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/commands.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/commands.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/commands.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-css.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-css.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-css.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-css.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-html.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-html.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-html.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-html.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-javascript.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-javascript.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-javascript.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-javascript.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-json.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-json.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-json.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-json.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-php.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-php.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-php.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-php.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-sql.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-sql.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-sql.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-sql.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-xml.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-xml.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-xml.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lang-xml.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/language.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/language.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/language.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/language.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lint.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lint.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lint.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/lint.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/search.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/search.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/search.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/search.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/state.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/state.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/state.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/state.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/theme-one-dark.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/theme-one-dark.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/theme-one-dark.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/theme-one-dark.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/view.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/view.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@codemirror/view.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@codemirror/view.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/common.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/common.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/common.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/common.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/css.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/css.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/css.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/css.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/highlight.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/highlight.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/highlight.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/highlight.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/html.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/html.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/html.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/html.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/javascript.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/javascript.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/javascript.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/javascript.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/json.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/json.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/json.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/json.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/lr.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/lr.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/lr.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/lr.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/php.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/php.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/php.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/php.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/xml.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/xml.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/@lezer/xml.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/@lezer/xml.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/crelt.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/crelt.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/crelt.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/crelt.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/style-mod.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/style-mod.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/style-mod.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/style-mod.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/w3c-keyname.js b/typo3/sysext/backend/Resources/Public/JavaScript/Contrib/w3c-keyname.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/w3c-keyname.js rename to typo3/sysext/backend/Resources/Public/JavaScript/Contrib/w3c-keyname.js diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/autocomplete/completion-result.js b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/autocomplete/completion-result.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/autocomplete/completion-result.js rename to typo3/sysext/backend/Resources/Public/JavaScript/code-editor/autocomplete/completion-result.js diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/autocomplete/ts-code-completion.js b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/autocomplete/ts-code-completion.js new file mode 100644 index 0000000000000000000000000000000000000000..f52aef629947e93323a5d92e41a0bd63531dcffc --- /dev/null +++ b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/autocomplete/ts-code-completion.js @@ -0,0 +1,13 @@ +/* + * This file is part of the TYPO3 CMS project. + * + * It is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, either version 2 + * of the License, or any later version. + * + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + * + * The TYPO3 project - inspiring people to share! + */ +import AjaxRequest from"@typo3/core/ajax/ajax-request.js";import{TsRef}from"@typo3/backend/code-editor/autocomplete/ts-ref.js";import{TsParser}from"@typo3/backend/code-editor/autocomplete/ts-parser.js";import{CompletionResult}from"@typo3/backend/code-editor/autocomplete/completion-result.js";export class TsCodeCompletion{constructor(e){this.extTsObjTree={},this.parser=null,this.proposals=null,this.compResult=null,this.tsRef=new TsRef,this.parser=new TsParser(this.tsRef,this.extTsObjTree),this.tsRef.loadTsrefAsync(),this.loadExtTemplatesAsync(e)}refreshCodeCompletion(e){const t=this.getFilter(e),s=this.parser.buildTsObjTree(e);this.compResult=new CompletionResult(this.tsRef,s),this.proposals=this.compResult.getFilteredProposals(t);const r=[];for(let e=0;e<this.proposals.length;e++)r[e]=this.proposals[e].word;return r}loadExtTemplatesAsync(e){if(Number.isNaN(e)||0===e)return null;new AjaxRequest(TYPO3.settings.ajaxUrls.codeeditor_codecompletion_loadtemplates).withQueryArguments({pageId:e}).get().then((async e=>{this.extTsObjTree.c=await e.resolve(),this.resolveExtReferencesRec(this.extTsObjTree.c)}))}resolveExtReferencesRec(e){for(const t of Object.keys(e)){let s;if(e[t].v&&"<"===e[t].v[0]&&-1===e[t].v.indexOf(">")){const r=e[t].v.replace(/</,"").trim();-1===r.indexOf(" ")&&(s=this.getExtChildNode(r),null!==s&&(e[t]=s))}!s&&e[t].c&&this.resolveExtReferencesRec(e[t].c)}}getExtChildNode(e){let t=this.extTsObjTree;const s=e.split(".");for(let e=0;e<s.length;e++){const r=s[e];if(void 0===t.c||void 0===t.c[r])return null;t=t.c[r]}return t}getFilter(e){return e.completingAfterDot?"":e.token.string.replace(".","").replace(/\s/g,"")}} \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/autocomplete/ts-parser.js b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/autocomplete/ts-parser.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/autocomplete/ts-parser.js rename to typo3/sysext/backend/Resources/Public/JavaScript/code-editor/autocomplete/ts-parser.js diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/autocomplete/ts-ref.js b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/autocomplete/ts-ref.js new file mode 100644 index 0000000000000000000000000000000000000000..77d2adca30feb508938b50fba9b5acb42e89a44f --- /dev/null +++ b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/autocomplete/ts-ref.js @@ -0,0 +1,13 @@ +/* + * This file is part of the TYPO3 CMS project. + * + * It is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, either version 2 + * of the License, or any later version. + * + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + * + * The TYPO3 project - inspiring people to share! + */ +import AjaxRequest from"@typo3/core/ajax/ajax-request.js";export class TsRefType{constructor(e,t,s){this.properties={},this.typeId=e,this.extends=t,this.properties=s}}export class TsRefProperty{constructor(e,t,s){this.parentType=e,this.name=t,this.value=s}}export class TsRef{constructor(){this.typeTree={},this.doc=null}async loadTsrefAsync(){const e=await new AjaxRequest(TYPO3.settings.ajaxUrls.codeeditor_tsref).get();this.doc=await e.resolve(),this.buildTree()}buildTree(){for(const e of Object.keys(this.doc)){const t=this.doc[e];this.typeTree[e]=new TsRefType(e,t.extends||void 0,Object.fromEntries(Object.entries(t.properties).map((([t,s])=>[t,new TsRefProperty(e,t,s.type)]))))}for(const e of Object.keys(this.typeTree))void 0!==this.typeTree[e].extends&&this.addPropertiesToType(this.typeTree[e],this.typeTree[e].extends,100)}addPropertiesToType(e,t,s){if(s<0)throw"Maximum recursion depth exceeded while trying to resolve the extends in the TSREF!";const r=t.split(",");for(let t=0;t<r.length;t++)if(void 0!==this.typeTree[r[t]]){void 0!==this.typeTree[r[t]].extends&&this.addPropertiesToType(this.typeTree[r[t]],this.typeTree[r[t]].extends,s-1);const i=this.typeTree[r[t]].properties;for(const t in i)void 0===e.properties[t]&&(e.properties[t]=i[t])}}getPropertiesFromTypeId(e){return void 0!==this.typeTree[e]?(this.typeTree[e].properties.clone=function(){const e={};for(const t of Object.keys(this))e[t]=new TsRefProperty(this[t].parentType,this[t].name,this[t].value);return e},this.typeTree[e].properties):{}}typeHasProperty(e,t){return void 0!==this.typeTree[e]&&void 0!==this.typeTree[e].properties[t]}getType(e){return this.typeTree[e]}isType(e){return void 0!==this.typeTree[e]}} \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/element/code-mirror-element.js b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/element/code-mirror-element.js similarity index 73% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/element/code-mirror-element.js rename to typo3/sysext/backend/Resources/Public/JavaScript/code-editor/element/code-mirror-element.js index 3e85a86484518cfd8c065afe161f8b2007b39e73..c15b16b82d81af480d659d9f42851745281db195 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/element/code-mirror-element.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/element/code-mirror-element.js @@ -15,7 +15,7 @@ var __decorate=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Obj <div id="codemirror-parent" @keydown=${e=>this.onKeydown(e)}></div> ${this.label&&"bottom"===this.panel?html`<div class="codemirror-label codemirror-label-bottom">${this.label}</div>`:""} ${null===this.editorView?html`<typo3-backend-spinner size="large"></typo3-backend-spinner>`:""} - `}firstUpdated(){if(this.nolazyload)return void this.initializeEditor(this.firstElementChild);const e={root:document.body},t=new IntersectionObserver((e=>{e.forEach((e=>{e.intersectionRatio>0&&(t.unobserve(e.target),this.firstElementChild&&"textarea"===this.firstElementChild.nodeName.toLowerCase()&&this.initializeEditor(this.firstElementChild))}))}),e);t.observe(this)}onKeydown(e){e.ctrlKey&&e.altKey&&"f"===e.key&&(e.preventDefault(),this.fullscreen=!0),"Escape"===e.key&&this.fullscreen&&(e.preventDefault(),this.fullscreen=!1)}async initializeEditor(e){const t=EditorView.updateListener.of((t=>{t.docChanged&&(e.value=t.state.doc.toString(),e.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}));this.lineDigits>0?this.style.setProperty("--rows",this.lineDigits.toString()):e.getAttribute("rows")&&this.style.setProperty("--rows",e.getAttribute("rows")),this.editorTheme=new Compartment;const o=[this.editorTheme.of([]),t,lineNumbers(),highlightSpecialChars(),drawSelection(),EditorState.allowMultipleSelections.of(!0),syntaxHighlighting(defaultHighlightStyle,{fallback:!0})];if(this.readonly&&o.push(EditorState.readOnly.of(!0)),this.placeholder&&o.push(placeholder(this.placeholder)),this.mode){const e=await executeJavaScriptModuleInstruction(this.mode);o.push(...e)}this.addons.length>0&&o.push(...await Promise.all(this.addons.map((e=>executeJavaScriptModuleInstruction(e)))));const r=[...defaultKeymap,indentWithTab];if(this.keymaps.length>0){const e=await Promise.all(this.keymaps.map((e=>loadModule(e).then((t=>resolveSubjectRef(t,e))))));e.forEach((e=>r.push(...e)))}o.push(keymap.of(r)),this.editorView=new EditorView({state:EditorState.create({doc:e.value,extensions:o}),parent:this.renderRoot.querySelector("#codemirror-parent"),root:this.renderRoot});const i=window.matchMedia("(prefers-color-scheme: dark)");this.toggleDarkMode(i.matches),i.addEventListener("change",(e=>{this.toggleDarkMode(e.matches)}))}toggleDarkMode(e){this.editorView.dispatch({effects:this.editorTheme.reconfigure(e?oneDark:[])})}};CodeMirrorElement.styles=css` + `}firstUpdated(){if(this.nolazyload)return void this.initializeEditor(this.firstElementChild);const e={root:document.body},t=new IntersectionObserver((e=>{e.forEach((e=>{e.intersectionRatio>0&&(t.unobserve(e.target),this.firstElementChild&&"textarea"===this.firstElementChild.nodeName.toLowerCase()&&this.initializeEditor(this.firstElementChild))}))}),e);t.observe(this)}setContent(e){null!==this.editorView&&this.editorView.dispatch({changes:{from:0,to:this.editorView.state.doc.length,insert:e}})}getContent(){return this.editorView.state.doc.toString()}onKeydown(e){e.ctrlKey&&e.altKey&&"f"===e.key&&(e.preventDefault(),this.fullscreen=!0),"Escape"===e.key&&this.fullscreen&&(e.preventDefault(),this.fullscreen=!1)}async initializeEditor(e){const t=EditorView.updateListener.of((t=>{t.docChanged&&(e.value=t.state.doc.toString(),e.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}));this.lineDigits>0?this.style.setProperty("--rows",this.lineDigits.toString()):e.getAttribute("rows")&&this.style.setProperty("--rows",e.getAttribute("rows")),this.editorTheme=new Compartment;const o=[this.editorTheme.of([]),t,lineNumbers(),highlightSpecialChars(),drawSelection(),EditorState.allowMultipleSelections.of(!0),syntaxHighlighting(defaultHighlightStyle,{fallback:!0})];if(this.readonly&&o.push(EditorState.readOnly.of(!0)),this.placeholder&&o.push(placeholder(this.placeholder)),this.mode){const e=await executeJavaScriptModuleInstruction(this.mode);o.push(...e)}this.addons.length>0&&o.push(...await Promise.all(this.addons.map((e=>executeJavaScriptModuleInstruction(e)))));const r=[...defaultKeymap,indentWithTab];if(this.keymaps.length>0){const e=await Promise.all(this.keymaps.map((e=>loadModule(e).then((t=>resolveSubjectRef(t,e))))));e.forEach((e=>r.push(...e)))}o.push(keymap.of(r)),this.editorView=new EditorView({state:EditorState.create({doc:e.value,extensions:o}),parent:this.renderRoot.querySelector("#codemirror-parent"),root:this.renderRoot});const i=window.matchMedia("(prefers-color-scheme: dark)");this.toggleDarkMode(i.matches),i.addEventListener("change",(e=>{this.toggleDarkMode(e.matches)}))}toggleDarkMode(e){this.editorView.dispatch({effects:this.editorTheme.reconfigure(e?oneDark:[])})}};CodeMirrorElement.styles=css` @media (prefers-color-scheme: dark) { :host { color-scheme: dark; diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/language/typoscript.js b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/language/typoscript.js new file mode 100644 index 0000000000000000000000000000000000000000..4297206199fab213721a99295cbdb8808ee57321 --- /dev/null +++ b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/language/typoscript.js @@ -0,0 +1,13 @@ +/* + * This file is part of the TYPO3 CMS project. + * + * It is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, either version 2 + * of the License, or any later version. + * + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + * + * The TYPO3 project - inspiring people to share! + */ +import DocumentService from"@typo3/core/document-service.js";import{StreamLanguage,LanguageSupport}from"@codemirror/language";import{TypoScriptStreamParserFactory}from"@typo3/backend/code-editor/stream-parser/typoscript.js";import{TsCodeCompletion}from"@typo3/backend/code-editor/autocomplete/ts-code-completion.js";import{syntaxTree}from"@codemirror/language";export function typoscript(){const e=StreamLanguage.define((new TypoScriptStreamParserFactory).create()),t=e.data.of({autocomplete:complete});return new LanguageSupport(e,[t])}const tsCodeCompletionInitializer=(async()=>{await DocumentService.ready();const e=parseInt(document.querySelector('input[name="effectivePid"]')?.value,10);return new TsCodeCompletion(e)})();export async function complete(e){if(!e.explicit)return null;const t=parseCodeMirror5CompatibleCompletionState(e),o=e.pos-(t.completingAfterDot?1:0),r=syntaxTree(e.state).resolveInner(o,-1),n="Document"===r.name||t.completingAfterDot?"":e.state.sliceDoc(r.from,o),s="Document"===r.name||t.completingAfterDot?e.pos:r.from;let a={start:r.from,end:o,string:n,type:r.name};/^[\w$_]*$/.test(n)||(a={start:e.pos,end:e.pos,string:"",type:"."===n?"property":null}),t.token=a;const i=(await tsCodeCompletionInitializer).refreshCodeCompletion(t);if(("string"===r.name||"comment"===r.name)&&tokenIsSubStringOfKeywords(n,i))return null;return{from:s,options:getCompletions(n,i).map((e=>({label:e,type:"keyword"})))}}function parseCodeMirror5CompatibleCompletionState(e){const t=e.state.sliceDoc().split(e.state.lineBreak).length,o=e.state.sliceDoc(0,e.pos).split(e.state.lineBreak).length,r=e.state.sliceDoc().split(e.state.lineBreak)[o-1],n="."===e.state.sliceDoc(e.pos-1,e.pos);return{lineTokens:extractCodemirror5StyleLineTokens(t,e),currentLineNumber:o,currentLine:r,lineCount:t,completingAfterDot:n}}function extractCodemirror5StyleLineTokens(e,t){const o=Array(e).fill("").map((()=>[]));let r=0,n=1;return syntaxTree(t.state).cursor().iterate((s=>{const a=s.type.name||s.name;if("Document"===a)return;const i=s.from,c=s.to;r<i&&t.state.sliceDoc(r,i).split(t.state.lineBreak).forEach((t=>{t&&(o[Math.min(n-1,e-1)].push({type:null,string:t,start:r,end:r+t.length}),n++,r+=t.length)}));const l=t.state.sliceDoc(s.from,s.to);n=t.state.sliceDoc(0,s.from).split(t.state.lineBreak).length,o[n-1].push({type:a,string:l,start:i,end:c}),r=c})),r<t.state.doc.length&&o[n-1].push({type:null,string:t.state.sliceDoc(r),start:r,end:t.state.doc.length}),o}function tokenIsSubStringOfKeywords(e,t){const o=e.length;for(let r=0;r<t.length;++r)if(e===t[r].substr(o))return!0;return!1}function getCompletions(e,t){const o=new Set;for(let n=0,s=t.length;n<s;++n)0!==(r=t[n]).lastIndexOf(e,0)||o.has(r)||o.add(r);var r;const n=Array.from(o);return n.sort(),n} \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/stream-parser/typoscript.js b/typo3/sysext/backend/Resources/Public/JavaScript/code-editor/stream-parser/typoscript.js similarity index 100% rename from typo3/sysext/t3editor/Resources/Public/JavaScript/stream-parser/typoscript.js rename to typo3/sysext/backend/Resources/Public/JavaScript/code-editor/stream-parser/typoscript.js diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/pagetsconfig/pagetsconfig-includes.js b/typo3/sysext/backend/Resources/Public/JavaScript/pagetsconfig/pagetsconfig-includes.js index 47e8262775a3e72e5cce5abcee93ec401b61c4c1..9cf60d62e199eaa781c3850bbfd2cee5cd167eae 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/pagetsconfig/pagetsconfig-includes.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/pagetsconfig/pagetsconfig-includes.js @@ -10,8 +10,8 @@ * * The TYPO3 project - inspiring people to share! */ -import DocumentService from"@typo3/core/document-service.js";import{default as Modal}from"@typo3/backend/modal.js";import{topLevelModuleImport}from"@typo3/backend/utility/top-level-module-import.js";import{html}from"lit";import{until}from"lit/directives/until.js";import AjaxRequest from"@typo3/core/ajax/ajax-request.js";class PageTsConfigIncludes{constructor(){this.registerEventListeners()}async registerEventListeners(){await DocumentService.ready(),document.querySelectorAll(".t3js-pagetsconfig-includes-modal").forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault();const o=Modal.types.default,r=e.dataset.modalTitle||e.textContent.trim(),a=e.getAttribute("href"),l=Modal.sizes.large,i=html`${until(this.fetchModalContent(a),html`<div class="modal-loading"><typo3-backend-spinner size="default"></typo3-backend-spinner></div>`)}`;Modal.advanced({type:o,title:r,size:l,content:i})}))}))}async fetchModalContent(e){topLevelModuleImport("@typo3/t3editor/element/code-mirror-element.js");const t=await new AjaxRequest(e).get(),o=await t.resolve();return html` - <typo3-t3editor-codemirror .mode="${{name:"@typo3/t3editor/language/typoscript.js",flags:2,exportName:"typoscript",items:[{type:"invoke",args:[]}]}}" nolazyload readonly class="flex-grow-1 mh-100"> +import DocumentService from"@typo3/core/document-service.js";import{default as Modal}from"@typo3/backend/modal.js";import{topLevelModuleImport}from"@typo3/backend/utility/top-level-module-import.js";import{html}from"lit";import{until}from"lit/directives/until.js";import AjaxRequest from"@typo3/core/ajax/ajax-request.js";class PageTsConfigIncludes{constructor(){this.registerEventListeners()}async registerEventListeners(){await DocumentService.ready(),document.querySelectorAll(".t3js-pagetsconfig-includes-modal").forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault();const o=Modal.types.default,r=e.dataset.modalTitle||e.textContent.trim(),a=e.getAttribute("href"),l=Modal.sizes.large,i=html`${until(this.fetchModalContent(a),html`<div class="modal-loading"><typo3-backend-spinner size="default"></typo3-backend-spinner></div>`)}`;Modal.advanced({type:o,title:r,size:l,content:i})}))}))}async fetchModalContent(e){topLevelModuleImport("@typo3/backend/code-editor/element/code-mirror-element.js");const t=await new AjaxRequest(e).get(),o=await t.resolve();return html` + <typo3-t3editor-codemirror .mode="${{name:"@typo3/backend/code-editor/language/typoscript.js",flags:2,exportName:"typoscript",items:[{type:"invoke",args:[]}]}}" nolazyload readonly class="flex-grow-1 mh-100"> <textarea readonly disabled class="form-control">${o}</textarea> </typo3-t3editor-codemirror> `}}export default new PageTsConfigIncludes; \ No newline at end of file diff --git a/typo3/sysext/t3editor/Tests/Unit/Registry/AddonRegistryTest.php b/typo3/sysext/backend/Tests/Unit/CodeEditor/Registry/AddonRegistryTest.php similarity index 94% rename from typo3/sysext/t3editor/Tests/Unit/Registry/AddonRegistryTest.php rename to typo3/sysext/backend/Tests/Unit/CodeEditor/Registry/AddonRegistryTest.php index 6a7417324a0db260c3ffb4d01bdaefc7cdfe9e43..fe3cd3b3bc23191c0e72d8d040bb11e21aa38017 100644 --- a/typo3/sysext/t3editor/Tests/Unit/Registry/AddonRegistryTest.php +++ b/typo3/sysext/backend/Tests/Unit/CodeEditor/Registry/AddonRegistryTest.php @@ -15,11 +15,11 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor\Tests\Unit\Registry; +namespace TYPO3\CMS\Backend\Tests\Unit\CodeEditor\Registry; +use TYPO3\CMS\Backend\CodeEditor\Addon; +use TYPO3\CMS\Backend\CodeEditor\Registry\AddonRegistry; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\T3editor\Addon; -use TYPO3\CMS\T3editor\Registry\AddonRegistry; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; /** diff --git a/typo3/sysext/t3editor/Tests/Unit/Registry/ModeRegistryTest.php b/typo3/sysext/backend/Tests/Unit/CodeEditor/Registry/ModeRegistryTest.php similarity index 93% rename from typo3/sysext/t3editor/Tests/Unit/Registry/ModeRegistryTest.php rename to typo3/sysext/backend/Tests/Unit/CodeEditor/Registry/ModeRegistryTest.php index 930b1f5df323731864c04195ff7edac11d9c4781..33f329cd13b8f6dc148c1c660c5fa28ae7b9805c 100644 --- a/typo3/sysext/t3editor/Tests/Unit/Registry/ModeRegistryTest.php +++ b/typo3/sysext/backend/Tests/Unit/CodeEditor/Registry/ModeRegistryTest.php @@ -15,12 +15,12 @@ declare(strict_types=1); * The TYPO3 project - inspiring people to share! */ -namespace TYPO3\CMS\T3editor\Tests\Unit\Registry; +namespace TYPO3\CMS\Backend\Tests\Unit\CodeEditor\Registry; +use TYPO3\CMS\Backend\CodeEditor\Mode; +use TYPO3\CMS\Backend\CodeEditor\Registry\ModeRegistry; use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\T3editor\Mode; -use TYPO3\CMS\T3editor\Registry\ModeRegistry; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; /** diff --git a/typo3/sysext/backend/Tests/Unit/Form/Element/JsonElementTest.php b/typo3/sysext/backend/Tests/Unit/Form/Element/JsonElementTest.php index 30c522dfd0f2fba7cd9d5c60e894ae005c80cb99..3124606db1d7652fd54e369a8afb8a4b4f28073c 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/Element/JsonElementTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/Element/JsonElementTest.php @@ -17,6 +17,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\Tests\Unit\Form\Element; +use TYPO3\CMS\Backend\CodeEditor\Mode; +use TYPO3\CMS\Backend\CodeEditor\Registry\ModeRegistry; use TYPO3\CMS\Backend\Form\Element\JsonElement; use TYPO3\CMS\Backend\Form\NodeExpansion\FieldInformation; use TYPO3\CMS\Backend\Form\NodeFactory; @@ -26,8 +28,6 @@ use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Package\PackageManager; use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\T3editor\Mode; -use TYPO3\CMS\T3editor\Registry\ModeRegistry; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; final class JsonElementTest extends UnitTestCase @@ -119,7 +119,7 @@ final class JsonElementTest extends UnitTestCase $subject->setData($data); $result = $subject->render(); - self::assertEquals('@typo3/t3editor/element/code-mirror-element.js', $result['javaScriptModules'][0]->getName()); + self::assertEquals('@typo3/backend/code-editor/element/code-mirror-element.js', $result['javaScriptModules'][0]->getName()); self::assertStringContainsString('<typo3-t3editor-codemirror', $result['html']); self::assertStringContainsString('placeholder="placeholder"', $result['html']); self::assertStringContainsString('"foo": "bar"', $result['html']); diff --git a/typo3/sysext/backend/composer.json b/typo3/sysext/backend/composer.json index 5f827e229a9b4d10df13753feb3511d2d4346aa1..930c3a2400d3d40ec82a42ff943c26bd2dc8d740 100644 --- a/typo3/sysext/backend/composer.json +++ b/typo3/sysext/backend/composer.json @@ -19,6 +19,7 @@ "sort-packages": true }, "require": { + "ext-libxml": "*", "psr/event-dispatcher": "^1.0", "typo3/cms-core": "13.0.*@dev" }, @@ -34,6 +35,7 @@ "typo3/cms-cshmanual": "*", "typo3/cms-func-wizards": "*", "typo3/cms-recordlist": "*", + "typo3/cms-t3editor": "*", "typo3/cms-wizard-crpages": "*", "typo3/cms-wizard-sortpages": "*" }, diff --git a/typo3/sysext/core/Classes/Configuration/Tca/TcaMigration.php b/typo3/sysext/core/Classes/Configuration/Tca/TcaMigration.php index 0d1f0cfd081af726c18f5276777385f06ce35795..ac6c864b2919777ba383cf3f76be3faac1cf1673 100644 --- a/typo3/sysext/core/Classes/Configuration/Tca/TcaMigration.php +++ b/typo3/sysext/core/Classes/Configuration/Tca/TcaMigration.php @@ -83,6 +83,7 @@ class TcaMigration $tca = $this->migrateItemsToAssociativeArray($tca); $tca = $this->removeMmInsertFields($tca); $tca = $this->removeMmHasUidField($tca); + $tca = $this->migrateT3EditorToCodeEditor($tca); return $tca; } @@ -1479,4 +1480,33 @@ class TcaMigration } return $tca; } + + protected function migrateT3EditorToCodeEditor(array $tca): array + { + foreach ($tca as $table => $tableDefinition) { + if (!is_array($tableDefinition['columns'] ?? false)) { + continue; + } + foreach ($tableDefinition['columns'] as $fieldName => $fieldConfig) { + if (($fieldConfig['config']['renderType'] ?? '') === 't3editor') { + $tca[$table]['columns'][$fieldName]['config']['renderType'] = 'codeEditor'; + $this->messages[] = 'The TCA field \'' . $fieldName . '\' of table \'' . $table . '\' uses ' + . '\'renderType\' with the value \'t3editor\', which has been migrated to \'codeEditor\'. ' + . 'Please adjust your TCA accordingly.'; + } + } + + foreach ($tableDefinition['types'] ?? [] as $typeName => $typeConfig) { + foreach ($typeConfig['columnsOverrides'] ?? [] as $columnOverride => $columnOverrideConfig) { + if (($columnOverrideConfig['config']['renderType'] ?? '') === 't3editor') { + $tca[$table]['types'][$typeName]['columnsOverrides'][$columnOverride]['config']['renderType'] = 'codeEditor'; + $this->messages[] = 'The TCA column override \'' . $columnOverride . '\' of table \'' . $table . '\' uses ' + . '\'renderType\' with the value \'t3editor\', which has been migrated to \'codeEditor\'. ' + . 'Please adjust your TCA accordingly.'; + } + } + } + } + return $tca; + } } diff --git a/typo3/sysext/core/Documentation/Changelog/13.0/Breaking-102440-EXTt3editorMergedIntoEXTbackend.rst b/typo3/sysext/core/Documentation/Changelog/13.0/Breaking-102440-EXTt3editorMergedIntoEXTbackend.rst new file mode 100644 index 0000000000000000000000000000000000000000..5c2324b2e4d0ca4c528a0cec08a6ac8324c6d23f --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/13.0/Breaking-102440-EXTt3editorMergedIntoEXTbackend.rst @@ -0,0 +1,59 @@ +.. include:: /Includes.rst.txt + +.. _breaking-102440-1700638677: + +======================================================== +Breaking: #102440 - EXT:t3editor merged into EXT:backend +======================================================== + +See :issue:`102440` + +Description +=========== + +TYPO3 comes with a code editor extension called "t3editor" for a long time. +Since then, the extension was always optional. When the extension is installed, +selected text areas are converted to code editors based on CodeMirror. + +The optional extension has been merged into `EXT:backend`, making the code +editor always available. + + +Impact +====== + +An integrator cannot optionally install the code editor anymore as it's part of +the mandatory "backend" extension now. + +By default, this affects the following occurrences: + +* TCA: `be_groups.TSconfig` +* TCA: `be_users.TSconfig` +* TCA: `pages.TSconfig` +* TCA: `sys_template.constants` +* TCA: `sys_template.config` +* TCA: `tt_content.bodytext`, if the content element is of type "HTML" +* EXT:filelist: edit file content +* Composer status view in Extension Manager + +Also, checks whether the extension is installed via +:php:`TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('t3editor')` +are now obsolete. + + +Affected installations +====================== + +All installations are affected. + + +Migration +========= + +Extension checks using :php:`TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('t3editor')` +don't have an effect anymore and must get removed. + +In addition, please see <Deprecation-102440-EXTt3editorMergedIntoEXTBackend>. + + +.. index:: Backend, JavaScript, PHP-API, NotScanned, ext:t3editor diff --git a/typo3/sysext/core/Documentation/Changelog/13.0/Deprecation-102440-EXTt3editorMergedIntoEXTBackend.rst b/typo3/sysext/core/Documentation/Changelog/13.0/Deprecation-102440-EXTt3editorMergedIntoEXTBackend.rst new file mode 100644 index 0000000000000000000000000000000000000000..a75c51b8fdccb74b273c3c68c6e542ab243afc44 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/13.0/Deprecation-102440-EXTt3editorMergedIntoEXTBackend.rst @@ -0,0 +1,45 @@ +.. include:: /Includes.rst.txt + +.. _deprecation-102440-1700638677: + +=========================================================== +Deprecation: #102440 - EXT:t3editor merged into EXT:backend +=========================================================== + +See :issue:`102440` + +Description +=========== + +The JavaScript module specifier for modules shipped with the previous "t3editor" +extension has changed from :js:`@typo3/t3editor/` to +:js:`@typo3/backend/code-editor/`. The old specifier :js:`@typo3/t3editor/` is +still available, but deprecated. + +The value of the existing TCA option `renderType` switched from `t3editor` to +`codeEditor`. + + +Impact +====== + +The module specifier :js:`@typo3/t3editor/` automatically maps to +:js:`@typo3/backend/code-editor/`. The TCA render type `t3editor` is +automatically migrated to `codeEditor`, triggering a deprecation log entry. + + +Affected installations +====================== + +All extensions using t3editor are affected. + + +Migration +========= + +The JavaScript module namespace :js:`@typo3/t3editor/` maps to +:js:`@typo3/backend/code-editor/`. + +Rewrite all TCA render types usages of `t3editor` to `codeEditor`. + +.. index:: Backend, JavaScript, TCA, NotScanned, ext:t3editor diff --git a/typo3/sysext/core/Documentation/Settings.cfg b/typo3/sysext/core/Documentation/Settings.cfg index eeed4b941b7c8c8751281a95762d167742186d6f..a45e7df052215eb3de4ff36082909c93d8c9d04d 100644 --- a/typo3/sysext/core/Documentation/Settings.cfg +++ b/typo3/sysext/core/Documentation/Settings.cfg @@ -62,5 +62,4 @@ ext_reactions = https://docs.typo3.org/c/typo3/cms-reactions/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/core/Tests/Acceptance/Application/FileList/FileOperationsCest.php b/typo3/sysext/core/Tests/Acceptance/Application/FileList/FileOperationsCest.php index ebf4bf0b7bc763f6d077158cf8ea5e982ae0fe6d..5450c8119b8e61db9cb378fcf0789f2fc5c533b7 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/FileList/FileOperationsCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/FileList/FileOperationsCest.php @@ -35,7 +35,7 @@ final class FileOperationsCest public function fileCrud(ApplicationTester $I, ModalDialog $modalDialog): void { - $fileTextareaSelector = 'textarea[name="data[editfile][0][data]"]'; + $codeMirrorSelector = 'typo3-t3editor-codemirror[name="data[editfile][0][data]"]'; $fileName = 'typo3-test.txt'; $flashMessageSelector = '.typo3-messages'; @@ -48,13 +48,14 @@ final class FileOperationsCest $I->wait(0.2); $I->click('Create file'); $I->see('File created:', $flashMessageSelector); - $I->fillField($fileTextareaSelector, 'Some Text'); + $I->waitForElementVisible($codeMirrorSelector); + $I->executeJS("document.querySelector('" . $codeMirrorSelector . "').setContent('Some Text')"); // Save file $I->amGoingTo('save the file'); $I->click('.module-docheader button[name="_save"]'); - $textareaValue = $I->grabValueFrom($fileTextareaSelector); - $I->assertEquals('Some Text', $textareaValue); + $I->waitForElementVisible($codeMirrorSelector); + $I->executeJS("console.assert(document.querySelector('" . $codeMirrorSelector . "').getContent() === 'Some Text')"); $I->see('File saved to', $flashMessageSelector); // Save file diff --git a/typo3/sysext/core/Tests/Acceptance/Application/Impexp/UsersCest.php b/typo3/sysext/core/Tests/Acceptance/Application/Impexp/UsersCest.php index 85d72131b8f699affdcafaeb934bcf545f3882d2..5ff4f7140faf48aee14813827ecb4d820f4b719c 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/Impexp/UsersCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/Impexp/UsersCest.php @@ -67,7 +67,7 @@ final class UsersCest extends AbstractCest $selectedPageTitle = 'Root'; $selectedPageIcon = '//*[text()=\'' . $selectedPageTitle . '\']/../*[contains(@class, \'node-icon-container\')]'; - $this->setUserTsConfig($I, 2, "options.impexp.enableImportForNonAdminUser = 1\noptions.impexp.enableExportForNonAdminUser = 1"); + $this->setUserTsConfig($I, 2, 'options.impexp.enableImportForNonAdminUser = 1\noptions.impexp.enableExportForNonAdminUser = 1'); $I->useExistingSession('editor'); $I->click($selectedPageIcon); @@ -79,6 +79,9 @@ final class UsersCest extends AbstractCest $I->useExistingSession('admin'); } + /** + * @depends showImportExportInContextMenuForNonAdminUserIfFlagSet + */ public function hideImportCheckboxForceAllUidsForNonAdmin(ApplicationTester $I): void { $selectedPageTitle = 'Root'; @@ -101,6 +104,9 @@ final class UsersCest extends AbstractCest $I->useExistingSession('admin'); } + /** + * @depends showImportExportInContextMenuForNonAdminUserIfFlagSet + */ public function hideUploadTabAndImportPathIfNoImportFolderAvailable(ApplicationTester $I, PageTree $pageTree): void { $selectedPageTitle = 'Root'; @@ -221,13 +227,16 @@ final class UsersCest extends AbstractCest $I->switchToContentFrame(); } + $codeMirrorSelector = 'typo3-t3editor-codemirror[name="data[be_users][' . $userId . '][TSconfig]"]'; + $I->waitForElementVisible($this->inModuleHeader . ' [name=BackendUserModuleMenu]'); $I->selectOption($this->inModuleHeader . ' [name=BackendUserModuleMenu]', ['text' => 'Backend users']); $I->waitForElement('#typo3-backend-user-list'); $I->click('//table[@id="typo3-backend-user-list"]/tbody/tr[descendant::a[@data-contextmenu-uid="' . $userId . '"]]//a[@title="Edit"]'); $I->waitForElement('#EditDocumentController'); $I->click('//form[@id="EditDocumentController"]//ul/li[5]/a'); - $I->fillField('//div[@class="tab-content"]/div[5]/fieldset[1]//textarea', $userTsConfig); + $I->waitForElementVisible($codeMirrorSelector); + $I->executeJS("document.querySelector('" . $codeMirrorSelector . "').setContent('" . $userTsConfig . "')"); $I->click($this->inModuleHeader . ' .btn[title="Save"]'); $I->wait(0.5); $I->click($this->inModuleHeader . ' .btn[title="Close"]'); diff --git a/typo3/sysext/core/Tests/Acceptance/Application/Template/TemplateCest.php b/typo3/sysext/core/Tests/Acceptance/Application/Template/TemplateCest.php index f728aa904311aa0c3054c3be6a4c87a7d45d17e7..cbb5c23cecad53f7a2134ed899c9483b6b69d7a8 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/Template/TemplateCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/Template/TemplateCest.php @@ -93,11 +93,11 @@ final class TemplateCest $I->waitForElement('#EditDocumentController'); $I->waitForElementNotVisible('#t3js-ui-block'); + $codeMirrorSelector = 'typo3-t3editor-codemirror[name$="[config]"]'; + $I->wantTo('change the setup, save the TypoScript record and close the form'); - // grab and fill setup textarea - $config = $I->grabTextFrom('//textarea[contains(@data-formengine-input-name, "data[sys_template]") and contains(@data-formengine-input-name, "[config]")]'); - $config = str_replace('HELLO WORLD!', 'Hello Acceptance Test!', $config); - $I->fillField('//textarea[contains(@data-formengine-input-name, "data[sys_template]") and contains(@data-formengine-input-name, "[config]")]', $config); + $I->waitForElementVisible($codeMirrorSelector); + $I->executeJS("const codeMirror = document.querySelector('" . $codeMirrorSelector . "'); const config = codeMirror.getContent().replace('HELLO WORLD!', 'Hello Acceptance Test!'); codeMirror.setContent(config)"); $I->switchToMainFrame(); $I->waitForElementNotVisible('typo3-notification-message', 20); $I->switchToContentFrame(); diff --git a/typo3/sysext/core/Tests/Functional/Package/PackageStatesTest.php b/typo3/sysext/core/Tests/Functional/Package/PackageStatesTest.php index 69c30120f1dfd864e982ec369fde71f324e49ca2..4af328ae5fa66cb2773501b633f331eac3c027de 100644 --- a/typo3/sysext/core/Tests/Functional/Package/PackageStatesTest.php +++ b/typo3/sysext/core/Tests/Functional/Package/PackageStatesTest.php @@ -59,7 +59,6 @@ final class PackageStatesTest extends FunctionalTestCase 'seo', 'setup', 'sys_note', - 't3editor', 'tstemplate', 'viewpage', 'webhooks', @@ -133,7 +132,6 @@ final class PackageStatesTest extends FunctionalTestCase 'reactions', 'seo', 'sys_note', - 't3editor', 'tstemplate', 'viewpage', 'webhooks', diff --git a/typo3/sysext/core/Tests/Unit/Configuration/Tca/TcaMigrationTest.php b/typo3/sysext/core/Tests/Unit/Configuration/Tca/TcaMigrationTest.php index 2cf72279037f25aa92132277d11e7303adb197b6..56c0137fa0bfcc79ad76c9e636d89aeab606c326 100644 --- a/typo3/sysext/core/Tests/Unit/Configuration/Tca/TcaMigrationTest.php +++ b/typo3/sysext/core/Tests/Unit/Configuration/Tca/TcaMigrationTest.php @@ -3733,4 +3733,68 @@ final class TcaMigrationTest extends UnitTestCase ]; self::assertSame($expected, (new TcaMigration())->migrate($input)); } + + /** + * @test + */ + public function migrationChangesRenderTypeFromT3Editor(): void + { + $input = [ + 'aTable' => [ + 'columns' => [ + 'aColumn' => [ + 'config' => [ + 'type' => 'text', + 'renderType' => 't3editor', + ], + ], + 'bColumn' => [ + 'config' => [ + 'type' => 'text', + ], + ], + ], + 'types' => [ + 'aType' => [ + 'columnsOverrides' => [ + 'bColumn' => [ + 'config' => [ + 'renderType' => 't3editor', + ], + ], + ], + ], + ], + ], + ]; + $expected = [ + 'aTable' => [ + 'columns' => [ + 'aColumn' => [ + 'config' => [ + 'type' => 'text', + 'renderType' => 'codeEditor', + ], + ], + 'bColumn' => [ + 'config' => [ + 'type' => 'text', + ], + ], + ], + 'types' => [ + 'aType' => [ + 'columnsOverrides' => [ + 'bColumn' => [ + 'config' => [ + 'renderType' => 'codeEditor', + ], + ], + ], + ], + ], + ], + ]; + self::assertSame($expected, (new TcaMigration())->migrate($input)); + } } diff --git a/typo3/sysext/dashboard/Documentation/Settings.cfg b/typo3/sysext/dashboard/Documentation/Settings.cfg index 3b4a80744c17e831db0530e1c049d6bb428bdee5..28a3b28ba8c63dc67f484da85b6b65ca4f46409b 100644 --- a/typo3/sysext/dashboard/Documentation/Settings.cfg +++ b/typo3/sysext/dashboard/Documentation/Settings.cfg @@ -62,5 +62,4 @@ ext_core = https://docs.typo3.org/c/typo3/cms-core/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/extensionmanager/Classes/Controller/ExtensionComposerStatusController.php b/typo3/sysext/extensionmanager/Classes/Controller/ExtensionComposerStatusController.php index d5570d9b7a35a416e3cd5fb7a2bf517b3a8ee9d5..30e15115c3906a3441740309bafbfca90751ede9 100644 --- a/typo3/sysext/extensionmanager/Classes/Controller/ExtensionComposerStatusController.php +++ b/typo3/sysext/extensionmanager/Classes/Controller/ExtensionComposerStatusController.php @@ -23,9 +23,7 @@ use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Imaging\IconSize; use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; use TYPO3\CMS\Core\Page\PageRenderer; -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Extensionmanager\Package\ComposerDeficitDetector; use TYPO3\CMS\Extensionmanager\Service\ComposerManifestProposalGenerator; @@ -100,27 +98,21 @@ class ExtensionComposerStatusController extends AbstractController if ($composerManifest === '') { return ''; } - $rows = MathUtility::forceIntegerInRange(count(explode(LF, $composerManifest)), 1, PHP_INT_MAX); - if (ExtensionManagementUtility::isLoaded('t3editor')) { - $this->pageRenderer->loadJavaScriptModule('@typo3/t3editor/element/code-mirror-element.js'); - $codeMirrorConfig = [ - 'label' => $extensionKey . ' > composer.json', - 'panel' => 'bottom', - 'mode' => GeneralUtility::jsonEncodeForHtmlAttribute(JavaScriptModuleInstruction::create('@codemirror/lang-json', 'json')->invoke(), false), - 'nolazyload' => 'true', - 'autoheight' => 'true', - ]; - $textareaAttributes = [ - 'rows' => (string)count(explode(LF, $composerManifest)), - 'class' => 'form-control', - ]; - return '<typo3-t3editor-codemirror ' . GeneralUtility::implodeAttributes($codeMirrorConfig, true) . '>' - . '<textarea ' . GeneralUtility::implodeAttributes($textareaAttributes, true) . '>' . htmlspecialchars($composerManifest) . '</textarea>' - . '</typo3-t3editor-codemirror>'; - } - return '<textarea ' . GeneralUtility::implodeAttributes(['class' => 'form-control', 'rows' => (string)++$rows], true) . '>' - . htmlspecialchars($composerManifest) - . '</textarea>'; + $this->pageRenderer->loadJavaScriptModule('@typo3/backend/code-editor/element/code-mirror-element.js'); + $codeMirrorConfig = [ + 'label' => $extensionKey . ' > composer.json', + 'panel' => 'bottom', + 'mode' => GeneralUtility::jsonEncodeForHtmlAttribute(JavaScriptModuleInstruction::create('@codemirror/lang-json', 'json')->invoke(), false), + 'nolazyload' => 'true', + 'autoheight' => 'true', + ]; + $textareaAttributes = [ + 'rows' => (string)count(explode(LF, $composerManifest)), + 'class' => 'form-control', + ]; + return '<typo3-t3editor-codemirror ' . GeneralUtility::implodeAttributes($codeMirrorConfig, true) . '>' + . '<textarea ' . GeneralUtility::implodeAttributes($textareaAttributes, true) . '>' . htmlspecialchars($composerManifest) . '</textarea>' + . '</typo3-t3editor-codemirror>'; } protected function registerDocHeaderButtons(ModuleTemplate $view): void diff --git a/typo3/sysext/felogin/Documentation/Settings.cfg b/typo3/sysext/felogin/Documentation/Settings.cfg index 71498ef20009c9a4819d92d4cc6c59933d00c694..1c1bb40068552e8da59592898ad2be7dacade527 100644 --- a/typo3/sysext/felogin/Documentation/Settings.cfg +++ b/typo3/sysext/felogin/Documentation/Settings.cfg @@ -62,5 +62,4 @@ t3coreapi = https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/fluid_styled_content/Documentation/Settings.cfg b/typo3/sysext/fluid_styled_content/Documentation/Settings.cfg index 4d7c2c832caf038719d6b3bcd08600af5c2e6d48..23a0b124eeba8aecdf2299f230e93ec54ce4e0dc 100644 --- a/typo3/sysext/fluid_styled_content/Documentation/Settings.cfg +++ b/typo3/sysext/fluid_styled_content/Documentation/Settings.cfg @@ -62,5 +62,4 @@ t3upgrade = https://docs.typo3.org/m/typo3/guide-installation/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/form/Documentation/Settings.cfg b/typo3/sysext/form/Documentation/Settings.cfg index a4e2e6d0430e919276e75b51c340cd7166db6a93..bbfe8b2b43b447b78a2453652576186ec126b577 100644 --- a/typo3/sysext/form/Documentation/Settings.cfg +++ b/typo3/sysext/form/Documentation/Settings.cfg @@ -62,7 +62,6 @@ t3coreapi = https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ [extlinks] diff --git a/typo3/sysext/impexp/Documentation/Settings.cfg b/typo3/sysext/impexp/Documentation/Settings.cfg index e2b855bb910ac0e49195584e294c5ea367f9e598..91502ac1dbbefedc00aceb0bd33531281053a889 100644 --- a/typo3/sysext/impexp/Documentation/Settings.cfg +++ b/typo3/sysext/impexp/Documentation/Settings.cfg @@ -62,5 +62,4 @@ t3tsconfig = https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/indexed_search/Documentation/Settings.cfg b/typo3/sysext/indexed_search/Documentation/Settings.cfg index 09c30b3cccabda2c8858ae5a98fa8549eea36710..1cf37f9f282a023dcd021cdc470c297c9c8f4b1a 100644 --- a/typo3/sysext/indexed_search/Documentation/Settings.cfg +++ b/typo3/sysext/indexed_search/Documentation/Settings.cfg @@ -62,5 +62,4 @@ t3tsref = https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/linkvalidator/Documentation/Settings.cfg b/typo3/sysext/linkvalidator/Documentation/Settings.cfg index f65e2b9f7174cc151b997fea4682ca98cab149d9..fb137e2a4011d1c9b6aa2dfbac9c3aa85205a242 100644 --- a/typo3/sysext/linkvalidator/Documentation/Settings.cfg +++ b/typo3/sysext/linkvalidator/Documentation/Settings.cfg @@ -62,5 +62,4 @@ t3tca = https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/lowlevel/Documentation/Settings.cfg b/typo3/sysext/lowlevel/Documentation/Settings.cfg index c54790ed56e82e09b0ae39ee1d175c9936d66d9d..3b5ad2d692152450b1ae1edc38722e7aee6dd098 100644 --- a/typo3/sysext/lowlevel/Documentation/Settings.cfg +++ b/typo3/sysext/lowlevel/Documentation/Settings.cfg @@ -62,5 +62,4 @@ ext_reactions = https://docs.typo3.org/c/typo3/cms-reactions/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/reactions/Documentation/Settings.cfg b/typo3/sysext/reactions/Documentation/Settings.cfg index 043f36b3f652d2945cf444deccd9e49875f41ae4..3e10d3e4b385152b68b612cf123eb53792938b3c 100644 --- a/typo3/sysext/reactions/Documentation/Settings.cfg +++ b/typo3/sysext/reactions/Documentation/Settings.cfg @@ -62,7 +62,6 @@ t3tca = https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ [extlinks] diff --git a/typo3/sysext/recycler/Documentation/Settings.cfg b/typo3/sysext/recycler/Documentation/Settings.cfg index b269d124d4dcddde155c976f8a413c5581bd2074..f1b80247eafa1523dd2e695ab47201ddc2877716 100644 --- a/typo3/sysext/recycler/Documentation/Settings.cfg +++ b/typo3/sysext/recycler/Documentation/Settings.cfg @@ -62,5 +62,4 @@ ext_lowlevel = https://docs.typo3.org/c/typo3/cms-lowlevel/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/redirects/Documentation/Settings.cfg b/typo3/sysext/redirects/Documentation/Settings.cfg index ff19acfe5e78a19ae4a0caad1bf21bc9b18572d3..ebf2902dcea1b709387acd6ed616e6a18e046ef7 100644 --- a/typo3/sysext/redirects/Documentation/Settings.cfg +++ b/typo3/sysext/redirects/Documentation/Settings.cfg @@ -62,5 +62,4 @@ t3coreapi = https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/reports/Documentation/Settings.cfg b/typo3/sysext/reports/Documentation/Settings.cfg index e7707936069d454ad88229e4d0b051cdd5a5172a..253dbcc7c648682d5307f5149e60651c1faabe60 100644 --- a/typo3/sysext/reports/Documentation/Settings.cfg +++ b/typo3/sysext/reports/Documentation/Settings.cfg @@ -62,5 +62,4 @@ t3start = https://docs.typo3.org/m/typo3/tutorial-getting-started/main/en # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/rte_ckeditor/Documentation/Settings.cfg b/typo3/sysext/rte_ckeditor/Documentation/Settings.cfg index f1ed4b50f18732f674a67abf2013bf377818a54e..165b16f84d77ee54825bae924bdb063a444dcb37 100644 --- a/typo3/sysext/rte_ckeditor/Documentation/Settings.cfg +++ b/typo3/sysext/rte_ckeditor/Documentation/Settings.cfg @@ -62,5 +62,4 @@ t3tsref = https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/scheduler/Documentation/Settings.cfg b/typo3/sysext/scheduler/Documentation/Settings.cfg index af38559d2c23a6f7602c0176a5dc476291a596f1..d669c74cc577505dcab9fcaba9e33b6f8c1c8035 100644 --- a/typo3/sysext/scheduler/Documentation/Settings.cfg +++ b/typo3/sysext/scheduler/Documentation/Settings.cfg @@ -62,5 +62,4 @@ t3coreapi = https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/seo/Documentation/Settings.cfg b/typo3/sysext/seo/Documentation/Settings.cfg index 725b0ed50e87a3cf0d0ba2df9a67a8209fb27ec5..9d174f99c66be5a27ef0d00a2e002c023cc991e6 100644 --- a/typo3/sysext/seo/Documentation/Settings.cfg +++ b/typo3/sysext/seo/Documentation/Settings.cfg @@ -62,5 +62,4 @@ ext_redirects = https://docs.typo3.org/c/typo3/cms-redirects/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGenerator/TypeTextFormatT3editor.php b/typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGenerator/TypeTextFormatCodeEditor.php similarity index 88% rename from typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGenerator/TypeTextFormatT3editor.php rename to typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGenerator/TypeTextFormatCodeEditor.php index a52d7b0bba2c1775c1564e8c3a88626a221a4900..5c11ece8c5e6ad4f8f4cbc54c1fb798094b91fcc 100644 --- a/typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGenerator/TypeTextFormatT3editor.php +++ b/typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGenerator/TypeTextFormatCodeEditor.php @@ -24,7 +24,7 @@ use TYPO3\CMS\Styleguide\TcaDataGenerator\FieldGeneratorInterface; * * @internal */ -final class TypeTextFormatT3editor extends AbstractFieldGenerator implements FieldGeneratorInterface +final class TypeTextFormatCodeEditor extends AbstractFieldGenerator implements FieldGeneratorInterface { /** * @var array General match if type=text @@ -33,7 +33,7 @@ final class TypeTextFormatT3editor extends AbstractFieldGenerator implements Fie 'fieldConfig' => [ 'config' => [ 'type' => 'text', - 'renderType' => 't3editor', + 'renderType' => 'codeEditor', 'format' => 'html', ], ], diff --git a/typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGeneratorResolver.php b/typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGeneratorResolver.php index 975a2093cf7b27b12e0fecbca40313d3681a7625..5ddaed69ecf0c9601ffb3feff2e8bff201845651 100644 --- a/typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGeneratorResolver.php +++ b/typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGeneratorResolver.php @@ -82,7 +82,7 @@ final class FieldGeneratorResolver FieldGenerator\TypeTextDefaultExtrasRichtext::class, FieldGenerator\TypeTextFormatDatetime::class, - FieldGenerator\TypeTextFormatT3editor::class, + FieldGenerator\TypeTextFormatCodeEditor::class, FieldGenerator\TypeTextMax30::class, FieldGenerator\TypeTextWizardSelect::class, FieldGenerator\TypeTextWizardTable::class, diff --git a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor.php b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor.php index 9b55dc406b77b2f3461b7d2d3f1ea4bbe0049941..17755a80a573e5a711a00d0643d0bdd09b442d25 100644 --- a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor.php +++ b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor.php @@ -79,7 +79,7 @@ return [ 'description' => 'field description', 'config' => [ 'type' => 'text', - 'renderType' => 't3editor', + 'renderType' => 'codeEditor', 'format' => 'html', 'rows' => 7, ], @@ -107,7 +107,7 @@ return [ 'description' => 'readOnly=true', 'config' => [ 'type' => 'text', - 'renderType' => 't3editor', + 'renderType' => 'codeEditor', 'format' => 'html', 'readOnly' => true, ], @@ -139,7 +139,7 @@ return [ <description>field description</description> <config> <type>text</type> - <renderType>t3editor</renderType> + <renderType>codeEditor</renderType> <format>html</format> </config> </t3editor_1> @@ -165,7 +165,7 @@ return [ <description>field description</description> <config> <type>text</type> - <renderType>t3editor</renderType> + <renderType>codeEditor</renderType> <format>html</format> </config> </t3editor_1> diff --git a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor_flex_1_inline_1_child.php b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor_flex_1_inline_1_child.php index 14e10cdb7245cc0586e0c577d6e666b43df32369..fa8a2360c48fcdaa7475da00dbb12353d835d487 100644 --- a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor_flex_1_inline_1_child.php +++ b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor_flex_1_inline_1_child.php @@ -84,7 +84,7 @@ return [ 'description' => 'field description', 'config' => [ 'type' => 'text', - 'renderType' => 't3editor', + 'renderType' => 'codeEditor', 'format' => 'html', ], ], diff --git a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor_inline_1_child.php b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor_inline_1_child.php index bdaa98440269d421418defe1bbaee72701ba67e2..d89bbb7b455324d4e845feb4733966614b754627 100644 --- a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor_inline_1_child.php +++ b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor_inline_1_child.php @@ -84,7 +84,7 @@ return [ 'description' => 'field description', 'config' => [ 'type' => 'text', - 'renderType' => 't3editor', + 'renderType' => 'codeEditor', 'format' => 'html', ], ], diff --git a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_1n_inline_2_child.php b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_1n_inline_2_child.php index 02cbce3572616443c7ddab6857fbc4104c5dc7ec..c54c94d2b529f753d7e1d7ae590d1603f227ee81 100644 --- a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_1n_inline_2_child.php +++ b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_1n_inline_2_child.php @@ -153,7 +153,7 @@ return [ 'label' => 't3editor_1', 'config' => [ 'type' => 'text', - 'renderType' => 't3editor', + 'renderType' => 'codeEditor', ], ], diff --git a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_expand_inline_1_child.php b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_expand_inline_1_child.php index 95a91111d177712f8a03c15199fd9834e85333f0..6aedec33146f1afa4fe1e2726aba8dd5937ebb9a 100644 --- a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_expand_inline_1_child.php +++ b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_expand_inline_1_child.php @@ -153,7 +153,7 @@ return [ 'label' => 't3editor_1', 'config' => [ 'type' => 'text', - 'renderType' => 't3editor', + 'renderType' => 'codeEditor', ], ], diff --git a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_l10nreadonly.php b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_l10nreadonly.php index 4ab2c727cfc7778b45558f4caed171797cbdde59..daad98edbbfa978dd9b075df8ea598819e6d644c 100644 --- a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_l10nreadonly.php +++ b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_l10nreadonly.php @@ -347,7 +347,7 @@ return [ 'l10n_display' => 'defaultAsReadonly', 'config' => [ 'type' => 'text', - 'renderType' => 't3editor', + 'renderType' => 'codeEditor', 'format' => 'html', 'rows' => 5, ], diff --git a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_type.php b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_type.php index bd5d49c382368f5bf96cc637fab7c802df09ac77..30884be410ec1dcbe914d73e001090086255d385 100644 --- a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_type.php +++ b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_type.php @@ -127,7 +127,7 @@ return [ ], 'text_1' => [ 'config' => [ - 'renderType' => 't3editor', + 'renderType' => 'codeEditor', 'format' => 'html', ], ], diff --git a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_typeforeign.php b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_typeforeign.php index a293cd7025a1fa486d24f8af1437e8148a5b43d5..e1491d5030db2a810f4dc6465574bfb6e38e164a 100644 --- a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_typeforeign.php +++ b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_typeforeign.php @@ -127,7 +127,7 @@ return [ ], 'text_1' => [ 'config' => [ - 'renderType' => 't3editor', + 'renderType' => 'codeEditor', 'format' => 'html', ], ], diff --git a/typo3/sysext/t3editor/.gitattributes b/typo3/sysext/t3editor/.gitattributes deleted file mode 100644 index 79ede152a8388ffb534b68d44b887ef6d9e759ab..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/.gitattributes export-ignore -/Tests/ export-ignore diff --git a/typo3/sysext/t3editor/Configuration/Backend/AjaxRoutes.php b/typo3/sysext/t3editor/Configuration/Backend/AjaxRoutes.php deleted file mode 100644 index b5315e7786ca4cf962d01df03b1ab275d8e153af..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Configuration/Backend/AjaxRoutes.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -/** - * Definitions for routes provided by EXT:t3editor - */ -return [ - // Get TSRef - 't3editor_tsref' => [ - 'path' => '/t3editor/tsref', - 'target' => \TYPO3\CMS\T3editor\Controller\TypoScriptReferenceController::class . '::loadReference', - ], - - // Load code completion templates - 't3editor_codecompletion_loadtemplates' => [ - 'path' => '/t3editor/codecompletion/load-templates', - 'target' => \TYPO3\CMS\T3editor\Controller\CodeCompletionController::class . '::loadCompletions', - ], -]; diff --git a/typo3/sysext/t3editor/Configuration/JavaScriptModules.php b/typo3/sysext/t3editor/Configuration/JavaScriptModules.php deleted file mode 100644 index 2ea4afd6712bfd2dbce913b657c5033b5265eede..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Configuration/JavaScriptModules.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -return [ - 'dependencies' => [ - 'backend', - ], - 'tags' => [ - 'backend.form', - ], - 'imports' => [ - '@typo3/t3editor/' => [ - 'path' => 'EXT:t3editor/Resources/Public/JavaScript/', - 'exclude' => [ - 'EXT:core/Resources/Public/JavaScript/Contrib/', - ], - ], - 'crelt' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/crelt.js', - 'style-mod' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/style-mod.js', - 'w3c-keyname' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/w3c-keyname.js', - '@lezer/common' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@lezer/common.js', - '@lezer/css' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@lezer/css.js', - '@lezer/html' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@lezer/html.js', - '@lezer/javascript' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@lezer/javascript.js', - '@lezer/json' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@lezer/json.js', - '@lezer/php' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@lezer/php.js', - '@lezer/xml' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@lezer/xml.js', - '@lezer/lr' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@lezer/lr.js', - '@lezer/highlight' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@lezer/highlight.js', - '@codemirror/autocomplete' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/autocomplete.js', - '@codemirror/closebrackets' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/closebrackets.js', - '@codemirror/commands' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/commands.js', - '@codemirror/comment' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/comment.js', - '@codemirror/fold' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/fold.js', - '@codemirror/gutter' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/gutter.js', - '@codemirror/highlight' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/highlight.js', - '@codemirror/history' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/history.js', - '@codemirror/language' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/language.js', - '@codemirror/lang-css' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-css.js', - '@codemirror/lang-html' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-html.js', - '@codemirror/lang-javascript' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-javascript.js', - '@codemirror/lang-json' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-json.js', - '@codemirror/lang-php' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-php.js', - '@codemirror/lang-sql' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-sql.js', - '@codemirror/lang-xml' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lang-xml.js', - '@codemirror/lint' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/lint.js', - '@codemirror/matchbrackets' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/matchbrackets.js', - '@codemirror/panel' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/panel.js', - '@codemirror/rangeset' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/rangeset.js', - '@codemirror/rectangular-selection' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/rectangular-selection.js', - '@codemirror/search' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/search.js', - '@codemirror/state' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/state.js', - '@codemirror/text' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/text.js', - '@codemirror/tooltip' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/tooltip.js', - '@codemirror/theme-one-dark' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/theme-one-dark.js', - '@codemirror/view' => 'EXT:t3editor/Resources/Public/JavaScript/Contrib/@codemirror/view.js', - ], -]; diff --git a/typo3/sysext/t3editor/Configuration/Services.yaml b/typo3/sysext/t3editor/Configuration/Services.yaml deleted file mode 100644 index f9134d1f523412945ef698b8feb1af53622c0285..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Configuration/Services.yaml +++ /dev/null @@ -1,8 +0,0 @@ -services: - _defaults: - autowire: true - autoconfigure: true - public: false - - TYPO3\CMS\T3editor\: - resource: '../Classes/*' diff --git a/typo3/sysext/t3editor/Configuration/TCA/Overrides/tt_content.php b/typo3/sysext/t3editor/Configuration/TCA/Overrides/tt_content.php deleted file mode 100644 index b3faba5ae8fd76d4eacb827254b92ba609ca7fb7..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Configuration/TCA/Overrides/tt_content.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -defined('TYPO3') or die(); - -// Activate t3editor for tt_content type HTML if this type exists -if (is_array($GLOBALS['TCA']['tt_content']['types']['html'])) { - if (!isset($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides'])) { - $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides'] = []; - } - if (!isset($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext'])) { - $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext'] = []; - } - if (!isset($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config'])) { - $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config'] = []; - } - $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config']['renderType'] = 't3editor'; - $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config']['wrap'] = 'off'; - $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config']['format'] = 'html'; -} diff --git a/typo3/sysext/t3editor/Documentation/CodeSnippets/Automatic/T3editor1.rst.txt b/typo3/sysext/t3editor/Documentation/CodeSnippets/Automatic/T3editor1.rst.txt deleted file mode 100644 index a0c871ee47ef335ca137c23228c1f7560eba59fb..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/CodeSnippets/Automatic/T3editor1.rst.txt +++ /dev/null @@ -1,23 +0,0 @@ -.. ==================================== -.. Automatically generated code snippet -.. ==================================== -.. -.. Extracted from typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_t3editor.php - - -.. code-block:: php - :caption: :file:`Configuration/TCA/tx_styleguide_elements_t3editor.php` - - 'columns' => [ - 't3editor_1' => [ - 'exclude' => true, - 'label' => 't3editor_1 format=html, rows=7', - 'description' => 'field description', - 'config' => [ - 'type' => 'text', - 'renderType' => 't3editor', - 'format' => 'html', - 'rows' => 7, - ], - ], - ] diff --git a/typo3/sysext/t3editor/Documentation/Developer/Extend.rst b/typo3/sysext/t3editor/Documentation/Developer/Extend.rst deleted file mode 100644 index 7947c12089bc056d5f9eff4e17718df0edc633a2..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/Developer/Extend.rst +++ /dev/null @@ -1,137 +0,0 @@ -.. include:: /Includes.rst.txt - -=============== -Extend T3editor -=============== - -Custom modes (used for syntax highlighting) and addons can be registered. - -CodeMirror delivers a lot more modes and addons than registered in T3editor -by default. - -More supported addons and modes are available at: - -* https://github.com/codemirror/CodeMirror/tree/5.27.4/addon -* https://github.com/codemirror/CodeMirror/tree/5.27.4/mode - -Prerequisites -============= - -To do this, extensions may have these two files to feed T3editor: - -* :file:`Configuration/Backend/T3editor/Addons.php` -* :file:`Configuration/Backend/T3editor/Modes.php` - -Both files return an array, as known as in TCA and Backend Routes, for example. - -.. _register_addon: - -Register an addon -================= - -To register an addon, the following code may be used: - -.. code-block:: php - :caption: :file:`EXT:myext/Configuration/Backend/T3editor/Addons.php` - - <?php - - return [ - 'my/addon' => [ - 'module' => JavaScriptModuleInstruction::create('@codemirror/addon', 'addon')->invoke() - 'cssFiles' => [ - 'EXT:my_extension/Resources/Public/Css/MyAddon.css', - ], - 'options' [ - 'foobar' => 'baz', - ], - 'modes' => ['htmlmixed', 'xml'], - ], - ]; - -.. confval:: <identifier> - - :type: string - :Required: true - - Represents the unique identifier of the module (`my/addon` in this example). - -.. confval:: module - - :type: string - :Required: true - - Holds the JavaScriptModuleInstruction of the CodeMirror module. - -.. confval:: cssFiles - - :type: array - - Holds all CSS files that must be loaded for the module. - -.. confval:: options - - :type: array - - Options that are used by the addon. - -.. confval:: modes - - :type: array - - If set the addon is only loaded if any of the modes supplied here is used. - - -.. _register_mode: - -Register a mode -=============== - -To register a mode, the following code may be used: - -.. code-block:: php - :caption: :file:`EXT:myext/Configuration/Backend/T3editor/Modes.php` - - <?php - - return [ - 'css' => [ - 'module' => 'cm/mode/css/css', - 'extensions' => ['css'], - ], - ]; - - -.. confval:: <identifier> - - :type: string - :Required: true - - Represents the unique identifier and format code of the mode - (`css` in this example). The format code is used in TCA to - define the CodeMirror mode to be used. - - Example:: - - $GLOBALS['TCA']['tt_content']['types']['css']['columnsOverrides']['bodytext']['config']['format'] = 'css'; - -.. confval:: module - - :type: string - :Required: true - - Holds the JavaScriptModuleInstruction of the CodeMirror module. - -.. confval:: extensions - - :type: array - - Binds the mode to specific file extensions. This is important for using - T3editor in the module :guilabel:`Filelist`. - -.. confval:: default - - :type: bool - - If set, the mode is used as fallback if no sufficient mode is available. - By factory default, the default mode is `html`. diff --git a/typo3/sysext/t3editor/Documentation/Developer/Index.rst b/typo3/sysext/t3editor/Documentation/Developer/Index.rst deleted file mode 100644 index cef64cdc332b3d98bede2d51ac9ecc4b36bf290c..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/Developer/Index.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. include:: /Includes.rst.txt -.. highlight:: php - -.. _developer: - -================ -Developer corner -================ - -.. toctree:: - :titlesonly: - - TCA - Extend diff --git a/typo3/sysext/t3editor/Documentation/Developer/TCA.rst b/typo3/sysext/t3editor/Documentation/Developer/TCA.rst deleted file mode 100644 index 4ea8948feeef30f2fffa5e738b16caeba5014794..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/Developer/TCA.rst +++ /dev/null @@ -1,37 +0,0 @@ -.. include:: /Includes.rst.txt - -.. _tca: -.. _renderType: - -=================== -Use t3editor in TCA -=================== - -Extensions may configure backend fields to use the t3editor by TCA. The editor -is only available for fields of type `text`. By setting the -:ref:`renderType to t3editor <t3tca:columns-text-renderType-t3editor>` the -syntax highlighting can be activated. - -By setting the property :ref:`format <t3tca:columns-text-properties-format>` -the mode for syntax highlighting can be chosen. Allowed values: -`css`, `html`, `javascript`, `php`, `typoscript`, `xml` and any -:ref:`custom mode <register_mode>` registered by an extension. - -.. versionadded:: 11.3 - TCA fields of renderType :php:`t3editor` support the - :php:`'readOnly' => true` option. If set, syntax highlighting - is applied as usual, but the corresponding text can not be edited. - - -.. _tca_examples: - -Examples -======== - -.. include:: /CodeSnippets/Automatic/T3editor1.rst.txt - -Displays an edior like the following: - -.. include:: /Images/AutomaticScreenshots/T3editor1.rst.txt - - diff --git a/typo3/sysext/t3editor/Documentation/Images/AutomaticScreenshots/T3editor1.png b/typo3/sysext/t3editor/Documentation/Images/AutomaticScreenshots/T3editor1.png deleted file mode 100644 index 72a317d07e7cf5a0cb7fcca42eb831cb987fac5e..0000000000000000000000000000000000000000 Binary files a/typo3/sysext/t3editor/Documentation/Images/AutomaticScreenshots/T3editor1.png and /dev/null differ diff --git a/typo3/sysext/t3editor/Documentation/Images/AutomaticScreenshots/T3editor1.rst.txt b/typo3/sysext/t3editor/Documentation/Images/AutomaticScreenshots/T3editor1.rst.txt deleted file mode 100644 index ec43cb55f45cdd8b76ebc7465588078d901394f6..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/Images/AutomaticScreenshots/T3editor1.rst.txt +++ /dev/null @@ -1,9 +0,0 @@ -.. ========================================== -.. Automatically generated screenshot include -.. ========================================== -.. - -.. figure:: /Images/AutomaticScreenshots/T3editor1.png - :class: with-shadow - - A t3editor with syntax highlighting for HTML and 7 rows. \ No newline at end of file diff --git a/typo3/sysext/t3editor/Documentation/Includes.rst.txt b/typo3/sysext/t3editor/Documentation/Includes.rst.txt deleted file mode 100644 index 469841d32a762123eb6506894a36d73da8f8e3db..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/Includes.rst.txt +++ /dev/null @@ -1,34 +0,0 @@ -.. More information about this file: - https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/GeneralConventions/FileStructure.html#includes-rst-txt - -.. ---------- -.. text roles -.. ---------- - -.. role:: aspect(emphasis) -.. role:: bash(code) -.. role:: html(code) -.. role:: js(code) -.. role:: php(code) -.. role:: rst(code) -.. role:: sep(strong) -.. role:: sql(code) - -.. role:: tsconfig(code) - :class: typoscript - -.. role:: typoscript(code) -.. role:: xml(code) - :class: html - -.. role:: yaml(code) - -.. default-role:: code - -.. --------- -.. highlight -.. --------- - -.. By default, code blocks use PHP syntax highlighting - -.. highlight:: php diff --git a/typo3/sysext/t3editor/Documentation/Index.rst b/typo3/sysext/t3editor/Documentation/Index.rst deleted file mode 100644 index 00931e5f3ee34104322123df1fa83b97b43b58ef..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/Index.rst +++ /dev/null @@ -1,54 +0,0 @@ -.. include:: /Includes.rst.txt - -============== -TYPO3 T3Editor -============== - -:Extension key: - t3editor - -:Package name: - typo3/cms-t3editor - -:Version: - |release| - -:Language: - en - -:Author: - TYPO3 contributors - -:License: - This document is published under the - `Open Content License <https://www.openhub.net/licenses/opl>`__. - -:Rendered: - |today| - ----- - -This extension provides a JavaScript-driven editor with syntax highlighting and -code completion, based on the `CodeMirror`_ editor. - -.. _CodeMirror: https://codemirror.net/ - ----- - -**Table of Contents:** - -.. toctree:: - :maxdepth: 2 - :titlesonly: - - Introduction/Index - Installation/Index - Developer/Index - -.. Meta Menu - -.. toctree:: - :hidden: - - Sitemap - genindex diff --git a/typo3/sysext/t3editor/Documentation/Installation/Index.rst b/typo3/sysext/t3editor/Documentation/Installation/Index.rst deleted file mode 100644 index c23924909742572416af09f54215dfeb98cf9b94..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/Installation/Index.rst +++ /dev/null @@ -1,59 +0,0 @@ -.. include:: /Includes.rst.txt - -.. _installation: - -============ -Installation -============ - -.. _installation_composer: - -With Composer -============= - -If your TYPO3 installation is using Composer, install the t3editor -extension by: - -.. code-block:: bash - - composer require typo3/cms-t3editor - -If you are using Composer and not working with the latest version of TYPO3 -you will need to add a version constraint: - -.. code-block:: bash - - composer require typo3/cms-t3editor:"^10.4" - -Installing the extension prior to version 11.4 ----------------------------------------------- - -Before TYPO3 11.4 it was still necessary to manually activate extensions -installed via Composer using the Extension Manager. - -If you are using TYPO3 with Composer and are using a version of TYPO3 that is -lower than 11.4, you will need to activate the extension: - -- Access :guilabel:`Admin Tools > Extension Manager > Installed Extensions` -- Search for `t3editor` -- Activate the extension by selecting the :guilabel:`Activate` button in the - column labeled :guilabel:`A/D` - -.. _installation_legacy: - -Without Composer -================ - -If you are working with an installation of TYPO3 that doesn't use Composer, this -extension will already be part of the installation due to the fact that -legacy `.tar` & `.zip` packages come bundled with all system extensions. - -However, whilst the extension is already downloaded, it is likely that the -extension is not activated. - -To activate the t3editor, navigate to -:guilabel:`Admin Tools > Extension Manager > Installed Extensions` and -search for "t3editor". If the extension is not active, activate it by selecting -the :guilabel:`Activate` button in the column labeled :guilabel:`A/D`. - -System Maintainer rights are required to activate the extension. diff --git a/typo3/sysext/t3editor/Documentation/Introduction/Index.rst b/typo3/sysext/t3editor/Documentation/Introduction/Index.rst deleted file mode 100644 index bff8e543dc14aee53aed5c2f09f0da80d8d88950..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/Introduction/Index.rst +++ /dev/null @@ -1,27 +0,0 @@ -.. include:: /Includes.rst.txt - -.. _introduction: - -============ -Introduction -============ - -.. _what-it-does: - -What does it do? -================ - -This system extension provides a backend editor with syntax highlighting. -The editor is used for TCA fields with type `text` and renderType `t3editor` -and in the module :guilabel:`Filelist`. - -.. _screenshots: - -Screenshots -=========== - -.. include:: /Images/AutomaticScreenshots/T3editor1.rst.txt - -Configured by the following TCA: - -.. include:: /CodeSnippets/Automatic/T3editor1.rst.txt diff --git a/typo3/sysext/t3editor/Documentation/Settings.cfg b/typo3/sysext/t3editor/Documentation/Settings.cfg deleted file mode 100644 index e5f17c6adb607399ffcd49c4e91932cb0e4795a7..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/Settings.cfg +++ /dev/null @@ -1,66 +0,0 @@ -# More information about this file: -# https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/GeneralConventions/FileStructure.html#settings-cfg - -[general] - -project = T3Editor -version = main (development) -release = main (development) -copyright = since 2007 by the TYPO3 contributors - -[html_theme_options] - -# "Edit on GitHub" button -github_repository = typo3/typo3 -github_branch = main -path_to_documentation_dir = typo3/sysext/t3editor/Documentation/ - -# Footer links -project_home = https://extensions.typo3.org/extension/t3editor/ -project_contact = https://typo3.slack.com/archives/C025BQLFA -project_repository = https://github.com/typo3/typo3 -project_issues = https://forge.typo3.org/projects/typo3cms-core/issues -project_discussions = - -use_opensearch = - -[intersphinx_mapping] - -# Official TYPO3 manuals -# h2document = https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/ -# t3content = https://docs.typo3.org/m/typo3/guide-contentandmarketing/main/en-us/ -# t3contribute = https://docs.typo3.org/m/typo3/guide-contributionworkflow/main/en-us/ -# t3coreapi = https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ -# t3editors = https://docs.typo3.org/m/typo3/tutorial-editors/main/en-us/ -# t3extexample = https://docs.typo3.org/m/typo3/guide-example-extension-manual/main/en-us/ -# t3home = https://docs.typo3.org/ -# t3sitepackage = https://docs.typo3.org/m/typo3/tutorial-sitepackage/main/en-us/ -# t3start = https://docs.typo3.org/m/typo3/tutorial-getting-started/main/en-us/ -t3tca = https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ -# t3translate = https://docs.typo3.org/m/typo3/guide-frontendlocalization/main/en-us/ -# t3tsconfig = https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/ -# t3tsref = https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/ -# t3ts45 = https://docs.typo3.org/m/typo3/tutorial-typoscript-in-45-minutes/main/en-us/ -# t3viewhelper = https://docs.typo3.org/other/typo3/view-helper-reference/main/en-us/ -# t3upgrade = https://docs.typo3.org/m/typo3/guide-installation/main/en-us/ - -# TYPO3 system extensions -# ext_adminpanel = https://docs.typo3.org/c/typo3/cms-adminpanel/main/en-us/ -# ext_core = https://docs.typo3.org/c/typo3/cms-core/main/en-us/ -# ext_dashboard = https://docs.typo3.org/c/typo3/cms-dashboard/main/en-us/ -# ext_felogin = https://docs.typo3.org/c/typo3/cms-felogin/main/en-us/ -# ext_form = https://docs.typo3.org/c/typo3/cms-form/main/en-us/ -# ext_fsc = https://docs.typo3.org/c/typo3/cms-fluid-styled-content/main/en-us/ -# ext_impexp = https://docs.typo3.org/c/typo3/cms-impexp/main/en-us/ -# ext_indexed_search = https://docs.typo3.org/c/typo3/cms-indexed-search/main/en-us/ -# ext_linkvalidator = https://docs.typo3.org/c/typo3/cms-linkvalidator/main/en-us/ -# ext_lowlevel = https://docs.typo3.org/c/typo3/cms-lowlevel/main/en-us/ -# ext_reactions = https://docs.typo3.org/c/typo3/cms-reactions/main/en-us/ -# ext_recycler = https://docs.typo3.org/c/typo3/cms-recycler/main/en-us/ -# ext_redirects = https://docs.typo3.org/c/typo3/cms-redirects/main/en-us/ -# ext_reports = https://docs.typo3.org/c/typo3/cms-reports/main/en-us/ -# ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ -# ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ -# ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ -# ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/ diff --git a/typo3/sysext/t3editor/Documentation/Sitemap.rst b/typo3/sysext/t3editor/Documentation/Sitemap.rst deleted file mode 100644 index 09d3c6f56e97422d5e402797988ad9ab0b994777..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/Sitemap.rst +++ /dev/null @@ -1,9 +0,0 @@ -:template: sitemap.html - -.. include:: /Includes.rst.txt - -======= -Sitemap -======= - -.. The sitemap.html template will insert here the page tree automatically. diff --git a/typo3/sysext/t3editor/Documentation/genindex.rst b/typo3/sysext/t3editor/Documentation/genindex.rst deleted file mode 100644 index 806ec56a77c4fd96f61bccba17e471c1d273b5cc..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/genindex.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. include:: /Includes.rst.txt - -===== -Index -===== - -.. Sphinx will insert here the general index automatically. diff --git a/typo3/sysext/t3editor/Documentation/screenshots.json b/typo3/sysext/t3editor/Documentation/screenshots.json deleted file mode 100644 index 6c2b5126032466b3f98930a1907fb490c8db5413..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Documentation/screenshots.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "suites": { - "Styleguide": { - "screenshots": { - "options": [ - { - "action": "setCodeSnippetsTargetPath", - "path": "CodeSnippets/Automatic" - }, - {"action": "setScreenshotsImagePath","path": "Images/AutomaticScreenshots"}, - {"action": "setScreenshotsRstPath","path": "Images/AutomaticScreenshots"} - ], - "t3editor": [ - { - "action": "resizeWindow", - "width": 640, - "height": 640 - }, - { - "action": "setCodeSnippetsSourcePath", - "path": "typo3/sysext/styleguide" - }, - { - "action": "makeScreenshotOfField", - "fields": "t3editor_1", - "fileName": "T3editor1", - "table": "tx_styleguide_elements_t3editor", - "captionText": "A t3editor with syntax highlighting for HTML and 7 rows.", - "uid": { - "action": "getUidByField", - "table": "tx_styleguide_elements_t3editor", - "field": "sys_language_uid", - "value": 0 - } - }, - { - "action": "createPhpArrayCodeSnippet", - "sourceFile": "Configuration/TCA/tx_styleguide_elements_t3editor.php", - "caption": ":file:`Configuration/TCA/tx_styleguide_elements_t3editor.php`", - "fields": [ - "columns/t3editor_1" - ], - "targetFileName": "T3editor1" - } - ] - } - } - } -} diff --git a/typo3/sysext/t3editor/LICENSE.txt b/typo3/sysext/t3editor/LICENSE.txt deleted file mode 100644 index d159169d1050894d3ea3b98e1c965c4058208fe1..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/typo3/sysext/t3editor/README.rst b/typo3/sysext/t3editor/README.rst deleted file mode 100644 index be9910d45ca365449422702d8e65307498929d39..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/README.rst +++ /dev/null @@ -1,13 +0,0 @@ -============================ -TYPO3 extension ``t3editor`` -============================ - -This extension provides a JavaScript-driven editor with syntax highlighting and -code completion, based on the `CodeMirror`_ editor. - -.. _CodeMirror: https://codemirror.net/ - -:Repository: https://github.com/typo3/typo3 -:Issues: https://forge.typo3.org/ -:Read online: https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ -:TER: https://extensions.typo3.org/extension/t3editor/ diff --git a/typo3/sysext/t3editor/Resources/Private/Language/locallang.xlf b/typo3/sysext/t3editor/Resources/Private/Language/locallang.xlf deleted file mode 100644 index 56b1ae23a46ed2730942f2683b93a48aff67763b..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Resources/Private/Language/locallang.xlf +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> - <file source-language="en" datatype="plaintext" original="EXT:t3editor/Resources/Private/Language/locallang.xlf" date="2011-10-17T20:22:37Z" product-name="t3editor"> - <header/> - <body> - <trans-unit id="deactivate" resname="deactivate"> - <source>Deactivate t3editor</source> - </trans-unit> - <trans-unit id="template" resname="template"> - <source>Template</source> - </trans-unit> - <trans-unit id="file" resname="file"> - <source>File</source> - </trans-unit> - <trans-unit id="delimiter" resname="delimiter"> - <source></source> - </trans-unit> - <trans-unit id="constants" resname="constants"> - <source>Constants</source> - </trans-unit> - <trans-unit id="setup" resname="setup"> - <source>Setup</source> - </trans-unit> - <trans-unit id="unknownContentType" resname="unknownContentType"> - <source>Unknown content type</source> - </trans-unit> - <trans-unit id="pageIDInteger" resname="pageIDInteger"> - <source>Syntax error: Parameter pageID must be a valid integer.</source> - </trans-unit> - <trans-unit id="noPermission" resname="noPermission"> - <source>Access denied: No permission to template records.</source> - </trans-unit> - <trans-unit id="typeIDMissing" resname="typeIDMissing"> - <source>Syntax error: At least parameter typeID has to be supplied.</source> - </trans-unit> - <trans-unit id="js.label_lines" resname="js.label_lines"> - <source>lines</source> - </trans-unit> - <trans-unit id="js.label_documentModified" resname="js.label_documentModified"> - <source>document has been modified</source> - </trans-unit> - <trans-unit id="js.label_errorWhileSaving" resname="js.label_errorWhileSaving"> - <source>An error occurred while saving the data.</source> - </trans-unit> - </body> - </file> -</xliff> diff --git a/typo3/sysext/t3editor/Resources/Public/Icons/Extension.png b/typo3/sysext/t3editor/Resources/Public/Icons/Extension.png deleted file mode 100644 index 6d9d2eba87289ac9a13834a5ea2a46bcae30d995..0000000000000000000000000000000000000000 Binary files a/typo3/sysext/t3editor/Resources/Public/Icons/Extension.png and /dev/null differ diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/autocomplete/ts-code-completion.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/autocomplete/ts-code-completion.js deleted file mode 100644 index d32b4018abaab72afbc2d07e5b1ce796c3bcf472..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/autocomplete/ts-code-completion.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ -import AjaxRequest from"@typo3/core/ajax/ajax-request.js";import{TsRef}from"@typo3/t3editor/autocomplete/ts-ref.js";import{TsParser}from"@typo3/t3editor/autocomplete/ts-parser.js";import{CompletionResult}from"@typo3/t3editor/autocomplete/completion-result.js";export class TsCodeCompletion{constructor(e){this.extTsObjTree={},this.parser=null,this.proposals=null,this.compResult=null,this.tsRef=new TsRef,this.parser=new TsParser(this.tsRef,this.extTsObjTree),this.tsRef.loadTsrefAsync(),this.loadExtTemplatesAsync(e)}refreshCodeCompletion(e){const t=this.getFilter(e),s=this.parser.buildTsObjTree(e);this.compResult=new CompletionResult(this.tsRef,s),this.proposals=this.compResult.getFilteredProposals(t);const o=[];for(let e=0;e<this.proposals.length;e++)o[e]=this.proposals[e].word;return o}loadExtTemplatesAsync(e){if(Number.isNaN(e)||0===e)return null;new AjaxRequest(TYPO3.settings.ajaxUrls.t3editor_codecompletion_loadtemplates).withQueryArguments({pageId:e}).get().then((async e=>{this.extTsObjTree.c=await e.resolve(),this.resolveExtReferencesRec(this.extTsObjTree.c)}))}resolveExtReferencesRec(e){for(const t of Object.keys(e)){let s;if(e[t].v&&"<"===e[t].v[0]&&-1===e[t].v.indexOf(">")){const o=e[t].v.replace(/</,"").trim();-1===o.indexOf(" ")&&(s=this.getExtChildNode(o),null!==s&&(e[t]=s))}!s&&e[t].c&&this.resolveExtReferencesRec(e[t].c)}}getExtChildNode(e){let t=this.extTsObjTree;const s=e.split(".");for(let e=0;e<s.length;e++){const o=s[e];if(void 0===t.c||void 0===t.c[o])return null;t=t.c[o]}return t}getFilter(e){return e.completingAfterDot?"":e.token.string.replace(".","").replace(/\s/g,"")}} \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/autocomplete/ts-ref.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/autocomplete/ts-ref.js deleted file mode 100644 index ed706c121ea6bfbf4d1547ae0e8ccb083bef6261..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/autocomplete/ts-ref.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ -import AjaxRequest from"@typo3/core/ajax/ajax-request.js";export class TsRefType{constructor(e,t,s){this.properties={},this.typeId=e,this.extends=t,this.properties=s}}export class TsRefProperty{constructor(e,t,s){this.parentType=e,this.name=t,this.value=s}}export class TsRef{constructor(){this.typeTree={},this.doc=null}async loadTsrefAsync(){const e=await new AjaxRequest(TYPO3.settings.ajaxUrls.t3editor_tsref).get();this.doc=await e.resolve(),this.buildTree()}buildTree(){for(const e of Object.keys(this.doc)){const t=this.doc[e];this.typeTree[e]=new TsRefType(e,t.extends||void 0,Object.fromEntries(Object.entries(t.properties).map((([t,s])=>[t,new TsRefProperty(e,t,s.type)]))))}for(const e of Object.keys(this.typeTree))void 0!==this.typeTree[e].extends&&this.addPropertiesToType(this.typeTree[e],this.typeTree[e].extends,100)}addPropertiesToType(e,t,s){if(s<0)throw"Maximum recursion depth exceeded while trying to resolve the extends in the TSREF!";const r=t.split(",");for(let t=0;t<r.length;t++)if(void 0!==this.typeTree[r[t]]){void 0!==this.typeTree[r[t]].extends&&this.addPropertiesToType(this.typeTree[r[t]],this.typeTree[r[t]].extends,s-1);const i=this.typeTree[r[t]].properties;for(const t in i)void 0===e.properties[t]&&(e.properties[t]=i[t])}}getPropertiesFromTypeId(e){return void 0!==this.typeTree[e]?(this.typeTree[e].properties.clone=function(){const e={};for(const t of Object.keys(this))e[t]=new TsRefProperty(this[t].parentType,this[t].name,this[t].value);return e},this.typeTree[e].properties):{}}typeHasProperty(e,t){return void 0!==this.typeTree[e]&&void 0!==this.typeTree[e].properties[t]}getType(e){return this.typeTree[e]}isType(e){return void 0!==this.typeTree[e]}} \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/language/typoscript.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/language/typoscript.js deleted file mode 100644 index 46c8356ce913aac08ea1e05986623bd054622ca8..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/language/typoscript.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ -import DocumentService from"@typo3/core/document-service.js";import{StreamLanguage,LanguageSupport}from"@codemirror/language";import{TypoScriptStreamParserFactory}from"@typo3/t3editor/stream-parser/typoscript.js";import{TsCodeCompletion}from"@typo3/t3editor/autocomplete/ts-code-completion.js";import{syntaxTree}from"@codemirror/language";export function typoscript(){const t=StreamLanguage.define((new TypoScriptStreamParserFactory).create()),e=t.data.of({autocomplete:complete});return new LanguageSupport(t,[e])}const tsCodeCompletionInitializer=(async()=>{await DocumentService.ready();const t=parseInt(document.querySelector('input[name="effectivePid"]')?.value,10);return new TsCodeCompletion(t)})();export async function complete(t){if(!t.explicit)return null;const e=parseCodeMirror5CompatibleCompletionState(t),o=t.pos-(e.completingAfterDot?1:0),r=syntaxTree(t.state).resolveInner(o,-1),n="Document"===r.name||e.completingAfterDot?"":t.state.sliceDoc(r.from,o),s="Document"===r.name||e.completingAfterDot?t.pos:r.from;let a={start:r.from,end:o,string:n,type:r.name};/^[\w$_]*$/.test(n)||(a={start:t.pos,end:t.pos,string:"",type:"."===n?"property":null}),e.token=a;const i=(await tsCodeCompletionInitializer).refreshCodeCompletion(e);if(("string"===r.name||"comment"===r.name)&&tokenIsSubStringOfKeywords(n,i))return null;return{from:s,options:getCompletions(n,i).map((t=>({label:t,type:"keyword"})))}}function parseCodeMirror5CompatibleCompletionState(t){const e=t.state.sliceDoc().split(t.state.lineBreak).length,o=t.state.sliceDoc(0,t.pos).split(t.state.lineBreak).length,r=t.state.sliceDoc().split(t.state.lineBreak)[o-1],n="."===t.state.sliceDoc(t.pos-1,t.pos);return{lineTokens:extractCodemirror5StyleLineTokens(e,t),currentLineNumber:o,currentLine:r,lineCount:e,completingAfterDot:n}}function extractCodemirror5StyleLineTokens(t,e){const o=Array(t).fill("").map((()=>[]));let r=0,n=1;return syntaxTree(e.state).cursor().iterate((s=>{const a=s.type.name||s.name;if("Document"===a)return;const i=s.from,c=s.to;r<i&&e.state.sliceDoc(r,i).split(e.state.lineBreak).forEach((e=>{e&&(o[Math.min(n-1,t-1)].push({type:null,string:e,start:r,end:r+e.length}),n++,r+=e.length)}));const l=e.state.sliceDoc(s.from,s.to);n=e.state.sliceDoc(0,s.from).split(e.state.lineBreak).length,o[n-1].push({type:a,string:l,start:i,end:c}),r=c})),r<e.state.doc.length&&o[n-1].push({type:null,string:e.state.sliceDoc(r),start:r,end:e.state.doc.length}),o}function tokenIsSubStringOfKeywords(t,e){const o=t.length;for(let r=0;r<e.length;++r)if(t===e[r].substr(o))return!0;return!1}function getCompletions(t,e){const o=new Set;for(let n=0,s=e.length;n<s;++n)0!==(r=e[n]).lastIndexOf(t,0)||o.has(r)||o.add(r);var r;const n=Array.from(o);return n.sort(),n} \ No newline at end of file diff --git a/typo3/sysext/t3editor/composer.json b/typo3/sysext/t3editor/composer.json deleted file mode 100644 index a47050324d8d70caf907fec5d6aa4a59d5a93cce..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "typo3/cms-t3editor", - "type": "typo3-cms-framework", - "description": "TYPO3 CMS T3Editor - JavaScript-driven editor with syntax highlighting and code completion. Based on CodeMirror.", - "homepage": "https://typo3.org", - "license": ["GPL-2.0-or-later"], - "authors": [{ - "name": "TYPO3 Core Team", - "email": "typo3cms@typo3.org", - "role": "Developer" - }], - "support": { - "chat": "https://typo3.org/help", - "docs": "https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us", - "issues": "https://forge.typo3.org", - "source": "https://github.com/typo3/typo3" - }, - "config": { - "sort-packages": true - }, - "require": { - "ext-libxml": "*", - "typo3/cms-core": "13.0.*@dev" - }, - "conflict": { - "typo3/cms": "*" - }, - "extra": { - "branch-alias": { - "dev-main": "13.0.x-dev" - }, - "typo3/cms": { - "Package": { - "partOfFactoryDefault": true - }, - "extension-key": "t3editor" - } - }, - "autoload": { - "psr-4": { - "TYPO3\\CMS\\T3editor\\": "Classes/" - } - } -} diff --git a/typo3/sysext/t3editor/ext_emconf.php b/typo3/sysext/t3editor/ext_emconf.php deleted file mode 100644 index 0d6c7ec0134fb4a5e97df2aab23b36bd19da7c5c..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/ext_emconf.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -$EM_CONF[$_EXTKEY] = [ - 'title' => 'TYPO3 CMS T3Editor', - 'description' => 'JavaScript-driven editor with syntax highlighting and code completion. Based on CodeMirror.', - 'category' => 'be', - 'state' => 'stable', - 'author' => 'TYPO3 Core Team', - 'author_email' => 'typo3cms@typo3.org', - 'author_company' => '', - 'version' => '13.0.0', - 'constraints' => [ - 'depends' => [ - 'typo3' => '13.0.0', - ], - 'conflicts' => [], - 'suggests' => [], - ], -]; diff --git a/typo3/sysext/t3editor/ext_localconf.php b/typo3/sysext/t3editor/ext_localconf.php deleted file mode 100644 index 6fa08b2f897dcd2b5477ccfaf448faf8abc64462..0000000000000000000000000000000000000000 --- a/typo3/sysext/t3editor/ext_localconf.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -declare(strict_types=1); - -use TYPO3\CMS\T3editor\Form\Element\T3editorElement; - -defined('TYPO3') or die(); - -// Register backend FormEngine node -$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1433089350] = [ - 'nodeName' => 't3editor', - 'priority' => 40, - 'class' => T3editorElement::class, -]; diff --git a/typo3/sysext/tstemplate/Configuration/JavaScriptModules.php b/typo3/sysext/tstemplate/Configuration/JavaScriptModules.php index ef530bda2a53e09861ed60f00e26dfd7ec05080d..d823cd436766763f40622e117d440f4e0945620b 100644 --- a/typo3/sysext/tstemplate/Configuration/JavaScriptModules.php +++ b/typo3/sysext/tstemplate/Configuration/JavaScriptModules.php @@ -4,7 +4,6 @@ return [ 'dependencies' => [ 'backend', 'core', - 't3editor', ], 'tags' => [ 'backend.module', diff --git a/typo3/sysext/tstemplate/Resources/Public/JavaScript/template-analyzer.js b/typo3/sysext/tstemplate/Resources/Public/JavaScript/template-analyzer.js index 2befe3ae7e0dfdf9d803ab7a7b4b70f1f21d8bbc..f411a0ef9f253410ef12f9329d012bef3c626ab3 100644 --- a/typo3/sysext/tstemplate/Resources/Public/JavaScript/template-analyzer.js +++ b/typo3/sysext/tstemplate/Resources/Public/JavaScript/template-analyzer.js @@ -10,8 +10,8 @@ * * The TYPO3 project - inspiring people to share! */ -import DocumentService from"@typo3/core/document-service.js";import{default as Modal}from"@typo3/backend/modal.js";import{topLevelModuleImport}from"@typo3/backend/utility/top-level-module-import.js";import{html}from"lit";import{until}from"lit/directives/until.js";import AjaxRequest from"@typo3/core/ajax/ajax-request.js";class TemplateAnalyzer{constructor(){this.registerEventListeners()}async registerEventListeners(){await DocumentService.ready(),document.querySelectorAll(".t3js-typoscript-analyzer-modal").forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault();const o=Modal.types.default,r=e.dataset.modalTitle||e.textContent.trim(),a=e.getAttribute("href"),l=Modal.sizes.large,i=html`${until(this.fetchModalContent(a),html`<div class="modal-loading"><typo3-backend-spinner size="default"></typo3-backend-spinner></div>`)}`;Modal.advanced({type:o,title:r,size:l,content:i})}))}))}async fetchModalContent(e){topLevelModuleImport("@typo3/t3editor/element/code-mirror-element.js");const t=await new AjaxRequest(e).get(),o=await t.resolve();return html` - <typo3-t3editor-codemirror .mode="${{name:"@typo3/t3editor/language/typoscript.js",flags:2,exportName:"typoscript",items:[{type:"invoke",args:[]}]}}" nolazyload readonly class="flex-grow-1 mh-100"> +import DocumentService from"@typo3/core/document-service.js";import{default as Modal}from"@typo3/backend/modal.js";import{topLevelModuleImport}from"@typo3/backend/utility/top-level-module-import.js";import{html}from"lit";import{until}from"lit/directives/until.js";import AjaxRequest from"@typo3/core/ajax/ajax-request.js";class TemplateAnalyzer{constructor(){this.registerEventListeners()}async registerEventListeners(){await DocumentService.ready(),document.querySelectorAll(".t3js-typoscript-analyzer-modal").forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault();const o=Modal.types.default,r=e.dataset.modalTitle||e.textContent.trim(),a=e.getAttribute("href"),l=Modal.sizes.large,i=html`${until(this.fetchModalContent(a),html`<div class="modal-loading"><typo3-backend-spinner size="default"></typo3-backend-spinner></div>`)}`;Modal.advanced({type:o,title:r,size:l,content:i})}))}))}async fetchModalContent(e){topLevelModuleImport("@typo3/backend/code-editor/element/code-mirror-element.js");const t=await new AjaxRequest(e).get(),o=await t.resolve();return html` + <typo3-t3editor-codemirror .mode="${{name:"@typo3/backend/code-editor/language/typoscript.js",flags:2,exportName:"typoscript",items:[{type:"invoke",args:[]}]}}" nolazyload readonly class="flex-grow-1 mh-100"> <textarea readonly disabled class="form-control">${o}</textarea> </typo3-t3editor-codemirror> `}}export default new TemplateAnalyzer; \ No newline at end of file diff --git a/typo3/sysext/workspaces/Documentation/Settings.cfg b/typo3/sysext/workspaces/Documentation/Settings.cfg index 443f6cd0ae329dd8654bc69071b6f9e9668dcd0f..1765aa3c636a31e564eb59deb25a63ddbfdd1965 100644 --- a/typo3/sysext/workspaces/Documentation/Settings.cfg +++ b/typo3/sysext/workspaces/Documentation/Settings.cfg @@ -62,5 +62,4 @@ t3tsconfig = https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/ # ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ -# ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/ # ext_workspaces = https://docs.typo3.org/c/typo3/cms-workspaces/main/en-us/