@linto-ai/transcript-ui-webcomponent 0.9.0

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.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @linto-ai/transcript-ui-webcomponent
2
+
3
+ [@linto-ai/transcript-ui](https://github.com/linto-ai/linto-studio/tree/master/studio-sdk/components/transcript-ui) packaged as a `<linto-editor>` [Web Component](https://developer.mozilla.org/en-US/docs/Web/API/Web_components), for hosts that aren't Vue. Self-contained: Vue itself, every official plugin, fonts, and styles are all bundled in — nothing else to install.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <script type="module">
9
+ import { register, createAudioPlugin } from '@linto-ai/transcript-ui-webcomponent'
10
+ import { mapApiDocument } from '@linto-ai/transcript-ui-core'
11
+
12
+ register() // defines <linto-editor>
13
+
14
+ const el = document.querySelector('linto-editor')
15
+ el.core.use(createAudioPlugin())
16
+
17
+ const raw = await fetch('/transcript.json').then((r) => r.json())
18
+ el.core.setDocument(mapApiDocument(raw))
19
+ </script>
20
+
21
+ <linto-editor locale="en"></linto-editor>
22
+ ```
23
+
24
+ `register(tagName?)` defines the custom element (`linto-editor` by default — pass a different name if that tag is already taken). The element exposes its `core` as a plain property (`el.core`), the same `Core` object documented in [`@linto-ai/transcript-ui-core`](https://github.com/linto-ai/linto-studio/tree/master/studio-sdk/components/transcript-ui/packages/core#readme) — activate plugins on it exactly as you would in a direct Vue integration.
25
+
26
+ Every plugin factory (`createAudioPlugin`, `createChatPlugin`, `createLLMServicesPlugin`, `createLivePlugin`, `createSubtitlePlugin`, `createTranscriptionEditorPlugin`) is re-exported from this same package — see each plugin's own README (linked from the [root README](https://github.com/linto-ai/linto-studio/tree/master/studio-sdk/components/transcript-ui#readme)) for its options.
27
+
28
+ Because everything is bundled ahead of time, this package doesn't benefit from picking plugins individually the way the direct-Vue integration does — installing it gets you all of them, at whatever `dist/` weighs. If bundle size matters more than not touching Vue, use `@linto-ai/transcript-ui` + individual plugin packages instead.
29
+
30
+ ## Without a bundler, via a CDN
31
+
32
+ The package also ships as a single self-contained IIFE script (no ES modules, no `type="module"` needed) — everything hangs off a `LintoEditor` global instead of an `import`.
33
+
34
+ Once published to npm, jsDelivr/unpkg serve it by default (no path needed, via the `unpkg`/`jsdelivr` `package.json` fields):
35
+
36
+ ```html
37
+ <script src="https://cdn.jsdelivr.net/npm/@linto-ai/transcript-ui-webcomponent"></script>
38
+ <script>
39
+ LintoEditor.register()
40
+ document.querySelector('linto-editor').core.use(LintoEditor.createAudioPlugin())
41
+ </script>
42
+
43
+ <linto-editor locale="en"></linto-editor>
44
+ ```
45
+
46
+ Before that (or to pin an exact commit/branch), jsDelivr's GitHub mode serves straight from this repo, no npm publish required:
47
+
48
+ ```html
49
+ <script src="https://cdn.jsdelivr.net/gh/linto-ai/linto-studio@master/studio-sdk/components/transcript-ui/packages/webcomponent/dist/linto-editor.iife.js"></script>
50
+ ```