ding-image-editor 3.15.3 → 3.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tui-image-editor.js +963 -18
- package/dist/tui-image-editor.min.js +3 -3
- package/package.json +1 -1
- package/src/js/component/freeDrawing.js +29 -10
- package/src/js/imageEditor.js +7 -0
package/dist/tui-image-editor.js
CHANGED
@@ -31002,6 +31002,13 @@ module.exports = __webpack_require__(2214);
|
|
31002
31002
|
|
31003
31003
|
/***/ }),
|
31004
31004
|
|
31005
|
+
/***/ 7567:
|
31006
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
31007
|
+
|
31008
|
+
module.exports = __webpack_require__(983);
|
31009
|
+
|
31010
|
+
/***/ }),
|
31011
|
+
|
31005
31012
|
/***/ 184:
|
31006
31013
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
31007
31014
|
|
@@ -31014,6 +31021,14 @@ module.exports = __webpack_require__(9256);
|
|
31014
31021
|
|
31015
31022
|
module.exports = __webpack_require__(5659);
|
31016
31023
|
|
31024
|
+
/***/ }),
|
31025
|
+
|
31026
|
+
/***/ 261:
|
31027
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
31028
|
+
|
31029
|
+
module.exports = __webpack_require__(5047);
|
31030
|
+
|
31031
|
+
|
31017
31032
|
/***/ }),
|
31018
31033
|
|
31019
31034
|
/***/ 1801:
|
@@ -31791,6 +31806,21 @@ var parent = __webpack_require__(6672);
|
|
31791
31806
|
module.exports = parent;
|
31792
31807
|
|
31793
31808
|
|
31809
|
+
/***/ }),
|
31810
|
+
|
31811
|
+
/***/ 983:
|
31812
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
31813
|
+
|
31814
|
+
var parent = __webpack_require__(6618);
|
31815
|
+
__webpack_require__(2752);
|
31816
|
+
// TODO: Remove from `core-js@4`
|
31817
|
+
__webpack_require__(4562);
|
31818
|
+
__webpack_require__(5363);
|
31819
|
+
__webpack_require__(9355);
|
31820
|
+
|
31821
|
+
module.exports = parent;
|
31822
|
+
|
31823
|
+
|
31794
31824
|
/***/ }),
|
31795
31825
|
|
31796
31826
|
/***/ 9256:
|
@@ -36885,6 +36915,56 @@ var defineWellKnownSymbol = __webpack_require__(1488);
|
|
36885
36915
|
defineWellKnownSymbol('unscopables');
|
36886
36916
|
|
36887
36917
|
|
36918
|
+
/***/ }),
|
36919
|
+
|
36920
|
+
/***/ 2752:
|
36921
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
36922
|
+
|
36923
|
+
// TODO: Remove from `core-js@4`
|
36924
|
+
__webpack_require__(4242);
|
36925
|
+
|
36926
|
+
|
36927
|
+
/***/ }),
|
36928
|
+
|
36929
|
+
/***/ 4562:
|
36930
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
36931
|
+
|
36932
|
+
// TODO: Remove from `core-js@4`
|
36933
|
+
__webpack_require__(7884);
|
36934
|
+
|
36935
|
+
|
36936
|
+
/***/ }),
|
36937
|
+
|
36938
|
+
/***/ 9355:
|
36939
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
36940
|
+
|
36941
|
+
// TODO: Remove from `core-js@4`
|
36942
|
+
__webpack_require__(8885);
|
36943
|
+
|
36944
|
+
|
36945
|
+
/***/ }),
|
36946
|
+
|
36947
|
+
/***/ 5363:
|
36948
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
36949
|
+
|
36950
|
+
"use strict";
|
36951
|
+
|
36952
|
+
var $ = __webpack_require__(3085);
|
36953
|
+
var newPromiseCapabilityModule = __webpack_require__(9438);
|
36954
|
+
var perform = __webpack_require__(892);
|
36955
|
+
|
36956
|
+
// `Promise.try` method
|
36957
|
+
// https://github.com/tc39/proposal-promise-try
|
36958
|
+
$({ target: 'Promise', stat: true }, {
|
36959
|
+
'try': function (callbackfn) {
|
36960
|
+
var promiseCapability = newPromiseCapabilityModule.f(this);
|
36961
|
+
var result = perform(callbackfn);
|
36962
|
+
(result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value);
|
36963
|
+
return promiseCapability.promise;
|
36964
|
+
}
|
36965
|
+
});
|
36966
|
+
|
36967
|
+
|
36888
36968
|
/***/ }),
|
36889
36969
|
|
36890
36970
|
/***/ 177:
|
@@ -38740,6 +38820,767 @@ var path = __webpack_require__(7545);
|
|
38740
38820
|
module.exports = path.URL;
|
38741
38821
|
|
38742
38822
|
|
38823
|
+
/***/ }),
|
38824
|
+
|
38825
|
+
/***/ 5047:
|
38826
|
+
/***/ (function(module) {
|
38827
|
+
|
38828
|
+
/**
|
38829
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
38830
|
+
*
|
38831
|
+
* This source code is licensed under the MIT license found in the
|
38832
|
+
* LICENSE file in the root directory of this source tree.
|
38833
|
+
*/
|
38834
|
+
|
38835
|
+
var runtime = (function (exports) {
|
38836
|
+
"use strict";
|
38837
|
+
|
38838
|
+
var Op = Object.prototype;
|
38839
|
+
var hasOwn = Op.hasOwnProperty;
|
38840
|
+
var undefined; // More compressible than void 0.
|
38841
|
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
38842
|
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
38843
|
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
38844
|
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
38845
|
+
|
38846
|
+
function define(obj, key, value) {
|
38847
|
+
Object.defineProperty(obj, key, {
|
38848
|
+
value: value,
|
38849
|
+
enumerable: true,
|
38850
|
+
configurable: true,
|
38851
|
+
writable: true
|
38852
|
+
});
|
38853
|
+
return obj[key];
|
38854
|
+
}
|
38855
|
+
try {
|
38856
|
+
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
38857
|
+
define({}, "");
|
38858
|
+
} catch (err) {
|
38859
|
+
define = function(obj, key, value) {
|
38860
|
+
return obj[key] = value;
|
38861
|
+
};
|
38862
|
+
}
|
38863
|
+
|
38864
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
38865
|
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
38866
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
38867
|
+
var generator = Object.create(protoGenerator.prototype);
|
38868
|
+
var context = new Context(tryLocsList || []);
|
38869
|
+
|
38870
|
+
// The ._invoke method unifies the implementations of the .next,
|
38871
|
+
// .throw, and .return methods.
|
38872
|
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
38873
|
+
|
38874
|
+
return generator;
|
38875
|
+
}
|
38876
|
+
exports.wrap = wrap;
|
38877
|
+
|
38878
|
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
38879
|
+
// record like context.tryEntries[i].completion. This interface could
|
38880
|
+
// have been (and was previously) designed to take a closure to be
|
38881
|
+
// invoked without arguments, but in all the cases we care about we
|
38882
|
+
// already have an existing method we want to call, so there's no need
|
38883
|
+
// to create a new function object. We can even get away with assuming
|
38884
|
+
// the method takes exactly one argument, since that happens to be true
|
38885
|
+
// in every case, so we don't have to touch the arguments object. The
|
38886
|
+
// only additional allocation required is the completion record, which
|
38887
|
+
// has a stable shape and so hopefully should be cheap to allocate.
|
38888
|
+
function tryCatch(fn, obj, arg) {
|
38889
|
+
try {
|
38890
|
+
return { type: "normal", arg: fn.call(obj, arg) };
|
38891
|
+
} catch (err) {
|
38892
|
+
return { type: "throw", arg: err };
|
38893
|
+
}
|
38894
|
+
}
|
38895
|
+
|
38896
|
+
var GenStateSuspendedStart = "suspendedStart";
|
38897
|
+
var GenStateSuspendedYield = "suspendedYield";
|
38898
|
+
var GenStateExecuting = "executing";
|
38899
|
+
var GenStateCompleted = "completed";
|
38900
|
+
|
38901
|
+
// Returning this object from the innerFn has the same effect as
|
38902
|
+
// breaking out of the dispatch switch statement.
|
38903
|
+
var ContinueSentinel = {};
|
38904
|
+
|
38905
|
+
// Dummy constructor functions that we use as the .constructor and
|
38906
|
+
// .constructor.prototype properties for functions that return Generator
|
38907
|
+
// objects. For full spec compliance, you may wish to configure your
|
38908
|
+
// minifier not to mangle the names of these two functions.
|
38909
|
+
function Generator() {}
|
38910
|
+
function GeneratorFunction() {}
|
38911
|
+
function GeneratorFunctionPrototype() {}
|
38912
|
+
|
38913
|
+
// This is a polyfill for %IteratorPrototype% for environments that
|
38914
|
+
// don't natively support it.
|
38915
|
+
var IteratorPrototype = {};
|
38916
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
38917
|
+
return this;
|
38918
|
+
});
|
38919
|
+
|
38920
|
+
var getProto = Object.getPrototypeOf;
|
38921
|
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
38922
|
+
if (NativeIteratorPrototype &&
|
38923
|
+
NativeIteratorPrototype !== Op &&
|
38924
|
+
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
38925
|
+
// This environment has a native %IteratorPrototype%; use it instead
|
38926
|
+
// of the polyfill.
|
38927
|
+
IteratorPrototype = NativeIteratorPrototype;
|
38928
|
+
}
|
38929
|
+
|
38930
|
+
var Gp = GeneratorFunctionPrototype.prototype =
|
38931
|
+
Generator.prototype = Object.create(IteratorPrototype);
|
38932
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
38933
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
38934
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
38935
|
+
GeneratorFunction.displayName = define(
|
38936
|
+
GeneratorFunctionPrototype,
|
38937
|
+
toStringTagSymbol,
|
38938
|
+
"GeneratorFunction"
|
38939
|
+
);
|
38940
|
+
|
38941
|
+
// Helper for defining the .next, .throw, and .return methods of the
|
38942
|
+
// Iterator interface in terms of a single ._invoke method.
|
38943
|
+
function defineIteratorMethods(prototype) {
|
38944
|
+
["next", "throw", "return"].forEach(function(method) {
|
38945
|
+
define(prototype, method, function(arg) {
|
38946
|
+
return this._invoke(method, arg);
|
38947
|
+
});
|
38948
|
+
});
|
38949
|
+
}
|
38950
|
+
|
38951
|
+
exports.isGeneratorFunction = function(genFun) {
|
38952
|
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
38953
|
+
return ctor
|
38954
|
+
? ctor === GeneratorFunction ||
|
38955
|
+
// For the native GeneratorFunction constructor, the best we can
|
38956
|
+
// do is to check its .name property.
|
38957
|
+
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
38958
|
+
: false;
|
38959
|
+
};
|
38960
|
+
|
38961
|
+
exports.mark = function(genFun) {
|
38962
|
+
if (Object.setPrototypeOf) {
|
38963
|
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
38964
|
+
} else {
|
38965
|
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
38966
|
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
38967
|
+
}
|
38968
|
+
genFun.prototype = Object.create(Gp);
|
38969
|
+
return genFun;
|
38970
|
+
};
|
38971
|
+
|
38972
|
+
// Within the body of any async function, `await x` is transformed to
|
38973
|
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
38974
|
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
38975
|
+
// meant to be awaited.
|
38976
|
+
exports.awrap = function(arg) {
|
38977
|
+
return { __await: arg };
|
38978
|
+
};
|
38979
|
+
|
38980
|
+
function AsyncIterator(generator, PromiseImpl) {
|
38981
|
+
function invoke(method, arg, resolve, reject) {
|
38982
|
+
var record = tryCatch(generator[method], generator, arg);
|
38983
|
+
if (record.type === "throw") {
|
38984
|
+
reject(record.arg);
|
38985
|
+
} else {
|
38986
|
+
var result = record.arg;
|
38987
|
+
var value = result.value;
|
38988
|
+
if (value &&
|
38989
|
+
typeof value === "object" &&
|
38990
|
+
hasOwn.call(value, "__await")) {
|
38991
|
+
return PromiseImpl.resolve(value.__await).then(function(value) {
|
38992
|
+
invoke("next", value, resolve, reject);
|
38993
|
+
}, function(err) {
|
38994
|
+
invoke("throw", err, resolve, reject);
|
38995
|
+
});
|
38996
|
+
}
|
38997
|
+
|
38998
|
+
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
38999
|
+
// When a yielded Promise is resolved, its final value becomes
|
39000
|
+
// the .value of the Promise<{value,done}> result for the
|
39001
|
+
// current iteration.
|
39002
|
+
result.value = unwrapped;
|
39003
|
+
resolve(result);
|
39004
|
+
}, function(error) {
|
39005
|
+
// If a rejected Promise was yielded, throw the rejection back
|
39006
|
+
// into the async generator function so it can be handled there.
|
39007
|
+
return invoke("throw", error, resolve, reject);
|
39008
|
+
});
|
39009
|
+
}
|
39010
|
+
}
|
39011
|
+
|
39012
|
+
var previousPromise;
|
39013
|
+
|
39014
|
+
function enqueue(method, arg) {
|
39015
|
+
function callInvokeWithMethodAndArg() {
|
39016
|
+
return new PromiseImpl(function(resolve, reject) {
|
39017
|
+
invoke(method, arg, resolve, reject);
|
39018
|
+
});
|
39019
|
+
}
|
39020
|
+
|
39021
|
+
return previousPromise =
|
39022
|
+
// If enqueue has been called before, then we want to wait until
|
39023
|
+
// all previous Promises have been resolved before calling invoke,
|
39024
|
+
// so that results are always delivered in the correct order. If
|
39025
|
+
// enqueue has not been called before, then it is important to
|
39026
|
+
// call invoke immediately, without waiting on a callback to fire,
|
39027
|
+
// so that the async generator function has the opportunity to do
|
39028
|
+
// any necessary setup in a predictable way. This predictability
|
39029
|
+
// is why the Promise constructor synchronously invokes its
|
39030
|
+
// executor callback, and why async functions synchronously
|
39031
|
+
// execute code before the first await. Since we implement simple
|
39032
|
+
// async functions in terms of async generators, it is especially
|
39033
|
+
// important to get this right, even though it requires care.
|
39034
|
+
previousPromise ? previousPromise.then(
|
39035
|
+
callInvokeWithMethodAndArg,
|
39036
|
+
// Avoid propagating failures to Promises returned by later
|
39037
|
+
// invocations of the iterator.
|
39038
|
+
callInvokeWithMethodAndArg
|
39039
|
+
) : callInvokeWithMethodAndArg();
|
39040
|
+
}
|
39041
|
+
|
39042
|
+
// Define the unified helper method that is used to implement .next,
|
39043
|
+
// .throw, and .return (see defineIteratorMethods).
|
39044
|
+
this._invoke = enqueue;
|
39045
|
+
}
|
39046
|
+
|
39047
|
+
defineIteratorMethods(AsyncIterator.prototype);
|
39048
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
39049
|
+
return this;
|
39050
|
+
});
|
39051
|
+
exports.AsyncIterator = AsyncIterator;
|
39052
|
+
|
39053
|
+
// Note that simple async functions are implemented on top of
|
39054
|
+
// AsyncIterator objects; they just return a Promise for the value of
|
39055
|
+
// the final result produced by the iterator.
|
39056
|
+
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
39057
|
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
39058
|
+
|
39059
|
+
var iter = new AsyncIterator(
|
39060
|
+
wrap(innerFn, outerFn, self, tryLocsList),
|
39061
|
+
PromiseImpl
|
39062
|
+
);
|
39063
|
+
|
39064
|
+
return exports.isGeneratorFunction(outerFn)
|
39065
|
+
? iter // If outerFn is a generator, return the full iterator.
|
39066
|
+
: iter.next().then(function(result) {
|
39067
|
+
return result.done ? result.value : iter.next();
|
39068
|
+
});
|
39069
|
+
};
|
39070
|
+
|
39071
|
+
function makeInvokeMethod(innerFn, self, context) {
|
39072
|
+
var state = GenStateSuspendedStart;
|
39073
|
+
|
39074
|
+
return function invoke(method, arg) {
|
39075
|
+
if (state === GenStateExecuting) {
|
39076
|
+
throw new Error("Generator is already running");
|
39077
|
+
}
|
39078
|
+
|
39079
|
+
if (state === GenStateCompleted) {
|
39080
|
+
if (method === "throw") {
|
39081
|
+
throw arg;
|
39082
|
+
}
|
39083
|
+
|
39084
|
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
39085
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
39086
|
+
return doneResult();
|
39087
|
+
}
|
39088
|
+
|
39089
|
+
context.method = method;
|
39090
|
+
context.arg = arg;
|
39091
|
+
|
39092
|
+
while (true) {
|
39093
|
+
var delegate = context.delegate;
|
39094
|
+
if (delegate) {
|
39095
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
39096
|
+
if (delegateResult) {
|
39097
|
+
if (delegateResult === ContinueSentinel) continue;
|
39098
|
+
return delegateResult;
|
39099
|
+
}
|
39100
|
+
}
|
39101
|
+
|
39102
|
+
if (context.method === "next") {
|
39103
|
+
// Setting context._sent for legacy support of Babel's
|
39104
|
+
// function.sent implementation.
|
39105
|
+
context.sent = context._sent = context.arg;
|
39106
|
+
|
39107
|
+
} else if (context.method === "throw") {
|
39108
|
+
if (state === GenStateSuspendedStart) {
|
39109
|
+
state = GenStateCompleted;
|
39110
|
+
throw context.arg;
|
39111
|
+
}
|
39112
|
+
|
39113
|
+
context.dispatchException(context.arg);
|
39114
|
+
|
39115
|
+
} else if (context.method === "return") {
|
39116
|
+
context.abrupt("return", context.arg);
|
39117
|
+
}
|
39118
|
+
|
39119
|
+
state = GenStateExecuting;
|
39120
|
+
|
39121
|
+
var record = tryCatch(innerFn, self, context);
|
39122
|
+
if (record.type === "normal") {
|
39123
|
+
// If an exception is thrown from innerFn, we leave state ===
|
39124
|
+
// GenStateExecuting and loop back for another invocation.
|
39125
|
+
state = context.done
|
39126
|
+
? GenStateCompleted
|
39127
|
+
: GenStateSuspendedYield;
|
39128
|
+
|
39129
|
+
if (record.arg === ContinueSentinel) {
|
39130
|
+
continue;
|
39131
|
+
}
|
39132
|
+
|
39133
|
+
return {
|
39134
|
+
value: record.arg,
|
39135
|
+
done: context.done
|
39136
|
+
};
|
39137
|
+
|
39138
|
+
} else if (record.type === "throw") {
|
39139
|
+
state = GenStateCompleted;
|
39140
|
+
// Dispatch the exception by looping back around to the
|
39141
|
+
// context.dispatchException(context.arg) call above.
|
39142
|
+
context.method = "throw";
|
39143
|
+
context.arg = record.arg;
|
39144
|
+
}
|
39145
|
+
}
|
39146
|
+
};
|
39147
|
+
}
|
39148
|
+
|
39149
|
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
39150
|
+
// result, either by returning a { value, done } result from the
|
39151
|
+
// delegate iterator, or by modifying context.method and context.arg,
|
39152
|
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
39153
|
+
function maybeInvokeDelegate(delegate, context) {
|
39154
|
+
var method = delegate.iterator[context.method];
|
39155
|
+
if (method === undefined) {
|
39156
|
+
// A .throw or .return when the delegate iterator has no .throw
|
39157
|
+
// method always terminates the yield* loop.
|
39158
|
+
context.delegate = null;
|
39159
|
+
|
39160
|
+
if (context.method === "throw") {
|
39161
|
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
39162
|
+
if (delegate.iterator["return"]) {
|
39163
|
+
// If the delegate iterator has a return method, give it a
|
39164
|
+
// chance to clean up.
|
39165
|
+
context.method = "return";
|
39166
|
+
context.arg = undefined;
|
39167
|
+
maybeInvokeDelegate(delegate, context);
|
39168
|
+
|
39169
|
+
if (context.method === "throw") {
|
39170
|
+
// If maybeInvokeDelegate(context) changed context.method from
|
39171
|
+
// "return" to "throw", let that override the TypeError below.
|
39172
|
+
return ContinueSentinel;
|
39173
|
+
}
|
39174
|
+
}
|
39175
|
+
|
39176
|
+
context.method = "throw";
|
39177
|
+
context.arg = new TypeError(
|
39178
|
+
"The iterator does not provide a 'throw' method");
|
39179
|
+
}
|
39180
|
+
|
39181
|
+
return ContinueSentinel;
|
39182
|
+
}
|
39183
|
+
|
39184
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
39185
|
+
|
39186
|
+
if (record.type === "throw") {
|
39187
|
+
context.method = "throw";
|
39188
|
+
context.arg = record.arg;
|
39189
|
+
context.delegate = null;
|
39190
|
+
return ContinueSentinel;
|
39191
|
+
}
|
39192
|
+
|
39193
|
+
var info = record.arg;
|
39194
|
+
|
39195
|
+
if (! info) {
|
39196
|
+
context.method = "throw";
|
39197
|
+
context.arg = new TypeError("iterator result is not an object");
|
39198
|
+
context.delegate = null;
|
39199
|
+
return ContinueSentinel;
|
39200
|
+
}
|
39201
|
+
|
39202
|
+
if (info.done) {
|
39203
|
+
// Assign the result of the finished delegate to the temporary
|
39204
|
+
// variable specified by delegate.resultName (see delegateYield).
|
39205
|
+
context[delegate.resultName] = info.value;
|
39206
|
+
|
39207
|
+
// Resume execution at the desired location (see delegateYield).
|
39208
|
+
context.next = delegate.nextLoc;
|
39209
|
+
|
39210
|
+
// If context.method was "throw" but the delegate handled the
|
39211
|
+
// exception, let the outer generator proceed normally. If
|
39212
|
+
// context.method was "next", forget context.arg since it has been
|
39213
|
+
// "consumed" by the delegate iterator. If context.method was
|
39214
|
+
// "return", allow the original .return call to continue in the
|
39215
|
+
// outer generator.
|
39216
|
+
if (context.method !== "return") {
|
39217
|
+
context.method = "next";
|
39218
|
+
context.arg = undefined;
|
39219
|
+
}
|
39220
|
+
|
39221
|
+
} else {
|
39222
|
+
// Re-yield the result returned by the delegate method.
|
39223
|
+
return info;
|
39224
|
+
}
|
39225
|
+
|
39226
|
+
// The delegate iterator is finished, so forget it and continue with
|
39227
|
+
// the outer generator.
|
39228
|
+
context.delegate = null;
|
39229
|
+
return ContinueSentinel;
|
39230
|
+
}
|
39231
|
+
|
39232
|
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
39233
|
+
// unified ._invoke helper method.
|
39234
|
+
defineIteratorMethods(Gp);
|
39235
|
+
|
39236
|
+
define(Gp, toStringTagSymbol, "Generator");
|
39237
|
+
|
39238
|
+
// A Generator should always return itself as the iterator object when the
|
39239
|
+
// @@iterator function is called on it. Some browsers' implementations of the
|
39240
|
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
39241
|
+
// object to not be returned from this call. This ensures that doesn't happen.
|
39242
|
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
39243
|
+
define(Gp, iteratorSymbol, function() {
|
39244
|
+
return this;
|
39245
|
+
});
|
39246
|
+
|
39247
|
+
define(Gp, "toString", function() {
|
39248
|
+
return "[object Generator]";
|
39249
|
+
});
|
39250
|
+
|
39251
|
+
function pushTryEntry(locs) {
|
39252
|
+
var entry = { tryLoc: locs[0] };
|
39253
|
+
|
39254
|
+
if (1 in locs) {
|
39255
|
+
entry.catchLoc = locs[1];
|
39256
|
+
}
|
39257
|
+
|
39258
|
+
if (2 in locs) {
|
39259
|
+
entry.finallyLoc = locs[2];
|
39260
|
+
entry.afterLoc = locs[3];
|
39261
|
+
}
|
39262
|
+
|
39263
|
+
this.tryEntries.push(entry);
|
39264
|
+
}
|
39265
|
+
|
39266
|
+
function resetTryEntry(entry) {
|
39267
|
+
var record = entry.completion || {};
|
39268
|
+
record.type = "normal";
|
39269
|
+
delete record.arg;
|
39270
|
+
entry.completion = record;
|
39271
|
+
}
|
39272
|
+
|
39273
|
+
function Context(tryLocsList) {
|
39274
|
+
// The root entry object (effectively a try statement without a catch
|
39275
|
+
// or a finally block) gives us a place to store values thrown from
|
39276
|
+
// locations where there is no enclosing try statement.
|
39277
|
+
this.tryEntries = [{ tryLoc: "root" }];
|
39278
|
+
tryLocsList.forEach(pushTryEntry, this);
|
39279
|
+
this.reset(true);
|
39280
|
+
}
|
39281
|
+
|
39282
|
+
exports.keys = function(object) {
|
39283
|
+
var keys = [];
|
39284
|
+
for (var key in object) {
|
39285
|
+
keys.push(key);
|
39286
|
+
}
|
39287
|
+
keys.reverse();
|
39288
|
+
|
39289
|
+
// Rather than returning an object with a next method, we keep
|
39290
|
+
// things simple and return the next function itself.
|
39291
|
+
return function next() {
|
39292
|
+
while (keys.length) {
|
39293
|
+
var key = keys.pop();
|
39294
|
+
if (key in object) {
|
39295
|
+
next.value = key;
|
39296
|
+
next.done = false;
|
39297
|
+
return next;
|
39298
|
+
}
|
39299
|
+
}
|
39300
|
+
|
39301
|
+
// To avoid creating an additional object, we just hang the .value
|
39302
|
+
// and .done properties off the next function object itself. This
|
39303
|
+
// also ensures that the minifier will not anonymize the function.
|
39304
|
+
next.done = true;
|
39305
|
+
return next;
|
39306
|
+
};
|
39307
|
+
};
|
39308
|
+
|
39309
|
+
function values(iterable) {
|
39310
|
+
if (iterable) {
|
39311
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
39312
|
+
if (iteratorMethod) {
|
39313
|
+
return iteratorMethod.call(iterable);
|
39314
|
+
}
|
39315
|
+
|
39316
|
+
if (typeof iterable.next === "function") {
|
39317
|
+
return iterable;
|
39318
|
+
}
|
39319
|
+
|
39320
|
+
if (!isNaN(iterable.length)) {
|
39321
|
+
var i = -1, next = function next() {
|
39322
|
+
while (++i < iterable.length) {
|
39323
|
+
if (hasOwn.call(iterable, i)) {
|
39324
|
+
next.value = iterable[i];
|
39325
|
+
next.done = false;
|
39326
|
+
return next;
|
39327
|
+
}
|
39328
|
+
}
|
39329
|
+
|
39330
|
+
next.value = undefined;
|
39331
|
+
next.done = true;
|
39332
|
+
|
39333
|
+
return next;
|
39334
|
+
};
|
39335
|
+
|
39336
|
+
return next.next = next;
|
39337
|
+
}
|
39338
|
+
}
|
39339
|
+
|
39340
|
+
// Return an iterator with no values.
|
39341
|
+
return { next: doneResult };
|
39342
|
+
}
|
39343
|
+
exports.values = values;
|
39344
|
+
|
39345
|
+
function doneResult() {
|
39346
|
+
return { value: undefined, done: true };
|
39347
|
+
}
|
39348
|
+
|
39349
|
+
Context.prototype = {
|
39350
|
+
constructor: Context,
|
39351
|
+
|
39352
|
+
reset: function(skipTempReset) {
|
39353
|
+
this.prev = 0;
|
39354
|
+
this.next = 0;
|
39355
|
+
// Resetting context._sent for legacy support of Babel's
|
39356
|
+
// function.sent implementation.
|
39357
|
+
this.sent = this._sent = undefined;
|
39358
|
+
this.done = false;
|
39359
|
+
this.delegate = null;
|
39360
|
+
|
39361
|
+
this.method = "next";
|
39362
|
+
this.arg = undefined;
|
39363
|
+
|
39364
|
+
this.tryEntries.forEach(resetTryEntry);
|
39365
|
+
|
39366
|
+
if (!skipTempReset) {
|
39367
|
+
for (var name in this) {
|
39368
|
+
// Not sure about the optimal order of these conditions:
|
39369
|
+
if (name.charAt(0) === "t" &&
|
39370
|
+
hasOwn.call(this, name) &&
|
39371
|
+
!isNaN(+name.slice(1))) {
|
39372
|
+
this[name] = undefined;
|
39373
|
+
}
|
39374
|
+
}
|
39375
|
+
}
|
39376
|
+
},
|
39377
|
+
|
39378
|
+
stop: function() {
|
39379
|
+
this.done = true;
|
39380
|
+
|
39381
|
+
var rootEntry = this.tryEntries[0];
|
39382
|
+
var rootRecord = rootEntry.completion;
|
39383
|
+
if (rootRecord.type === "throw") {
|
39384
|
+
throw rootRecord.arg;
|
39385
|
+
}
|
39386
|
+
|
39387
|
+
return this.rval;
|
39388
|
+
},
|
39389
|
+
|
39390
|
+
dispatchException: function(exception) {
|
39391
|
+
if (this.done) {
|
39392
|
+
throw exception;
|
39393
|
+
}
|
39394
|
+
|
39395
|
+
var context = this;
|
39396
|
+
function handle(loc, caught) {
|
39397
|
+
record.type = "throw";
|
39398
|
+
record.arg = exception;
|
39399
|
+
context.next = loc;
|
39400
|
+
|
39401
|
+
if (caught) {
|
39402
|
+
// If the dispatched exception was caught by a catch block,
|
39403
|
+
// then let that catch block handle the exception normally.
|
39404
|
+
context.method = "next";
|
39405
|
+
context.arg = undefined;
|
39406
|
+
}
|
39407
|
+
|
39408
|
+
return !! caught;
|
39409
|
+
}
|
39410
|
+
|
39411
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
39412
|
+
var entry = this.tryEntries[i];
|
39413
|
+
var record = entry.completion;
|
39414
|
+
|
39415
|
+
if (entry.tryLoc === "root") {
|
39416
|
+
// Exception thrown outside of any try block that could handle
|
39417
|
+
// it, so set the completion value of the entire function to
|
39418
|
+
// throw the exception.
|
39419
|
+
return handle("end");
|
39420
|
+
}
|
39421
|
+
|
39422
|
+
if (entry.tryLoc <= this.prev) {
|
39423
|
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
39424
|
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
39425
|
+
|
39426
|
+
if (hasCatch && hasFinally) {
|
39427
|
+
if (this.prev < entry.catchLoc) {
|
39428
|
+
return handle(entry.catchLoc, true);
|
39429
|
+
} else if (this.prev < entry.finallyLoc) {
|
39430
|
+
return handle(entry.finallyLoc);
|
39431
|
+
}
|
39432
|
+
|
39433
|
+
} else if (hasCatch) {
|
39434
|
+
if (this.prev < entry.catchLoc) {
|
39435
|
+
return handle(entry.catchLoc, true);
|
39436
|
+
}
|
39437
|
+
|
39438
|
+
} else if (hasFinally) {
|
39439
|
+
if (this.prev < entry.finallyLoc) {
|
39440
|
+
return handle(entry.finallyLoc);
|
39441
|
+
}
|
39442
|
+
|
39443
|
+
} else {
|
39444
|
+
throw new Error("try statement without catch or finally");
|
39445
|
+
}
|
39446
|
+
}
|
39447
|
+
}
|
39448
|
+
},
|
39449
|
+
|
39450
|
+
abrupt: function(type, arg) {
|
39451
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
39452
|
+
var entry = this.tryEntries[i];
|
39453
|
+
if (entry.tryLoc <= this.prev &&
|
39454
|
+
hasOwn.call(entry, "finallyLoc") &&
|
39455
|
+
this.prev < entry.finallyLoc) {
|
39456
|
+
var finallyEntry = entry;
|
39457
|
+
break;
|
39458
|
+
}
|
39459
|
+
}
|
39460
|
+
|
39461
|
+
if (finallyEntry &&
|
39462
|
+
(type === "break" ||
|
39463
|
+
type === "continue") &&
|
39464
|
+
finallyEntry.tryLoc <= arg &&
|
39465
|
+
arg <= finallyEntry.finallyLoc) {
|
39466
|
+
// Ignore the finally entry if control is not jumping to a
|
39467
|
+
// location outside the try/catch block.
|
39468
|
+
finallyEntry = null;
|
39469
|
+
}
|
39470
|
+
|
39471
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
39472
|
+
record.type = type;
|
39473
|
+
record.arg = arg;
|
39474
|
+
|
39475
|
+
if (finallyEntry) {
|
39476
|
+
this.method = "next";
|
39477
|
+
this.next = finallyEntry.finallyLoc;
|
39478
|
+
return ContinueSentinel;
|
39479
|
+
}
|
39480
|
+
|
39481
|
+
return this.complete(record);
|
39482
|
+
},
|
39483
|
+
|
39484
|
+
complete: function(record, afterLoc) {
|
39485
|
+
if (record.type === "throw") {
|
39486
|
+
throw record.arg;
|
39487
|
+
}
|
39488
|
+
|
39489
|
+
if (record.type === "break" ||
|
39490
|
+
record.type === "continue") {
|
39491
|
+
this.next = record.arg;
|
39492
|
+
} else if (record.type === "return") {
|
39493
|
+
this.rval = this.arg = record.arg;
|
39494
|
+
this.method = "return";
|
39495
|
+
this.next = "end";
|
39496
|
+
} else if (record.type === "normal" && afterLoc) {
|
39497
|
+
this.next = afterLoc;
|
39498
|
+
}
|
39499
|
+
|
39500
|
+
return ContinueSentinel;
|
39501
|
+
},
|
39502
|
+
|
39503
|
+
finish: function(finallyLoc) {
|
39504
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
39505
|
+
var entry = this.tryEntries[i];
|
39506
|
+
if (entry.finallyLoc === finallyLoc) {
|
39507
|
+
this.complete(entry.completion, entry.afterLoc);
|
39508
|
+
resetTryEntry(entry);
|
39509
|
+
return ContinueSentinel;
|
39510
|
+
}
|
39511
|
+
}
|
39512
|
+
},
|
39513
|
+
|
39514
|
+
"catch": function(tryLoc) {
|
39515
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
39516
|
+
var entry = this.tryEntries[i];
|
39517
|
+
if (entry.tryLoc === tryLoc) {
|
39518
|
+
var record = entry.completion;
|
39519
|
+
if (record.type === "throw") {
|
39520
|
+
var thrown = record.arg;
|
39521
|
+
resetTryEntry(entry);
|
39522
|
+
}
|
39523
|
+
return thrown;
|
39524
|
+
}
|
39525
|
+
}
|
39526
|
+
|
39527
|
+
// The context.catch method must only be called with a location
|
39528
|
+
// argument that corresponds to a known catch block.
|
39529
|
+
throw new Error("illegal catch attempt");
|
39530
|
+
},
|
39531
|
+
|
39532
|
+
delegateYield: function(iterable, resultName, nextLoc) {
|
39533
|
+
this.delegate = {
|
39534
|
+
iterator: values(iterable),
|
39535
|
+
resultName: resultName,
|
39536
|
+
nextLoc: nextLoc
|
39537
|
+
};
|
39538
|
+
|
39539
|
+
if (this.method === "next") {
|
39540
|
+
// Deliberately forget the last sent value so that we don't
|
39541
|
+
// accidentally pass it on to the delegate.
|
39542
|
+
this.arg = undefined;
|
39543
|
+
}
|
39544
|
+
|
39545
|
+
return ContinueSentinel;
|
39546
|
+
}
|
39547
|
+
};
|
39548
|
+
|
39549
|
+
// Regardless of whether this script is executing as a CommonJS module
|
39550
|
+
// or not, return the runtime object so that we can declare the variable
|
39551
|
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
39552
|
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
39553
|
+
return exports;
|
39554
|
+
|
39555
|
+
}(
|
39556
|
+
// If this script is executing as a CommonJS module, use module.exports
|
39557
|
+
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
39558
|
+
// object. Either way, the resulting object will be used to initialize
|
39559
|
+
// the regeneratorRuntime variable at the top of this file.
|
39560
|
+
true ? module.exports : 0
|
39561
|
+
));
|
39562
|
+
|
39563
|
+
try {
|
39564
|
+
regeneratorRuntime = runtime;
|
39565
|
+
} catch (accidentalStrictMode) {
|
39566
|
+
// This module should not be running in strict mode, so the above
|
39567
|
+
// assignment should always work unless something is misconfigured. Just
|
39568
|
+
// in case runtime.js accidentally runs in strict mode, in modern engines
|
39569
|
+
// we can explicitly access globalThis. In older engines we can escape
|
39570
|
+
// strict mode using a global Function call. This could conceivably fail
|
39571
|
+
// if a Content Security Policy forbids using Function, but in that case
|
39572
|
+
// the proper solution is to fix the accidental strict mode problem. If
|
39573
|
+
// you've misconfigured your bundler to force strict mode and applied a
|
39574
|
+
// CSP to forbid Function, and you're not willing to fix either of those
|
39575
|
+
// problems, please detail your unique predicament in a GitHub issue.
|
39576
|
+
if (typeof globalThis === "object") {
|
39577
|
+
globalThis.regeneratorRuntime = runtime;
|
39578
|
+
} else {
|
39579
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
39580
|
+
}
|
39581
|
+
}
|
39582
|
+
|
39583
|
+
|
38743
39584
|
/***/ }),
|
38744
39585
|
|
38745
39586
|
/***/ 7928:
|
@@ -52382,6 +53223,49 @@ var Rotation = /*#__PURE__*/function (_Component) {
|
|
52382
53223
|
}(component);
|
52383
53224
|
|
52384
53225
|
/* harmony default export */ var rotation = (Rotation);
|
53226
|
+
// EXTERNAL MODULE: ../../node_modules/@babel/runtime-corejs3/core-js/promise.js
|
53227
|
+
var promise = __webpack_require__(7567);
|
53228
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime-corejs3/helpers/esm/asyncToGenerator.js
|
53229
|
+
|
53230
|
+
|
53231
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
53232
|
+
try {
|
53233
|
+
var info = gen[key](arg);
|
53234
|
+
var value = info.value;
|
53235
|
+
} catch (error) {
|
53236
|
+
reject(error);
|
53237
|
+
return;
|
53238
|
+
}
|
53239
|
+
|
53240
|
+
if (info.done) {
|
53241
|
+
resolve(value);
|
53242
|
+
} else {
|
53243
|
+
promise.resolve(value).then(_next, _throw);
|
53244
|
+
}
|
53245
|
+
}
|
53246
|
+
|
53247
|
+
function _asyncToGenerator(fn) {
|
53248
|
+
return function () {
|
53249
|
+
var self = this,
|
53250
|
+
args = arguments;
|
53251
|
+
return new promise(function (resolve, reject) {
|
53252
|
+
var gen = fn.apply(self, args);
|
53253
|
+
|
53254
|
+
function _next(value) {
|
53255
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
53256
|
+
}
|
53257
|
+
|
53258
|
+
function _throw(err) {
|
53259
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
53260
|
+
}
|
53261
|
+
|
53262
|
+
_next(undefined);
|
53263
|
+
});
|
53264
|
+
};
|
53265
|
+
}
|
53266
|
+
// EXTERNAL MODULE: ../../node_modules/@babel/runtime-corejs3/regenerator/index.js
|
53267
|
+
var regenerator = __webpack_require__(261);
|
53268
|
+
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
52385
53269
|
;// CONCATENATED MODULE: ./src/js/component/freeDrawing.js
|
52386
53270
|
|
52387
53271
|
|
@@ -52392,6 +53276,10 @@ var Rotation = /*#__PURE__*/function (_Component) {
|
|
52392
53276
|
|
52393
53277
|
|
52394
53278
|
|
53279
|
+
|
53280
|
+
|
53281
|
+
|
53282
|
+
|
52395
53283
|
function freeDrawing_createSuper(Derived) { var hasNativeReflectConstruct = freeDrawing_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct_default()(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
52396
53284
|
|
52397
53285
|
function freeDrawing_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !(construct_default())) return false; if ((construct_default()).sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct_default()(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
@@ -52435,8 +53323,13 @@ var FreeDrawing = /*#__PURE__*/function (_Component) {
|
|
52435
53323
|
_this._handlers = {
|
52436
53324
|
mousedown: bind_default()(_context = _this._onFabricMouseDown).call(_context, _assertThisInitialized(_this)),
|
52437
53325
|
mousemove: bind_default()(_context2 = _this._onFabricMouseMove).call(_context2, _assertThisInitialized(_this)),
|
52438
|
-
mouseup: bind_default()(_context3 = _this.
|
53326
|
+
mouseup: bind_default()(_context3 = _this._onMasikMouseUp).call(_context3, _assertThisInitialized(_this))
|
52439
53327
|
};
|
53328
|
+
/**
|
53329
|
+
* imageEditor instance
|
53330
|
+
*/
|
53331
|
+
|
53332
|
+
_this.imageEditor = null;
|
52440
53333
|
return _this;
|
52441
53334
|
}
|
52442
53335
|
/**
|
@@ -52450,10 +53343,11 @@ var FreeDrawing = /*#__PURE__*/function (_Component) {
|
|
52450
53343
|
value: function start(setting) {
|
52451
53344
|
console.log(setting);
|
52452
53345
|
|
52453
|
-
if (setting !== null && setting !== void 0 && setting.
|
52454
|
-
this.
|
53346
|
+
if (setting !== null && setting !== void 0 && setting.mosaic) {
|
53347
|
+
this.setMosaic(setting);
|
52455
53348
|
} else {
|
52456
53349
|
var canvas = this.getCanvas();
|
53350
|
+
console.log(canvas);
|
52457
53351
|
canvas.isDrawingMode = true;
|
52458
53352
|
this.setBrush(setting);
|
52459
53353
|
}
|
@@ -52490,12 +53384,14 @@ var FreeDrawing = /*#__PURE__*/function (_Component) {
|
|
52490
53384
|
canvas.off('mouse:down', this._handlers.mousedown);
|
52491
53385
|
}
|
52492
53386
|
/**
|
52493
|
-
* Set
|
53387
|
+
* Set mosaic
|
52494
53388
|
*/
|
52495
53389
|
|
52496
53390
|
}, {
|
52497
|
-
key: "
|
52498
|
-
value: function
|
53391
|
+
key: "setMosaic",
|
53392
|
+
value: function setMosaic(setting) {
|
53393
|
+
this.imageEditor = setting.imageEditor;
|
53394
|
+
this.width = setting.width;
|
52499
53395
|
var canvas = this.getCanvas();
|
52500
53396
|
canvas.selection = false;
|
52501
53397
|
canvas.on('mouse:down', this._handlers.mousedown);
|
@@ -52525,11 +53421,15 @@ var FreeDrawing = /*#__PURE__*/function (_Component) {
|
|
52525
53421
|
key: "_onFabricMouseMove",
|
52526
53422
|
value: function _onFabricMouseMove(fEvent) {
|
52527
53423
|
var canvas = this.getCanvas();
|
52528
|
-
var blockSize =
|
53424
|
+
var blockSize = this.width;
|
53425
|
+
var halfSize = this.width / 2; // 直接获取e中的x,y有问题
|
53426
|
+
|
52529
53427
|
var startPoints = canvas.getPointer(fEvent.e);
|
52530
|
-
|
52531
|
-
var
|
52532
|
-
|
53428
|
+
console.log(startPoints);
|
53429
|
+
var startX = startPoints.x - halfSize;
|
53430
|
+
console.log(startX);
|
53431
|
+
var startY = startPoints.y - halfSize;
|
53432
|
+
var ctx = canvas.contextContainer;
|
52533
53433
|
var imageData = ctx.getImageData(startX, startY, blockSize, blockSize);
|
52534
53434
|
var data = imageData.data;
|
52535
53435
|
var r = 0;
|
@@ -52561,14 +53461,50 @@ var FreeDrawing = /*#__PURE__*/function (_Component) {
|
|
52561
53461
|
*/
|
52562
53462
|
|
52563
53463
|
}, {
|
52564
|
-
key: "
|
52565
|
-
value: function
|
52566
|
-
var
|
52567
|
-
|
52568
|
-
|
52569
|
-
|
52570
|
-
|
52571
|
-
|
53464
|
+
key: "_onMasikMouseUp",
|
53465
|
+
value: function () {
|
53466
|
+
var _onMasikMouseUp2 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee() {
|
53467
|
+
var doms, _doms, domCanvas, dataURL, response, blob, imgUrl, canvas;
|
53468
|
+
|
53469
|
+
return regenerator_default().wrap(function _callee$(_context4) {
|
53470
|
+
while (1) {
|
53471
|
+
switch (_context4.prev = _context4.next) {
|
53472
|
+
case 0:
|
53473
|
+
doms = document.getElementsByClassName('lower-canvas');
|
53474
|
+
_doms = _slicedToArray(doms, 1), domCanvas = _doms[0];
|
53475
|
+
dataURL = domCanvas.toDataURL();
|
53476
|
+
_context4.next = 5;
|
53477
|
+
return fetch(dataURL);
|
53478
|
+
|
53479
|
+
case 5:
|
53480
|
+
response = _context4.sent;
|
53481
|
+
_context4.next = 8;
|
53482
|
+
return response.blob();
|
53483
|
+
|
53484
|
+
case 8:
|
53485
|
+
blob = _context4.sent;
|
53486
|
+
imgUrl = url_default().createObjectURL(blob);
|
53487
|
+
this.imageEditor.invoke('addImageObject', imgUrl);
|
53488
|
+
canvas = this.getCanvas();
|
53489
|
+
canvas.off({
|
53490
|
+
'mouse:move': this._handlers.mousemove,
|
53491
|
+
'mouse:up': this._handlers.mouseup
|
53492
|
+
});
|
53493
|
+
|
53494
|
+
case 13:
|
53495
|
+
case "end":
|
53496
|
+
return _context4.stop();
|
53497
|
+
}
|
53498
|
+
}
|
53499
|
+
}, _callee, this);
|
53500
|
+
}));
|
53501
|
+
|
53502
|
+
function _onMasikMouseUp() {
|
53503
|
+
return _onMasikMouseUp2.apply(this, arguments);
|
53504
|
+
}
|
53505
|
+
|
53506
|
+
return _onMasikMouseUp;
|
53507
|
+
}()
|
52572
53508
|
}]);
|
52573
53509
|
|
52574
53510
|
return FreeDrawing;
|
@@ -60079,6 +61015,15 @@ var ImageEditor = /*#__PURE__*/function () {
|
|
60079
61015
|
this._graphics.endHandMode();
|
60080
61016
|
}
|
60081
61017
|
}
|
61018
|
+
/**
|
61019
|
+
* get canvas image center
|
61020
|
+
*/
|
61021
|
+
|
61022
|
+
}, {
|
61023
|
+
key: "getCenterPoint",
|
61024
|
+
value: function getCenterPoint() {
|
61025
|
+
return this._graphics.canvasImage.getCenterPoint();
|
61026
|
+
}
|
60082
61027
|
/**
|
60083
61028
|
* Load image from file
|
60084
61029
|
* @param {File} imgFile - Image file
|