Framework-agnostic XBRL tagging library with Web Components (Lit Element) - includes resizable panels with fileData support, auto-tagging, table API integration, and taxonomy services for Jupiter XBRL projects
npm install jupiter-tagger-copilotš Framework-agnostic XBRL tagging library with Web Components (Lit Element) for building sophisticated XBRL tagging interfaces. Works with Angular, React, Vue, or vanilla JavaScript.
- šÆ Resizable Panels Component: Draggable split-panel layout (70/30 default) with smooth resizing - See Quick Start
- NEW: fileData property - Pass array of files with fileName and fileContent - See FileData Feature
- NEW: Table API Integration - Automatic table tagging via REST API - See Table API Docs
- š¤ Auto Tagger: Automatic XBRL concept suggestion based on taxonomy analysis
- š·ļø HTML Tagging: Interactive manual tagging with real-time validation
- š XBRL Services: Comprehensive taxonomy management and processing
- š§ Framework Agnostic: Web Components work everywhere - Angular, React, Vue, vanilla JS
- š¦ TypeScript: Fully typed interfaces and models for XBRL data structures
- šØ Shadow DOM: Encapsulated styles prevent CSS conflicts
- ā” Vite Build: Fast development and optimized production builds
``bash`
npm install jupiter-tagger-copilot
The simplest way to use resizable panels:
`html
Left panel content (70%)
Right panel content (30%)
`
That's it! The component handles:
- ā
70/30 split by default
- ā
Draggable divider
- ā
Min/max constraints (20%-80%)
- ā
Keyboard navigation
- ā
Touch support
- ā
Responsive behavior
ā See full Quick Start Guide | ā View Live Demo
Pass an array of files directly to the component:
`javascript
const panels = document.querySelector('resizable-panels');
// Set fileData property
panels.fileData = [
{
fileName: 'report.html',
fileContent: '
Content...
'// Access file data
console.log(panels.fileData.length); // 2
console.log(panels.fileData[0].fileName); // 'report.html'
`
ā See FileData Feature Documentation | ā View FileData Example
Automatically tag tables using AI-powered REST API:
`html`
report-language="nl-NL"
period-start-date="2025-01-01"
period-end-date="2025-12-31"
monetary-unit="EUR">
Assets
10,000
How it works:
1. User selects a table from the left panel
2. Chooses a role and sets monetary scale
3. Component calls REST API automatically
4. API response displayed in right panel
ā See Table API Documentation | ā View Table API Test | ā Implementation Details
This library has peer dependencies on the following Angular packages:
- @angular/core (>=14.0.0)@angular/common
- (>=14.0.0)@angular/forms
- (>=14.0.0)@angular/material
- (>=14.0.0)@angular/cdk
- (>=14.0.0)rxjs
- (>=7.4.0)
Make sure these are installed in your Angular project.
Add JupiterTaggerCopilotModule to your Angular module:
`typescript
import { NgModule } from '@angular/core';
import { JupiterTaggerCopilotModule } from 'jupiter-tagger-copilot';
@NgModule({
imports: [
JupiterTaggerCopilotModule
],
// ... other module configuration
})
export class AppModule { }
`
#### Auto Tagger Component
`html`
[targetDocument]="document"
(tagSuggested)="onTagSuggested($event)"
(taggingCompleted)="onTaggingCompleted($event)">
#### HTML Tagging Component
`html`
[taxonomyData]="taxonomyData"
[existingTags]="existingTags"
(tagCreated)="onTagCreated($event)"
(tagUpdated)="onTagUpdated($event)"
(tagDeleted)="onTagDeleted($event)">
#### Tagging Service
`typescript
import { TaggingService } from 'jupiter-tagger-copilot';
constructor(private taggingService: TaggingService) {
// Subscribe to tags changes
this.taggingService.tags$.subscribe(tags => {
console.log('Current tags:', tags);
});
}
// Add a new tag
this.taggingService.addTag({
id: 'tag-1',
conceptName: 'ifrs-full:Assets',
conceptLabel: 'Assets',
namespace: 'ifrs-full',
textContent: 'Total Assets',
value: 1000000,
unit: 'EUR',
contextRef: 'c1'
});
`
#### XBRL Taxonomy Service
`typescript
import { XbrlTaxonomyService } from 'jupiter-tagger-copilot';
constructor(private taxonomyService: XbrlTaxonomyService) {}
// Load taxonomy from JSON data
this.taxonomyService.loadTaxonomyFromJson({
calculation: calculationData,
datatypes: datatypesData,
presentation: presentationData,
schemas: schemasData
}).subscribe(taxonomy => {
console.log('Taxonomy loaded:', taxonomy);
});
// Search for concepts
this.taxonomyService.searchConcepts('Assets').subscribe(concepts => {
console.log('Found concepts:', concepts);
});
`
#### AutoTaggerComponent
Provides automatic XBRL tagging functionality.
Inputs:
- taxonomyData: any - XBRL taxonomy datatargetDocument: Document
- - Target HTML document for taggingautoTaggingEnabled: boolean
- - Enable/disable auto-tagging
Outputs:
- tagSuggested: EventEmitter - Emitted when a tag is suggestedtaggingCompleted: EventEmitter
- - Emitted when tagging is completeerror: EventEmitter
- - Emitted when errors occur
#### TagHtmlComponent
Provides interactive HTML tagging interface.
Inputs:
- htmlContent: string - HTML content to tagtaxonomyData: any
- - XBRL taxonomy dataexistingTags: TagInterface[]
- - Existing tagsreadOnly: boolean
- - Read-only mode
Outputs:
- tagCreated: EventEmitter - Emitted when a tag is createdtagUpdated: EventEmitter
- - Emitted when a tag is updatedtagDeleted: EventEmitter
- - Emitted when a tag is deletedselectionChanged: EventEmitter
- - Emitted when text selection changes
#### TaggingService
Manages XBRL tagging operations.
Methods:
- addTag(tag: TagInterface): void - Add a new tagremoveTag(tagId: string): void
- - Remove a tagupdateTag(tagId: string, updates: Partial
- - Update a taggetTags(): TagInterface[]
- - Get all tagsclearTags(): void
- - Clear all tagssuggestTags(text: string): Observable
- - Get tag suggestions
#### XbrlTaxonomyService
Manages XBRL taxonomy data and operations.
Methods:
- loadTaxonomy(taxonomy: TaxonomyInterface): void - Load taxonomy datasearchConcepts(searchTerm: string): Observable
- - Search conceptsgetConceptById(conceptId: string): any
- - Get concept by IDvalidateConcept(conceptId: string): Observable
- - Validate concept
#### TagInterface
Represents an XBRL tag applied to HTML content.
`typescript`
interface TagInterface {
id: string;
conceptName: string;
conceptLabel: string;
namespace: string;
textContent: string;
value?: number | string;
unit?: string;
contextRef?: string;
// ... additional properties
}
#### TaxonomyInterface
Represents XBRL taxonomy structure.
`typescript`
interface TaxonomyInterface {
id: string;
name: string;
version: string;
calculation?: any;
datatypes?: any;
hypercubes?: any;
presentation?: any;
schemas?: any;
}
#### XBRL Utilities
`typescript
import { parseQName, createQName, isValidConceptName, formatXbrlDate } from 'jupiter-tagger-copilot';
// Parse qualified names
const { prefix, localName } = parseQName('ifrs-full:Assets');
// Validate concept names
const isValid = isValidConceptName('ifrs-full:Assets');
// Format dates for XBRL
const xbrlDate = formatXbrlDate(new Date());
`
#### Tagging Utilities
`typescript
import { TextSelection, ElementHighlight, TagValidation } from 'jupiter-tagger-copilot';
// Get selected text
const selection = TextSelection.getSelectedText();
// Highlight elements
ElementHighlight.addHighlight(element, 'my-highlight-class');
// Validate tagging capability
const validation = TagValidation.canTag(element);
`
`bash`
npm run build
`bash`
npm test
`bash`
npm run pack
`bash`
npm run release
1. Fork the repository
2. Create your feature branch (git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature'
3. Commit your changes ()git push origin feature/amazing-feature`)
4. Push to the branch (
5. Open a Pull Request
- Angular: 14.x, 15.x, 16.x, 17.x, 18.x
- TypeScript: 4.7+
- Node.js: 18.19.1+
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support, please open an issue in the GitHub repository.