- Revert prefer-named-capture-group due to apparently problematic Babel plugin
This commit is contained in:
173
dist/extensions/ext-arrows.js
vendored
173
dist/extensions/ext-arrows.js
vendored
@@ -1,170 +1,6 @@
|
||||
var svgEditorExtension_arrows = (function () {
|
||||
'use strict';
|
||||
|
||||
function _inherits(subClass, superClass) {
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
|
||||
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
||||
constructor: {
|
||||
value: subClass,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
if (superClass) _setPrototypeOf(subClass, superClass);
|
||||
}
|
||||
|
||||
function _getPrototypeOf(o) {
|
||||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
||||
return o.__proto__ || Object.getPrototypeOf(o);
|
||||
};
|
||||
return _getPrototypeOf(o);
|
||||
}
|
||||
|
||||
function _setPrototypeOf(o, p) {
|
||||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
||||
o.__proto__ = p;
|
||||
return o;
|
||||
};
|
||||
|
||||
return _setPrototypeOf(o, p);
|
||||
}
|
||||
|
||||
function isNativeReflectConstruct() {
|
||||
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
||||
if (Reflect.construct.sham) return false;
|
||||
if (typeof Proxy === "function") return true;
|
||||
|
||||
try {
|
||||
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function _construct(Parent, args, Class) {
|
||||
if (isNativeReflectConstruct()) {
|
||||
_construct = Reflect.construct;
|
||||
} else {
|
||||
_construct = function _construct(Parent, args, Class) {
|
||||
var a = [null];
|
||||
a.push.apply(a, args);
|
||||
var Constructor = Function.bind.apply(Parent, a);
|
||||
var instance = new Constructor();
|
||||
if (Class) _setPrototypeOf(instance, Class.prototype);
|
||||
return instance;
|
||||
};
|
||||
}
|
||||
|
||||
return _construct.apply(null, arguments);
|
||||
}
|
||||
|
||||
function _isNativeFunction(fn) {
|
||||
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
||||
}
|
||||
|
||||
function _wrapNativeSuper(Class) {
|
||||
var _cache = typeof Map === "function" ? new Map() : undefined;
|
||||
|
||||
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
||||
if (Class === null || !_isNativeFunction(Class)) return Class;
|
||||
|
||||
if (typeof Class !== "function") {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
|
||||
if (typeof _cache !== "undefined") {
|
||||
if (_cache.has(Class)) return _cache.get(Class);
|
||||
|
||||
_cache.set(Class, Wrapper);
|
||||
}
|
||||
|
||||
function Wrapper() {
|
||||
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
||||
}
|
||||
|
||||
Wrapper.prototype = Object.create(Class.prototype, {
|
||||
constructor: {
|
||||
value: Wrapper,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
return _setPrototypeOf(Wrapper, Class);
|
||||
};
|
||||
|
||||
return _wrapNativeSuper(Class);
|
||||
}
|
||||
|
||||
function _wrapRegExp(re, groups) {
|
||||
_wrapRegExp = function (re, groups) {
|
||||
return new BabelRegExp(re, undefined, groups);
|
||||
};
|
||||
|
||||
var _RegExp = _wrapNativeSuper(RegExp);
|
||||
|
||||
var _super = RegExp.prototype;
|
||||
|
||||
var _groups = new WeakMap();
|
||||
|
||||
function BabelRegExp(re, flags, groups) {
|
||||
var _this = _RegExp.call(this, re, flags);
|
||||
|
||||
_groups.set(_this, groups || _groups.get(re));
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_inherits(BabelRegExp, _RegExp);
|
||||
|
||||
BabelRegExp.prototype.exec = function (str) {
|
||||
var result = _super.exec.call(this, str);
|
||||
|
||||
if (result) result.groups = buildGroups(result, this);
|
||||
return result;
|
||||
};
|
||||
|
||||
BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
|
||||
if (typeof substitution === "string") {
|
||||
var groups = _groups.get(this);
|
||||
|
||||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
|
||||
return "$" + groups[name];
|
||||
}));
|
||||
} else if (typeof substitution === "function") {
|
||||
var _this = this;
|
||||
|
||||
return _super[Symbol.replace].call(this, str, function () {
|
||||
var args = [];
|
||||
args.push.apply(args, arguments);
|
||||
|
||||
if (typeof args[args.length - 1] !== "object") {
|
||||
args.push(buildGroups(args, _this));
|
||||
}
|
||||
|
||||
return substitution.apply(this, args);
|
||||
});
|
||||
} else {
|
||||
return _super[Symbol.replace].call(this, str, substitution);
|
||||
}
|
||||
};
|
||||
|
||||
function buildGroups(result, re) {
|
||||
var g = _groups.get(re);
|
||||
|
||||
return Object.keys(g).reduce(function (groups, name) {
|
||||
groups[name] = result[g[name]];
|
||||
return groups;
|
||||
}, Object.create(null));
|
||||
}
|
||||
|
||||
return _wrapRegExp.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-arrows.js
|
||||
*
|
||||
@@ -362,15 +198,14 @@ var svgEditorExtension_arrows = (function () {
|
||||
return null;
|
||||
}
|
||||
|
||||
var m = str.match(_wrapRegExp(/\(#(.+)\)/, {
|
||||
id: 1
|
||||
}));
|
||||
var m = str.match(/\(#(.*)\)/); // const m = str.match(/\(#(?<id>.+)\)/);
|
||||
// if (!m || !m.groups.id) {
|
||||
|
||||
if (!m || !m.groups.id) {
|
||||
if (!m || m.length !== 2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return svgCanvas.getElem(m.groups.id);
|
||||
return svgCanvas.getElem(m[1]); // return svgCanvas.getElem(m.groups.id);
|
||||
};
|
||||
|
||||
unsetArrowNonce = function _ref4(win) {
|
||||
|
||||
173
dist/extensions/ext-markers.js
vendored
173
dist/extensions/ext-markers.js
vendored
@@ -1,170 +1,6 @@
|
||||
var svgEditorExtension_markers = (function () {
|
||||
'use strict';
|
||||
|
||||
function _inherits(subClass, superClass) {
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
|
||||
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
||||
constructor: {
|
||||
value: subClass,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
if (superClass) _setPrototypeOf(subClass, superClass);
|
||||
}
|
||||
|
||||
function _getPrototypeOf(o) {
|
||||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
||||
return o.__proto__ || Object.getPrototypeOf(o);
|
||||
};
|
||||
return _getPrototypeOf(o);
|
||||
}
|
||||
|
||||
function _setPrototypeOf(o, p) {
|
||||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
||||
o.__proto__ = p;
|
||||
return o;
|
||||
};
|
||||
|
||||
return _setPrototypeOf(o, p);
|
||||
}
|
||||
|
||||
function isNativeReflectConstruct() {
|
||||
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
||||
if (Reflect.construct.sham) return false;
|
||||
if (typeof Proxy === "function") return true;
|
||||
|
||||
try {
|
||||
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function _construct(Parent, args, Class) {
|
||||
if (isNativeReflectConstruct()) {
|
||||
_construct = Reflect.construct;
|
||||
} else {
|
||||
_construct = function _construct(Parent, args, Class) {
|
||||
var a = [null];
|
||||
a.push.apply(a, args);
|
||||
var Constructor = Function.bind.apply(Parent, a);
|
||||
var instance = new Constructor();
|
||||
if (Class) _setPrototypeOf(instance, Class.prototype);
|
||||
return instance;
|
||||
};
|
||||
}
|
||||
|
||||
return _construct.apply(null, arguments);
|
||||
}
|
||||
|
||||
function _isNativeFunction(fn) {
|
||||
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
||||
}
|
||||
|
||||
function _wrapNativeSuper(Class) {
|
||||
var _cache = typeof Map === "function" ? new Map() : undefined;
|
||||
|
||||
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
||||
if (Class === null || !_isNativeFunction(Class)) return Class;
|
||||
|
||||
if (typeof Class !== "function") {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
|
||||
if (typeof _cache !== "undefined") {
|
||||
if (_cache.has(Class)) return _cache.get(Class);
|
||||
|
||||
_cache.set(Class, Wrapper);
|
||||
}
|
||||
|
||||
function Wrapper() {
|
||||
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
||||
}
|
||||
|
||||
Wrapper.prototype = Object.create(Class.prototype, {
|
||||
constructor: {
|
||||
value: Wrapper,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
return _setPrototypeOf(Wrapper, Class);
|
||||
};
|
||||
|
||||
return _wrapNativeSuper(Class);
|
||||
}
|
||||
|
||||
function _wrapRegExp(re, groups) {
|
||||
_wrapRegExp = function (re, groups) {
|
||||
return new BabelRegExp(re, undefined, groups);
|
||||
};
|
||||
|
||||
var _RegExp = _wrapNativeSuper(RegExp);
|
||||
|
||||
var _super = RegExp.prototype;
|
||||
|
||||
var _groups = new WeakMap();
|
||||
|
||||
function BabelRegExp(re, flags, groups) {
|
||||
var _this = _RegExp.call(this, re, flags);
|
||||
|
||||
_groups.set(_this, groups || _groups.get(re));
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_inherits(BabelRegExp, _RegExp);
|
||||
|
||||
BabelRegExp.prototype.exec = function (str) {
|
||||
var result = _super.exec.call(this, str);
|
||||
|
||||
if (result) result.groups = buildGroups(result, this);
|
||||
return result;
|
||||
};
|
||||
|
||||
BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
|
||||
if (typeof substitution === "string") {
|
||||
var groups = _groups.get(this);
|
||||
|
||||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
|
||||
return "$" + groups[name];
|
||||
}));
|
||||
} else if (typeof substitution === "function") {
|
||||
var _this = this;
|
||||
|
||||
return _super[Symbol.replace].call(this, str, function () {
|
||||
var args = [];
|
||||
args.push.apply(args, arguments);
|
||||
|
||||
if (typeof args[args.length - 1] !== "object") {
|
||||
args.push(buildGroups(args, _this));
|
||||
}
|
||||
|
||||
return substitution.apply(this, args);
|
||||
});
|
||||
} else {
|
||||
return _super[Symbol.replace].call(this, str, substitution);
|
||||
}
|
||||
};
|
||||
|
||||
function buildGroups(result, re) {
|
||||
var g = _groups.get(re);
|
||||
|
||||
return Object.keys(g).reduce(function (groups, name) {
|
||||
groups[name] = result[g[name]];
|
||||
return groups;
|
||||
}, Object.create(null));
|
||||
}
|
||||
|
||||
return _wrapRegExp.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-markers.js
|
||||
*
|
||||
@@ -641,15 +477,14 @@ var svgEditorExtension_markers = (function () {
|
||||
return null;
|
||||
}
|
||||
|
||||
var m = str.match(_wrapRegExp(/\(#(.+)\)/, {
|
||||
id: 1
|
||||
}));
|
||||
var m = str.match(/\(#(.*)\)/); // const m = str.match(/\(#(?<id>.+)\)/);
|
||||
// if (!m || !m.groups.id) {
|
||||
|
||||
if (!m || !m.groups.id) {
|
||||
if (!m || m.length !== 2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return svgCanvas.getElem(m.groups.id);
|
||||
return svgCanvas.getElem(m[1]); // return svgCanvas.getElem(m.groups.id);
|
||||
};
|
||||
|
||||
_context3.next = 15;
|
||||
|
||||
176
dist/extensions/ext-placemark.js
vendored
176
dist/extensions/ext-placemark.js
vendored
@@ -1,105 +1,6 @@
|
||||
var svgEditorExtension_placemark = (function () {
|
||||
'use strict';
|
||||
|
||||
function _inherits(subClass, superClass) {
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
|
||||
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
||||
constructor: {
|
||||
value: subClass,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
if (superClass) _setPrototypeOf(subClass, superClass);
|
||||
}
|
||||
|
||||
function _getPrototypeOf(o) {
|
||||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
||||
return o.__proto__ || Object.getPrototypeOf(o);
|
||||
};
|
||||
return _getPrototypeOf(o);
|
||||
}
|
||||
|
||||
function _setPrototypeOf(o, p) {
|
||||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
||||
o.__proto__ = p;
|
||||
return o;
|
||||
};
|
||||
|
||||
return _setPrototypeOf(o, p);
|
||||
}
|
||||
|
||||
function isNativeReflectConstruct() {
|
||||
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
||||
if (Reflect.construct.sham) return false;
|
||||
if (typeof Proxy === "function") return true;
|
||||
|
||||
try {
|
||||
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function _construct(Parent, args, Class) {
|
||||
if (isNativeReflectConstruct()) {
|
||||
_construct = Reflect.construct;
|
||||
} else {
|
||||
_construct = function _construct(Parent, args, Class) {
|
||||
var a = [null];
|
||||
a.push.apply(a, args);
|
||||
var Constructor = Function.bind.apply(Parent, a);
|
||||
var instance = new Constructor();
|
||||
if (Class) _setPrototypeOf(instance, Class.prototype);
|
||||
return instance;
|
||||
};
|
||||
}
|
||||
|
||||
return _construct.apply(null, arguments);
|
||||
}
|
||||
|
||||
function _isNativeFunction(fn) {
|
||||
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
||||
}
|
||||
|
||||
function _wrapNativeSuper(Class) {
|
||||
var _cache = typeof Map === "function" ? new Map() : undefined;
|
||||
|
||||
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
||||
if (Class === null || !_isNativeFunction(Class)) return Class;
|
||||
|
||||
if (typeof Class !== "function") {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
|
||||
if (typeof _cache !== "undefined") {
|
||||
if (_cache.has(Class)) return _cache.get(Class);
|
||||
|
||||
_cache.set(Class, Wrapper);
|
||||
}
|
||||
|
||||
function Wrapper() {
|
||||
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
||||
}
|
||||
|
||||
Wrapper.prototype = Object.create(Class.prototype, {
|
||||
constructor: {
|
||||
value: Wrapper,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
return _setPrototypeOf(Wrapper, Class);
|
||||
};
|
||||
|
||||
return _wrapNativeSuper(Class);
|
||||
}
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
||||
}
|
||||
@@ -142,71 +43,6 @@ var svgEditorExtension_placemark = (function () {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
||||
}
|
||||
|
||||
function _wrapRegExp(re, groups) {
|
||||
_wrapRegExp = function (re, groups) {
|
||||
return new BabelRegExp(re, undefined, groups);
|
||||
};
|
||||
|
||||
var _RegExp = _wrapNativeSuper(RegExp);
|
||||
|
||||
var _super = RegExp.prototype;
|
||||
|
||||
var _groups = new WeakMap();
|
||||
|
||||
function BabelRegExp(re, flags, groups) {
|
||||
var _this = _RegExp.call(this, re, flags);
|
||||
|
||||
_groups.set(_this, groups || _groups.get(re));
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_inherits(BabelRegExp, _RegExp);
|
||||
|
||||
BabelRegExp.prototype.exec = function (str) {
|
||||
var result = _super.exec.call(this, str);
|
||||
|
||||
if (result) result.groups = buildGroups(result, this);
|
||||
return result;
|
||||
};
|
||||
|
||||
BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
|
||||
if (typeof substitution === "string") {
|
||||
var groups = _groups.get(this);
|
||||
|
||||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
|
||||
return "$" + groups[name];
|
||||
}));
|
||||
} else if (typeof substitution === "function") {
|
||||
var _this = this;
|
||||
|
||||
return _super[Symbol.replace].call(this, str, function () {
|
||||
var args = [];
|
||||
args.push.apply(args, arguments);
|
||||
|
||||
if (typeof args[args.length - 1] !== "object") {
|
||||
args.push(buildGroups(args, _this));
|
||||
}
|
||||
|
||||
return substitution.apply(this, args);
|
||||
});
|
||||
} else {
|
||||
return _super[Symbol.replace].call(this, str, substitution);
|
||||
}
|
||||
};
|
||||
|
||||
function buildGroups(result, re) {
|
||||
var g = _groups.get(re);
|
||||
|
||||
return Object.keys(g).reduce(function (groups, name) {
|
||||
groups[name] = result[g[name]];
|
||||
return groups;
|
||||
}, Object.create(null));
|
||||
}
|
||||
|
||||
return _wrapRegExp.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-placemark.js
|
||||
*
|
||||
@@ -448,17 +284,17 @@ var svgEditorExtension_placemark = (function () {
|
||||
|
||||
if (!str) {
|
||||
return null;
|
||||
}
|
||||
} // const m = str.match(/\(#(?<id>.+)\)/);
|
||||
// if (!m || !m.groups.id) {
|
||||
|
||||
var m = str.match(_wrapRegExp(/\(#(.+)\)/, {
|
||||
id: 1
|
||||
}));
|
||||
|
||||
if (!m || !m.groups.id) {
|
||||
var m = str.match(/\(#(.*)\)/);
|
||||
|
||||
if (!m || m.length !== 2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return svgCanvas.getElem(m.groups.id);
|
||||
return svgCanvas.getElem(m[1]); // return svgCanvas.getElem(m.groups.id);
|
||||
};
|
||||
|
||||
showPanel = function _ref(on) {
|
||||
|
||||
124
dist/extensions/ext-server_moinsave.js
vendored
124
dist/extensions/ext-server_moinsave.js
vendored
@@ -98,44 +98,6 @@ var svgEditorExtension_server_moinsave = (function () {
|
||||
return _construct.apply(null, arguments);
|
||||
}
|
||||
|
||||
function _isNativeFunction(fn) {
|
||||
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
||||
}
|
||||
|
||||
function _wrapNativeSuper(Class) {
|
||||
var _cache = typeof Map === "function" ? new Map() : undefined;
|
||||
|
||||
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
||||
if (Class === null || !_isNativeFunction(Class)) return Class;
|
||||
|
||||
if (typeof Class !== "function") {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
|
||||
if (typeof _cache !== "undefined") {
|
||||
if (_cache.has(Class)) return _cache.get(Class);
|
||||
|
||||
_cache.set(Class, Wrapper);
|
||||
}
|
||||
|
||||
function Wrapper() {
|
||||
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
||||
}
|
||||
|
||||
Wrapper.prototype = Object.create(Class.prototype, {
|
||||
constructor: {
|
||||
value: Wrapper,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
return _setPrototypeOf(Wrapper, Class);
|
||||
};
|
||||
|
||||
return _wrapNativeSuper(Class);
|
||||
}
|
||||
|
||||
function _assertThisInitialized(self) {
|
||||
if (self === void 0) {
|
||||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
@@ -244,71 +206,6 @@ var svgEditorExtension_server_moinsave = (function () {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
||||
}
|
||||
|
||||
function _wrapRegExp(re, groups) {
|
||||
_wrapRegExp = function (re, groups) {
|
||||
return new BabelRegExp(re, undefined, groups);
|
||||
};
|
||||
|
||||
var _RegExp = _wrapNativeSuper(RegExp);
|
||||
|
||||
var _super = RegExp.prototype;
|
||||
|
||||
var _groups = new WeakMap();
|
||||
|
||||
function BabelRegExp(re, flags, groups) {
|
||||
var _this = _RegExp.call(this, re, flags);
|
||||
|
||||
_groups.set(_this, groups || _groups.get(re));
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_inherits(BabelRegExp, _RegExp);
|
||||
|
||||
BabelRegExp.prototype.exec = function (str) {
|
||||
var result = _super.exec.call(this, str);
|
||||
|
||||
if (result) result.groups = buildGroups(result, this);
|
||||
return result;
|
||||
};
|
||||
|
||||
BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
|
||||
if (typeof substitution === "string") {
|
||||
var groups = _groups.get(this);
|
||||
|
||||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
|
||||
return "$" + groups[name];
|
||||
}));
|
||||
} else if (typeof substitution === "function") {
|
||||
var _this = this;
|
||||
|
||||
return _super[Symbol.replace].call(this, str, function () {
|
||||
var args = [];
|
||||
args.push.apply(args, arguments);
|
||||
|
||||
if (typeof args[args.length - 1] !== "object") {
|
||||
args.push(buildGroups(args, _this));
|
||||
}
|
||||
|
||||
return substitution.apply(this, args);
|
||||
});
|
||||
} else {
|
||||
return _super[Symbol.replace].call(this, str, substitution);
|
||||
}
|
||||
};
|
||||
|
||||
function buildGroups(result, re) {
|
||||
var g = _groups.get(re);
|
||||
|
||||
return Object.keys(g).reduce(function (groups, name) {
|
||||
groups[name] = result[g[name]];
|
||||
return groups;
|
||||
}, Object.create(null));
|
||||
}
|
||||
|
||||
return _wrapRegExp.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* For parsing color values
|
||||
* @module RGBColor
|
||||
@@ -463,11 +360,8 @@ var svgEditorExtension_server_moinsave = (function () {
|
||||
}; // array of color definition objects
|
||||
|
||||
var colorDefs = [{
|
||||
re: _wrapRegExp(/^rgb\(([0-9]{1,3}),[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*([0-9]{1,3}),[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*([0-9]{1,3})\)$/, {
|
||||
r: 1,
|
||||
g: 2,
|
||||
b: 3
|
||||
}),
|
||||
re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
|
||||
// re: /^rgb\((?<r>\d{1,3}),\s*(?<g>\d{1,3}),\s*(?<b>\d{1,3})\)$/,
|
||||
example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
|
||||
process: function process(_) {
|
||||
for (var _len = arguments.length, bits = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
@@ -479,11 +373,8 @@ var svgEditorExtension_server_moinsave = (function () {
|
||||
});
|
||||
}
|
||||
}, {
|
||||
re: _wrapRegExp(/^([0-9A-Z_a-z]{2})([0-9A-Z_a-z]{2})([0-9A-Z_a-z]{2})$/, {
|
||||
r: 1,
|
||||
g: 2,
|
||||
b: 3
|
||||
}),
|
||||
re: /^(\w{2})(\w{2})(\w{2})$/,
|
||||
// re: /^(?<r>\w{2})(?<g>\w{2})(?<b>\w{2})$/,
|
||||
example: ['#00ff00', '336699'],
|
||||
process: function process(_) {
|
||||
for (var _len2 = arguments.length, bits = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||
@@ -495,11 +386,8 @@ var svgEditorExtension_server_moinsave = (function () {
|
||||
});
|
||||
}
|
||||
}, {
|
||||
re: _wrapRegExp(/^([0-9A-Z_a-z]{1})([0-9A-Z_a-z]{1})([0-9A-Z_a-z]{1})$/, {
|
||||
r: 1,
|
||||
g: 2,
|
||||
b: 3
|
||||
}),
|
||||
re: /^(\w{1})(\w{1})(\w{1})$/,
|
||||
// re: /^(?<r>\w{1})(?<g>\w{1})(?<b>\w{1})$/,
|
||||
example: ['#fb0', 'f0f'],
|
||||
process: function process(_) {
|
||||
for (var _len3 = arguments.length, bits = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
||||
|
||||
124
dist/extensions/ext-server_opensave.js
vendored
124
dist/extensions/ext-server_opensave.js
vendored
@@ -98,44 +98,6 @@ var svgEditorExtension_server_opensave = (function () {
|
||||
return _construct.apply(null, arguments);
|
||||
}
|
||||
|
||||
function _isNativeFunction(fn) {
|
||||
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
||||
}
|
||||
|
||||
function _wrapNativeSuper(Class) {
|
||||
var _cache = typeof Map === "function" ? new Map() : undefined;
|
||||
|
||||
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
||||
if (Class === null || !_isNativeFunction(Class)) return Class;
|
||||
|
||||
if (typeof Class !== "function") {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
|
||||
if (typeof _cache !== "undefined") {
|
||||
if (_cache.has(Class)) return _cache.get(Class);
|
||||
|
||||
_cache.set(Class, Wrapper);
|
||||
}
|
||||
|
||||
function Wrapper() {
|
||||
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
||||
}
|
||||
|
||||
Wrapper.prototype = Object.create(Class.prototype, {
|
||||
constructor: {
|
||||
value: Wrapper,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
return _setPrototypeOf(Wrapper, Class);
|
||||
};
|
||||
|
||||
return _wrapNativeSuper(Class);
|
||||
}
|
||||
|
||||
function _assertThisInitialized(self) {
|
||||
if (self === void 0) {
|
||||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
@@ -244,71 +206,6 @@ var svgEditorExtension_server_opensave = (function () {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
||||
}
|
||||
|
||||
function _wrapRegExp(re, groups) {
|
||||
_wrapRegExp = function (re, groups) {
|
||||
return new BabelRegExp(re, undefined, groups);
|
||||
};
|
||||
|
||||
var _RegExp = _wrapNativeSuper(RegExp);
|
||||
|
||||
var _super = RegExp.prototype;
|
||||
|
||||
var _groups = new WeakMap();
|
||||
|
||||
function BabelRegExp(re, flags, groups) {
|
||||
var _this = _RegExp.call(this, re, flags);
|
||||
|
||||
_groups.set(_this, groups || _groups.get(re));
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_inherits(BabelRegExp, _RegExp);
|
||||
|
||||
BabelRegExp.prototype.exec = function (str) {
|
||||
var result = _super.exec.call(this, str);
|
||||
|
||||
if (result) result.groups = buildGroups(result, this);
|
||||
return result;
|
||||
};
|
||||
|
||||
BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
|
||||
if (typeof substitution === "string") {
|
||||
var groups = _groups.get(this);
|
||||
|
||||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
|
||||
return "$" + groups[name];
|
||||
}));
|
||||
} else if (typeof substitution === "function") {
|
||||
var _this = this;
|
||||
|
||||
return _super[Symbol.replace].call(this, str, function () {
|
||||
var args = [];
|
||||
args.push.apply(args, arguments);
|
||||
|
||||
if (typeof args[args.length - 1] !== "object") {
|
||||
args.push(buildGroups(args, _this));
|
||||
}
|
||||
|
||||
return substitution.apply(this, args);
|
||||
});
|
||||
} else {
|
||||
return _super[Symbol.replace].call(this, str, substitution);
|
||||
}
|
||||
};
|
||||
|
||||
function buildGroups(result, re) {
|
||||
var g = _groups.get(re);
|
||||
|
||||
return Object.keys(g).reduce(function (groups, name) {
|
||||
groups[name] = result[g[name]];
|
||||
return groups;
|
||||
}, Object.create(null));
|
||||
}
|
||||
|
||||
return _wrapRegExp.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* For parsing color values
|
||||
* @module RGBColor
|
||||
@@ -463,11 +360,8 @@ var svgEditorExtension_server_opensave = (function () {
|
||||
}; // array of color definition objects
|
||||
|
||||
var colorDefs = [{
|
||||
re: _wrapRegExp(/^rgb\(([0-9]{1,3}),[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*([0-9]{1,3}),[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*([0-9]{1,3})\)$/, {
|
||||
r: 1,
|
||||
g: 2,
|
||||
b: 3
|
||||
}),
|
||||
re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
|
||||
// re: /^rgb\((?<r>\d{1,3}),\s*(?<g>\d{1,3}),\s*(?<b>\d{1,3})\)$/,
|
||||
example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
|
||||
process: function process(_) {
|
||||
for (var _len = arguments.length, bits = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
@@ -479,11 +373,8 @@ var svgEditorExtension_server_opensave = (function () {
|
||||
});
|
||||
}
|
||||
}, {
|
||||
re: _wrapRegExp(/^([0-9A-Z_a-z]{2})([0-9A-Z_a-z]{2})([0-9A-Z_a-z]{2})$/, {
|
||||
r: 1,
|
||||
g: 2,
|
||||
b: 3
|
||||
}),
|
||||
re: /^(\w{2})(\w{2})(\w{2})$/,
|
||||
// re: /^(?<r>\w{2})(?<g>\w{2})(?<b>\w{2})$/,
|
||||
example: ['#00ff00', '336699'],
|
||||
process: function process(_) {
|
||||
for (var _len2 = arguments.length, bits = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||
@@ -495,11 +386,8 @@ var svgEditorExtension_server_opensave = (function () {
|
||||
});
|
||||
}
|
||||
}, {
|
||||
re: _wrapRegExp(/^([0-9A-Z_a-z]{1})([0-9A-Z_a-z]{1})([0-9A-Z_a-z]{1})$/, {
|
||||
r: 1,
|
||||
g: 2,
|
||||
b: 3
|
||||
}),
|
||||
re: /^(\w{1})(\w{1})(\w{1})$/,
|
||||
// re: /^(?<r>\w{1})(?<g>\w{1})(?<b>\w{1})$/,
|
||||
example: ['#fb0', 'f0f'],
|
||||
process: function process(_) {
|
||||
for (var _len3 = arguments.length, bits = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
||||
|
||||
176
dist/extensions/ext-storage.js
vendored
176
dist/extensions/ext-storage.js
vendored
@@ -1,105 +1,6 @@
|
||||
var svgEditorExtension_storage = (function () {
|
||||
'use strict';
|
||||
|
||||
function _inherits(subClass, superClass) {
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
|
||||
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
||||
constructor: {
|
||||
value: subClass,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
if (superClass) _setPrototypeOf(subClass, superClass);
|
||||
}
|
||||
|
||||
function _getPrototypeOf(o) {
|
||||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
||||
return o.__proto__ || Object.getPrototypeOf(o);
|
||||
};
|
||||
return _getPrototypeOf(o);
|
||||
}
|
||||
|
||||
function _setPrototypeOf(o, p) {
|
||||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
||||
o.__proto__ = p;
|
||||
return o;
|
||||
};
|
||||
|
||||
return _setPrototypeOf(o, p);
|
||||
}
|
||||
|
||||
function isNativeReflectConstruct() {
|
||||
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
||||
if (Reflect.construct.sham) return false;
|
||||
if (typeof Proxy === "function") return true;
|
||||
|
||||
try {
|
||||
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function _construct(Parent, args, Class) {
|
||||
if (isNativeReflectConstruct()) {
|
||||
_construct = Reflect.construct;
|
||||
} else {
|
||||
_construct = function _construct(Parent, args, Class) {
|
||||
var a = [null];
|
||||
a.push.apply(a, args);
|
||||
var Constructor = Function.bind.apply(Parent, a);
|
||||
var instance = new Constructor();
|
||||
if (Class) _setPrototypeOf(instance, Class.prototype);
|
||||
return instance;
|
||||
};
|
||||
}
|
||||
|
||||
return _construct.apply(null, arguments);
|
||||
}
|
||||
|
||||
function _isNativeFunction(fn) {
|
||||
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
||||
}
|
||||
|
||||
function _wrapNativeSuper(Class) {
|
||||
var _cache = typeof Map === "function" ? new Map() : undefined;
|
||||
|
||||
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
||||
if (Class === null || !_isNativeFunction(Class)) return Class;
|
||||
|
||||
if (typeof Class !== "function") {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
|
||||
if (typeof _cache !== "undefined") {
|
||||
if (_cache.has(Class)) return _cache.get(Class);
|
||||
|
||||
_cache.set(Class, Wrapper);
|
||||
}
|
||||
|
||||
function Wrapper() {
|
||||
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
||||
}
|
||||
|
||||
Wrapper.prototype = Object.create(Class.prototype, {
|
||||
constructor: {
|
||||
value: Wrapper,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
return _setPrototypeOf(Wrapper, Class);
|
||||
};
|
||||
|
||||
return _wrapNativeSuper(Class);
|
||||
}
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
||||
}
|
||||
@@ -142,71 +43,6 @@ var svgEditorExtension_storage = (function () {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
||||
}
|
||||
|
||||
function _wrapRegExp(re, groups) {
|
||||
_wrapRegExp = function (re, groups) {
|
||||
return new BabelRegExp(re, undefined, groups);
|
||||
};
|
||||
|
||||
var _RegExp = _wrapNativeSuper(RegExp);
|
||||
|
||||
var _super = RegExp.prototype;
|
||||
|
||||
var _groups = new WeakMap();
|
||||
|
||||
function BabelRegExp(re, flags, groups) {
|
||||
var _this = _RegExp.call(this, re, flags);
|
||||
|
||||
_groups.set(_this, groups || _groups.get(re));
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_inherits(BabelRegExp, _RegExp);
|
||||
|
||||
BabelRegExp.prototype.exec = function (str) {
|
||||
var result = _super.exec.call(this, str);
|
||||
|
||||
if (result) result.groups = buildGroups(result, this);
|
||||
return result;
|
||||
};
|
||||
|
||||
BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
|
||||
if (typeof substitution === "string") {
|
||||
var groups = _groups.get(this);
|
||||
|
||||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
|
||||
return "$" + groups[name];
|
||||
}));
|
||||
} else if (typeof substitution === "function") {
|
||||
var _this = this;
|
||||
|
||||
return _super[Symbol.replace].call(this, str, function () {
|
||||
var args = [];
|
||||
args.push.apply(args, arguments);
|
||||
|
||||
if (typeof args[args.length - 1] !== "object") {
|
||||
args.push(buildGroups(args, _this));
|
||||
}
|
||||
|
||||
return substitution.apply(this, args);
|
||||
});
|
||||
} else {
|
||||
return _super[Symbol.replace].call(this, str, substitution);
|
||||
}
|
||||
};
|
||||
|
||||
function buildGroups(result, re) {
|
||||
var g = _groups.get(re);
|
||||
|
||||
return Object.keys(g).reduce(function (groups, name) {
|
||||
groups[name] = result[g[name]];
|
||||
return groups;
|
||||
}, Object.create(null));
|
||||
}
|
||||
|
||||
return _wrapRegExp.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-storage.js
|
||||
*
|
||||
@@ -257,11 +93,13 @@ var svgEditorExtension_storage = (function () {
|
||||
var loc = top.location; // Allow this to work with the embedded editor as well
|
||||
|
||||
if (loc.href.includes('storagePrompt=')) {
|
||||
loc.href = loc.href.replace(_wrapRegExp(/([&\?])storagePrompt=[\0-%'-\uFFFF]*(&?)/, {
|
||||
sep: 1,
|
||||
amp: 2
|
||||
}), function (n0, sep, amp) {
|
||||
return (val ? sep : '') + val + (!val && amp ? sep : amp || '');
|
||||
/*
|
||||
loc.href = loc.href.replace(/(?<sep>[&?])storagePrompt=[^&]*(?<amp>&?)/, function (n0, sep, amp) {
|
||||
return (val ? sep : '') + val + (!val && amp ? sep : (amp || ''));
|
||||
});
|
||||
*/
|
||||
loc.href = loc.href.replace(/([&?])storagePrompt=[^&]*(&?)/, function (n0, n1, amp) {
|
||||
return (val ? n1 : '') + val + (!val && amp ? n1 : amp || '');
|
||||
});
|
||||
} else {
|
||||
loc.href += (loc.href.includes('?') ? '&' : '?') + val;
|
||||
|
||||
Reference in New Issue
Block a user