@dxos/react-ui-editor 0.6.4 → 0.6.5-staging.42fccfe

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.
@@ -2267,6 +2267,7 @@ var defaultTheme = {
2267
2267
 
2268
2268
  // packages/ui/react-ui-editor/src/extensions/factories.ts
2269
2269
  var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/extensions/factories.ts";
2270
+ var preventNewline = EditorState.transactionFilter.of((tr) => tr.newDoc.lines > 1 ? [] : tr);
2270
2271
  var defaultBasicOptions = {
2271
2272
  allowMultipleSelections: true,
2272
2273
  bracketMatching: true,
@@ -2291,7 +2292,7 @@ var createBasicExtensions = (_props) => {
2291
2292
  EditorView9.exceptionSink.of((err) => {
2292
2293
  log5.catch(err, void 0, {
2293
2294
  F: __dxlog_file8,
2294
- L: 90,
2295
+ L: 92,
2295
2296
  S: void 0,
2296
2297
  C: (f, a) => f(...a)
2297
2298
  });
@@ -3753,8 +3754,10 @@ var createUrlLink = (url) => {
3753
3754
  return `[${displayUrl}](${url})`;
3754
3755
  };
3755
3756
  var formatUrlForDisplay = (url) => {
3756
- const withoutProtocol = url.replace(/^https?:\/\//, "");
3757
- return truncateQueryParams(withoutProtocol);
3757
+ let formattedUrl = url.replace(/^https?:\/\//, "");
3758
+ formattedUrl = formattedUrl.replace(/^www\./, "");
3759
+ formattedUrl = formattedUrl.replace(/\.com\/$/, ".com");
3760
+ return truncateQueryParams(formattedUrl);
3758
3761
  };
3759
3762
  var truncateQueryParams = (url, maxQueryLength = 15) => {
3760
3763
  const [urlBase, queryString] = url.split("?");
@@ -4757,21 +4760,18 @@ import { ChatText, Code, CodeBlock, Image, Link, ListBullets, ListChecks, ListNu
4757
4760
  import { createContext } from "@radix-ui/react-context";
4758
4761
  import React2, { useEffect as useEffect3, useRef as useRef2, useState as useState4 } from "react";
4759
4762
  import { useDropzone } from "react-dropzone";
4760
- import { DensityProvider, ElevationProvider, Toolbar as NaturalToolbar, Tooltip, useTranslation, DropdownMenu, Button } from "@dxos/react-ui";
4763
+ import { Button, DensityProvider, DropdownMenu, ElevationProvider, Toolbar as NaturalToolbar, Tooltip, useTranslation } from "@dxos/react-ui";
4761
4764
  import { getSize } from "@dxos/react-ui-theme";
4765
+ var iconStyles = getSize(5);
4766
+ var buttonStyles = "min-bs-0 p-2";
4762
4767
  var tooltipProps = {
4763
4768
  side: "top",
4764
4769
  classNames: "z-10"
4765
4770
  };
4766
- var HeadingIcons = {
4767
- "0": Paragraph,
4768
- "1": TextHOne,
4769
- "2": TextHTwo,
4770
- "3": TextHThree,
4771
- "4": TextHFour,
4772
- "5": TextHFive,
4773
- "6": TextHSix
4774
- };
4771
+ var ToolbarSeparator = () => /* @__PURE__ */ React2.createElement("div", {
4772
+ role: "separator",
4773
+ className: "grow"
4774
+ });
4775
4775
  var [ToolbarContextProvider, useToolbarContext] = createContext("Toolbar");
4776
4776
  var ToolbarRoot = ({ children, onAction, classNames, state: state2 }) => {
4777
4777
  return /* @__PURE__ */ React2.createElement(ToolbarContextProvider, {
@@ -4788,8 +4788,6 @@ var ToolbarRoot = ({ children, onAction, classNames, state: state2 }) => {
4788
4788
  ]
4789
4789
  }, children))));
4790
4790
  };
4791
- var buttonStyles = "min-bs-0 p-2";
4792
- var iconStyles = getSize(5);
4793
4791
  var ToolbarToggleButton = ({ Icon, children, ...props }) => {
4794
4792
  return /* @__PURE__ */ React2.createElement(Tooltip.Root, null, /* @__PURE__ */ React2.createElement(Tooltip.Trigger, {
4795
4793
  asChild: true
@@ -4816,10 +4814,15 @@ var ToolbarButton = ({ Icon, children, ...props }) => {
4816
4814
  className: "sr-only"
4817
4815
  }, children))), /* @__PURE__ */ React2.createElement(Tooltip.Portal, null, /* @__PURE__ */ React2.createElement(Tooltip.Content, tooltipProps, children, /* @__PURE__ */ React2.createElement(Tooltip.Arrow, null))));
4818
4816
  };
4819
- var ToolbarSeparator = () => /* @__PURE__ */ React2.createElement("div", {
4820
- role: "separator",
4821
- className: "grow"
4822
- });
4817
+ var HeadingIcons = {
4818
+ "0": Paragraph,
4819
+ "1": TextHOne,
4820
+ "2": TextHTwo,
4821
+ "3": TextHThree,
4822
+ "4": TextHFour,
4823
+ "5": TextHFive,
4824
+ "6": TextHSix
4825
+ };
4823
4826
  var MarkdownHeading = () => {
4824
4827
  const { t } = useTranslation(translationKey);
4825
4828
  const { onAction, state: state2 } = useToolbarContext("MarkdownFormatting");
@@ -5041,7 +5044,7 @@ var MarkdownCustom = ({ onUpload } = {}) => {
5041
5044
  }, t("image label")));
5042
5045
  };
5043
5046
  var MarkdownActions = () => {
5044
- const { onAction, state: state2 } = useToolbarContext("MarkdownStyles");
5047
+ const { onAction, state: state2 } = useToolbarContext("MarkdownActions");
5045
5048
  const { t } = useTranslation(translationKey);
5046
5049
  return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(ToolbarButton, {
5047
5050
  value: "comment",
@@ -5248,6 +5251,7 @@ export {
5248
5251
  markdownTags,
5249
5252
  markdownTagsExtensions,
5250
5253
  mention,
5254
+ preventNewline,
5251
5255
  processAction,
5252
5256
  removeBlockquote,
5253
5257
  removeCodeblock,