docblocks-react-ui 0.4.0 → 0.4.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/CHANGELOG.md +16 -0
- package/README.md +8 -2
- package/dist/{Editor-BgG_An_T.mjs → Editor-CUToaW9z.mjs} +5 -3
- package/dist/{index-1dJBnGYv.d.mts → index-BQRTt8x2.d.mts} +11 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +7 -3
- 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,21 @@
|
|
|
1
1
|
# docblocks-react-ui
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ddc068e: The standalone `DatabaseTable` gains a `className` prop: the consumer's
|
|
8
|
+
sizing / layout classes merge over the component's root (the package's
|
|
9
|
+
`--docblocks-*` token scope's anchor, merged with the consumer's own
|
|
10
|
+
classes). The grid already stands the root's width (`w-full`); the
|
|
11
|
+
`className` closes the height's stand — a height-constrained root (the
|
|
12
|
+
consumer's `h-*` class) stands the grid's inner scroll over the toolbar
|
|
13
|
+
|
|
14
|
+
- header + rows (the card / content / grid-region's flex plumbing:
|
|
15
|
+
`flex-1 min-h-0`), and the unconstrained's stand is the content's height
|
|
16
|
+
(as over the document's database block — the plumbing stands inert over
|
|
17
|
+
the block's context).
|
|
18
|
+
|
|
3
19
|
## 0.4.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -422,7 +422,8 @@ function TablesSection({ bridge }: { bridge: DatabaseBridge }) {
|
|
|
422
422
|
}
|
|
423
423
|
```
|
|
424
424
|
|
|
425
|
-
- `DatabaseTable({ bridge, tableId, readOnly?, view?, onViewChange
|
|
425
|
+
- `DatabaseTable({ bridge, tableId, readOnly?, view?, onViewChange?,
|
|
426
|
+
className? })` —
|
|
426
427
|
the live grid over the bridge's table id (the same data stand as the
|
|
427
428
|
document block: the schema, the rows, the live events, the optimistic
|
|
428
429
|
cell layer). The view's settings (`filter`, `columnOrder`,
|
|
@@ -430,7 +431,12 @@ function TablesSection({ bridge }: { bridge: DatabaseBridge }) {
|
|
|
430
431
|
the optional `view` prop at mount); `onViewChange(patch)` receives one
|
|
431
432
|
patch per change for the consumer's persistence (the controlled mode
|
|
432
433
|
stands absent — the state is never external). `readOnly` gates the
|
|
433
|
-
editing's paths (the read-only block's parity). The
|
|
434
|
+
editing's paths (the read-only block's parity). The sizing's stand is
|
|
435
|
+
the consumer's: the grid stands the root's width (`w-full`), and the
|
|
436
|
+
`className` over the root (the component's own classes stand merged
|
|
437
|
+
over it) — a height-constrained root stands the grid's inner scroll
|
|
438
|
+
(the unconstrained's stand is the content's height, as over the
|
|
439
|
+
document's block). The component is
|
|
434
440
|
self-contained: it wraps itself in the package's i18n scope and anchors
|
|
435
441
|
the `--docblocks-*` token scope over its own root, so it themes
|
|
436
442
|
standalone over the consumer's page (the `dark` class over an ancestor
|
|
@@ -9544,6 +9544,7 @@ function GridBody({ blockId, bridge, tableId, filter, columnOrder, hiddenColumns
|
|
|
9544
9544
|
"data-slot": "docblocks/block",
|
|
9545
9545
|
"data-block-type": "database",
|
|
9546
9546
|
"data-block-id": blockId,
|
|
9547
|
+
className: "min-h-0 flex-1",
|
|
9547
9548
|
children: /* @__PURE__ */ jsx(CardContent, {
|
|
9548
9549
|
"data-slot": "docblocks/database",
|
|
9549
9550
|
"data-state": "loading",
|
|
@@ -9559,7 +9560,7 @@ function GridBody({ blockId, bridge, tableId, filter, columnOrder, hiddenColumns
|
|
|
9559
9560
|
"data-slot": "docblocks/block",
|
|
9560
9561
|
"data-block-type": "database",
|
|
9561
9562
|
"data-block-id": blockId,
|
|
9562
|
-
className: "\n my-(--docblocks-block-spacing) rounded-(--docblocks-radius)
|
|
9563
|
+
className: "\n my-(--docblocks-block-spacing) min-h-0 flex-1 rounded-(--docblocks-radius)\n border-(length:--docblocks-table-border-width) border-(--docblocks-table-border-color) outline-none\n ",
|
|
9563
9564
|
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
9564
9565
|
"data-slot": "docblocks/database",
|
|
9565
9566
|
"data-state": "broken",
|
|
@@ -9651,10 +9652,10 @@ function GridBody({ blockId, bridge, tableId, filter, columnOrder, hiddenColumns
|
|
|
9651
9652
|
"data-block-type": "database",
|
|
9652
9653
|
"data-block-id": blockId,
|
|
9653
9654
|
"data-state": "ready",
|
|
9654
|
-
className: "\n my-(--docblocks-block-spacing) rounded-(--docblocks-radius)
|
|
9655
|
+
className: "\n my-(--docblocks-block-spacing) flex min-h-0 flex-1 flex-col rounded-(--docblocks-radius)\n border-(length:--docblocks-table-border-width) border-(--docblocks-table-border-color) outline-none\n ",
|
|
9655
9656
|
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
9656
9657
|
"data-slot": "docblocks/database",
|
|
9657
|
-
className: "flex flex-col gap-(--docblocks-block-spacing) p-(--docblocks-block-spacing)",
|
|
9658
|
+
className: "flex min-h-0 flex-1 flex-col gap-(--docblocks-block-spacing) p-(--docblocks-block-spacing)",
|
|
9658
9659
|
children: [
|
|
9659
9660
|
/* @__PURE__ */ jsxs("div", {
|
|
9660
9661
|
"data-slot": "docblocks/database-toolbar",
|
|
@@ -9761,6 +9762,7 @@ function GridBody({ blockId, bridge, tableId, filter, columnOrder, hiddenColumns
|
|
|
9761
9762
|
}),
|
|
9762
9763
|
/* @__PURE__ */ jsxs(ScrollArea, {
|
|
9763
9764
|
"data-slot": "docblocks/database-grid",
|
|
9765
|
+
className: "min-h-0 flex-1",
|
|
9764
9766
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
9765
9767
|
ref: tableRef,
|
|
9766
9768
|
"data-slot": "docblocks/database-table",
|
|
@@ -767,6 +767,12 @@ interface DatabaseTableProps {
|
|
|
767
767
|
view?: Partial<DatabaseTableView>;
|
|
768
768
|
/** The view's change's hook (the persistence's stand; the patch = the changed's attrs only). */
|
|
769
769
|
onViewChange?: (patch: Partial<DatabaseTableView>) => void;
|
|
770
|
+
/** The consumer's sizing / layout's classes over the root (the package's
|
|
771
|
+
* token's scope's anchor + the flex-column's stand): the width stands the
|
|
772
|
+
* consumer's layout (the grid's `w-full`'s parity), and a height-
|
|
773
|
+
* constrained root stands the grid's inner scroll (the unconstrained's
|
|
774
|
+
* stand is the content's height, as over the document's block). */
|
|
775
|
+
className?: string;
|
|
770
776
|
}
|
|
771
777
|
/**
|
|
772
778
|
* The standalone's database table: the live grid over the bridge's table
|
|
@@ -777,9 +783,12 @@ interface DatabaseTableProps {
|
|
|
777
783
|
* prop) + the consumer's persistence over the `onViewChange`'s patch
|
|
778
784
|
* (one patch per change, as the block's `updateBlock` stand). The i18n's
|
|
779
785
|
* scope stands self-contained (the package's instance — the same's stand
|
|
780
|
-
* as the consumer-placed components).
|
|
786
|
+
* as the consumer-placed components). The sizing's stand is the
|
|
787
|
+
* consumer's: the `className` over the root (a height-constrained root
|
|
788
|
+
* stands the grid's inner scroll; the unconstrained's stand is the
|
|
789
|
+
* content's height).
|
|
781
790
|
*/
|
|
782
|
-
declare function DatabaseTable({ bridge, tableId, readOnly, view, onViewChange }: DatabaseTableProps): import("react").JSX.Element;
|
|
791
|
+
declare function DatabaseTable({ bridge, tableId, readOnly, view, onViewChange, className }: DatabaseTableProps): import("react").JSX.Element;
|
|
783
792
|
//#endregion
|
|
784
793
|
//#region src/database/standalone/use-table-list.d.ts
|
|
785
794
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as BlockRendererMap, r as BlockRendererProps, t as BlockRenderer } from "./index-YJcgf8Hh.mjs";
|
|
2
|
-
import { $ as ProtocolLimits, A as filterIsComplete, B as DatabaseBridge, C as DatabaseTableView, Ct as BlobSubtype, D as DatabaseTableRow, E as DatabaseTablePhase, F as BridgeTableDescription, G as IsoInstant, H as FilterConditionInput, I as BridgeValueInput, J as OperationStatus, K as MutationContext, L as CellMap, M as BatchOp, N as BridgeColumn, O as UseDatabaseTable, P as BridgeColumnAnnotation, Q as ProtocolDescriptor, R as CellValueParse, S as DatabaseTableProps, St as BlobStore, T as useDatabaseTable, Tt as createMemoryBlobStore, U as FilterInput, V as DomainEvent, W as Id, X as PageSnapshot, Y as PageQuery, Z as ProtocolCapability, _ as PresencePeer, _t as isBridgeError, a as EditorContextValue, at as SortInput, b as useTableList, bt as BlobMeta, c as EmbedSandboxPolicy, ct as SubscriptionStatus, d as PdfPreview, dt as TableEvent, et as QueryOperator, f as PdfPreviewProps, ft as TableRef, g as PresenceIdentity, gt as BridgeErrorCode, h as PresenceCrypto, ht as BridgeError, i as AccessLevel, it as RowWire, j as FilterBuilder, k as emptyFilter, l as MentionEntry, lt as TableDescription, m as SyncEmbedResolver, mt as BRIDGE_ERROR_CODES, n as DEFAULT_EMBED_SANDBOX, nt as Revision, o as EditorMode, ot as SubscriptionHandle, p as PresenceConfig, pt as TableSnapshot, q as MutationReceipt, r as EditorProvider, rt as RowPage, s as EditorProviderProps, st as SubscriptionObserver, t as useEditorContext, tt as QuerySemantics, u as MentionProvider, ut as TableEnvelopeBase, v as PresenceSharing, vt as isBridgeErrorCode, w as UseTableList, wt as blobSubtypeOf, x as DatabaseTable, xt as BlobRef, y as PresenceSharingMode, yt as toBridgeError, z as Column } from "./index-
|
|
2
|
+
import { $ as ProtocolLimits, A as filterIsComplete, B as DatabaseBridge, C as DatabaseTableView, Ct as BlobSubtype, D as DatabaseTableRow, E as DatabaseTablePhase, F as BridgeTableDescription, G as IsoInstant, H as FilterConditionInput, I as BridgeValueInput, J as OperationStatus, K as MutationContext, L as CellMap, M as BatchOp, N as BridgeColumn, O as UseDatabaseTable, P as BridgeColumnAnnotation, Q as ProtocolDescriptor, R as CellValueParse, S as DatabaseTableProps, St as BlobStore, T as useDatabaseTable, Tt as createMemoryBlobStore, U as FilterInput, V as DomainEvent, W as Id, X as PageSnapshot, Y as PageQuery, Z as ProtocolCapability, _ as PresencePeer, _t as isBridgeError, a as EditorContextValue, at as SortInput, b as useTableList, bt as BlobMeta, c as EmbedSandboxPolicy, ct as SubscriptionStatus, d as PdfPreview, dt as TableEvent, et as QueryOperator, f as PdfPreviewProps, ft as TableRef, g as PresenceIdentity, gt as BridgeErrorCode, h as PresenceCrypto, ht as BridgeError, i as AccessLevel, it as RowWire, j as FilterBuilder, k as emptyFilter, l as MentionEntry, lt as TableDescription, m as SyncEmbedResolver, mt as BRIDGE_ERROR_CODES, n as DEFAULT_EMBED_SANDBOX, nt as Revision, o as EditorMode, ot as SubscriptionHandle, p as PresenceConfig, pt as TableSnapshot, q as MutationReceipt, r as EditorProvider, rt as RowPage, s as EditorProviderProps, st as SubscriptionObserver, t as useEditorContext, tt as QuerySemantics, u as MentionProvider, ut as TableEnvelopeBase, v as PresenceSharing, vt as isBridgeErrorCode, w as UseTableList, wt as blobSubtypeOf, x as DatabaseTable, xt as BlobRef, y as PresenceSharingMode, yt as toBridgeError, z as Column } from "./index-BQRTt8x2.mjs";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { ComponentType, ReactNode } from "react";
|
|
5
5
|
import { Block, BlockId, BlockType, Doc, DocMeta, PresenceState, Selection, SelectionView, SyncEmbedRef, TextRun } from "docblocks-core";
|
|
@@ -294,7 +294,7 @@ declare function AlertDescription({ className, ...props }: React.ComponentProps<
|
|
|
294
294
|
//#endregion
|
|
295
295
|
//#region src/shared/ui/Badge.d.ts
|
|
296
296
|
declare const badgeVariants: (props?: ({
|
|
297
|
-
variant?: "default" | "destructive" | "
|
|
297
|
+
variant?: "default" | "destructive" | "custom" | "secondary" | "outline" | null | undefined;
|
|
298
298
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
299
299
|
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
300
300
|
asChild?: boolean;
|
|
@@ -305,7 +305,7 @@ declare function BareSelect({ className, children, ...props }: React.ComponentPr
|
|
|
305
305
|
//#endregion
|
|
306
306
|
//#region src/shared/ui/Button.d.ts
|
|
307
307
|
declare const buttonVariants: (props?: ({
|
|
308
|
-
variant?: "link" | "default" | "destructive" | "
|
|
308
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
309
309
|
size?: "default" | "icon" | "sm" | "lg" | "xl" | null | undefined;
|
|
310
310
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
311
311
|
declare function Button({ className, variant, size, asChild, type, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as PopoverHeader, A as SelectTrigger, At as isBridgeErrorCode, B as DropdownMenuRadioGroup, Bt as useMeta, C as SelectContent, Ct as BASELINE_CAPABILITIES, D as SelectScrollDownButton, Dt as BRIDGE_ERROR_CODES, E as SelectLabel, Et as validateProtocolDescriptor, F as DropdownMenuContent, Ft as columnAnnotation, G as DropdownMenuSubContent, Gt as useText, H as DropdownMenuSeparator, Ht as usePresenceSharing, I as DropdownMenuGroup, It as ScrollArea, J as Separator, Jt as blobSubtypeOf, K as DropdownMenuSubTrigger, L as DropdownMenuItem, Lt as Input, M as Label, Mt as conditionMatches, N as DropdownMenu, Nt as parseCellValue, O as SelectScrollUpButton, Ot as BridgeError, P as DropdownMenuCheckboxItem, Pt as TEXT_TYPES, Q as PopoverDescription, R as DropdownMenuLabel, Rt as useBlock, S as Select, St as AlertTitle, T as SelectItem, Tt as isDatabaseBridge, U as DropdownMenuShortcut, Ut as useSelection, V as DropdownMenuRadioItem, Vt as usePresence, W as DropdownMenuSub, Wt as useSelectionView, X as PopoverAnchor, Y as Popover, Yt as createMemoryBlobStore, Z as PopoverContent, _ as FilterBuilder, _t as BareSelect, a as SHAPE_FONT_STACKS, at as CardAction, b as Skeleton, bt as Alert, ct as CardFooter, d as useEditorContext, dt as Pen, et as PopoverTitle, f as DEFAULT_EMBED_SANDBOX, ft as Eye, g as newMutationContext, gt as buttonVariants, h as cellValueEqual, ht as Button, i as SHAPE_FONT_OPTIONS, it as Card, j as SelectValue, jt as toBridgeError, k as SelectSeparator, kt as isBridgeError, l as markToggleAction, lt as CardHeader, m as useDatabaseTable, mt as BookOpen, nt as DocblocksI18nProvider, o as FORMAT_PALETTE, ot as CardContent, p as GridBody, q as DropdownMenuTrigger, qt as renderRuns, rt as Checkbox, st as CardDescription, t as Editor, tt as PopoverTrigger, u as EditorProvider, ut as CardTitle, v as emptyFilter, vt as Badge, w as SelectGroup, wt as PROTOCOL_VERSION, x as SegmentSelector, xt as AlertDescription, y as filterIsComplete, yt as badgeVariants, z as DropdownMenuPortal, zt as useDoc } from "./Editor-
|
|
1
|
+
import { $ as PopoverHeader, A as SelectTrigger, At as isBridgeErrorCode, B as DropdownMenuRadioGroup, Bt as useMeta, C as SelectContent, Ct as BASELINE_CAPABILITIES, D as SelectScrollDownButton, Dt as BRIDGE_ERROR_CODES, E as SelectLabel, Et as validateProtocolDescriptor, F as DropdownMenuContent, Ft as columnAnnotation, G as DropdownMenuSubContent, Gt as useText, H as DropdownMenuSeparator, Ht as usePresenceSharing, I as DropdownMenuGroup, It as ScrollArea, J as Separator, Jt as blobSubtypeOf, K as DropdownMenuSubTrigger, L as DropdownMenuItem, Lt as Input, M as Label, Mt as conditionMatches, N as DropdownMenu, Nt as parseCellValue, O as SelectScrollUpButton, Ot as BridgeError, P as DropdownMenuCheckboxItem, Pt as TEXT_TYPES, Q as PopoverDescription, R as DropdownMenuLabel, Rt as useBlock, S as Select, St as AlertTitle, T as SelectItem, Tt as isDatabaseBridge, U as DropdownMenuShortcut, Ut as useSelection, V as DropdownMenuRadioItem, Vt as usePresence, W as DropdownMenuSub, Wt as useSelectionView, X as PopoverAnchor, Y as Popover, Yt as createMemoryBlobStore, Z as PopoverContent, _ as FilterBuilder, _t as BareSelect, a as SHAPE_FONT_STACKS, at as CardAction, b as Skeleton, bt as Alert, ct as CardFooter, d as useEditorContext, dt as Pen, et as PopoverTitle, f as DEFAULT_EMBED_SANDBOX, ft as Eye, g as newMutationContext, gt as buttonVariants, h as cellValueEqual, ht as Button, i as SHAPE_FONT_OPTIONS, it as Card, j as SelectValue, jt as toBridgeError, k as SelectSeparator, kt as isBridgeError, l as markToggleAction, lt as CardHeader, m as useDatabaseTable, mt as BookOpen, nt as DocblocksI18nProvider, o as FORMAT_PALETTE, ot as CardContent, p as GridBody, q as DropdownMenuTrigger, qt as renderRuns, rt as Checkbox, st as CardDescription, t as Editor, tt as PopoverTrigger, u as EditorProvider, ut as CardTitle, v as emptyFilter, vt as Badge, w as SelectGroup, wt as PROTOCOL_VERSION, x as SegmentSelector, xt as AlertDescription, y as filterIsComplete, yt as badgeVariants, z as DropdownMenuPortal, zt as useDoc } from "./Editor-CUToaW9z.mjs";
|
|
2
2
|
import { d as cn, l as preventDefault } from "./constants-BaAj3jDA.mjs";
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -392,9 +392,12 @@ const EMPTY_VIEW = {};
|
|
|
392
392
|
* prop) + the consumer's persistence over the `onViewChange`'s patch
|
|
393
393
|
* (one patch per change, as the block's `updateBlock` stand). The i18n's
|
|
394
394
|
* scope stands self-contained (the package's instance — the same's stand
|
|
395
|
-
* as the consumer-placed components).
|
|
395
|
+
* as the consumer-placed components). The sizing's stand is the
|
|
396
|
+
* consumer's: the `className` over the root (a height-constrained root
|
|
397
|
+
* stands the grid's inner scroll; the unconstrained's stand is the
|
|
398
|
+
* content's height).
|
|
396
399
|
*/
|
|
397
|
-
function DatabaseTable({ bridge, tableId, readOnly = false, view, onViewChange }) {
|
|
400
|
+
function DatabaseTable({ bridge, tableId, readOnly = false, view, onViewChange, className }) {
|
|
398
401
|
const [viewState, setViewState] = useState(view ?? EMPTY_VIEW);
|
|
399
402
|
const viewRef = useRef(viewState);
|
|
400
403
|
viewRef.current = viewState;
|
|
@@ -409,6 +412,7 @@ function DatabaseTable({ bridge, tableId, readOnly = false, view, onViewChange }
|
|
|
409
412
|
return /* @__PURE__ */ jsx(DocblocksI18nProvider, { children: /* @__PURE__ */ jsx("div", {
|
|
410
413
|
"data-slot": "docblocks/editor",
|
|
411
414
|
"data-readonly": readOnly ? "true" : void 0,
|
|
415
|
+
className: cn("flex flex-col", className),
|
|
412
416
|
children: /* @__PURE__ */ jsx(GridBody, {
|
|
413
417
|
bridge,
|
|
414
418
|
tableId,
|
package/dist/mermaid/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Kt as INLINE_CODE_CLASS, St as AlertTitle, b as Skeleton, bt as Alert, c as textOf, d as useEditorContext, ft as Eye, n as childrenSlot, pt as CodeXml, r as CodeHeader, s as TextBlock, x as SegmentSelector, xt as AlertDescription } from "../Editor-
|
|
1
|
+
import { Kt as INLINE_CODE_CLASS, St as AlertTitle, b as Skeleton, bt as Alert, c as textOf, d as useEditorContext, ft as Eye, n as childrenSlot, pt as CodeXml, r as CodeHeader, s as TextBlock, x as SegmentSelector, xt as AlertDescription } from "../Editor-CUToaW9z.mjs";
|
|
2
2
|
import { r as TriangleAlert } from "../constants-BaAj3jDA.mjs";
|
|
3
3
|
import { t as LoaderCircle } from "../LoaderCircle-AGVFE4IP.mjs";
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
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-BQRTt8x2.mjs";
|
|
2
2
|
//#region src/pdf/PdfFirstPage.d.ts
|
|
3
3
|
declare function PdfFirstPage({ id, url, name }: PdfPreviewProps): import("react").JSX.Element;
|
|
4
4
|
//#endregion
|
package/package.json
CHANGED