@emdash-cms/admin 0.22.0 → 0.24.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.
Files changed (104) hide show
  1. package/dist/{LocaleDirectionProvider-KiOZcAs2.js → LocaleDirectionProvider-CK7aJ2Lb.js} +20 -20
  2. package/dist/{LocaleDirectionProvider-KiOZcAs2.js.map → LocaleDirectionProvider-CK7aJ2Lb.js.map} +1 -1
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +250 -208
  6. package/dist/index.js.map +1 -1
  7. package/dist/locales/ar/messages.mjs +1 -1
  8. package/dist/locales/de/messages.mjs +1 -1
  9. package/dist/locales/en/messages.mjs +1 -1
  10. package/dist/locales/en-GB/messages.mjs +1 -1
  11. package/dist/locales/es-419/messages.mjs +1 -1
  12. package/dist/locales/es-ES/messages.mjs +1 -1
  13. package/dist/locales/eu/messages.mjs +1 -1
  14. package/dist/locales/fa/messages.mjs +1 -1
  15. package/dist/locales/fr/messages.mjs +1 -1
  16. package/dist/locales/id/messages.mjs +1 -1
  17. package/dist/locales/index.js +1 -1
  18. package/dist/locales/ja/messages.mjs +1 -1
  19. package/dist/locales/ko/messages.mjs +1 -1
  20. package/dist/locales/nb/messages.mjs +1 -1
  21. package/dist/locales/pl/messages.mjs +1 -1
  22. package/dist/locales/pseudo/messages.mjs +1 -1
  23. package/dist/locales/pt-BR/messages.mjs +1 -1
  24. package/dist/locales/th/messages.mjs +1 -1
  25. package/dist/locales/zh-CN/messages.mjs +1 -1
  26. package/dist/locales/zh-TW/messages.mjs +1 -1
  27. package/dist/messages-8fTMJtWA.js +6 -0
  28. package/dist/messages-8fTMJtWA.js.map +1 -0
  29. package/dist/messages-B43-WzBC.js +6 -0
  30. package/dist/messages-B43-WzBC.js.map +1 -0
  31. package/dist/messages-BT9Q9atq.js +6 -0
  32. package/dist/messages-BT9Q9atq.js.map +1 -0
  33. package/dist/messages-BTDhbVyJ.js +6 -0
  34. package/dist/messages-BTDhbVyJ.js.map +1 -0
  35. package/dist/messages-BXAjXbUr.js +6 -0
  36. package/dist/messages-BXAjXbUr.js.map +1 -0
  37. package/dist/messages-BdciNNnG.js +6 -0
  38. package/dist/messages-BdciNNnG.js.map +1 -0
  39. package/dist/messages-Bh2bSu3x.js +6 -0
  40. package/dist/messages-Bh2bSu3x.js.map +1 -0
  41. package/dist/messages-CIm8G_NT.js +6 -0
  42. package/dist/messages-CIm8G_NT.js.map +1 -0
  43. package/dist/messages-Cl5m9q7M.js +6 -0
  44. package/dist/messages-Cl5m9q7M.js.map +1 -0
  45. package/dist/messages-Crei9McK.js +6 -0
  46. package/dist/messages-Crei9McK.js.map +1 -0
  47. package/dist/messages-D6wHPGil.js +6 -0
  48. package/dist/messages-D6wHPGil.js.map +1 -0
  49. package/dist/messages-DjQX9PJY.js +6 -0
  50. package/dist/messages-DjQX9PJY.js.map +1 -0
  51. package/dist/messages-DlzFD1ts.js +6 -0
  52. package/dist/messages-DlzFD1ts.js.map +1 -0
  53. package/dist/messages-DxYrdNN-.js +6 -0
  54. package/dist/messages-DxYrdNN-.js.map +1 -0
  55. package/dist/messages-FkTGnwV-.js +6 -0
  56. package/dist/messages-FkTGnwV-.js.map +1 -0
  57. package/dist/messages-cWzWbWxk.js +6 -0
  58. package/dist/messages-cWzWbWxk.js.map +1 -0
  59. package/dist/messages-n6HQSjDA.js +6 -0
  60. package/dist/messages-n6HQSjDA.js.map +1 -0
  61. package/dist/messages-otHOIv0j.js +6 -0
  62. package/dist/messages-otHOIv0j.js.map +1 -0
  63. package/dist/messages-umZ9RCq_.js +6 -0
  64. package/dist/messages-umZ9RCq_.js.map +1 -0
  65. package/dist/styles.css +1 -1
  66. package/package.json +5 -5
  67. package/dist/messages-4RfOgpRe.js +0 -6
  68. package/dist/messages-4RfOgpRe.js.map +0 -1
  69. package/dist/messages-B2dislAg.js +0 -6
  70. package/dist/messages-B2dislAg.js.map +0 -1
  71. package/dist/messages-BCwJZnj9.js +0 -6
  72. package/dist/messages-BCwJZnj9.js.map +0 -1
  73. package/dist/messages-BKIhPAtr.js +0 -6
  74. package/dist/messages-BKIhPAtr.js.map +0 -1
  75. package/dist/messages-BXVAMkKS.js +0 -6
  76. package/dist/messages-BXVAMkKS.js.map +0 -1
  77. package/dist/messages-Bi-nkgXF.js +0 -6
  78. package/dist/messages-Bi-nkgXF.js.map +0 -1
  79. package/dist/messages-BijE6qyL.js +0 -6
  80. package/dist/messages-BijE6qyL.js.map +0 -1
  81. package/dist/messages-CUr8te5R.js +0 -6
  82. package/dist/messages-CUr8te5R.js.map +0 -1
  83. package/dist/messages-CsCXsIkt.js +0 -6
  84. package/dist/messages-CsCXsIkt.js.map +0 -1
  85. package/dist/messages-CvdFDy7W.js +0 -6
  86. package/dist/messages-CvdFDy7W.js.map +0 -1
  87. package/dist/messages-D3Za28AJ.js +0 -6
  88. package/dist/messages-D3Za28AJ.js.map +0 -1
  89. package/dist/messages-D4fTrIpF.js +0 -6
  90. package/dist/messages-D4fTrIpF.js.map +0 -1
  91. package/dist/messages-DPKhsdix.js +0 -6
  92. package/dist/messages-DPKhsdix.js.map +0 -1
  93. package/dist/messages-DU6VHdml.js +0 -6
  94. package/dist/messages-DU6VHdml.js.map +0 -1
  95. package/dist/messages-DVps7CyU.js +0 -6
  96. package/dist/messages-DVps7CyU.js.map +0 -1
  97. package/dist/messages-DcYO8AdT.js +0 -6
  98. package/dist/messages-DcYO8AdT.js.map +0 -1
  99. package/dist/messages-HYNWLJvO.js +0 -6
  100. package/dist/messages-HYNWLJvO.js.map +0 -1
  101. package/dist/messages-HwYE7sN5.js +0 -6
  102. package/dist/messages-HwYE7sN5.js.map +0 -1
  103. package/dist/messages-n9rSmjwa.js +0 -6
  104. package/dist/messages-n9rSmjwa.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { c as fetchAuthMode, d as throwResponseError, i as fetchPlugins, l as fetchManifest, n as enablePlugin, o as API_BASE, r as fetchPlugin, s as apiFetch, t as disablePlugin, u as parseApiResponse } from "./plugins-G9Z9NQ7n.js";
2
- import { a as SUPPORTED_LOCALES, i as DEFAULT_LOCALE, l as resolveLocale, n as useLocale, o as SUPPORTED_LOCALE_CODES, t as LocaleDirectionProvider } from "./LocaleDirectionProvider-KiOZcAs2.js";
2
+ import { a as SUPPORTED_LOCALES, i as DEFAULT_LOCALE, l as resolveLocale, n as useLocale, o as SUPPORTED_LOCALE_CODES, s as getLocaleDir, t as LocaleDirectionProvider } from "./LocaleDirectionProvider-CK7aJ2Lb.js";
3
3
  import "./locales/index.js";
4
- import { Autocomplete, Badge, Button, Checkbox, ClipboardText, CommandPalette, Dialog, Input, InputArea, Label, LinkButton, Loader, Popover, Select, Sidebar as KumoSidebar, Switch, Tabs, Toast, Toasty, Tooltip, buttonVariants, useSidebar } from "@cloudflare/kumo";
4
+ import { Autocomplete, Badge, Button, Checkbox, ClipboardText, CommandPalette, Dialog, Input, InputArea, Label, LinkButton, LinkProvider, Loader, Popover, Select, Sidebar as KumoSidebar, Switch, Tabs, Toast, Toasty, Tooltip, buttonVariants, useSidebar } from "@cloudflare/kumo";
5
5
  import { i18n } from "@lingui/core";
6
6
  import { I18nProvider, Trans, useLingui } from "@lingui/react";
7
7
  import { QueryClient, QueryClientProvider, keepPreviousData, useInfiniteQuery, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
@@ -5082,6 +5082,7 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5082
5082
  const [displayWidth, setDisplayWidth] = React$1.useState(attributes.displayWidth ?? attributes.width);
5083
5083
  const [displayHeight, setDisplayHeight] = React$1.useState(attributes.displayHeight ?? attributes.height);
5084
5084
  const [lockAspectRatio, setLockAspectRatio] = React$1.useState(true);
5085
+ const [alignment, setAlignment] = React$1.useState(attributes.alignment);
5085
5086
  const aspectRatio = attributes.width && attributes.height ? attributes.width / attributes.height : void 0;
5086
5087
  const handleWidthChange = (value) => {
5087
5088
  const newWidth = value ? parseInt(value, 10) : void 0;
@@ -5113,14 +5114,15 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5113
5114
  const hasChanges = React$1.useMemo(() => {
5114
5115
  const originalDisplayWidth = attributes.displayWidth ?? attributes.width;
5115
5116
  const originalDisplayHeight = attributes.displayHeight ?? attributes.height;
5116
- return alt !== (attributes.alt ?? "") || caption !== (attributes.caption ?? "") || title !== (attributes.title ?? "") || displayWidth !== originalDisplayWidth || displayHeight !== originalDisplayHeight;
5117
+ return alt !== (attributes.alt ?? "") || caption !== (attributes.caption ?? "") || title !== (attributes.title ?? "") || displayWidth !== originalDisplayWidth || displayHeight !== originalDisplayHeight || alignment !== attributes.alignment;
5117
5118
  }, [
5118
5119
  attributes,
5119
5120
  alt,
5120
5121
  caption,
5121
5122
  title,
5122
5123
  displayWidth,
5123
- displayHeight
5124
+ displayHeight,
5125
+ alignment
5124
5126
  ]);
5125
5127
  const handleSave = () => {
5126
5128
  onUpdate({
@@ -5128,10 +5130,55 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5128
5130
  caption: caption || void 0,
5129
5131
  title: title || void 0,
5130
5132
  displayWidth,
5131
- displayHeight
5133
+ displayHeight,
5134
+ alignment
5132
5135
  });
5133
5136
  onClose();
5134
5137
  };
5138
+ const alignmentOptions = [
5139
+ {
5140
+ value: void 0,
5141
+ label: _t({
5142
+ id: "EdQY6l",
5143
+ message: "None"
5144
+ })
5145
+ },
5146
+ {
5147
+ value: "left",
5148
+ label: _t({
5149
+ id: "UlKSMd",
5150
+ message: "Left"
5151
+ })
5152
+ },
5153
+ {
5154
+ value: "center",
5155
+ label: _t({
5156
+ id: "VTRXqB",
5157
+ message: "Center"
5158
+ })
5159
+ },
5160
+ {
5161
+ value: "right",
5162
+ label: _t({
5163
+ id: "nOPbWJ",
5164
+ message: "Right"
5165
+ })
5166
+ },
5167
+ {
5168
+ value: "wide",
5169
+ label: _t({
5170
+ id: "I5S9ZE",
5171
+ message: "Wide"
5172
+ })
5173
+ },
5174
+ {
5175
+ value: "full",
5176
+ label: _t({
5177
+ id: "g2Tj8R",
5178
+ message: "Full"
5179
+ })
5180
+ }
5181
+ ];
5135
5182
  const [showDeleteConfirm, setShowDeleteConfirm] = React$1.useState(false);
5136
5183
  const handleDelete = () => {
5137
5184
  setShowDeleteConfirm(true);
@@ -5255,7 +5302,7 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5255
5302
  ]
5256
5303
  })]
5257
5304
  }),
5258
- attributes.width && attributes.height && /* @__PURE__ */ jsxs("div", {
5305
+ attributes.src && /* @__PURE__ */ jsxs("div", {
5259
5306
  className: "p-4 border-b space-y-3",
5260
5307
  children: [
5261
5308
  /* @__PURE__ */ jsxs("div", {
@@ -5263,7 +5310,7 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5263
5310
  children: [/* @__PURE__ */ jsx(Label, { children: _t({
5264
5311
  id: "UlO610",
5265
5312
  message: "Display Size"
5266
- }) }), /* @__PURE__ */ jsx(Button, {
5313
+ }) }), attributes.width && attributes.height && /* @__PURE__ */ jsx(Button, {
5267
5314
  variant: "ghost",
5268
5315
  size: "sm",
5269
5316
  onClick: handleResetDimensions,
@@ -5289,7 +5336,7 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5289
5336
  onChange: (e) => handleWidthChange(e.target.value)
5290
5337
  })
5291
5338
  }),
5292
- /* @__PURE__ */ jsx(Button, {
5339
+ aspectRatio && /* @__PURE__ */ jsx(Button, {
5293
5340
  variant: "ghost",
5294
5341
  shape: "square",
5295
5342
  className: "mt-5",
@@ -5333,6 +5380,22 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5333
5380
  })
5334
5381
  ]
5335
5382
  }),
5383
+ attributes.src && /* @__PURE__ */ jsxs("div", {
5384
+ className: "p-4 border-b space-y-3",
5385
+ children: [/* @__PURE__ */ jsx(Label, { children: _t({
5386
+ id: "ukH0aS",
5387
+ message: "Alignment"
5388
+ }) }), /* @__PURE__ */ jsx("div", {
5389
+ className: "flex flex-wrap gap-1",
5390
+ children: alignmentOptions.map((opt) => /* @__PURE__ */ jsx(Button, {
5391
+ type: "button",
5392
+ size: "sm",
5393
+ variant: alignment === opt.value ? "primary" : "secondary",
5394
+ onClick: () => setAlignment(opt.value),
5395
+ children: opt.label
5396
+ }, opt.value ?? "none"))
5397
+ })]
5398
+ }),
5336
5399
  /* @__PURE__ */ jsxs("div", {
5337
5400
  className: "p-4 space-y-4",
5338
5401
  children: [
@@ -5513,7 +5576,7 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5513
5576
  ]
5514
5577
  })
5515
5578
  }),
5516
- attributes.width && attributes.height && /* @__PURE__ */ jsxs("div", {
5579
+ attributes.src && /* @__PURE__ */ jsxs("div", {
5517
5580
  className: "p-4 border-b space-y-3",
5518
5581
  children: [
5519
5582
  /* @__PURE__ */ jsxs("div", {
@@ -5521,7 +5584,7 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5521
5584
  children: [/* @__PURE__ */ jsx(Label, { children: _t({
5522
5585
  id: "UlO610",
5523
5586
  message: "Display Size"
5524
- }) }), /* @__PURE__ */ jsx(Button, {
5587
+ }) }), attributes.width && attributes.height && /* @__PURE__ */ jsx(Button, {
5525
5588
  variant: "ghost",
5526
5589
  size: "sm",
5527
5590
  onClick: handleResetDimensions,
@@ -5547,7 +5610,7 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5547
5610
  onChange: (e) => handleWidthChange(e.target.value)
5548
5611
  })
5549
5612
  }),
5550
- /* @__PURE__ */ jsx(Button, {
5613
+ aspectRatio && /* @__PURE__ */ jsx(Button, {
5551
5614
  variant: "ghost",
5552
5615
  shape: "square",
5553
5616
  className: "mt-5",
@@ -5591,6 +5654,22 @@ function ImageDetailPanel({ attributes, onUpdate, onReplace, onDelete, onClose,
5591
5654
  })
5592
5655
  ]
5593
5656
  }),
5657
+ attributes.src && /* @__PURE__ */ jsxs("div", {
5658
+ className: "p-4 border-b space-y-3",
5659
+ children: [/* @__PURE__ */ jsx(Label, { children: _t({
5660
+ id: "ukH0aS",
5661
+ message: "Alignment"
5662
+ }) }), /* @__PURE__ */ jsx("div", {
5663
+ className: "flex flex-wrap gap-1",
5664
+ children: alignmentOptions.map((opt) => /* @__PURE__ */ jsx(Button, {
5665
+ type: "button",
5666
+ size: "sm",
5667
+ variant: alignment === opt.value ? "primary" : "secondary",
5668
+ onClick: () => setAlignment(opt.value),
5669
+ children: opt.label
5670
+ }, opt.value ?? "none"))
5671
+ })]
5672
+ }),
5594
5673
  /* @__PURE__ */ jsxs("div", {
5595
5674
  className: "p-4 space-y-4",
5596
5675
  children: [
@@ -7006,7 +7085,8 @@ function ImageNodeView({ node, updateAttributes, selected, deleteNode, editor })
7006
7085
  width: node.attrs.width,
7007
7086
  height: node.attrs.height,
7008
7087
  displayWidth: node.attrs.displayWidth,
7009
- displayHeight: node.attrs.displayHeight
7088
+ displayHeight: node.attrs.displayHeight,
7089
+ alignment: node.attrs.alignment
7010
7090
  });
7011
7091
  const openSidebar = () => {
7012
7092
  const onOpen = editor.storage.image?.onOpenBlockSidebar;
@@ -7039,7 +7119,22 @@ function ImageNodeView({ node, updateAttributes, selected, deleteNode, editor })
7039
7119
  React$1.useEffect(() => {
7040
7120
  if (!selected) closeSidebar();
7041
7121
  }, [selected]);
7122
+ const alignment = node.attrs.alignment;
7042
7123
  return /* @__PURE__ */ jsx(NodeViewWrapper, {
7124
+ style: alignment === "left" ? {
7125
+ float: "left",
7126
+ width: "fit-content",
7127
+ maxWidth: "50%",
7128
+ marginInlineEnd: "1.5rem"
7129
+ } : alignment === "right" ? {
7130
+ float: "right",
7131
+ width: "fit-content",
7132
+ maxWidth: "50%",
7133
+ marginInlineStart: "1.5rem"
7134
+ } : alignment === "center" ? {
7135
+ width: "fit-content",
7136
+ marginInline: "auto"
7137
+ } : alignment === "wide" || alignment === "full" ? { width: "100%" } : {},
7043
7138
  className: cn("relative my-4 group", selected && "ring-2 ring-kumo-brand ring-offset-2 rounded-lg"),
7044
7139
  children: /* @__PURE__ */ jsxs("figure", {
7045
7140
  className: "relative",
@@ -7215,7 +7310,8 @@ const ImageExtension = Node$2.create({
7215
7310
  width: { default: null },
7216
7311
  height: { default: null },
7217
7312
  displayWidth: { default: null },
7218
- displayHeight: { default: null }
7313
+ displayHeight: { default: null },
7314
+ alignment: { default: null }
7219
7315
  };
7220
7316
  },
7221
7317
  parseHTML() {
@@ -7865,12 +7961,15 @@ function convertPMNode(node) {
7865
7961
  case "paragraph": {
7866
7962
  const { children, markDefs } = convertInlineContent(node.content || []);
7867
7963
  if (children.length === 0) return null;
7964
+ const ta = node.attrs?.textAlign;
7965
+ const textAlign = ta === "center" || ta === "right" || ta === "justify" ? ta : void 0;
7868
7966
  return {
7869
7967
  _type: "block",
7870
7968
  _key: generateKey(),
7871
7969
  style: "normal",
7872
7970
  children,
7873
- markDefs: markDefs.length > 0 ? markDefs : void 0
7971
+ markDefs: markDefs.length > 0 ? markDefs : void 0,
7972
+ ...textAlign ? { textAlign } : {}
7874
7973
  };
7875
7974
  }
7876
7975
  case "heading": {
@@ -7879,12 +7978,15 @@ function convertPMNode(node) {
7879
7978
  const level = typeof rawLevel === "number" ? rawLevel : 1;
7880
7979
  if (children.length === 0) return null;
7881
7980
  const headingStyle = level >= 1 && level <= 6 ? `h${level}` : "h1";
7981
+ const ta = node.attrs?.textAlign;
7982
+ const textAlign = ta === "center" || ta === "right" || ta === "justify" ? ta : void 0;
7882
7983
  return {
7883
7984
  _type: "block",
7884
7985
  _key: generateKey(),
7885
7986
  style: headingStyle,
7886
7987
  children,
7887
- markDefs: markDefs.length > 0 ? markDefs : void 0
7988
+ markDefs: markDefs.length > 0 ? markDefs : void 0,
7989
+ ...textAlign ? { textAlign } : {}
7888
7990
  };
7889
7991
  }
7890
7992
  case "bulletList": return convertList(node.content || [], "bullet");
@@ -7939,7 +8041,8 @@ function convertPMNode(node) {
7939
8041
  width: attrNum(attrs.width),
7940
8042
  height: attrNum(attrs.height),
7941
8043
  displayWidth: attrNum(attrs.displayWidth),
7942
- displayHeight: attrNum(attrs.displayHeight)
8044
+ displayHeight: attrNum(attrs.displayHeight),
8045
+ alignment: attrStr(attrs.alignment)
7943
8046
  };
7944
8047
  }
7945
8048
  case "horizontalRule": return {
@@ -8126,7 +8229,7 @@ function convertPTBlock(block) {
8126
8229
  switch (block._type) {
8127
8230
  case "block": {
8128
8231
  if (!isTextBlock(block)) return null;
8129
- const { style = "normal", children, markDefs = [] } = block;
8232
+ const { style = "normal", children, markDefs = [], textAlign } = block;
8130
8233
  const pmContent = convertPTSpans(children, markDefs);
8131
8234
  switch (style) {
8132
8235
  case "h1":
@@ -8136,7 +8239,10 @@ function convertPTBlock(block) {
8136
8239
  case "h5":
8137
8240
  case "h6": return {
8138
8241
  type: "heading",
8139
- attrs: { level: parseInt(style.substring(1), 10) },
8242
+ attrs: {
8243
+ level: parseInt(style.substring(1), 10),
8244
+ ...textAlign ? { textAlign } : {}
8245
+ },
8140
8246
  content: pmContent.length > 0 ? pmContent : void 0
8141
8247
  };
8142
8248
  case "blockquote": return {
@@ -8148,6 +8254,7 @@ function convertPTBlock(block) {
8148
8254
  };
8149
8255
  default: return {
8150
8256
  type: "paragraph",
8257
+ attrs: textAlign ? { textAlign } : void 0,
8151
8258
  content: pmContent.length > 0 ? pmContent : void 0
8152
8259
  };
8153
8260
  }
@@ -8166,7 +8273,8 @@ function convertPTBlock(block) {
8166
8273
  width: imageBlock.width,
8167
8274
  height: imageBlock.height,
8168
8275
  displayWidth: imageBlock.displayWidth,
8169
- displayHeight: imageBlock.displayHeight
8276
+ displayHeight: imageBlock.displayHeight,
8277
+ alignment: imageBlock.alignment
8170
8278
  }
8171
8279
  };
8172
8280
  }
@@ -30159,41 +30267,37 @@ function resolveNavIcon(name) {
30159
30267
  return icon;
30160
30268
  }
30161
30269
  /**
30162
- * Navigation item rendered as a TanStack Router <Link> inside kumo's
30163
- * Sidebar.MenuItem. Styled to match kumo MenuButton appearance.
30164
- * This approach guarantees client-side navigation works correctly.
30270
+ * Navigation item rendered with Kumo's native Sidebar.MenuButton. Kumo's
30271
+ * LinkProvider maps the href to TanStack Router for client-side navigation.
30165
30272
  */
30166
30273
  function NavMenuLink({ item, isActive }) {
30167
30274
  const { state } = useSidebar();
30168
30275
  const Icon = item.icon;
30169
- const iconClassName = cn("emdash-nav-icon size-[18px] shrink-0 transition-colors duration-200", isActive ? "text-white" : "text-white/60 group-hover/menu-button:text-white/90");
30170
- const link = /* @__PURE__ */ jsxs(Link$1, {
30171
- to: item.to,
30172
- params: item.params,
30173
- "aria-current": isActive ? "page" : void 0,
30174
- "data-active": isActive || void 0,
30175
- "data-sidebar": "menu-button",
30176
- className: cn("emdash-nav-link group/menu-button flex w-full min-w-0 items-center gap-2.5 rounded-md no-underline outline-none cursor-pointer", "min-h-[36px] px-3 py-1.5 text-[13px]", "transition-all duration-200 ease-out", isActive ? "bg-kumo-brand text-white" : "text-white/70 hover:text-white hover:bg-white/8", "focus-visible:ring-2 focus-visible:ring-kumo-brand/50"),
30177
- children: [/* @__PURE__ */ jsx(React$1.Suspense, {
30178
- fallback: /* @__PURE__ */ jsx(PuzzlePiece, {
30179
- className: iconClassName,
30180
- "aria-hidden": "true"
30181
- }),
30182
- children: /* @__PURE__ */ jsx(Icon, {
30183
- className: iconClassName,
30184
- "aria-hidden": "true"
30185
- })
30186
- }), /* @__PURE__ */ jsxs("span", {
30187
- className: "emdash-nav-label flex flex-1 items-center min-w-0 text-start overflow-hidden",
30188
- children: [item.label, item.badge != null && item.badge > 0 && /* @__PURE__ */ jsx(KumoSidebar.MenuBadge, { children: item.badge })]
30189
- })]
30276
+ function IconComponent({ className }) {
30277
+ return /* @__PURE__ */ jsx(NavIcon, {
30278
+ icon: Icon,
30279
+ className
30280
+ });
30281
+ }
30282
+ return /* @__PURE__ */ jsxs(KumoSidebar.MenuButton, {
30283
+ href: resolveItemPath(item),
30284
+ active: isActive,
30285
+ tooltip: state === "collapsed" ? item.label : void 0,
30286
+ icon: IconComponent,
30287
+ children: [item.label, item.badge != null && item.badge > 0 && /* @__PURE__ */ jsx(KumoSidebar.MenuBadge, { children: item.badge })]
30288
+ });
30289
+ }
30290
+ function NavIcon({ icon: Icon, className }) {
30291
+ return /* @__PURE__ */ jsx(React$1.Suspense, {
30292
+ fallback: /* @__PURE__ */ jsx(PuzzlePiece, {
30293
+ className,
30294
+ "aria-hidden": "true"
30295
+ }),
30296
+ children: /* @__PURE__ */ jsx(Icon, {
30297
+ className,
30298
+ "aria-hidden": "true"
30299
+ })
30190
30300
  });
30191
- return /* @__PURE__ */ jsx(KumoSidebar.MenuItem, { children: state === "collapsed" ? /* @__PURE__ */ jsx(Tooltip, {
30192
- content: item.label,
30193
- side: "right",
30194
- asChild: true,
30195
- children: link
30196
- }) : link });
30197
30301
  }
30198
30302
  /** Resolves a nav item's route path by substituting $param placeholders. */
30199
30303
  function resolveItemPath(item) {
@@ -30317,6 +30421,14 @@ function SidebarNav({ manifest }) {
30317
30421
  icon: Database,
30318
30422
  minRole: ROLE_ADMIN$2
30319
30423
  },
30424
+ {
30425
+ ...BYLINE_SCHEMA_NAV_ITEM,
30426
+ label: _t({
30427
+ id: "EWaYRd",
30428
+ message: "Byline Schema"
30429
+ }),
30430
+ icon: FileText
30431
+ },
30320
30432
  {
30321
30433
  to: "/users",
30322
30434
  label: _t({
@@ -30409,103 +30521,7 @@ function SidebarNav({ manifest }) {
30409
30521
  }, `${item.to}-${index}`);
30410
30522
  });
30411
30523
  }
30412
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: `
30413
- /* Classic dark chrome — override kumo tokens within the sidebar */
30414
- .emdash-sidebar {
30415
- --color-kumo-base: #1d2327;
30416
- /* Kumo 2.4 paints the surface via bg-(--sidebar-bg) on an inner
30417
- container, resolved from the wrapper's light --color-kumo-base. */
30418
- --sidebar-bg: #1d2327;
30419
- --color-kumo-tint: rgba(255,255,255,0.1);
30420
- --color-kumo-line: rgba(255,255,255,0.08);
30421
- --color-kumo-brand: #2271b1;
30422
- --text-color-kumo-default: #fff;
30423
- --text-color-kumo-subtle: rgba(255,255,255,0.7);
30424
- --text-color-kumo-strong: #fff;
30425
- background-color: #1d2327 !important;
30426
- color: #fff !important;
30427
- border-color: rgba(255,255,255,0.08) !important;
30428
- }
30429
- /* Group labels — uppercase muted style */
30430
- .emdash-sidebar [data-sidebar="group-label"] {
30431
- color: rgba(255,255,255,0.45) !important;
30432
- font-size: 11px !important;
30433
- text-transform: uppercase;
30434
- letter-spacing: 0.06em;
30435
- font-weight: 600;
30436
- padding-left: 0.75rem;
30437
- padding-right: 0.75rem;
30438
- }
30439
- .emdash-sidebar [data-sidebar="group-label"] svg {
30440
- color: rgba(255,255,255,0.3);
30441
- }
30442
- .emdash-sidebar [data-sidebar="group-label"]:hover svg {
30443
- color: rgba(255,255,255,0.6);
30444
- }
30445
- /* Separators */
30446
- .emdash-sidebar [data-sidebar="separator"] {
30447
- border-color: rgba(255,255,255,0.06) !important;
30448
- margin: 0.5rem 0.75rem;
30449
- }
30450
- /* Header/footer borders */
30451
- .emdash-sidebar [data-sidebar="header"] {
30452
- border-bottom: 1px solid rgba(255,255,255,0.08);
30453
- }
30454
- .emdash-sidebar [data-sidebar="footer"] {
30455
- border-top: 1px solid rgba(255,255,255,0.08);
30456
- }
30457
-
30458
- /* Collapsed separators — thin centered line */
30459
- .emdash-sidebar[data-state="collapsed"] [data-sidebar="separator"] {
30460
- margin: 0.375rem 0.625rem;
30461
- }
30462
- /* Collapsed: tighten group spacing */
30463
- .emdash-sidebar[data-state="collapsed"] [data-sidebar="group"] {
30464
- gap: 0.125rem;
30465
- }
30466
- .emdash-sidebar[data-state="collapsed"] [data-sidebar="menu"] {
30467
- gap: 0.125rem;
30468
- }
30469
-
30470
- /* Collapsed: nav links — center icon, hide text */
30471
- .emdash-sidebar[data-state="collapsed"] .emdash-nav-link {
30472
- justify-content: center;
30473
- padding: 0.5rem 0;
30474
- gap: 0;
30475
- min-height: 36px;
30476
- }
30477
- .emdash-sidebar[data-state="collapsed"] .emdash-nav-label {
30478
- display: none !important;
30479
- }
30480
- /* Collapsed: brand link */
30481
- .emdash-sidebar[data-state="collapsed"] .emdash-brand-link {
30482
- justify-content: center;
30483
- padding-left: 0;
30484
- padding-right: 0;
30485
- }
30486
- .emdash-sidebar[data-state="collapsed"] .emdash-brand-text {
30487
- display: none !important;
30488
- }
30489
-
30490
- /* Mobile drawer slide animation from left (LTR) */
30491
- [data-starting-style]:has(> .emdash-sidebar[data-mobile="true"]),
30492
- [data-ending-style]:has(> .emdash-sidebar[data-mobile="true"]) {
30493
- transform: translateX(-100%);
30494
- }
30495
-
30496
- /* Mobile drawer slide animation from right (RTL) */
30497
- [dir="rtl"] [data-starting-style]:has(> .emdash-sidebar[data-mobile="true"]),
30498
- [dir="rtl"] [data-ending-style]:has(> .emdash-sidebar[data-mobile="true"]) {
30499
- transform: translateX(100%);
30500
- --tw-translate-x: 100%;
30501
- }
30502
-
30503
- /* RTL: Position drawer on right side */
30504
- [dir="rtl"] :has(> .emdash-sidebar[data-mobile="true"]) {
30505
- left: auto;
30506
- right: 0;
30507
- }
30508
- ` } }), /* @__PURE__ */ jsxs(KumoSidebar, {
30524
+ return /* @__PURE__ */ jsxs(KumoSidebar, {
30509
30525
  className: "emdash-sidebar",
30510
30526
  "aria-label": _t({
30511
30527
  id: "M0SYyg",
@@ -30514,63 +30530,51 @@ function SidebarNav({ manifest }) {
30514
30530
  children: [
30515
30531
  /* @__PURE__ */ jsx(KumoSidebar.Header, { children: /* @__PURE__ */ jsxs(Link$1, {
30516
30532
  to: "/",
30517
- className: "emdash-brand-link flex w-full min-w-0 items-center gap-2 px-3 py-1",
30533
+ className: "flex w-full min-w-0 items-center gap-2 px-3 py-1 group-data-[state=collapsed]/sidebar:justify-center group-data-[state=collapsed]/sidebar:px-0",
30518
30534
  children: [/* @__PURE__ */ jsx(BrandIcon, {
30519
30535
  logoUrl: manifest.admin?.logo,
30520
30536
  siteName: manifest.admin?.siteName,
30521
30537
  className: "size-5 shrink-0",
30522
30538
  "aria-hidden": "true"
30523
30539
  }), /* @__PURE__ */ jsx("span", {
30524
- className: "emdash-brand-text font-semibold truncate",
30540
+ className: "font-semibold truncate group-data-[state=collapsed]/sidebar:hidden",
30525
30541
  children: manifest.admin?.siteName || "EmDash"
30526
30542
  })]
30527
30543
  }) }),
30528
30544
  /* @__PURE__ */ jsxs(KumoSidebar.Content, { children: [
30529
- /* @__PURE__ */ jsx(KumoSidebar.Group, { children: /* @__PURE__ */ jsx(KumoSidebar.Menu, { children: /* @__PURE__ */ jsx(NavMenuLink, {
30530
- item: {
30531
- to: "/",
30532
- label: _t({
30533
- id: "7p5kLi",
30534
- message: "Dashboard"
30535
- }),
30536
- icon: SquaresFour
30537
- },
30538
- isActive: isItemActive("/", currentPath)
30539
- }) }) }),
30540
- /* @__PURE__ */ jsx(KumoSidebar.Separator, {}),
30541
- visibleContent.length > 1 && /* @__PURE__ */ jsxs(KumoSidebar.Group, { children: [/* @__PURE__ */ jsx(KumoSidebar.GroupLabel, {
30542
- className: "[&>span]:text-start [&_svg]:rtl:-scale-x-100 [&_svg]:rtl:-scale-y-100",
30543
- children: _t({
30544
- id: "4b3oEV",
30545
- message: "Content"
30546
- })
30547
- }), /* @__PURE__ */ jsx(KumoSidebar.Menu, { children: renderNavItems(visibleContent.filter((i) => i.to !== "/")) })] }),
30548
- /* @__PURE__ */ jsx(KumoSidebar.Separator, {}),
30549
- visibleManage.length > 0 && /* @__PURE__ */ jsxs(KumoSidebar.Group, { children: [/* @__PURE__ */ jsx(KumoSidebar.GroupLabel, {
30550
- className: "[&>span]:text-start [&_svg]:rtl:-scale-x-100 [&_svg]:rtl:-scale-y-100",
30551
- children: _t({
30552
- id: "wckWOP",
30553
- message: "Manage"
30554
- })
30555
- }), /* @__PURE__ */ jsx(KumoSidebar.Menu, { children: renderNavItems(visibleManage) })] }),
30556
- /* @__PURE__ */ jsx(KumoSidebar.Separator, {}),
30557
- visibleAdmin.length > 0 && /* @__PURE__ */ jsxs(KumoSidebar.Group, { children: [/* @__PURE__ */ jsx(KumoSidebar.GroupLabel, {
30558
- className: "[&>span]:text-start [&_svg]:rtl:-scale-x-100 [&_svg]:rtl:-scale-y-100",
30559
- children: _t({
30560
- id: "U3pytU",
30561
- message: "Admin"
30562
- })
30563
- }), /* @__PURE__ */ jsx(KumoSidebar.Menu, { children: renderNavItems(visibleAdmin) })] }),
30564
- visiblePlugins.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(KumoSidebar.Separator, {}), /* @__PURE__ */ jsxs(KumoSidebar.Group, { children: [/* @__PURE__ */ jsx(KumoSidebar.GroupLabel, {
30565
- className: "[&>span]:text-start [&_svg]:rtl:-scale-x-100 [&_svg]:rtl:-scale-y-100",
30566
- children: _t({
30567
- id: "ohUJJM",
30568
- message: "Plugins"
30569
- })
30570
- }), /* @__PURE__ */ jsx(KumoSidebar.Menu, { children: renderNavItems(visiblePlugins) })] })] })
30545
+ /* @__PURE__ */ jsx(KumoSidebar.Group, {
30546
+ className: "mt-2 md:mt-1.5",
30547
+ children: /* @__PURE__ */ jsx(KumoSidebar.Menu, { children: /* @__PURE__ */ jsx(NavMenuLink, {
30548
+ item: {
30549
+ to: "/",
30550
+ label: _t({
30551
+ id: "7p5kLi",
30552
+ message: "Dashboard"
30553
+ }),
30554
+ icon: SquaresFour
30555
+ },
30556
+ isActive: isItemActive("/", currentPath)
30557
+ }) })
30558
+ }),
30559
+ visibleContent.length > 1 && /* @__PURE__ */ jsxs(KumoSidebar.Group, { children: [/* @__PURE__ */ jsx(KumoSidebar.GroupLabel, { children: _t({
30560
+ id: "4b3oEV",
30561
+ message: "Content"
30562
+ }) }), /* @__PURE__ */ jsx(KumoSidebar.Menu, { children: renderNavItems(visibleContent.filter((i) => i.to !== "/")) })] }),
30563
+ visibleManage.length > 0 && /* @__PURE__ */ jsxs(KumoSidebar.Group, { children: [/* @__PURE__ */ jsx(KumoSidebar.GroupLabel, { children: _t({
30564
+ id: "wckWOP",
30565
+ message: "Manage"
30566
+ }) }), /* @__PURE__ */ jsx(KumoSidebar.Menu, { children: renderNavItems(visibleManage) })] }),
30567
+ visibleAdmin.length > 0 && /* @__PURE__ */ jsxs(KumoSidebar.Group, { children: [/* @__PURE__ */ jsx(KumoSidebar.GroupLabel, { children: _t({
30568
+ id: "U3pytU",
30569
+ message: "Admin"
30570
+ }) }), /* @__PURE__ */ jsx(KumoSidebar.Menu, { children: renderNavItems(visibleAdmin) })] }),
30571
+ visiblePlugins.length > 0 && /* @__PURE__ */ jsxs(KumoSidebar.Group, { children: [/* @__PURE__ */ jsx(KumoSidebar.GroupLabel, { children: _t({
30572
+ id: "ohUJJM",
30573
+ message: "Plugins"
30574
+ }) }), /* @__PURE__ */ jsx(KumoSidebar.Menu, { children: renderNavItems(visiblePlugins) })] })
30571
30575
  ] }),
30572
30576
  /* @__PURE__ */ jsx(KumoSidebar.Footer, { children: /* @__PURE__ */ jsxs("p", {
30573
- className: "emdash-nav-label px-3 py-2 text-[11px] text-white/30",
30577
+ className: "px-3 py-2 text-[11px] text-kumo-subtle group-data-[state=collapsed]/sidebar:hidden",
30574
30578
  children: [
30575
30579
  manifest.admin?.siteName || "EmDash CMS",
30576
30580
  " v",
@@ -30579,7 +30583,7 @@ function SidebarNav({ manifest }) {
30579
30583
  ]
30580
30584
  }) })
30581
30585
  ]
30582
- })] });
30586
+ });
30583
30587
  }
30584
30588
 
30585
30589
  //#endregion
@@ -30665,7 +30669,7 @@ function Header() {
30665
30669
  });
30666
30670
  const initials = ((user?.name || user?.email || "U")[0] ?? "U").toUpperCase();
30667
30671
  return /* @__PURE__ */ jsxs("header", {
30668
- className: "sticky top-0 z-10 flex h-16 items-center justify-between border-b bg-kumo-base px-4",
30672
+ className: "sticky top-0 z-10 flex h-[58px] items-center justify-between border-b bg-kumo-elevated px-4",
30669
30673
  children: [/* @__PURE__ */ jsx(KumoSidebar.Trigger, { className: "cursor-pointer rtl:rotate-180" }), /* @__PURE__ */ jsxs("div", {
30670
30674
  className: "flex items-center gap-2",
30671
30675
  children: [
@@ -30965,16 +30969,19 @@ function WelcomeModal({ open, onClose, userName, userRole }) {
30965
30969
  function Shell({ children, manifest }) {
30966
30970
  const [welcomeModalOpen, setWelcomeModalOpen] = React$1.useState(false);
30967
30971
  const { data: user } = useCurrentUser();
30972
+ const { locale } = useLocale();
30973
+ const sidebarSide = getLocaleDir(locale) === "rtl" ? "right" : "left";
30968
30974
  React$1.useEffect(() => {
30969
30975
  if (user?.isFirstLogin) setWelcomeModalOpen(true);
30970
30976
  }, [user?.isFirstLogin]);
30971
30977
  return /* @__PURE__ */ jsxs(KumoSidebar.Provider, {
30972
30978
  defaultOpen: true,
30979
+ side: sidebarSide,
30973
30980
  style: {
30981
+ "--sidebar-bg": "var(--color-kumo-elevated)",
30974
30982
  height: "100svh",
30975
30983
  minHeight: "0",
30976
- overflow: "hidden",
30977
- "--sidebar-width-icon": "53px"
30984
+ overflow: "hidden"
30978
30985
  },
30979
30986
  children: [
30980
30987
  /* @__PURE__ */ jsx(SidebarNav, { manifest }),
@@ -39818,8 +39825,7 @@ function ContentEditPage() {
39818
39825
  queryClient.invalidateQueries({ queryKey: [
39819
39826
  "content",
39820
39827
  collection,
39821
- id,
39822
- { locale: rawItem?.locale ?? activeLocale }
39828
+ id
39823
39829
  ] });
39824
39830
  queryClient.invalidateQueries({ queryKey: [
39825
39831
  "revisions",
@@ -39881,8 +39887,7 @@ function ContentEditPage() {
39881
39887
  queryClient.invalidateQueries({ queryKey: [
39882
39888
  "content",
39883
39889
  collection,
39884
- id,
39885
- { locale: rawItem?.locale ?? activeLocale }
39890
+ id
39886
39891
  ] });
39887
39892
  queryClient.invalidateQueries({ queryKey: [
39888
39893
  "revisions",
@@ -39920,8 +39925,7 @@ function ContentEditPage() {
39920
39925
  queryClient.invalidateQueries({ queryKey: [
39921
39926
  "content",
39922
39927
  collection,
39923
- id,
39924
- { locale: rawItem?.locale ?? activeLocale }
39928
+ id
39925
39929
  ] });
39926
39930
  queryClient.invalidateQueries({ queryKey: [
39927
39931
  "revisions",
@@ -39959,8 +39963,7 @@ function ContentEditPage() {
39959
39963
  queryClient.invalidateQueries({ queryKey: [
39960
39964
  "content",
39961
39965
  collection,
39962
- id,
39963
- { locale: rawItem?.locale ?? activeLocale }
39966
+ id
39964
39967
  ] });
39965
39968
  queryClient.invalidateQueries({ queryKey: [
39966
39969
  "revisions",
@@ -39998,8 +40001,7 @@ function ContentEditPage() {
39998
40001
  queryClient.invalidateQueries({ queryKey: [
39999
40002
  "content",
40000
40003
  collection,
40001
- id,
40002
- { locale: rawItem?.locale ?? activeLocale }
40004
+ id
40003
40005
  ] });
40004
40006
  toastManager.add({
40005
40007
  title: _t3({
@@ -40032,8 +40034,7 @@ function ContentEditPage() {
40032
40034
  queryClient.invalidateQueries({ queryKey: [
40033
40035
  "content",
40034
40036
  collection,
40035
- id,
40036
- { locale: rawItem?.locale ?? activeLocale }
40037
+ id
40037
40038
  ] });
40038
40039
  toastManager.add({
40039
40040
  title: _t3({
@@ -40971,6 +40972,44 @@ const queryClient = new QueryClient({ defaultOptions: { queries: {
40971
40972
  retry: 1
40972
40973
  } } });
40973
40974
  const router = createAdminRouter(queryClient);
40975
+ const ADMIN_BASEPATH = "/_emdash/admin";
40976
+ function normalizeAdminHref(href) {
40977
+ if (href === ADMIN_BASEPATH) return "/";
40978
+ if (href.startsWith(`${ADMIN_BASEPATH}/`)) return href.slice(14);
40979
+ if (href.startsWith(`${ADMIN_BASEPATH}?`) || href.startsWith(`${ADMIN_BASEPATH}#`)) return `/${href.slice(14)}`;
40980
+ return href;
40981
+ }
40982
+ function getAnchorHref(destination, routerDestination) {
40983
+ if (routerDestination.startsWith("/") && !routerDestination.startsWith("//")) {
40984
+ if (routerDestination === "/" || routerDestination.startsWith("/?") || routerDestination.startsWith("/#")) return `${ADMIN_BASEPATH}${routerDestination.slice(1)}`;
40985
+ return `${ADMIN_BASEPATH}${routerDestination}`;
40986
+ }
40987
+ return destination;
40988
+ }
40989
+ const KumoRouterLink = React$1.forwardRef(({ href, to, target, download, children, ...props }, ref) => {
40990
+ const destination = href ?? to ?? "";
40991
+ const hasSearchOrHash = destination.includes("?") || destination.includes("#");
40992
+ const routerDestination = normalizeAdminHref(destination);
40993
+ const shouldUseAnchor = !(routerDestination.startsWith("/") && !routerDestination.startsWith("//")) || hasSearchOrHash || target || download != null;
40994
+ const linkProps = props;
40995
+ const ariaCurrent = linkProps["aria-current"] ?? (linkProps["data-active"] ? "page" : void 0);
40996
+ if (shouldUseAnchor) return /* @__PURE__ */ jsx("a", {
40997
+ ref,
40998
+ href: hasSearchOrHash && !target && download == null ? getAnchorHref(destination, routerDestination) : destination,
40999
+ target,
41000
+ download,
41001
+ ...props,
41002
+ children
41003
+ });
41004
+ return /* @__PURE__ */ jsx(Link$1, {
41005
+ ...props,
41006
+ ref,
41007
+ to: routerDestination,
41008
+ "aria-current": ariaCurrent,
41009
+ children
41010
+ });
41011
+ });
41012
+ KumoRouterLink.displayName = "KumoRouterLink";
40974
41013
  /**
40975
41014
  * Main Admin Application
40976
41015
  */
@@ -40996,7 +41035,10 @@ function AdminApp({ pluginAdmins = EMPTY_PLUGINS, authProviders = EMPTY_AUTH_PRO
40996
41035
  pluginAdmins,
40997
41036
  children: /* @__PURE__ */ jsx(QueryClientProvider, {
40998
41037
  client: queryClient,
40999
- children: /* @__PURE__ */ jsx(RouterProvider, { router })
41038
+ children: /* @__PURE__ */ jsx(LinkProvider, {
41039
+ component: KumoRouterLink,
41040
+ children: /* @__PURE__ */ jsx(RouterProvider, { router })
41041
+ })
41000
41042
  })
41001
41043
  })
41002
41044
  }) }) })