docblocks-react-ui 0.4.7 → 0.5.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.
@@ -644,6 +644,10 @@ interface UseDatabaseTable {
644
644
  table: BridgeTableDescription | null;
645
645
  /** The loaded rows in the row order. */
646
646
  rows: DatabaseTableRow[];
647
+ /** The latest inserted row while it stays outside the filtered page. */
648
+ pendingRow: DatabaseTableRow | null;
649
+ /** Ends the inserted row's temporary visibility outside the filtered page. */
650
+ dismissPendingRow(rowId?: string): void;
647
651
  /** The row's live revision (the CAS's stand — the draft session's open
648
652
  * pin reads it at the session's open). */
649
653
  revisionOf(rowId: string): Revision | undefined;
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-CZEO5s2i.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-DtVBbaEs.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";
@@ -322,7 +322,7 @@ declare function AlertDescription({ className, ...props }: React.ComponentProps<
322
322
  //#endregion
323
323
  //#region src/shared/ui/Badge.d.ts
324
324
  declare const badgeVariants: (props?: ({
325
- variant?: "default" | "destructive" | "outline" | "secondary" | "custom" | null | undefined;
325
+ variant?: "default" | "custom" | "secondary" | "destructive" | "outline" | null | undefined;
326
326
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
327
327
  declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
328
328
  asChild?: boolean;
@@ -333,7 +333,7 @@ declare function BareSelect({ className, children, ...props }: React.ComponentPr
333
333
  //#endregion
334
334
  //#region src/shared/ui/Button.d.ts
335
335
  declare const buttonVariants: (props?: ({
336
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
336
+ variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
337
337
  size?: "default" | "icon" | "sm" | "lg" | "xl" | null | undefined;
338
338
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
339
339
  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, ot as CardContent, p as GridBody, q as DropdownMenuTrigger, qt as renderRuns, rt as Checkbox, s as FORMAT_PALETTE, 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-CTSlILEm.mjs";
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, ot as CardContent, p as GridBody, q as DropdownMenuTrigger, qt as renderRuns, rt as Checkbox, s as FORMAT_PALETTE, 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-BBbAwxWT.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";
@@ -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, o as TextBlock, pt as CodeXml, r as CodeHeader, x as SegmentSelector, xt as AlertDescription } from "../Editor-CTSlILEm.mjs";
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, o as TextBlock, pt as CodeXml, r as CodeHeader, x as SegmentSelector, xt as AlertDescription } from "../Editor-BBbAwxWT.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";
@@ -1,4 +1,4 @@
1
- import { f as PdfPreviewProps } from "../index-CZEO5s2i.mjs";
1
+ import { f as PdfPreviewProps } from "../index-DtVBbaEs.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/dist/styles.css CHANGED
@@ -56,6 +56,7 @@
56
56
  --color-gray-700: oklch(37.3% 0.034 259.733);
57
57
  --color-white: #fff;
58
58
  --spacing: 0.25rem;
59
+ --container-xl: 36rem;
59
60
  --text-xs: 0.75rem;
60
61
  --text-xs--line-height: calc(1 / 0.75);
61
62
  --text-sm: 0.875rem;
@@ -297,6 +298,9 @@
297
298
  .top-4 {
298
299
  top: calc(var(--spacing) * 4);
299
300
  }
301
+ .top-6 {
302
+ top: calc(var(--spacing) * 6);
303
+ }
300
304
  .top-8 {
301
305
  top: calc(var(--spacing) * 8);
302
306
  }
@@ -333,12 +337,18 @@
333
337
  .right-4 {
334
338
  right: calc(var(--spacing) * 4);
335
339
  }
340
+ .-bottom-2 {
341
+ bottom: calc(var(--spacing) * -2);
342
+ }
336
343
  .bottom-0 {
337
344
  bottom: 0px;
338
345
  }
339
346
  .bottom-4 {
340
347
  bottom: calc(var(--spacing) * 4);
341
348
  }
349
+ .-left-5 {
350
+ left: calc(var(--spacing) * -5);
351
+ }
342
352
  .left-\(--docblocks-checkbox-left\) {
343
353
  left: var(--docblocks-checkbox-left);
344
354
  }
@@ -724,6 +734,9 @@
724
734
  .w-1\.5 {
725
735
  width: calc(var(--spacing) * 1.5);
726
736
  }
737
+ .w-5 {
738
+ width: calc(var(--spacing) * 5);
739
+ }
727
740
  .w-7 {
728
741
  width: calc(var(--spacing) * 7);
729
742
  }
@@ -754,9 +767,6 @@
754
767
  .w-72 {
755
768
  width: calc(var(--spacing) * 72);
756
769
  }
757
- .w-96 {
758
- width: calc(var(--spacing) * 96);
759
- }
760
770
  .w-\[5ch\] {
761
771
  width: 5ch;
762
772
  }
@@ -793,6 +803,9 @@
793
803
  .max-w-full {
794
804
  max-width: 100%;
795
805
  }
806
+ .max-w-xl {
807
+ max-width: var(--container-xl);
808
+ }
796
809
  .min-w-\(--cell-size\) {
797
810
  min-width: var(--cell-size);
798
811
  }
@@ -808,6 +821,12 @@
808
821
  .min-w-32 {
809
822
  min-width: calc(var(--spacing) * 32);
810
823
  }
824
+ .min-w-35 {
825
+ min-width: calc(var(--spacing) * 35);
826
+ }
827
+ .min-w-110 {
828
+ min-width: calc(var(--spacing) * 110);
829
+ }
811
830
  .min-w-full {
812
831
  min-width: 100%;
813
832
  }
@@ -1693,6 +1712,10 @@
1693
1712
  .italic {
1694
1713
  font-style: italic;
1695
1714
  }
1715
+ .ordinal {
1716
+ --tw-ordinal: ordinal;
1717
+ font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
1718
+ }
1696
1719
  .tabular-nums {
1697
1720
  --tw-numeric-spacing: tabular-nums;
1698
1721
  font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
@@ -3591,6 +3614,8 @@
3591
3614
  column type stands the one height — the cell's trigger / the input fit
3592
3615
  the content box, the row never grows over its content). */
3593
3616
  --docblocks-database-row-height: 32px;
3617
+ /* The locally inserted row that stays visible outside the active filter. */
3618
+ --docblocks-database-pending-row-border-color: #d97706;
3594
3619
 
3595
3620
  /* Image. */
3596
3621
  --docblocks-image-radius: 0;
@@ -3687,6 +3712,7 @@
3687
3712
  --docblocks-table-border-color: var(--border, rgba(110, 118, 129, 0.65));
3688
3713
  --docblocks-table-drag-background: var(--card, #27272a);
3689
3714
  --docblocks-table-drag-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
3715
+ --docblocks-database-pending-row-border-color: #f59e0b;
3690
3716
  --docblocks-selected-background: color-mix(in srgb, var(--accent, #388bfd) 15%, transparent);
3691
3717
 
3692
3718
  --docblocks-canvas-background: color-mix(in srgb, var(--muted, #6e7681) 15%, transparent);
@@ -3971,6 +3997,29 @@
3971
3997
  vertical-align: baseline;
3972
3998
  }
3973
3999
 
4000
+ /* The flat grid has no row element: the pending row's outline is composed
4001
+ over its cells, with the outer vertical edges on the first and last track. */
4002
+ [data-slot="docblocks/database-cell"][data-filter-pending="true"],
4003
+ [data-slot="docblocks/database-row-menu"][data-filter-pending="true"] {
4004
+ box-shadow:
4005
+ inset 0 1px 0 var(--docblocks-database-pending-row-border-color),
4006
+ inset 0 -1px 0 var(--docblocks-database-pending-row-border-color);
4007
+ }
4008
+
4009
+ [data-slot="docblocks/database-cell"][data-filter-pending="true"][data-col="0"] {
4010
+ box-shadow:
4011
+ inset 2px 0 0 var(--docblocks-database-pending-row-border-color),
4012
+ inset 0 1px 0 var(--docblocks-database-pending-row-border-color),
4013
+ inset 0 -1px 0 var(--docblocks-database-pending-row-border-color);
4014
+ }
4015
+
4016
+ [data-slot="docblocks/database-row-menu"][data-filter-pending="true"] {
4017
+ box-shadow:
4018
+ inset -2px 0 0 var(--docblocks-database-pending-row-border-color),
4019
+ inset 0 1px 0 var(--docblocks-database-pending-row-border-color),
4020
+ inset 0 -1px 0 var(--docblocks-database-pending-row-border-color);
4021
+ }
4022
+
3974
4023
  /* 5. The shape-text's self-hosted fonts (the woff2 in dist/fonts/; the
3975
4024
  * unicode-range keeps a file fetched only when the shape's text stands
3976
4025
  * in that font / subset). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docblocks-react-ui",
3
- "version": "0.4.7",
3
+ "version": "0.5.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",