move namespace to svgcanvas folder
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
|
||||
import * as coords from '../../../instrumented/svgcanvas/coords.js';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'pathseg';
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
import * as draw from '../../../instrumented/svgcanvas/draw.js';
|
||||
import * as units from '../../../instrumented/common/units.js';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
|
||||
import * as hstory from '../../../instrumented/svgcanvas/history.js';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
import * as math from '../../../instrumented/svgcanvas/math.js';
|
||||
|
||||
describe('math', function () {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* globals SVGPathSeg */
|
||||
import 'pathseg';
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
|
||||
import * as pathModule from '../../../instrumented/svgcanvas/path.js';
|
||||
import { Path, Segment } from '../../../instrumented/svgcanvas/path-method.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
|
||||
import * as coords from '../../../instrumented/svgcanvas/coords.js';
|
||||
import * as recalculate from '../../../instrumented/svgcanvas/recalculate.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
import * as sanitize from '../../../instrumented/svgcanvas/sanitize.js';
|
||||
|
||||
describe('sanitize', function () {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as select from '../../../instrumented/svgcanvas/select.js';
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
|
||||
describe('select', function () {
|
||||
const sandbox = document.createElement('div');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable max-len */
|
||||
import 'pathseg';
|
||||
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
|
||||
import * as math from '../../../instrumented/svgcanvas/math.js';
|
||||
import * as path from '../../../instrumented/svgcanvas/path.js';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable max-len, no-console */
|
||||
import 'pathseg';
|
||||
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
|
||||
import * as math from '../../../instrumented/svgcanvas/math.js';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable max-len */
|
||||
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
|
||||
import { NS } from '../../../instrumented/common/namespaces.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
|
||||
describe('utilities', function () {
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2010 Jeff Schiller, 2010 Alexis Deveria
|
||||
*/
|
||||
|
||||
import { NS } from './namespaces.js';
|
||||
const NSSVG = 'http://www.w3.org/2000/svg';
|
||||
|
||||
const { userAgent } = navigator;
|
||||
|
||||
@@ -19,12 +19,12 @@ const isTouch_ = 'ontouchstart' in window;
|
||||
|
||||
// text character positioning (for IE9 and now Chrome)
|
||||
const supportsGoodTextCharPos_ = (function () {
|
||||
const svgroot = document.createElementNS(NS.SVG, 'svg');
|
||||
const svgcontent = document.createElementNS(NS.SVG, 'svg');
|
||||
const svgroot = document.createElementNS(NSSVG, 'svg');
|
||||
const svgcontent = document.createElementNS(NSSVG, 'svg');
|
||||
document.documentElement.append(svgroot);
|
||||
svgcontent.setAttribute('x', 5);
|
||||
svgroot.append(svgcontent);
|
||||
const text = document.createElementNS(NS.SVG, 'text');
|
||||
const text = document.createElementNS(NSSVG, 'text');
|
||||
text.textContent = 'a';
|
||||
svgcontent.append(text);
|
||||
try { // Chrome now fails here
|
||||
@@ -39,13 +39,13 @@ const supportsGoodTextCharPos_ = (function () {
|
||||
|
||||
// Support for correct bbox sizing on groups with horizontal/vertical lines
|
||||
const supportsHVLineContainerBBox_ = (function () {
|
||||
const svgcontent = document.createElementNS(NS.SVG, 'svg');
|
||||
const svgcontent = document.createElementNS(NSSVG, 'svg');
|
||||
document.documentElement.append(svgcontent);
|
||||
const path = document.createElementNS(NS.SVG, 'path');
|
||||
const path = document.createElementNS(NSSVG, 'path');
|
||||
path.setAttribute('d', 'M0,0 10,0');
|
||||
const path2 = document.createElementNS(NS.SVG, 'path');
|
||||
const path2 = document.createElementNS(NSSVG, 'path');
|
||||
path2.setAttribute('d', 'M5,0 15,0');
|
||||
const g = document.createElementNS(NS.SVG, 'g');
|
||||
const g = document.createElementNS(NSSVG, 'g');
|
||||
g.append(path, path2);
|
||||
svgcontent.append(g);
|
||||
const bbox = g.getBBox();
|
||||
@@ -55,7 +55,7 @@ const supportsHVLineContainerBBox_ = (function () {
|
||||
}());
|
||||
|
||||
const supportsNonScalingStroke_ = (function () {
|
||||
const rect = document.createElementNS(NS.SVG, 'rect');
|
||||
const rect = document.createElementNS(NSSVG, 'rect');
|
||||
rect.setAttribute('style', 'vector-effect:non-scaling-stroke');
|
||||
return rect.style.vectorEffect === 'non-scaling-stroke';
|
||||
}());
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2010 Alexis Deveria, 2010 Jeff Schiller
|
||||
*/
|
||||
|
||||
import { NS } from './namespaces.js';
|
||||
const NSSVG = 'http://www.w3.org/2000/svg';
|
||||
|
||||
const wAttrs = [ 'x', 'x1', 'cx', 'rx', 'width' ];
|
||||
const hAttrs = [ 'y', 'y1', 'cy', 'ry', 'height' ];
|
||||
@@ -79,9 +79,9 @@ export const init = function (elementContainer) {
|
||||
elementContainer_ = elementContainer;
|
||||
|
||||
// Get correct em/ex values by creating a temporary SVG.
|
||||
const svg = document.createElementNS(NS.SVG, 'svg');
|
||||
const svg = document.createElementNS(NSSVG, 'svg');
|
||||
document.body.append(svg);
|
||||
const rect = document.createElementNS(NS.SVG, 'rect');
|
||||
const rect = document.createElementNS(NSSVG, 'rect');
|
||||
rect.setAttribute('width', '1em');
|
||||
rect.setAttribute('height', '1ex');
|
||||
rect.setAttribute('x', '1in');
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @license MIT
|
||||
* @copyright 2011 Jeff Schiller
|
||||
*/
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
|
||||
let clearContext_ = null;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Layer from './layer.js';
|
||||
import HistoryRecordingService from './historyrecording.js';
|
||||
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import {
|
||||
toXml, getElem
|
||||
} from './utilities.js';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { jGraduate } from '../editor/components/jgraduate/jQuery.jGraduate.js';
|
||||
import * as hstry from './history.js';
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import {
|
||||
getVisibleElements, getStrokedBBoxDefaultVisible, findDefs,
|
||||
walkTree, isNullish, getHref, setHref, getElem
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2010 Alexis Deveria, 2010 Jeff Schiller
|
||||
*/
|
||||
import { getElem, assignAttributes, cleanupElement } from './utilities.js';
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
|
||||
let jsonContext_ = null;
|
||||
let svgdoc_ = null;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2011 Jeff Schiller, 2016 Flint O'Brien
|
||||
*/
|
||||
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import { toXml, walkTree, isNullish } from './utilities.js';
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* @property {Float} y
|
||||
*/
|
||||
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
|
||||
// Constants
|
||||
const NEAR_ZERO = 1e-14;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2011 Alexis Deveria, 2011 Jeff Schiller
|
||||
*/
|
||||
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import { shortFloat } from '../common/units.js';
|
||||
import { ChangeElementCommand, BatchCommand } from './history.js';
|
||||
import {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2011 Alexis Deveria, 2011 Jeff Schiller
|
||||
*/
|
||||
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import { ChangeElementCommand } from './history.js';
|
||||
import {
|
||||
transformPoint, getMatrix
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import { convertToNum } from '../common/units.js';
|
||||
import { isWebkit } from '../common/browser.js';
|
||||
import { getRotationAngle, getHref, getBBox, getRefElem, isNullish } from './utilities.js';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2010 Alexis Deveria, 2010 Jeff Schiller
|
||||
*/
|
||||
|
||||
import { getReverseNS, NS } from '../common/namespaces.js';
|
||||
import { getReverseNS, NS } from './namespaces.js';
|
||||
import { isGecko } from '../common/browser.js';
|
||||
import { getHref, setHref, getUrlFromAttr } from './utilities.js';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2010 Alexis Deveria, 2010 Jeff Schiller
|
||||
*/
|
||||
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import * as hstry from './history.js';
|
||||
import * as pathModule from './path.js';
|
||||
import {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @copyright 2011 Jeff Schiller
|
||||
*/
|
||||
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import {
|
||||
isNullish, getBBox as utilsGetBBox, getStrokedBBoxDefaultVisible
|
||||
} from './utilities.js';
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
} from '../common/units.js';
|
||||
import { isGecko, isChrome, isWebkit } from '../common/browser.js';
|
||||
import * as pathModule from './path.js';
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import * as draw from './draw.js';
|
||||
import {
|
||||
recalculateDimensions
|
||||
|
||||
@@ -63,7 +63,7 @@ import {
|
||||
init as blurInit, setBlurNoUndo, setBlurOffsets, setBlur
|
||||
} from './blur-event.js';
|
||||
import { sanitizeSvg } from './sanitize.js';
|
||||
import { getReverseNS, NS } from '../common/namespaces.js';
|
||||
import { getReverseNS, NS } from './namespaces.js';
|
||||
import {
|
||||
text2xml, assignAttributes, cleanupElement, getElem, getUrlFromAttr,
|
||||
findDefs, getHref, setHref, getRefElem, getRotationAngle, getPathBBox,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* @copyright 2010 Alexis Deveria, 2010 Jeff Schiller
|
||||
*/
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import { text2xml } from './utilities.js';
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import {
|
||||
transformPoint, getMatrix
|
||||
} from './math.js';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2010 Alexis Deveria, 2010 Jeff Schiller
|
||||
*/
|
||||
|
||||
import { NS } from '../common/namespaces.js';
|
||||
import { NS } from './namespaces.js';
|
||||
import { setUnitAttr, getTypeMap } from '../common/units.js';
|
||||
import {
|
||||
hasMatrixTransform, transformListToTransform, transformBox
|
||||
|
||||
Reference in New Issue
Block a user