michael-s-molina commented on code in PR #37499: URL: https://github.com/apache/superset/pull/37499#discussion_r2737518406
########## superset-frontend/packages/superset-core/src/api/editors.ts: ########## @@ -0,0 +1,381 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * @fileoverview Editors API for Superset extension editor contributions. + * + * This module defines the interfaces and types for editor contributions to the + * Superset platform. Extensions can register custom text editor implementations + * (e.g., Monaco, CodeMirror) through the extension manifest, replacing the + * default Ace editor for specific languages. + */ + +import { ForwardRefExoticComponent, RefAttributes } from 'react'; +import { EditorContribution, EditorLanguage } from './contributions'; +import { Disposable, Event } from './core'; +import type { SupersetTheme } from '../ui'; + +// Re-export contribution types for convenience +export type { EditorContribution, EditorLanguage }; + +/** + * Represents a position in the editor (line and column). + */ +export interface Position { + /** Zero-based line number */ + line: number; + /** Zero-based column number */ + column: number; +} + +/** + * Represents a range in the editor with start and end positions. + */ +export interface Range { + /** Start position of the range */ + start: Position; + /** End position of the range */ + end: Position; +} + +/** + * Represents a selection in the editor. + */ +export interface Selection extends Range { + /** Direction of the selection */ + direction?: 'ltr' | 'rtl'; Review Comment: 1. Selection direction (what's defined here): When selecting text by dragging right-to-left vs left-to-right, the selection has a direction. This is standard behavior that Ace and most editors already support natively - the anchor point vs active cursor position. 2. RTL language support: Full support for right-to-left languages (Arabic, Hebrew, etc.) with bidirectional text rendering, cursor movement, line ordering, etc. This would indeed require more extensive work. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
