|
| 1 | +/******************************************************************************** |
| 2 | + * Copyright (c) 2023 EclipseSource and others. |
| 3 | + * |
| 4 | + * This program and the accompanying materials are made available under the |
| 5 | + * terms of the Eclipse Public License v. 2.0 which is available at |
| 6 | + * http://www.eclipse.org/legal/epl-2.0. |
| 7 | + * |
| 8 | + * This Source Code may also be made available under the following Secondary |
| 9 | + * Licenses when the conditions for such availability set forth in the Eclipse |
| 10 | + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 |
| 11 | + * with the GNU Classpath Exception which is available at |
| 12 | + * https://www.gnu.org/software/classpath/license.html. |
| 13 | + * |
| 14 | + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 |
| 15 | + ********************************************************************************/ |
| 16 | + |
| 17 | +import { GShapePreRenderedElementBuilder, GShapedPreRenderedElement } from './gshaped-prerendered-element'; |
| 18 | + |
| 19 | +/** |
| 20 | + * A `foreignObject` element to be transferred to the DOM within the SVG. |
| 21 | + * |
| 22 | + * This can be useful to to benefit from e.g. HTML rendering features, such as line wrapping, inside of |
| 23 | + * the SVG diagram. Note that `foreignObject` is not supported by all browsers and SVG viewers may not |
| 24 | + * support rendering the `foreignObject` content. |
| 25 | + * |
| 26 | + * If no dimensions are specified in the schema element, this element will obtain the dimension of |
| 27 | + * its parent to fill the entire available room. Thus, this element requires specified bounds itself |
| 28 | + * or bounds to be available for its parent. |
| 29 | + */ |
| 30 | +export class GForeignObjectElement extends GShapedPreRenderedElement { |
| 31 | + static override builder(): GForeignObjectElementBuilder { |
| 32 | + return new GForeignObjectElementBuilder(GForeignObjectElement); |
| 33 | + } |
| 34 | + namespace: string; |
| 35 | +} |
| 36 | + |
| 37 | +export class GForeignObjectElementBuilder< |
| 38 | + G extends GForeignObjectElement = GForeignObjectElement |
| 39 | +> extends GShapePreRenderedElementBuilder<G> { |
| 40 | + namespace(namespace: string): this { |
| 41 | + this.proxy.namespace = namespace; |
| 42 | + return this; |
| 43 | + } |
| 44 | +} |
0 commit comments