@blockly/field-multilineinput 3.0.3 → 3.0.4

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 (2) hide show
  1. package/README.md +24 -4
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -15,17 +15,28 @@ npm install @blockly/field-multilineinput --save
15
15
  ```
16
16
 
17
17
  ## Usage
18
- See the [Blockly Multiline Text Input Field documentation](https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/multiline-text-input) on what parameters and configurations this field supports.
18
+
19
+ This field accepts up to 3 parameters:
20
+ * "text" to specify the default text. Defaults to `""`.
21
+ * "maxLines" to specify the maximum number of lines displayed before scrolling
22
+ functionality is enabled. Defaults to `Infinity`.
23
+ * "spellcheck" to specify whether spell checking is enabled. Defaults to
24
+ `true`.
25
+
26
+ The multiline input field is a subclass of Blockly.FieldInput
19
27
 
20
28
  ### JavaScript
21
29
  ```js
22
30
  import * as Blockly from 'blockly';
23
31
  import {FieldMultilineInput} from '@blockly/field-multilineinput';
32
+
24
33
  Blockly.Blocks["test_field_multilineinput"] = {
25
34
  init: function () {
26
35
  this.appendDummyInput()
27
36
  .appendField("multilineinput: ")
28
- .appendField(new FieldMultilineInput(90), "FIELDNAME");
37
+ .appendField(
38
+ new FieldMultilineInput("some text \n with newlines"),
39
+ "FIELDNAME");
29
40
  }
30
41
  };
31
42
  ```
@@ -34,6 +45,7 @@ Blockly.Blocks["test_field_multilineinput"] = {
34
45
  ```js
35
46
  import * as Blockly from 'blockly';
36
47
  import '@blockly/field-multilineinput';
48
+
37
49
  Blockly.defineBlocksWithJsonArray([
38
50
  {
39
51
  "type": "test_field_multilineinput",
@@ -42,12 +54,20 @@ Blockly.defineBlocksWithJsonArray([
42
54
  {
43
55
  "type": "field_multilineinput",
44
56
  "name": "FIELDNAME",
45
- "value": 50
57
+ "text": "some text \n with newlines"
46
58
  }
47
- ]
48
59
  }]);
49
60
  ```
50
61
 
62
+ ### API reference
63
+
64
+ * `setMaxLines`: Sets the maximum number of displayed lines before
65
+ scrolling functionality is enabled.
66
+ * `getMaxLines`: Returns the maximum number of displayed lines before
67
+ scrolling functionality is enabled.
68
+ * `setSpellcheck`: Sets whether spell checking is enabled.
69
+ * `getSpellcheck`: Returns whether spell checking is enabled.
70
+
51
71
  ## License
52
72
 
53
73
  Apache 2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockly/field-multilineinput",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "A Blockly multilineinput field.",
5
5
  "scripts": {
6
6
  "audit:fix": "blockly-scripts auditFix",
@@ -61,5 +61,5 @@
61
61
  "engines": {
62
62
  "node": ">=8.0.0"
63
63
  },
64
- "gitHead": "22d986a43d070ff8e93fb0d2766c0c85b8e5a854"
64
+ "gitHead": "993c4b87b60250ec41566921a5012cfc07a35e48"
65
65
  }