diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-06 13:48:05 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-06 13:48:05 +0100 |
commit | a0b13ebcacfd74b9f521110c7225bb404325bcd3 (patch) | |
tree | a07c5cc422645e31d7dfef81ce4e54f03f0945f6 /src/svg.js | |
parent | 9f2696e8a2cf7e4eebc1cc7e31027fe2070094fa (diff) | |
download | svg.js-a0b13ebcacfd74b9f521110c7225bb404325bcd3.tar.gz svg.js-a0b13ebcacfd74b9f521110c7225bb404325bcd3.zip |
reordered modules, add es6 build
Diffstat (limited to 'src/svg.js')
-rw-r--r-- | src/svg.js | 101 |
1 files changed, 7 insertions, 94 deletions
@@ -1,101 +1,14 @@ -import * as Classes from './classes.js' -import * as adopter from './adopter.js' -import * as tools from './tools.js' -import './attr.js' -import './arrange.js' -import './data.js' -import './classHandling.js' -import find from './selector.js' -import './css.js' -import './transform.js' -import './memory.js' -import './sugar.js' -import { getMethodsFor } from './methods.js' -import { registerMorphableType, makeMorphable, TransformBag, ObjectBag, NonMorphable } from './Morphable.js' - -import './EventTarget.js' -import './Element.js' - -import * as utils from './utils.js' - -import * as regex from './regex.js' - -// satisfy tests, fix later -import * as ns from './namespaces.js' -import { easing } from './Controller.js' -import * as events from './event.js' -import parser from './parser.js' -import * as defaults from './defaults.js' -const extend = tools.extend - -extend([ - Classes.Doc, - Classes.Symbol, - Classes.Image, - Classes.Pattern, - Classes.Marker -], getMethodsFor('viewbox')) - -extend([ - Classes.Line, - Classes.Polyline, - Classes.Polygon, - Classes.Path -], getMethodsFor('marker')) - -extend(Classes.Text, getMethodsFor('Text')) -extend(Classes.Path, getMethodsFor('Path')) - -extend(Classes.Defs, getMethodsFor('Defs')) - -extend([ - Classes.Text, - Classes.Tspan -], getMethodsFor('Tspan')) - -extend([ - Classes.Rect, - Classes.Ellipse, - Classes.Circle, - Classes.Gradient -], getMethodsFor('radius')) - -extend(Classes.EventTarget, getMethodsFor('EventTarget')) -extend(Classes.Dom, getMethodsFor('Dom')) -extend(Classes.Element, getMethodsFor('Element')) -extend(Classes.Shape, getMethodsFor('Shape')) -// extend(Classes.Element, getConstructor('Memory')) -extend(Classes.Container, getMethodsFor('Container')) - -registerMorphableType([ - Classes.SVGNumber, - Classes.Color, - Classes.Box, - Classes.Matrix, - Classes.SVGArray, - Classes.PointArray, - Classes.PathArray -]) - -makeMorphable() +import * as svgMembers from './main.js' +import * as regex from './modules/core/regex.js' +import { makeInstance } from './utils/adopter' // The main wrapping element export default function SVG (element) { - return adopter.makeInstance(element) + return makeInstance(element) } -Object.assign(SVG, Classes) -Object.assign(SVG, tools) -Object.assign(SVG, adopter) -SVG.utils = utils +Object.assign(SVG, svgMembers) + +SVG.utils = SVG SVG.regex = regex SVG.get = SVG -SVG.find = find -Object.assign(SVG, ns) -SVG.easing = easing -Object.assign(SVG, events) -SVG.TransformBag = TransformBag -SVG.ObjectBag = ObjectBag -SVG.NonMorphable = NonMorphable -SVG.parser = parser -SVG.defaults = defaults |