docblocks-react-ui 0.26.0 → 0.27.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 +24 -0
- package/README.md +30 -2
- package/dist/{Editor-DsnFHj1x.mjs → Editor-L0Ph4I89.mjs} +657 -279
- package/dist/{index-DAc-REs_.d.mts → index-QtG3mkFQ.d.mts} +8 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +12 -1
- package/dist/mermaid/index.mjs +1 -1
- package/dist/pdf/index.d.mts +1 -1
- package/dist/styles.css +36 -0
- package/package.json +2 -2
|
@@ -788,8 +788,14 @@ interface DatabaseTableSection {
|
|
|
788
788
|
* (the block's own attr over it, else the auto height). */
|
|
789
789
|
getHeaderHeight?: (tableId: string) => number | undefined;
|
|
790
790
|
/** Commits the header-row height for the table (the section's grid drag's
|
|
791
|
-
* release): one value over every block referencing the table.
|
|
792
|
-
|
|
791
|
+
* release): one value over every block referencing the table.
|
|
792
|
+
* `undefined` clears the persisted value (the header's double-click's
|
|
793
|
+
* reset's stand — the auto height's return). */
|
|
794
|
+
setHeaderHeight?: (tableId: string, height: number | undefined) => void;
|
|
795
|
+
/** The consumer's authoritative total row count; `undefined` lets the
|
|
796
|
+
* grid fall back to its loaded rows. The interface is a read, not a
|
|
797
|
+
* subscription: the consumer re-renders when its count changes. */
|
|
798
|
+
getRowCount?: (tableId: string) => number | undefined;
|
|
793
799
|
}
|
|
794
800
|
//#endregion
|
|
795
801
|
//#region src/database/standalone/models.d.ts
|
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-DeOMnr7f.mjs";
|
|
2
|
-
import { $ as SubscriptionStatus, A as useDatabaseTable, At as AttributeTypePickerProps, B as BridgeColumnAnnotation, C as DatabaseTable, Ct as isBridgeErrorCode, D as DatabaseTableSection, Dt as BlobStore, E as UseTableList, Et as BlobRef, F as filterIsComplete, G as MutationContext, H as BridgeValueInput, I as FilterBuilder, J as ProtocolCapability, K as MutationReceipt, L as BatchOp, M as DatabaseTableRow, Mt as RenderAttributeProps, N as UseDatabaseTable, O as cellValueEqual, Ot as createMemoryBlobStore, P as emptyFilter, Q as SubscriptionObserver, R as DatabaseBridge, S as useTableList, St as isBridgeError, T as DatabaseTableView, Tt as BlobMeta, U as CellValueParse, V as BridgeTableDescription, W as DomainEvent, X as ProtocolLimits, Y as ProtocolDescriptor, Z as SubscriptionHandle, _ as AccessLevel, _t as TableRef, a as EditorContextValue, at as FilterInput, b as MentionInteractions, bt as BridgeError, c as SelectionRef, ct as PageQuery, d as PdfPreview, dt as QuerySemantics, et as TableEnvelopeBase, f as PdfPreviewProps, ft as Revision, g as DocTags, gt as TableDescription, h as DocTag, ht as SortInput, i as EditorProviderProps, it as FilterConditionInput, j as DatabaseTablePhase, jt as RenderAttribute, k as newMutationContext, kt as AttributeTypePicker, l as BlobLoading, lt as PageSnapshot, m as DocDescription, mt as RowWire, n as DEFAULT_EMBED_SANDBOX, nt as CellMap, o as EmbedSandboxPolicy, ot as Id, p as CoverPresetSets, pt as RowPage, q as OperationStatus, r as EditorProvider, rt as Column, s as SyncEmbedResolver, st as IsoInstant, t as useEditorContext, tt as TableEvent, u as PresenceConfig, ut as QueryOperator, v as EditorMode, vt as TableSnapshot, w as DatabaseTableProps, wt as toBridgeError, x as MentionProvider, xt as BridgeErrorCode, y as MentionEntry, yt as BRIDGE_ERROR_CODES, z as BridgeColumn } from "./index-
|
|
2
|
+
import { $ as SubscriptionStatus, A as useDatabaseTable, At as AttributeTypePickerProps, B as BridgeColumnAnnotation, C as DatabaseTable, Ct as isBridgeErrorCode, D as DatabaseTableSection, Dt as BlobStore, E as UseTableList, Et as BlobRef, F as filterIsComplete, G as MutationContext, H as BridgeValueInput, I as FilterBuilder, J as ProtocolCapability, K as MutationReceipt, L as BatchOp, M as DatabaseTableRow, Mt as RenderAttributeProps, N as UseDatabaseTable, O as cellValueEqual, Ot as createMemoryBlobStore, P as emptyFilter, Q as SubscriptionObserver, R as DatabaseBridge, S as useTableList, St as isBridgeError, T as DatabaseTableView, Tt as BlobMeta, U as CellValueParse, V as BridgeTableDescription, W as DomainEvent, X as ProtocolLimits, Y as ProtocolDescriptor, Z as SubscriptionHandle, _ as AccessLevel, _t as TableRef, a as EditorContextValue, at as FilterInput, b as MentionInteractions, bt as BridgeError, c as SelectionRef, ct as PageQuery, d as PdfPreview, dt as QuerySemantics, et as TableEnvelopeBase, f as PdfPreviewProps, ft as Revision, g as DocTags, gt as TableDescription, h as DocTag, ht as SortInput, i as EditorProviderProps, it as FilterConditionInput, j as DatabaseTablePhase, jt as RenderAttribute, k as newMutationContext, kt as AttributeTypePicker, l as BlobLoading, lt as PageSnapshot, m as DocDescription, mt as RowWire, n as DEFAULT_EMBED_SANDBOX, nt as CellMap, o as EmbedSandboxPolicy, ot as Id, p as CoverPresetSets, pt as RowPage, q as OperationStatus, r as EditorProvider, rt as Column, s as SyncEmbedResolver, st as IsoInstant, t as useEditorContext, tt as TableEvent, u as PresenceConfig, ut as QueryOperator, v as EditorMode, vt as TableSnapshot, w as DatabaseTableProps, wt as toBridgeError, x as MentionProvider, xt as BridgeErrorCode, y as MentionEntry, yt as BRIDGE_ERROR_CODES, z as BridgeColumn } from "./index-QtG3mkFQ.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" | "
|
|
430
|
+
variant?: "default" | "destructive" | "custom" | "secondary" | "outline" | 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" | "
|
|
441
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "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-L0Ph4I89.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";
|
|
@@ -412,6 +412,15 @@ function DatabaseTable({ bridge, tableId, readOnly = false, view, onViewChange,
|
|
|
412
412
|
});
|
|
413
413
|
tableSection?.setHeaderHeight?.(tableId, height);
|
|
414
414
|
};
|
|
415
|
+
const commitHeaderHeightReset = () => {
|
|
416
|
+
if (sectionHeight === void 0) return;
|
|
417
|
+
setHeaderEcho({
|
|
418
|
+
tableId,
|
|
419
|
+
base: sectionHeight,
|
|
420
|
+
height: void 0
|
|
421
|
+
});
|
|
422
|
+
tableSection?.setHeaderHeight?.(tableId, void 0);
|
|
423
|
+
};
|
|
415
424
|
const handleViewChange = useCallback((patch) => {
|
|
416
425
|
const typed = patch;
|
|
417
426
|
setViewState((current) => ({
|
|
@@ -432,7 +441,9 @@ function DatabaseTable({ bridge, tableId, readOnly = false, view, onViewChange,
|
|
|
432
441
|
hiddenColumns: viewState.hiddenColumns,
|
|
433
442
|
columnWidths: viewState.columnWidths,
|
|
434
443
|
sectionHeaderHeight,
|
|
444
|
+
getRowCount: tableSection?.getRowCount,
|
|
435
445
|
onHeaderHeightChange: tableSection === void 0 ? void 0 : commitHeaderHeight,
|
|
446
|
+
onHeaderHeightReset: tableSection === void 0 ? void 0 : commitHeaderHeightReset,
|
|
436
447
|
onViewChange: handleViewChange,
|
|
437
448
|
readColumnOrder: () => viewRef.current.columnOrder,
|
|
438
449
|
readOnly
|
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-L0Ph4I89.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-QtG3mkFQ.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/dist/styles.css
CHANGED
|
@@ -748,6 +748,9 @@
|
|
|
748
748
|
.max-h-80 {
|
|
749
749
|
max-height: calc(var(--spacing) * 80);
|
|
750
750
|
}
|
|
751
|
+
.max-h-full {
|
|
752
|
+
max-height: 100%;
|
|
753
|
+
}
|
|
751
754
|
.min-h-0 {
|
|
752
755
|
min-height: 0px;
|
|
753
756
|
}
|
|
@@ -760,6 +763,9 @@
|
|
|
760
763
|
.min-h-16 {
|
|
761
764
|
min-height: calc(var(--spacing) * 16);
|
|
762
765
|
}
|
|
766
|
+
.min-h-28 {
|
|
767
|
+
min-height: calc(var(--spacing) * 28);
|
|
768
|
+
}
|
|
763
769
|
.min-h-40 {
|
|
764
770
|
min-height: calc(var(--spacing) * 40);
|
|
765
771
|
}
|
|
@@ -1229,10 +1235,22 @@
|
|
|
1229
1235
|
border-top-left-radius: var(--cell-radius);
|
|
1230
1236
|
border-bottom-left-radius: var(--cell-radius);
|
|
1231
1237
|
}
|
|
1238
|
+
.rounded-tl-\(--docblocks-radius\) {
|
|
1239
|
+
border-top-left-radius: var(--docblocks-radius);
|
|
1240
|
+
}
|
|
1232
1241
|
.rounded-r-\(--cell-radius\) {
|
|
1233
1242
|
border-top-right-radius: var(--cell-radius);
|
|
1234
1243
|
border-bottom-right-radius: var(--cell-radius);
|
|
1235
1244
|
}
|
|
1245
|
+
.rounded-tr-\(--docblocks-radius\) {
|
|
1246
|
+
border-top-right-radius: var(--docblocks-radius);
|
|
1247
|
+
}
|
|
1248
|
+
.rounded-br-\(--docblocks-radius\) {
|
|
1249
|
+
border-bottom-right-radius: var(--docblocks-radius);
|
|
1250
|
+
}
|
|
1251
|
+
.rounded-bl-\(--docblocks-radius\) {
|
|
1252
|
+
border-bottom-left-radius: var(--docblocks-radius);
|
|
1253
|
+
}
|
|
1236
1254
|
.border {
|
|
1237
1255
|
border-style: var(--tw-border-style);
|
|
1238
1256
|
border-width: 1px;
|
|
@@ -4098,6 +4116,24 @@
|
|
|
4098
4116
|
appearance: textfield;
|
|
4099
4117
|
}
|
|
4100
4118
|
|
|
4119
|
+
/* The database header's name: the single-line's ellipsis stand (the
|
|
4120
|
+
auto height's floor — the one line never grows the row). Over the
|
|
4121
|
+
stretched header (the grid root's `data-header-wrap`'s key — the
|
|
4122
|
+
height's stand over the single-line's auto) the name wraps over the
|
|
4123
|
+
column's width (the ellipsis stands off — the full name's stand);
|
|
4124
|
+
the span's `max-h-full`'s clip stands the lines' stand past the row's
|
|
4125
|
+
height (the under-height's clip). */
|
|
4126
|
+
[data-slot="docblocks/database-header-name"] {
|
|
4127
|
+
overflow: hidden;
|
|
4128
|
+
text-overflow: ellipsis;
|
|
4129
|
+
white-space: nowrap;
|
|
4130
|
+
}
|
|
4131
|
+
[data-slot="docblocks/database-table"][data-header-wrap="true"] [data-slot="docblocks/database-header-name"] {
|
|
4132
|
+
white-space: normal;
|
|
4133
|
+
overflow-wrap: break-word;
|
|
4134
|
+
text-overflow: clip;
|
|
4135
|
+
}
|
|
4136
|
+
|
|
4101
4137
|
/* The multi-ref cell's display (the multi-enum / the row-links' chips)
|
|
4102
4138
|
stands the right fade over the overflowing train: the mask gradients the
|
|
4103
4139
|
tail to transparency at the right edge (the chips clip without the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docblocks-react-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "React rendering + editing layer for docblocks: hooks, block renderers, caret/selection, keyboard, clipboard.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"docblocks-core": "^0.
|
|
39
|
+
"docblocks-core": "^0.11.0",
|
|
40
40
|
"framer-motion": "^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
|
41
41
|
"mermaid": "^12.0.0",
|
|
42
42
|
"pdfjs-dist": "^6.0.0",
|