@1urso/generic-editor 0.1.22 → 0.1.23
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<a href="https://bearry.app">
|
|
3
|
-
<img src="https://bearry.app/
|
|
3
|
+
<img src="https://cdn.bearry.app/images/logo_png.png" alt="Bearry - Streaming Tools" height="100">
|
|
4
4
|
</a>
|
|
5
5
|
<br />
|
|
6
6
|
<br />
|
|
@@ -296,6 +296,39 @@ const htmlString = generateHTML(layout.elements, dados, {
|
|
|
296
296
|
document.getElementById("preview").innerHTML = htmlString;
|
|
297
297
|
```
|
|
298
298
|
|
|
299
|
+
### Dynamic List Updates (Real-time)
|
|
300
|
+
|
|
301
|
+
When generating HTML for lists (`isList: true`), the editor automatically injects a smart script that enables real-time updates without regenerating the entire HTML.
|
|
302
|
+
|
|
303
|
+
This is perfect for **OBS Overlays, Chat Widgets, or Live Feeds**.
|
|
304
|
+
|
|
305
|
+
#### How to use:
|
|
306
|
+
|
|
307
|
+
1. Generate the initial HTML using `generateHTML`.
|
|
308
|
+
2. Load the HTML in your view (Browser, WebView, OBS).
|
|
309
|
+
3. Call `window.addItem(data)` whenever you have new data.
|
|
310
|
+
|
|
311
|
+
```javascript
|
|
312
|
+
// Example: Adding a new item via WebSocket or Event
|
|
313
|
+
const newItem = {
|
|
314
|
+
name: "New Subscriber",
|
|
315
|
+
message: "Hello World!",
|
|
316
|
+
avatar: "https://...",
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
// This function is automatically available in the generated HTML
|
|
320
|
+
if (window.addItem) {
|
|
321
|
+
window.addItem(newItem);
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
The injected script automatically handles:
|
|
326
|
+
|
|
327
|
+
- **Rendering**: Uses the exact same layout configuration from the JSON.
|
|
328
|
+
- **Animation**: Smooth slide-in animation for new items.
|
|
329
|
+
- **Positioning**: Respects 'Newest on Top' or 'Bottom' settings.
|
|
330
|
+
- **Scrolling**: Auto-scrolls to the newest item if configured.
|
|
331
|
+
|
|
299
332
|
---
|
|
300
333
|
|
|
301
334
|
## API Reference
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface ColorPickerContentProps {
|
|
3
|
+
color: string;
|
|
4
|
+
onChange: (color: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const ColorPickerContent: React.FC<ColorPickerContentProps>;
|
|
7
|
+
interface ColorInputProps extends ColorPickerContentProps {
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const ColorInput: React.FC<ColorInputProps>;
|
|
11
|
+
export {};
|