ngx-text-editor-angular
Version:
WYSIWYG Editor for Angular 2+
369 lines (354 loc) • 15.8 kB
JavaScript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{
/***/ "./node_modules/@ionic/core/dist/esm-es5/framework-delegate-c2e2e1f4.js":
/*!******************************************************************************!*\
!*** ./node_modules/@ionic/core/dist/esm-es5/framework-delegate-c2e2e1f4.js ***!
\******************************************************************************/
/*! exports provided: a, d */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
;
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return attachComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return detachComponent; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
var attachComponent = function (delegate, container, component, cssClasses, componentProps) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
var el;
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
switch (_a.label) {
case 0:
if (delegate) {
return [2 /*return*/, delegate.attachViewToDom(container, component, componentProps, cssClasses)];
}
if (typeof component !== 'string' && !(component instanceof HTMLElement)) {
throw new Error('framework delegate is missing');
}
el = (typeof component === 'string')
? container.ownerDocument && container.ownerDocument.createElement(component)
: component;
if (cssClasses) {
cssClasses.forEach(function (c) { return el.classList.add(c); });
}
if (componentProps) {
Object.assign(el, componentProps);
}
container.appendChild(el);
if (!el.componentOnReady) return [3 /*break*/, 2];
return [4 /*yield*/, el.componentOnReady()];
case 1:
_a.sent();
_a.label = 2;
case 2: return [2 /*return*/, el];
}
});
}); };
var detachComponent = function (delegate, element) {
if (element) {
if (delegate) {
var container = element.parentElement;
return delegate.removeViewFromDom(container, element);
}
element.remove();
}
return Promise.resolve();
};
/***/ }),
/***/ "./node_modules/@ionic/core/dist/esm-es5/index-6826f2f6.js":
/*!*****************************************************************!*\
!*** ./node_modules/@ionic/core/dist/esm-es5/index-6826f2f6.js ***!
\*****************************************************************/
/*! exports provided: d, g, l, s, t */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
;
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return deepReady; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getIonPageElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return lifecycle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return setPageHidden; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return transition; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _core_ca0488fc_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core-ca0488fc.js */ "./node_modules/@ionic/core/dist/esm-es5/core-ca0488fc.js");
/* harmony import */ var _constants_3c3e1099_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants-3c3e1099.js */ "./node_modules/@ionic/core/dist/esm-es5/constants-3c3e1099.js");
var iosTransitionAnimation = function () { return __webpack_require__.e(/*! import() | ios-transition-071bd421-js */ "ios-transition-071bd421-js").then(__webpack_require__.bind(null, /*! ./ios.transition-071bd421.js */ "./node_modules/@ionic/core/dist/esm-es5/ios.transition-071bd421.js")); };
var mdTransitionAnimation = function () { return __webpack_require__.e(/*! import() | md-transition-15a81b08-js */ "md-transition-15a81b08-js").then(__webpack_require__.bind(null, /*! ./md.transition-15a81b08.js */ "./node_modules/@ionic/core/dist/esm-es5/md.transition-15a81b08.js")); };
var transition = function (opts) {
return new Promise(function (resolve, reject) {
Object(_core_ca0488fc_js__WEBPACK_IMPORTED_MODULE_1__["w"])(function () {
beforeTransition(opts);
runTransition(opts).then(function (result) {
if (result.animation) {
result.animation.destroy();
}
afterTransition(opts);
resolve(result);
}, function (error) {
afterTransition(opts);
reject(error);
});
});
});
};
var beforeTransition = function (opts) {
var enteringEl = opts.enteringEl;
var leavingEl = opts.leavingEl;
setZIndex(enteringEl, leavingEl, opts.direction);
if (opts.showGoBack) {
enteringEl.classList.add('can-go-back');
}
else {
enteringEl.classList.remove('can-go-back');
}
setPageHidden(enteringEl, false);
if (leavingEl) {
setPageHidden(leavingEl, false);
}
};
var runTransition = function (opts) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
var animationBuilder, ani;
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, getAnimationBuilder(opts)];
case 1:
animationBuilder = _a.sent();
ani = (animationBuilder)
? animation(animationBuilder, opts)
: noAnimation(opts);
return [2 /*return*/, ani];
}
});
}); };
var afterTransition = function (opts) {
var enteringEl = opts.enteringEl;
var leavingEl = opts.leavingEl;
enteringEl.classList.remove('ion-page-invisible');
if (leavingEl !== undefined) {
leavingEl.classList.remove('ion-page-invisible');
}
};
var getAnimationBuilder = function (opts) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
var getAnimation, _a;
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_b) {
switch (_b.label) {
case 0:
if (!opts.leavingEl || !opts.animated || opts.duration === 0) {
return [2 /*return*/, undefined];
}
if (opts.animationBuilder) {
return [2 /*return*/, opts.animationBuilder];
}
if (!(opts.mode === 'ios')) return [3 /*break*/, 2];
return [4 /*yield*/, iosTransitionAnimation()];
case 1:
_a = (_b.sent()).iosTransitionAnimation;
return [3 /*break*/, 4];
case 2: return [4 /*yield*/, mdTransitionAnimation()];
case 3:
_a = (_b.sent()).mdTransitionAnimation;
_b.label = 4;
case 4:
getAnimation = _a;
return [2 /*return*/, getAnimation];
}
});
}); };
var animation = function (animationBuilder, opts) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
var trans, mod, err_1, didComplete;
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, waitForReady(opts, true)];
case 1:
_a.sent();
_a.label = 2;
case 2:
_a.trys.push([2, 5, , 6]);
return [4 /*yield*/, __webpack_require__.e(/*! import() | index-69c37885-js */ "index-69c37885-js").then(__webpack_require__.bind(null, /*! ./index-69c37885.js */ "./node_modules/@ionic/core/dist/esm-es5/index-69c37885.js"))];
case 3:
mod = _a.sent();
return [4 /*yield*/, mod.create(animationBuilder, opts.baseEl, opts)];
case 4:
trans = _a.sent();
return [3 /*break*/, 6];
case 5:
err_1 = _a.sent();
trans = animationBuilder(opts.baseEl, opts);
return [3 /*break*/, 6];
case 6:
fireWillEvents(opts.enteringEl, opts.leavingEl);
return [4 /*yield*/, playTransition(trans, opts)];
case 7:
didComplete = _a.sent();
if (opts.progressCallback) {
opts.progressCallback(undefined);
}
if (didComplete) {
fireDidEvents(opts.enteringEl, opts.leavingEl);
}
return [2 /*return*/, {
hasCompleted: didComplete,
animation: trans
}];
}
});
}); };
var noAnimation = function (opts) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
var enteringEl, leavingEl;
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
switch (_a.label) {
case 0:
enteringEl = opts.enteringEl;
leavingEl = opts.leavingEl;
return [4 /*yield*/, waitForReady(opts, false)];
case 1:
_a.sent();
fireWillEvents(enteringEl, leavingEl);
fireDidEvents(enteringEl, leavingEl);
return [2 /*return*/, {
hasCompleted: true
}];
}
});
}); };
var waitForReady = function (opts, defaultDeep) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
var deep, promises;
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
switch (_a.label) {
case 0:
deep = opts.deepWait !== undefined ? opts.deepWait : defaultDeep;
promises = deep ? [
deepReady(opts.enteringEl),
deepReady(opts.leavingEl),
] : [
shallowReady(opts.enteringEl),
shallowReady(opts.leavingEl),
];
return [4 /*yield*/, Promise.all(promises)];
case 1:
_a.sent();
return [4 /*yield*/, notifyViewReady(opts.viewIsReady, opts.enteringEl)];
case 2:
_a.sent();
return [2 /*return*/];
}
});
}); };
var notifyViewReady = function (viewIsReady, enteringEl) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
switch (_a.label) {
case 0:
if (!viewIsReady) return [3 /*break*/, 2];
return [4 /*yield*/, viewIsReady(enteringEl)];
case 1:
_a.sent();
_a.label = 2;
case 2: return [2 /*return*/];
}
});
}); };
var playTransition = function (trans, opts) {
var progressCallback = opts.progressCallback;
// TODO: Remove AnimationBuilder
var promise = new Promise(function (resolve) {
trans.onFinish(function (currentStep) {
if (typeof currentStep === 'number') {
resolve(currentStep === 1);
}
else if (trans.hasCompleted !== undefined) {
resolve(trans.hasCompleted);
}
});
});
// cool, let's do this, start the transition
if (progressCallback) {
// this is a swipe to go back, just get the transition progress ready
// kick off the swipe animation start
trans.progressStart(true);
progressCallback(trans);
}
else {
// only the top level transition should actually start "play"
// kick it off and let it play through
// ******** DOM WRITE ****************
trans.play();
}
// create a callback for when the animation is done
return promise;
};
var fireWillEvents = function (enteringEl, leavingEl) {
lifecycle(leavingEl, _constants_3c3e1099_js__WEBPACK_IMPORTED_MODULE_2__["b"]);
lifecycle(enteringEl, _constants_3c3e1099_js__WEBPACK_IMPORTED_MODULE_2__["L"]);
};
var fireDidEvents = function (enteringEl, leavingEl) {
lifecycle(enteringEl, _constants_3c3e1099_js__WEBPACK_IMPORTED_MODULE_2__["a"]);
lifecycle(leavingEl, _constants_3c3e1099_js__WEBPACK_IMPORTED_MODULE_2__["c"]);
};
var lifecycle = function (el, eventName) {
if (el) {
var ev = new CustomEvent(eventName, {
bubbles: false,
cancelable: false,
});
el.dispatchEvent(ev);
}
};
var shallowReady = function (el) {
if (el && el.componentOnReady) {
return el.componentOnReady();
}
return Promise.resolve();
};
var deepReady = function (el) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
var element, stencilEl;
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
switch (_a.label) {
case 0:
element = el;
if (!element) return [3 /*break*/, 4];
if (!(element.componentOnReady != null)) return [3 /*break*/, 2];
return [4 /*yield*/, element.componentOnReady()];
case 1:
stencilEl = _a.sent();
if (stencilEl != null) {
return [2 /*return*/];
}
_a.label = 2;
case 2: return [4 /*yield*/, Promise.all(Array.from(element.children).map(deepReady))];
case 3:
_a.sent();
_a.label = 4;
case 4: return [2 /*return*/];
}
});
}); };
var setPageHidden = function (el, hidden) {
if (hidden) {
el.setAttribute('aria-hidden', 'true');
el.classList.add('ion-page-hidden');
}
else {
el.hidden = false;
el.removeAttribute('aria-hidden');
el.classList.remove('ion-page-hidden');
}
};
var setZIndex = function (enteringEl, leavingEl, direction) {
if (enteringEl !== undefined) {
enteringEl.style.zIndex = (direction === 'back')
? '99'
: '101';
}
if (leavingEl !== undefined) {
leavingEl.style.zIndex = '100';
}
};
var getIonPageElement = function (element) {
if (element.classList.contains('ion-page')) {
return element;
}
var ionPage = element.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs');
if (ionPage) {
return ionPage;
}
// idk, return the original element so at least something animates and we don't have a null pointer
return element;
};
/***/ })
}]);
//# sourceMappingURL=0.js.map