Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 1e27ec5

Browse files
hlomzikmakseq
andauthored
docs: Improve dynamic Choices example, add html attribute (#1220)
* Add `html` attribute to `Choices` documentation. Describe dynamic `Choices` better. Provide flags that has to be enabled in order to use them. * Update jsdoc-to-markdown to avoid buffer errors `create-docs` script fails on local runs because of unclear error. Turned out it's because of buffer overflow, new version works well. * Update lock file * Fix typo * One more typo --------- Co-authored-by: Max Tkachenko <[email protected]>
1 parent 0222a39 commit 1e27ec5

File tree

5 files changed

+231
-114
lines changed

5 files changed

+231
-114
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@
8686
"text-annotation"
8787
],
8888
"dependencies": {
89+
"@martel/audio-file-decoder": "2.3.15",
8990
"@thi.ng/rle-pack": "^2.1.6",
9091
"babel-plugin-istanbul": "^6.1.1",
91-
"@martel/audio-file-decoder": "2.3.15",
9292
"babel-preset-react-app": "^9.1.1",
9393
"d3": "^5.16.0",
9494
"magic-wand-js": "^1.0.0",
@@ -150,7 +150,7 @@
150150
"insert-after": "^0.1.4",
151151
"jest": "^29.3.1",
152152
"jest-environment-jsdom": "^29.3.1",
153-
"jsdoc-to-markdown": "^5.0.3",
153+
"jsdoc-to-markdown": "^8",
154154
"keymaster": "*",
155155
"konva": "^8.1.3",
156156
"lint-staged": "^9.5.0",

src/tags/control/Choices.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,27 @@ const { Option } = Select;
4343
* </View>
4444
*
4545
* @example <caption>This config with dynamic labels</caption>
46+
* <!--
47+
* `Choice`s can be loaded dynamically from task data. It should be an array of objects with attributes.
48+
* `html` can be used to show enriched content, it has higher priority than `value`, however `value` will be used in the exported result.
49+
* *ff_dev_2007_dev_2008_dynamic_tag_children_250322_short* should be enabled to use dynamic options.
50+
* *ff_dev_2007_rework_choices_280322_short* should be enabled to use `html` attribute.
51+
* -->
4652
* <View>
4753
* <Audio name="audio" value="$audio" />
4854
* <Choices name="transcription" toName="audio" value="$variants" />
4955
* </View>
5056
* <!-- {
5157
* "data": {
5258
* "variants": [
53-
* { "value": "Do or doughnut. There is no try." },
54-
* { "value": "Do or do not. There is no trial." },
59+
* { "value": "Do or doughnut. There is no try.", "html": "<img src='https://labelstud.io/images/logo.png'>" },
60+
* { "value": "Do or do not. There is no trial.", "html": "<h1>You can use hypertext here</h2>" },
5561
* { "value": "Do or do not. There is no try." },
5662
* { "value": "Duo do not. There is no try." }
5763
* ]
5864
* }
5965
* } -->
66+
*
6067
* @example <caption>is equivalent to this config</caption>
6168
* <View>
6269
* <Audio name="audio" value="$audio" />

src/tags/control/Number.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { ReadOnlyControlMixin } from '../../mixins/ReadOnlyMixin';
3232
* @param {number} [min] - Minimum number value
3333
* @param {number} [max] - Maximum number value
3434
* @param {number} [step=1] - Step for value increment/decrement
35-
* @param {number} [defaultValue] - Default number value; will be added automaticaly to result for required fields
35+
* @param {number} [defaultValue] - Default number value; will be added automatically to result for required fields
3636
* @param {string} [hotkey] - Hotkey for increasing number value
3737
* @param {boolean} [required=false] - Whether to require number validation
3838
* @param {string} [requiredMessage] - Message to show if validation fails

src/tags/visual/Repeater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Repeater Tag for annotating multiple data objects in a dynamic range with the same semantics. You can loop through data items in a python-like `for` cycle in the labeling process.
5-
* It repeats tags inside it for every item in a given data array from your dataset. All the occurences of `indexFlag` (default is `{{idx}}`) in parameter values will be replaced by the current index.
5+
* It repeats tags inside it for every item in a given data array from your dataset. All the occurrences of `indexFlag` (default is `{{idx}}`) in parameter values will be replaced by the current index.
66
* Names should always be unique, so you can use this placeholder in tag names.
77
*
88
* The Repeater Tag supports the `mode` property. This creates the possibility to enable pagination in repeater for performance improvement.

0 commit comments

Comments
 (0)