jclic 2.1.21 → 2.1.23

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 (175) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/jclic-node.js +9 -8
  3. package/dist/jclic-node.js.map +1 -1
  4. package/dist/jclic.min.js +2 -2
  5. package/dist/jclic.min.js.map +1 -1
  6. package/package.json +4 -4
  7. package/src/GlobalData.js +1 -1
  8. package/src/JClicPlayer.js +2 -2
  9. package/src/bags/MediaBag.js +6 -5
  10. package/dist/1078.jclic-node.js +0 -282
  11. package/dist/1078.jclic-node.js.map +0 -1
  12. package/dist/1196.jclic-node.js +0 -808
  13. package/dist/1196.jclic-node.js.map +0 -1
  14. package/dist/1253.jclic-node.js +0 -1432
  15. package/dist/1253.jclic-node.js.map +0 -1
  16. package/dist/13.jclic-node.js +0 -103
  17. package/dist/13.jclic-node.js.map +0 -1
  18. package/dist/1567.jclic-node.js +0 -2313
  19. package/dist/1567.jclic-node.js.map +0 -1
  20. package/dist/1588.jclic-node.js +0 -602
  21. package/dist/1588.jclic-node.js.map +0 -1
  22. package/dist/1725.jclic-node.js +0 -836
  23. package/dist/1725.jclic-node.js.map +0 -1
  24. package/dist/1731.jclic-node.js +0 -438
  25. package/dist/1731.jclic-node.js.map +0 -1
  26. package/dist/1842.jclic-node.js +0 -651
  27. package/dist/1842.jclic-node.js.map +0 -1
  28. package/dist/2160.jclic-node.js +0 -1016
  29. package/dist/2160.jclic-node.js.map +0 -1
  30. package/dist/222.jclic-node.js +0 -129
  31. package/dist/222.jclic-node.js.map +0 -1
  32. package/dist/2316.jclic-node.js +0 -949
  33. package/dist/2316.jclic-node.js.map +0 -1
  34. package/dist/2355.jclic-node.js +0 -371
  35. package/dist/2355.jclic-node.js.map +0 -1
  36. package/dist/2366.jclic-node.js +0 -431
  37. package/dist/2366.jclic-node.js.map +0 -1
  38. package/dist/2379.jclic-node.js +0 -202
  39. package/dist/2379.jclic-node.js.map +0 -1
  40. package/dist/2437.jclic-node.js +0 -450
  41. package/dist/2437.jclic-node.js.map +0 -1
  42. package/dist/2531.jclic-node.js +0 -869
  43. package/dist/2531.jclic-node.js.map +0 -1
  44. package/dist/2608.jclic-node.js +0 -160
  45. package/dist/2608.jclic-node.js.map +0 -1
  46. package/dist/2715.jclic-node.js +0 -554
  47. package/dist/2715.jclic-node.js.map +0 -1
  48. package/dist/277.jclic-node.js +0 -22
  49. package/dist/277.jclic-node.js.map +0 -1
  50. package/dist/2921.jclic-node.js +0 -660
  51. package/dist/2921.jclic-node.js.map +0 -1
  52. package/dist/2952.jclic-node.js +0 -101
  53. package/dist/2952.jclic-node.js.map +0 -1
  54. package/dist/3018.jclic-node.js +0 -421
  55. package/dist/3018.jclic-node.js.map +0 -1
  56. package/dist/3019.jclic-node.js +0 -682
  57. package/dist/3019.jclic-node.js.map +0 -1
  58. package/dist/3231.jclic-node.js +0 -274
  59. package/dist/3231.jclic-node.js.map +0 -1
  60. package/dist/331.jclic-node.js +0 -115
  61. package/dist/331.jclic-node.js.map +0 -1
  62. package/dist/3391.jclic-node.js +0 -276
  63. package/dist/3391.jclic-node.js.map +0 -1
  64. package/dist/3502.jclic-node.js +0 -671
  65. package/dist/3502.jclic-node.js.map +0 -1
  66. package/dist/3653.jclic-node.js +0 -982
  67. package/dist/3653.jclic-node.js.map +0 -1
  68. package/dist/371.jclic.min.js +0 -2
  69. package/dist/371.jclic.min.js.map +0 -1
  70. package/dist/3856.jclic-node.js +0 -575
  71. package/dist/3856.jclic-node.js.map +0 -1
  72. package/dist/4112.jclic-node.js +0 -659
  73. package/dist/4112.jclic-node.js.map +0 -1
  74. package/dist/4123.jclic-node.js +0 -910
  75. package/dist/4123.jclic-node.js.map +0 -1
  76. package/dist/427.jclic-node.js +0 -894
  77. package/dist/427.jclic-node.js.map +0 -1
  78. package/dist/4483.jclic-node.js +0 -327
  79. package/dist/4483.jclic-node.js.map +0 -1
  80. package/dist/4548.jclic-node.js +0 -1078
  81. package/dist/4548.jclic-node.js.map +0 -1
  82. package/dist/466.jclic-node.js +0 -99
  83. package/dist/466.jclic-node.js.map +0 -1
  84. package/dist/485.jclic-node.js +0 -783
  85. package/dist/485.jclic-node.js.map +0 -1
  86. package/dist/4921.jclic-node.js +0 -500
  87. package/dist/4921.jclic-node.js.map +0 -1
  88. package/dist/5091.jclic-node.js +0 -239
  89. package/dist/5091.jclic-node.js.map +0 -1
  90. package/dist/520.jclic-node.js +0 -550
  91. package/dist/520.jclic-node.js.map +0 -1
  92. package/dist/5312.jclic-node.js +0 -1126
  93. package/dist/5312.jclic-node.js.map +0 -1
  94. package/dist/5338.jclic-node.js +0 -212
  95. package/dist/5338.jclic-node.js.map +0 -1
  96. package/dist/5344.jclic-node.js +0 -229
  97. package/dist/5344.jclic-node.js.map +0 -1
  98. package/dist/5550.jclic-node.js +0 -238
  99. package/dist/5550.jclic-node.js.map +0 -1
  100. package/dist/5626.jclic-node.js +0 -614
  101. package/dist/5626.jclic-node.js.map +0 -1
  102. package/dist/5977.jclic-node.js +0 -1081
  103. package/dist/5977.jclic-node.js.map +0 -1
  104. package/dist/6148.jclic-node.js +0 -345
  105. package/dist/6148.jclic-node.js.map +0 -1
  106. package/dist/6176.jclic-node.js +0 -481
  107. package/dist/6176.jclic-node.js.map +0 -1
  108. package/dist/6221.jclic-node.js +0 -1072
  109. package/dist/6221.jclic-node.js.map +0 -1
  110. package/dist/6238.jclic-node.js +0 -718
  111. package/dist/6238.jclic-node.js.map +0 -1
  112. package/dist/6454.jclic-node.js +0 -1413
  113. package/dist/6454.jclic-node.js.map +0 -1
  114. package/dist/6565.jclic-node.js +0 -294
  115. package/dist/6565.jclic-node.js.map +0 -1
  116. package/dist/6579.jclic-node.js +0 -719
  117. package/dist/6579.jclic-node.js.map +0 -1
  118. package/dist/6715.jclic-node.js +0 -148
  119. package/dist/6715.jclic-node.js.map +0 -1
  120. package/dist/6777.jclic-node.js +0 -171
  121. package/dist/6777.jclic-node.js.map +0 -1
  122. package/dist/6782.jclic-node.js +0 -1611
  123. package/dist/6782.jclic-node.js.map +0 -1
  124. package/dist/6847.jclic-node.js +0 -601
  125. package/dist/6847.jclic-node.js.map +0 -1
  126. package/dist/6856.jclic-node.js +0 -252
  127. package/dist/6856.jclic-node.js.map +0 -1
  128. package/dist/696.jclic-node.js +0 -1821
  129. package/dist/696.jclic-node.js.map +0 -1
  130. package/dist/698.jclic-node.js +0 -583
  131. package/dist/698.jclic-node.js.map +0 -1
  132. package/dist/704.jclic-node.js +0 -80
  133. package/dist/704.jclic-node.js.map +0 -1
  134. package/dist/7046.jclic-node.js +0 -735
  135. package/dist/7046.jclic-node.js.map +0 -1
  136. package/dist/7220.jclic-node.js +0 -156
  137. package/dist/7220.jclic-node.js.map +0 -1
  138. package/dist/7257.jclic-node.js +0 -931
  139. package/dist/7257.jclic-node.js.map +0 -1
  140. package/dist/743.jclic-node.js +0 -583
  141. package/dist/743.jclic-node.js.map +0 -1
  142. package/dist/757.jclic-node.js +0 -1072
  143. package/dist/757.jclic-node.js.map +0 -1
  144. package/dist/7781.jclic-node.js +0 -202
  145. package/dist/7781.jclic-node.js.map +0 -1
  146. package/dist/7912.jclic-node.js +0 -2103
  147. package/dist/7912.jclic-node.js.map +0 -1
  148. package/dist/827.jclic-node.js +0 -708
  149. package/dist/827.jclic-node.js.map +0 -1
  150. package/dist/8276.jclic-node.js +0 -409
  151. package/dist/8276.jclic-node.js.map +0 -1
  152. package/dist/8322.jclic-node.js +0 -498
  153. package/dist/8322.jclic-node.js.map +0 -1
  154. package/dist/8641.jclic-node.js +0 -360
  155. package/dist/8641.jclic-node.js.map +0 -1
  156. package/dist/8837.jclic-node.js +0 -651
  157. package/dist/8837.jclic-node.js.map +0 -1
  158. package/dist/8895.jclic-node.js +0 -151
  159. package/dist/8895.jclic-node.js.map +0 -1
  160. package/dist/9072.jclic-node.js +0 -1285
  161. package/dist/9072.jclic-node.js.map +0 -1
  162. package/dist/9078.jclic-node.js +0 -935
  163. package/dist/9078.jclic-node.js.map +0 -1
  164. package/dist/9103.jclic-node.js +0 -718
  165. package/dist/9103.jclic-node.js.map +0 -1
  166. package/dist/9359.jclic-node.js +0 -145
  167. package/dist/9359.jclic-node.js.map +0 -1
  168. package/dist/9409.jclic-node.js +0 -921
  169. package/dist/9409.jclic-node.js.map +0 -1
  170. package/dist/9513.jclic-node.js +0 -720
  171. package/dist/9513.jclic-node.js.map +0 -1
  172. package/dist/9704.jclic-node.js +0 -81
  173. package/dist/9704.jclic-node.js.map +0 -1
  174. package/dist/9950.jclic-node.js +0 -827
  175. package/dist/9950.jclic-node.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"9513.jclic-node.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEgE;AAC7B;;AAEnC;AACA;AACA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACO,0BAA0B,wDAAS;AAC1C;AACA;AACA,aAAa,oBAAoB;AACjC,aAAa,sBAAsB;AACnC,aAAa,gBAAgB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,sCAAsC;AACnD;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uEAAuE,2BAA2B;AAClG,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,4CAA4C;AAC3D,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,4CAA4C;AAChE,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,yBAAyB,mDAAO;AAChC;;AAEA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,iBAAiB,wDAAS;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA,+BAA+B,wDAAS;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAa,kBAAkB;AAC/B,aAAa,QAAQ;AACrB;AACA;AACA;AACA,mBAAmB,oDAAK;AACxB,wBAAwB,wDAAS;AACjC;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA,wBAAwB,wDAAS;AACjC;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA,uBAAuB,wDAAS,eAAe,wDAAS;AACxD;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,6DAA6D;AACzE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;;AAGA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM,yDAAyD;AAC/D,aAAa,mCAAmC;AAChD;AACA,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,yCAAyC,wDAAwD;AACjG,4DAA4D,kDAAkD;AAC9G,aAAa,mCAAmC;AAChD;AACA,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,mCAAmC;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM,qDAAM;AACZ;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA,uBAAuB,wDAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,8EAA8E;AAC7F,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,8EAA8E;AACrG,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA,WAAW,8EAA8E;AACzF,2BAA2B,4CAA4C;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,+CAA+C,GAAG,wBAAwB;AAC/G;AACA;AACA;;AAEA;AACA,eAAe,8EAA8E;AAC7F,MAAM,4CAA4C;AAClD;AACA;AACA;AACA;AACA;AACA,2BAA2B,mEAAmE;AAC9F;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,yBAAyB,6EAA6E;AACtG;AACA,aAAa,SAAS,iCAAiC,kDAAkD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA;AACA,YAAY,sBAAsB;AAClC;AACA;AACA,UAAU,4CAA4C;AACtD;AACA;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA,CAAC;;AAED,iEAAe,WAAW,EAAC","sources":["webpack://jclic/./src/boxes/AbstractBox.js"],"sourcesContent":["/**\n * File : boxes/AbstractBox.js\n * Created : 18/04/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport { Rectangle, Point, Dimension, Stroke } from '../AWT.js';\nimport BoxBase from './BoxBase.js';\n\n/**\n * This abstract class is the base for most graphic components of JClic. It describes an area\n * (by default an {@link module:AWT.Rectangle}) with some special properties that determine how it must\n * be drawn on screen.\n *\n * Some types of boxes can act as containers for other boxes, establishing a hierarchy of dependences.\n * @abstract\n * @extends module:AWT.Rectangle\n */\nexport class AbstractBox extends Rectangle {\n /**\n * AbstractBox constructor\n * @param {module:AbstractBox} parent - The AbstractBox to which this one belongs\n * @param {module:AWT.Container} container - The container where this box is placed.\n * @param {module:BoxBase} boxBase - The object where colors, fonts, border and other graphic properties\n * of this box are defined.\n */\n constructor(parent, container, boxBase) {\n // AbstractBox extends AWT.Rectangle\n super();\n this.container = container;\n this.parent = parent;\n this.boxBase = boxBase;\n this.shape = this;\n this.specialShape = false;\n this.visible = true;\n }\n\n /**\n * Setter method for `parent`\n * @param {module:boxes/AbstractBox.AbstractBox} parent - The new parent of this box\n */\n setParent(parent) {\n this.parent = parent;\n }\n\n /**\n * Gets the current parent of this box\n * @returns {module:boxes/AbstractBox.AbstractBox}\n */\n getParent() {\n return this.parent;\n }\n\n /**\n * Finisher method\n */\n end() {\n }\n\n /**\n * Setter method for `container`\n * @param {module:AWT.Container} newContainer - The new Container assigned to this box\n */\n setContainer(newContainer) {\n this.container = newContainer;\n if (this.$hostedComponent && this.container && this.container.$div) {\n this.$hostedComponent.detach();\n this.container.$div.append(this.$hostedComponent);\n }\n }\n\n /**\n * Gets the `container` attribute of this box, without checking its parent\n * @returns {module:AWT.Container}\n */\n getContainerX() {\n return this.container;\n }\n\n /**\n * Gets the container associated to this box, asking its parents when `null`.\n * @returns {module:AWT.Container}\n */\n getContainerResolve() {\n let ab = this;\n while (ab.container === null && ab.parent !== null)\n ab = ab.parent;\n return ab.container;\n }\n\n /**\n * Invalidates the zone corresponding to this box in the associated {@link module:AWT.Container}, if any.\n * @param {module:AWT.Rectangle} rect - The rectangle to be invalidated. When `null`, it's the full\n * container area.\n */\n invalidate(rect) {\n const cnt = this.getContainerResolve();\n if (cnt)\n cnt.invalidate(rect);\n }\n\n /**\n * Sets the {@link module:boxes/BoxBase.BoxBase BoxBase} of this box\n * @param {module:boxes/BoxBase.BoxBase} boxBase - The new BoxBase\n */\n setBoxBase(boxBase) {\n this.boxBase = boxBase;\n this.invalidate();\n }\n\n /**\n * Gets the real {@link module:boxes/BoxBase.BoxBase BoxBase} associated to this box, scanning down parent relationships.\n * @returns {module:boxes/BoxBase.BoxBase}\n */\n getBoxBaseResolve() {\n let ab = this;\n while (!ab.boxBase && ab.parent)\n ab = ab.parent;\n return ab.boxBase || BoxBase.DEFAULT_BOX_BASE;\n }\n\n /**\n * Sets the shape used to draw the content of this box\n * @param {module:AWT.Shape} sh - The shape to be set\n */\n setShape(sh) {\n this.shape = sh;\n this.specialShape = true;\n this.invalidate();\n super.setBounds(sh.getBounds());\n this.invalidate();\n }\n\n /**\n * Gets the current shape used in this box\n * @returns {module:AWT.Shape}\n */\n getShape() {\n return this.shape;\n }\n\n /**\n * Check if this box contains the specified point\n * @override\n * @param {module:AWT.Point} p - The point to be checked\n * @returns {boolean}\n */\n contains(p) {\n return this.shape === this ? super.contains(p) : this.shape.contains(p);\n }\n\n /**\n * Sets a new size and/or dimension to this box\n * @override\n * @param {AWT.Rectangle|number} rect - An AWT.Rectangle object, or the `x` coordinate of the\n * upper-left corner of a new rectangle.\n * @param {number} [y] - `y` coordinate of the upper-left corner of the new rectangle.\n * @param {number} [w] - Width of the new rectangle.\n * @param {number} [h] - Height of the new rectangle.\n */\n setBounds(rect, y, w, h) {\n if (typeof rect === 'number')\n // arguments are co-ordinates and size\n rect = new Rectangle(rect, y, w, h);\n // Rectangle comparision\n if (this.equals(rect))\n return;\n\n const sizeChanged = !this.dim.equals(rect.dim);\n if (this.specialShape) {\n if (sizeChanged) {\n this.shape.scaleBy(new Dimension(rect.dim.width / this.dim.width, rect.dim.height / this.dim.height));\n this.setShape(this.shape);\n }\n if (!this.pos.equals(rect.pos)) {\n this.shape.moveTo(rect.pos);\n }\n this.setShape(this.shape);\n } else\n super.setBounds(rect);\n\n if (this.$hostedComponent)\n this.setHostedComponentBounds(sizeChanged);\n\n return this;\n }\n\n /**\n * Sets a new location for this box. In JClic this method was named `setLocation`\n * @param {AWT.Point|number} newPos - A point or the `x` coordinate of a new point.\n * @param {number} [y] - The `y` coordinate of a new point.\n */\n moveTo(newPos, y) {\n if (typeof newPos === 'number')\n newPos = new Point(newPos, y);\n this.setBounds((new Rectangle(this)).moveTo(newPos));\n }\n\n /**\n * Sets a new location to this box. In JClic this method was named `translate`.\n * @param {number} dx - The displacement on the X axis\n * @param {number} dy - The displacement on the Y axis\n */\n moveBy(dx, dy) {\n this.setBounds((new Rectangle(this)).moveBy(dx, dy));\n }\n\n /**\n * Changes the size of this box\n * @param {number} width\n * @param {number} height\n */\n setSize(width, height) {\n this.setBounds(new Rectangle(this.pos, new Dimension(width, height)));\n }\n\n /**\n * Checks if this box has border\n * @returns {boolean}\n */\n hasBorder() {\n return this.border;\n }\n\n /**\n * Sets/unsets a border to this box\n * @param {boolean} newVal - `true` to set a border.\n */\n setBorder(newVal) {\n if (!newVal)\n this.invalidate();\n this.border = newVal;\n if (newVal)\n this.invalidate();\n }\n\n /**\n * Checks if this box is fully visible\n * @returns {boolean}\n */\n isVisible() {\n return this.visible;\n }\n\n /**\n * Sets this box visible or invisible\n * @param {boolean} newVal - `true` for visible\n */\n setVisible(newVal) {\n this.visible = newVal;\n this.setHostedComponentVisible();\n this.invalidate();\n }\n\n /**\n * Makes {@link module:boxes/AbstractBox.AbstractBox#$hostedComponent} visible or invisible, based on the value of\n * the AbstractBox `visible` flag.\n */\n setHostedComponentVisible() {\n if (this.$hostedComponent)\n this.$hostedComponent.css('visibility', this.visible ? 'visible' : 'hidden');\n }\n\n /**\n * Checks if this box is temporary hidden\n * @returns {boolean}\n */\n isTemporaryHidden() {\n return this.temporaryHidden;\n }\n\n /**\n * Makes this box temporary hidden (newVal `true`) or resets its original state (newVal `false`)\n * @param {boolean} newVal\n */\n setTemporaryHidden(newVal) {\n this.temporaryHidden = newVal;\n }\n\n /**\n * Checks if this box is currently inactive.\n * @returns {boolean}\n */\n isInactive() {\n return this.inactive;\n }\n\n /**\n * Makes this box active (`false`) or inactive (`true`)\n * @param {boolean} newVal\n */\n setInactive(newVal) {\n this.inactive = newVal;\n if (this.$hostedComponent) {\n this.setHostedComponentColors();\n this.setHostedComponentVisible();\n } else {\n if (this.$accessibleElement) {\n const disabled = this.isInactive() && !this.accessibleAlwaysActive;\n this.$accessibleElement.prop({\n disabled: disabled,\n tabindex: disabled ? -1 : 0\n });\n }\n this.invalidate();\n }\n }\n\n /**\n * Checks if this box is in `inverted` state.\n * @returns {boolean}\n */\n isInverted() {\n return this.inverted;\n }\n\n\n /**\n * Puts this box in `inverted` mode or restores its original state.\n * @param {boolean} newVal\n */\n setInverted(newVal) {\n this.inverted = newVal;\n if (this.$hostedComponent)\n this.setHostedComponentColors();\n else\n this.invalidate();\n }\n\n /**\n * Checks if this box is `marked`\n * @returns {boolean}\n */\n isMarked() {\n return this.marked;\n }\n\n /**\n * Sets this box in `marked` mode, or restores its original state.\n * @param {boolean} newVal\n */\n setMarked(newVal) {\n if (!newVal)\n this.invalidate();\n this.marked = newVal;\n if (this.$hostedComponent) {\n this.setHostedComponentColors();\n this.setHostedComponentBorder();\n } else if (newVal)\n this.invalidate();\n }\n\n /**\n * Checks if this box has the input focus\n * @returns {boolean}\n */\n isFocused() {\n return this.focused;\n }\n\n /**\n *\n * Sets or unsets the input focus to this box.\n * @param {boolean} newVal\n */\n setFocused(newVal) {\n if (!newVal)\n this.invalidate();\n this.focused = newVal;\n if (newVal)\n this.invalidate();\n // Put hosted component on top\n if (this.$hostedComponent)\n this.$hostedComponent.css('z-index', this.focused ? 20 : 2);\n }\n\n /**\n * Checks if this box is in `alternative` state.\n * @returns {boolean}\n */\n isAlternative() {\n return this.alternative;\n }\n\n /**\n * Sets this box in `alternative` mode, or restores its original state.\n * @param {boolean} newVal\n */\n setAlternative(newVal) {\n this.alternative = newVal;\n this.invalidate();\n }\n\n /**\n * Draws the content of this box on an HTML `canvas` element. At this level, only background\n * and border are painted/stroked. Derived classes should implement specific drawing tasks in\n * {@link module:boxes/AbstractBox.AbstractBox#updateContent}.\n * @param {external:CanvasRenderingContext2D} ctx - The canvas rendering context used to draw the\n * box content.\n * @param {module:AWT.Rectangle} [dirtyRegion=null] - The area that must be repainted. `null` refers to the whole box.\n */\n update(ctx, dirtyRegion = null) {\n if (this.isEmpty() || !this.isVisible() || this.isTemporaryHidden())\n return false;\n\n if (dirtyRegion && !this.shape.intersects(dirtyRegion))\n return false;\n\n /**\n * TODO: Implement clipping\n Shape saveClip=new Area(g2.getClip())\n Area clip=new Area(saveClip)\n clip.intersect(new Area(shape))\n g2.setClip(clip)\n */\n\n const style = this.getBoxBaseResolve();\n if (!style.transparent && !style.dontFill && !this.tmpTrans) {\n if (!style.bgGradient || style.bgGradient.hasTransparency()) {\n // Prepare the rendering context\n ctx.fillStyle = this.inactive ?\n style.inactiveColor :\n this.inverted ? style.textColor : style.backColor;\n // Fill the shape\n this.shape.fill(ctx, dirtyRegion);\n }\n if (style.bgGradient) {\n ctx.fillStyle = style.bgGradient.getGradient(ctx, this.shape.getBounds());\n this.shape.fill(ctx, dirtyRegion);\n }\n // Reset the canvas context\n ctx.fillStyle = 'black';\n }\n\n if (!this.$hostedComponent)\n this.updateContent(ctx, dirtyRegion);\n\n this.drawBorder(ctx);\n return true;\n }\n\n /**\n * Here is where classes derived from {@link module:boxes/AbstractBox.AbstractBox AbstractBox} should implement the drawing of its\n * content. Background and border are already painted in {@link module:boxes/AbstractBox.AbstractBox#update}.\n * @param {external:CanvasRenderingContext2D} _ctx - The canvas rendering context used to draw the\n * box content.\n * @param {module:AWT.Rectangle} [_dirtyRegion] - The area that must be repainted. `null` refers to the whole box.\n */\n //\n // Abstract method, to be implemented in subclasses\n updateContent(_ctx, _dirtyRegion) {\n }\n\n /**\n * Draws the box border\n * @param {external:CanvasRenderingContext2D} ctx - The canvas rendering context where the border\n * will be drawn.\n */\n drawBorder(ctx) {\n if (this.border || this.marked) {\n const style = this.getBoxBaseResolve();\n\n // Prepare stroke settings\n ctx.strokeStyle = style.borderColor;\n style[this.marked ? 'markerStroke' : 'borderStroke'].setStroke(ctx);\n if (this.marked)\n ctx.globalCompositeOperation = 'xor';\n\n // Draw border\n this.shape.stroke(ctx);\n\n // Reset ctx default values\n if (this.marked)\n ctx.globalCompositeOperation = 'source-over';\n ctx.strokeStyle = 'black';\n Stroke.prototype.setStroke(ctx);\n }\n }\n\n /**\n * Returns the enclosing Rectangle of this box including its border (if any)\n * @returns {module:AWT.Rectangle}\n */\n getBorderBounds() {\n const result = new Rectangle(this.getBounds());\n if (this.border || this.marked) {\n const style = this.getBoxBaseResolve();\n const w = style[this.marked ? 'markerStroke' : 'borderStroke'].lineWidth;\n result.moveBy(-w / 2, -w / 2);\n result.dim.width += w;\n result.dim.height += w;\n }\n return result;\n }\n\n /**\n * Sets the {@link module:boxes/AbstractBox.AbstractBox#$hostedComponent $hostedComponent} member.\n * @param {external:jQuery} $hc - The jQuery DOM component hosted by this box.\n */\n setHostedComponent($hc) {\n if (this.$hostedComponent)\n this.$hostedComponent.detach();\n\n this.$hostedComponent = $hc;\n\n if (this.$hostedComponent) {\n this.setContainer(this.container);\n this.setHostedComponentColors();\n this.setHostedComponentBorder();\n this.setHostedComponentBounds(true);\n this.setHostedComponentVisible();\n this.setFocused(this.focused);\n }\n }\n\n /**\n * Gets the current {@link module:boxes/AbstractBox.AbstractBox#$hostedComponent|$hostedComponent} member\n * @returns {external:jQuery}\n */\n getHostedComponent() {\n return this.$hostedComponent;\n }\n\n /**\n * Sets {@link module:boxes/AbstractBox.AbstractBox#$hostedComponent|$hostedComponent} colors and other css properties\n * based on the current {@link module:boxes/BoxBase.BoxBase BoxBase} of this box.\n */\n setHostedComponentColors() {\n if (this.$hostedComponent) {\n const style = this.getBoxBaseResolve();\n const css = style.getCSS(null, this.inactive, this.inverted, this.alternative);\n // Check if cell has background gradient and animated gif\n if (this.$hostedComponent.data('background-image') && css['background-image'])\n css['background-image'] = `${this.$hostedComponent.data('background-image')},${css['background-image']}`;\n this.$hostedComponent.css(css);\n }\n }\n\n /**\n * Sets the {@link module:boxes/AbstractBox.AbstractBox#$hostedComponent|$hostedComponent} border, based on the current\n * {@link module:boxes/BoxBase.BoxBase BoxBase} of this box.\n */\n setHostedComponentBorder() {\n if (this.$hostedComponent && (this.border || this.marked)) {\n const style = this.getBoxBaseResolve();\n this.$hostedComponent.css({\n 'border-width': `${style.get(this.marked ? 'markerStroke' : 'borderStroke').lineWidth}px`,\n 'border-style': 'solid',\n 'border-color': style.get('borderColor')\n });\n }\n }\n\n /**\n * Places and resizes {@link module:boxes/AbstractBox.AbstractBox#$hostedComponent|$hostedComponent}, based on the size\n * and position of this box.\n * @param {boolean} _sizeChanged - `true` when this {@link module:boxes/ActiveBox.ActiveBox ActiveBox} has changed its size\n */\n setHostedComponentBounds(_sizeChanged) {\n if (this.$hostedComponent) {\n const\n r = this.getBounds(),\n b = this.border || this.marked ? this.getBoxBaseResolve().get(this.marked ? 'markerStroke' : 'borderStroke').lineWidth : 0;\n this.$hostedComponent.css({\n position: 'absolute',\n width: r.dim.width - 2 * b + 'px',\n height: r.dim.height - 2 * b + 'px',\n top: r.pos.y + 'px',\n left: r.pos.x + 'px'\n });\n }\n }\n}\n\nObject.assign(AbstractBox.prototype, {\n /**\n * The parent AbstractBox (can be `null`)\n * @name module:boxes/AbstractBox.AbstractBox#parent\n * @type {module:boxes/AbstractBox.AbstractBox} */\n parent: null,\n /**\n * The Container to which this AbstractBox belongs\n * @name module:boxes/AbstractBox.AbstractBox#container\n * @type {module:AWT.Container} */\n container: null,\n /**\n * The {@link module:boxes/BoxBase.BoxBase BoxBase} related to this AbstractBox. When `null`, the parent can provide an\n * alternative one.\n * @name module:boxes/AbstractBox.AbstractBox#boxBase\n * @type {module:boxes/BoxBase.BoxBase} */\n boxBase: null,\n /**\n * Whether this box has a border or not\n * @name module:boxes/AbstractBox.AbstractBox#border\n * @type {boolean} */\n border: false,\n /**\n * The shape of this box (the box Rectangle or a special Shape, if set)\n * @name module:boxes/AbstractBox.AbstractBox#shape\n * @type {module:AWT.Shape} */\n shape: null,\n /**\n * Whether this box has a shape that is not a rectangle\n * @name module:boxes/AbstractBox.AbstractBox#specialShape\n * @type {boolean} */\n specialShape: false,\n /**\n * Whether this box is visible or not\n * @name module:boxes/AbstractBox.AbstractBox#visible\n * @type {boolean} */\n visible: true,\n /**\n * Used to temporary hide a box while other drawing operations are done\n * @name module:boxes/AbstractBox.AbstractBox#temporaryHidden\n * @type {boolean} */\n temporaryHidden: false,\n /**\n * Cells with this attribute will be transparent but with painted border\n * @name module:boxes/AbstractBox.AbstractBox#tmpTrans\n * @type {boolean}*/\n tmpTrans: false,\n /**\n * Whether this box is active or inactive\n * @name module:boxes/AbstractBox.AbstractBox#inactive\n * @type {boolean} */\n inactive: false,\n /**\n * Whether this box must be displayed with inverted or regular colors\n * @name module:boxes/AbstractBox.AbstractBox#inverted\n * @type {boolean} */\n inverted: false,\n /**\n * Whether this box must be displayed with alternative or regular color and font settings\n * @name module:boxes/AbstractBox.AbstractBox#alternative\n * @type {boolean} */\n alternative: false,\n /**\n * Whether this box is marked (selected) or not\n * @name module:boxes/AbstractBox.AbstractBox#marked\n * @type {boolean} */\n marked: false,\n /**\n * Whether this box holds the input focus\n * @name module:boxes/AbstractBox.AbstractBox#focused\n * @type {boolean} */\n focused: false,\n /**\n * Text to be used in accessible contexts\n * @name module:boxes/AbstractBox.AbstractBox#accessibleText\n * @type {string} */\n accessibleText: '',\n /**\n * Describes the main role of this box on the activity. Useful in wai-aria descriptions.\n * @name module:boxes/AbstractBox.AbstractBox#role\n * @type {string} */\n role: 'cell',\n /**\n * DOM element used to display this cell content in wai-aria contexts\n * @name module:boxes/AbstractBox.AbstractBox#$accessibleElement\n * @type {external:jQuery} */\n $accessibleElement: null,\n /**\n * Flag indicating that $accessibleElement should be always active\n * @name module:boxes/AbstractBox.AbstractBox#accessibleAlwaysActive\n * @type {boolean} */\n accessibleAlwaysActive: false,\n /**\n * An external JQuery DOM element hosted by this box\n * @name module:boxes/AbstractBox.AbstractBox#$hostedComponent\n * @type {external:jQuery} */\n $hostedComponent: null,\n});\n\nexport default AbstractBox;\n"],"names":[],"sourceRoot":""}
@@ -1,81 +0,0 @@
1
- "use strict";
2
- exports.id = 9704;
3
- exports.ids = [9704];
4
- exports.modules = {
5
-
6
- /***/ 9704:
7
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
8
-
9
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
10
- __webpack_require__.r(__webpack_exports__);
11
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
13
- /* harmony export */ });
14
- /*!
15
- * File : init-jsdom.js
16
- * Created : 12/11/2024
17
- * By : Francesc Busquets <francesc@gmail.com>
18
- *
19
- * JClic.js
20
- * An HTML5 player of JClic activities
21
- * https://projectestac.github.io/jclic.js
22
- *
23
- * @source https://github.com/projectestac/jclic.js
24
- *
25
- * @license EUPL-1.2
26
- * @licstart
27
- * (c) 2000-2024 Educational Telematic Network of Catalonia (XTEC)
28
- *
29
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
30
- * the European Commission- subsequent versions of the EUPL (the "Licence");
31
- * You may not use this work except in compliance with the Licence.
32
- *
33
- * You may obtain a copy of the Licence at:
34
- * https://joinup.ec.europa.eu/software/page/eupl
35
- *
36
- * Unless required by applicable law or agreed to in writing, software
37
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
38
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
39
- * Licence for the specific language governing permissions and limitations
40
- * under the Licence.
41
- * @licend
42
- * @module
43
- */
44
-
45
- /* global global, console */
46
-
47
- /**
48
- * Initializes some global variables needed for JClic in order to be used in nodeJS
49
- */
50
-
51
- // import jsdom from 'jsdom';
52
- const { default: jsdom } = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 2325, 23));
53
-
54
- // import { DOMParser } from '@xmldom/xmldom';
55
- const { default: xmlDOM } = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 511, 23));
56
- const { DOMParser } = xmlDOM;
57
-
58
- const dom = await new jsdom.JSDOM('<!DOCTYPE html><head></head><body></body>', { url: 'https://example.com' });
59
-
60
- console.log('Hola!');
61
- console.log(dom.window);
62
-
63
- global.window = dom.window;
64
- global.document = dom.window.document;
65
- global.navigator = dom.window.navigator;
66
- global.Image = dom.window.Image;
67
- global.Audio = dom.window.Audio;
68
- global.XMLHttpRequest = dom.window.XMLHttpRequest;
69
- global.DOMParser = DOMParser;
70
-
71
- // This is just a side-effect module
72
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({});
73
-
74
- __webpack_async_result__();
75
- } catch(e) { __webpack_async_result__(e); } }, 1);
76
-
77
- /***/ })
78
-
79
- };
80
- ;
81
- //# sourceMappingURL=9704.jclic-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"9704.jclic-node.js","mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,QAAQ,iBAAiB,QAAQ,+FAAe;;AAEhD,YAAY,YAAY;AACxB,QAAQ,kBAAkB,QAAQ,8FAAwB;AAC1D,QAAQ,YAAY;;AAEpB,iFAAiF,4BAA4B;;AAE7G;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iEAAe,EAAE,EAAC","sources":["webpack://jclic/./src/init-jsdom.js"],"sourcesContent":["/*!\n * File : init-jsdom.js\n * Created : 12/11/2024\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2024 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\n/* global global, console */\n\n/**\n * Initializes some global variables needed for JClic in order to be used in nodeJS\n */\n\n// import jsdom from 'jsdom';\nconst { default: jsdom } = await import('jsdom');\n\n// import { DOMParser } from '@xmldom/xmldom';\nconst { default: xmlDOM } = await import('@xmldom/xmldom');\nconst { DOMParser } = xmlDOM;\n\nconst dom = await new jsdom.JSDOM('<!DOCTYPE html><head></head><body></body>', { url: 'https://example.com' });\n\nconsole.log('Hola!');\nconsole.log(dom.window);\n\nglobal.window = dom.window;\nglobal.document = dom.window.document;\nglobal.navigator = dom.window.navigator;\nglobal.Image = dom.window.Image;\nglobal.Audio = dom.window.Audio;\nglobal.XMLHttpRequest = dom.window.XMLHttpRequest;\nglobal.DOMParser = DOMParser;\n\n// This is just a side-effect module\nexport default {};\n"],"names":[],"sourceRoot":""}