Skip to content

Commit 28cc9cc

Browse files
authored
feat: UTC-148: Add Dynamic Text Plugin to Gallery (#11)
1 parent d699a61 commit 28cc9cc

File tree

36 files changed

+862
-730
lines changed

36 files changed

+862
-730
lines changed

.github/workflows/validate-plugins.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ jobs:
2828
- name: Checkout
2929
uses: actions/checkout@v4
3030

31-
- name: Setup Biome
32-
uses: biomejs/setup-biome@v2
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
3333
with:
34-
version: latest
34+
node-version: 20
35+
36+
- name: Install dependencies
37+
run: yarn install --frozen-lockfile
3538

36-
- name: Run Biome
37-
run: biome ci .
39+
- name: Run Linter
40+
run: yarn lint

.husky/pre-push

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yarn lint

biome.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"files": {
4+
"ignore": ["node_modules/**", "dist/**", "**/tsconfig*"],
5+
"maxSize": 3670016
6+
},
7+
"vcs": {
8+
"enabled": true,
9+
"clientKind": "git",
10+
"useIgnoreFile": true,
11+
"defaultBranch": "develop"
12+
},
13+
"formatter": {
14+
"indentStyle": "space",
15+
"indentWidth": 2,
16+
"lineWidth": 120,
17+
"formatWithErrors": true
18+
},
19+
"css": {
20+
"linter": {
21+
"enabled": false
22+
},
23+
"formatter": {
24+
"enabled": false
25+
}
26+
},
27+
"linter": {
28+
"enabled": true,
29+
"rules": {
30+
"recommended": true
31+
}
32+
}
33+
}

manifest.json

Lines changed: 84 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,86 @@
11
[
2-
{
3-
"title": "Bulk labeling for text spans with keyboard shortcuts",
4-
"description": "Assigns labels to all occurrences of the selected text at once and removes them",
5-
"path": "bulk-labeling",
6-
"private": false
7-
},
8-
{
9-
"title": "Text area word count",
10-
"description": "Validates the length of a text area based on its word count",
11-
"path": "count-words-in-textarea",
12-
"private": false
13-
},
14-
{
15-
"title": "Connect to LLM backend",
16-
"description": "Sends prompts to an LLM URL",
17-
"path": "llm-backend",
18-
"private": false
19-
},
20-
{
21-
"title": "Markdown to HTML",
22-
"description": "Converts markdown to HTML format",
23-
"path": "markdown-to-html",
24-
"private": false
25-
},
26-
{
27-
"title": "Text span overlap validation",
28-
"description": "Prevents overlap of text spans",
29-
"path": "ner-text-span-overlap-validation",
30-
"private": false
31-
},
32-
{
33-
"title": "Spam and bot detection",
34-
"description": "Pauses an annotator if bot behavior in detected",
35-
"path": "pausing-annotator",
36-
"private": false
37-
},
38-
{
39-
"title": "Data visualization",
40-
"description": "Display a Plotly chart to annotators",
41-
"path": "plotly",
42-
"private": false
43-
},
44-
{
45-
"title": "Redact annotator PII",
46-
"description": "Anonymize the annotator to reduce bias",
47-
"path": "redact-pii",
48-
"private": false
49-
},
50-
{
51-
"title": "Dynamic image swap",
52-
"description": "Changes active image based on conditions",
53-
"path": "different-images-per-label",
54-
"private": false
55-
},
56-
{
57-
"title": "Spellcheck",
58-
"description": "Validates misspelled text",
59-
"path": "spellcheck",
60-
"private": false
61-
},
62-
{
63-
"title": "Validate JSON",
64-
"description": "Checks that the introduced text is a valid JSON",
65-
"path": "validate-json-in-textarea",
66-
"private": false
67-
},
68-
{
69-
"title": "Simple content moderation",
70-
"description": "Prevents saving annotations containing inappropriate content",
71-
"path": "simple-content-moderation",
72-
"private": false
73-
},
74-
{
75-
"title": "Multi-frame video view",
76-
"description": "Synchronizes multiple video views to display a video with different frame offsets",
77-
"path": "multi-frame-video-view",
78-
"private": false
79-
}
2+
{
3+
"title": "Bulk labeling for text spans with keyboard shortcuts",
4+
"description": "Assigns labels to all occurrences of the selected text at once and removes them",
5+
"path": "bulk-labeling",
6+
"private": false
7+
},
8+
{
9+
"title": "Text area word count",
10+
"description": "Validates the length of a text area based on its word count",
11+
"path": "count-words-in-textarea",
12+
"private": false
13+
},
14+
{
15+
"title": "Connect to LLM backend",
16+
"description": "Sends prompts to an LLM URL",
17+
"path": "llm-backend",
18+
"private": false
19+
},
20+
{
21+
"title": "Markdown to HTML",
22+
"description": "Converts markdown to HTML format",
23+
"path": "markdown-to-html",
24+
"private": false
25+
},
26+
{
27+
"title": "Text span overlap validation",
28+
"description": "Prevents overlap of text spans",
29+
"path": "ner-text-span-overlap-validation",
30+
"private": false
31+
},
32+
{
33+
"title": "Spam and bot detection",
34+
"description": "Pauses an annotator if bot behavior in detected",
35+
"path": "pausing-annotator",
36+
"private": false
37+
},
38+
{
39+
"title": "Data visualization",
40+
"description": "Display a Plotly chart to annotators",
41+
"path": "plotly",
42+
"private": false
43+
},
44+
{
45+
"title": "Redact annotator PII",
46+
"description": "Anonymize the annotator to reduce bias",
47+
"path": "redact-pii",
48+
"private": false
49+
},
50+
{
51+
"title": "Dynamic image swap",
52+
"description": "Changes active image based on conditions",
53+
"path": "different-images-per-label",
54+
"private": false
55+
},
56+
{
57+
"title": "Spellcheck",
58+
"description": "Validates misspelled text",
59+
"path": "spellcheck",
60+
"private": false
61+
},
62+
{
63+
"title": "Validate JSON",
64+
"description": "Checks that the introduced text is a valid JSON",
65+
"path": "validate-json-in-textarea",
66+
"private": false
67+
},
68+
{
69+
"title": "Simple content moderation",
70+
"description": "Prevents saving annotations containing inappropriate content",
71+
"path": "simple-content-moderation",
72+
"private": false
73+
},
74+
{
75+
"title": "Multi-frame video view",
76+
"description": "Synchronizes multiple video views to display a video with different frame offsets",
77+
"path": "multi-frame-video-view",
78+
"private": false
79+
},
80+
{
81+
"title": "Dynamic text tags from textarea",
82+
"description": "Dynamically populates a text box given the input of a text area tag for span based labeling",
83+
"path": "dynamic-text-spans",
84+
"private": false
85+
}
8086
]

package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "label-studio-plugins",
3+
"version": "1.0.0",
4+
"description": "Plugins to extend Label Studio with custom workflows, integrations, and UI components.",
5+
"main": "index.js",
6+
"repository": "git@github.com:HumanSignal/label-studio-plugins.git",
7+
"author": "Ignacio Velazquez <ignacio@humansignal.com>",
8+
"license": "MIT",
9+
"private": true,
10+
"scripts": {
11+
"lint": "biome check --write .",
12+
"prepare": "husky"
13+
},
14+
"dependencies": {},
15+
"devDependencies": {
16+
"@biomejs/biome": "^1.9.4",
17+
"husky": "^9.1.7"
18+
}
19+
}

src/bulk-labeling/data.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"data": {
3-
"text": [
4-
"Opossums, commonly known as possums in North America, are marsupials found primarily in the Americas. The most well-known species is the Virginia opossum (Didelphis virginiana), which ranges from Central America and the eastern United States to southern Canada. These adaptable creatures are known for their ability to thrive in a variety of environments, including both rural and urban areas. Opossums are also found in South America, where different species inhabit a range of ecosystems, from tropical rainforests to temperate forests.",
5-
"Opossums are highly adaptable in terms of habitat, often residing in woodlands, farmland, and even suburban backyards. They typically seek shelter in hollow trees, abandoned burrows, or any dark, enclosed space they can find. Opossums are nocturnal and omnivorous, with a diet that includes fruits, insects, small animals, and even carrion. Their opportunistic feeding habits contribute to their resilience and ability to live in close proximity to human settlements.",
6-
"In terms of behavior, opossums are solitary and nomadic, often moving to different locations in search of food. They are known for their unique defense mechanism of 'playing dead' or 'playing possum' when threatened, which involves mimicking the appearance and smell of a sick or dead animal to deter predators. Opossums have relatively short lifespans, typically living only 2 to 4 years in the wild. Despite their short lives, they reproduce quickly, with females giving birth to large litters of up to 20 young, although not all offspring typically survive to maturity.",
7-
"In popular culture, opossums often appear as symbols of resilience and survival due to their hardy nature and ability to adapt to various environments. They are sometimes depicted in a comical or misunderstood light, given their nocturnal habits and somewhat disheveled appearance. Despite this, they play a crucial role in the ecosystem by controlling insect and rodent populations and cleaning up carrion. Opossums have been featured in various forms of media, from cartoons and children's books to movies, often emphasizing their unique behaviors and survival strategies."
8-
]
9-
}
2+
"data": {
3+
"text": [
4+
"Opossums, commonly known as possums in North America, are marsupials found primarily in the Americas. The most well-known species is the Virginia opossum (Didelphis virginiana), which ranges from Central America and the eastern United States to southern Canada. These adaptable creatures are known for their ability to thrive in a variety of environments, including both rural and urban areas. Opossums are also found in South America, where different species inhabit a range of ecosystems, from tropical rainforests to temperate forests.",
5+
"Opossums are highly adaptable in terms of habitat, often residing in woodlands, farmland, and even suburban backyards. They typically seek shelter in hollow trees, abandoned burrows, or any dark, enclosed space they can find. Opossums are nocturnal and omnivorous, with a diet that includes fruits, insects, small animals, and even carrion. Their opportunistic feeding habits contribute to their resilience and ability to live in close proximity to human settlements.",
6+
"In terms of behavior, opossums are solitary and nomadic, often moving to different locations in search of food. They are known for their unique defense mechanism of 'playing dead' or 'playing possum' when threatened, which involves mimicking the appearance and smell of a sick or dead animal to deter predators. Opossums have relatively short lifespans, typically living only 2 to 4 years in the wild. Despite their short lives, they reproduce quickly, with females giving birth to large litters of up to 20 young, although not all offspring typically survive to maturity.",
7+
"In popular culture, opossums often appear as symbols of resilience and survival due to their hardy nature and ability to adapt to various environments. They are sometimes depicted in a comical or misunderstood light, given their nocturnal habits and somewhat disheveled appearance. Despite this, they play a crucial role in the ecosystem by controlling insect and rodent populations and cleaning up carrion. Opossums have been featured in various forms of media, from cartoons and children's books to movies, often emphasizing their unique behaviors and survival strategies."
8+
]
9+
}
1010
}

0 commit comments

Comments
 (0)