refactor: move components from /drawing/inline to /drawing

- they will be used for other positioning element (floating)
This commit is contained in:
Igor Bulovski
2018-06-08 07:50:23 +02:00
parent 548fe3c864
commit ac40a40ec0
42 changed files with 7 additions and 7 deletions

View File

@ -1,15 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IDocPropertiesAttributes {
id?: number;
name?: string;
descr?: string;
}
export class DocPropertiesAttributes extends XmlAttributeComponent<IDocPropertiesAttributes> {
protected xmlKeys = {
id: "id",
name: "name",
descr: "descr",
};
}

View File

@ -1,16 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { DocPropertiesAttributes } from "./doc-properties-attributes";
export class DocProperties extends XmlComponent {
constructor() {
super("wp:docPr");
this.root.push(
new DocPropertiesAttributes({
id: 0,
name: "",
descr: "",
}),
);
}
}

View File

@ -1,17 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IEffectExtentAttributes {
b?: number;
l?: number;
r?: number;
t?: number;
}
export class EffectExtentAttributes extends XmlAttributeComponent<IEffectExtentAttributes> {
protected xmlKeys = {
b: "b",
l: "l",
r: "r",
t: "t",
};
}

View File

@ -1,17 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { EffectExtentAttributes } from "./effect-extent-attributes";
export class EffectExtent extends XmlComponent {
constructor() {
super("wp:effectExtent");
this.root.push(
new EffectExtentAttributes({
b: 0,
l: 0,
r: 0,
t: 0,
}),
);
}
}

View File

@ -1,13 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IExtentAttributes {
cx?: number;
cy?: number;
}
export class ExtentAttributes extends XmlAttributeComponent<IExtentAttributes> {
protected xmlKeys = {
cx: "cx",
cy: "cy",
};
}

View File

@ -1,15 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { ExtentAttributes } from "./extent-attributes";
export class Extent extends XmlComponent {
constructor(x: number, y: number) {
super("wp:extent");
this.root.push(
new ExtentAttributes({
cx: x,
cy: y,
}),
);
}
}

View File

@ -1,13 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IGraphicFrameLockAttributes {
xmlns?: string;
noChangeAspect?: number;
}
export class GraphicFrameLockAttributes extends XmlAttributeComponent<IGraphicFrameLockAttributes> {
protected xmlKeys = {
xmlns: "xmlns:a",
noChangeAspect: "noChangeAspect",
};
}

View File

@ -1,15 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { GraphicFrameLockAttributes } from "./graphic-frame-lock-attributes";
export class GraphicFrameLocks extends XmlComponent {
constructor() {
super("a:graphicFrameLocks");
this.root.push(
new GraphicFrameLockAttributes({
xmlns: "http://schemas.openxmlformats.org/drawingml/2006/main",
noChangeAspect: 1,
}),
);
}
}

View File

@ -1,10 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { GraphicFrameLocks } from "./graphic-frame-locks/graphic-frame-locks";
export class GraphicFrameProperties extends XmlComponent {
constructor() {
super("wp:cNvGraphicFramePr");
this.root.push(new GraphicFrameLocks());
}
}

View File

@ -1,11 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IGraphicDataAttributes {
uri?: string;
}
export class GraphicDataAttributes extends XmlAttributeComponent<IGraphicDataAttributes> {
protected xmlKeys = {
uri: "uri",
};
}

View File

@ -1,17 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { GraphicDataAttributes } from "./graphic-data-attribute";
import { Pic } from "./pic";
export class GraphicData extends XmlComponent {
constructor(referenceId: number, x: number, y: number) {
super("a:graphicData");
this.root.push(
new GraphicDataAttributes({
uri: "http://schemas.openxmlformats.org/drawingml/2006/picture",
}),
);
this.root.push(new Pic(referenceId, x, y));
}
}

View File

@ -1 +0,0 @@
export * from "./graphic-data";

View File

@ -1,13 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { Blip } from "./blip";
import { SourceRectangle } from "./source-rectangle";
import { Stretch } from "./stretch";
export class BlipFill extends XmlComponent {
constructor(referenceId: number) {
super("pic:blipFill");
this.root.push(new Blip(referenceId));
this.root.push(new SourceRectangle());
this.root.push(new Stretch());
}
}

View File

@ -1,25 +0,0 @@
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
interface IBlipProperties {
embed: string;
cstate: string;
}
class BlipAttributes extends XmlAttributeComponent<IBlipProperties> {
protected xmlKeys = {
embed: "r:embed",
cstate: "cstate",
};
}
export class Blip extends XmlComponent {
constructor(referenceId: number) {
super("a:blip");
this.root.push(
new BlipAttributes({
embed: `rId${referenceId}`,
cstate: "none",
}),
);
}
}

View File

@ -1,7 +0,0 @@
import { XmlComponent } from "file/xml-components";
export class SourceRectangle extends XmlComponent {
constructor() {
super("a:srcRect");
}
}

View File

@ -1,14 +0,0 @@
import { XmlComponent } from "file/xml-components";
class FillRectangle extends XmlComponent {
constructor() {
super("a:fillRect");
}
}
export class Stretch extends XmlComponent {
constructor() {
super("a:stretch");
this.root.push(new FillRectangle());
}
}

View File

@ -1 +0,0 @@
export * from "./pic";

View File

@ -1,10 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { PicLocks } from "./pic-locks/pic-locks";
export class ChildNonVisualProperties extends XmlComponent {
constructor() {
super("pic:cNvPicPr");
this.root.push(new PicLocks());
}
}

View File

@ -1,13 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IPicLocksAttributes {
noChangeAspect?: number;
noChangeArrowheads?: number;
}
export class PicLocksAttributes extends XmlAttributeComponent<IPicLocksAttributes> {
protected xmlKeys = {
noChangeAspect: "noChangeAspect",
noChangeArrowheads: "noChangeArrowheads",
};
}

View File

@ -1,14 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { PicLocksAttributes } from "./pic-locks-attributes";
export class PicLocks extends XmlComponent {
constructor() {
super("a:picLocks");
this.root.push(
new PicLocksAttributes({
noChangeAspect: 1,
noChangeArrowheads: 1,
}),
);
}
}

View File

@ -1,12 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { ChildNonVisualProperties } from "./child-non-visual-pic-properties/child-non-visual-pic-properties";
import { NonVisualProperties } from "./non-visual-properties/non-visual-properties";
export class NonVisualPicProperties extends XmlComponent {
constructor() {
super("pic:nvPicPr");
this.root.push(new NonVisualProperties());
this.root.push(new ChildNonVisualProperties());
}
}

View File

@ -1,15 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface INonVisualPropertiesAttributes {
id?: number;
name?: string;
descr?: string;
}
export class NonVisualPropertiesAttributes extends XmlAttributeComponent<INonVisualPropertiesAttributes> {
protected xmlKeys = {
id: "id",
name: "name",
descr: "desc",
};
}

View File

@ -1,16 +0,0 @@
import { XmlComponent } from "file/xml-components";
import { NonVisualPropertiesAttributes } from "./non-visual-properties-attributes";
export class NonVisualProperties extends XmlComponent {
constructor() {
super("pic:cNvPr");
this.root.push(
new NonVisualPropertiesAttributes({
id: 0,
name: "",
descr: "",
}),
);
}
}

View File

@ -1,11 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IPicAttributes {
xmlns?: string;
}
export class PicAttributes extends XmlAttributeComponent<IPicAttributes> {
protected xmlKeys = {
xmlns: "xmlns:pic",
};
}

View File

@ -1,21 +0,0 @@
// http://officeopenxml.com/drwPic.php
import { XmlComponent } from "file/xml-components";
import { BlipFill } from "./blip/blip-fill";
import { NonVisualPicProperties } from "./non-visual-pic-properties/non-visual-pic-properties";
import { PicAttributes } from "./pic-attributes";
import { ShapeProperties } from "./shape-properties/shape-properties";
export class Pic extends XmlComponent {
constructor(referenceId: number, x: number, y: number) {
super("pic:pic");
this.root.push(
new PicAttributes({
xmlns: "http://schemas.openxmlformats.org/drawingml/2006/picture",
}),
);
this.root.push(new NonVisualPicProperties());
this.root.push(new BlipFill(referenceId));
this.root.push(new ShapeProperties(x, y));
}
}

View File

@ -1,13 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IExtentsAttributes {
cx?: number;
cy?: number;
}
export class ExtentsAttributes extends XmlAttributeComponent<IExtentsAttributes> {
protected xmlKeys = {
cx: "cx",
cy: "cy",
};
}

View File

@ -1,16 +0,0 @@
// http://officeopenxml.com/drwSp-size.php
import { XmlComponent } from "file/xml-components";
import { ExtentsAttributes } from "./extents-attributes";
export class Extents extends XmlComponent {
constructor(x: number, y: number) {
super("a:ext");
this.root.push(
new ExtentsAttributes({
cx: x,
cy: y,
}),
);
}
}

View File

@ -1,13 +0,0 @@
// http://officeopenxml.com/drwSp-size.php
import { XmlComponent } from "file/xml-components";
import { Extents } from "./extents/extents";
import { Offset } from "./offset/off";
export class Form extends XmlComponent {
constructor(x: number, y: number) {
super("a:xfrm");
this.root.push(new Extents(x, y));
this.root.push(new Offset());
}
}

View File

@ -1,13 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IOffsetAttributes {
x?: number;
y?: number;
}
export class OffsetAttributes extends XmlAttributeComponent<IOffsetAttributes> {
protected xmlKeys = {
x: "x",
y: "y",
};
}

View File

@ -1,16 +0,0 @@
// http://officeopenxml.com/drwSp-size.php
import { XmlComponent } from "file/xml-components";
import { OffsetAttributes } from "./off-attributes";
export class Offset extends XmlComponent {
constructor() {
super("a:off");
this.root.push(
new OffsetAttributes({
x: 0,
y: 0,
}),
);
}
}

View File

@ -1,7 +0,0 @@
import { XmlComponent } from "file/xml-components";
export class NoFill extends XmlComponent {
constructor() {
super("a:noFill");
}
}

View File

@ -1,7 +0,0 @@
import { XmlComponent } from "file/xml-components";
export class NoFill extends XmlComponent {
constructor() {
super("a:noFill");
}
}

View File

@ -1,11 +0,0 @@
// http://officeopenxml.com/drwSp-outline.php
import { XmlComponent } from "file/xml-components";
import { NoFill } from "./no-fill";
export class Outline extends XmlComponent {
constructor() {
super("a:ln");
this.root.push(new NoFill());
}
}

View File

@ -1,8 +0,0 @@
// http://officeopenxml.com/drwSp-prstGeom.php
import { XmlComponent } from "file/xml-components";
export class AdjustmentValues extends XmlComponent {
constructor() {
super("a:avLst");
}
}

View File

@ -1,11 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IPresetGeometryAttributes {
prst?: string;
}
export class PresetGeometryAttributes extends XmlAttributeComponent<IPresetGeometryAttributes> {
protected xmlKeys = {
prst: "prst",
};
}

View File

@ -1,18 +0,0 @@
// http://officeopenxml.com/drwSp-prstGeom.php
import { XmlComponent } from "file/xml-components";
import { AdjustmentValues } from "./adjustment-values/adjustment-values";
import { PresetGeometryAttributes } from "./preset-geometry-attributes";
export class PresetGeometry extends XmlComponent {
constructor() {
super("a:prstGeom");
this.root.push(
new PresetGeometryAttributes({
prst: "rect",
}),
);
this.root.push(new AdjustmentValues());
}
}

View File

@ -1,11 +0,0 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IShapePropertiesAttributes {
bwMode?: string;
}
export class ShapePropertiesAttributes extends XmlAttributeComponent<IShapePropertiesAttributes> {
protected xmlKeys = {
bwMode: "bwMode",
};
}

View File

@ -1,24 +0,0 @@
// http://officeopenxml.com/drwSp-SpPr.php
import { XmlComponent } from "file/xml-components";
import { Form } from "./form";
// import { NoFill } from "./no-fill";
// import { Outline } from "./outline/outline";
import { PresetGeometry } from "./preset-geometry/preset-geometry";
import { ShapePropertiesAttributes } from "./shape-properties-attributes";
export class ShapeProperties extends XmlComponent {
constructor(x: number, y: number) {
super("pic:spPr");
this.root.push(
new ShapePropertiesAttributes({
bwMode: "auto",
}),
);
this.root.push(new Form(x, y));
this.root.push(new PresetGeometry());
// this.root.push(new NoFill());
// this.root.push(new Outline());
}
}

View File

@ -1,24 +0,0 @@
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
import { GraphicData } from "./graphic-data";
interface IGraphicProperties {
a: string;
}
class GraphicAttributes extends XmlAttributeComponent<IGraphicProperties> {
protected xmlKeys = {
a: "xmlns:a",
};
}
export class Graphic extends XmlComponent {
constructor(referenceId: number, x: number, y: number) {
super("a:graphic");
this.root.push(
new GraphicAttributes({
a: "http://schemas.openxmlformats.org/drawingml/2006/main",
}),
);
this.root.push(new GraphicData(referenceId, x, y));
}
}

View File

@ -1,11 +1,11 @@
// http://officeopenxml.com/drwPicInline.php
import { IMediaDataDimensions } from "file/media";
import { XmlComponent } from "file/xml-components";
import { DocProperties } from "./doc-properties/doc-properties";
import { EffectExtent } from "./effect-extent/effect-extent";
import { Extent } from "./extent/extent";
import { Graphic } from "./graphic";
import { GraphicFrameProperties } from "./graphic-frame/graphic-frame-properties";
import { DocProperties } from "./../doc-properties/doc-properties";
import { EffectExtent } from "./../effect-extent/effect-extent";
import { Extent } from "./../extent/extent";
import { Graphic } from "./../graphic";
import { GraphicFrameProperties } from "./../graphic-frame/graphic-frame-properties";
import { InlineAttributes } from "./inline-attributes";
export class Inline extends XmlComponent {