@dxos/react-ui-editor 0.4.9-main.2d20855 → 0.4.9-main.76223f7
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/dist/lib/browser/index.mjs +40 -33
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/TextEditor/TextEditor.stories.d.ts +0 -3
- package/dist/types/src/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +0 -3
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts +0 -3
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useTextEditor.stories.d.ts +0 -3
- package/dist/types/src/hooks/useTextEditor.stories.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +24 -24
- package/src/components/Toolbar/Toolbar.stories.tsx +1 -0
- package/src/components/Toolbar/Toolbar.tsx +32 -38
- package/src/translations.ts +0 -3
|
@@ -17,10 +17,7 @@ var translations_default = [
|
|
|
17
17
|
"comment label": "Create comment",
|
|
18
18
|
"image label": "Insert image",
|
|
19
19
|
"heading label": "Heading level",
|
|
20
|
-
"table label": "Create table"
|
|
21
|
-
"heading level label_zero": "Paragraph",
|
|
22
|
-
"heading level label_one": "Heading level {{count}}",
|
|
23
|
-
"heading level label_other": "Heading level {{count}}"
|
|
20
|
+
"table label": "Create table"
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
23
|
}
|
|
@@ -4488,11 +4485,11 @@ var TextEditor = /* @__PURE__ */ forwardRef(({ id, doc, selection, extensions, c
|
|
|
4488
4485
|
});
|
|
4489
4486
|
|
|
4490
4487
|
// packages/ui/react-ui-editor/src/components/Toolbar/Toolbar.tsx
|
|
4491
|
-
import { ChatText, Code, CodeBlock, Image, Link, ListBullets, ListChecks, ListNumbers, Paragraph, Quotes, TextStrikethrough, Table as Table2, TextB, TextHOne, TextHTwo, TextHThree, TextHFour, TextHFive, TextHSix, TextItalic
|
|
4488
|
+
import { ChatText, Code, CodeBlock, Image, Link, ListBullets, ListChecks, ListNumbers, Paragraph, Quotes, TextStrikethrough, Table as Table2, TextB, TextHOne, TextHTwo, TextHThree, TextHFour, TextHFive, TextHSix, TextItalic } from "@phosphor-icons/react";
|
|
4492
4489
|
import { createContext } from "@radix-ui/react-context";
|
|
4493
4490
|
import React2, { useEffect as useEffect3, useRef as useRef2, useState as useState3 } from "react";
|
|
4494
4491
|
import { useDropzone } from "react-dropzone";
|
|
4495
|
-
import { DensityProvider, ElevationProvider, Toolbar as NaturalToolbar, Tooltip, useTranslation
|
|
4492
|
+
import { DensityProvider, ElevationProvider, Select, Toolbar as NaturalToolbar, Tooltip, useTranslation } from "@dxos/react-ui";
|
|
4496
4493
|
import { getSize } from "@dxos/react-ui-theme";
|
|
4497
4494
|
var tooltipProps = {
|
|
4498
4495
|
side: "top",
|
|
@@ -4575,48 +4572,58 @@ var MarkdownHeading = () => {
|
|
|
4575
4572
|
return setTooltipOpen(nextOpen);
|
|
4576
4573
|
}
|
|
4577
4574
|
}
|
|
4578
|
-
}, /* @__PURE__ */ React2.createElement(
|
|
4575
|
+
}, /* @__PURE__ */ React2.createElement(Select.Root, {
|
|
4576
|
+
disabled: value === null,
|
|
4577
|
+
value: value ?? "0",
|
|
4579
4578
|
open: selectOpen,
|
|
4580
4579
|
onOpenChange: (nextOpen) => {
|
|
4581
4580
|
if (!nextOpen) {
|
|
4582
4581
|
suppressNextTooltip.current = true;
|
|
4583
4582
|
}
|
|
4584
4583
|
return setSelectOpen(nextOpen);
|
|
4585
|
-
}
|
|
4584
|
+
},
|
|
4585
|
+
onValueChange: (value2) => onAction?.({
|
|
4586
|
+
type: "heading",
|
|
4587
|
+
data: parseInt(value2)
|
|
4588
|
+
})
|
|
4586
4589
|
}, /* @__PURE__ */ React2.createElement(Tooltip.Trigger, {
|
|
4587
4590
|
asChild: true
|
|
4588
4591
|
}, /* @__PURE__ */ React2.createElement(NaturalToolbar.Button, {
|
|
4589
4592
|
asChild: true
|
|
4590
|
-
}, /* @__PURE__ */ React2.createElement(
|
|
4591
|
-
asChild: true
|
|
4592
|
-
}, /* @__PURE__ */ React2.createElement(Button, {
|
|
4593
|
+
}, /* @__PURE__ */ React2.createElement(Select.TriggerButton, {
|
|
4593
4594
|
variant: "ghost",
|
|
4594
|
-
classNames: buttonStyles
|
|
4595
|
-
disabled: value === null
|
|
4595
|
+
classNames: buttonStyles
|
|
4596
4596
|
}, /* @__PURE__ */ React2.createElement("span", {
|
|
4597
4597
|
className: "sr-only"
|
|
4598
4598
|
}, t("heading label")), /* @__PURE__ */ React2.createElement(HeadingIcon, {
|
|
4599
4599
|
className: iconStyles
|
|
4600
|
-
}), /* @__PURE__ */ React2.createElement(
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4600
|
+
})))), /* @__PURE__ */ React2.createElement(Select.Portal, null, /* @__PURE__ */ React2.createElement(Select.Content, null, /* @__PURE__ */ React2.createElement(Select.ScrollUpButton, null), /* @__PURE__ */ React2.createElement(Select.Viewport, null, /* @__PURE__ */ React2.createElement(Select.Option, {
|
|
4601
|
+
value: "0"
|
|
4602
|
+
}, /* @__PURE__ */ React2.createElement(Paragraph, {
|
|
4603
|
+
className: iconStyles
|
|
4604
|
+
})), [
|
|
4605
|
+
1,
|
|
4606
|
+
2,
|
|
4607
|
+
3,
|
|
4608
|
+
4,
|
|
4609
|
+
5,
|
|
4610
|
+
6
|
|
4611
|
+
].map((level) => /* @__PURE__ */ React2.createElement(Select.Option, {
|
|
4612
|
+
key: level,
|
|
4613
|
+
value: String(level)
|
|
4614
|
+
}, level === 1 && /* @__PURE__ */ React2.createElement(TextHOne, {
|
|
4615
|
+
className: iconStyles
|
|
4616
|
+
}), level === 2 && /* @__PURE__ */ React2.createElement(TextHTwo, {
|
|
4617
|
+
className: iconStyles
|
|
4618
|
+
}), level === 3 && /* @__PURE__ */ React2.createElement(TextHThree, {
|
|
4619
|
+
className: iconStyles
|
|
4620
|
+
}), level === 4 && /* @__PURE__ */ React2.createElement(TextHFour, {
|
|
4621
|
+
className: iconStyles
|
|
4622
|
+
}), level === 5 && /* @__PURE__ */ React2.createElement(TextHFive, {
|
|
4623
|
+
className: iconStyles
|
|
4624
|
+
}), level === 6 && /* @__PURE__ */ React2.createElement(TextHSix, {
|
|
4625
|
+
className: iconStyles
|
|
4626
|
+
})))), /* @__PURE__ */ React2.createElement(Select.ScrollDownButton, null), /* @__PURE__ */ React2.createElement(Select.Arrow, null)))), /* @__PURE__ */ React2.createElement(Tooltip.Portal, null, /* @__PURE__ */ React2.createElement(Tooltip.Content, tooltipProps, t("heading label"), /* @__PURE__ */ React2.createElement(Tooltip.Arrow, null))));
|
|
4620
4627
|
};
|
|
4621
4628
|
var markdownStyles = [
|
|
4622
4629
|
{
|