@fileverse-dev/ddoc 6.0.0-drop-in.0 → 6.0.0-drop-in.1
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 +5 -4
- package/dist/index.es.js +8118 -8118
- package/dist/package/components/editor-toolbar.d.ts +2 -1
- package/dist/package/components/mobile-toolbar.d.ts +2 -1
- package/dist/package/types.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ import '@fileverse-dev/ddoc/styles'; // editor CSS
|
|
|
61
61
|
|
|
62
62
|
If the editor renders with no height, its parent has none.
|
|
63
63
|
|
|
64
|
-
`renderNavbar` output is the editor's first row by default. Without `renderNavbar`
|
|
64
|
+
`renderNavbar` output is the editor's first row by default, rendered as is: the editor adds no styling, so return one element with your own background, padding and border. In flow it sits in an unstyled row that only animates the collapse. Without `renderNavbar` nothing is rendered. To place the navbar elsewhere, pass the element to render into. Hold it in state, not in a ref, so the editor re-renders when it attaches:
|
|
65
65
|
|
|
66
66
|
```tsx
|
|
67
67
|
const [navbarEl, setNavbarEl] = useState<HTMLElement | null>(null);
|
|
@@ -153,7 +153,7 @@ You should now be set to use dDocs!
|
|
|
153
153
|
- Give the editor a parent with a definite height (see Sizing). It no longer sizes itself from `100dvh`.
|
|
154
154
|
- Put your footer after the editor in normal flow. `footerHeight` has no effect and can be removed.
|
|
155
155
|
- The navbar and toolbars are no longer inside `#editor-canvas`. CSS that used `#editor-canvas` as their ancestor should use `.ddoc-editor-root`.
|
|
156
|
-
-
|
|
156
|
+
- The editor no longer wraps your navbar in `<nav id="Navbar">`. It renders what `renderNavbar` returns, so move the wrapper's styling (`color-bg-default p-2 flex gap-10 items-center justify-between w-full border-b color-border-default`) and the `id`, if you select on it, onto your own element. The Escape-returns-focus-to-editor handler went with it, and hiding now collapses an unstyled row (`.ddoc-navbar-row`) around your element. Without `renderNavbar` nothing is rendered. The navbar's height comes from its content; it was a fixed 64px, 46px below `lg`.
|
|
157
157
|
- `editorCanvasClassNames` should not set a height.
|
|
158
158
|
- `zoomLevel`, `isNavbarVisible` and `isPreviewMode` are optional. Every UI state can be left out, or controlled with a value and an `onXChange` callback. The `setX` props still work and are deprecated.
|
|
159
159
|
- Your Tailwind build needs no config change. The new `ddoc-*` variants (container-query breakpoints that follow the editor's width) come from the `@fileverse-dev/ddoc/tailwind` preset you already use.
|
|
@@ -163,8 +163,8 @@ Behaviour that changes without a code change on your side:
|
|
|
163
163
|
- UI features that did nothing without their `setX` prop now work on internal state. The Split View toggle shows whenever live collaboration is off (it needed `setIsSplitView` before), and the comment drawer, the outline and presentation mode open without a setter. To keep one fixed, pass its value with no callback, for example `isPresentationMode={false}`. For Split View, `isSplitView={false}` keeps the editor out of Split View, but the toolbar toggle is still shown and does nothing.
|
|
164
164
|
- `onFocusModeChange` and the deprecated `onFocusMode` also fire when `isFocusMode` is not passed.
|
|
165
165
|
- `#editor-canvas` is now the document scroller (it carries `data-editor-scroll-container`), and the root (`.ddoc-editor-root`) is `overflow: hidden`.
|
|
166
|
-
- A navbar portalled with `navbarContainer` is positioned and layered by you; the editor only renders into the element.
|
|
167
|
-
- The
|
|
166
|
+
- A navbar portalled with `navbarContainer` is positioned and layered by you; the editor only renders into the element. Focus mode and the toolbar's collapse toggle do not hide it: hide your own element from `onFocusModeChange` and `onNavbarVisibleChange` if you want that, or pass `showNavbarToggle={false}` to remove the collapse toggle.
|
|
167
|
+
- The toolbars no longer slide or fade when hidden; their rows are removed and the canvas takes the space. An in-flow navbar still slides up and fades over 300ms. For a portalled navbar the animation is yours: put `ddoc-navbar-row` on your element and add `ddoc-navbar-row--hidden` to collapse it.
|
|
168
168
|
- The mobile tab panel sits at the editor's bottom edge. It no longer adds `24px + env(safe-area-inset-bottom)`, so your footer must carry the safe-area inset.
|
|
169
169
|
- The editor's responsive classes use `:where()` in their window fallback, so they need Chrome 88+, Safari 14+ or Firefox 78+.
|
|
170
170
|
|
|
@@ -211,6 +211,7 @@ Every UI state can be left out (the editor keeps it internally), or controlled w
|
|
|
211
211
|
| `setIsNavbarVisible` | `React.Dispatch<SetStateAction<boolean>>` | Deprecated, use `onNavbarVisibleChange` |
|
|
212
212
|
| `renderNavbar` | `() => JSX.Element` | Custom navbar renderer. Without it no navbar is rendered |
|
|
213
213
|
| `navbarContainer` | `HTMLElement \| null` | Element to render the navbar into. Omit for in-flow. `null` renders nothing until it attaches |
|
|
214
|
+
| `showNavbarToggle` | `boolean` | Show the toolbar's navbar collapse chevron. Default `true` |
|
|
214
215
|
| `renderThemeToggle` | `() => JSX.Element` | Custom theme toggle renderer |
|
|
215
216
|
| `showTOC` | `boolean` | Controls the outline |
|
|
216
217
|
| `onShowTOCChange` | `(show: boolean) => void` | Outline shown or hidden |
|