gobstones-blockly 0.31.0 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a635ac1b19348ea87ca23976497fa8aad110558d6d17bda146c80b7a8064b3c4
4
- data.tar.gz: 8caab52b4dcd9e632ecad56d56f0c4a72c08bea83cbd46fbad7d371936940580
3
+ metadata.gz: b47ed0e304185189a1d5b7cc25dad46e9a707f19649d960f55f0452a62dbdcea
4
+ data.tar.gz: 9232a10f5c19d707017564980654612b72aab401a18ef65da60db1b319fb4418
5
5
  SHA512:
6
- metadata.gz: a808286901cf84d9147a906750909fb558fbcdaa108754368cc3d3b202af9f0a1120ff30244448a10f62d4f7e6a82e040fb9f2f73b975b9472b5314cdaf8f5c6
7
- data.tar.gz: 11fbab2de6de522690905cc434b43ac2f33084873d60435e1f8692d2d059c2c0897c50c0ae5d6eb094b746539644522ad2d187826028d6604712f2b811f94757
6
+ metadata.gz: 902cd68bd2423da9b2d4ed38d5d4363199a5b972985cd8ae75ad516600340b96c5b262c79cdbf727152dde76658b505963df3d3416b28d373ff01dd63bc5dd3a
7
+ data.tar.gz: f0c245a9c0a010389705cd1f1cf26ae4fe3c608fdd717658c8d16f23f00951d613c5f9d4f6796fc68239c16ae405a8b32c9ded89dcbee3e22e79cd101b13b1f0
@@ -81,6 +81,7 @@ Example:
81
81
  <block type="OperadorLogico"></block>
82
82
  <block type="not"></block>
83
83
  <block type="OperadoresDeEnumeracion"></block>
84
+ <block type="AlternativaEnExpresiones"></block>
84
85
  </category>
85
86
  </category>
86
87
  <category name="Definiciones">
@@ -4235,7 +4236,7 @@ Blockly.createBlockSvg = function(workspace, name, f) {
4235
4236
  newBlock.render();
4236
4237
  };
4237
4238
 
4238
- const createVariable = (parent, name) => {
4239
+ const createVariable = (parent, name, callback = () => {}) => {
4239
4240
  const workspace = parent.workspace;
4240
4241
  Blockly.createBlockSvg(workspace, 'variables_get', b => {
4241
4242
  ATOMICALLY(() => {
@@ -4243,6 +4244,7 @@ const createVariable = (parent, name) => {
4243
4244
  const posParent = parent.getRelativeToSurfaceXY();
4244
4245
  const pos = b.getRelativeToSurfaceXY();
4245
4246
  b.moveBy(posParent.x - pos.x + parent.width + 16, posParent.y - pos.y + b.height + 6);
4247
+ callback(b);
4246
4248
  });
4247
4249
  });
4248
4250
  }
@@ -4369,7 +4371,7 @@ Blockly.Blocks.InteractiveProgram = {
4369
4371
  getLocalMediaUrl(this, icon),
4370
4372
  getLocalMediaSize(icon),
4371
4373
  getLocalMediaSize(icon),
4372
- "Eliminar",
4374
+ "",
4373
4375
  function() {
4374
4376
  this.$init = false;
4375
4377
  this.removeInput("initlabel");
@@ -4378,6 +4380,7 @@ Blockly.Blocks.InteractiveProgram = {
4378
4380
  triggerRefresh(this);
4379
4381
  }.bind(this)
4380
4382
  );
4383
+ setTimeout(() => { removeButton.setTooltip("Eliminar"); });
4381
4384
 
4382
4385
  this.appendDummyInput("initlabel").appendField('Al inicializar:').appendField(removeButton);
4383
4386
  this.appendStatementInput('init').setCheck(["Statement"]);
@@ -4396,7 +4399,7 @@ Blockly.Blocks.InteractiveProgram = {
4396
4399
  getLocalMediaUrl(this, icon),
4397
4400
  getLocalMediaSize(icon),
4398
4401
  getLocalMediaSize(icon),
4399
- "Eliminar",
4402
+ "",
4400
4403
  function() {
4401
4404
  this.$timeout = undefined;
4402
4405
  this.removeInput("timeoutlabel");
@@ -4404,6 +4407,7 @@ Blockly.Blocks.InteractiveProgram = {
4404
4407
  triggerRefresh(this);
4405
4408
  }.bind(this)
4406
4409
  );
4410
+ setTimeout(() => { removeButton.setTooltip("Eliminar"); });
4407
4411
 
4408
4412
  this.appendDummyInput("timeoutlabel").appendField(`Al estar inactivo ${timeout} milisegundos:`).appendField(removeButton);
4409
4413
  this.appendStatementInput('timeout').setCheck(["Statement"]);
@@ -4478,27 +4482,32 @@ createInteractiveBinding = (name, keys) => {
4478
4482
  const input = this.inputList[0];
4479
4483
  const plusIcon = "plus.png";
4480
4484
  const cleanIcon = "clean.png";
4481
- input.appendField(new Blockly.FieldImage(
4485
+ const addModifier = new Blockly.FieldImage(
4482
4486
  getLocalMediaUrl(this, plusIcon),
4483
4487
  getLocalMediaSize(plusIcon),
4484
4488
  getLocalMediaSize(plusIcon),
4485
- "Agregar modificador",
4489
+ "",
4486
4490
  function() {
4487
4491
  const modifiersCount = getModifierFields(self).length / 2;
4488
4492
  if (modifiersCount >= modifiers.length) return;
4489
4493
 
4490
4494
  self._addModifier();
4491
4495
  }
4492
- ));
4493
- input.appendField(new Blockly.FieldImage(
4496
+ );
4497
+ setTimeout(() => { addModifier.setTooltip("Agregar modificador"); });
4498
+ input.appendField(addModifier);
4499
+
4500
+ const cleanModifiers = new Blockly.FieldImage(
4494
4501
  getLocalMediaUrl(this, cleanIcon),
4495
4502
  getLocalMediaSize(cleanIcon),
4496
4503
  getLocalMediaSize(cleanIcon),
4497
- "Limpiar modificadores",
4504
+ "",
4498
4505
  function() {
4499
4506
  self._cleanModifiers();
4500
4507
  }
4501
- ));
4508
+ );
4509
+ setTimeout(() => { addModifier.setTooltip("Limpiar modificadores"); });
4510
+ input.appendField(cleanModifiers);
4502
4511
  },
4503
4512
 
4504
4513
  customContextMenu: function(options) {
@@ -5113,11 +5122,13 @@ Blockly.Blocks.List = {
5113
5122
  getLocalMediaUrl(this, icon),
5114
5123
  getLocalMediaSize(icon),
5115
5124
  getLocalMediaSize(icon),
5116
- "Agregar elemento",
5125
+ "",
5117
5126
  function() {
5118
5127
  this._addElement();
5119
5128
  }.bind(this)
5120
5129
  );
5130
+ setTimeout(() => { addButton.setTooltip("Agregar elemento"); });
5131
+
5121
5132
  const input = this.appendDummyInput();
5122
5133
  input.appendField(addButton);
5123
5134
  input.name = "addButton";
@@ -5138,11 +5149,137 @@ Blockly.Blocks.List = {
5138
5149
  getLocalMediaUrl(this, icon),
5139
5150
  getLocalMediaSize(icon),
5140
5151
  getLocalMediaSize(icon),
5141
- "Quitar elemento",
5152
+ "",
5142
5153
  function() {
5143
5154
  this._removeElement(input);
5144
5155
  }.bind(this)
5145
5156
  );
5157
+ setTimeout(() => { removeButton.setTooltip("Quitar elemento"); });
5158
+ input.appendField(removeButton);
5159
+ }
5160
+ };
5161
+
5162
+ Blockly.Blocks.AlternativaEnExpresiones = {
5163
+ init: function () {
5164
+ this.jsonInit({
5165
+ message0: "",
5166
+ args0: [],
5167
+ output: "*",
5168
+ colour: Blockly.CUSTOM_COLORS.AlternativaEnExpresiones || Blockly.CUSTOM_COLORS.operator,
5169
+ inputsInline: true
5170
+ });
5171
+ this.length = 0;
5172
+
5173
+ this._addOtherwise();
5174
+ this._addElement();
5175
+ },
5176
+
5177
+ mutationToDom: function() {
5178
+ var container = document.createElement('mutation');
5179
+ container.setAttribute('extrabranches', this.length - 1);
5180
+ return container;
5181
+ },
5182
+
5183
+ domToMutation: function(xmlElement) {
5184
+ var extraBranches = parseInt(xmlElement.getAttribute('extrabranches')) || 0;
5185
+ for (let i = 0; i < extraBranches; i++) this._addElement();
5186
+ },
5187
+
5188
+ _addElement: function() {
5189
+ this.length++;
5190
+ this._removeOtherwise();
5191
+ this._removeAddButton();
5192
+
5193
+ if (this.length > 1) this._addNewline("newline" + this.length);
5194
+ this.appendDummyInput().appendField('elegir').name = "label1" + this.length;
5195
+ const input1 = this.appendValueInput('element' + this.length);
5196
+ this.appendDummyInput().appendField('cuando').name = "label2" + this.length;
5197
+ const input2 = this.appendValueInput('condition' + this.length);
5198
+
5199
+ if (this.length > 1) this._addRemoveButtonFor(this.length, input2);
5200
+ this._addAddButton();
5201
+ this._addOtherwise();
5202
+ triggerRefresh(this);
5203
+ },
5204
+
5205
+ _removeElement: function(n) {
5206
+ const isLastBranch = this.length === 2;
5207
+
5208
+ const elements = ["newline", "label1", "element", "label2", "condition"];
5209
+ elements.forEach((element) => this.removeInput(element + n));
5210
+ this.length--;
5211
+
5212
+ let id;
5213
+ elements.forEach((element) => {
5214
+ id = 1;
5215
+ for (let input of this.inputList) {
5216
+ if (input.name.startsWith(element)) {
5217
+ input.name = element + id;
5218
+ id++;
5219
+ }
5220
+ }
5221
+ });
5222
+
5223
+ if (isLastBranch) this.removeInput("newline1");
5224
+
5225
+ triggerRefresh(this);
5226
+ },
5227
+
5228
+ _addAddButton: function() {
5229
+ const icon = "plus.png";
5230
+ var addButton = new Blockly.FieldImage(
5231
+ getLocalMediaUrl(this, icon),
5232
+ getLocalMediaSize(icon),
5233
+ getLocalMediaSize(icon),
5234
+ "",
5235
+ function() {
5236
+ this._addElement();
5237
+ }.bind(this)
5238
+ );
5239
+ setTimeout(() => { addButton.setTooltip("Agregar opción"); });
5240
+
5241
+ const input = this.appendDummyInput();
5242
+ input.appendField(addButton);
5243
+ input.name = "addButton";
5244
+ },
5245
+
5246
+ _removeAddButton: function() {
5247
+ this.removeInput("addButton")
5248
+ this.removeInput("closingBracket");
5249
+ },
5250
+
5251
+ _addOtherwise: function() {
5252
+ this._addNewline("otherwiseNewline");
5253
+
5254
+ const textInput = this.appendDummyInput();
5255
+ textInput.appendField("o si no");
5256
+ textInput.name = "otherwiseText";
5257
+
5258
+ this.appendValueInput("otherwise");
5259
+ },
5260
+
5261
+ _removeOtherwise: function() {
5262
+ this.removeInput("otherwiseText");
5263
+ this.removeInput("otherwise");
5264
+ this.removeInput("otherwiseNewline");
5265
+ },
5266
+
5267
+ _addNewline: function(name) {
5268
+ this.appendStatementInput(name).setCheck(["NEWLINE"]);
5269
+ },
5270
+
5271
+ _addRemoveButtonFor: function(n, input) {
5272
+ const icon = "minus.png";
5273
+ var removeButton = new Blockly.FieldImage(
5274
+ getLocalMediaUrl(this, icon),
5275
+ getLocalMediaSize(icon),
5276
+ getLocalMediaSize(icon),
5277
+ "",
5278
+ function() {
5279
+ this._removeElement(n);
5280
+ }.bind(this)
5281
+ );
5282
+ setTimeout(() => { removeButton.setTooltip("Quitar opción"); });
5146
5283
  input.appendField(removeButton);
5147
5284
  }
5148
5285
  };
@@ -5170,24 +5307,46 @@ Blockly.Blocks.ForEach = {
5170
5307
  ]
5171
5308
  });
5172
5309
 
5310
+ var self = this;
5311
+
5312
+ const nameField = this.getField("varName");
5313
+ nameField.setValidator(function(name) {
5314
+ // Strip leading and trailing whitespace. Beyond this, all names are legal.
5315
+ name = name.replace(/^[\s\xa0]+|[\s\xa0]+$/g, '');
5316
+
5317
+ var oldName = this.text_;
5318
+ if (oldName != name) {
5319
+ // Rename any callers.
5320
+ var blocks = this.sourceBlock_.workspace.getAllBlocks(false);
5321
+ for (var i = 0; i < blocks.length; i++) {
5322
+ if (blocks[i].$parent === self.id) {
5323
+ blocks[i].setFieldValue(name, "VAR")
5324
+ }
5325
+ }
5326
+ }
5327
+
5328
+ return name;
5329
+ });
5330
+
5173
5331
  this.setColour(Blockly.CUSTOM_COLORS.ForEach || Blockly.CUSTOM_COLORS.controlStructure);
5174
5332
  this.appendValueInput('list');
5175
5333
  this.appendStatementInput('block').setCheck(["Statement"]);
5176
5334
  this.setInputsInline(true);
5177
5335
 
5178
- var self = this;
5179
-
5180
5336
  const handIcon = "hand.png";
5181
5337
  var createGetterButton = new Blockly.FieldImage(
5182
5338
  getLocalMediaUrl(this, handIcon),
5183
5339
  getLocalMediaSize(handIcon),
5184
5340
  getLocalMediaSize(handIcon),
5185
- "Obtener variable",
5341
+ "",
5186
5342
  function() {
5187
5343
  var name = self.getFieldValue('varName');
5188
- createVariable(self, name);
5344
+ createVariable(self, name, (block) => {
5345
+ block.$parent = self.id;
5346
+ });
5189
5347
  }
5190
5348
  );
5349
+ setTimeout(() => { createGetterButton.setTooltip("Obtener variable"); });
5191
5350
 
5192
5351
  this.inputList[0].appendField(createGetterButton);
5193
5352
  }
@@ -5353,12 +5512,13 @@ Blockly.Blocks.Asignacion = {
5353
5512
  getLocalMediaUrl(this, handIcon),
5354
5513
  getLocalMediaSize(handIcon),
5355
5514
  getLocalMediaSize(handIcon),
5356
- "Obtener variable",
5515
+ "",
5357
5516
  function() {
5358
5517
  var name = self.getFieldValue('varName');
5359
5518
  self.createVariableBlock(name);
5360
5519
  }
5361
5520
  );
5521
+ setTimeout(() => { createGetterButton.setTooltip("Obtener variable"); });
5362
5522
 
5363
5523
  this.appendDummyInput().appendField(createGetterButton);
5364
5524
  },
@@ -5860,6 +6020,25 @@ Blockly.GobstonesLanguage.List = function(block) {
5860
6020
  return [code, Blockly.GobstonesLanguage.ORDER_ATOMIC];
5861
6021
  };
5862
6022
 
6023
+ Blockly.GobstonesLanguage.AlternativaEnExpresiones = function(block) {
6024
+ const elements = block
6025
+ .inputList
6026
+ .filter((it) => it.name.startsWith("element"))
6027
+ .map((it) => {
6028
+ const id = it.name.match(/element(\d+)/)[1];
6029
+ const value = Blockly.GobstonesLanguage.valueToCode(block, it.name, Blockly.GobstonesLanguage.ORDER_NONE);
6030
+ const conditionValue = Blockly.GobstonesLanguage.valueToCode(block, `condition${id}`, Blockly.GobstonesLanguage.ORDER_NONE);
6031
+
6032
+ return `${value} when (${conditionValue})`;
6033
+ })
6034
+ .join("\n ");
6035
+
6036
+ const otherwise = Blockly.GobstonesLanguage.valueToCode(block, "otherwise", Blockly.GobstonesLanguage.ORDER_NONE);
6037
+ const code = `\n choose ${elements}\n ${otherwise} otherwise\n`;
6038
+
6039
+ return [code, Blockly.GobstonesLanguage.ORDER_ATOMIC];
6040
+ };
6041
+
5863
6042
  Blockly.GobstonesLanguage.ForEach = function (block) {
5864
6043
  let body = Blockly.GobstonesLanguage.statementToCode(block, 'block');
5865
6044
  var varName = formatCallName(block.getFieldValue('varName'), false, Blockly.VARIABLE_CATEGORY_NAME);
@@ -6721,6 +6900,11 @@ Blockly.ErrorInforming.CssContent = [
6721
6900
  // Bloque
6722
6901
  Blockly.Blocks[name] = {
6723
6902
  init: function () {
6903
+ this.jsonInit({
6904
+ type: "Statement",
6905
+ previousStatement: "Statement",
6906
+ nextStatement: "Statement",
6907
+ });
6724
6908
  this.setColour(Blockly.CUSTOM_COLORS.primitiveProcedure);
6725
6909
 
6726
6910
  if (icon) {
@@ -6734,8 +6918,6 @@ Blockly.ErrorInforming.CssContent = [
6734
6918
 
6735
6919
  self._definePrimitiveHolesOrDropdown(this, parts, dropdownOptions);
6736
6920
 
6737
- this.setPreviousStatement(true);
6738
- this.setNextStatement(true);
6739
6921
  this.setInputsInline(true);
6740
6922
  this.setTooltip(definition.attributes && definition.attributes.tooltip || "");
6741
6923
  }
@@ -6796,6 +6978,7 @@ Blockly.ErrorInforming.CssContent = [
6796
6978
  this.setNextStatement(false);
6797
6979
  this.setInputsInline(true);
6798
6980
  this.setOutput('var');
6981
+ this.setTooltip(definition.attributes && definition.attributes.tooltip || "");
6799
6982
  }
6800
6983
  };
6801
6984
 
@@ -408,6 +408,9 @@ Polymer.telemetry.instanceCount = 0;
408
408
  }());(function () {
409
409
  var modules = {};
410
410
  var lcModules = {};
411
+ function setModule(id, module) {
412
+ modules[id] = lcModules[id.toLowerCase()] = module;
413
+ }
411
414
  var findModule = function (id) {
412
415
  return modules[id] || lcModules[id.toLowerCase()];
413
416
  };
@@ -422,9 +425,12 @@ this.register();
422
425
  register: function (id) {
423
426
  id = id || this.id || this.getAttribute('name') || this.getAttribute('is');
424
427
  if (id) {
428
+ if (Polymer.Settings.strictTemplatePolicy && findModule(id) !== undefined) {
429
+ setModule(id, null);
430
+ throw new Error('strictTemplatePolicy: dom-module ' + id + ' re-registered');
431
+ }
425
432
  this.id = id;
426
- modules[id] = this;
427
- lcModules[id.toLowerCase()] = this;
433
+ setModule(id, this);
428
434
  }
429
435
  },
430
436
  import: function (id, selector) {
@@ -791,7 +797,7 @@ default:
791
797
  return value != null ? value : undefined;
792
798
  }
793
799
  }
794
- });Polymer.version = "1.11.3";Polymer.Base._addFeature({
800
+ });Polymer.version = "1.12.0";Polymer.Base._addFeature({
795
801
  _registerFeatures: function () {
796
802
  this._prepIs();
797
803
  this._prepBehaviors();
@@ -75,7 +75,11 @@ _prepTemplate: function () {
75
75
  var module;
76
76
  if (this._template === undefined) {
77
77
  module = Polymer.DomModule.import(this.is);
78
- this._template = module && module.querySelector('template');
78
+ var template = module && module.querySelector('template');
79
+ if (Polymer.Settings.strictTemplatePolicy && !template) {
80
+ throw new Error('strictTemplatePolicy: expecting dom-module or null _template for ' + this.is);
81
+ }
82
+ this._template = template;
79
83
  }
80
84
  if (module) {
81
85
  var assetPath = module.getAttribute('assetpath') || '';
@@ -1041,10 +1045,20 @@ this.removeChild(this.childNodes[0]);
1041
1045
  },
1042
1046
  setAttribute: function (name, value) {
1043
1047
  this.node.setAttribute(name, value);
1044
- this._maybeDistributeParent();
1048
+ this._maybeDistributeForAttributeChange(this.node, name);
1045
1049
  },
1046
1050
  removeAttribute: function (name) {
1047
1051
  this.node.removeAttribute(name);
1052
+ this._maybeDistributeForAttributeChange(this.node, name);
1053
+ },
1054
+ _maybeDistributeForAttributeChange: function (element, name) {
1055
+ if (name === 'select' && element.localName === 'content') {
1056
+ var ownerRoot = this.getOwnerRoot();
1057
+ if (ownerRoot && this._nodeNeedsDistribution(ownerRoot.host)) {
1058
+ this._lazyDistribute(ownerRoot.host);
1059
+ return;
1060
+ }
1061
+ }
1048
1062
  this._maybeDistributeParent();
1049
1063
  },
1050
1064
  _maybeDistributeParent: function () {
@@ -1599,7 +1613,7 @@ return h;
1599
1613
  _unobserveContentElements: function (elements) {
1600
1614
  for (var i = 0, n, h; i < elements.length && (n = elements[i]); i++) {
1601
1615
  if (this._isContent(n)) {
1602
- h = n.__observeNodesMap.get(this);
1616
+ h = n.__observeNodesMap && n.__observeNodesMap.get(this);
1603
1617
  if (h) {
1604
1618
  Polymer.dom(n).unobserveNodes(h);
1605
1619
  n.__observeNodesMap.delete(this);
@@ -162,6 +162,11 @@ i++;
162
162
  }
163
163
  }
164
164
  },
165
+ _select$Attr: function () {
166
+ var div = document.createElement('div');
167
+ div.innerHTML = '<div select$>';
168
+ return div.childNodes[0].attributes.getNamedItem('select$');
169
+ }(),
165
170
  _replaceSlotWithContent: function (slot) {
166
171
  var content = slot.ownerDocument.createElement('content');
167
172
  while (slot.firstChild) {
@@ -169,13 +174,18 @@ content.appendChild(slot.firstChild);
169
174
  }
170
175
  var attrs = slot.attributes;
171
176
  for (var i = 0; i < attrs.length; i++) {
172
- var attr = attrs[i];
173
- content.setAttribute(attr.name, attr.value);
177
+ content.attributes.setNamedItem(attrs[i].cloneNode());
174
178
  }
175
179
  var name = slot.getAttribute('name');
176
180
  if (name) {
177
181
  content.setAttribute('select', '[slot=\'' + name + '\']');
178
182
  }
183
+ var name$Value = slot.getAttribute('name$');
184
+ if (name$Value) {
185
+ var select$Attr = this._select$Attr.cloneNode();
186
+ select$Attr.value = '[slot=\'' + name$Value + '\']';
187
+ content.attributes.setNamedItem(select$Attr);
188
+ }
179
189
  slot.parentNode.replaceChild(content, slot);
180
190
  return content;
181
191
  },
@@ -379,7 +389,7 @@ this._marshalAnnotatedListeners();
379
389
  }
380
390
  },
381
391
  _configureAnnotationReferences: function () {
382
- var notes = this._notes;
392
+ var notes = this._notes || [];
383
393
  var nodes = this._nodes;
384
394
  for (var i = 0; i < notes.length; i++) {
385
395
  var note = notes[i];
@@ -695,7 +705,11 @@ deepTargetFind: function (x, y) {
695
705
  var node = document.elementFromPoint(x, y);
696
706
  var next = node;
697
707
  while (next && next.shadowRoot) {
708
+ var oldNext = next;
698
709
  next = next.shadowRoot.elementFromPoint(x, y);
710
+ if (oldNext === next) {
711
+ break;
712
+ }
699
713
  if (next) {
700
714
  node = next;
701
715
  }
@@ -4346,6 +4360,9 @@ properties: { __hideTemplateChildren__: { observer: '_showHideChildren' } },
4346
4360
  _instanceProps: Polymer.nob,
4347
4361
  _parentPropPrefix: '_parent_',
4348
4362
  templatize: function (template) {
4363
+ if (Polymer.Settings.strictTemplatePolicy && !this._getRootDataHost()) {
4364
+ throw new Error('strictTemplatePolicy: template owner not trusted');
4365
+ }
4349
4366
  this._templatized = template;
4350
4367
  if (!template._content) {
4351
4368
  template._content = template.content;
@@ -4945,6 +4962,9 @@ this._debounceTemplate(this._render);
4945
4962
  this._flushTemplates();
4946
4963
  },
4947
4964
  _render: function () {
4965
+ if (!this.ctor) {
4966
+ return;
4967
+ }
4948
4968
  if (this._needFullRefresh) {
4949
4969
  this._applyFullRefresh();
4950
4970
  this._needFullRefresh = false;
@@ -5426,10 +5446,12 @@ if (this._instance) {
5426
5446
  var c$ = this._instance._children;
5427
5447
  if (c$ && c$.length) {
5428
5448
  var parent = Polymer.dom(Polymer.dom(c$[0]).parentNode);
5449
+ if (parent) {
5429
5450
  for (var i = 0, n; i < c$.length && (n = c$[i]); i++) {
5430
5451
  parent.removeChild(n);
5431
5452
  }
5432
5453
  }
5454
+ }
5433
5455
  this._instance = null;
5434
5456
  }
5435
5457
  },
@@ -5455,6 +5477,9 @@ properties: { notifyDomChange: { type: Boolean } },
5455
5477
  extends: 'template',
5456
5478
  _template: null,
5457
5479
  created: function () {
5480
+ if (Polymer.Settings.strictTemplatePolicy) {
5481
+ throw new Error('strictTemplatePolicy: dom-bind not allowed');
5482
+ }
5458
5483
  var self = this;
5459
5484
  Polymer.RenderStatus.whenReady(function () {
5460
5485
  if (document.readyState == 'loading') {
@@ -1,5 +1,5 @@
1
1
  module Gobstones
2
2
  module Blockly
3
- VERSION = "0.31.0"
3
+ VERSION = "0.32.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobstones-blockly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Alfonso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-19 00:00:00.000000000 Z
11
+ date: 2019-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler