rt-native 1.0.109 → 1.0.111
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 +7 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -297,7 +297,7 @@ Read-only mode can also be set declaratively via the **readonly** HTML attribute
|
|
|
297
297
|
|
|
298
298
|
### setPreviewCssFiles()
|
|
299
299
|
|
|
300
|
-
Sets one or more CSS files to apply to
|
|
300
|
+
Sets one or more CSS files to apply to the preview window. Rules are automatically scoped so they only style the HTML being edited — the toolbar, menus, and dialogs are never affected. Call with no arguments to remove all files.
|
|
301
301
|
|
|
302
302
|
```js
|
|
303
303
|
// Load two stylesheets
|
|
@@ -325,7 +325,7 @@ editor.setPreviewCssFile('');
|
|
|
325
325
|
|
|
326
326
|
### setPreviewCss()
|
|
327
327
|
|
|
328
|
-
Supplies **inline CSS** to apply to both the
|
|
328
|
+
Supplies **inline CSS** to apply to both the preview window. Rules are automatically scoped, exactly like **setPreviewCssFiles()**. Call with no argument (or '') to clear.
|
|
329
329
|
|
|
330
330
|
```js
|
|
331
331
|
editor.setPreviewCss(`
|
|
@@ -342,6 +342,10 @@ editor.setPreviewCss('');
|
|
|
342
342
|
|
|
343
343
|
**setPreviewCss()** and **setPreviewCssFiles()** are independent — both can be active at the same time. File rules are applied first; inline rules are appended after, so inline CSS always wins when there is a conflict.
|
|
344
344
|
|
|
345
|
+
### At-rules
|
|
346
|
+
|
|
347
|
+
@media, @supports, @layer, and @container blocks are handled correctly — selectors inside them are scoped. Other at-rules (@keyframes, @font-face, etc.) are passed through unchanged.
|
|
348
|
+
|
|
345
349
|
---
|
|
346
350
|
|
|
347
351
|
## Events
|
|
@@ -702,20 +706,12 @@ rt-native.fluent-dark {
|
|
|
702
706
|
|
|
703
707
|
## Preview Window Styling
|
|
704
708
|
|
|
705
|
-
When you load preview CSS with **setPreviewCssFiles()** or **setPreviewCss()**, the component applies the styles in
|
|
706
|
-
|
|
707
|
-
1. **Editor content area** — CSS files are fetched, every selector is automatically prefixed with .rich-text-box-content, and the scoped rules are injected into the editor's shadow root. You see your production styles while you type, with no risk of styles escaping to the toolbar, menus, or the surrounding page.
|
|
708
|
-
|
|
709
|
-
2. **Preview window** — Content is rendered inside an iframe srcdoc with a completely isolated browsing context. The preview shows exactly what a reader would see in production with a clean browser baseline.
|
|
709
|
+
When you load preview CSS with **setPreviewCssFiles()** or **setPreviewCss()**, the component applies the styles to the Preview window. Content is rendered inside an iframe srcdoc with a completely isolated browsing context. The preview shows exactly what a reader would see in production with a clean browser baseline.
|
|
710
710
|
|
|
711
711
|
```js
|
|
712
712
|
editor.setPreviewCssFiles('my-content.css');
|
|
713
713
|
```
|
|
714
714
|
|
|
715
|
-
### At-rules
|
|
716
|
-
|
|
717
|
-
@media, @supports, @layer, and @container blocks are handled correctly — selectors inside them are scoped. Other at-rules (@keyframes, @font-face, etc.) are passed through unchanged.
|
|
718
|
-
|
|
719
715
|
---
|
|
720
716
|
|
|
721
717
|
## Toolbar Buttons
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rt-native",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.111",
|
|
4
4
|
"description": "rt-native HTML Editor is a free native web component that provides accessibility features and a wide variety of elements and customizations that make it one of the most robust and flexible HTML editors available. It allows the programmer to apply custom .css files to the preview window, so see how the content will be displayed in production. The editor uses embedded .svg Google Font Icons and the shadow DOM to isolate the HTML from inheriting the existing page styles. No frameworks, no build step, no dependencies — drop one script tag into any HTML page and you're done.",
|
|
5
5
|
"main": "rt-native.js",
|
|
6
6
|
"exports": {
|