docblocks-react-ui 0.20.0 → 0.21.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/CHANGELOG.md +35 -0
- package/README.md +27 -0
- package/dist/{Editor-Oia-HUin.mjs → Editor-DlnrmBT3.mjs} +49 -33
- package/dist/{index-BoKKzCxv.d.mts → index-CfaTBJ85.d.mts} +17 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/mermaid/index.mjs +1 -1
- package/dist/pdf/index.d.mts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# docblocks-react-ui
|
|
2
2
|
|
|
3
|
+
## 0.21.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1dd5577: `EditorProvider` takes a `scrollContainer` prop: the element that scrolls
|
|
8
|
+
the document when the consumer renders the editor inside its own `overflow`
|
|
9
|
+
box instead of the page scroll. The lazy blob resolution's preload band is
|
|
10
|
+
an `IntersectionObserver` — an element clipped by an inner scroller never
|
|
11
|
+
intersects a window-rooted observer, so the band degenerated to the visible
|
|
12
|
+
area and the bytes resolved only once an image entered the view. The band
|
|
13
|
+
and the first screen's eager measure now frame on the passed container; a
|
|
14
|
+
nested provider inherits it, and `null` (the default) keeps the window
|
|
15
|
+
frame — the page-scroll consumers are unchanged.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 258233c: The blob placeholder's box stays inside the page column and its content
|
|
20
|
+
stands centered. A figure whose intrinsic ratio is far wider than the
|
|
21
|
+
column (a 26:1 banner) let the loading placeholder outgrow the row on
|
|
22
|
+
Chromium — the box took its width from the inline `aspect-ratio` alone and
|
|
23
|
+
the document scroller grew a horizontal overflow; the shared placeholder
|
|
24
|
+
class now clamps the card to the row width. The placeholder's content (the
|
|
25
|
+
spinner + the label) is centered on both axes inside the reserved height
|
|
26
|
+
instead of sitting at the top edge — centered with auto margins, so a
|
|
27
|
+
reserved box shorter than the content keeps its top edge rather than
|
|
28
|
+
spilling above it.
|
|
29
|
+
- 1e71630: A standalone markdown image line (``) is dropped by the markdown
|
|
30
|
+
import and paste, the same stand the `text/html` paste already takes with
|
|
31
|
+
`<img>`: the document's image source is an opaque blob-store key, and a
|
|
32
|
+
markdown payload carries no bytes to store under one — the materialized
|
|
33
|
+
block took the source string verbatim (`img.png`, an external URL) and stood
|
|
34
|
+
a permanently broken `image` block whose store lookup never resolves. The
|
|
35
|
+
inline image in the middle of a line keeps its literal text. An imported
|
|
36
|
+
image becomes a real `image` block only through the consumer's upload.
|
|
37
|
+
|
|
3
38
|
## 0.20.0
|
|
4
39
|
|
|
5
40
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -299,6 +299,11 @@ attach(doc, provider);
|
|
|
299
299
|
- an empty or whitespace-only payload is a no-op (no transaction);
|
|
300
300
|
- a non-fresh document (the root has children) throws the typed
|
|
301
301
|
`ImportDocumentError` — the import fills the root, it never appends;
|
|
302
|
+
- a standalone markdown image line (``) is dropped, the same
|
|
303
|
+
stand as the HTML paste's `img`: the data model's image source is an
|
|
304
|
+
opaque blob-store key, and a payload carries no bytes to store under one
|
|
305
|
+
(an imported image becomes a real `image` block only through the
|
|
306
|
+
consumer's upload);
|
|
302
307
|
- the markdown's YAML frontmatter (a leading `--- … ---` fence, a hand-
|
|
303
308
|
rolled subset) is stripped before the blocks' parse and mapped to the
|
|
304
309
|
meta over the fresh document: `title` → the doc's title, the known
|
|
@@ -441,6 +446,10 @@ between those ids and the stored objects:
|
|
|
441
446
|
interface BlobMeta {
|
|
442
447
|
name: string;
|
|
443
448
|
mimeType: string;
|
|
449
|
+
/** The intrinsic dimensions: the lazy placeholder reserves the aspect
|
|
450
|
+
* ratio from them (the landing shifts nothing). */
|
|
451
|
+
width?: number;
|
|
452
|
+
height?: number;
|
|
444
453
|
}
|
|
445
454
|
|
|
446
455
|
interface BlobStore {
|
|
@@ -469,6 +478,24 @@ interface BlobStore {
|
|
|
469
478
|
`downloadUrl` — the blocks keep the legacy stand (the bytes over `get`,
|
|
470
479
|
the object URL's href). Both members are optional: existing consumers and
|
|
471
480
|
`createMemoryBlobStore` stand exactly the legacy behavior.
|
|
481
|
+
- **The lazy resolution (the default):** the metadata's head lookup runs at
|
|
482
|
+
mount (the placeholder reserves the aspect ratio from `width`/`height`),
|
|
483
|
+
and the bytes resolve only once the block enters the preload band — the
|
|
484
|
+
viewport grown by the `--docblocks-image-preload-margin` token (200% by
|
|
485
|
+
default, two viewport heights on each side). The blocks standing in view
|
|
486
|
+
at mount resolve at once (the first screen's priority); a resolved view
|
|
487
|
+
never falls back to the placeholder on a store change, and outside the
|
|
488
|
+
band the bytes are not re-fetched. `blobLoading: "eager"` on the provider
|
|
489
|
+
resolves every block at mount (the pre-lazy behavior); `"lazy"` is the
|
|
490
|
+
default, and a nested provider inherits the enclosing policy.
|
|
491
|
+
- **The scroll container** (`scrollContainer`): the preload band and the
|
|
492
|
+
first screen's measure are framed by this element when the consumer
|
|
493
|
+
scrolls the document inside its own `overflow` box instead of the page —
|
|
494
|
+
an element clipped by an inner scroller never intersects a window-rooted
|
|
495
|
+
observer, so the band would shrink to the visible area. `null` (the
|
|
496
|
+
default) frames the window; the value is read per render into the provider
|
|
497
|
+
context, so pass a stable reference (and the element itself may land after
|
|
498
|
+
the provider's first render — the band re-frames on it).
|
|
472
499
|
- The file picker accepts arbitrary files. New `image/*` uploads create an
|
|
473
500
|
`image` block; other MIME types, including `application/pdf`, create a
|
|
474
501
|
`file` block. PDF files render through `pdfPreview` or the sandboxed native
|
|
@@ -12212,12 +12212,19 @@ function FileCard({ id, fileId, blockType, url, name, subtype }) {
|
|
|
12212
12212
|
//#region src/blocks/blob-styles.ts
|
|
12213
12213
|
/** The shared blob placeholder card's structural classes (the vertical
|
|
12214
12214
|
* spacing stands per caller: the image figure carries none of its own, the
|
|
12215
|
-
* file card carries the block spacing).
|
|
12215
|
+
* file card carries the block spacing). The width clamp keeps the card
|
|
12216
|
+
* inside the row: the inline aspect ratio alone lets the box outgrow the
|
|
12217
|
+
* column (the resolved image carries the same clamp). */
|
|
12216
12218
|
const BLOB_PLACEHOLDER_CLASS = `
|
|
12217
|
-
mx-0 rounded-(--docblocks-radius)
|
|
12219
|
+
mx-0 max-w-full rounded-(--docblocks-radius)
|
|
12218
12220
|
border-(length:--docblocks-table-border-width) border-dashed border-(--docblocks-table-border-color)
|
|
12219
12221
|
outline-none
|
|
12220
12222
|
`;
|
|
12223
|
+
/** The placeholder card's content: centered in the reserved box on both
|
|
12224
|
+
* axes. Auto margins rather than `justify-content: center` — the content
|
|
12225
|
+
* past the reserved height (a very wide figure's short box) keeps its top
|
|
12226
|
+
* edge instead of spilling above it. */
|
|
12227
|
+
const BLOB_PLACEHOLDER_CONTENT_CLASS = "m-auto flex flex-col items-center gap-2 text-center";
|
|
12221
12228
|
/** The block spacing the file placeholder mirrors (the file card's own
|
|
12222
12229
|
* margins). */
|
|
12223
12230
|
const BLOB_PLACEHOLDER_SPACING = "my-(--docblocks-block-spacing)";
|
|
@@ -12245,7 +12252,13 @@ function blobPlaceholderAspect(meta) {
|
|
|
12245
12252
|
*
|
|
12246
12253
|
* The band is the viewport grown by the preload margin (the
|
|
12247
12254
|
* `--docblocks-image-preload-margin` token — 200% by default, so the
|
|
12248
|
-
* network runs well before the element enters the frame).
|
|
12255
|
+
* network runs well before the element enters the frame). The band's frame
|
|
12256
|
+
* is the observer's root: the window over the page scroll, or the
|
|
12257
|
+
* consumer's own scroll container (`root`) when the document scrolls inside
|
|
12258
|
+
* one — a window-rooted observer never sees an element clipped by the inner
|
|
12259
|
+
* scroller, so the band degenerates to the visible area. The same root
|
|
12260
|
+
* frames the mount's above-the-fold measure.
|
|
12261
|
+
* Without an
|
|
12249
12262
|
* `IntersectionObserver` in the runtime (SSR hydration, a test
|
|
12250
12263
|
* environment) the hook reports in view: the resolution's eager fallback.
|
|
12251
12264
|
*/
|
|
@@ -12261,13 +12274,16 @@ function readPreloadMargin(node) {
|
|
|
12261
12274
|
const value = getComputedStyle(node).getPropertyValue(PRELOAD_MARGIN_TOKEN).trim();
|
|
12262
12275
|
return value === "" ? DEFAULT_PRELOAD_MARGIN : value;
|
|
12263
12276
|
}
|
|
12264
|
-
/** True when the element's box touches the
|
|
12265
|
-
|
|
12277
|
+
/** True when the element's box touches the band's frame at the mount's
|
|
12278
|
+
* stand: the window's viewport, or the scroll container's box. */
|
|
12279
|
+
function standsAboveFold(node, root) {
|
|
12266
12280
|
const rect = node.getBoundingClientRect();
|
|
12267
|
-
return rect.bottom > 0 && rect.top < window.innerHeight;
|
|
12281
|
+
if (root === null) return rect.bottom > 0 && rect.top < window.innerHeight;
|
|
12282
|
+
const frame = root.getBoundingClientRect();
|
|
12283
|
+
return rect.bottom > frame.top && rect.top < frame.bottom;
|
|
12268
12284
|
}
|
|
12269
12285
|
function useInView(options = {}) {
|
|
12270
|
-
const { disabled = false, ready = true } = options;
|
|
12286
|
+
const { disabled = false, ready = true, root = null } = options;
|
|
12271
12287
|
const [inView, setInView] = useState(() => disabled || typeof IntersectionObserver === "undefined");
|
|
12272
12288
|
const nodeRef = useRef(null);
|
|
12273
12289
|
const ref = useCallback((node) => {
|
|
@@ -12280,7 +12296,7 @@ function useInView(options = {}) {
|
|
|
12280
12296
|
return;
|
|
12281
12297
|
}
|
|
12282
12298
|
if (!ready || node === null) return;
|
|
12283
|
-
if (standsAboveFold(node)) {
|
|
12299
|
+
if (standsAboveFold(node, root)) {
|
|
12284
12300
|
setInView(true);
|
|
12285
12301
|
return;
|
|
12286
12302
|
}
|
|
@@ -12289,10 +12305,17 @@ function useInView(options = {}) {
|
|
|
12289
12305
|
if (entry === void 0) return;
|
|
12290
12306
|
if (entry.isIntersecting) observer.disconnect();
|
|
12291
12307
|
setInView(entry.isIntersecting);
|
|
12292
|
-
}, {
|
|
12308
|
+
}, {
|
|
12309
|
+
root,
|
|
12310
|
+
rootMargin: readPreloadMargin(node)
|
|
12311
|
+
});
|
|
12293
12312
|
observer.observe(node);
|
|
12294
12313
|
return () => observer.disconnect();
|
|
12295
|
-
}, [
|
|
12314
|
+
}, [
|
|
12315
|
+
disabled,
|
|
12316
|
+
ready,
|
|
12317
|
+
root
|
|
12318
|
+
]);
|
|
12296
12319
|
return {
|
|
12297
12320
|
ref,
|
|
12298
12321
|
inView
|
|
@@ -12305,8 +12328,9 @@ function useInView(options = {}) {
|
|
|
12305
12328
|
* changes. The resolution stands in two phases: the metadata's lookup (the
|
|
12306
12329
|
* store's opt-in `getMeta` — no body transfer) runs at mount, and the
|
|
12307
12330
|
* bytes' fetch (`get` + the object URL) runs only once the placeholder's
|
|
12308
|
-
* box stands in the viewport's preload band
|
|
12309
|
-
*
|
|
12331
|
+
* box stands in the viewport's preload band (framed by the consumer's
|
|
12332
|
+
* `scrollContainer` when the document scrolls inside one) — the
|
|
12333
|
+
* viewport-gated lazy loading. The gate waits for the head's metadata over a store that offers
|
|
12310
12334
|
* it: the reserved aspect ratio is the layout the band's decision is made
|
|
12311
12335
|
* on (a document of images resolves its first screen only).
|
|
12312
12336
|
*
|
|
@@ -12320,7 +12344,7 @@ function useInView(options = {}) {
|
|
|
12320
12344
|
* outside it.
|
|
12321
12345
|
*/
|
|
12322
12346
|
function useBlobFile(fileId, rendersBytes, options = {}) {
|
|
12323
|
-
const { blobStore } = useEditorContext();
|
|
12347
|
+
const { blobStore, scrollContainer } = useEditorContext();
|
|
12324
12348
|
const getMeta = blobStore.getMeta;
|
|
12325
12349
|
const [ref, setRef] = useState(null);
|
|
12326
12350
|
const [metaView, setMetaView] = useState(null);
|
|
@@ -12332,7 +12356,8 @@ function useBlobFile(fileId, rendersBytes, options = {}) {
|
|
|
12332
12356
|
const headSettled = options.eager === true || blobStore.getMeta === void 0 || headMeta !== null || metaView !== null || failed;
|
|
12333
12357
|
const { ref: observeRef, inView } = useInView({
|
|
12334
12358
|
disabled: options.eager === true,
|
|
12335
|
-
ready: headSettled
|
|
12359
|
+
ready: headSettled,
|
|
12360
|
+
root: scrollContainer
|
|
12336
12361
|
});
|
|
12337
12362
|
const inViewRef = useRef(inView);
|
|
12338
12363
|
/** True once the bytes resolved: a later store change re-resolves them
|
|
@@ -12481,7 +12506,7 @@ function FileBlock({ id, block }) {
|
|
|
12481
12506
|
"aria-busy": view.status === "loading",
|
|
12482
12507
|
className: `${BLOB_PLACEHOLDER_CLASS} ${BLOB_PLACEHOLDER_SPACING}`,
|
|
12483
12508
|
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
12484
|
-
className:
|
|
12509
|
+
className: BLOB_PLACEHOLDER_CONTENT_CLASS,
|
|
12485
12510
|
children: [view.status === "loading" ? /* @__PURE__ */ jsx(LoaderCircle, { className: "size-6 animate-spin" }) : /* @__PURE__ */ jsx(File, { className: "size-6" }), t("file.placeholder")]
|
|
12486
12511
|
})
|
|
12487
12512
|
});
|
|
@@ -20735,6 +20760,8 @@ function tagEmphasisMarks(tagName) {
|
|
|
20735
20760
|
/** The markdown paste's constants (the line / tag regexes, the entity
|
|
20736
20761
|
* tables, the highlight color).
|
|
20737
20762
|
*/
|
|
20763
|
+
/** A standalone image line (the parser drops it: the schema's image source
|
|
20764
|
+
* is an opaque blob key, and a markdown payload carries no bytes). */
|
|
20738
20765
|
const IMAGE_LINE = /^ {0,3}!\[([^\]]*)\]\(\s*([^)\s]+)(?:\s+"[^"]*")?\s*\)$/;
|
|
20739
20766
|
/** The highlight color of a parsed `<mark>` (the standard HTML `mark` yellow). */
|
|
20740
20767
|
const MARK_HIGHLIGHT = "#ffff00";
|
|
@@ -21271,15 +21298,8 @@ function mdToBlocks(markdown) {
|
|
|
21271
21298
|
});
|
|
21272
21299
|
continue;
|
|
21273
21300
|
}
|
|
21274
|
-
|
|
21275
|
-
if (image !== null) {
|
|
21301
|
+
if (IMAGE_LINE.test(line)) {
|
|
21276
21302
|
closeParagraph();
|
|
21277
|
-
blocks.push({
|
|
21278
|
-
type: "image",
|
|
21279
|
-
indent: 0,
|
|
21280
|
-
attrs: { src: image[2] },
|
|
21281
|
-
runs: []
|
|
21282
|
-
});
|
|
21283
21303
|
i += 1;
|
|
21284
21304
|
continue;
|
|
21285
21305
|
}
|
|
@@ -21325,13 +21345,10 @@ function decodeRuns(runs) {
|
|
|
21325
21345
|
};
|
|
21326
21346
|
});
|
|
21327
21347
|
}
|
|
21328
|
-
/** The entity decode over a parsed block (the runs, the table cells
|
|
21348
|
+
/** The entity decode over a parsed block (the runs, the table cells). */
|
|
21329
21349
|
function decodeBlockEntities(block) {
|
|
21330
|
-
const attrs = { ...block.attrs };
|
|
21331
|
-
if (block.type === "image" && typeof attrs.src === "string") attrs.src = decodeEntities(attrs.src);
|
|
21332
21350
|
return {
|
|
21333
21351
|
...block,
|
|
21334
|
-
attrs,
|
|
21335
21352
|
runs: decodeRuns(block.runs),
|
|
21336
21353
|
rows: block.rows !== void 0 ? block.rows.map((row) => row.map(decodeRuns)) : void 0
|
|
21337
21354
|
};
|
|
@@ -21387,10 +21404,6 @@ function insertBlockOf(doc, m, parent, after, indent) {
|
|
|
21387
21404
|
indent
|
|
21388
21405
|
} : { indent }, at);
|
|
21389
21406
|
case "divider": return doc.insertBlock("divider", indent !== 0 ? { indent } : void 0, at);
|
|
21390
|
-
case "image": return doc.insertBlock("image", {
|
|
21391
|
-
src: m.attrs.src,
|
|
21392
|
-
indent
|
|
21393
|
-
}, at);
|
|
21394
21407
|
case "table": return insertTable(doc, m, parent, after, indent);
|
|
21395
21408
|
default: return insertBlockWithIndent(doc, "paragraph", parent, after, indent);
|
|
21396
21409
|
}
|
|
@@ -28993,7 +29006,7 @@ function ImageBlock({ id, block }) {
|
|
|
28993
29006
|
className: BLOB_PLACEHOLDER_CLASS,
|
|
28994
29007
|
style: file.status === "loading" ? blobPlaceholderAspect(file.meta) : void 0,
|
|
28995
29008
|
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
28996
|
-
className:
|
|
29009
|
+
className: BLOB_PLACEHOLDER_CONTENT_CLASS,
|
|
28997
29010
|
children: [file.status === "loading" ? /* @__PURE__ */ jsx(LoaderCircle, { className: "size-6 animate-spin" }) : /* @__PURE__ */ jsx(Image$1, { className: "size-6" }), t("image.placeholder")]
|
|
28998
29011
|
})
|
|
28999
29012
|
});
|
|
@@ -35080,7 +35093,7 @@ function publishedStandKey(doc) {
|
|
|
35080
35093
|
* its own. Safe under StrictMode double-mount: the cleanup detaches every
|
|
35081
35094
|
* subscription and destroys the view between the two mounts.
|
|
35082
35095
|
*/
|
|
35083
|
-
function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoading, databaseBridge, syncEmbedResolver, pdfPreview, mentionProvider, mentionInteractions, embedSandbox, rootBlockId, commandPalettePlaceholder, accessLevel, mode, publishedDoc, presence, hiddenAttributes, renderAttribute, attributeTypePicker, docTags, docDescription, coverPresets, children }) {
|
|
35096
|
+
function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoading, scrollContainer, databaseBridge, syncEmbedResolver, pdfPreview, mentionProvider, mentionInteractions, embedSandbox, rootBlockId, commandPalettePlaceholder, accessLevel, mode, publishedDoc, presence, hiddenAttributes, renderAttribute, attributeTypePicker, docTags, docDescription, coverPresets, children }) {
|
|
35084
35097
|
const rootId = rootBlockId ?? doc.meta.id;
|
|
35085
35098
|
const [store] = useState(() => createEditorStore(doc, rootId));
|
|
35086
35099
|
const docRef = useRef(doc);
|
|
@@ -35116,6 +35129,7 @@ function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoa
|
|
|
35116
35129
|
usePresencePublish(provider, store, presence, effectiveMode !== "edit");
|
|
35117
35130
|
const effectiveBlobStore = useMemo(() => blobStore ?? parentContext?.blobStore ?? getDefaultBlobStore(), [blobStore, parentContext]);
|
|
35118
35131
|
const effectiveBlobLoading = blobLoading ?? parentContext?.blobLoading ?? "lazy";
|
|
35132
|
+
const effectiveScrollContainer = scrollContainer === void 0 ? parentContext?.scrollContainer ?? null : scrollContainer;
|
|
35119
35133
|
const effectiveDatabaseBridge = useMemo(() => databaseBridge ?? parentContext?.databaseBridge, [databaseBridge, parentContext]);
|
|
35120
35134
|
const value = useMemo(() => {
|
|
35121
35135
|
const parent = parentContext;
|
|
@@ -35126,6 +35140,7 @@ function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoa
|
|
|
35126
35140
|
renderers: blockRenderers ?? parent?.renderers ?? {},
|
|
35127
35141
|
blobStore: effectiveBlobStore,
|
|
35128
35142
|
blobLoading: effectiveBlobLoading,
|
|
35143
|
+
scrollContainer: effectiveScrollContainer,
|
|
35129
35144
|
databaseBridge: effectiveDatabaseBridge,
|
|
35130
35145
|
syncEmbedResolver: syncEmbedResolver ?? parent?.syncEmbedResolver ?? null,
|
|
35131
35146
|
pdfPreview: pdfPreview ?? parent?.pdfPreview ?? null,
|
|
@@ -35153,6 +35168,7 @@ function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoa
|
|
|
35153
35168
|
blockRenderers,
|
|
35154
35169
|
effectiveBlobStore,
|
|
35155
35170
|
effectiveBlobLoading,
|
|
35171
|
+
effectiveScrollContainer,
|
|
35156
35172
|
effectiveDatabaseBridge,
|
|
35157
35173
|
syncEmbedResolver,
|
|
35158
35174
|
rootId,
|
|
@@ -1101,6 +1101,20 @@ interface EditorProviderBaseProps {
|
|
|
1101
1101
|
* A nested provider that supplies none inherits the enclosing policy.
|
|
1102
1102
|
*/
|
|
1103
1103
|
blobLoading?: BlobLoading;
|
|
1104
|
+
/**
|
|
1105
|
+
* The scroll container that scrolls the document, when the consumer
|
|
1106
|
+
* renders the editor inside its own `overflow` box instead of the page
|
|
1107
|
+
* scroll. The lazy blob resolution's preload band is measured against
|
|
1108
|
+
* this element (an element clipped by an inner scroller never intersects
|
|
1109
|
+
* a window-rooted observer, so the band would shrink to the visible
|
|
1110
|
+
* area); the first screen's eager stand is measured against its box too.
|
|
1111
|
+
*
|
|
1112
|
+
* `null` (the default) stands the window — the page scroll. The value is
|
|
1113
|
+
* read per render into the provider context: pass a stable reference. A
|
|
1114
|
+
* nested provider that passes nothing inherits the enclosing container;
|
|
1115
|
+
* an explicit `null` frames its own subtree on the window.
|
|
1116
|
+
*/
|
|
1117
|
+
scrollContainer?: Element | null;
|
|
1104
1118
|
/**
|
|
1105
1119
|
* Optional database bridge: the consumer's implementation of the table
|
|
1106
1120
|
* operations behind the external-form database blocks (the document
|
|
@@ -1181,6 +1195,9 @@ interface EditorContextValue {
|
|
|
1181
1195
|
/** The effective blob loading policy (the own prop, else the enclosing
|
|
1182
1196
|
* one, else "lazy"). */
|
|
1183
1197
|
blobLoading: BlobLoading;
|
|
1198
|
+
/** The consumer's scroll container (the `scrollContainer` provider prop);
|
|
1199
|
+
* `null` stands the window — the page scroll. */
|
|
1200
|
+
scrollContainer: Element | null;
|
|
1184
1201
|
/** The effective database bridge (the consumer's implementation);
|
|
1185
1202
|
* undefined when none was supplied — the external-form database blocks
|
|
1186
1203
|
* render the disconnected placeholder. */
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as PresenceCrypto, c as PresenceSharing, l as PresenceSharingMode, n as BlockRendererMap, o as PresenceIdentity, r as BlockRendererProps, s as PresencePeer, t as BlockRenderer } from "./index-2gZyAsdf.mjs";
|
|
2
|
-
import { $ as TableEnvelopeBase, A as DatabaseTablePhase, At as RenderAttribute, B as BridgeTableDescription, C as DatabaseTable, Ct as toBridgeError, D as cellValueEqual, Dt as createMemoryBlobStore, E as UseTableList, Et as BlobStore, F as FilterBuilder, G as MutationReceipt, H as CellValueParse, I as BatchOp, J as ProtocolDescriptor, K as OperationStatus, L as DatabaseBridge, M as UseDatabaseTable, N as emptyFilter, O as newMutationContext, Ot as AttributeTypePicker, P as filterIsComplete, Q as SubscriptionStatus, R as BridgeColumn, S as useTableList, St as isBridgeErrorCode, T as DatabaseTableView, Tt as BlobRef, U as DomainEvent, V as BridgeValueInput, W as MutationContext, X as SubscriptionHandle, Y as ProtocolLimits, Z as SubscriptionObserver, _ as AccessLevel, _t as TableSnapshot, a as EditorContextValue, at as Id, b as MentionInteractions, bt as BridgeErrorCode, c as SelectionRef, ct as PageSnapshot, d as PdfPreview, dt as Revision, et as TableEvent, f as PdfPreviewProps, ft as RowPage, g as DocTags, gt as TableRef, h as DocTag, ht as TableDescription, i as EditorProviderProps, it as FilterInput, j as DatabaseTableRow, jt as RenderAttributeProps, k as useDatabaseTable, kt as AttributeTypePickerProps, l as BlobLoading, lt as QueryOperator, m as DocDescription, mt as SortInput, n as DEFAULT_EMBED_SANDBOX, nt as Column, o as EmbedSandboxPolicy, ot as IsoInstant, p as CoverPresetSets, pt as RowWire, q as ProtocolCapability, r as EditorProvider, rt as FilterConditionInput, s as SyncEmbedResolver, st as PageQuery, t as useEditorContext, tt as CellMap, u as PresenceConfig, ut as QuerySemantics, v as EditorMode, vt as BRIDGE_ERROR_CODES, w as DatabaseTableProps, wt as BlobMeta, x as MentionProvider, xt as isBridgeError, y as MentionEntry, yt as BridgeError, z as BridgeColumnAnnotation } from "./index-
|
|
2
|
+
import { $ as TableEnvelopeBase, A as DatabaseTablePhase, At as RenderAttribute, B as BridgeTableDescription, C as DatabaseTable, Ct as toBridgeError, D as cellValueEqual, Dt as createMemoryBlobStore, E as UseTableList, Et as BlobStore, F as FilterBuilder, G as MutationReceipt, H as CellValueParse, I as BatchOp, J as ProtocolDescriptor, K as OperationStatus, L as DatabaseBridge, M as UseDatabaseTable, N as emptyFilter, O as newMutationContext, Ot as AttributeTypePicker, P as filterIsComplete, Q as SubscriptionStatus, R as BridgeColumn, S as useTableList, St as isBridgeErrorCode, T as DatabaseTableView, Tt as BlobRef, U as DomainEvent, V as BridgeValueInput, W as MutationContext, X as SubscriptionHandle, Y as ProtocolLimits, Z as SubscriptionObserver, _ as AccessLevel, _t as TableSnapshot, a as EditorContextValue, at as Id, b as MentionInteractions, bt as BridgeErrorCode, c as SelectionRef, ct as PageSnapshot, d as PdfPreview, dt as Revision, et as TableEvent, f as PdfPreviewProps, ft as RowPage, g as DocTags, gt as TableRef, h as DocTag, ht as TableDescription, i as EditorProviderProps, it as FilterInput, j as DatabaseTableRow, jt as RenderAttributeProps, k as useDatabaseTable, kt as AttributeTypePickerProps, l as BlobLoading, lt as QueryOperator, m as DocDescription, mt as SortInput, n as DEFAULT_EMBED_SANDBOX, nt as Column, o as EmbedSandboxPolicy, ot as IsoInstant, p as CoverPresetSets, pt as RowWire, q as ProtocolCapability, r as EditorProvider, rt as FilterConditionInput, s as SyncEmbedResolver, st as PageQuery, t as useEditorContext, tt as CellMap, u as PresenceConfig, ut as QuerySemantics, v as EditorMode, vt as BRIDGE_ERROR_CODES, w as DatabaseTableProps, wt as BlobMeta, x as MentionProvider, xt as isBridgeError, y as MentionEntry, yt as BridgeError, z as BridgeColumnAnnotation } from "./index-CfaTBJ85.mjs";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { Component, ComponentType, ErrorInfo, ReactNode } from "react";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
@@ -427,7 +427,7 @@ declare function AlertDescription({ className, ...props }: React$1.ComponentProp
|
|
|
427
427
|
//#endregion
|
|
428
428
|
//#region src/shared/ui/Badge.d.ts
|
|
429
429
|
declare const badgeVariants: (props?: ({
|
|
430
|
-
variant?: "default" | "destructive" | "
|
|
430
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "custom" | null | undefined;
|
|
431
431
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
432
432
|
declare function Badge({ className, variant, asChild, ...props }: React$1.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
433
433
|
asChild?: boolean;
|
|
@@ -438,7 +438,7 @@ declare function BareSelect({ className, children, ...props }: React$1.Component
|
|
|
438
438
|
//#endregion
|
|
439
439
|
//#region src/shared/ui/Button.d.ts
|
|
440
440
|
declare const buttonVariants: (props?: ({
|
|
441
|
-
variant?: "link" | "default" | "destructive" | "
|
|
441
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
442
442
|
size?: "default" | "icon" | "sm" | "lg" | "xl" | null | undefined;
|
|
443
443
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
444
444
|
declare function Button({ className, variant, size, asChild, type, ...props }: React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as UnknownSlashCommandError, S as UnhandledValueError, _ as CanvasPasteError, b as HookMisuseError, g as BlobNotFoundError, s as preventDefault, v as DocBlocksUiError, w as cn, x as PdfFetchError, y as EditorProviderError } from "./constants-D_3p65rk.mjs";
|
|
2
|
-
import { $ as DropdownMenuShortcut, $t as DocblocksI18nProvider, A as Select, B as Label, Bt as CardFooter, C as cellValueEqual, Ct as isBridgeError, D as filterIsComplete, Dt as parseCellValue, E as emptyFilter, Et as conditionMatches, F as SelectScrollDownButton, Ft as Skeleton, G as DropdownMenuContent, Gt as useBlock, H as Input, Ht as CardTitle, I as SelectScrollUpButton, It as Card, J as DropdownMenuLabel, Jt as usePresence, K as DropdownMenuGroup, Kt as useDoc, L as SelectSeparator, Lt as CardAction, M as SelectGroup, Mt as Eye, N as SelectItem, O as SegmentSelector, Ot as TEXT_TYPES, P as SelectLabel, Pt as BookOpen, Q as DropdownMenuSeparator, Qt as useText, R as SelectTrigger, Rt as CardContent, S as useDatabaseTable, St as BridgeError, T as FilterBuilder, Tt as toBridgeError, U as DropdownMenu, Ut as Badge, V as InlineEditInput, Vt as CardHeader, W as DropdownMenuCheckboxItem, Wt as badgeVariants, X as DropdownMenuRadioGroup, Xt as useSelection, Y as DropdownMenuPortal, Yt as usePresenceSharing, Z as DropdownMenuRadioItem, Zt as useSelectionView, _ as mapFrontmatter, _t as BASELINE_CAPABILITIES, a as DEFAULT_EMBED_SANDBOX, at as Popover, b as renderRuns, bt as validateProtocolDescriptor, c as SHAPE_FONT_OPTIONS, ct as PopoverDescription, d as FORMAT_PALETTE, dt as PopoverTrigger, en as createMemoryBlobStore, et as DropdownMenuSub, ft as Checkbox, g as parseFrontmatter, gt as AlertTitle, h as mdToBlocks, ht as AlertDescription, i as useEditorContext, it as Separator, j as SelectContent, jt as Pen, k as ScrollArea, kt as columnAnnotation, l as SHAPE_FONT_STACKS, lt as PopoverHeader, m as insertNative, mt as Alert, n as useCoverAverageColor, nn as Button, nt as DropdownMenuSubTrigger, ot as PopoverAnchor, p as htmlToBlocks, pt as BareSelect, q as DropdownMenuItem, qt as useMeta, r as EditorProvider, rn as buttonVariants, rt as DropdownMenuTrigger, st as PopoverContent, t as Editor, tn as EditorErrorBoundary, tt as DropdownMenuSubContent, ut as PopoverTitle, v as markToggleAction, vt as PROTOCOL_VERSION, w as newMutationContext, wt as isBridgeErrorCode, x as GridBody, xt as BRIDGE_ERROR_CODES, yt as isDatabaseBridge, z as SelectValue, zt as CardDescription } from "./Editor-
|
|
2
|
+
import { $ as DropdownMenuShortcut, $t as DocblocksI18nProvider, A as Select, B as Label, Bt as CardFooter, C as cellValueEqual, Ct as isBridgeError, D as filterIsComplete, Dt as parseCellValue, E as emptyFilter, Et as conditionMatches, F as SelectScrollDownButton, Ft as Skeleton, G as DropdownMenuContent, Gt as useBlock, H as Input, Ht as CardTitle, I as SelectScrollUpButton, It as Card, J as DropdownMenuLabel, Jt as usePresence, K as DropdownMenuGroup, Kt as useDoc, L as SelectSeparator, Lt as CardAction, M as SelectGroup, Mt as Eye, N as SelectItem, O as SegmentSelector, Ot as TEXT_TYPES, P as SelectLabel, Pt as BookOpen, Q as DropdownMenuSeparator, Qt as useText, R as SelectTrigger, Rt as CardContent, S as useDatabaseTable, St as BridgeError, T as FilterBuilder, Tt as toBridgeError, U as DropdownMenu, Ut as Badge, V as InlineEditInput, Vt as CardHeader, W as DropdownMenuCheckboxItem, Wt as badgeVariants, X as DropdownMenuRadioGroup, Xt as useSelection, Y as DropdownMenuPortal, Yt as usePresenceSharing, Z as DropdownMenuRadioItem, Zt as useSelectionView, _ as mapFrontmatter, _t as BASELINE_CAPABILITIES, a as DEFAULT_EMBED_SANDBOX, at as Popover, b as renderRuns, bt as validateProtocolDescriptor, c as SHAPE_FONT_OPTIONS, ct as PopoverDescription, d as FORMAT_PALETTE, dt as PopoverTrigger, en as createMemoryBlobStore, et as DropdownMenuSub, ft as Checkbox, g as parseFrontmatter, gt as AlertTitle, h as mdToBlocks, ht as AlertDescription, i as useEditorContext, it as Separator, j as SelectContent, jt as Pen, k as ScrollArea, kt as columnAnnotation, l as SHAPE_FONT_STACKS, lt as PopoverHeader, m as insertNative, mt as Alert, n as useCoverAverageColor, nn as Button, nt as DropdownMenuSubTrigger, ot as PopoverAnchor, p as htmlToBlocks, pt as BareSelect, q as DropdownMenuItem, qt as useMeta, r as EditorProvider, rn as buttonVariants, rt as DropdownMenuTrigger, st as PopoverContent, t as Editor, tn as EditorErrorBoundary, tt as DropdownMenuSubContent, ut as PopoverTitle, v as markToggleAction, vt as PROTOCOL_VERSION, w as newMutationContext, wt as isBridgeErrorCode, x as GridBody, xt as BRIDGE_ERROR_CODES, yt as isDatabaseBridge, z as SelectValue, zt as CardDescription } from "./Editor-DlnrmBT3.mjs";
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
package/dist/mermaid/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as clamp, d as Plus, f as Minus, p as LoaderCircle, s as preventDefault, u as TriangleAlert } from "../constants-D_3p65rk.mjs";
|
|
2
|
-
import { At as RotateCcw, Ft as Skeleton, Mt as Eye, Nt as CodeXml, O as SegmentSelector, f as textOf, gt as AlertTitle, ht as AlertDescription, i as useEditorContext, mt as Alert, nn as Button, o as childrenSlot, s as CodeHeader, u as TextBlock, y as INLINE_CODE_CLASS } from "../Editor-
|
|
2
|
+
import { At as RotateCcw, Ft as Skeleton, Mt as Eye, Nt as CodeXml, O as SegmentSelector, f as textOf, gt as AlertTitle, ht as AlertDescription, i as useEditorContext, mt as Alert, nn as Button, o as childrenSlot, s as CodeHeader, u as TextBlock, y as INLINE_CODE_CLASS } from "../Editor-DlnrmBT3.mjs";
|
|
3
3
|
import { t as Maximize } from "../Maximize-BBHnCDWL.mjs";
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
package/dist/pdf/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as PdfPreviewProps } from "../index-
|
|
1
|
+
import { f as PdfPreviewProps } from "../index-CfaTBJ85.mjs";
|
|
2
2
|
//#region src/pdf/PdfFirstPage.d.ts
|
|
3
3
|
declare function PdfFirstPage({ id, blockType, url, name }: PdfPreviewProps): import("react").JSX.Element;
|
|
4
4
|
//#endregion
|
package/package.json
CHANGED