@phuong-tran-redoc/document-engine-angular 0.1.4 → 0.1.6
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 +46 -4
- package/fesm2022/phuong-tran-redoc-document-engine-angular.mjs +402 -252
- package/fesm2022/phuong-tran-redoc-document-engine-angular.mjs.map +1 -1
- package/index.d.ts +44 -3
- package/package.json +5 -2
- package/src/lib/styles/_panel-surface.scss +43 -0
- package/src/lib/styles/document-editor.scss +69 -0
- package/src/lib/styles/index.scss +8 -0
- package/src/lib/styles/tokens.scss +69 -0
package/README.md
CHANGED
|
@@ -50,9 +50,13 @@ Add the SCSS entry to your global styles (or `angular.json` styles array):
|
|
|
50
50
|
|
|
51
51
|
```scss
|
|
52
52
|
// styles.scss
|
|
53
|
-
@
|
|
53
|
+
@use '@phuong-tran-redoc/document-engine-angular/styles';
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
That one import is the whole baseline — it ships the editor chrome **and** a default value for every
|
|
57
|
+
design token the library reads, so it looks right with no theming at all. **Tailwind CSS is not
|
|
58
|
+
required**; the library does not depend on your Tailwind config.
|
|
59
|
+
|
|
56
60
|
---
|
|
57
61
|
|
|
58
62
|
## 🚀 Quick Start
|
|
@@ -167,11 +171,49 @@ The feature-toggle object passed to `[config]`. Each key is a boolean or an opti
|
|
|
167
171
|
|
|
168
172
|
> The package entry `index.ts` is the public contract — additive changes only between minor versions.
|
|
169
173
|
|
|
170
|
-
|
|
174
|
+
### Deprecations
|
|
175
|
+
|
|
176
|
+
| Deprecated | Use instead | Removed in |
|
|
177
|
+
| --- | --- | --- |
|
|
178
|
+
| `[popover]` selector/input on `PopoverDirective` | `[documentEnginePopover]` | next major |
|
|
179
|
+
|
|
180
|
+
`[popover]` still works, so no consumer breaks on upgrade. It is being retired because it collides with
|
|
181
|
+
the platform's native [`popover`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/popover)
|
|
182
|
+
HTML attribute — an element carrying both gets the browser's top-layer behaviour *and* ours.
|
|
171
183
|
|
|
172
|
-
|
|
184
|
+
```html
|
|
185
|
+
<!-- before -->
|
|
186
|
+
<div [popover]="triggerRef">…</div>
|
|
187
|
+
<!-- after -->
|
|
188
|
+
<div [documentEnginePopover]="triggerRef">…</div>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
173
192
|
|
|
174
|
-
|
|
193
|
+
## 🎨 Styling & theming
|
|
194
|
+
|
|
195
|
+
Import the SCSS entry (see [Importing Styles](#importing-styles)), then theme by **redeclaring CSS
|
|
196
|
+
custom properties** — never by overriding rule bodies.
|
|
197
|
+
|
|
198
|
+
**[`docs/THEMING.md`](https://github.com/phuong-tran-redoc/document-engine/blob/main/docs/THEMING.md) is
|
|
199
|
+
the contract.** It lists every token the library reads
|
|
200
|
+
(colour, elevation, sizing), its default, and what it paints. Highlights:
|
|
201
|
+
|
|
202
|
+
- The barrel's defaults are emitted on `:where(:root)`, which has **zero specificity** — anything you
|
|
203
|
+
declare (`:root`, `.dark`, `[data-theme]`, an inline style) wins regardless of source order. No
|
|
204
|
+
`!important`, no matching a selector shape.
|
|
205
|
+
- Dark mode is purely a matter of redeclaring the tokens on your dark selector; nothing in the library
|
|
206
|
+
hardcodes a colour.
|
|
207
|
+
- `--de-editor-min-height` (default `12rem`) sets the editing surface's floor; alternatively give the
|
|
208
|
+
`document-engine-editor` element a real height and the surface fills it.
|
|
209
|
+
- **The editing surface does not scroll internally — it grows, and the page scrolls.** `0.1.5` briefly
|
|
210
|
+
made it a scroll container; that was reverted in `0.1.6` because the selection bubble menu is an
|
|
211
|
+
absolutely-positioned descendant of it, so the scroller became the panel's clip rect and a dropdown
|
|
212
|
+
opening upward lost its top options to the clip. If you need a fixed-height box that scrolls its
|
|
213
|
+
content, put `overflow: auto` on **your own** wrapper around `document-engine-editor`, never on
|
|
214
|
+
`.tiptap-editor`.
|
|
215
|
+
- Prose and editing-affordance styles are **opt-in** subpaths (`styles/editor-content`,
|
|
216
|
+
`styles/editor-interaction`), so the baseline can never impose a look on your documents.
|
|
175
217
|
|
|
176
218
|
---
|
|
177
219
|
|