docblocks-react-ui 0.4.2 → 0.4.3

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # docblocks-react-ui
2
2
 
3
+ ## 0.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 0d75fe3: The callout's icon stands vertically centered over the block (the
8
+ marker-zone zone's top-alignment is replaced by the block's vertical
9
+ center); the icon catalog's "Preset" entry is removed — the icon's
10
+ override is reset by the type preset (the current variant's re-pick
11
+ stands the preset's reset: the variant + the overrides, one transact).
12
+ - Updated dependencies [c0559db]
13
+ - docblocks-core@0.2.1
14
+
3
15
  ## 0.4.2
4
16
 
5
17
  ### Patch Changes
@@ -4396,12 +4396,9 @@ var editor_default$1 = {
4396
4396
  "paragraph": "Text"
4397
4397
  },
4398
4398
  "callout": {
4399
- "trigger": "Callout",
4400
4399
  "typeAria": "Callout type",
4401
4400
  "variant": "{variant} callout",
4402
- "iconAria": "Callout icon",
4403
- "presetIcon": "Preset icon",
4404
- "preset": "Preset"
4401
+ "iconAria": "Callout icon"
4405
4402
  },
4406
4403
  "color": {
4407
4404
  "trigger": "Text and background color",
@@ -4852,12 +4849,9 @@ var editor_default = {
4852
4849
  "paragraph": "Текст"
4853
4850
  },
4854
4851
  "callout": {
4855
- "trigger": "Выноска",
4856
4852
  "typeAria": "Тип выноски",
4857
4853
  "variant": "Выноска: {variant}",
4858
- "iconAria": "Иконка выноски",
4859
- "presetIcon": "Иконка по умолчанию",
4860
- "preset": "По умолчанию"
4854
+ "iconAria": "Иконка выноски"
4861
4855
  },
4862
4856
  "color": {
4863
4857
  "trigger": "Цвет текста и фона",
@@ -18384,16 +18378,12 @@ function CalloutBlockMenu({ id, block }) {
18384
18378
  if (icon === name) return;
18385
18379
  doc.updateBlock(id, { icon: name });
18386
18380
  };
18387
- const onIconPreset = () => {
18388
- setMenuOpen(false);
18389
- if (icon === null) return;
18390
- doc.updateBlock(id, { icon: null });
18391
- };
18392
18381
  const onControlMouseDown = useCallback((event) => {
18393
18382
  event.preventDefault();
18394
18383
  }, []);
18395
18384
  const iconStyle = {
18396
- top: "var(--docblocks-callout-padding-y)",
18385
+ top: "50%",
18386
+ transform: "translateY(-50%)",
18397
18387
  left: "var(--docblocks-callout-padding-x)",
18398
18388
  width: "var(--docblocks-callout-icon-size)",
18399
18389
  height: "var(--docblocks-callout-icon-size)",
@@ -18496,11 +18486,11 @@ function CalloutBlockMenu({ id, block }) {
18496
18486
  }),
18497
18487
  /* @__PURE__ */ jsx("div", {
18498
18488
  className: "mt-2 border-t border-border pt-2",
18499
- children: /* @__PURE__ */ jsxs("div", {
18489
+ children: /* @__PURE__ */ jsx("div", {
18500
18490
  role: "group",
18501
18491
  "aria-label": t("formatToolbar.callout.iconAria"),
18502
18492
  className: "grid grid-cols-6 gap-1",
18503
- children: [CALLOUT_ICONS.map((name) => {
18493
+ children: CALLOUT_ICONS.map((name) => {
18504
18494
  const IconComponent = CALLOUT_ICON_COMPONENTS[name];
18505
18495
  const active = calloutIconName(icon, variant) === name;
18506
18496
  if (IconComponent === void 0) return null;
@@ -18515,16 +18505,7 @@ function CalloutBlockMenu({ id, block }) {
18515
18505
  onClick: () => onIconPick(name),
18516
18506
  children: /* @__PURE__ */ jsx(IconComponent, { className: "size-4" })
18517
18507
  }, name);
18518
- }), /* @__PURE__ */ jsx(Button, {
18519
- variant: "ghost",
18520
- size: "sm",
18521
- "data-callout-icon-preset": true,
18522
- "aria-label": t("formatToolbar.callout.presetIcon"),
18523
- title: t("formatToolbar.callout.presetIcon"),
18524
- className: cn("col-span-6 h-7 text-xs", icon === null && "bg-accent text-accent-foreground"),
18525
- onClick: onIconPreset,
18526
- children: t("formatToolbar.callout.preset")
18527
- })]
18508
+ })
18528
18509
  })
18529
18510
  })
18530
18511
  ]
package/dist/index.d.mts CHANGED
@@ -294,7 +294,7 @@ declare function AlertDescription({ className, ...props }: React.ComponentProps<
294
294
  //#endregion
295
295
  //#region src/shared/ui/Badge.d.ts
296
296
  declare const badgeVariants: (props?: ({
297
- variant?: "default" | "destructive" | "custom" | "secondary" | "outline" | null | undefined;
297
+ variant?: "default" | "custom" | "secondary" | "destructive" | "outline" | null | undefined;
298
298
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
299
299
  declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
300
300
  asChild?: boolean;
@@ -305,7 +305,7 @@ declare function BareSelect({ className, children, ...props }: React.ComponentPr
305
305
  //#endregion
306
306
  //#region src/shared/ui/Button.d.ts
307
307
  declare const buttonVariants: (props?: ({
308
- variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
308
+ variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
309
309
  size?: "default" | "icon" | "sm" | "lg" | "xl" | null | undefined;
310
310
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
311
311
  declare function Button({ className, variant, size, asChild, type, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as PopoverHeader, A as SelectTrigger, At as isBridgeErrorCode, B as DropdownMenuRadioGroup, Bt as useMeta, C as SelectContent, Ct as BASELINE_CAPABILITIES, D as SelectScrollDownButton, Dt as BRIDGE_ERROR_CODES, E as SelectLabel, Et as validateProtocolDescriptor, F as DropdownMenuContent, Ft as columnAnnotation, G as DropdownMenuSubContent, Gt as useText, H as DropdownMenuSeparator, Ht as usePresenceSharing, I as DropdownMenuGroup, It as ScrollArea, J as Separator, Jt as blobSubtypeOf, K as DropdownMenuSubTrigger, L as DropdownMenuItem, Lt as Input, M as Label, Mt as conditionMatches, N as DropdownMenu, Nt as parseCellValue, O as SelectScrollUpButton, Ot as BridgeError, P as DropdownMenuCheckboxItem, Pt as TEXT_TYPES, Q as PopoverDescription, R as DropdownMenuLabel, Rt as useBlock, S as Select, St as AlertTitle, T as SelectItem, Tt as isDatabaseBridge, U as DropdownMenuShortcut, Ut as useSelection, V as DropdownMenuRadioItem, Vt as usePresence, W as DropdownMenuSub, Wt as useSelectionView, X as PopoverAnchor, Y as Popover, Yt as createMemoryBlobStore, Z as PopoverContent, _ as FilterBuilder, _t as BareSelect, a as SHAPE_FONT_STACKS, at as CardAction, b as Skeleton, bt as Alert, ct as CardFooter, d as useEditorContext, dt as Pen, et as PopoverTitle, f as DEFAULT_EMBED_SANDBOX, ft as Eye, g as newMutationContext, gt as buttonVariants, h as cellValueEqual, ht as Button, i as SHAPE_FONT_OPTIONS, it as Card, j as SelectValue, jt as toBridgeError, k as SelectSeparator, kt as isBridgeError, l as markToggleAction, lt as CardHeader, m as useDatabaseTable, mt as BookOpen, nt as DocblocksI18nProvider, 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-7TzmKd9z.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-BHXnrEJ1.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-7TzmKd9z.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-BHXnrEJ1.mjs";
2
2
  import { r as TriangleAlert } from "../constants-BaAj3jDA.mjs";
3
3
  import { t as LoaderCircle } from "../LoaderCircle-AGVFE4IP.mjs";
4
4
  import { useEffect, useRef, useState } from "react";
package/dist/styles.css CHANGED
@@ -387,9 +387,6 @@
387
387
  .z-60 {
388
388
  z-index: 60;
389
389
  }
390
- .col-span-6 {
391
- grid-column: span 6 / span 6;
392
- }
393
390
  .col-start-2 {
394
391
  grid-column-start: 2;
395
392
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docblocks-react-ui",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "React rendering + editing layer for docblocks: hooks, block renderers, caret/selection, keyboard, clipboard.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "access": "public"
35
35
  },
36
36
  "peerDependencies": {
37
- "docblocks-core": "^0.2.0",
37
+ "docblocks-core": "^0.2.1",
38
38
  "framer-motion": "^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
39
39
  "mermaid": "^12.0.0",
40
40
  "pdfjs-dist": "^6.0.0",