docblocks-react-ui 0.24.0 → 0.25.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.
@@ -500,7 +500,8 @@ const INIT_OPTIONS = {
500
500
  "editOptions": "Edit options",
501
501
  "show": "Show column",
502
502
  "hide": "Hide column",
503
- "delete": "Delete column"
503
+ "delete": "Delete column",
504
+ "resizeHeight": "Resize the header row"
504
505
  },
505
506
  row: {
506
507
  "moveUp": "Move up",
@@ -1043,7 +1044,8 @@ const INIT_OPTIONS = {
1043
1044
  "editOptions": "Изменить варианты",
1044
1045
  "show": "Показать столбец",
1045
1046
  "hide": "Скрыть столбец",
1046
- "delete": "Удалить столбец"
1047
+ "delete": "Удалить столбец",
1048
+ "resizeHeight": "Изменить высоту заголовка"
1047
1049
  },
1048
1050
  row: {
1049
1051
  "moveUp": "Переместить вверх",
@@ -8545,6 +8547,77 @@ function AddColumnForm({ open, onOpenChange, form, formNumber, formRef, error, b
8545
8547
  });
8546
8548
  }
8547
8549
  //#endregion
8550
+ //#region src/database/grid/column-type-icon.ts
8551
+ function columnTypeIcon(type, refKind, refMany) {
8552
+ if (refKind === "enum") return refMany ? ListChecks : CircleChevronDown;
8553
+ if (refKind === "row") return Cable;
8554
+ if (type === "integer" || type === "numeric") return Hash;
8555
+ if (type === "boolean") return CircleCheck;
8556
+ if (type === "date") return CalendarIcon;
8557
+ if (type === "timestamptz") return CalendarClock;
8558
+ return Type;
8559
+ }
8560
+ //#endregion
8561
+ //#region src/database/grid/AddColumnCell.tsx
8562
+ /** The grid's header-row "add column" cell: the plus chip (the type's menu)
8563
+ * and the create form over it. The cell carries its own explicit grid
8564
+ * placement (the header row's track after the last column) — the header's
8565
+ * resize strip occupies the same row across all tracks. The read-only
8566
+ * modes render the empty track (the primitive's stand: no chip, no form). */
8567
+ function AddColumnCell({ gridColumn, readOnly, form, OptionsEditor }) {
8568
+ const { t } = useTranslation("database");
8569
+ return /* @__PURE__ */ jsxs("div", {
8570
+ "data-slot": "docblocks/database-add-column",
8571
+ className: "\n relative row-start-1 flex items-center justify-center border-b-(length:--docblocks-table-border-width)\n border-(--docblocks-table-border-color)\n ",
8572
+ style: { gridColumn },
8573
+ children: [!readOnly && /* @__PURE__ */ jsxs(DropdownMenu, {
8574
+ modal: false,
8575
+ open: form.addingColumn,
8576
+ onOpenChange: form.setAddingColumn,
8577
+ children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
8578
+ asChild: true,
8579
+ children: /* @__PURE__ */ jsx(Button, {
8580
+ "data-slot": "docblocks/database-add-column-trigger",
8581
+ variant: "ghost",
8582
+ size: "icon",
8583
+ className: cn("rounded-(--docblocks-radius) border-(length:--docblocks-table-border-width) border-(--docblocks-table-border-color) bg-transparent dark:border-(--docblocks-table-border-color) dark:bg-transparent", "size-6 cursor-pointer p-1 text-(--docblocks-placeholder-color) hover:bg-transparent", "hover:text-(--docblocks-text-color) dark:hover:bg-transparent"),
8584
+ children: /* @__PURE__ */ jsx(Plus, { className: "size-4" })
8585
+ })
8586
+ }), /* @__PURE__ */ jsx(DropdownMenuContent, {
8587
+ align: "end",
8588
+ className: "min-w-32",
8589
+ children: ADD_COLUMN_TYPES.map((entry) => {
8590
+ const EntryIcon = columnTypeIcon(entry.type, entry.refKind, entry.refMany);
8591
+ return /* @__PURE__ */ jsxs(DropdownMenuItem, {
8592
+ "data-column-entry": entry.key,
8593
+ onClick: () => form.openCreateForm(entry),
8594
+ children: [/* @__PURE__ */ jsx(EntryIcon, { className: "size-4 shrink-0 text-muted-foreground" }), t(entry.labelKey)]
8595
+ }, entry.key);
8596
+ })
8597
+ })]
8598
+ }), /* @__PURE__ */ jsx(AddColumnForm, {
8599
+ open: form.columnFormOpen,
8600
+ onOpenChange: form.onColumnFormOpenChange,
8601
+ form: form.columnForm,
8602
+ formNumber: form.columnFormNumber,
8603
+ formRef: form.columnFormRef,
8604
+ error: form.columnFormError,
8605
+ bridgeTables: form.bridgeTables,
8606
+ OptionsEditor,
8607
+ onCommit: form.commitColumnForm,
8608
+ onNameChange: form.onColumnNameChange,
8609
+ onDecimalsChange: form.onColumnDecimalsChange,
8610
+ onThousandsChange: form.onColumnThousandsChange,
8611
+ onPrefixChange: form.onColumnPrefixChange,
8612
+ onSuffixChange: form.onColumnSuffixChange,
8613
+ onAllowNegativeChange: form.onColumnAllowNegativeChange,
8614
+ onEnumOptionsChange: form.onColumnEnumOptionsChange,
8615
+ onRefPickChange: form.onColumnRefPickChange,
8616
+ onNewTableNameChange: form.onColumnNewTableNameChange
8617
+ })]
8618
+ });
8619
+ }
8620
+ //#endregion
8548
8621
  //#region src/database/grid/cells/CellDisplay.tsx
8549
8622
  /** The cell's read-only display (the single-press stand: the value text or
8550
8623
  * the empty stand). */
@@ -9659,17 +9732,6 @@ function GridRows({ rows, columns, data, selectedCells, editingCell, setEditingC
9659
9732
  ] });
9660
9733
  }
9661
9734
  //#endregion
9662
- //#region src/database/grid/column-type-icon.ts
9663
- function columnTypeIcon(type, refKind, refMany) {
9664
- if (refKind === "enum") return refMany ? ListChecks : CircleChevronDown;
9665
- if (refKind === "row") return Cable;
9666
- if (type === "integer" || type === "numeric") return Hash;
9667
- if (type === "boolean") return CircleCheck;
9668
- if (type === "date") return CalendarIcon;
9669
- if (type === "timestamptz") return CalendarClock;
9670
- return Type;
9671
- }
9672
- //#endregion
9673
9735
  //#region src/database/grid/HeaderCell.tsx
9674
9736
  /** The grid's header cell (the column's name + the press menu + the
9675
9737
  * right-edge resize seam). */
@@ -9683,6 +9745,12 @@ function HeaderCell({ readOnly = false, column, colIndex, first, resizing, dragD
9683
9745
  const { t } = useTranslation("database");
9684
9746
  const [nameDraft, setNameDraft] = useState(column.name);
9685
9747
  const ColumnIcon = columnTypeIcon(column.type, column.refKind, column.refMany);
9748
+ const dragStyle = dragDx !== 0 ? {
9749
+ transform: `translateX(${dragDx}px)`,
9750
+ position: "relative",
9751
+ zIndex: dragShifted ? void 0 : 10,
9752
+ transition: dragShifted ? GRID_DRAG_TRANSITION : void 0
9753
+ } : null;
9686
9754
  const commitRename = () => {
9687
9755
  const trimmed = nameDraft.trim();
9688
9756
  if (trimmed !== "" && trimmed !== column.name) onRename(trimmed);
@@ -9709,12 +9777,11 @@ function HeaderCell({ readOnly = false, column, colIndex, first, resizing, dragD
9709
9777
  return /* @__PURE__ */ jsxs("div", {
9710
9778
  "data-slot": "docblocks/database-header-cell",
9711
9779
  "data-column-id": column.id,
9712
- style: dragDx !== 0 ? {
9713
- transform: `translateX(${dragDx}px)`,
9714
- position: "relative",
9715
- zIndex: dragShifted ? void 0 : 10,
9716
- transition: dragShifted ? GRID_DRAG_TRANSITION : void 0
9717
- } : void 0,
9780
+ style: {
9781
+ gridRow: 1,
9782
+ gridColumn: colIndex + 1,
9783
+ ...dragStyle
9784
+ },
9718
9785
  className: cn(`
9719
9786
  relative flex min-w-0 items-center gap-1 border-b-(length:--docblocks-table-border-width)
9720
9787
  border-(--docblocks-table-border-color) bg-muted/40 px-2 py-1 select-none
@@ -9804,6 +9871,38 @@ function HeaderCell({ readOnly = false, column, colIndex, first, resizing, dragD
9804
9871
  });
9805
9872
  }
9806
9873
  //#endregion
9874
+ //#region src/database/grid/HeaderResizeHandle.tsx
9875
+ /** The grid's header-row resize handle: the full-width strip over the
9876
+ * header row's bottom edge (it spans the header's track row — the header
9877
+ * cells carry their own explicit placement, so the strip stands the
9878
+ * overlay of the same row). The press-drag session is the hook's stand;
9879
+ * the read-only modes render no handle (the height itself still
9880
+ * applies). */
9881
+ /** The header's bottom edge: the 6 px strip straddles the border (the
9882
+ * seam idiom — the pointer over the edge stands the stable row-resize). */
9883
+ function HeaderResizeHandle({ resizing, onPointerDown, onPointerMove, onPointerUp, onPointerCancel }) {
9884
+ const { t } = useTranslation("database");
9885
+ return /* @__PURE__ */ jsx("div", {
9886
+ role: "separator",
9887
+ "aria-orientation": "horizontal",
9888
+ "aria-label": t("header.resizeHeight"),
9889
+ "data-slot": "docblocks/database-header-resize",
9890
+ className: cn(`
9891
+ z-10 col-span-full row-start-1 flex h-1.5 translate-y-1/2 cursor-row-resize items-center self-end opacity-0
9892
+ transition-opacity
9893
+ hover:opacity-100
9894
+ `, resizing && "opacity-100"),
9895
+ onPointerDown,
9896
+ onPointerMove,
9897
+ onPointerUp,
9898
+ onPointerCancel,
9899
+ children: /* @__PURE__ */ jsx("div", {
9900
+ "data-slot": "docblocks/database-header-resize-line",
9901
+ className: "h-0.5 w-full rounded bg-(--muted-foreground)"
9902
+ })
9903
+ });
9904
+ }
9905
+ //#endregion
9807
9906
  //#region src/database/grid/use-grid-column-drag.ts
9808
9907
  /** The database grid's column drag: the header cell's press + drag (the
9809
9908
  * live parting preview — the dragged column's own cells stand the pointer's
@@ -9889,6 +9988,99 @@ function useGridColumnDrag({ columns, allColumns, columnOrder, hiddenColumns, co
9889
9988
  };
9890
9989
  }
9891
9990
  //#endregion
9991
+ //#region src/database/grid/header-height.ts
9992
+ /** The grid's header-row height stands: the resolution over the two
9993
+ * persistence levels (the block's own attr over the consumer's per-table
9994
+ * section value, an absent stand = the auto height), the drag's clamp, and
9995
+ * the auto height's live measurement. */
9996
+ /** The header row's height stand: the block's own attr wins over the
9997
+ * table section's value (the consumer's per-table persistence — the same
9998
+ * height over every block referencing the table); an absent stand keeps
9999
+ * the auto height. */
10000
+ function resolveDatabaseHeaderHeight(blockHeight, sectionHeight) {
10001
+ return blockHeight ?? sectionHeight;
10002
+ }
10003
+ /** The drag's clamp: the auto height is the floor (the column names never
10004
+ * render clipped), with the one-line fallback floor when the auto height
10005
+ * stands unmeasured; the ceiling is the drag's generous bound (the data
10006
+ * level checks the positivity only). */
10007
+ function clampDatabaseHeaderHeight(requested, natural) {
10008
+ return Math.max(Math.max(Math.round(natural), 28), Math.min(Math.round(requested), 600));
10009
+ }
10010
+ /** The header row's natural (auto) height in px, measured over the live
10011
+ * grid: the explicit track's height is lifted for the read and restored
10012
+ * before the frame paints, so the returned stand is the content's own.
10013
+ * A detached / unlaid-out grid (no layout in the runtime) stands 0. */
10014
+ function measureDatabaseHeaderHeight(grid) {
10015
+ if (grid === null) return 0;
10016
+ const previous = grid.style.gridTemplateRows;
10017
+ grid.style.gridTemplateRows = "auto";
10018
+ let natural = 0;
10019
+ for (const cell of grid.querySelectorAll("[data-slot=\"docblocks/database-header-cell\"]")) natural = Math.max(natural, cell.offsetHeight);
10020
+ grid.style.gridTemplateRows = previous;
10021
+ return natural;
10022
+ }
10023
+ //#endregion
10024
+ //#region src/database/grid/use-grid-header-resize.ts
10025
+ /** The database grid's header-row resize: the full-width handle's press +
10026
+ * drag (the live preview stands the row's height; no commit until the
10027
+ * release), the release (the clamped height commits over the caller's
10028
+ * write stand — the block's attr / the consumer's per-table section
10029
+ * setting; a drag back to the press's height stands a no-op), and the
10030
+ * cancel. The clamp's floor is the auto height measured at the press, so
10031
+ * the header's content never renders clipped. */
10032
+ function useGridHeaderResize({ tableRef, headerHeight, onCommit }) {
10033
+ const [headerPreview, setHeaderPreview] = useState(null);
10034
+ const session = useRef(null);
10035
+ /** The handle's press: starts the resize session (the native click /
10036
+ * the surrounding gestures are suppressed — the handle stands its own
10037
+ * session). */
10038
+ const onHeaderPointerDown = (event) => {
10039
+ if (event.button !== 0 || session.current !== null) return;
10040
+ event.preventDefault();
10041
+ event.stopPropagation();
10042
+ event.currentTarget.setPointerCapture?.(event.pointerId);
10043
+ const natural = measureDatabaseHeaderHeight(tableRef.current);
10044
+ const startHeight = clampDatabaseHeaderHeight(headerHeight ?? Math.max(natural, 28), natural);
10045
+ session.current = {
10046
+ startY: event.clientY,
10047
+ startHeight,
10048
+ natural,
10049
+ height: startHeight
10050
+ };
10051
+ setHeaderPreview(startHeight);
10052
+ };
10053
+ const onHeaderPointerMove = (event) => {
10054
+ const live = session.current;
10055
+ if (live === null) return;
10056
+ live.height = clampDatabaseHeaderHeight(live.startHeight + (event.clientY - live.startY), live.natural);
10057
+ setHeaderPreview(live.height);
10058
+ };
10059
+ /** The handle's release: the clamped height commits when it changed (one
10060
+ * write, one undo step over the block's stand); a drag back to the
10061
+ * press's height stands a no-op (no wire traffic). */
10062
+ const onHeaderPointerUp = (event) => {
10063
+ const live = session.current;
10064
+ session.current = null;
10065
+ setHeaderPreview(null);
10066
+ if (live === null) return;
10067
+ event.currentTarget.releasePointerCapture?.(event.pointerId);
10068
+ if (live.height === live.startHeight) return;
10069
+ onCommit(live.height);
10070
+ };
10071
+ const onHeaderPointerCancel = () => {
10072
+ session.current = null;
10073
+ setHeaderPreview(null);
10074
+ };
10075
+ return {
10076
+ headerPreview,
10077
+ onHeaderPointerDown,
10078
+ onHeaderPointerMove,
10079
+ onHeaderPointerUp,
10080
+ onHeaderPointerCancel
10081
+ };
10082
+ }
10083
+ //#endregion
9892
10084
  //#region src/database/grid/use-grid-seam-resize.ts
9893
10085
  /** The database grid's column-seam resize: the header cell's right-edge
9894
10086
  * seam's press + drag (the live preview locks every column over its
@@ -9989,8 +10181,7 @@ function useGridSeamResize({ columns, columnWidths, updateView }) {
9989
10181
  * model (the cell / column selection — the native text selection over the
9990
10182
  * drag is suppressed).
9991
10183
  */
9992
- function GridTable({ columns, allColumns, columnOrder, hiddenColumns, columnWidths, onViewChange, data, rows, selectedCells, editingCell, setEditingCell, onCellPointerDown, booleanPressRef, pendingRowId, refTableData, filter, readOnly = false, tableRef, onTableKeyDown, onTablePaste, onTableBlur, form, OptionsEditor }) {
9993
- const { t } = useTranslation("database");
10184
+ function GridTable({ columns, allColumns, columnOrder, hiddenColumns, columnWidths, onViewChange, data, rows, selectedCells, editingCell, setEditingCell, onCellPointerDown, booleanPressRef, pendingRowId, refTableData, filter, readOnly = false, headerHeight, onHeaderHeightChange, tableRef, onTableKeyDown, onTablePaste, onTableBlur, form, OptionsEditor }) {
9994
10185
  const [columnMenu, setColumnMenu] = useState(null);
9995
10186
  const { resizePreview, onSeamPointerDown, onSeamPointerMove, onSeamPointerUp, onSeamPointerCancel } = useGridSeamResize({
9996
10187
  columns,
@@ -10006,6 +10197,12 @@ function GridTable({ columns, allColumns, columnOrder, hiddenColumns, columnWidt
10006
10197
  updateView: onViewChange,
10007
10198
  tableRef
10008
10199
  });
10200
+ const { headerPreview, onHeaderPointerDown, onHeaderPointerMove, onHeaderPointerUp, onHeaderPointerCancel } = useGridHeaderResize({
10201
+ tableRef,
10202
+ headerHeight,
10203
+ onCommit: onHeaderHeightChange ?? (() => void 0)
10204
+ });
10205
+ const headerRowHeight = headerPreview ?? headerHeight;
10009
10206
  const dragFrom = drag === null ? -1 : columns.findIndex((entry) => entry.id === drag.id);
10010
10207
  const dragShiftOf = (index) => {
10011
10208
  if (drag === null || drag.toIndex === null || index === dragFrom) return 0;
@@ -10039,7 +10236,7 @@ function GridTable({ columns, allColumns, columnOrder, hiddenColumns, columnWidt
10039
10236
  onPaste: onTablePaste,
10040
10237
  onBlur: onTableBlur,
10041
10238
  style: {
10042
- gridTemplateRows: "auto",
10239
+ gridTemplateRows: headerRowHeight !== void 0 ? `${headerRowHeight}px` : "auto",
10043
10240
  gridAutoRows: "var(--docblocks-database-row-height)",
10044
10241
  gridTemplateColumns: `${columns.map((_, index) => {
10045
10242
  const width = (resizePreview !== null ? resizePreview.widths[index] : void 0) ?? columnWidths?.[index];
@@ -10071,54 +10268,18 @@ function GridTable({ columns, allColumns, columnOrder, hiddenColumns, columnWidt
10071
10268
  onPointerMove: onColumnPointerMove,
10072
10269
  onPointerUp: columnPointerUp(column)
10073
10270
  }, column.id)),
10074
- /* @__PURE__ */ jsxs("div", {
10075
- "data-slot": "docblocks/database-add-column",
10076
- className: "\n relative flex items-center justify-center border-b-(length:--docblocks-table-border-width)\n border-(--docblocks-table-border-color)\n ",
10077
- children: [!readOnly && /* @__PURE__ */ jsxs(DropdownMenu, {
10078
- modal: false,
10079
- open: form.addingColumn,
10080
- onOpenChange: form.setAddingColumn,
10081
- children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
10082
- asChild: true,
10083
- children: /* @__PURE__ */ jsx(Button, {
10084
- "data-slot": "docblocks/database-add-column-trigger",
10085
- variant: "ghost",
10086
- size: "icon",
10087
- className: cn("rounded-(--docblocks-radius) border-(length:--docblocks-table-border-width) border-(--docblocks-table-border-color) bg-transparent dark:border-(--docblocks-table-border-color) dark:bg-transparent", "size-6 cursor-pointer p-1 text-(--docblocks-placeholder-color) hover:bg-transparent", "hover:text-(--docblocks-text-color) dark:hover:bg-transparent"),
10088
- children: /* @__PURE__ */ jsx(Plus, { className: "size-4" })
10089
- })
10090
- }), /* @__PURE__ */ jsx(DropdownMenuContent, {
10091
- align: "end",
10092
- className: "min-w-32",
10093
- children: ADD_COLUMN_TYPES.map((entry) => {
10094
- const EntryIcon = columnTypeIcon(entry.type, entry.refKind, entry.refMany);
10095
- return /* @__PURE__ */ jsxs(DropdownMenuItem, {
10096
- "data-column-entry": entry.key,
10097
- onClick: () => form.openCreateForm(entry),
10098
- children: [/* @__PURE__ */ jsx(EntryIcon, { className: "size-4 shrink-0 text-muted-foreground" }), t(entry.labelKey)]
10099
- }, entry.key);
10100
- })
10101
- })]
10102
- }), /* @__PURE__ */ jsx(AddColumnForm, {
10103
- open: form.columnFormOpen,
10104
- onOpenChange: form.onColumnFormOpenChange,
10105
- form: form.columnForm,
10106
- formNumber: form.columnFormNumber,
10107
- formRef: form.columnFormRef,
10108
- error: form.columnFormError,
10109
- bridgeTables: form.bridgeTables,
10110
- OptionsEditor,
10111
- onCommit: form.commitColumnForm,
10112
- onNameChange: form.onColumnNameChange,
10113
- onDecimalsChange: form.onColumnDecimalsChange,
10114
- onThousandsChange: form.onColumnThousandsChange,
10115
- onPrefixChange: form.onColumnPrefixChange,
10116
- onSuffixChange: form.onColumnSuffixChange,
10117
- onAllowNegativeChange: form.onColumnAllowNegativeChange,
10118
- onEnumOptionsChange: form.onColumnEnumOptionsChange,
10119
- onRefPickChange: form.onColumnRefPickChange,
10120
- onNewTableNameChange: form.onColumnNewTableNameChange
10121
- })]
10271
+ !readOnly && onHeaderHeightChange !== void 0 && /* @__PURE__ */ jsx(HeaderResizeHandle, {
10272
+ resizing: headerPreview !== null,
10273
+ onPointerDown: onHeaderPointerDown,
10274
+ onPointerMove: onHeaderPointerMove,
10275
+ onPointerUp: onHeaderPointerUp,
10276
+ onPointerCancel: onHeaderPointerCancel
10277
+ }),
10278
+ /* @__PURE__ */ jsx(AddColumnCell, {
10279
+ gridColumn: columns.length + 1,
10280
+ readOnly,
10281
+ form,
10282
+ OptionsEditor
10122
10283
  }),
10123
10284
  /* @__PURE__ */ jsx(GridRows, {
10124
10285
  rows,
@@ -11190,7 +11351,7 @@ function useGridPendingRow({ pendingRow, data, columns, tableRef, setEditingCell
11190
11351
  * toolbar over `GridToolbar`, the table over `GridTable` (+ `GridRows`),
11191
11352
  * the pending row's lifecycle over `use-grid-pending-row`, the state's
11192
11353
  * surfaces over `GridStateCards`. */
11193
- function GridBody({ blockId, bridge, tableId, filter, columnOrder, hiddenColumns, columnWidths, onViewChange, readColumnOrder, readOnly = false }) {
11354
+ function GridBody({ blockId, bridge, tableId, filter, columnOrder, hiddenColumns, columnWidths, headerHeight, sectionHeaderHeight, onHeaderHeightChange, onViewChange, readColumnOrder, readOnly = false }) {
11194
11355
  const { t } = useTranslation("database");
11195
11356
  const data = useDatabaseTable(bridge, tableId, filter);
11196
11357
  const tableRef = useRef(null);
@@ -11216,6 +11377,7 @@ function GridBody({ blockId, bridge, tableId, filter, columnOrder, hiddenColumns
11216
11377
  onViewChange
11217
11378
  });
11218
11379
  const columns = visibleColumns(data.table?.columns, columnOrder, hiddenColumns);
11380
+ const resolvedHeaderHeight = resolveDatabaseHeaderHeight(headerHeight, sectionHeaderHeight);
11219
11381
  const updateView = (patch) => {
11220
11382
  onViewChange(patch);
11221
11383
  };
@@ -11288,6 +11450,8 @@ function GridBody({ blockId, bridge, tableId, filter, columnOrder, hiddenColumns
11288
11450
  refTableData,
11289
11451
  filter,
11290
11452
  readOnly,
11453
+ headerHeight: resolvedHeaderHeight,
11454
+ onHeaderHeightChange,
11291
11455
  tableRef,
11292
11456
  onTableKeyDown,
11293
11457
  onTablePaste,
@@ -11363,7 +11527,7 @@ function DatabaseDisconnected({ name }) {
11363
11527
  });
11364
11528
  }
11365
11529
  function DatabaseGrid({ id, block }) {
11366
- const { doc, databaseBridge, viewMode } = useEditorContext();
11530
+ const { doc, databaseBridge, databaseTableSection, viewMode } = useEditorContext();
11367
11531
  const tableId = block.attrs.tableId;
11368
11532
  if (tableId === void 0) return null;
11369
11533
  if (databaseBridge === void 0) return /* @__PURE__ */ jsx(DatabaseDisconnected, { name: block.attrs.name });
@@ -11375,6 +11539,9 @@ function DatabaseGrid({ id, block }) {
11375
11539
  columnOrder: block.attrs.columnOrder,
11376
11540
  hiddenColumns: block.attrs.hiddenColumns,
11377
11541
  columnWidths: block.attrs.columnWidths,
11542
+ headerHeight: block.attrs.headerHeight,
11543
+ sectionHeaderHeight: databaseTableSection?.getHeaderHeight?.(tableId),
11544
+ onHeaderHeightChange: (height) => doc.updateBlock(id, { headerHeight: height }),
11378
11545
  onViewChange: (patch) => doc.updateBlock(id, patch),
11379
11546
  readColumnOrder: () => {
11380
11547
  const current = doc.getBlock(id);
@@ -24020,9 +24187,14 @@ function resolveLinkHref(input) {
24020
24187
  * absolutely-positioned div inside the editor root (the root is the
24021
24188
  * positioning context), like the slash / the mention's menus. Enter / the
24022
24189
  * apply stands the commit (the `applyLinkHref`'s one transaction), the
24023
- * Escape stands the close (the no-write's stand), the invalid's stand
24190
+ * Escape stands the close (the no-write's stand — the document's stand
24191
+ * over the input's no-focus's, the LinkMenu's parity), the invalid's stand
24024
24192
  * stands the destructive's border + the message. The popover's mousedown
24025
- * stands the default's suppress (the selection's life over the edit).
24193
+ * stands the default's suppress (the selection's life over the edit) over
24194
+ * the non-form-control's stand only — the input's press keeps its default
24195
+ * (the focus + the caret's seat, the typing's stand over a lost focus).
24196
+ * The outside's press stands the close (the capture's document's stand,
24197
+ * the LinkMenu's parity).
24026
24198
  */
24027
24199
  /** The popover's width (px — the input's field's stand). */
24028
24200
  const POPOVER_WIDTH_PX = 288;
@@ -24043,6 +24215,27 @@ function LinkPopover({ rootRef, state, onClose }) {
24043
24215
  input.focus();
24044
24216
  input.select();
24045
24217
  }, []);
24218
+ useLayoutEffect(() => {
24219
+ const onKey = (event) => {
24220
+ if (event.key === "Escape") onClose();
24221
+ };
24222
+ const onPointerDown = (event) => {
24223
+ const el = popoverRef.current;
24224
+ const target = event.target instanceof Element ? event.target : null;
24225
+ if (el !== null && target !== null && !el.contains(target)) onClose();
24226
+ };
24227
+ document.addEventListener("keydown", onKey, true);
24228
+ document.addEventListener("pointerdown", onPointerDown, true);
24229
+ return () => {
24230
+ document.removeEventListener("keydown", onKey, true);
24231
+ document.removeEventListener("pointerdown", onPointerDown, true);
24232
+ };
24233
+ }, [onClose]);
24234
+ const handleMouseDown = (event) => {
24235
+ const target = event.target instanceof Element ? event.target : null;
24236
+ if (target !== null && target.closest("input, textarea") !== null) return;
24237
+ preventDefault(event);
24238
+ };
24046
24239
  useLayoutEffect(() => {
24047
24240
  const el = popoverRef.current;
24048
24241
  const root = rootRef.current;
@@ -24081,7 +24274,7 @@ function LinkPopover({ rootRef, state, onClose }) {
24081
24274
  left: position.left,
24082
24275
  top: position.top
24083
24276
  },
24084
- onMouseDown: preventDefault,
24277
+ onMouseDown: handleMouseDown,
24085
24278
  children: [
24086
24279
  /* @__PURE__ */ jsx(Input, {
24087
24280
  ref: inputRef,
@@ -24099,10 +24292,6 @@ function LinkPopover({ rootRef, state, onClose }) {
24099
24292
  event.preventDefault();
24100
24293
  event.stopPropagation();
24101
24294
  apply();
24102
- } else if (event.key === "Escape") {
24103
- event.preventDefault();
24104
- event.stopPropagation();
24105
- onClose();
24106
24295
  }
24107
24296
  }
24108
24297
  }),
@@ -24202,7 +24391,7 @@ const openLinkHref = (href) => {
24202
24391
  * handler (the link's anchor's stand — the native menu's suppress over the
24203
24392
  * link's own menu; the other's targets stand the native's stand). */
24204
24393
  /** The selection's rect's bottom to the popover's anchor's gap (px). */
24205
- const ANCHOR_GAP_PX = 8;
24394
+ const ANCHOR_GAP_PX$1 = 8;
24206
24395
  /** The selection's reseat's window (the tracking's transient mapping's
24207
24396
  * suppression over the popover / the menu's open's input's focus and the
24208
24397
  * close's residue — the doc's selection's no-clobber's stand). */
@@ -24279,7 +24468,7 @@ function useLinkPopover(rootRef) {
24279
24468
  const rootRect = root.getBoundingClientRect();
24280
24469
  anchor = {
24281
24470
  x: rect.left + rect.width / 2 - rootRect.left,
24282
- y: rect.bottom - rootRect.top + ANCHOR_GAP_PX
24471
+ y: rect.bottom - rootRect.top + ANCHOR_GAP_PX$1
24283
24472
  };
24284
24473
  }
24285
24474
  open(anchor, { target });
@@ -24639,6 +24828,39 @@ function createFormatToolbarActions({ doc, range, single, target, rootRef, onPal
24639
24828
  };
24640
24829
  }
24641
24830
  //#endregion
24831
+ //#region src/editing/format-toolbar/format-toolbar-anchor.ts
24832
+ /** The format bar's anchoring: the placement over the selection's rect and
24833
+ * the root's stand. */
24834
+ /** The bar's inset from the editor root's edges and the selection's rect. */
24835
+ const ANCHOR_GAP_PX = 8;
24836
+ /** The upper room below which the bar stands under the selection. */
24837
+ const ABOVE_MIN_ROOM_PX = 4;
24838
+ /**
24839
+ * Places the bar above the selection's rect (below it when the upper room
24840
+ * is short) and never above the editor root's upper edge: the consumer's own
24841
+ * chrome stands there, and the bar is the editor's surface (it legitimately
24842
+ * overhangs the content's bottom — no chrome below). A model range the DOM
24843
+ * carries no rect for (the canvas/page switch re-seats the selection over a
24844
+ * re-mounted page, a parked focus) keeps the bar's last position: an empty
24845
+ * rect is no anchor, and its page-origin stand would put the bar over the
24846
+ * chrome above the editor. The unit runtime has no range geometry — the bar
24847
+ * keeps its default position there.
24848
+ */
24849
+ function anchorFormatToolbar(el, root) {
24850
+ if (typeof Range.prototype.getBoundingClientRect !== "function") return;
24851
+ const selection = window.getSelection();
24852
+ if (selection === null || selection.rangeCount === 0 || !root.contains(selection.anchorNode)) return;
24853
+ const rect = selection.getRangeAt(0).getBoundingClientRect();
24854
+ if (rect.width === 0 && rect.height === 0) return;
24855
+ const rootRect = root.getBoundingClientRect();
24856
+ const width = el.offsetWidth;
24857
+ const height = el.offsetHeight;
24858
+ const above = rect.top - rootRect.top - height - ANCHOR_GAP_PX;
24859
+ const top = above < ABOVE_MIN_ROOM_PX ? rect.bottom - rootRect.top + ANCHOR_GAP_PX : above;
24860
+ el.style.left = `${clamp(rect.left + rect.width / 2 - width / 2 - rootRect.left, ANCHOR_GAP_PX, Math.max(ANCHOR_GAP_PX, rootRect.width - width - ANCHOR_GAP_PX))}px`;
24861
+ el.style.top = `${Math.max(top, ANCHOR_GAP_PX)}px`;
24862
+ }
24863
+ //#endregion
24642
24864
  //#region src/editing/format-toolbar/FormatToolbar.tsx
24643
24865
  /** The floating format toolbar — the selection's formatting affordance.
24644
24866
  *
@@ -24650,7 +24872,10 @@ function createFormatToolbarActions({ doc, range, single, target, rootRef, onPal
24650
24872
  * (below it when there is no room above) and disappears as soon as the
24651
24873
  * selection collapses, leaves the target, or becomes a blocks selection —
24652
24874
  * the visibility is derived from the selection state, so no key or mouse
24653
- * capture is needed.
24875
+ * capture is needed. A model range the DOM carries no rect for (the
24876
+ * canvas/page switch re-seats the selection over a re-mounted page) keeps the
24877
+ * bar's last position — never the page origin's stand above the editor's own
24878
+ * box, over the consumer's chrome.
24654
24879
  *
24655
24880
  * Controls (shared/ui primitives): the five toggle marks (bold, monospace
24656
24881
  * = the exclusive code mark, italic, underline, strikethrough) and the
@@ -24683,20 +24908,7 @@ function FormatToolbar({ rootRef, palette }) {
24683
24908
  const el = barRef.current;
24684
24909
  const root = rootRef.current;
24685
24910
  if (el === null || root === null) return;
24686
- const domSelection = window.getSelection();
24687
- if (domSelection === null || domSelection.rangeCount === 0) return;
24688
- if (!root.contains(domSelection.anchorNode)) return;
24689
- const range = domSelection.getRangeAt(0);
24690
- if (typeof range.getBoundingClientRect !== "function") return;
24691
- const rect = range.getBoundingClientRect();
24692
- const rootRect = root.getBoundingClientRect();
24693
- const width = el.offsetWidth;
24694
- const height = el.offsetHeight;
24695
- const left = clamp(rect.left + rect.width / 2 - width / 2 - rootRect.left, 8, Math.max(8, rootRect.width - width - 8));
24696
- const above = rect.top - rootRect.top - height - 8;
24697
- const top = above < 4 ? rect.bottom - rootRect.top + 8 : above;
24698
- el.style.left = `${left}px`;
24699
- el.style.top = `${top}px`;
24911
+ anchorFormatToolbar(el, root);
24700
24912
  });
24701
24913
  if (range === null) return null;
24702
24914
  if (range.kind === "single" && (block === void 0 || !TOOLBAR_BLOCK_TYPES.has(block.type))) return null;
@@ -30787,12 +30999,11 @@ const TableRow = memo(function TableRow({ id, rowTransform, columnTransforms, di
30787
30999
  * and the add-column chip (the table's right edge). The add-row chip and
30788
31000
  * the size's stand stand at the frame's level (they stay pinned while the
30789
31001
  * content scrolls) — over the entry. */
30790
- function TableSeams({ blockedSeams, widths, tableWidth, tableHeight, seamXs, resizePreview, addPreview, onSeamPointerDown, onSeamPointerMove, onSeamPointerUp, onSeamPointerCancel, onSeamKeyDown, onAddChipPointerDown, onAddChipPointerMove, onAddChipPointerUp, onAddChipPointerCancel, insertTableColumn }) {
31002
+ function TableSeams({ widths, tableWidth, tableHeight, seamXs, resizePreview, addPreview, onSeamPointerDown, onSeamPointerMove, onSeamPointerUp, onSeamPointerCancel, onSeamKeyDown, onAddChipPointerDown, onAddChipPointerMove, onAddChipPointerUp, onAddChipPointerCancel, insertTableColumn }) {
30791
31003
  const { t } = useTranslation("table");
30792
31004
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
30793
31005
  widths.map((_, col) => {
30794
31006
  const seamIndex = col + 1;
30795
- if (blockedSeams.has(seamIndex)) return null;
30796
31007
  const x = col + 1 < widths.length ? seamXs[seamIndex] ?? 20 + tableWidth : 20 + tableWidth;
30797
31008
  return /* @__PURE__ */ jsx("div", {
30798
31009
  "data-slot": "docblocks/table-col-resize",
@@ -31414,11 +31625,12 @@ function useTableMetrics({ scrollRef, tableWidth, rows }) {
31414
31625
  //#endregion
31415
31626
  //#region src/blocks/table/use-table-regions.ts
31416
31627
  /**
31417
- * The table's merged regions over the renderer's chrome: the stands the chrome
31418
- * must honour — no resize seam and no reorder handle on a region's interior,
31419
- * and no handle to drag at all for a column / row the region spans (a reorder
31420
- * through a region would shift its rectangle; the core rejects it, and the
31421
- * chrome simply offers nothing).
31628
+ * The table's merged regions over the renderer's chrome: no reorder handle
31629
+ * for a column / row the region spans (a reorder through a region would shift
31630
+ * its rectangle; the core rejects it, and the chrome simply offers nothing).
31631
+ * The region's column seams stand unblocked — a covered column resizes on its
31632
+ * own seam, and the region's width follows the columns' sum (the core's
31633
+ * width set has no region guard).
31422
31634
  */
31423
31635
  /**
31424
31636
  * The region-derived chrome stands. The chrome stamp re-reads the grid over
@@ -31431,18 +31643,13 @@ function useTableRegions({ doc, tableId }) {
31431
31643
  const chromeStamp = useStore(store, (state) => state.chromeStamp);
31432
31644
  return useMemo(() => {
31433
31645
  const grid = resolveTableGrid(doc.raw, tableId);
31434
- const blockedSeams = /* @__PURE__ */ new Set();
31435
31646
  const lockedColumns = /* @__PURE__ */ new Set();
31436
31647
  const lockedRows = /* @__PURE__ */ new Set();
31437
31648
  for (const anchor of grid?.rows.flat() ?? []) {
31438
- if (anchor.colspan > 1) {
31439
- for (let col = anchor.col + 1; col < anchor.col + anchor.colspan; col += 1) blockedSeams.add(col);
31440
- for (let col = anchor.col; col < anchor.col + anchor.colspan; col += 1) lockedColumns.add(col);
31441
- }
31649
+ if (anchor.colspan > 1) for (let col = anchor.col; col < anchor.col + anchor.colspan; col += 1) lockedColumns.add(col);
31442
31650
  if (anchor.rowspan > 1) for (let row = anchor.row; row < anchor.row + anchor.rowspan; row += 1) lockedRows.add(row);
31443
31651
  }
31444
31652
  return {
31445
- blockedSeams,
31446
31653
  lockedColumns,
31447
31654
  lockedRows
31448
31655
  };
@@ -31652,7 +31859,7 @@ function TableBlock({ id, block }) {
31652
31859
  });
31653
31860
  const columnCenters = columnCentersOf(widths);
31654
31861
  const seamXs = seamXsOf(widths);
31655
- const { blockedSeams, lockedColumns, lockedRows } = useTableRegions({
31862
+ const { lockedColumns, lockedRows } = useTableRegions({
31656
31863
  doc,
31657
31864
  tableId: id
31658
31865
  });
@@ -31729,7 +31936,6 @@ function TableBlock({ id, block }) {
31729
31936
  onRowHandleColor,
31730
31937
  palette
31731
31938
  }), /* @__PURE__ */ jsx(TableSeams, {
31732
- blockedSeams,
31733
31939
  widths,
31734
31940
  tableWidth,
31735
31941
  tableHeight,
@@ -35291,6 +35497,23 @@ function useEditorContext() {
35291
35497
  return context;
35292
35498
  }
35293
35499
  //#endregion
35500
+ //#region src/editor-provider/published-stand.ts
35501
+ /** The published snapshot's stand key: one key per snapshot instance. A new
35502
+ * snapshot remounts the nested published provider (the doc's stand must not
35503
+ * change over a mounted provider — the doc's stand guard), while the same
35504
+ * snapshot keeps its stand over the re-renders. */
35505
+ const SNAPSHOT_KEYS = /* @__PURE__ */ new WeakMap();
35506
+ let SNAPSHOT_KEY_SEQ = 0;
35507
+ function publishedStandKey(doc) {
35508
+ let key = SNAPSHOT_KEYS.get(doc);
35509
+ if (key === void 0) {
35510
+ key = SNAPSHOT_KEY_SEQ;
35511
+ SNAPSHOT_KEY_SEQ += 1;
35512
+ SNAPSHOT_KEYS.set(doc, key);
35513
+ }
35514
+ return `published-${key}`;
35515
+ }
35516
+ //#endregion
35294
35517
  //#region src/presence/utils.ts
35295
35518
  /** Deterministic hue (0–359) from the peer id (pure function, no peer state). */
35296
35519
  function peerHue(peerId) {
@@ -35727,17 +35950,6 @@ function useTrailingParagraph(doc, rootBlockId, editingStand) {
35727
35950
  //#region src/editor-provider/EditorProvider.tsx
35728
35951
  /** The per-instance editor provider: the doc + store + selection lifecycle
35729
35952
  * + the per-instance customization context. */
35730
- const SNAPSHOT_KEYS = /* @__PURE__ */ new WeakMap();
35731
- let SNAPSHOT_KEY_SEQ = 0;
35732
- function publishedStandKey(doc) {
35733
- let key = SNAPSHOT_KEYS.get(doc);
35734
- if (key === void 0) {
35735
- key = SNAPSHOT_KEY_SEQ;
35736
- SNAPSHOT_KEY_SEQ += 1;
35737
- SNAPSHOT_KEYS.set(doc, key);
35738
- }
35739
- return `published-${key}`;
35740
- }
35741
35953
  /**
35742
35954
  * The stand: owns the per-instance editor lifecycle — the zustand store
35743
35955
  * (projection of the doc), the selection view, and the subscriptions that
@@ -35749,7 +35961,7 @@ function publishedStandKey(doc) {
35749
35961
  * its own. Safe under StrictMode double-mount: the cleanup detaches every
35750
35962
  * subscription and destroys the view between the two mounts.
35751
35963
  */
35752
- 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 }) {
35964
+ function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoading, scrollContainer, databaseBridge, databaseTableSection, syncEmbedResolver, pdfPreview, mentionProvider, mentionInteractions, embedSandbox, rootBlockId, commandPalettePlaceholder, accessLevel, mode, publishedDoc, publishedCopyable, presence, hiddenAttributes, renderAttribute, attributeTypePicker, docTags, docDescription, coverPresets, children }) {
35753
35965
  const rootId = rootBlockId ?? doc.meta.id;
35754
35966
  const [store] = useState(() => createEditorStore(doc, rootId));
35755
35967
  const docRef = useRef(doc);
@@ -35787,6 +35999,8 @@ function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoa
35787
35999
  const effectiveBlobLoading = blobLoading ?? parentContext?.blobLoading ?? "lazy";
35788
36000
  const effectiveScrollContainer = scrollContainer === void 0 ? parentContext?.scrollContainer ?? null : scrollContainer;
35789
36001
  const effectiveDatabaseBridge = useMemo(() => databaseBridge ?? parentContext?.databaseBridge, [databaseBridge, parentContext]);
36002
+ const effectiveDatabaseTableSection = databaseTableSection ?? parentContext?.databaseTableSection ?? null;
36003
+ const effectivePublishedCopyable = publishedCopyable ?? parentContext?.publishedCopyable ?? false;
35790
36004
  const value = useMemo(() => {
35791
36005
  const parent = parentContext;
35792
36006
  return {
@@ -35798,6 +36012,7 @@ function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoa
35798
36012
  blobLoading: effectiveBlobLoading,
35799
36013
  scrollContainer: effectiveScrollContainer,
35800
36014
  databaseBridge: effectiveDatabaseBridge,
36015
+ databaseTableSection: effectiveDatabaseTableSection,
35801
36016
  syncEmbedResolver: syncEmbedResolver ?? parent?.syncEmbedResolver ?? null,
35802
36017
  pdfPreview: pdfPreview ?? parent?.pdfPreview ?? null,
35803
36018
  mentionProvider: mentionProvider ?? parent?.mentionProvider ?? null,
@@ -35815,6 +36030,7 @@ function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoa
35815
36030
  commandPalettePlaceholder: commandPalettePlaceholder ?? parent?.commandPalettePlaceholder ?? null,
35816
36031
  accessLevel: effectiveAccessLevel,
35817
36032
  mode: effectiveMode,
36033
+ publishedCopyable: effectivePublishedCopyable,
35818
36034
  viewMode: effectiveMode !== "edit",
35819
36035
  presence: presence ?? null
35820
36036
  };
@@ -35826,6 +36042,7 @@ function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoa
35826
36042
  effectiveBlobLoading,
35827
36043
  effectiveScrollContainer,
35828
36044
  effectiveDatabaseBridge,
36045
+ effectiveDatabaseTableSection,
35829
36046
  syncEmbedResolver,
35830
36047
  rootId,
35831
36048
  parentContext,
@@ -35836,6 +36053,7 @@ function EditorProviderStand({ doc, provider, blockRenderers, blobStore, blobLoa
35836
36053
  embedSandbox,
35837
36054
  effectiveAccessLevel,
35838
36055
  effectiveMode,
36056
+ effectivePublishedCopyable,
35839
36057
  presence,
35840
36058
  hiddenAttributes,
35841
36059
  renderAttribute,
@@ -38571,12 +38789,13 @@ function clipboardContentOf(doc, selection) {
38571
38789
  * selection view (the mapping owns it); the view's mode maps the DOM
38572
38790
  * selection at copy time — the read-only stand keeps no live view (the
38573
38791
  * browser's native range is the only selection there). The published
38574
- * stand never intercepts (no selection, no copy).
38792
+ * stand intercepts only over the consumer's copyable policy — the default
38793
+ * keeps the reader's selection and copy off.
38575
38794
  */
38576
38795
  function createCopyHandler(deps) {
38577
- const { doc, mode, viewMode, rootRef, selectionRef } = deps;
38796
+ const { doc, mode, viewMode, publishedCopyable, rootRef, selectionRef } = deps;
38578
38797
  return (event) => {
38579
- if (mode === "published") return;
38798
+ if (mode === "published" && !publishedCopyable) return;
38580
38799
  const root = rootRef.current;
38581
38800
  const view = selectionRef.view;
38582
38801
  if (root === null || view === null) return;
@@ -38744,7 +38963,7 @@ function useSelectionTracking(doc, rootRef, selectionRef, viewMode) {
38744
38963
  * so a render-time value would be a stale null.
38745
38964
  */
38746
38965
  function useEditing() {
38747
- const { doc, rootBlockId, selection: selectionRef, viewMode, mode } = useEditorContext();
38966
+ const { doc, rootBlockId, selection: selectionRef, viewMode, mode, publishedCopyable } = useEditorContext();
38748
38967
  const rootRef = useRef(null);
38749
38968
  const crossDrag = useCrossDrag(rootRef, doc, viewMode);
38750
38969
  useSelectionTracking(doc, rootRef, selectionRef, viewMode);
@@ -38798,6 +39017,7 @@ function useEditing() {
38798
39017
  doc,
38799
39018
  mode,
38800
39019
  viewMode,
39020
+ publishedCopyable,
38801
39021
  rootRef,
38802
39022
  selectionRef
38803
39023
  }),
@@ -39837,7 +40057,7 @@ function useMotionDrag({ doc, rootBlockId, store, rootRef, rowKeys, nodesById })
39837
40057
  * palette.
39838
40058
  */
39839
40059
  function Editor({ view = "page", formatPalette = FORMAT_PALETTE }) {
39840
- const { doc, store, rootBlockId, viewMode, mode, mentionInteractions } = useEditorContext();
40060
+ const { doc, store, rootBlockId, viewMode, mode, publishedCopyable, mentionInteractions } = useEditorContext();
39841
40061
  const rootChildren = useStore(store, (state) => state.rootChildren);
39842
40062
  const attributes = useStore(store, (state) => state.meta.attributes);
39843
40063
  const coverTintEnabled = (typeof attributes?.cover === "string" ? attributes.cover : void 0) !== void 0 && attributes?.coverTint !== false;
@@ -39915,6 +40135,7 @@ function Editor({ view = "page", formatPalette = FORMAT_PALETTE }) {
39915
40135
  "data-view": view,
39916
40136
  "data-mode": mode,
39917
40137
  "data-readonly": viewMode ? "true" : void 0,
40138
+ "data-copyable": mode === "published" && publishedCopyable ? "true" : void 0,
39918
40139
  "data-mention-interactive": mentionInteractions !== null ? "true" : void 0,
39919
40140
  tabIndex: -1,
39920
40141
  className: cn("relative min-h-0 flex-1 selection:bg-(--docblocks-selection-background)", "font-(family-name:--docblocks-font-family) text-(length:--docblocks-font-size)", "leading-(--docblocks-line-height) text-(--docblocks-text-color)"),