@gedit/utils
Advanced tools
Comparing version 0.2.9 to 0.2.10
@@ -7,2 +7,6 @@ import { SchemaDecoration } from './schema'; | ||
export type RotationSchema = number; | ||
export interface Rotation3dSchema { | ||
x: number; | ||
y: number; | ||
} | ||
export interface OriginSchema { | ||
@@ -36,2 +40,4 @@ x: number; | ||
rotation: RotationSchema; | ||
rotation3D?: Rotation3dSchema; | ||
perspective?: number; | ||
} | ||
@@ -41,3 +47,5 @@ export declare const SizeSchemaDecoration: SchemaDecoration<SizeSchema>; | ||
export declare const PositionSchemaDecoration: SchemaDecoration<PositionSchema>; | ||
export declare const RotationSchemaDecoration: SchemaDecoration<RotationSchema>; | ||
export declare const RotationSchemaDecoration: SchemaDecoration<number>; | ||
export declare const Rotation3DSchemaDecoration: SchemaDecoration<Rotation3dSchema>; | ||
export declare const PerspectiveSchemaDecoration: SchemaDecoration<number>; | ||
export declare const ScaleSchemaDecoration: SchemaDecoration<ScaleSchema>; | ||
@@ -44,0 +52,0 @@ export declare const SkewSchemaDecoration: SchemaDecoration<SkewSchema>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SizeSchema = exports.TransformSchema = exports.TransformSchemaDecoration = exports.SkewSchemaDecoration = exports.ScaleSchemaDecoration = exports.RotationSchemaDecoration = exports.PositionSchemaDecoration = exports.OriginSchemaDecoration = exports.SizeSchemaDecoration = void 0; | ||
exports.SizeSchema = exports.TransformSchema = exports.TransformSchemaDecoration = exports.SkewSchemaDecoration = exports.ScaleSchemaDecoration = exports.PerspectiveSchemaDecoration = exports.Rotation3DSchemaDecoration = exports.RotationSchemaDecoration = exports.PositionSchemaDecoration = exports.OriginSchemaDecoration = exports.SizeSchemaDecoration = void 0; | ||
const schema_1 = require("./schema"); | ||
; | ||
exports.SizeSchemaDecoration = { | ||
@@ -38,2 +39,17 @@ label: '大小', | ||
}; | ||
// dom 使用 | ||
exports.Rotation3DSchemaDecoration = { | ||
label: '旋转', | ||
type: 'object', | ||
properties: { | ||
x: { label: 'x', default: 0, type: 'float' }, | ||
y: { label: 'y', default: 0, type: 'float' } | ||
}, | ||
}; | ||
// dom 使用 | ||
exports.PerspectiveSchemaDecoration = { | ||
label: '透视', | ||
type: 'float', | ||
default: 0, | ||
}; | ||
exports.ScaleSchemaDecoration = { | ||
@@ -63,2 +79,4 @@ label: '缩放', | ||
rotation: exports.RotationSchemaDecoration, | ||
rotation3D: exports.Rotation3DSchemaDecoration, | ||
perspective: exports.PerspectiveSchemaDecoration, | ||
}, | ||
@@ -87,2 +105,5 @@ type: 'object' | ||
rotation: obj.rotation, | ||
// TODO 进选择器 | ||
/* rotation3D: obj.rotation3D ? { x: obj.rotation3D.x, y: obj.rotation3D.y } : undefined, | ||
perspective: obj.perspective, */ | ||
}; | ||
@@ -115,2 +136,7 @@ } | ||
rotation: newTransform.rotation - oldTransform.rotation, | ||
/* rotation3D: newTransform.rotation3D && oldTransform.rotation3D ? { | ||
x: newTransform.rotation3D.x - oldTransform.rotation3D.x, | ||
y: newTransform.rotation3D.y - oldTransform.rotation3D.y, | ||
} : undefined, | ||
perspective: (newTransform.perspective || 0) - (oldTransform.perspective || 0), */ | ||
}; | ||
@@ -144,2 +170,7 @@ } | ||
rotation: newTransformDelta.rotation + oldTransform.rotation, | ||
/* rotation3D: newTransformDelta.rotation3D && oldTransform.rotation3D ? { | ||
x: toFixed(newTransformDelta.rotation3D.x + oldTransform.rotation3D.x), | ||
y: toFixed(newTransformDelta.rotation3D.y + oldTransform.rotation3D.y), | ||
} : undefined, | ||
perspective: (newTransformDelta.perspective || 0) + (oldTransform.perspective || 0), */ | ||
}; | ||
@@ -146,0 +177,0 @@ } |
{ | ||
"name": "@gedit/utils", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"license": "MIT", | ||
@@ -32,3 +32,3 @@ "main": "lib/common/index", | ||
}, | ||
"gitHead": "894a37415ef8662489f26ea84632001d05b87a73" | ||
"gitHead": "ae3505802ae3cfe1d1915d916400583dcf7f5ba1" | ||
} |
@@ -9,2 +9,6 @@ import { Schema, SchemaDecoration } from './schema'; | ||
export type RotationSchema = number; | ||
export interface Rotation3dSchema { | ||
x: number, | ||
y: number, | ||
}; | ||
@@ -43,2 +47,4 @@ export interface OriginSchema { | ||
rotation: RotationSchema, | ||
rotation3D?: Rotation3dSchema, | ||
perspective?: number, | ||
} | ||
@@ -77,3 +83,3 @@ | ||
export const RotationSchemaDecoration: SchemaDecoration<RotationSchema> = { | ||
export const RotationSchemaDecoration: SchemaDecoration<number> = { | ||
label: '旋转', | ||
@@ -84,2 +90,18 @@ type: 'float', | ||
// dom 使用 | ||
export const Rotation3DSchemaDecoration: SchemaDecoration<Rotation3dSchema> = { | ||
label: '旋转', | ||
type: 'object', | ||
properties: { | ||
x: {label: 'x', default: 0, type: 'float'}, | ||
y: {label: 'y', default: 0, type: 'float'} | ||
}, | ||
}; | ||
// dom 使用 | ||
export const PerspectiveSchemaDecoration: SchemaDecoration<number> = { | ||
label: '透视', | ||
type: 'float', | ||
default: 0, | ||
}; | ||
export const ScaleSchemaDecoration: SchemaDecoration<ScaleSchema> = { | ||
@@ -110,2 +132,4 @@ label: '缩放', | ||
rotation: RotationSchemaDecoration, | ||
rotation3D: Rotation3DSchemaDecoration, | ||
perspective: PerspectiveSchemaDecoration, | ||
}, | ||
@@ -134,2 +158,5 @@ type: 'object' | ||
rotation: obj.rotation, | ||
// TODO 进选择器 | ||
/* rotation3D: obj.rotation3D ? { x: obj.rotation3D.x, y: obj.rotation3D.y } : undefined, | ||
perspective: obj.perspective, */ | ||
}; | ||
@@ -164,2 +191,7 @@ } | ||
rotation: newTransform.rotation - oldTransform.rotation, | ||
/* rotation3D: newTransform.rotation3D && oldTransform.rotation3D ? { | ||
x: newTransform.rotation3D.x - oldTransform.rotation3D.x, | ||
y: newTransform.rotation3D.y - oldTransform.rotation3D.y, | ||
} : undefined, | ||
perspective: (newTransform.perspective || 0) - (oldTransform.perspective || 0), */ | ||
}; | ||
@@ -196,2 +228,7 @@ } | ||
rotation: newTransformDelta.rotation + oldTransform.rotation, | ||
/* rotation3D: newTransformDelta.rotation3D && oldTransform.rotation3D ? { | ||
x: toFixed(newTransformDelta.rotation3D.x + oldTransform.rotation3D.x), | ||
y: toFixed(newTransformDelta.rotation3D.y + oldTransform.rotation3D.y), | ||
} : undefined, | ||
perspective: (newTransformDelta.perspective || 0) + (oldTransform.perspective || 0), */ | ||
}; | ||
@@ -198,0 +235,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
507225
9617