var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Workspace } from '@blockeditor/store';
import { DEFAULT_ROUGHNESS } from '../consts.js';
import { ElementModel } from './base.js';
import {} from './common.js';
import {} from './common.js';
import { yfield } from './decorators.js';
export var ShapeTextFontSize;
(function (ShapeTextFontSize) {
    ShapeTextFontSize[ShapeTextFontSize["SMALL"] = 12] = "SMALL";
    ShapeTextFontSize[ShapeTextFontSize["MEDIUM"] = 20] = "MEDIUM";
    ShapeTextFontSize[ShapeTextFontSize["LARGE"] = 28] = "LARGE";
    ShapeTextFontSize[ShapeTextFontSize["XLARGE"] = 36] = "XLARGE";
})(ShapeTextFontSize || (ShapeTextFontSize = {}));
export class ShapeElementModel extends ElementModel {
    constructor() {
        super(...arguments);
        this.xywh = '[0,0,100,100]';
        this.rotate = 0;
        this.shapeType = 'rect';
        this.radius = 0;
        this.filled = false;
        this.fillColor = '--affine-palette-shape-yellow';
        this.strokeWidth = 4;
        this.strokeColor = '--affine-palette-line-yellow';
        this.strokeStyle = 'solid';
        this.shapeStyle = 'General';
        this.roughness = DEFAULT_ROUGHNESS;
    }
    static propsToY(props) {
        if (props.text && !(props.text instanceof Workspace.Y.Text)) {
            props.text = new Workspace.Y.Text(props.text);
        }
        return props;
    }
    get type() {
        return 'shape';
    }
}
__decorate([
    yfield()
], ShapeElementModel.prototype, "xywh", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "rotate", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "shapeType", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "radius", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "filled", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "fillColor", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "strokeWidth", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "strokeColor", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "strokeStyle", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "shapeStyle", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "roughness", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "text", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "color", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "fontSize", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "fontFamily", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "fontWeight", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "fontStyle", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "textAlign", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "textHorizontalAlign", void 0);
__decorate([
    yfield()
], ShapeElementModel.prototype, "textVerticalAlign", void 0);
//# sourceMappingURL=shape.js.map