@digipair/skill-web-editor 0.8.12 → 0.8.14

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/index.cjs2.js CHANGED
@@ -84,7 +84,7 @@ var n$3 = /*#__PURE__*/ function() {
84
84
  ]);
85
85
  return n;
86
86
  }();
87
- var r$5 = function(t) {
87
+ var r$4 = function(t) {
88
88
  return new n$3("string" == typeof t ? t : t + "", void 0, s$2);
89
89
  }, S$1 = function(s, o) {
90
90
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
@@ -136,7 +136,7 @@ var r$5 = function(t) {
136
136
  }
137
137
  }
138
138
  }
139
- return r$5(e);
139
+ return r$4(e);
140
140
  }(t) : t;
141
141
  };
142
142
 
@@ -458,7 +458,7 @@ var _Symbol, _a, _a1;
458
458
  * @license
459
459
  * Copyright 2017 Google LLC
460
460
  * SPDX-License-Identifier: BSD-3-Clause
461
- */ var i$1 = Object.is, e$1 = Object.defineProperty, r$4 = Object.getOwnPropertyDescriptor, h$1 = Object.getOwnPropertyNames, o$2 = Object.getOwnPropertySymbols, n$2 = Object.getPrototypeOf, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = function(t, s) {
461
+ */ var i$1 = Object.is, e$1 = Object.defineProperty, r$3 = Object.getOwnPropertyDescriptor, h$1 = Object.getOwnPropertyNames, o$2 = Object.getOwnPropertySymbols, n$2 = Object.getPrototypeOf, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = function(t, s) {
462
462
  return t;
463
463
  }, u$1 = {
464
464
  toAttribute: function toAttribute(t, s) {
@@ -860,7 +860,7 @@ var b = /*#__PURE__*/ function(HTMLElement1) {
860
860
  key: "getPropertyDescriptor",
861
861
  value: function getPropertyDescriptor(t, s, i) {
862
862
  var _r;
863
- var _ref = (_r = r$4(this.prototype, t)) !== null && _r !== void 0 ? _r : {
863
+ var _ref = (_r = r$3(this.prototype, t)) !== null && _r !== void 0 ? _r : {
864
864
  get: function get() {
865
865
  return this[s];
866
866
  },
@@ -1171,8 +1171,8 @@ var t$1 = globalThis, i = t$1.trustedTypes, s$1 = i ? i.createPolicy("lit-html",
1171
1171
  createHTML: function(t) {
1172
1172
  return t;
1173
1173
  }
1174
- }) : void 0, e = "$lit$", h = "lit$".concat((Math.random() + "").slice(9), "$"), o$1 = "?" + h, n$1 = "<".concat(o$1, ">"), r$3 = document, l = function() {
1175
- return r$3.createComment("");
1174
+ }) : void 0, e = "$lit$", h = "lit$".concat((Math.random() + "").slice(9), "$"), o$1 = "?" + h, n$1 = "<".concat(o$1, ">"), r$2 = document, l = function() {
1175
+ return r$2.createComment("");
1176
1176
  }, c = function(t) {
1177
1177
  return null === t || "object" != typeof t && "function" != typeof t;
1178
1178
  }, a = Array.isArray, u = function(t) {
@@ -1188,7 +1188,7 @@ var t$1 = globalThis, i = t$1.trustedTypes, s$1 = i ? i.createPolicy("lit-html",
1188
1188
  values: s
1189
1189
  };
1190
1190
  };
1191
- }, x = y(1), w = Symbol.for("lit-noChange"), T = Symbol.for("lit-nothing"), A = new WeakMap, E = r$3.createTreeWalker(r$3, 129);
1191
+ }, x = y(1), w = Symbol.for("lit-noChange"), T = Symbol.for("lit-nothing"), A = new WeakMap, E = r$2.createTreeWalker(r$2, 129);
1192
1192
  function C(t, i) {
1193
1193
  if (!Array.isArray(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
1194
1194
  return void 0 !== s$1 ? s$1.createHTML(i) : i;
@@ -1284,7 +1284,7 @@ var V = /*#__PURE__*/ function() {
1284
1284
  {
1285
1285
  key: "createElement",
1286
1286
  value: function createElement(t, i) {
1287
- var s = r$3.createElement("template");
1287
+ var s = r$2.createElement("template");
1288
1288
  return s.innerHTML = t, s;
1289
1289
  }
1290
1290
  }
@@ -1323,7 +1323,7 @@ var S = /*#__PURE__*/ function() {
1323
1323
  key: "u",
1324
1324
  value: function u(t) {
1325
1325
  var _t_creationScope;
1326
- var _this__$AD = this._$AD, _this__$AD_el = _this__$AD.el, i = _this__$AD_el.content, s = _this__$AD.parts, e = ((_t_creationScope = t === null || t === void 0 ? void 0 : t.creationScope) !== null && _t_creationScope !== void 0 ? _t_creationScope : r$3).importNode(i, !0);
1326
+ var _this__$AD = this._$AD, _this__$AD_el = _this__$AD.el, i = _this__$AD_el.content, s = _this__$AD.parts, e = ((_t_creationScope = t === null || t === void 0 ? void 0 : t.creationScope) !== null && _t_creationScope !== void 0 ? _t_creationScope : r$2).importNode(i, !0);
1327
1327
  E.currentNode = e;
1328
1328
  var h = E.nextNode(), o = 0, n = 0, l = s[0];
1329
1329
  for(; void 0 !== l;){
@@ -1333,7 +1333,7 @@ var S = /*#__PURE__*/ function() {
1333
1333
  }
1334
1334
  o !== (l === null || l === void 0 ? void 0 : l.index) && (h = E.nextNode(), o++);
1335
1335
  }
1336
- return E.currentNode = r$3, e;
1336
+ return E.currentNode = r$2, e;
1337
1337
  }
1338
1338
  },
1339
1339
  {
@@ -1422,7 +1422,7 @@ var M = /*#__PURE__*/ function() {
1422
1422
  {
1423
1423
  key: "_",
1424
1424
  value: function _(t) {
1425
- this._$AH !== T && c(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r$3.createTextNode(t)), this._$AH = t;
1425
+ this._$AH !== T && c(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r$2.createTextNode(t)), this._$AH = t;
1426
1426
  }
1427
1427
  },
1428
1428
  {
@@ -1815,8 +1815,8 @@ var _globalThis1;
1815
1815
  s._$litElement$ = !0, s["finalized"] = !0, (_globalThis_litElementHydrateSupport = (_globalThis = globalThis).litElementHydrateSupport) === null || _globalThis_litElementHydrateSupport === void 0 ? void 0 : _globalThis_litElementHydrateSupport.call(_globalThis, {
1816
1816
  LitElement: s
1817
1817
  });
1818
- var r$2 = globalThis.litElementPolyfillSupport;
1819
- r$2 === null || r$2 === void 0 ? void 0 : r$2({
1818
+ var r$1 = globalThis.litElementPolyfillSupport;
1819
+ r$1 === null || r$1 === void 0 ? void 0 : r$1({
1820
1820
  LitElement: s
1821
1821
  });
1822
1822
  var _litElementVersions;
@@ -1834,7 +1834,7 @@ var _litElementVersions;
1834
1834
  };
1835
1835
  };
1836
1836
 
1837
- function _define_property$1(obj, key, value) {
1837
+ function _define_property(obj, key, value) {
1838
1838
  if (key in obj) {
1839
1839
  Object.defineProperty(obj, key, {
1840
1840
  value: value,
@@ -1847,7 +1847,7 @@ function _define_property$1(obj, key, value) {
1847
1847
  }
1848
1848
  return obj;
1849
1849
  }
1850
- function _object_spread$1(target) {
1850
+ function _object_spread(target) {
1851
1851
  for(var i = 1; i < arguments.length; i++){
1852
1852
  var source = arguments[i] != null ? arguments[i] : {};
1853
1853
  var ownKeys = Object.keys(source);
@@ -1857,12 +1857,12 @@ function _object_spread$1(target) {
1857
1857
  }));
1858
1858
  }
1859
1859
  ownKeys.forEach(function(key) {
1860
- _define_property$1(target, key, source[key]);
1860
+ _define_property(target, key, source[key]);
1861
1861
  });
1862
1862
  }
1863
1863
  return target;
1864
1864
  }
1865
- function ownKeys$1(object, enumerableOnly) {
1865
+ function ownKeys(object, enumerableOnly) {
1866
1866
  var keys = Object.keys(object);
1867
1867
  if (Object.getOwnPropertySymbols) {
1868
1868
  var symbols = Object.getOwnPropertySymbols(object);
@@ -1875,12 +1875,12 @@ function ownKeys$1(object, enumerableOnly) {
1875
1875
  }
1876
1876
  return keys;
1877
1877
  }
1878
- function _object_spread_props$1(target, source) {
1878
+ function _object_spread_props(target, source) {
1879
1879
  source = source != null ? source : {};
1880
1880
  if (Object.getOwnPropertyDescriptors) {
1881
1881
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1882
1882
  } else {
1883
- ownKeys$1(Object(source)).forEach(function(key) {
1883
+ ownKeys(Object(source)).forEach(function(key) {
1884
1884
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1885
1885
  });
1886
1886
  }
@@ -1896,7 +1896,7 @@ function _object_spread_props$1(target, source) {
1896
1896
  converter: u$1,
1897
1897
  reflect: !1,
1898
1898
  hasChanged: f$1
1899
- }, r$1 = function() {
1899
+ }, r = function() {
1900
1900
  var _$t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : o, _$e = arguments.length > 1 ? arguments[1] : void 0, r = arguments.length > 2 ? arguments[2] : void 0;
1901
1901
  var n = r.kind, i = r.metadata;
1902
1902
  var s = globalThis.litPropertyMetadata.get(i);
@@ -1923,447 +1923,15 @@ function _object_spread_props$1(target, source) {
1923
1923
  };
1924
1924
  function n(t) {
1925
1925
  return function(e, o) {
1926
- return "object" == typeof o ? r$1(t, e, o) : function(t, e, o) {
1926
+ return "object" == typeof o ? r(t, e, o) : function(t, e, o) {
1927
1927
  var r = e.hasOwnProperty(o);
1928
- return e.constructor.createProperty(o, r ? _object_spread_props$1(_object_spread$1({}, t), {
1928
+ return e.constructor.createProperty(o, r ? _object_spread_props(_object_spread({}, t), {
1929
1929
  wrapped: !0
1930
1930
  }) : t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
1931
1931
  }(t, e, o);
1932
1932
  };
1933
1933
  }
1934
1934
 
1935
- function _define_property(obj, key, value) {
1936
- if (key in obj) {
1937
- Object.defineProperty(obj, key, {
1938
- value: value,
1939
- enumerable: true,
1940
- configurable: true,
1941
- writable: true
1942
- });
1943
- } else {
1944
- obj[key] = value;
1945
- }
1946
- return obj;
1947
- }
1948
- function _object_spread(target) {
1949
- for(var i = 1; i < arguments.length; i++){
1950
- var source = arguments[i] != null ? arguments[i] : {};
1951
- var ownKeys = Object.keys(source);
1952
- if (typeof Object.getOwnPropertySymbols === "function") {
1953
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1954
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1955
- }));
1956
- }
1957
- ownKeys.forEach(function(key) {
1958
- _define_property(target, key, source[key]);
1959
- });
1960
- }
1961
- return target;
1962
- }
1963
- function ownKeys(object, enumerableOnly) {
1964
- var keys = Object.keys(object);
1965
- if (Object.getOwnPropertySymbols) {
1966
- var symbols = Object.getOwnPropertySymbols(object);
1967
- if (enumerableOnly) {
1968
- symbols = symbols.filter(function(sym) {
1969
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1970
- });
1971
- }
1972
- keys.push.apply(keys, symbols);
1973
- }
1974
- return keys;
1975
- }
1976
- function _object_spread_props(target, source) {
1977
- source = source != null ? source : {};
1978
- if (Object.getOwnPropertyDescriptors) {
1979
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1980
- } else {
1981
- ownKeys(Object(source)).forEach(function(key) {
1982
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1983
- });
1984
- }
1985
- return target;
1986
- }
1987
- /**
1988
- * @license
1989
- * Copyright 2017 Google LLC
1990
- * SPDX-License-Identifier: BSD-3-Clause
1991
- */ function r(r) {
1992
- return n(_object_spread_props(_object_spread({}, r), {
1993
- state: !0,
1994
- attribute: !1
1995
- }));
1996
- }
1997
-
1998
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1999
-
2000
- var toastify$1 = {
2001
- exports: {}
2002
- };
2003
-
2004
- (function (module) {
2005
- function _instanceof(left, right) {
2006
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
2007
- return !!right[Symbol.hasInstance](left);
2008
- } else {
2009
- return left instanceof right;
2010
- }
2011
- }
2012
- /*!
2013
- * Toastify js 1.12.0
2014
- * https://github.com/apvarun/toastify-js
2015
- * @license MIT licensed
2016
- *
2017
- * Copyright (C) 2018 Varun A P
2018
- */ (function(root, factory) {
2019
- if (module.exports) {
2020
- module.exports = factory();
2021
- } else {
2022
- root.Toastify = factory();
2023
- }
2024
- })(commonjsGlobal, function(global) {
2025
- // Object initialization
2026
- var Toastify = function Toastify1(options) {
2027
- // Returning a new init object
2028
- return new Toastify.lib.init(options);
2029
- }, // Library version
2030
- version = "1.12.0";
2031
- // Set the default global options
2032
- Toastify.defaults = {
2033
- oldestFirst: true,
2034
- text: "Toastify is awesome!",
2035
- node: undefined,
2036
- duration: 3000,
2037
- selector: undefined,
2038
- callback: function callback() {},
2039
- destination: undefined,
2040
- newWindow: false,
2041
- close: false,
2042
- gravity: "toastify-top",
2043
- positionLeft: false,
2044
- position: "",
2045
- backgroundColor: "",
2046
- avatar: "",
2047
- className: "",
2048
- stopOnFocus: true,
2049
- onClick: function onClick() {},
2050
- offset: {
2051
- x: 0,
2052
- y: 0
2053
- },
2054
- escapeMarkup: true,
2055
- ariaLive: "polite",
2056
- style: {
2057
- background: ""
2058
- }
2059
- };
2060
- // Defining the prototype of the object
2061
- Toastify.lib = Toastify.prototype = {
2062
- toastify: version,
2063
- constructor: Toastify,
2064
- // Initializing the object with required parameters
2065
- init: function init(options) {
2066
- // Verifying and validating the input object
2067
- if (!options) {
2068
- options = {};
2069
- }
2070
- // Creating the options object
2071
- this.options = {};
2072
- this.toastElement = null;
2073
- // Validating the options
2074
- this.options.text = options.text || Toastify.defaults.text; // Display message
2075
- this.options.node = options.node || Toastify.defaults.node; // Display content as node
2076
- this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration
2077
- this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector
2078
- this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display
2079
- this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination
2080
- this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window
2081
- this.options.close = options.close || Toastify.defaults.close; // Show toast close icon
2082
- this.options.gravity = options.gravity === "bottom" ? "toastify-bottom" : Toastify.defaults.gravity; // toast position - top or bottom
2083
- this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right
2084
- this.options.position = options.position || Toastify.defaults.position; // toast position - left or right
2085
- this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color
2086
- this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path
2087
- this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast
2088
- this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus
2089
- this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click
2090
- this.options.offset = options.offset || Toastify.defaults.offset; // toast offset
2091
- this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;
2092
- this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;
2093
- this.options.style = options.style || Toastify.defaults.style;
2094
- if (options.backgroundColor) {
2095
- this.options.style.background = options.backgroundColor;
2096
- }
2097
- // Returning the current object for chaining functions
2098
- return this;
2099
- },
2100
- // Building the DOM element
2101
- buildToast: function buildToast() {
2102
- // Validating if the options are defined
2103
- if (!this.options) {
2104
- throw "Toastify is not initialized";
2105
- }
2106
- // Creating the DOM object
2107
- var divElement = document.createElement("div");
2108
- divElement.className = "toastify on " + this.options.className;
2109
- // Positioning toast to left or right or center
2110
- if (!!this.options.position) {
2111
- divElement.className += " toastify-" + this.options.position;
2112
- } else {
2113
- // To be depreciated in further versions
2114
- if (this.options.positionLeft === true) {
2115
- divElement.className += " toastify-left";
2116
- console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.");
2117
- } else {
2118
- // Default position
2119
- divElement.className += " toastify-right";
2120
- }
2121
- }
2122
- // Assigning gravity of element
2123
- divElement.className += " " + this.options.gravity;
2124
- if (this.options.backgroundColor) {
2125
- // This is being deprecated in favor of using the style HTML DOM property
2126
- console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');
2127
- }
2128
- // Loop through our style object and apply styles to divElement
2129
- for(var property in this.options.style){
2130
- divElement.style[property] = this.options.style[property];
2131
- }
2132
- // Announce the toast to screen readers
2133
- if (this.options.ariaLive) {
2134
- divElement.setAttribute("aria-live", this.options.ariaLive);
2135
- }
2136
- // Adding the toast message/node
2137
- if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {
2138
- // If we have a valid node, we insert it
2139
- divElement.appendChild(this.options.node);
2140
- } else {
2141
- if (this.options.escapeMarkup) {
2142
- divElement.innerText = this.options.text;
2143
- } else {
2144
- divElement.innerHTML = this.options.text;
2145
- }
2146
- if (this.options.avatar !== "") {
2147
- var avatarElement = document.createElement("img");
2148
- avatarElement.src = this.options.avatar;
2149
- avatarElement.className = "toastify-avatar";
2150
- if (this.options.position == "left" || this.options.positionLeft === true) {
2151
- // Adding close icon on the left of content
2152
- divElement.appendChild(avatarElement);
2153
- } else {
2154
- // Adding close icon on the right of content
2155
- divElement.insertAdjacentElement("afterbegin", avatarElement);
2156
- }
2157
- }
2158
- }
2159
- // Adding a close icon to the toast
2160
- if (this.options.close === true) {
2161
- // Create a span for close element
2162
- var closeElement = document.createElement("button");
2163
- closeElement.type = "button";
2164
- closeElement.setAttribute("aria-label", "Close");
2165
- closeElement.className = "toast-close";
2166
- closeElement.innerHTML = "&#10006;";
2167
- // Triggering the removal of toast from DOM on close click
2168
- closeElement.addEventListener("click", (function(event) {
2169
- event.stopPropagation();
2170
- this.removeElement(this.toastElement);
2171
- window.clearTimeout(this.toastElement.timeOutValue);
2172
- }).bind(this));
2173
- //Calculating screen width
2174
- var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
2175
- // Adding the close icon to the toast element
2176
- // Display on the right if screen width is less than or equal to 360px
2177
- if ((this.options.position == "left" || this.options.positionLeft === true) && width > 360) {
2178
- // Adding close icon on the left of content
2179
- divElement.insertAdjacentElement("afterbegin", closeElement);
2180
- } else {
2181
- // Adding close icon on the right of content
2182
- divElement.appendChild(closeElement);
2183
- }
2184
- }
2185
- // Clear timeout while toast is focused
2186
- if (this.options.stopOnFocus && this.options.duration > 0) {
2187
- var self = this;
2188
- // stop countdown
2189
- divElement.addEventListener("mouseover", function(event) {
2190
- window.clearTimeout(divElement.timeOutValue);
2191
- });
2192
- // add back the timeout
2193
- divElement.addEventListener("mouseleave", function() {
2194
- divElement.timeOutValue = window.setTimeout(function() {
2195
- // Remove the toast from DOM
2196
- self.removeElement(divElement);
2197
- }, self.options.duration);
2198
- });
2199
- }
2200
- // Adding an on-click destination path
2201
- if (typeof this.options.destination !== "undefined") {
2202
- divElement.addEventListener("click", (function(event) {
2203
- event.stopPropagation();
2204
- if (this.options.newWindow === true) {
2205
- window.open(this.options.destination, "_blank");
2206
- } else {
2207
- window.location = this.options.destination;
2208
- }
2209
- }).bind(this));
2210
- }
2211
- if (typeof this.options.onClick === "function" && typeof this.options.destination === "undefined") {
2212
- divElement.addEventListener("click", (function(event) {
2213
- event.stopPropagation();
2214
- this.options.onClick();
2215
- }).bind(this));
2216
- }
2217
- // Adding offset
2218
- if (typeof this.options.offset === "object") {
2219
- var x = getAxisOffsetAValue("x", this.options);
2220
- var y = getAxisOffsetAValue("y", this.options);
2221
- var xOffset = this.options.position == "left" ? x : "-" + x;
2222
- var yOffset = this.options.gravity == "toastify-top" ? y : "-" + y;
2223
- divElement.style.transform = "translate(" + xOffset + "," + yOffset + ")";
2224
- }
2225
- // Returning the generated element
2226
- return divElement;
2227
- },
2228
- // Displaying the toast
2229
- showToast: function showToast() {
2230
- // Creating the DOM object for the toast
2231
- this.toastElement = this.buildToast();
2232
- // Getting the root element to with the toast needs to be added
2233
- var rootElement;
2234
- if (typeof this.options.selector === "string") {
2235
- rootElement = document.getElementById(this.options.selector);
2236
- } else if (_instanceof(this.options.selector, HTMLElement) || typeof ShadowRoot !== "undefined" && _instanceof(this.options.selector, ShadowRoot)) {
2237
- rootElement = this.options.selector;
2238
- } else {
2239
- rootElement = document.body;
2240
- }
2241
- // Validating if root element is present in DOM
2242
- if (!rootElement) {
2243
- throw "Root element is not defined";
2244
- }
2245
- // Adding the DOM element
2246
- var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;
2247
- rootElement.insertBefore(this.toastElement, elementToInsert);
2248
- // Repositioning the toasts in case multiple toasts are present
2249
- Toastify.reposition();
2250
- if (this.options.duration > 0) {
2251
- this.toastElement.timeOutValue = window.setTimeout((function() {
2252
- // Remove the toast from DOM
2253
- this.removeElement(this.toastElement);
2254
- }).bind(this), this.options.duration); // Binding `this` for function invocation
2255
- }
2256
- // Supporting function chaining
2257
- return this;
2258
- },
2259
- hideToast: function hideToast() {
2260
- if (this.toastElement.timeOutValue) {
2261
- clearTimeout(this.toastElement.timeOutValue);
2262
- }
2263
- this.removeElement(this.toastElement);
2264
- },
2265
- // Removing the element from the DOM
2266
- removeElement: function removeElement(toastElement) {
2267
- // Hiding the element
2268
- // toastElement.classList.remove("on");
2269
- toastElement.className = toastElement.className.replace(" on", "");
2270
- // Removing the element from DOM after transition end
2271
- window.setTimeout((function() {
2272
- // remove options node if any
2273
- if (this.options.node && this.options.node.parentNode) {
2274
- this.options.node.parentNode.removeChild(this.options.node);
2275
- }
2276
- // Remove the element from the DOM, only when the parent node was not removed before.
2277
- if (toastElement.parentNode) {
2278
- toastElement.parentNode.removeChild(toastElement);
2279
- }
2280
- // Calling the callback function
2281
- this.options.callback.call(toastElement);
2282
- // Repositioning the toasts again
2283
- Toastify.reposition();
2284
- }).bind(this), 400); // Binding `this` for function invocation
2285
- }
2286
- };
2287
- // Positioning the toasts on the DOM
2288
- Toastify.reposition = function() {
2289
- // Top margins with gravity
2290
- var topLeftOffsetSize = {
2291
- top: 15,
2292
- bottom: 15
2293
- };
2294
- var topRightOffsetSize = {
2295
- top: 15,
2296
- bottom: 15
2297
- };
2298
- var offsetSize = {
2299
- top: 15,
2300
- bottom: 15
2301
- };
2302
- // Get all toast messages on the DOM
2303
- var allToasts = document.getElementsByClassName("toastify");
2304
- var classUsed;
2305
- // Modifying the position of each toast element
2306
- for(var i = 0; i < allToasts.length; i++){
2307
- // Getting the applied gravity
2308
- if (containsClass(allToasts[i], "toastify-top") === true) {
2309
- classUsed = "toastify-top";
2310
- } else {
2311
- classUsed = "toastify-bottom";
2312
- }
2313
- var height = allToasts[i].offsetHeight;
2314
- classUsed = classUsed.substr(9, classUsed.length - 1);
2315
- // Spacing between toasts
2316
- var offset = 15;
2317
- var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
2318
- // Show toast in center if screen with less than or equal to 360px
2319
- if (width <= 360) {
2320
- // Setting the position
2321
- allToasts[i].style[classUsed] = offsetSize[classUsed] + "px";
2322
- offsetSize[classUsed] += height + offset;
2323
- } else {
2324
- if (containsClass(allToasts[i], "toastify-left") === true) {
2325
- // Setting the position
2326
- allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + "px";
2327
- topLeftOffsetSize[classUsed] += height + offset;
2328
- } else {
2329
- // Setting the position
2330
- allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + "px";
2331
- topRightOffsetSize[classUsed] += height + offset;
2332
- }
2333
- }
2334
- }
2335
- // Supporting function chaining
2336
- return this;
2337
- };
2338
- // Helper function to get offset.
2339
- function getAxisOffsetAValue(axis, options) {
2340
- if (options.offset[axis]) {
2341
- if (isNaN(options.offset[axis])) {
2342
- return options.offset[axis];
2343
- } else {
2344
- return options.offset[axis] + "px";
2345
- }
2346
- }
2347
- return "0px";
2348
- }
2349
- function containsClass(elem, yourClass) {
2350
- if (!elem || typeof yourClass !== "string") {
2351
- return false;
2352
- } else if (elem.className && elem.className.trim().split(/\s+/gi).indexOf(yourClass) > -1) {
2353
- return true;
2354
- } else {
2355
- return false;
2356
- }
2357
- }
2358
- // Setting up the prototype for the init object
2359
- Toastify.lib.init.prototype = Toastify.lib;
2360
- // Returning the Toastify function to be assigned to the window object/module
2361
- return Toastify;
2362
- });
2363
- }(toastify$1));
2364
-
2365
- var toastify = toastify$1.exports;
2366
-
2367
1935
  const blocksLegacy = [
2368
1936
  {
2369
1937
  type: 'object',
@@ -3076,7 +2644,6 @@ const schemas = {
3076
2644
  'x-scene-blocks': {}
3077
2645
  };
3078
2646
 
3079
- const Toastify$1 = toastify;
3080
2647
  const BASE_URL = 'https://cdn.jsdelivr.net/npm';
3081
2648
  const BLOCKLY_VERSION = '10.4.3';
3082
2649
  let jsonGenerator, generateBlocklyBlockFromLibraries, generateToolboxFromLibraries, initializeMutator;
@@ -3089,11 +2656,6 @@ class EditorElement extends s {
3089
2656
  this.initialize();
3090
2657
  }
3091
2658
  async initialize() {
3092
- const link = document.createElement('link');
3093
- link.rel = 'stylesheet';
3094
- link.href = `${BASE_URL}/toastify-js/src/toastify.min.css`;
3095
- link.type = 'text/css';
3096
- document.head.appendChild(link);
3097
2659
  let script, promise;
3098
2660
  script = document.createElement('script');
3099
2661
  script.src = `${BASE_URL}/blockly@${BLOCKLY_VERSION}/blockly_compressed.js`;
@@ -3158,27 +2720,6 @@ class EditorElement extends s {
3158
2720
  return false;
3159
2721
  }
3160
2722
  }
3161
- async saveScene() {
3162
- if (this.canSave == true) {
3163
- this.dispatchEvent(new CustomEvent('save', {
3164
- detail: {
3165
- digipair: this.digipair.id,
3166
- reasoning: this.reasoning.id,
3167
- value: this.codeInWorkspace
3168
- }
3169
- }));
3170
- } else {
3171
- Toastify$1({
3172
- text: 'Your scene cannot be saved, invalid format',
3173
- position: 'center',
3174
- style: {
3175
- 'font-family': '"Poppins", sans-serif',
3176
- background: 'linear-gradient(90deg, rgba(121,9,9,1) 0%, rgba(203,62,62,1) 100%)'
3177
- },
3178
- duration: 3000
3179
- }).showToast();
3180
- }
3181
- }
3182
2723
  loadBlockly(scene) {
3183
2724
  var _this_librariesToLoad_find_xsceneblocks_, _this_librariesToLoad_find_xsceneblocks, _this_librariesToLoad_find;
3184
2725
  initializeMutator();
@@ -3303,29 +2844,6 @@ class EditorElement extends s {
3303
2844
  fill: #fff;
3304
2845
  }
3305
2846
  </style>
3306
-
3307
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
3308
- <div>
3309
- <div style=${this.contentStyle} data-scene></div>
3310
- <div
3311
- style ="position: absolute;
3312
- top: 24px;
3313
- right: 24px;
3314
- border-radius: 100%;
3315
- color: #52DFDB;
3316
- width: 56px;
3317
- height: 56px;
3318
- line-height: 56px;
3319
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
3320
- transition: box-shadow 0.3s ease-in-out;
3321
- text-align: center;
3322
- font-weight: 500;
3323
- background-color:${this.canSave ? '#242E3B' : '#5F5F5F'} ;
3324
- cursor: pointer;"
3325
- class="material-icons"
3326
- aria-hidden="true"
3327
- @click=${()=>this.saveScene()}>save</div>
3328
- </div>
3329
2847
  </div>
3330
2848
  `;
3331
2849
  }
@@ -3355,43 +2873,15 @@ __decorate([
3355
2873
  n()
3356
2874
  ], EditorElement.prototype, "contentStyle", void 0);
3357
2875
  __decorate([
3358
- r()
2876
+ n()
3359
2877
  ], EditorElement.prototype, "canSave", void 0);
2878
+ __decorate([
2879
+ n(),
2880
+ __metadata("design:type", Object)
2881
+ ], EditorElement.prototype, "codeInWorkspace", void 0);
3360
2882
  EditorElement = __decorate([
3361
2883
  t('digipair-editor')
3362
2884
  ], EditorElement);
3363
2885
 
3364
- const Toastify = toastify;
3365
- let EditorService = class EditorService {
3366
- async information(params, _pinsSettingsList, _context) {
3367
- const { message } = params;
3368
- Toastify({
3369
- text: message,
3370
- position: 'center',
3371
- style: {
3372
- 'font-family': '"Poppins", sans-serif',
3373
- background: '#52DFDB'
3374
- },
3375
- duration: 3000
3376
- }).showToast();
3377
- }
3378
- async error(params, _pinsSettingsList, _context) {
3379
- const { message } = params;
3380
- Toastify({
3381
- text: message,
3382
- position: 'center',
3383
- style: {
3384
- 'font-family': '"Poppins", sans-serif',
3385
- background: 'linear-gradient(90deg, rgba(121,9,9,1) 0%, rgba(203,62,62,1) 100%)'
3386
- },
3387
- duration: 3000
3388
- }).showToast();
3389
- }
3390
- };
3391
- const information = (params, pinsSettingsList, context)=>new EditorService().information(params, pinsSettingsList, context);
3392
- const error = (params, pinsSettingsList, context)=>new EditorService().error(params, pinsSettingsList, context);
3393
-
3394
2886
  exports.EditorElement = EditorElement;
3395
2887
  exports._extends = _extends;
3396
- exports.error = error;
3397
- exports.information = information;