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,931 +0,0 @@
1
- "use strict";
2
- exports.id = 7257;
3
- exports.ids = [7257,7781,6148];
4
- exports.modules = {
5
-
6
- /***/ 7257:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
11
- /* harmony export */ });
12
- /* unused harmony export ExchangePuzzle */
13
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7750);
14
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
15
- /* harmony import */ var _Activity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1567);
16
- /* harmony import */ var _boxes_ActiveBoxGrid_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7781);
17
- /* harmony import */ var _boxes_BoxBag_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9205);
18
- /* harmony import */ var _boxes_BoxConnector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6148);
19
- /* harmony import */ var _AWT_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7912);
20
- /**
21
- * File : activities/puzzles/ExchangePuzzle.js
22
- * Created : 30/05/2015
23
- * By : Francesc Busquets <francesc@gmail.com>
24
- *
25
- * JClic.js
26
- * An HTML5 player of JClic activities
27
- * https://projectestac.github.io/jclic.js
28
- *
29
- * @source https://github.com/projectestac/jclic.js
30
- *
31
- * @license EUPL-1.2
32
- * @licstart
33
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
34
- *
35
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
36
- * the European Commission- subsequent versions of the EUPL (the "Licence");
37
- * You may not use this work except in compliance with the Licence.
38
- *
39
- * You may obtain a copy of the Licence at:
40
- * https://joinup.ec.europa.eu/software/page/eupl
41
- *
42
- * Unless required by applicable law or agreed to in writing, software
43
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
44
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
45
- * Licence for the specific language governing permissions and limitations
46
- * under the Licence.
47
- * @licend
48
- * @module
49
- */
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
- /**
59
- * This class of {@link module:Activity.Activity Activity} shows only one panel with shuffled {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects.
60
- * To solve the activity, each cell must exchange its location with another one. When all cells are
61
- * on place, the activity is done.
62
- * @extends module:Activity.Activity
63
- */
64
- class ExchangePuzzle extends _Activity_js__WEBPACK_IMPORTED_MODULE_1__/* .Activity */ .I {
65
- /**
66
- * ExchangePuzzle constructor
67
- * @param {module:project/JClicProject.JClicProject} project - The {@link module:project/JClicProject.JClicProject JClicProject} to which this activity belongs
68
- */
69
- constructor(project) {
70
- super(project);
71
- }
72
-
73
- /**
74
- * Retrieves the minimum number of actions needed to solve this activity.
75
- * @override
76
- * @returns {number}
77
- */
78
- getMinNumActions() {
79
- return this.abc.primary.getNumCells();
80
- }
81
-
82
- /**
83
- * Whether or not the activity uses random to shuffle internal components
84
- * @override
85
- * @returns {boolean}
86
- */
87
- hasRandom() {
88
- return true;
89
- }
90
-
91
- /**
92
- * When `true`, the activity must always be shuffled
93
- * @override
94
- * @returns {boolean}
95
- */
96
- shuffleAlways() {
97
- return true;
98
- }
99
-
100
- /**
101
- * Whether the activity allows the user to request help.
102
- * @override
103
- * @returns {boolean}
104
- */
105
- helpSolutionAllowed() {
106
- return true;
107
- }
108
- }
109
-
110
- /**
111
- * The {@link module:Activity.ActivityPanel ActivityPanel} where activities of type {@link module:activities/puzzles/ExchangePuzzle.ExchangePuzzle ExchangePuzzle} are played.
112
- * @extends module:Activity.ActivityPanel
113
- */
114
- class ExchangePuzzlePanel extends _Activity_js__WEBPACK_IMPORTED_MODULE_1__/* .ActivityPanel */ .S {
115
- /**
116
- * ExchangePuzzlePanel constructor
117
- * @param {module:Activity.Activity} act - The {@link module:Activity.Activity Activity} to which this Panel belongs
118
- * @param {module:JClicPlayer.JClicPlayer} ps - Any object implementing the methods defined in the
119
- * [PlayStation](http://projectestac.github.io/jclic/apidoc/edu/xtec/jclic/PlayStation.html) Java interface.
120
- * @param {external:jQuery} [$div] - The jQuery DOM element where this Panel will deploy
121
- */
122
- constructor(act, ps, $div) {
123
- super(act, ps, $div);
124
- }
125
-
126
- /**
127
- * Miscellaneous cleaning operations
128
- * @override
129
- */
130
- clear() {
131
- if (this.bg) {
132
- this.bg.end();
133
- this.bg = null;
134
- }
135
- }
136
-
137
- /**
138
- * Prepares the visual components of the activity
139
- * @override
140
- */
141
- buildVisualComponents() {
142
- if (this.firstRun)
143
- super.buildVisualComponents();
144
- this.clear();
145
-
146
- const abc = this.act.abc['primary'];
147
- if (abc) {
148
- if (abc.image)
149
- abc.setImgContent(this.act.project.mediaBag, null, false);
150
-
151
- if (this.act.acp !== null)
152
- this.act.acp.generateContent(abc.nch, abc.ncw, [abc], false);
153
-
154
- this.bg = _boxes_ActiveBoxGrid_js__WEBPACK_IMPORTED_MODULE_2__["default"].createEmptyGrid(null, this, this.act.margin, this.act.margin, abc);
155
- this.bg.setContent(abc);
156
- this.bg.setVisible(true);
157
- }
158
- }
159
-
160
- /**
161
- * Basic initialization procedure
162
- * @override
163
- */
164
- initActivity() {
165
- super.initActivity();
166
- if (!this.firstRun)
167
- this.buildVisualComponents();
168
- else
169
- this.firstRun = false;
170
-
171
- if (this.bg) {
172
- this.shuffle([this.bg], true, true);
173
- if (this.useOrder)
174
- this.currentItem = this.bg.getNextItem(-1);
175
- this.setAndPlayMsg('initial', 'start');
176
- this.invalidate().update();
177
- this.playing = true;
178
- }
179
- }
180
-
181
- /**
182
- * Updates the graphic content of this panel.
183
- * This method will be called from {@link module:AWT.Container#update} when needed.
184
- * @override
185
- * @param {module:AWT.Rectangle} dirtyRegion - Specifies the area to be updated. When `null`,
186
- * it's the whole panel.
187
- */
188
- updateContent(dirtyRegion) {
189
- super.updateContent(dirtyRegion);
190
- if (this.bg && this.$canvas) {
191
- const
192
- canvas = this.$canvas.get(-1),
193
- ctx = canvas.getContext('2d');
194
- if (!dirtyRegion)
195
- dirtyRegion = new _AWT_js__WEBPACK_IMPORTED_MODULE_5__/* .Rectangle */ .M_(0, 0, canvas.width, canvas.height);
196
- ctx.clearRect(dirtyRegion.pos.x, dirtyRegion.pos.y, dirtyRegion.dim.width, dirtyRegion.dim.height);
197
- this.bg.update(ctx, dirtyRegion);
198
- }
199
- return this;
200
- }
201
-
202
- /**
203
- * Sets the real dimension of this panel.
204
- * @override
205
- * @param {module:AWT.Dimension} preferredMaxSize - The maximum surface available for the activity panel
206
- * @returns {module:AWT.Dimension}
207
- */
208
- setDimension(preferredMaxSize) {
209
- return !this.bg || this.getBounds().equals(preferredMaxSize) ?
210
- preferredMaxSize :
211
- _boxes_BoxBag_js__WEBPACK_IMPORTED_MODULE_3__["default"].layoutSingle(preferredMaxSize, this.bg, this.act.margin);
212
- }
213
-
214
- /**
215
- * Sets the size and position of this activity panel
216
- * @override
217
- * @param {module:AWT.Rectangle} rect
218
- */
219
- setBounds(rect) {
220
- if (this.$canvas)
221
- this.$canvas.remove();
222
-
223
- super.setBounds(rect);
224
- if (this.bg) {
225
- // Create the main canvas
226
- this.$canvas = jquery__WEBPACK_IMPORTED_MODULE_0___default()(`<canvas width="${rect.dim.width}" height="${rect.dim.height}"/>`).css({
227
- position: 'absolute',
228
- top: 0,
229
- left: 0
230
- });
231
- this.$div.append(this.$canvas);
232
-
233
- // Create a [BoxConnector](BoxConnector.html) and attach it to the canvas context
234
- this.bc = new _boxes_BoxConnector_js__WEBPACK_IMPORTED_MODULE_4__["default"](this, this.$canvas);
235
-
236
- // Repaint all
237
- this.invalidate().update();
238
- }
239
- }
240
-
241
- /**
242
- * Builds the accessible components needed for this ActivityPanel
243
- * This method is called when all main elements are placed and visible, when the activity is ready
244
- * to start or when resized.
245
- * @override
246
- */
247
- buildAccessibleComponents() {
248
- if (this.$canvas && this.accessibleCanvas && this.bg) {
249
- super.buildAccessibleComponents();
250
- this.bg.buildAccessibleElements(this.$canvas, this.$div, 'mousedown');
251
- }
252
- }
253
-
254
- /**
255
- * Main handler used to process mouse, touch, keyboard and edit events
256
- * @override
257
- * @param {external:Event} event - The HTML event to be processed
258
- * @returns {boolean} - When this event handler returns `false`, jQuery will stop its
259
- * propagation through the DOM tree. See: {@link http://api.jquery.com/on}
260
- */
261
- processEvent(event) {
262
- if (this.bc && this.playing) {
263
-
264
- //
265
- // The [AWT.Point](AWT.html#Point) where the mouse or touch event has been originated
266
- let p = null;
267
- //
268
- // Two [ActiveBox](ActiveBox.html) pointers used for the [BoxConnector](BoxConnector.html)
269
- // `origin` and `dest` points.
270
- let bx1, bx2;
271
- // Array to be filled with actions to be executed at the end of event processing
272
- const delayedActions = [];
273
- //
274
- // _touchend_ event don't provide pageX nor pageY information
275
- if (event.type === 'touchend')
276
- p = this.bc.active ? this.bc.dest.clone() : new _AWT_js__WEBPACK_IMPORTED_MODULE_5__/* .Point */ .bR();
277
- else {
278
- // Touch events can have more than one touch, so `pageX` must be obtained from `touches[0]`
279
- const
280
- x = event.originalEvent && event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX,
281
- y = event.originalEvent && event.originalEvent.touches ? event.originalEvent.touches[0].pageY : event.pageY;
282
- p = new _AWT_js__WEBPACK_IMPORTED_MODULE_5__/* .Point */ .bR(x - this.$div.offset().left, y - this.$div.offset().top);
283
- }
284
-
285
- // Flag for tracking `mouseup` events
286
- let up = false;
287
-
288
- switch (event.type) {
289
- case 'touchcancel':
290
- // Canvel movement
291
- if (this.bc.active)
292
- this.bc.end();
293
- break;
294
-
295
- case 'mouseup':
296
- // Don't consider drag moves below 3 pixels. Can be a "trembling click"
297
- if (this.bc.active && p.distanceTo(this.bc.origin) <= 3)
298
- break;
299
-
300
- up = true;
301
- /* falls through */
302
- case 'touchend':
303
- case 'touchstart':
304
- case 'mousedown':
305
- if (!this.bc.active) {
306
- // New pairing starts
307
- //
308
- // Pairings never can start with a `mouseup` event
309
- if (up)
310
- break;
311
-
312
- this.ps.stopMedia(1);
313
- // Find the ActiveBox behind the clicked point
314
- bx1 = this.bg.findActiveBox(p);
315
- if (bx1) {
316
- // Start the [BoxConnector](BoxConnector.html)
317
- if (this.act.dragCells)
318
- this.bc.begin(p, bx1);
319
- else
320
- this.bc.begin(p);
321
- // Play cell media or event sound
322
- if (!bx1.playMedia(this.ps, delayedActions))
323
- this.playEvent('click');
324
- }
325
- } else {
326
- this.ps.stopMedia(1);
327
- // Pairing completed
328
- //
329
- // Find the active boxes behind `bc.origin` and `p`
330
- if (this.act.dragCells)
331
- bx1 = this.bc.bx;
332
- else
333
- bx1 = this.bg.findActiveBox(this.bc.origin);
334
- this.bc.end();
335
- bx2 = this.bg.findActiveBox(p);
336
- //
337
- // Check if the pairing was OK
338
- if (bx1 && bx2) {
339
- const
340
- src = `${bx1.getDescription()} (${bx1.idOrder})`,
341
- dest = `(${bx2.idLoc})`;
342
- let ok = (bx1.idOrder === bx2.idLoc);
343
- this.bg.swapCellPositions(bx1, bx2, true);
344
- // Check results and notify action
345
- const cellsAtPlace = this.bg.countCellsAtEquivalentPlace(true);
346
- this.ps.reportNewAction(this.act, 'PLACE', src, dest, ok, cellsAtPlace);
347
- // End activity or play event sound
348
- if (ok && cellsAtPlace === this.bg.getNumCells())
349
- this.finishActivity(true);
350
- else
351
- this.playEvent(ok ? 'actionOk' : 'actionError');
352
- }
353
- this.update();
354
- }
355
- break;
356
-
357
- case 'mousemove':
358
- case 'touchmove':
359
- this.bc.moveTo(p);
360
- break;
361
- }
362
- delayedActions.forEach(action => action());
363
- event.preventDefault();
364
- }
365
- }
366
- }
367
-
368
- Object.assign(ExchangePuzzlePanel.prototype, {
369
- /**
370
- * The {@link module:boxes/ActiveBoxbag.ActiveBoxBag ActiveBoxBag} object containing the information to be displayed in the panel.
371
- * @name module:activities/puzzles/ExchangePuzzle.ExchangePuzzlePanel#bg
372
- * @type {module:boxes/ActiveBoxBag.ActiveBoxBag} */
373
- bg: null,
374
- /**
375
- * The box connector
376
- * @name module:activities/puzzles/ExchangePuzzle.ExchangePuzzlePanel#bc
377
- * @type {module:boxes/BoxConnector.BoxConnector} */
378
- bc: null,
379
- /**
380
- * List of mouse, touch and keyboard events intercepted by this panel
381
- * @override
382
- * @name module:activities/puzzles/ExchangePuzzle.ExchangePuzzlePanel#events
383
- * @type {string[]} */
384
- events: ['mousedown', 'mouseup', 'mousemove', 'touchstart', 'touchend', 'touchmove', 'touchcancel'],
385
- });
386
-
387
- /**
388
- * Panel class associated to this type of activity: {@link module:activities/puzzles/ExchangePuzzle.ExchangePuzzlePanel ExchangePuzzlePanel}
389
- * @type {class} */
390
- ExchangePuzzle.Panel = ExchangePuzzlePanel;
391
-
392
- // Register activity class
393
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Activity_js__WEBPACK_IMPORTED_MODULE_1__/* .Activity */ .I.registerClass('@puzzles.ExchangePuzzle', ExchangePuzzle));
394
-
395
-
396
- /***/ }),
397
-
398
- /***/ 7781:
399
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
400
-
401
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
402
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
403
- /* harmony export */ });
404
- /* unused harmony export ActiveBoxGrid */
405
- /* harmony import */ var _ActiveBoxBag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(427);
406
- /* harmony import */ var _ActiveBox_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1725);
407
- /* harmony import */ var _AWT_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7912);
408
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1253);
409
- /**
410
- * File : boxes/ActiveBoxGrid.js
411
- * Created : 19/05/2015
412
- * By : Francesc Busquets <francesc@gmail.com>
413
- *
414
- * JClic.js
415
- * An HTML5 player of JClic activities
416
- * https://projectestac.github.io/jclic.js
417
- *
418
- * @source https://github.com/projectestac/jclic.js
419
- *
420
- * @license EUPL-1.2
421
- * @licstart
422
- * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)
423
- *
424
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
425
- * the European Commission- subsequent versions of the EUPL (the "Licence");
426
- * You may not use this work except in compliance with the Licence.
427
- *
428
- * You may obtain a copy of the Licence at:
429
- * https://joinup.ec.europa.eu/software/page/eupl
430
- *
431
- * Unless required by applicable law or agreed to in writing, software
432
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
433
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
434
- * Licence for the specific language governing permissions and limitations
435
- * under the Licence.
436
- * @licend
437
- * @module
438
- */
439
-
440
-
441
-
442
-
443
-
444
-
445
- /**
446
- * This class extends {@link module:boxes/ActiveBoxbag.ActiveBoxBag ActiveBoxBag} with constructors that take an argument of type
447
- * {@link module:shapers/Shaper.Shaper Shaper} used to build all its {@link module:boxes/ActiveBox.ActiveBox ActiveBox}components. It also maintains information
448
- * about the number of "rows" and "columns", useful to compute valid (integer) values when
449
- * resizing or moving its components.
450
- * @extends module:boxes/ActiveBoxBag.ActiveBoxBag
451
- */
452
- class ActiveBoxGrid extends _ActiveBoxBag_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
453
- /**
454
- * ActiveBxGrid constructor
455
- * @param {module:boxes/AbstractBox.AbstractBox} parent - The AbstractBox to which this box grid belongs
456
- * @param {module:AWT.Container} container - The container where this box grid is placed.
457
- * @param {module:boxes/BoxBase} boxBase - The object where colors, fonts, border and other graphic properties
458
- * @param {number} px - `X` coordinate of the upper left corner of this box grid
459
- * @param {number} py - `Y` coordinate of the upper left corner of this box grid
460
- * @param {number} setWidth - Total width of the box grid
461
- * @param {number} setHeight - Total height of the box grid
462
- * @param {module:shapers/Shaper.Shaper} sh - Shaper used to build the ActiveBox objects
463
- */
464
- constructor(parent, container, boxBase, px, py, setWidth, setHeight, sh) {
465
- // ActiveBoxGrid derives from ActiveBoxBag
466
- super(parent, container, boxBase);
467
-
468
- this.nCols = sh.nCols;
469
- this.nRows = sh.nRows;
470
-
471
- // This will be the enclosing rectangle of this ActiveBox bag
472
- const r = new _AWT_js__WEBPACK_IMPORTED_MODULE_2__/* .Rectangle */ .M_(
473
- new _AWT_js__WEBPACK_IMPORTED_MODULE_2__/* .Point */ .bR(px, py),
474
- new _AWT_js__WEBPACK_IMPORTED_MODULE_2__/* .Dimension */ .fg(
475
- Math.round(setWidth / this.nCols) * this.nCols,
476
- Math.round(setHeight / this.nRows) * this.nRows));
477
-
478
- // Create all the [ActiveBox](ActiveBox.html) objects based on the
479
- // shapes provided by the [Shaper](Shaper.html)
480
- for (let i = 0; i < sh.nCells; i++) {
481
- const
482
- tmpSh = sh.getShape(i, r),
483
- bx = new _ActiveBox_js__WEBPACK_IMPORTED_MODULE_1__["default"](this, container, boxBase, i, tmpSh.getBounds());
484
- if (!sh.rectangularShapes)
485
- bx.setShape(tmpSh);
486
- this.addActiveBox(bx);
487
- }
488
-
489
- // If the Shaper has `remainder` (extra space), set the background box of this
490
- // [BoxBag](BoxBag.html)
491
- if (sh.hasRemainder) {
492
- const
493
- tmpSh = sh.getRemainderShape(r),
494
- bx = new _ActiveBox_js__WEBPACK_IMPORTED_MODULE_1__["default"](this, container, boxBase, 0, tmpSh.getBounds());
495
- bx.setShape(tmpSh);
496
- this.setBackgroundBox(bx);
497
- }
498
- }
499
-
500
- /**
501
- * This factory constructor creates a new empty grid with the number of cells indicated by the
502
- * {@link module:boxes/ActiveBagContent.ActiveBagContent ActiveBagContent} `abc`, not filling the cells with any content.
503
- * @param {module:boxes/AbstractBox.AbstractBox} parent - The AbstractBox to which this box grid belongs
504
- * @param {module:AWT.Container} container - The container where this box grid is placed.
505
- * @param {number} px - `X` coordinate of the upper left corner of this box grid
506
- * @param {number} py - `Y` coordinate of the upper left corner of this box grid
507
- * @param {module:boxes/ActiveBagContent.ActiveBagContent} abc - Used only to get the number of cells and the shaper (when `sh` is `null`)
508
- * @param {module:shapers/Shaper.Shaper} sh - Shaper used to build the ActiveBox objects
509
- * @param {module:boxes/BoxBase.BoxBase} boxBase - The object where colors, fonts, border and other graphic properties
510
- * of this box grid are defined.
511
- * @returns {module:boxes/ActiveBoxGrid.ActiveBoxGrid}
512
- */
513
- static createEmptyGrid(parent, container, px, py, abc, sh, boxBase) {
514
- const result = abc ? new ActiveBoxGrid(parent, container,
515
- boxBase || abc.style,
516
- px, py,
517
- abc.getTotalWidth(), abc.getTotalHeight(),
518
- sh || abc.getShaper()) : null;
519
-
520
- if (result)
521
- result.setBorder(abc.border);
522
-
523
- return result;
524
- }
525
-
526
- /**
527
- * Gets the minimum size of this grid
528
- * @returns {module:AWT.Dimension}
529
- */
530
- getMinimumSize() {
531
- return new _AWT_js__WEBPACK_IMPORTED_MODULE_2__/* .Dimension */ .fg(
532
- _Utils_js__WEBPACK_IMPORTED_MODULE_3__/* .settings */ .W0.MIN_CELL_SIZE * this.nCols,
533
- _Utils_js__WEBPACK_IMPORTED_MODULE_3__/* .settings */ .W0.MIN_CELL_SIZE * this.nRows);
534
- }
535
-
536
- /**
537
- * Gets a scaled size of this grid, rounded to the nearest integer values
538
- * @param {number} scale - The scale factor
539
- * @returns {module:AWT.Dimension}
540
- */
541
- getScaledSize(scale) {
542
- return new _AWT_js__WEBPACK_IMPORTED_MODULE_2__/* .Dimension */ .fg(
543
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_3__/* .roundTo */ .GB)(scale * this.preferredBounds.dim.width, this.nCols),
544
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_3__/* .roundTo */ .GB)(scale * this.preferredBounds.dim.height, this.nRows));
545
- }
546
-
547
- /**
548
- * Returns the logical coordinates of the provided {@link module:boxes/ActiveBox.ActiveBox ActiveBox}.
549
- * The units of the result are not pixels, but ordinal numbers (relative positions) of columns
550
- * and rows in the grid.
551
- * @param {module:boxes/ActiveBox.ActiveBox} bx - The box to process
552
- * @returns {module:AWT.Point}
553
- */
554
- getCoord(bx) {
555
- return new _AWT_js__WEBPACK_IMPORTED_MODULE_2__/* .Point */ .bR(bx.idLoc % this.nCols, Math.floor(bx.idLoc / this.nCols));
556
- }
557
-
558
- /**
559
- * Calculates the logical distance between two {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects.
560
- * Resulting units are not pixels, but ordinal numbers (relative positions) of columns and rows
561
- * in the grid.
562
- * @param {module:boxes/ActiveBox.ActiveBox} src - First box
563
- * @param {module:boxes/ActiveBox.ActiveBox} dest - Second box
564
- * @returns {module:AWT.Point}
565
- */
566
- getCoordDist(src, dest) {
567
- const
568
- ptSrc = this.getCoord(src),
569
- ptDest = this.getCoord(dest);
570
- return new _AWT_js__WEBPACK_IMPORTED_MODULE_2__/* .Point */ .bR(ptDest.x - ptSrc.x, ptDest.y - ptSrc.y);
571
- }
572
- }
573
-
574
- Object.assign(ActiveBoxGrid.prototype, {
575
- /**
576
- * Number of columns of this box grid
577
- * @name module:boxes/ActiveBoxGrid.ActiveBoxGrid#nCols
578
- * @type {number} */
579
- nCols: 1,
580
- /**
581
- * Number of rows of this box grid
582
- * @name module:boxes/ActiveBoxGrid.ActiveBoxGrid#nRows
583
- * @type {number} */
584
- nRows: 1,
585
- });
586
-
587
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ActiveBoxGrid);
588
-
589
-
590
- /***/ }),
591
-
592
- /***/ 6148:
593
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
594
-
595
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
596
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
597
- /* harmony export */ });
598
- /* unused harmony export BoxConnector */
599
- /* harmony import */ var _AWT_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7912);
600
- /**
601
- * File : boxes/BoxConnector.js
602
- * Created : 26/05/2015
603
- * By : Francesc Busquets <francesc@gmail.com>
604
- *
605
- * JClic.js
606
- * An HTML5 player of JClic activities
607
- * https://projectestac.github.io/jclic.js
608
- *
609
- * @source https://github.com/projectestac/jclic.js
610
- *
611
- * @license EUPL-1.2
612
- * @licstart
613
- * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)
614
- *
615
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
616
- * the European Commission- subsequent versions of the EUPL (the "Licence");
617
- * You may not use this work except in compliance with the Licence.
618
- *
619
- * You may obtain a copy of the Licence at:
620
- * https://joinup.ec.europa.eu/software/page/eupl
621
- *
622
- * Unless required by applicable law or agreed to in writing, software
623
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
624
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
625
- * Licence for the specific language governing permissions and limitations
626
- * under the Licence.
627
- * @licend
628
- * @module
629
- */
630
-
631
-
632
-
633
- const DEFAULT_COMPOSITE_OP = 'source-over';
634
-
635
- /**
636
- * BoxConnector allows users to visually connect two {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects of an
637
- * {@link module:Activity.ActivityPanel ActivityPanel}. There are two modes of operation:
638
- *
639
- * - Drawing a line between an origin point (usually the point where the user clicks on) and a
640
- * destination point.
641
- * - Dragging the ActiveBox from one location to another.
642
- *
643
- * The connecting lines can have arrowheads at its endings.
644
- */
645
- class BoxConnector {
646
- /**
647
- * BoxConnector constructor
648
- * @param {module:AWT.Container} parent - The Container to which this BoxConnector belongs
649
- * @param {external:jQuery} $canvas - The HTML `canvas` element where this BoxConnector will draw.
650
- */
651
- constructor(parent, $canvas) {
652
- this.parent = parent;
653
- this.ctx = $canvas.get(-1).getContext('2d', { willReadFrequently: true });
654
- this.dim = new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Dimension */ .fg(this.ctx.canvas.width, this.ctx.canvas.height);
655
- this.origin = new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Point */ .bR();
656
- this.dest = new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Point */ .bR();
657
- this.relativePos = new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Point */ .bR();
658
- }
659
-
660
- /**
661
- * Displaces the ending point of the connector
662
- * @param {number} dx - Displacement on the X axis
663
- * @param {number} dy - Displacement on the Y axis
664
- */
665
- moveBy(dx, dy) {
666
- this.moveTo((0,_AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Point */ .bR)(this.dest.x + dx, this.dest.y + dy));
667
- }
668
-
669
- /**
670
- * Moves the ending point of the connector to a new position
671
- * @param {module:AWT.Point} pt - The new position
672
- * @param {boolean} forcePaint - When `true`, forces the repaint of all the area also if there is
673
- * no movement at all.
674
- */
675
- moveTo(pt, forcePaint) {
676
- if (!this.active || !forcePaint && this.dest.equals(pt))
677
- return;
678
-
679
- // Restore the background
680
- if (this.bgRect) {
681
- if (this.bgImg) {
682
- this.ctx.putImageData(
683
- this.bgImg,
684
- 0, 0,
685
- this.bgRect.pos.x, this.bgRect.pos.y,
686
- this.bgRect.dim.width, this.bgRect.dim.height);
687
- } else if (this.parent)
688
- this.parent.updateContent();
689
- }
690
-
691
- this.dest.moveTo(pt);
692
-
693
- // Calculate the bounds of the invalidated area after the move:
694
- // Start with the origin point or box area
695
- const pt1 = new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Point */ .bR(this.origin.x - this.relativePos.x, this.origin.y - this.relativePos.y);
696
- this.bgRect = new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Rectangle */ .M_(pt1, this.bx ? this.bx.dim : new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Dimension */ .fg());
697
- // Add the destination point or box area
698
- const pt2 = new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Point */ .bR(pt.x - this.relativePos.x, pt.y - this.relativePos.y);
699
- this.bgRect.add(new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Rectangle */ .M_(pt2, this.bx ? this.bx.dim : new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Dimension */ .fg()));
700
- // Add a generous border around the area
701
- this.bgRect.grow(10, 10);
702
-
703
- if (this.bx !== null) {
704
- // Move the ActiveBox
705
- this.bx.moveTo(new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Point */ .bR(pt.x - this.relativePos.x, pt.y - this.relativePos.y));
706
- this.bx.setTemporaryHidden(false);
707
- this.bx.update(this.ctx, null);
708
- this.bx.setTemporaryHidden(true);
709
- } else {
710
- // Draw the connecting line
711
- this.drawLine();
712
- this.linePainted = true;
713
- }
714
- }
715
-
716
- /**
717
- * Starts the box connector operation
718
- * @param {module:AWT.Point} pt - Starting point
719
- * @param {module:boxes/ActiveBox.ActiveBox} [box] - Passed only when the BoxConnector runs in drag&drop mode
720
- */
721
- begin(pt, box) {
722
- if (this.active)
723
- this.end();
724
- this.origin.moveTo(pt);
725
- this.dest.moveTo(pt);
726
- this.linePainted = false;
727
- this.active = true;
728
-
729
- if (box) {
730
- // Remember what box will be moved, hide it from the panel and repaint all
731
- this.bx = box;
732
- this.relativePos.moveTo(pt.x - box.pos.x, pt.y - box.pos.y);
733
- this.bx.setFocused(true);
734
- this.bx.setTemporaryHidden(true);
735
- this.linePainted = false;
736
- this.parent.invalidate().update();
737
- }
738
-
739
- // Save the full image currently displayed on the panel (with the box hidden)
740
- try {
741
- this.bgImg = this.ctx.getImageData(0, 0, this.dim.width, this.dim.height);
742
- } catch (_ex) {
743
- // Avoid "canvas tainted by cross-origin data" errors
744
- // Setting bgImg to null is less efficient, but works
745
- this.bgImg = null;
746
- }
747
- this.bgRect = null;
748
-
749
- // Make a first movement to make the box appear
750
- if (box)
751
- this.moveTo(pt, true);
752
- }
753
-
754
- /**
755
- * Finalizes the operation of this box connector until a new call to `begin`
756
- */
757
- end() {
758
- if (!this.active)
759
- return;
760
-
761
- this.active = false;
762
- this.linePainted = false;
763
- this.bgRect = null;
764
- this.bgImg = null;
765
-
766
- if (this.bx) {
767
- // Restore the original position and attributes of the box
768
- this.bx.setFocused(false);
769
- this.bx.moveTo(this.origin.x - this.relativePos.x, this.origin.y - this.relativePos.y);
770
- this.bx.setTemporaryHidden(false);
771
- this.bx = null;
772
- this.relativePos.moveTo(0, 0);
773
- }
774
-
775
- // Repaint all
776
- this.ctx.clearRect(0, 0, this.dim.width, this.dim.height);
777
- this.parent.invalidate().update();
778
- }
779
-
780
- /**
781
- * Strokes a line between `origin` and `dest`, optionally ended with an arrowhead.
782
- */
783
- drawLine() {
784
- if (this.compositeOp !== DEFAULT_COMPOSITE_OP) {
785
- this.ctx.strokeStyle = this.xorColor;
786
- this.ctx.globalCompositeOperation = this.compositeOp;
787
- } else
788
- this.ctx.strokeStyle = this.lineColor;
789
-
790
- this.ctx.lineWidth = this.lineWidth;
791
-
792
- this.ctx.beginPath();
793
- this.ctx.moveTo(this.origin.x, this.origin.y);
794
- this.ctx.lineTo(this.dest.x, this.dest.y);
795
- this.ctx.stroke();
796
-
797
- if (this.arrow) {
798
- // Draws the arrow head
799
- const
800
- beta = Math.atan2(this.origin.x - this.dest.x, this.dest.x - this.origin.x),
801
- arp = new _AWT_js__WEBPACK_IMPORTED_MODULE_0__/* .Point */ .bR(this.dest.x - this.arrowLength * Math.cos(beta + this.arrowAngle),
802
- this.dest.y + this.arrowLength * Math.sin(beta + this.arrowAngle));
803
- this.ctx.beginPath();
804
- this.ctx.moveTo(this.dest.x, this.dest.y);
805
- this.ctx.lineTo(arp.x, arp.y);
806
- this.ctx.stroke();
807
-
808
- arp.moveTo(this.dest.x - this.arrowLength * Math.cos(beta - this.arrowAngle),
809
- this.dest.y + this.arrowLength * Math.sin(beta - this.arrowAngle));
810
- this.ctx.beginPath();
811
- this.ctx.moveTo(this.dest.x, this.dest.y);
812
- this.ctx.lineTo(arp.x, arp.y);
813
- this.ctx.stroke();
814
- }
815
- if (this.compositeOp !== DEFAULT_COMPOSITE_OP) {
816
- // reset default settings
817
- this.ctx.globalCompositeOperation = DEFAULT_COMPOSITE_OP;
818
- }
819
- }
820
- }
821
-
822
- Object.assign(BoxConnector.prototype, {
823
- /**
824
- * The background image, saved and redrawn on each movement
825
- * @name module:boxes/BoxConnector.BoxConnector#bgImg
826
- * @type {external:HTMLImageElement} */
827
- bgImg: null,
828
- /**
829
- * The rectangle of {@link module:Activity.ActivityPanel ActivityPanel} saved in `bgImg`
830
- * @name module:boxes/BoxConnector.BoxConnector#bgRect
831
- * @type {module:AWT.Rectangle} */
832
- bgRect: null,
833
- /**
834
- * Initial position of the connector
835
- * @name module:boxes/BoxConnector.BoxConnector#origin
836
- * @type {module:AWT.Point} */
837
- origin: null,
838
- /**
839
- * Current (while moving) and final position of the connector
840
- * @name module:boxes/BoxConnector.BoxConnector#dest
841
- * @type {module:AWT.Point} */
842
- dest: null,
843
- /**
844
- * When `true`, the connector must end on arrowhead
845
- * @name module:boxes/BoxConnector.BoxConnector#arrow
846
- * @type {boolean} */
847
- arrow: false,
848
- /**
849
- * `true` while the connector is active
850
- * @name module:boxes/BoxConnector.BoxConnector#active
851
- * @type {boolean} */
852
- active: false,
853
- /**
854
- * `true` while the line has already been painted (used for XOR expressions)
855
- * @name module:boxes/BoxConnector.BoxConnector#linePainted
856
- * @type {boolean} */
857
- linePainted: false,
858
- /**
859
- * The arrowhead length (in pixels)
860
- * @name module:boxes/BoxConnector.BoxConnector#arrowLength
861
- * @type {number} */
862
- arrowLength: 10,
863
- /**
864
- * The arrowhead angle
865
- * @name module:boxes/BoxConnector.BoxConnector#arrowAngle
866
- * @type {number} */
867
- arrowAngle: Math.PI / 6,
868
- /**
869
- * The main color used in XOR operations
870
- * @name module:boxes/BoxConnector.BoxConnector#lineColor
871
- * @type {string} */
872
- lineColor: 'black',
873
- /**
874
- * The complementary color used in XOR operations
875
- * @name module:boxes/BoxConnector.BoxConnector#xorColor
876
- * @type {string} */
877
- xorColor: 'white',
878
- /**
879
- * The global composite operator used when drawing in XOR mode. Default is "difference".
880
- * For a list of possible values see:
881
- * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation}
882
- * @name module:boxes/BoxConnector.BoxConnector#compositeOp
883
- * @type {string} */
884
- compositeOp: 'difference',
885
- /**
886
- * The default {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation composite operator}
887
- * ("source-over").
888
- * @name module:boxes/BoxConnector.BoxConnector#DEFAULT_COMPOSITE_OP
889
- * @static
890
- * @type {string} */
891
- DEFAULT_COMPOSITE_OP: DEFAULT_COMPOSITE_OP,
892
- /**
893
- * Relative position of point B regarding A
894
- * @name module:boxes/BoxConnector.BoxConnector#relativePos
895
- * @type {module:AWT.Point} */
896
- relativePos: null,
897
- /**
898
- * The ActiveBox to connect or move
899
- * @name module:boxes/BoxConnector.BoxConnector#bx
900
- * @type {module:boxes/ActiveBox.ActiveBox} */
901
- bx: null,
902
- /**
903
- * The Graphics context where the BoxConnector will paint
904
- * @name module:boxes/BoxConnector.BoxConnector#ctx
905
- * @type {external:CanvasRenderingContext2D} */
906
- ctx: null,
907
- /**
908
- * The dimension of the HTML canvas where to draw
909
- * @name module:boxes/BoxConnector.BoxConnector#dim
910
- * @type {module:AWT.Dimension} */
911
- dim: null,
912
- /**
913
- * The container to which this connector belongs
914
- * @name module:boxes/BoxConnector.BoxConnector#parent
915
- * @type {module:AWT.Container} */
916
- parent: null,
917
- /**
918
- * Width of the connector line
919
- * @name module:boxes/BoxConnector.BoxConnector#lineWidth
920
- * @type {number} */
921
- lineWidth: 1.5,
922
- });
923
-
924
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BoxConnector);
925
-
926
-
927
- /***/ })
928
-
929
- };
930
- ;
931
- //# sourceMappingURL=7257.jclic-node.js.map