@startinblox/core 0.17.31 → 0.18.0-beta.2

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.
Files changed (255) hide show
  1. package/dist/_snowpack/pkg/autolinker.js +3515 -3367
  2. package/dist/_snowpack/pkg/autolinker.js.map +1 -1
  3. package/dist/_snowpack/pkg/common/{_baseUnary-217dffb2.js → _baseUnary-c1edb653.js} +16 -40
  4. package/dist/_snowpack/pkg/common/{_baseUnary-217dffb2.js.map → _baseUnary-c1edb653.js.map} +1 -1
  5. package/dist/_snowpack/pkg/common/{_commonjsHelpers-8c19dec8.js → _commonjsHelpers-37fa8da4.js} +6 -2
  6. package/dist/_snowpack/pkg/common/_commonjsHelpers-37fa8da4.js.map +1 -0
  7. package/dist/_snowpack/pkg/common/{decode-a4c334cf.js → decode-26fbf385.js} +38 -69
  8. package/dist/_snowpack/pkg/common/decode-26fbf385.js.map +1 -0
  9. package/dist/_snowpack/pkg/common/lit-html-3647afce.js +1104 -0
  10. package/dist/_snowpack/pkg/common/lit-html-3647afce.js.map +1 -0
  11. package/dist/_snowpack/pkg/delta-markdown-for-quill.js +4767 -4246
  12. package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map +1 -1
  13. package/dist/_snowpack/pkg/dialog-polyfill.js +107 -139
  14. package/dist/_snowpack/pkg/dialog-polyfill.js.map +1 -1
  15. package/dist/_snowpack/pkg/fusejs.js +411 -601
  16. package/dist/_snowpack/pkg/fusejs.js.map +1 -1
  17. package/dist/_snowpack/pkg/jsonld-context-parser.js +718 -686
  18. package/dist/_snowpack/pkg/jsonld-context-parser.js.map +1 -1
  19. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css +59 -59
  20. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js +1 -1
  21. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css +14 -14
  22. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js +1 -1
  23. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js +13 -14
  24. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map +1 -1
  25. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js +17 -15
  26. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map +1 -1
  27. package/dist/_snowpack/pkg/lit-html/directives/until.js +45 -46
  28. package/dist/_snowpack/pkg/lit-html/directives/until.js.map +1 -1
  29. package/dist/_snowpack/pkg/lit-html.js +37 -35
  30. package/dist/_snowpack/pkg/lit-html.js.map +1 -1
  31. package/dist/_snowpack/pkg/markdown-it-link-attributes.js +1 -20
  32. package/dist/_snowpack/pkg/markdown-it-link-attributes.js.map +1 -1
  33. package/dist/_snowpack/pkg/markdown-it.js +1731 -2284
  34. package/dist/_snowpack/pkg/markdown-it.js.map +1 -1
  35. package/dist/_snowpack/pkg/quill-delta-to-markdown.js +236 -294
  36. package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map +1 -1
  37. package/dist/_snowpack/pkg/quill.js +12077 -11017
  38. package/dist/_snowpack/pkg/quill.js.map +1 -1
  39. package/dist/_snowpack/pkg/slim-select.js +711 -1
  40. package/dist/_snowpack/pkg/slim-select.js.map +1 -1
  41. package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css +1 -16
  42. package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css.proxy.js +1 -1
  43. package/dist/_snowpack/pkg/tui-calendar.js +44297 -40075
  44. package/dist/_snowpack/pkg/tui-calendar.js.map +1 -1
  45. package/dist/components/solid-ac-checker.js +4 -17
  46. package/dist/components/solid-calendar.js +5 -26
  47. package/dist/components/solid-delete.js +9 -24
  48. package/dist/components/solid-display.js +15 -59
  49. package/dist/components/solid-form-search.js +27 -79
  50. package/dist/components/solid-form.js +48 -143
  51. package/dist/components/solid-lang.js +8 -19
  52. package/dist/components/solid-map.js +26 -64
  53. package/dist/components/solid-table.js +51 -133
  54. package/dist/components/solid-widget.js +2 -24
  55. package/dist/index.js +17 -11
  56. package/dist/libs/Component.js +4 -10
  57. package/dist/libs/ComponentFactory.js +6 -34
  58. package/dist/libs/Compositor.js +8 -15
  59. package/dist/libs/Sib.js +7 -21
  60. package/dist/libs/filter.js +184 -0
  61. package/dist/libs/helpers.js +19 -47
  62. package/dist/libs/interfaces.js +1 -1
  63. package/dist/libs/lit-helpers.js +7 -34
  64. package/dist/libs/polyfills.js +7 -10
  65. package/dist/libs/store/server-pagination.js +22 -0
  66. package/dist/libs/store/server-search.js +35 -0
  67. package/dist/libs/store/store.js +243 -234
  68. package/dist/mixins/attributeBinderMixin.js +17 -25
  69. package/dist/mixins/contextMixin.js +5 -7
  70. package/dist/mixins/counterMixin.js +2 -23
  71. package/dist/mixins/federationMixin.js +2 -14
  72. package/dist/mixins/filterMixin.js +60 -100
  73. package/dist/mixins/grouperMixin.js +11 -18
  74. package/dist/mixins/highlighterMixin.js +2 -8
  75. package/dist/mixins/interfaces.js +3 -5
  76. package/dist/mixins/listMixin.js +12 -43
  77. package/dist/mixins/nextMixin.js +1 -4
  78. package/dist/mixins/paginateMixin.js +17 -30
  79. package/dist/mixins/requiredMixin.js +1 -9
  80. package/dist/mixins/serverPaginationMixin.js +122 -0
  81. package/dist/mixins/sorterMixin.js +26 -44
  82. package/dist/mixins/storeMixin.js +28 -21
  83. package/dist/mixins/translationMixin.js +2 -12
  84. package/dist/mixins/validationMixin.js +28 -46
  85. package/dist/mixins/widgetMixin.js +58 -154
  86. package/dist/new-widgets/attributeMixins/actionMixin.js +1 -2
  87. package/dist/new-widgets/attributeMixins/blankMixin.js +1 -4
  88. package/dist/new-widgets/attributeMixins/booleanMixin.js +1 -4
  89. package/dist/new-widgets/attributeMixins/index.js +1 -2
  90. package/dist/new-widgets/attributeMixins/mailtoMixin.js +1 -4
  91. package/dist/new-widgets/attributeMixins/multipleMixin.js +1 -2
  92. package/dist/new-widgets/attributeMixins/numberMixin.js +1 -4
  93. package/dist/new-widgets/attributeMixins/placeholderMixin.js +1 -4
  94. package/dist/new-widgets/attributeMixins/telMixin.js +1 -4
  95. package/dist/new-widgets/baseWidgetMixin.js +5 -18
  96. package/dist/new-widgets/callbackMixins/autocompletionMixin.js +3 -11
  97. package/dist/new-widgets/callbackMixins/index.js +1 -2
  98. package/dist/new-widgets/callbackMixins/richtextMixin.js +1 -6
  99. package/dist/new-widgets/interfaces.js +1 -0
  100. package/dist/new-widgets/new-widget-factory.js +14 -19
  101. package/dist/new-widgets/templateAdditionMixins/addableMixin.js +6 -21
  102. package/dist/new-widgets/templateAdditionMixins/index.js +2 -3
  103. package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js +5 -18
  104. package/dist/new-widgets/templateAdditionMixins/labelMixin.js +5 -18
  105. package/dist/new-widgets/templates/defaultTemplatesDirectory.js +21 -27
  106. package/dist/new-widgets/templates/displayTemplatesDirectory.js +35 -70
  107. package/dist/new-widgets/templates/formTemplatesDirectory.js +350 -315
  108. package/dist/new-widgets/templates/groupTemplatesDirectory.js +5 -15
  109. package/dist/new-widgets/templates/index.js +1 -2
  110. package/dist/new-widgets/templates/setTemplatesDirectory.js +4 -37
  111. package/dist/new-widgets/templatesDependencies/altMixin.js +1 -2
  112. package/dist/new-widgets/templatesDependencies/editableMixin.js +9 -26
  113. package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js +3 -7
  114. package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js +1 -5
  115. package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js +1 -11
  116. package/dist/new-widgets/templatesDependencies/formDropdownMixin.js +3 -13
  117. package/dist/new-widgets/templatesDependencies/formFileMixin.js +1 -13
  118. package/dist/new-widgets/templatesDependencies/formLengthMixin.js +1 -2
  119. package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js +1 -2
  120. package/dist/new-widgets/templatesDependencies/formMixin.js +4 -14
  121. package/dist/new-widgets/templatesDependencies/formNumberMixin.js +1 -5
  122. package/dist/new-widgets/templatesDependencies/formRadioMixin.js +1 -5
  123. package/dist/new-widgets/templatesDependencies/formStepMixin.js +1 -2
  124. package/dist/new-widgets/templatesDependencies/linkTextMixin.js +13 -0
  125. package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +23 -18
  126. package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js +1 -10
  127. package/dist/new-widgets/templatesDependencies/patternMixin.js +1 -2
  128. package/dist/new-widgets/templatesDependencies/rangeMixin.js +5 -15
  129. package/dist/new-widgets/templatesDependencies/setMixin.js +1 -4
  130. package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js +1 -4
  131. package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js +1 -5
  132. package/dist/new-widgets/valueTransformationMixins/dateMixin.js +5 -11
  133. package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js +1 -5
  134. package/dist/new-widgets/valueTransformationMixins/index.js +1 -2
  135. package/dist/new-widgets/valueTransformationMixins/markdownMixin.js +1 -7
  136. package/dist/new-widgets/valueTransformationMixins/multilineMixin.js +1 -5
  137. package/dist/new-widgets/valueTransformationMixins/oembedMixin.js +1 -7
  138. package/dist/solid-template-element.js +24 -44
  139. package/dist/widgets/baseWidget.js +21 -85
  140. package/dist/widgets/widget-factory.js +4 -6
  141. package/package.json +8 -6
  142. package/dist/_snowpack/env.js +0 -3
  143. package/dist/_snowpack/pkg/autolinker.js.map.proxy.js +0 -1
  144. package/dist/_snowpack/pkg/common/_baseUnary-217dffb2.js.map.proxy.js +0 -1
  145. package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js.map +0 -1
  146. package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js.map.proxy.js +0 -1
  147. package/dist/_snowpack/pkg/common/decode-a4c334cf.js.map +0 -1
  148. package/dist/_snowpack/pkg/common/decode-a4c334cf.js.map.proxy.js +0 -1
  149. package/dist/_snowpack/pkg/common/lit-html-babd44cd.js +0 -1119
  150. package/dist/_snowpack/pkg/common/lit-html-babd44cd.js.map +0 -1
  151. package/dist/_snowpack/pkg/common/lit-html-babd44cd.js.map.proxy.js +0 -1
  152. package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map.proxy.js +0 -1
  153. package/dist/_snowpack/pkg/dialog-polyfill.js.map.proxy.js +0 -1
  154. package/dist/_snowpack/pkg/fusejs.js.map.proxy.js +0 -1
  155. package/dist/_snowpack/pkg/jsonld-context-parser.js.map.proxy.js +0 -1
  156. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map.proxy.js +0 -1
  157. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map.proxy.js +0 -1
  158. package/dist/_snowpack/pkg/lit-html/directives/until.js.map.proxy.js +0 -1
  159. package/dist/_snowpack/pkg/lit-html.js.map.proxy.js +0 -1
  160. package/dist/_snowpack/pkg/markdown-it-link-attributes.js.map.proxy.js +0 -1
  161. package/dist/_snowpack/pkg/markdown-it.js.map.proxy.js +0 -1
  162. package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map.proxy.js +0 -1
  163. package/dist/_snowpack/pkg/quill.js.map.proxy.js +0 -1
  164. package/dist/_snowpack/pkg/slim-select.js.map.proxy.js +0 -1
  165. package/dist/_snowpack/pkg/tui-calendar.js.map.proxy.js +0 -1
  166. package/dist/components/solid-ac-checker.js.map +0 -1
  167. package/dist/components/solid-calendar.js.map +0 -1
  168. package/dist/components/solid-delete.js.map +0 -1
  169. package/dist/components/solid-display.js.map +0 -1
  170. package/dist/components/solid-form-search.js.map +0 -1
  171. package/dist/components/solid-form.js.map +0 -1
  172. package/dist/components/solid-lang.js.map +0 -1
  173. package/dist/components/solid-map.js.map +0 -1
  174. package/dist/components/solid-table.js.map +0 -1
  175. package/dist/components/solid-widget.js.map +0 -1
  176. package/dist/index.js.map +0 -1
  177. package/dist/libs/Component.js.map +0 -1
  178. package/dist/libs/ComponentFactory.js.map +0 -1
  179. package/dist/libs/Compositor.js.map +0 -1
  180. package/dist/libs/Sib.js.map +0 -1
  181. package/dist/libs/helpers.js.map +0 -1
  182. package/dist/libs/interfaces.js.map +0 -1
  183. package/dist/libs/lit-helpers.js.map +0 -1
  184. package/dist/libs/polyfills.js.map +0 -1
  185. package/dist/libs/store/store.js.map +0 -1
  186. package/dist/mixins/attributeBinderMixin.js.map +0 -1
  187. package/dist/mixins/contextMixin.js.map +0 -1
  188. package/dist/mixins/counterMixin.js.map +0 -1
  189. package/dist/mixins/federationMixin.js.map +0 -1
  190. package/dist/mixins/filterMixin.js.map +0 -1
  191. package/dist/mixins/grouperMixin.js.map +0 -1
  192. package/dist/mixins/highlighterMixin.js.map +0 -1
  193. package/dist/mixins/interfaces.js.map +0 -1
  194. package/dist/mixins/listMixin.js.map +0 -1
  195. package/dist/mixins/nextMixin.js.map +0 -1
  196. package/dist/mixins/paginateMixin.js.map +0 -1
  197. package/dist/mixins/requiredMixin.js.map +0 -1
  198. package/dist/mixins/sorterMixin.js.map +0 -1
  199. package/dist/mixins/storeMixin.js.map +0 -1
  200. package/dist/mixins/translationMixin.js.map +0 -1
  201. package/dist/mixins/validationMixin.js.map +0 -1
  202. package/dist/mixins/widgetMixin.js.map +0 -1
  203. package/dist/new-widgets/attributeMixins/actionMixin.js.map +0 -1
  204. package/dist/new-widgets/attributeMixins/blankMixin.js.map +0 -1
  205. package/dist/new-widgets/attributeMixins/booleanMixin.js.map +0 -1
  206. package/dist/new-widgets/attributeMixins/index.js.map +0 -1
  207. package/dist/new-widgets/attributeMixins/mailtoMixin.js.map +0 -1
  208. package/dist/new-widgets/attributeMixins/multipleMixin.js.map +0 -1
  209. package/dist/new-widgets/attributeMixins/numberMixin.js.map +0 -1
  210. package/dist/new-widgets/attributeMixins/placeholderMixin.js.map +0 -1
  211. package/dist/new-widgets/attributeMixins/telMixin.js.map +0 -1
  212. package/dist/new-widgets/baseWidgetMixin.js.map +0 -1
  213. package/dist/new-widgets/callbackMixins/autocompletionMixin.js.map +0 -1
  214. package/dist/new-widgets/callbackMixins/index.js.map +0 -1
  215. package/dist/new-widgets/callbackMixins/richtextMixin.js.map +0 -1
  216. package/dist/new-widgets/new-widget-factory.js.map +0 -1
  217. package/dist/new-widgets/templateAdditionMixins/addableMixin.js.map +0 -1
  218. package/dist/new-widgets/templateAdditionMixins/index.js.map +0 -1
  219. package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js.map +0 -1
  220. package/dist/new-widgets/templateAdditionMixins/labelMixin.js.map +0 -1
  221. package/dist/new-widgets/templates/defaultTemplatesDirectory.js.map +0 -1
  222. package/dist/new-widgets/templates/displayTemplatesDirectory.js.map +0 -1
  223. package/dist/new-widgets/templates/formTemplatesDirectory.js.map +0 -1
  224. package/dist/new-widgets/templates/groupTemplatesDirectory.js.map +0 -1
  225. package/dist/new-widgets/templates/index.js.map +0 -1
  226. package/dist/new-widgets/templates/setTemplatesDirectory.js.map +0 -1
  227. package/dist/new-widgets/templatesDependencies/altMixin.js.map +0 -1
  228. package/dist/new-widgets/templatesDependencies/editableMixin.js.map +0 -1
  229. package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js.map +0 -1
  230. package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js.map +0 -1
  231. package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js.map +0 -1
  232. package/dist/new-widgets/templatesDependencies/formDropdownMixin.js.map +0 -1
  233. package/dist/new-widgets/templatesDependencies/formFileMixin.js.map +0 -1
  234. package/dist/new-widgets/templatesDependencies/formLengthMixin.js.map +0 -1
  235. package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js.map +0 -1
  236. package/dist/new-widgets/templatesDependencies/formMixin.js.map +0 -1
  237. package/dist/new-widgets/templatesDependencies/formNumberMixin.js.map +0 -1
  238. package/dist/new-widgets/templatesDependencies/formRadioMixin.js.map +0 -1
  239. package/dist/new-widgets/templatesDependencies/formStepMixin.js.map +0 -1
  240. package/dist/new-widgets/templatesDependencies/multipleFormMixin.js.map +0 -1
  241. package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js.map +0 -1
  242. package/dist/new-widgets/templatesDependencies/patternMixin.js.map +0 -1
  243. package/dist/new-widgets/templatesDependencies/rangeMixin.js.map +0 -1
  244. package/dist/new-widgets/templatesDependencies/setMixin.js.map +0 -1
  245. package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js.map +0 -1
  246. package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js.map +0 -1
  247. package/dist/new-widgets/valueTransformationMixins/dateMixin.js.map +0 -1
  248. package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js.map +0 -1
  249. package/dist/new-widgets/valueTransformationMixins/index.js.map +0 -1
  250. package/dist/new-widgets/valueTransformationMixins/markdownMixin.js.map +0 -1
  251. package/dist/new-widgets/valueTransformationMixins/multilineMixin.js.map +0 -1
  252. package/dist/new-widgets/valueTransformationMixins/oembedMixin.js.map +0 -1
  253. package/dist/solid-template-element.js.map +0 -1
  254. package/dist/widgets/baseWidget.js.map +0 -1
  255. package/dist/widgets/widget-factory.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js';
2
- import { i as isObjectLike_1, c as _baseGetTag, h as _Symbol, g as isArray_1, _ as _getNative, f as _baseUnary, j as isObject_1 } from './common/_baseUnary-217dffb2.js';
1
+ import { c as createCommonjsModule } from './common/_commonjsHelpers-37fa8da4.js';
2
+ import { i as isObjectLike_1, c as _baseGetTag, h as _Symbol, g as isArray_1, _ as _getNative, f as _baseUnary, j as isObject_1 } from './common/_baseUnary-c1edb653.js';
3
3
 
4
4
  /**
5
5
  * A specialized version of `_.map` for arrays without support for iteratee
@@ -12,15 +12,13 @@ import { i as isObjectLike_1, c as _baseGetTag, h as _Symbol, g as isArray_1, _
12
12
  */
13
13
  function arrayMap(array, iteratee) {
14
14
  var index = -1,
15
- length = array == null ? 0 : array.length,
16
- result = Array(length);
17
-
15
+ length = array == null ? 0 : array.length,
16
+ result = Array(length);
18
17
  while (++index < length) {
19
18
  result[index] = iteratee(array[index], index, array);
20
19
  }
21
20
  return result;
22
21
  }
23
-
24
22
  var _arrayMap = arrayMap;
25
23
 
26
24
  /** `Object#toString` result references. */
@@ -44,10 +42,8 @@ var symbolTag = '[object Symbol]';
44
42
  * // => false
45
43
  */
46
44
  function isSymbol(value) {
47
- return typeof value == 'symbol' ||
48
- (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
45
+ return typeof value == 'symbol' || isObjectLike_1(value) && _baseGetTag(value) == symbolTag;
49
46
  }
50
-
51
47
  var isSymbol_1 = isSymbol;
52
48
 
53
49
  /** Used as references for various `Number` constants. */
@@ -55,7 +51,7 @@ var INFINITY = 1 / 0;
55
51
 
56
52
  /** Used to convert symbols to primitives and strings. */
57
53
  var symbolProto = _Symbol ? _Symbol.prototype : undefined,
58
- symbolToString = symbolProto ? symbolProto.toString : undefined;
54
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
59
55
 
60
56
  /**
61
57
  * The base implementation of `_.toString` which doesn't convert nullish
@@ -77,10 +73,9 @@ function baseToString(value) {
77
73
  if (isSymbol_1(value)) {
78
74
  return symbolToString ? symbolToString.call(value) : '';
79
75
  }
80
- var result = (value + '');
81
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
76
+ var result = value + '';
77
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result;
82
78
  }
83
-
84
79
  var _baseToString = baseToString;
85
80
 
86
81
  /**
@@ -94,25 +89,22 @@ var _baseToString = baseToString;
94
89
  */
95
90
  function baseSlice(array, start, end) {
96
91
  var index = -1,
97
- length = array.length;
98
-
92
+ length = array.length;
99
93
  if (start < 0) {
100
- start = -start > length ? 0 : (length + start);
94
+ start = -start > length ? 0 : length + start;
101
95
  }
102
96
  end = end > length ? length : end;
103
97
  if (end < 0) {
104
98
  end += length;
105
99
  }
106
- length = start > end ? 0 : ((end - start) >>> 0);
100
+ length = start > end ? 0 : end - start >>> 0;
107
101
  start >>>= 0;
108
-
109
102
  var result = Array(length);
110
103
  while (++index < length) {
111
104
  result[index] = array[index + start];
112
105
  }
113
106
  return result;
114
107
  }
115
-
116
108
  var _baseSlice = baseSlice;
117
109
 
118
110
  /**
@@ -127,9 +119,8 @@ var _baseSlice = baseSlice;
127
119
  function castSlice(array, start, end) {
128
120
  var length = array.length;
129
121
  end = end === undefined ? length : end;
130
- return (!start && end >= length) ? array : _baseSlice(array, start, end);
122
+ return !start && end >= length ? array : _baseSlice(array, start, end);
131
123
  }
132
-
133
124
  var _castSlice = castSlice;
134
125
 
135
126
  /**
@@ -145,16 +136,14 @@ var _castSlice = castSlice;
145
136
  */
146
137
  function baseFindIndex(array, predicate, fromIndex, fromRight) {
147
138
  var length = array.length,
148
- index = fromIndex + (fromRight ? 1 : -1);
149
-
150
- while ((fromRight ? index-- : ++index < length)) {
139
+ index = fromIndex + (fromRight ? 1 : -1);
140
+ while (fromRight ? index-- : ++index < length) {
151
141
  if (predicate(array[index], index, array)) {
152
142
  return index;
153
143
  }
154
144
  }
155
145
  return -1;
156
146
  }
157
-
158
147
  var _baseFindIndex = baseFindIndex;
159
148
 
160
149
  /**
@@ -167,7 +156,6 @@ var _baseFindIndex = baseFindIndex;
167
156
  function baseIsNaN(value) {
168
157
  return value !== value;
169
158
  }
170
-
171
159
  var _baseIsNaN = baseIsNaN;
172
160
 
173
161
  /**
@@ -182,8 +170,7 @@ var _baseIsNaN = baseIsNaN;
182
170
  */
183
171
  function strictIndexOf(array, value, fromIndex) {
184
172
  var index = fromIndex - 1,
185
- length = array.length;
186
-
173
+ length = array.length;
187
174
  while (++index < length) {
188
175
  if (array[index] === value) {
189
176
  return index;
@@ -191,7 +178,6 @@ function strictIndexOf(array, value, fromIndex) {
191
178
  }
192
179
  return -1;
193
180
  }
194
-
195
181
  var _strictIndexOf = strictIndexOf;
196
182
 
197
183
  /**
@@ -204,11 +190,8 @@ var _strictIndexOf = strictIndexOf;
204
190
  * @returns {number} Returns the index of the matched value, else `-1`.
205
191
  */
206
192
  function baseIndexOf(array, value, fromIndex) {
207
- return value === value
208
- ? _strictIndexOf(array, value, fromIndex)
209
- : _baseFindIndex(array, _baseIsNaN, fromIndex);
193
+ return value === value ? _strictIndexOf(array, value, fromIndex) : _baseFindIndex(array, _baseIsNaN, fromIndex);
210
194
  }
211
-
212
195
  var _baseIndexOf = baseIndexOf;
213
196
 
214
197
  /**
@@ -222,11 +205,9 @@ var _baseIndexOf = baseIndexOf;
222
205
  */
223
206
  function charsEndIndex(strSymbols, chrSymbols) {
224
207
  var index = strSymbols.length;
225
-
226
208
  while (index-- && _baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
227
209
  return index;
228
210
  }
229
-
230
211
  var _charsEndIndex = charsEndIndex;
231
212
 
232
213
  /**
@@ -239,22 +220,21 @@ var _charsEndIndex = charsEndIndex;
239
220
  function asciiToArray(string) {
240
221
  return string.split('');
241
222
  }
242
-
243
223
  var _asciiToArray = asciiToArray;
244
224
 
245
225
  /** Used to compose unicode character classes. */
246
226
  var rsAstralRange = '\\ud800-\\udfff',
247
- rsComboMarksRange = '\\u0300-\\u036f',
248
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
249
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
250
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
251
- rsVarRange = '\\ufe0e\\ufe0f';
227
+ rsComboMarksRange = '\\u0300-\\u036f',
228
+ reComboHalfMarksRange = '\\ufe20-\\ufe2f',
229
+ rsComboSymbolsRange = '\\u20d0-\\u20ff',
230
+ rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
231
+ rsVarRange = '\\ufe0e\\ufe0f';
252
232
 
253
233
  /** Used to compose unicode capture groups. */
254
234
  var rsZWJ = '\\u200d';
255
235
 
256
236
  /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
257
- var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
237
+ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
258
238
 
259
239
  /**
260
240
  * Checks if `string` contains Unicode symbols.
@@ -266,33 +246,32 @@ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRan
266
246
  function hasUnicode(string) {
267
247
  return reHasUnicode.test(string);
268
248
  }
269
-
270
249
  var _hasUnicode = hasUnicode;
271
250
 
272
251
  /** Used to compose unicode character classes. */
273
252
  var rsAstralRange$1 = '\\ud800-\\udfff',
274
- rsComboMarksRange$1 = '\\u0300-\\u036f',
275
- reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f',
276
- rsComboSymbolsRange$1 = '\\u20d0-\\u20ff',
277
- rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1,
278
- rsVarRange$1 = '\\ufe0e\\ufe0f';
253
+ rsComboMarksRange$1 = '\\u0300-\\u036f',
254
+ reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f',
255
+ rsComboSymbolsRange$1 = '\\u20d0-\\u20ff',
256
+ rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1,
257
+ rsVarRange$1 = '\\ufe0e\\ufe0f';
279
258
 
280
259
  /** Used to compose unicode capture groups. */
281
260
  var rsAstral = '[' + rsAstralRange$1 + ']',
282
- rsCombo = '[' + rsComboRange$1 + ']',
283
- rsFitz = '\\ud83c[\\udffb-\\udfff]',
284
- rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
285
- rsNonAstral = '[^' + rsAstralRange$1 + ']',
286
- rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
287
- rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
288
- rsZWJ$1 = '\\u200d';
261
+ rsCombo = '[' + rsComboRange$1 + ']',
262
+ rsFitz = '\\ud83c[\\udffb-\\udfff]',
263
+ rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
264
+ rsNonAstral = '[^' + rsAstralRange$1 + ']',
265
+ rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
266
+ rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
267
+ rsZWJ$1 = '\\u200d';
289
268
 
290
269
  /** Used to compose unicode regexes. */
291
270
  var reOptMod = rsModifier + '?',
292
- rsOptVar = '[' + rsVarRange$1 + ']?',
293
- rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
294
- rsSeq = rsOptVar + reOptMod + rsOptJoin,
295
- rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
271
+ rsOptVar = '[' + rsVarRange$1 + ']?',
272
+ rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
273
+ rsSeq = rsOptVar + reOptMod + rsOptJoin,
274
+ rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
296
275
 
297
276
  /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
298
277
  var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
@@ -307,7 +286,6 @@ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
307
286
  function unicodeToArray(string) {
308
287
  return string.match(reUnicode) || [];
309
288
  }
310
-
311
289
  var _unicodeToArray = unicodeToArray;
312
290
 
313
291
  /**
@@ -318,11 +296,8 @@ var _unicodeToArray = unicodeToArray;
318
296
  * @returns {Array} Returns the converted array.
319
297
  */
320
298
  function stringToArray(string) {
321
- return _hasUnicode(string)
322
- ? _unicodeToArray(string)
323
- : _asciiToArray(string);
299
+ return _hasUnicode(string) ? _unicodeToArray(string) : _asciiToArray(string);
324
300
  }
325
-
326
301
  var _stringToArray = stringToArray;
327
302
 
328
303
  /**
@@ -349,11 +324,25 @@ var _stringToArray = stringToArray;
349
324
  function toString(value) {
350
325
  return value == null ? '' : _baseToString(value);
351
326
  }
352
-
353
327
  var toString_1 = toString;
354
328
 
355
- /** Used to match leading and trailing whitespace. */
356
- var reTrimEnd = /\s+$/;
329
+ /** Used to match a single whitespace character. */
330
+ var reWhitespace = /\s/;
331
+
332
+ /**
333
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
334
+ * character of `string`.
335
+ *
336
+ * @private
337
+ * @param {string} string The string to inspect.
338
+ * @returns {number} Returns the index of the last non-whitespace character.
339
+ */
340
+ function trimmedEndIndex(string) {
341
+ var index = string.length;
342
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
343
+ return index;
344
+ }
345
+ var _trimmedEndIndex = trimmedEndIndex;
357
346
 
358
347
  /**
359
348
  * Removes trailing whitespace or specified characters from `string`.
@@ -377,17 +366,15 @@ var reTrimEnd = /\s+$/;
377
366
  function trimEnd(string, chars, guard) {
378
367
  string = toString_1(string);
379
368
  if (string && (guard || chars === undefined)) {
380
- return string.replace(reTrimEnd, '');
369
+ return string.slice(0, _trimmedEndIndex(string) + 1);
381
370
  }
382
371
  if (!string || !(chars = _baseToString(chars))) {
383
372
  return string;
384
373
  }
385
374
  var strSymbols = _stringToArray(string),
386
- end = _charsEndIndex(strSymbols, _stringToArray(chars)) + 1;
387
-
375
+ end = _charsEndIndex(strSymbols, _stringToArray(chars)) + 1;
388
376
  return _castSlice(strSymbols, 0, end).join('');
389
377
  }
390
-
391
378
  var trimEnd_1 = trimEnd;
392
379
 
393
380
  /** `Object#toString` result references. */
@@ -411,10 +398,8 @@ var stringTag = '[object String]';
411
398
  * // => false
412
399
  */
413
400
  function isString(value) {
414
- return typeof value == 'string' ||
415
- (!isArray_1(value) && isObjectLike_1(value) && _baseGetTag(value) == stringTag);
401
+ return typeof value == 'string' || !isArray_1(value) && isObjectLike_1(value) && _baseGetTag(value) == stringTag;
416
402
  }
417
-
418
403
  var isString_1 = isString;
419
404
 
420
405
  /**
@@ -436,7 +421,6 @@ var isString_1 = isString;
436
421
  function identity(value) {
437
422
  return value;
438
423
  }
439
-
440
424
  var identity_1 = identity;
441
425
 
442
426
  /**
@@ -451,14 +435,17 @@ var identity_1 = identity;
451
435
  */
452
436
  function apply(func, thisArg, args) {
453
437
  switch (args.length) {
454
- case 0: return func.call(thisArg);
455
- case 1: return func.call(thisArg, args[0]);
456
- case 2: return func.call(thisArg, args[0], args[1]);
457
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
438
+ case 0:
439
+ return func.call(thisArg);
440
+ case 1:
441
+ return func.call(thisArg, args[0]);
442
+ case 2:
443
+ return func.call(thisArg, args[0], args[1]);
444
+ case 3:
445
+ return func.call(thisArg, args[0], args[1], args[2]);
458
446
  }
459
447
  return func.apply(thisArg, args);
460
448
  }
461
-
462
449
  var _apply = apply;
463
450
 
464
451
  /* Built-in method references for those with the same name as other `lodash` methods. */
@@ -474,13 +461,12 @@ var nativeMax = Math.max;
474
461
  * @returns {Function} Returns the new function.
475
462
  */
476
463
  function overRest(func, start, transform) {
477
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
478
- return function() {
464
+ start = nativeMax(start === undefined ? func.length - 1 : start, 0);
465
+ return function () {
479
466
  var args = arguments,
480
- index = -1,
481
- length = nativeMax(args.length - start, 0),
482
- array = Array(length);
483
-
467
+ index = -1,
468
+ length = nativeMax(args.length - start, 0),
469
+ array = Array(length);
484
470
  while (++index < length) {
485
471
  array[index] = args[start + index];
486
472
  }
@@ -493,7 +479,6 @@ function overRest(func, start, transform) {
493
479
  return _apply(func, this, otherArgs);
494
480
  };
495
481
  }
496
-
497
482
  var _overRest = overRest;
498
483
 
499
484
  /**
@@ -516,21 +501,19 @@ var _overRest = overRest;
516
501
  * // => true
517
502
  */
518
503
  function constant(value) {
519
- return function() {
504
+ return function () {
520
505
  return value;
521
506
  };
522
507
  }
523
-
524
508
  var constant_1 = constant;
525
509
 
526
- var defineProperty = (function() {
510
+ var defineProperty = function () {
527
511
  try {
528
512
  var func = _getNative(Object, 'defineProperty');
529
513
  func({}, '', {});
530
514
  return func;
531
515
  } catch (e) {}
532
- }());
533
-
516
+ }();
534
517
  var _defineProperty = defineProperty;
535
518
 
536
519
  /**
@@ -541,7 +524,7 @@ var _defineProperty = defineProperty;
541
524
  * @param {Function} string The `toString` result.
542
525
  * @returns {Function} Returns `func`.
543
526
  */
544
- var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
527
+ var baseSetToString = !_defineProperty ? identity_1 : function (func, string) {
545
528
  return _defineProperty(func, 'toString', {
546
529
  'configurable': true,
547
530
  'enumerable': false,
@@ -549,12 +532,11 @@ var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
549
532
  'writable': true
550
533
  });
551
534
  };
552
-
553
535
  var _baseSetToString = baseSetToString;
554
536
 
555
537
  /** Used to detect hot functions by number of calls within a span of milliseconds. */
556
538
  var HOT_COUNT = 800,
557
- HOT_SPAN = 16;
539
+ HOT_SPAN = 16;
558
540
 
559
541
  /* Built-in method references for those with the same name as other `lodash` methods. */
560
542
  var nativeNow = Date.now;
@@ -570,12 +552,10 @@ var nativeNow = Date.now;
570
552
  */
571
553
  function shortOut(func) {
572
554
  var count = 0,
573
- lastCalled = 0;
574
-
575
- return function() {
555
+ lastCalled = 0;
556
+ return function () {
576
557
  var stamp = nativeNow(),
577
- remaining = HOT_SPAN - (stamp - lastCalled);
578
-
558
+ remaining = HOT_SPAN - (stamp - lastCalled);
579
559
  lastCalled = stamp;
580
560
  if (remaining > 0) {
581
561
  if (++count >= HOT_COUNT) {
@@ -587,7 +567,6 @@ function shortOut(func) {
587
567
  return func.apply(undefined, arguments);
588
568
  };
589
569
  }
590
-
591
570
  var _shortOut = shortOut;
592
571
 
593
572
  /**
@@ -599,7 +578,6 @@ var _shortOut = shortOut;
599
578
  * @returns {Function} Returns `func`.
600
579
  */
601
580
  var setToString = _shortOut(_baseSetToString);
602
-
603
581
  var _setToString = setToString;
604
582
 
605
583
  /**
@@ -613,7 +591,6 @@ var _setToString = setToString;
613
591
  function baseRest(func, start) {
614
592
  return _setToString(_overRest(func, start, identity_1), func + '');
615
593
  }
616
-
617
594
  var _baseRest = baseRest;
618
595
 
619
596
  /**
@@ -628,8 +605,7 @@ var _baseRest = baseRest;
628
605
  */
629
606
  function baseIndexOfWith(array, value, fromIndex, comparator) {
630
607
  var index = fromIndex - 1,
631
- length = array.length;
632
-
608
+ length = array.length;
633
609
  while (++index < length) {
634
610
  if (comparator(array[index], value)) {
635
611
  return index;
@@ -637,7 +613,6 @@ function baseIndexOfWith(array, value, fromIndex, comparator) {
637
613
  }
638
614
  return -1;
639
615
  }
640
-
641
616
  var _baseIndexOfWith = baseIndexOfWith;
642
617
 
643
618
  /**
@@ -650,15 +625,13 @@ var _baseIndexOfWith = baseIndexOfWith;
650
625
  */
651
626
  function copyArray(source, array) {
652
627
  var index = -1,
653
- length = source.length;
654
-
628
+ length = source.length;
655
629
  array || (array = Array(length));
656
630
  while (++index < length) {
657
631
  array[index] = source[index];
658
632
  }
659
633
  return array;
660
634
  }
661
-
662
635
  var _copyArray = copyArray;
663
636
 
664
637
  /** Used for built-in method references. */
@@ -680,10 +653,9 @@ var splice = arrayProto.splice;
680
653
  */
681
654
  function basePullAll(array, values, iteratee, comparator) {
682
655
  var indexOf = comparator ? _baseIndexOfWith : _baseIndexOf,
683
- index = -1,
684
- length = values.length,
685
- seen = array;
686
-
656
+ index = -1,
657
+ length = values.length,
658
+ seen = array;
687
659
  if (array === values) {
688
660
  values = _copyArray(values);
689
661
  }
@@ -692,9 +664,8 @@ function basePullAll(array, values, iteratee, comparator) {
692
664
  }
693
665
  while (++index < length) {
694
666
  var fromIndex = 0,
695
- value = values[index],
696
- computed = iteratee ? iteratee(value) : value;
697
-
667
+ value = values[index],
668
+ computed = iteratee ? iteratee(value) : value;
698
669
  while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
699
670
  if (seen !== array) {
700
671
  splice.call(seen, fromIndex, 1);
@@ -704,7 +675,6 @@ function basePullAll(array, values, iteratee, comparator) {
704
675
  }
705
676
  return array;
706
677
  }
707
-
708
678
  var _basePullAll = basePullAll;
709
679
 
710
680
  /**
@@ -728,11 +698,8 @@ var _basePullAll = basePullAll;
728
698
  * // => ['b', 'b']
729
699
  */
730
700
  function pullAll(array, values) {
731
- return (array && array.length && values && values.length)
732
- ? _basePullAll(array, values)
733
- : array;
701
+ return array && array.length && values && values.length ? _basePullAll(array, values) : array;
734
702
  }
735
-
736
703
  var pullAll_1 = pullAll;
737
704
 
738
705
  /**
@@ -759,11 +726,9 @@ var pullAll_1 = pullAll;
759
726
  * // => ['b', 'b']
760
727
  */
761
728
  var pull = _baseRest(pullAll_1);
762
-
763
729
  var pull_1 = pull;
764
730
 
765
731
  var id = 0;
766
-
767
732
  class Node {
768
733
  constructor(data) {
769
734
  this.id = ++id;
@@ -775,7 +740,6 @@ class Node {
775
740
  }
776
741
  this.children = [];
777
742
  }
778
-
779
743
  append(e) {
780
744
  if (!(e instanceof Node)) {
781
745
  e = new Node(e);
@@ -786,7 +750,6 @@ class Node {
786
750
  e._parent = this;
787
751
  this.children = this.children.concat(e);
788
752
  }
789
-
790
753
  render() {
791
754
  var text = '';
792
755
  if (this.open) {
@@ -801,65 +764,59 @@ class Node {
801
764
  if (this.close) {
802
765
  text += this.close;
803
766
  }
804
- return text
767
+ return text;
805
768
  }
806
-
807
769
  parent() {
808
- return this._parent
770
+ return this._parent;
809
771
  }
810
772
  }
811
-
812
773
  var Node_1 = Node;
813
774
 
814
- const encodeLink = (link) =>
815
- encodeURI(link)
816
- .replace(/\(/i, "%28")
817
- .replace(/\)/i, "%29")
818
- .replace(/(\?|&)response-content-disposition=attachment.*$/, "");
819
-
775
+ const encodeLink = link => encodeURI(link).replace(/\(/i, "%28").replace(/\)/i, "%29").replace(/(\?|&)response-content-disposition=attachment.*$/, "");
820
776
  var URL = {
821
- encodeLink,
777
+ encodeLink
822
778
  };
823
779
 
824
- const { encodeLink: encodeLink$1 } = URL;
825
-
780
+ const {
781
+ encodeLink: encodeLink$1
782
+ } = URL;
826
783
  var fromDelta_converters = {
827
784
  embed: {
828
- image: function(src) {
785
+ image: function (src) {
829
786
  this.append('![](' + encodeLink$1(src) + ')');
830
787
  },
831
788
  // Not a default Quill feature, converts custom divider embed blot added when
832
789
  // creating quill editor instance.
833
790
  // See https://quilljs.com/guides/cloning-medium-with-parchment/#dividers
834
- thematic_break: function() {
791
+ thematic_break: function () {
835
792
  this.open = '\n---\n' + this.open;
836
- },
793
+ }
837
794
  },
838
-
839
795
  inline: {
840
- italic: function() {
796
+ italic: function () {
841
797
  return ['_', '_'];
842
798
  },
843
- bold: function() {
799
+ bold: function () {
844
800
  return ['**', '**'];
845
801
  },
846
- link: function(url) {
802
+ link: function (url) {
847
803
  return ['[', '](' + url + ')'];
848
- },
804
+ }
849
805
  },
850
-
851
806
  block: {
852
- 'header': function({header}) {
807
+ 'header': function ({
808
+ header
809
+ }) {
853
810
  this.open = '#'.repeat(header) + ' ' + this.open;
854
811
  },
855
- blockquote: function() {
812
+ blockquote: function () {
856
813
  this.open = '> ' + this.open;
857
814
  },
858
815
  'list': {
859
- group: function() {
816
+ group: function () {
860
817
  return new Node_1(['', '\n']);
861
818
  },
862
- line: function(attrs, group) {
819
+ line: function (attrs, group) {
863
820
  if (attrs.list === 'bullet') {
864
821
  this.open = '- ' + this.open;
865
822
  } else if (attrs.list === "checked") {
@@ -871,153 +828,138 @@ var fromDelta_converters = {
871
828
  var count = ++group.count;
872
829
  this.open = count + '. ' + this.open;
873
830
  }
874
- },
831
+ }
875
832
  }
876
- },
833
+ }
877
834
  };
878
835
 
879
836
  var fromDelta = createCommonjsModule(function (module, exports) {
880
- module.exports = function(ops, converters = fromDelta_converters) {
881
- return trimEnd_1(convert(ops, converters).render()) + '\n';
882
- };
883
-
884
- function convert(ops, converters) {
885
- var group, line, el, activeInline, beginningOfLine;
886
- var root = new Node_1();
887
-
888
- function newLine() {
889
- el = line = new Node_1(['', '\n']);
890
- root.append(line);
891
- activeInline = {};
892
- }
893
- newLine();
894
-
895
- for (var i = 0; i < ops.length; i++) {
896
- var op = ops[i];
897
-
898
- if (isObject_1(op.insert)) {
899
- for (var k in op.insert) {
900
- if (converters.embed[k]) {
901
- applyInlineAttributes(op.attributes);
902
- converters.embed[k].call(el, op.insert[k], op.attributes);
903
- }
904
- }
905
- } else {
906
- var lines = op.insert.split('\n');
907
-
908
- if (hasBlockLevelAttribute(op.attributes, converters)) {
909
- // Some line-level styling (ie headings) is applied by inserting a \n
910
- // with the style; the style applies back to the previous \n.
911
- // There *should* only be one style in an insert operation.
912
-
913
- for (var j = 1; j < lines.length; j++) {
914
- for (var attr in op.attributes) {
915
- if (converters.block[attr]) {
916
- var fn = converters.block[attr];
917
- if (typeof fn === 'object') {
918
- if (group && group.type !== attr) {
919
- group = null;
920
- }
921
- if (!group && fn.group) {
922
- group = {
923
- el: fn.group(),
924
- type: attr,
925
- value: op.attributes[k],
926
- distance: 0,
927
- };
928
- root.append(group.el);
929
- }
930
-
931
- if (group) {
932
- group.el.append(line);
933
- group.distance = 0;
934
- }
935
- fn = fn.line;
936
- }
937
-
938
- fn.call(line, op.attributes, group);
939
- newLine();
940
- break
941
- }
942
- }
943
- }
944
- beginningOfLine = true;
945
- } else {
946
- for (var l = 0; l < lines.length; l++) {
947
- if ((l > 0 || beginningOfLine) && group && ++group.distance >= 2) {
948
- group = null;
949
- }
950
- applyInlineAttributes(op.attributes, ops[i + 1] && ops[i + 1].attributes);
951
- el.append(lines[l]);
952
- if (l < lines.length - 1) {
953
- newLine();
954
- }
955
- }
956
- beginningOfLine = false;
957
- }
958
- }
959
- }
960
-
961
- return root;
962
-
963
- function applyInlineAttributes(attrs, next) {
964
- var first = [],
965
- then = [];
966
- attrs = attrs || {};
967
-
968
- var tag = el,
969
- seen = {};
970
- while (tag._format) {
971
- seen[tag._format] = true;
972
- if (!attrs[tag._format]) {
973
- for (var k in seen) {
974
- delete activeInline[k];
975
- }
976
- el = tag.parent();
977
- }
978
-
979
- tag = tag.parent();
980
- }
981
-
982
- for (var attr in attrs) {
983
- if (converters.inline[attr]) {
984
- if (activeInline[attr]) {
985
- if (activeInline[attr] === attrs[attr]) {
986
- continue; // do nothing -- we should already be inside this style's tag
987
- }
988
- }
989
-
990
- if (next && attrs[attr] === next[attr]) {
991
- first.push(attr); // if the next operation has the same style, this should be the outermost tag
992
- } else {
993
- then.push(attr);
994
- }
995
- activeInline[attr] = attrs[attr];
996
- }
997
- }
998
-
999
- first.forEach(apply);
1000
- then.forEach(apply);
1001
-
1002
- function apply(fmt) {
1003
- var newEl = converters.inline[fmt].call(null, attrs[fmt]);
1004
- if (isArray_1(newEl)) {
1005
- newEl = new Node_1(newEl);
1006
- }
1007
- newEl._format = fmt;
1008
- el.append(newEl);
1009
- el = newEl;
1010
- }
1011
- }
1012
- }
1013
-
1014
- function hasBlockLevelAttribute(attrs, converters) {
1015
- for (var k in attrs) {
1016
- if (Object.keys(converters.block).includes(k)) {
1017
- return true
1018
- }
1019
- }
1020
- return false
837
+ module.exports = function (ops, converters = fromDelta_converters) {
838
+ return trimEnd_1(convert(ops, converters).render()) + '\n';
839
+ };
840
+ function convert(ops, converters) {
841
+ var group, line, el, activeInline, beginningOfLine;
842
+ var root = new Node_1();
843
+ function newLine() {
844
+ el = line = new Node_1(['', '\n']);
845
+ root.append(line);
846
+ activeInline = {};
847
+ }
848
+ newLine();
849
+ for (var i = 0; i < ops.length; i++) {
850
+ var op = ops[i];
851
+ if (isObject_1(op.insert)) {
852
+ for (var k in op.insert) {
853
+ if (converters.embed[k]) {
854
+ applyInlineAttributes(op.attributes);
855
+ converters.embed[k].call(el, op.insert[k], op.attributes);
856
+ }
857
+ }
858
+ } else {
859
+ var lines = op.insert.split('\n');
860
+ if (hasBlockLevelAttribute(op.attributes, converters)) {
861
+ // Some line-level styling (ie headings) is applied by inserting a \n
862
+ // with the style; the style applies back to the previous \n.
863
+ // There *should* only be one style in an insert operation.
864
+
865
+ for (var j = 1; j < lines.length; j++) {
866
+ for (var attr in op.attributes) {
867
+ if (converters.block[attr]) {
868
+ var fn = converters.block[attr];
869
+ if (typeof fn === 'object') {
870
+ if (group && group.type !== attr) {
871
+ group = null;
872
+ }
873
+ if (!group && fn.group) {
874
+ group = {
875
+ el: fn.group(),
876
+ type: attr,
877
+ value: op.attributes[k],
878
+ distance: 0
879
+ };
880
+ root.append(group.el);
881
+ }
882
+ if (group) {
883
+ group.el.append(line);
884
+ group.distance = 0;
885
+ }
886
+ fn = fn.line;
887
+ }
888
+ fn.call(line, op.attributes, group);
889
+ newLine();
890
+ break;
891
+ }
892
+ }
893
+ }
894
+ beginningOfLine = true;
895
+ } else {
896
+ for (var l = 0; l < lines.length; l++) {
897
+ if ((l > 0 || beginningOfLine) && group && ++group.distance >= 2) {
898
+ group = null;
899
+ }
900
+ applyInlineAttributes(op.attributes, ops[i + 1] && ops[i + 1].attributes);
901
+ el.append(lines[l]);
902
+ if (l < lines.length - 1) {
903
+ newLine();
904
+ }
905
+ }
906
+ beginningOfLine = false;
907
+ }
908
+ }
909
+ }
910
+ return root;
911
+ function applyInlineAttributes(attrs, next) {
912
+ var first = [],
913
+ then = [];
914
+ attrs = attrs || {};
915
+ var tag = el,
916
+ seen = {};
917
+ while (tag._format) {
918
+ seen[tag._format] = true;
919
+ if (!attrs[tag._format]) {
920
+ for (var k in seen) {
921
+ delete activeInline[k];
922
+ }
923
+ el = tag.parent();
924
+ }
925
+ tag = tag.parent();
926
+ }
927
+ for (var attr in attrs) {
928
+ if (converters.inline[attr]) {
929
+ if (activeInline[attr]) {
930
+ if (activeInline[attr] === attrs[attr]) {
931
+ continue; // do nothing -- we should already be inside this style's tag
932
+ }
933
+ }
934
+
935
+ if (next && attrs[attr] === next[attr]) {
936
+ first.push(attr); // if the next operation has the same style, this should be the outermost tag
937
+ } else {
938
+ then.push(attr);
939
+ }
940
+ activeInline[attr] = attrs[attr];
941
+ }
942
+ }
943
+ first.forEach(apply);
944
+ then.forEach(apply);
945
+ function apply(fmt) {
946
+ var newEl = converters.inline[fmt].call(null, attrs[fmt]);
947
+ if (isArray_1(newEl)) {
948
+ newEl = new Node_1(newEl);
949
+ }
950
+ newEl._format = fmt;
951
+ el.append(newEl);
952
+ el = newEl;
953
+ }
954
+ }
955
+ }
956
+ function hasBlockLevelAttribute(attrs, converters) {
957
+ for (var k in attrs) {
958
+ if (Object.keys(converters.block).includes(k)) {
959
+ return true;
960
+ }
961
+ }
962
+ return false;
1021
963
  }
1022
964
  });
1023
965