docblocks-react-ui 0.26.0 → 0.28.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.
@@ -729,6 +729,8 @@ interface UseDatabaseTable {
729
729
  beforeRowId: string | null;
730
730
  }): Promise<string[]>;
731
731
  removeRow(rowId: string): Promise<void>;
732
+ /** Removes known listed rows in one batch; unknown ids are skipped. One undo restores the batch when supported. */
733
+ removeRows(rowIds: string[]): Promise<void>;
732
734
  /** Moves the row before `beforeRowId` (null = the table's tail). An
733
735
  * unknown `rowId` (a peer's removed row, a stale page) is a no-op:
734
736
  * the seat resolves against the page, and no matching row exists. */
@@ -788,8 +790,14 @@ interface DatabaseTableSection {
788
790
  * (the block's own attr over it, else the auto height). */
789
791
  getHeaderHeight?: (tableId: string) => number | undefined;
790
792
  /** 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
- setHeaderHeight?: (tableId: string, height: number) => void;
793
+ * release): one value over every block referencing the table.
794
+ * `undefined` clears the persisted value (the header's double-click's
795
+ * reset's stand — the auto height's return). */
796
+ setHeaderHeight?: (tableId: string, height: number | undefined) => void;
797
+ /** The consumer's authoritative total row count; `undefined` lets the
798
+ * grid fall back to its loaded rows. The interface is a read, not a
799
+ * subscription: the consumer re-renders when its count changes. */
800
+ getRowCount?: (tableId: string) => number | undefined;
793
801
  }
794
802
  //#endregion
795
803
  //#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-DAc-REs_.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-Ccn_x_wU.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";
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-DsnFHj1x.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-IByUG91k.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
@@ -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-DsnFHj1x.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-IByUG91k.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";
@@ -1,4 +1,4 @@
1
- import { f as PdfPreviewProps } from "../index-DAc-REs_.mjs";
1
+ import { f as PdfPreviewProps } from "../index-Ccn_x_wU.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
  }
@@ -811,6 +817,9 @@
811
817
  .w-40 {
812
818
  width: calc(var(--spacing) * 40);
813
819
  }
820
+ .w-48 {
821
+ width: calc(var(--spacing) * 48);
822
+ }
814
823
  .w-52 {
815
824
  width: calc(var(--spacing) * 52);
816
825
  }
@@ -1229,10 +1238,22 @@
1229
1238
  border-top-left-radius: var(--cell-radius);
1230
1239
  border-bottom-left-radius: var(--cell-radius);
1231
1240
  }
1241
+ .rounded-tl-\(--docblocks-radius\) {
1242
+ border-top-left-radius: var(--docblocks-radius);
1243
+ }
1232
1244
  .rounded-r-\(--cell-radius\) {
1233
1245
  border-top-right-radius: var(--cell-radius);
1234
1246
  border-bottom-right-radius: var(--cell-radius);
1235
1247
  }
1248
+ .rounded-tr-\(--docblocks-radius\) {
1249
+ border-top-right-radius: var(--docblocks-radius);
1250
+ }
1251
+ .rounded-br-\(--docblocks-radius\) {
1252
+ border-bottom-right-radius: var(--docblocks-radius);
1253
+ }
1254
+ .rounded-bl-\(--docblocks-radius\) {
1255
+ border-bottom-left-radius: var(--docblocks-radius);
1256
+ }
1236
1257
  .border {
1237
1258
  border-style: var(--tw-border-style);
1238
1259
  border-width: 1px;
@@ -1954,6 +1975,10 @@
1954
1975
  outline-style: var(--tw-outline-style);
1955
1976
  outline-width: var(--docblocks-canvas-selection-border-width);
1956
1977
  }
1978
+ .outline-\(length\:--docblocks-database-paste-range-border-width\) {
1979
+ outline-style: var(--tw-outline-style);
1980
+ outline-width: var(--docblocks-database-paste-range-border-width);
1981
+ }
1957
1982
  .outline-offset-1 {
1958
1983
  outline-offset: 1px;
1959
1984
  }
@@ -1963,6 +1988,9 @@
1963
1988
  .outline-\(--docblocks-canvas-selection-border-color\) {
1964
1989
  outline-color: var(--docblocks-canvas-selection-border-color);
1965
1990
  }
1991
+ .outline-\(--docblocks-database-paste-range-border-color\) {
1992
+ outline-color: var(--docblocks-database-paste-range-border-color);
1993
+ }
1966
1994
  .blur {
1967
1995
  --tw-blur: blur(8px);
1968
1996
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
@@ -3820,6 +3848,8 @@
3820
3848
  --docblocks-database-row-height: 32px;
3821
3849
  /* The locally inserted row that stays visible outside the active filter. */
3822
3850
  --docblocks-database-pending-row-border-color: #d97706;
3851
+ --docblocks-database-paste-range-border-color: #16a34a;
3852
+ --docblocks-database-paste-range-border-width: 1px;
3823
3853
 
3824
3854
  /* Image. */
3825
3855
  --docblocks-image-radius: 0;
@@ -3917,6 +3947,7 @@
3917
3947
  --docblocks-table-drag-background: var(--card, #27272a);
3918
3948
  --docblocks-table-drag-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
3919
3949
  --docblocks-database-pending-row-border-color: #f59e0b;
3950
+ --docblocks-database-paste-range-border-color: #4ade80;
3920
3951
  --docblocks-selected-background: color-mix(in srgb, var(--accent, #388bfd) 15%, transparent);
3921
3952
 
3922
3953
  --docblocks-canvas-background: color-mix(in srgb, var(--muted, #6e7681) 15%, transparent);
@@ -4098,6 +4129,24 @@
4098
4129
  appearance: textfield;
4099
4130
  }
4100
4131
 
4132
+ /* The database header's name: the single-line's ellipsis stand (the
4133
+ auto height's floor — the one line never grows the row). Over the
4134
+ stretched header (the grid root's `data-header-wrap`'s key — the
4135
+ height's stand over the single-line's auto) the name wraps over the
4136
+ column's width (the ellipsis stands off — the full name's stand);
4137
+ the span's `max-h-full`'s clip stands the lines' stand past the row's
4138
+ height (the under-height's clip). */
4139
+ [data-slot="docblocks/database-header-name"] {
4140
+ overflow: hidden;
4141
+ text-overflow: ellipsis;
4142
+ white-space: nowrap;
4143
+ }
4144
+ [data-slot="docblocks/database-table"][data-header-wrap="true"] [data-slot="docblocks/database-header-name"] {
4145
+ white-space: normal;
4146
+ overflow-wrap: break-word;
4147
+ text-overflow: clip;
4148
+ }
4149
+
4101
4150
  /* The multi-ref cell's display (the multi-enum / the row-links' chips)
4102
4151
  stands the right fade over the overflowing train: the mask gradients the
4103
4152
  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.26.0",
3
+ "version": "0.28.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.10.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",