@namroodinc/liquid-editorial 0.1.0 → 0.1.2

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 (72) hide show
  1. package/README.md +62 -1
  2. package/dist/chunks/EntryEditor-BF808OZR.js +181 -0
  3. package/dist/chunks/EntryEditor-BF808OZR.js.map +1 -0
  4. package/dist/chunks/EntryEditor-cjDk4vdH.cjs +2 -0
  5. package/dist/chunks/EntryEditor-cjDk4vdH.cjs.map +1 -0
  6. package/dist/chunks/RichTextEditor-DRt-kibg.js +248 -0
  7. package/dist/chunks/RichTextEditor-DRt-kibg.js.map +1 -0
  8. package/dist/chunks/RichTextEditor-tFkISOvq.cjs +2 -0
  9. package/dist/chunks/RichTextEditor-tFkISOvq.cjs.map +1 -0
  10. package/dist/components/EntryEditor/index.cjs +1 -0
  11. package/dist/components/EntryEditor/index.d.cts +21 -0
  12. package/dist/components/EntryEditor/index.d.cts.map +1 -0
  13. package/dist/components/EntryEditor/index.d.ts +21 -0
  14. package/dist/components/EntryEditor/index.d.ts.map +1 -0
  15. package/dist/components/EntryEditor/index.js +6 -0
  16. package/dist/components/EntryEditor/model.d.cts +33 -0
  17. package/dist/components/EntryEditor/model.d.cts.map +1 -0
  18. package/dist/components/EntryEditor/model.d.ts +33 -0
  19. package/dist/components/EntryEditor/model.d.ts.map +1 -0
  20. package/dist/components/EntryEditor/style.css +8 -0
  21. package/dist/components/EntryPicker/index.cjs +1 -1
  22. package/dist/components/EntryPicker/index.cjs.map +1 -1
  23. package/dist/components/EntryPicker/index.d.cts.map +1 -1
  24. package/dist/components/EntryPicker/index.d.ts.map +1 -1
  25. package/dist/components/EntryPicker/index.js +15 -12
  26. package/dist/components/EntryPicker/index.js.map +1 -1
  27. package/dist/components/Field/index.cjs +1 -1
  28. package/dist/components/Field/index.cjs.map +1 -1
  29. package/dist/components/Field/index.d.cts +4 -1
  30. package/dist/components/Field/index.d.cts.map +1 -1
  31. package/dist/components/Field/index.d.ts +4 -1
  32. package/dist/components/Field/index.d.ts.map +1 -1
  33. package/dist/components/Field/index.js +29 -23
  34. package/dist/components/Field/index.js.map +1 -1
  35. package/dist/components/Field/style.css +12 -0
  36. package/dist/components/Modal/style.css +1 -0
  37. package/dist/components/NumberField/index.cjs +1 -1
  38. package/dist/components/NumberField/index.cjs.map +1 -1
  39. package/dist/components/NumberField/index.d.cts +1 -1
  40. package/dist/components/NumberField/index.d.cts.map +1 -1
  41. package/dist/components/NumberField/index.d.ts +1 -1
  42. package/dist/components/NumberField/index.d.ts.map +1 -1
  43. package/dist/components/NumberField/index.js +1 -1
  44. package/dist/components/NumberField/index.js.map +1 -1
  45. package/dist/components/RichTextEditor/document.d.cts +10 -0
  46. package/dist/components/RichTextEditor/document.d.cts.map +1 -0
  47. package/dist/components/RichTextEditor/document.d.ts +10 -0
  48. package/dist/components/RichTextEditor/document.d.ts.map +1 -0
  49. package/dist/components/RichTextEditor/index.cjs +1 -2
  50. package/dist/components/RichTextEditor/index.d.cts +21 -6
  51. package/dist/components/RichTextEditor/index.d.cts.map +1 -1
  52. package/dist/components/RichTextEditor/index.d.ts +21 -6
  53. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  54. package/dist/components/RichTextEditor/index.js +1 -175
  55. package/dist/components/SortableList/index.cjs +1 -1
  56. package/dist/components/SortableList/index.cjs.map +1 -1
  57. package/dist/components/SortableList/index.d.cts +4 -3
  58. package/dist/components/SortableList/index.d.cts.map +1 -1
  59. package/dist/components/SortableList/index.d.ts +4 -3
  60. package/dist/components/SortableList/index.d.ts.map +1 -1
  61. package/dist/components/SortableList/index.js +55 -48
  62. package/dist/components/SortableList/index.js.map +1 -1
  63. package/dist/index.cjs +1 -1
  64. package/dist/index.d.cts +3 -1
  65. package/dist/index.d.cts.map +1 -1
  66. package/dist/index.d.ts +3 -1
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +36 -35
  69. package/dist/styles.css +1 -0
  70. package/package.json +37 -11
  71. package/dist/components/RichTextEditor/index.cjs.map +0 -1
  72. package/dist/components/RichTextEditor/index.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,38 +1,39 @@
1
1
  import { n as e, r as t, t as n } from "./chunks/Icon-CGY1FNXT.js";
2
2
  import { Button as r } from "./components/Button/index.js";
3
3
  import { ButtonGroup as i } from "./components/ButtonGroup/index.js";
4
- import { RichTextEditor as a } from "./components/RichTextEditor/index.js";
5
- import { Board as o, BoardCard as s, BoardColumn as c } from "./components/Board/index.js";
6
- import { SortableList as l, SortableListItem as u } from "./components/SortableList/index.js";
7
- import { Drawer as d } from "./components/Drawer/index.js";
8
- import { Badge as f } from "./components/Badge/index.js";
9
- import { Avatar as p, AvatarGroup as m } from "./components/Avatar/index.js";
10
- import { Field as h } from "./components/Field/index.js";
11
- import { TextArea as g, TextField as _ } from "./components/TextField/index.js";
12
- import { Grid as v, GridItem as y, Stack as b } from "./components/Grid/index.js";
13
- import { Checkbox as x, ChoiceGroup as S, Radio as C } from "./components/Choice/index.js";
14
- import { Table as w, TableBody as T, TableCell as E, TableEmpty as D, TableFrame as O, TableHead as k, TableHeaderCell as A, TableRow as j, TableToolbar as M } from "./components/Table/index.js";
15
- import { Popover as N } from "./components/Popover/index.js";
16
- import { Menu as P, MenuItem as F, MenuLabel as I, MenuSeparator as L } from "./components/Menu/index.js";
17
- import { Modal as R } from "./components/Modal/index.js";
18
- import { Toast as z, ToastProvider as B, useToast as V } from "./components/Toast/index.js";
19
- import { Skeleton as H, SkeletonText as U } from "./components/Skeleton/index.js";
20
- import { SideNav as W, SideNavFooter as G, SideNavHeader as K, SideNavItem as q, SideNavSection as J, useSideNavCollapsed as Y } from "./components/SideNav/index.js";
21
- import { TopNav as X, TopNavItem as Z } from "./components/TopNav/index.js";
22
- import { SubNav as Q, SubNavButton as $, SubNavItem as ee } from "./components/SubNav/index.js";
23
- import { CheckboxCard as te, RadioCard as ne, SelectionCardGroup as re } from "./components/SelectionCard/index.js";
24
- import { Stepper as ie } from "./components/Stepper/index.js";
25
- import { AssetGrid as ae, AssetGridEmpty as oe, AssetTile as se, AssetTileSkeleton as ce } from "./components/AssetGrid/index.js";
26
- import { ImageCropper as le, cropRatios as ue, cropToBlob as de } from "./components/ImageCropper/index.js";
27
- import { Container as fe } from "./components/Container/index.js";
28
- import { Select as pe } from "./components/Select/index.js";
29
- import { FieldAffix as me } from "./components/FieldAffix/index.js";
30
- import { NumberField as he, NumberRangeField as ge } from "./components/NumberField/index.js";
31
- import { RangeSlider as _e, Slider as ve } from "./components/Slider/index.js";
32
- import { Switch as ye } from "./components/Switch/index.js";
33
- import { SearchField as be } from "./components/SearchField/index.js";
34
- import { Calendar as xe, DateField as Se, DateRangeField as Ce, formatIsoDate as we } from "./components/DatePicker/index.js";
35
- import { TagsInput as Te } from "./components/TagsInput/index.js";
36
- import { EntryPicker as Ee } from "./components/EntryPicker/index.js";
37
- import { Time as De, formatAbsoluteDate as Oe, formatAbsoluteTime as ke, formatRelativeTime as Ae } from "./components/Time/index.js";
38
- export { ae as AssetGrid, oe as AssetGridEmpty, se as AssetTile, ce as AssetTileSkeleton, p as Avatar, m as AvatarGroup, f as Badge, o as Board, s as BoardCard, c as BoardColumn, r as Button, i as ButtonGroup, xe as Calendar, x as Checkbox, te as CheckboxCard, S as ChoiceGroup, fe as Container, Se as DateField, Ce as DateRangeField, d as Drawer, Ee as EntryPicker, h as Field, me as FieldAffix, v as Grid, y as GridItem, n as Icon, le as ImageCropper, P as Menu, F as MenuItem, I as MenuLabel, L as MenuSeparator, R as Modal, he as NumberField, ge as NumberRangeField, N as Popover, C as Radio, ne as RadioCard, _e as RangeSlider, a as RichTextEditor, be as SearchField, pe as Select, re as SelectionCardGroup, W as SideNav, G as SideNavFooter, K as SideNavHeader, q as SideNavItem, J as SideNavSection, H as Skeleton, U as SkeletonText, ve as Slider, l as SortableList, u as SortableListItem, b as Stack, ie as Stepper, Q as SubNav, $ as SubNavButton, ee as SubNavItem, ye as Switch, w as Table, T as TableBody, E as TableCell, D as TableEmpty, O as TableFrame, k as TableHead, A as TableHeaderCell, j as TableRow, M as TableToolbar, Te as TagsInput, g as TextArea, _ as TextField, De as Time, z as Toast, B as ToastProvider, X as TopNav, Z as TopNavItem, ue as cropRatios, de as cropToBlob, Oe as formatAbsoluteDate, ke as formatAbsoluteTime, we as formatIsoDate, Ae as formatRelativeTime, e as iconNames, t as icons, Y as useSideNavCollapsed, V as useToast };
4
+ import { t as a } from "./chunks/RichTextEditor-DRt-kibg.js";
5
+ import { Badge as o } from "./components/Badge/index.js";
6
+ import { Modal as s } from "./components/Modal/index.js";
7
+ import { FieldAffix as c } from "./components/FieldAffix/index.js";
8
+ import { SearchField as l } from "./components/SearchField/index.js";
9
+ import { SortableList as u, SortableListItem as d } from "./components/SortableList/index.js";
10
+ import { EntryPicker as f } from "./components/EntryPicker/index.js";
11
+ import { Field as p } from "./components/Field/index.js";
12
+ import { NumberField as m, NumberRangeField as h } from "./components/NumberField/index.js";
13
+ import { Switch as g } from "./components/Switch/index.js";
14
+ import { TextArea as _, TextField as v } from "./components/TextField/index.js";
15
+ import { n as y, t as b } from "./chunks/EntryEditor-BF808OZR.js";
16
+ import { Board as x, BoardCard as S, BoardColumn as C } from "./components/Board/index.js";
17
+ import { Drawer as w } from "./components/Drawer/index.js";
18
+ import { Avatar as T, AvatarGroup as E } from "./components/Avatar/index.js";
19
+ import { Grid as D, GridItem as O, Stack as k } from "./components/Grid/index.js";
20
+ import { Checkbox as A, ChoiceGroup as j, Radio as M } from "./components/Choice/index.js";
21
+ import { Table as N, TableBody as P, TableCell as F, TableEmpty as I, TableFrame as L, TableHead as R, TableHeaderCell as z, TableRow as B, TableToolbar as V } from "./components/Table/index.js";
22
+ import { Popover as H } from "./components/Popover/index.js";
23
+ import { Menu as U, MenuItem as W, MenuLabel as G, MenuSeparator as K } from "./components/Menu/index.js";
24
+ import { Toast as q, ToastProvider as J, useToast as Y } from "./components/Toast/index.js";
25
+ import { Skeleton as X, SkeletonText as Z } from "./components/Skeleton/index.js";
26
+ import { SideNav as Q, SideNavFooter as $, SideNavHeader as ee, SideNavItem as te, SideNavSection as ne, useSideNavCollapsed as re } from "./components/SideNav/index.js";
27
+ import { TopNav as ie, TopNavItem as ae } from "./components/TopNav/index.js";
28
+ import { SubNav as oe, SubNavButton as se, SubNavItem as ce } from "./components/SubNav/index.js";
29
+ import { CheckboxCard as le, RadioCard as ue, SelectionCardGroup as de } from "./components/SelectionCard/index.js";
30
+ import { Stepper as fe } from "./components/Stepper/index.js";
31
+ import { AssetGrid as pe, AssetGridEmpty as me, AssetTile as he, AssetTileSkeleton as ge } from "./components/AssetGrid/index.js";
32
+ import { ImageCropper as _e, cropRatios as ve, cropToBlob as ye } from "./components/ImageCropper/index.js";
33
+ import { Container as be } from "./components/Container/index.js";
34
+ import { Select as xe } from "./components/Select/index.js";
35
+ import { RangeSlider as Se, Slider as Ce } from "./components/Slider/index.js";
36
+ import { Calendar as we, DateField as Te, DateRangeField as Ee, formatIsoDate as De } from "./components/DatePicker/index.js";
37
+ import { TagsInput as Oe } from "./components/TagsInput/index.js";
38
+ import { Time as ke, formatAbsoluteDate as Ae, formatAbsoluteTime as je, formatRelativeTime as Me } from "./components/Time/index.js";
39
+ export { pe as AssetGrid, me as AssetGridEmpty, he as AssetTile, ge as AssetTileSkeleton, T as Avatar, E as AvatarGroup, o as Badge, x as Board, S as BoardCard, C as BoardColumn, r as Button, i as ButtonGroup, we as Calendar, A as Checkbox, le as CheckboxCard, j as ChoiceGroup, be as Container, Te as DateField, Ee as DateRangeField, w as Drawer, b as EntryEditor, f as EntryPicker, p as Field, c as FieldAffix, D as Grid, O as GridItem, n as Icon, _e as ImageCropper, U as Menu, W as MenuItem, G as MenuLabel, K as MenuSeparator, s as Modal, m as NumberField, h as NumberRangeField, H as Popover, M as Radio, ue as RadioCard, Se as RangeSlider, a as RichTextEditor, l as SearchField, xe as Select, de as SelectionCardGroup, Q as SideNav, $ as SideNavFooter, ee as SideNavHeader, te as SideNavItem, ne as SideNavSection, X as Skeleton, Z as SkeletonText, Ce as Slider, u as SortableList, d as SortableListItem, k as Stack, fe as Stepper, oe as SubNav, se as SubNavButton, ce as SubNavItem, g as Switch, N as Table, P as TableBody, F as TableCell, I as TableEmpty, L as TableFrame, R as TableHead, z as TableHeaderCell, B as TableRow, V as TableToolbar, Oe as TagsInput, _ as TextArea, v as TextField, ke as Time, q as Toast, J as ToastProvider, ie as TopNav, ae as TopNavItem, ve as cropRatios, ye as cropToBlob, Ae as formatAbsoluteDate, je as formatAbsoluteTime, De as formatIsoDate, Me as formatRelativeTime, e as iconNames, t as icons, re as useSideNavCollapsed, Y as useToast, y as validateEntryValues };
package/dist/styles.css CHANGED
@@ -11,6 +11,7 @@
11
11
  @import "./components/DatePicker/style.css";
12
12
  @import "./components/Drawer/style.css";
13
13
  @import "./components/EntryPicker/style.css";
14
+ @import "./components/EntryEditor/style.css";
14
15
  @import "./components/Field/style.css";
15
16
  @import "./components/FieldAffix/style.css";
16
17
  @import "./components/Grid/style.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namroodinc/liquid-editorial",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A bold, accessible React component library for editorial products.",
5
5
  "author": "Namrood Inc",
6
6
  "license": "MIT",
@@ -10,14 +10,28 @@
10
10
  "types": "./dist/index.d.ts",
11
11
  "typesVersions": {
12
12
  "*": {
13
- "components/*": ["dist/components/*/index.d.ts"],
14
- "styles.css": ["dist/styles.css.d.ts"],
15
- "tokens.css": ["dist/tokens.css.d.ts"],
16
- "reset.css": ["dist/reset.css.d.ts"]
13
+ "components/*": [
14
+ "dist/components/*/index.d.ts"
15
+ ],
16
+ "styles.css": [
17
+ "dist/styles.css.d.ts"
18
+ ],
19
+ "tokens.css": [
20
+ "dist/tokens.css.d.ts"
21
+ ],
22
+ "reset.css": [
23
+ "dist/reset.css.d.ts"
24
+ ]
17
25
  }
18
26
  },
19
- "files": ["dist", "README.md", "LICENSE"],
20
- "sideEffects": ["**/*.css"],
27
+ "files": [
28
+ "dist",
29
+ "README.md",
30
+ "LICENSE"
31
+ ],
32
+ "sideEffects": [
33
+ "**/*.css"
34
+ ],
21
35
  "exports": {
22
36
  ".": {
23
37
  "import": {
@@ -57,10 +71,20 @@
57
71
  "type": "git",
58
72
  "url": "git+https://github.com/namroodinc/liquid-editorial.git"
59
73
  },
60
- "bugs": { "url": "https://github.com/namroodinc/liquid-editorial/issues" },
74
+ "bugs": {
75
+ "url": "https://github.com/namroodinc/liquid-editorial/issues"
76
+ },
61
77
  "homepage": "https://github.com/namroodinc/liquid-editorial#readme",
62
- "keywords": ["react", "components", "design-system", "editorial", "typescript"],
63
- "publishConfig": { "access": "public" },
78
+ "keywords": [
79
+ "react",
80
+ "components",
81
+ "design-system",
82
+ "editorial",
83
+ "typescript"
84
+ ],
85
+ "publishConfig": {
86
+ "access": "public"
87
+ },
64
88
  "scripts": {
65
89
  "clean": "node scripts/clean.mjs",
66
90
  "dev": "storybook dev -p 6006",
@@ -128,5 +152,7 @@
128
152
  "vite": "^8.0.16",
129
153
  "vitest": "^4.0.0"
130
154
  },
131
- "engines": { "node": ">=22" }
155
+ "engines": {
156
+ "node": ">=22"
157
+ }
132
158
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","useState","useEditor","StarterKit","Link","Placeholder","useEditorState","useCallback","ButtonGroup","Button","EditorContent","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__copyProps","from","keys","i","n","key","to","except","k","desc","__toESM","mod","isNodeMode","target","require_components_Button_index","require_components_ButtonGroup_index","react","react_jsx_runtime","_tiptap_react","_tiptap_starter_kit","_tiptap_extension_link","_tiptap_extension_placeholder","GROUPS","RichTextEditor","isFocused","setIsFocused","editor","isDisabled","defaultValue","label","onChange","state","toggleLink","href","className","isInvalid","group","tool","toolbarExtra","size"],"sources":["../../../src/components/RichTextEditor/index.tsx"],"sourcesContent":["import { forwardRef, useCallback, useState, type ReactNode } from \"react\";\nimport { EditorContent, useEditor, useEditorState, type Editor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport Link from \"@tiptap/extension-link\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport { Button } from \"../Button\";\nimport { ButtonGroup } from \"../ButtonGroup\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nexport type RichTextEditorSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface RichTextEditorProps {\n /** Initial HTML. The editor is uncontrolled: read changes from `onChange`. */\n defaultValue?: string;\n /** Fired with the document's HTML on every change. */\n onChange?: (html: string) => void;\n placeholder?: string;\n size?: RichTextEditorSize;\n isDisabled?: boolean;\n isInvalid?: boolean;\n /** Accessible name for the editing surface. */\n label?: string;\n className?: string;\n /** Extra controls appended to the toolbar, e.g. a word count. */\n toolbarExtra?: ReactNode;\n}\n\ninterface ToolItem {\n id: string;\n icon: IconName;\n label: string;\n run: (editor: Editor) => void;\n active?: (editor: Editor) => boolean;\n}\n\nconst GROUPS: ToolItem[][] = [\n [\n {\n id: \"bold\",\n icon: \"bold\",\n label: \"Bold\",\n run: (e) => e.chain().focus().toggleBold().run(),\n active: (e) => e.isActive(\"bold\"),\n },\n {\n id: \"italic\",\n icon: \"italic\",\n label: \"Italic\",\n run: (e) => e.chain().focus().toggleItalic().run(),\n active: (e) => e.isActive(\"italic\"),\n },\n {\n id: \"strike\",\n icon: \"strikethrough\",\n label: \"Strikethrough\",\n run: (e) => e.chain().focus().toggleStrike().run(),\n active: (e) => e.isActive(\"strike\"),\n },\n {\n id: \"code\",\n icon: \"code\",\n label: \"Inline code\",\n run: (e) => e.chain().focus().toggleCode().run(),\n active: (e) => e.isActive(\"code\"),\n },\n ],\n [\n {\n id: \"h2\",\n icon: \"heading-2\",\n label: \"Heading\",\n run: (e) => e.chain().focus().toggleHeading({ level: 2 }).run(),\n active: (e) => e.isActive(\"heading\", { level: 2 }),\n },\n {\n id: \"h3\",\n icon: \"heading-3\",\n label: \"Subheading\",\n run: (e) => e.chain().focus().toggleHeading({ level: 3 }).run(),\n active: (e) => e.isActive(\"heading\", { level: 3 }),\n },\n {\n id: \"quote\",\n icon: \"quote\",\n label: \"Quote\",\n run: (e) => e.chain().focus().toggleBlockquote().run(),\n active: (e) => e.isActive(\"blockquote\"),\n },\n ],\n [\n {\n id: \"ul\",\n icon: \"list\",\n label: \"Bulleted list\",\n run: (e) => e.chain().focus().toggleBulletList().run(),\n active: (e) => e.isActive(\"bulletList\"),\n },\n {\n id: \"ol\",\n icon: \"list-ordered\",\n label: \"Numbered list\",\n run: (e) => e.chain().focus().toggleOrderedList().run(),\n active: (e) => e.isActive(\"orderedList\"),\n },\n ],\n [\n {\n id: \"undo\",\n icon: \"undo\",\n label: \"Undo\",\n run: (e) => e.chain().focus().undo().run(),\n },\n {\n id: \"redo\",\n icon: \"redo\",\n label: \"Redo\",\n run: (e) => e.chain().focus().redo().run(),\n },\n ],\n];\n\n/**\n * The editorial writing surface. Rich text plus links — the same field skin,\n * radius and states as `TextField`, with the toolbar inside the frame.\n */\nexport const RichTextEditor = forwardRef<HTMLDivElement, RichTextEditorProps>(\n function RichTextEditor(\n {\n defaultValue = \"\",\n onChange,\n placeholder = \"Write something…\",\n size = \"md\",\n isDisabled = false,\n isInvalid = false,\n label = \"Rich text editor\",\n className,\n toolbarExtra,\n },\n ref,\n ) {\n const [isFocused, setIsFocused] = useState(false);\n\n const editor = useEditor({\n immediatelyRender: false,\n editable: !isDisabled,\n content: defaultValue,\n extensions: [\n StarterKit.configure({ link: false }),\n Link.configure({ openOnClick: false, autolink: true }),\n Placeholder.configure({ placeholder }),\n ],\n editorProps: {\n attributes: { role: \"textbox\", \"aria-label\": label, \"aria-multiline\": \"true\" },\n },\n onFocus: () => setIsFocused(true),\n onBlur: () => setIsFocused(false),\n onUpdate: ({ editor: e }) => onChange?.(e.getHTML()),\n });\n\n const state = useEditorState({\n editor,\n selector: ({ editor: e }) =>\n e\n ? {\n active: Object.fromEntries(\n GROUPS.flat().map((t) => [t.id, t.active?.(e) ?? false]),\n ),\n linkActive: e.isActive(\"link\"),\n }\n : null,\n });\n\n const toggleLink = useCallback(() => {\n if (!editor) return;\n if (editor.isActive(\"link\")) {\n editor.chain().focus().unsetLink().run();\n return;\n }\n const href = window.prompt(\"Link to\");\n if (!href) return;\n editor.chain().focus().extendMarkRange(\"link\").setLink({ href }).run();\n }, [editor]);\n\n return (\n <div\n ref={ref}\n className={[\"ds-rte\", className].filter(Boolean).join(\" \")}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n aria-invalid={isInvalid || undefined}\n >\n <div className=\"ds-rte__toolbar\" role=\"toolbar\" aria-label={`${label} formatting`}>\n {GROUPS.map((group, i) => (\n <ButtonGroup key={i} aria-label={`Formatting ${i + 1}`}>\n {group.map((tool) => (\n <Button\n key={tool.id}\n size=\"sm\"\n isIconOnly\n iconStart={tool.icon}\n aria-label={tool.label}\n title={tool.label}\n aria-pressed={tool.active ? state?.active[tool.id] : undefined}\n variant={state?.active[tool.id] ? \"active\" : \"neutral\"}\n isDisabled={isDisabled || !editor}\n onClick={() => editor && tool.run(editor)}\n />\n ))}\n </ButtonGroup>\n ))}\n <ButtonGroup aria-label=\"Link\">\n <Button\n size=\"sm\"\n isIconOnly\n iconStart={state?.linkActive ? \"link-off\" : \"link\"}\n aria-label={state?.linkActive ? \"Remove link\" : \"Add link\"}\n title={state?.linkActive ? \"Remove link\" : \"Add link\"}\n variant={state?.linkActive ? \"active\" : \"neutral\"}\n isDisabled={isDisabled || !editor}\n onClick={toggleLink}\n />\n </ButtonGroup>\n {toolbarExtra}\n </div>\n <div className=\"ds-rte__content\" data-size={size}>\n <EditorContent editor={editor} />\n </div>\n </div>\n );\n },\n);\n"],"mappings":"A,m5BAqCA,IAAMuC,EAAuB,CAC3B,CACE,CACE,GAAI,OACJ,KAAM,OACN,MAAO,OACP,IAAM,GAAM,EAAE,M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MAAOA,EAAK,MACZ,eAAcA,EAAK,OAASN,GAAO,OAAOM,EAAK,IAAM,IAAA,GACrD,QAASN,GAAO,OAAOM,EAAK,IAAM,SAAW,UAC7C,WAAYV,GAAc,CAACD,EAC3B,YAAeA,GAAUW,EAAK,IAAIX,CAAM,CACzC,EAVMW,EAAK,EAUX,CACF,CACU,EAfKlC,CAeL,CACd,GACD,EAAAc,EAAA,IAAA,CAAC1B,EAAAA,YAAD,CAAa,aAAW,OACtB,UAAA,EAAA0B,EAAA,IAAA,CAACzB,EAAAA,OAAD,CACE,KAAK,KACL,WAAA,GACA,UAAWuC,GAAO,WAAa,WAAa,OAC5C,aAAYA,GAAO,WAAa,cAAgB,WAChD,MAAOA,GAAO,WAAa,cAAgB,WAC3C,QAASA,GAAO,WAAa,SAAW,UACxC,WAAYJ,GAAc,CAACD,EAC3B,QAASM,CACV,CAAA,CACU,CAAA,EACZM,CACE,CACL,CAAA,GAAA,EAAArB,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,kBAAkB,YAAWsB,EAC1C,UAAA,EAAAtB,EAAA,IAAA,CAACxB,EAAAA,cAAD,CAAuB,QAAS,CAAA,CAC7B,CAAA,CACF,C,EAET,CACF,E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["StarterKit","Link","Placeholder","GROUPS","RichTextEditor","forwardRef","isFocused","setIsFocused","useState","editor","useEditor","isDisabled","defaultValue","label","onChange","state","useEditorState","toggleLink","useCallback","href","className","isInvalid","ButtonGroup","i","group","Button","tool","toolbarExtra","size","EditorContent"],"sources":["../../../src/components/RichTextEditor/index.tsx"],"sourcesContent":["import { forwardRef, useCallback, useState, type ReactNode } from \"react\";\nimport { EditorContent, useEditor, useEditorState, type Editor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport Link from \"@tiptap/extension-link\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport { Button } from \"../Button\";\nimport { ButtonGroup } from \"../ButtonGroup\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nexport type RichTextEditorSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface RichTextEditorProps {\n /** Initial HTML. The editor is uncontrolled: read changes from `onChange`. */\n defaultValue?: string;\n /** Fired with the document's HTML on every change. */\n onChange?: (html: string) => void;\n placeholder?: string;\n size?: RichTextEditorSize;\n isDisabled?: boolean;\n isInvalid?: boolean;\n /** Accessible name for the editing surface. */\n label?: string;\n className?: string;\n /** Extra controls appended to the toolbar, e.g. a word count. */\n toolbarExtra?: ReactNode;\n}\n\ninterface ToolItem {\n id: string;\n icon: IconName;\n label: string;\n run: (editor: Editor) => void;\n active?: (editor: Editor) => boolean;\n}\n\nconst GROUPS: ToolItem[][] = [\n [\n {\n id: \"bold\",\n icon: \"bold\",\n label: \"Bold\",\n run: (e) => e.chain().focus().toggleBold().run(),\n active: (e) => e.isActive(\"bold\"),\n },\n {\n id: \"italic\",\n icon: \"italic\",\n label: \"Italic\",\n run: (e) => e.chain().focus().toggleItalic().run(),\n active: (e) => e.isActive(\"italic\"),\n },\n {\n id: \"strike\",\n icon: \"strikethrough\",\n label: \"Strikethrough\",\n run: (e) => e.chain().focus().toggleStrike().run(),\n active: (e) => e.isActive(\"strike\"),\n },\n {\n id: \"code\",\n icon: \"code\",\n label: \"Inline code\",\n run: (e) => e.chain().focus().toggleCode().run(),\n active: (e) => e.isActive(\"code\"),\n },\n ],\n [\n {\n id: \"h2\",\n icon: \"heading-2\",\n label: \"Heading\",\n run: (e) => e.chain().focus().toggleHeading({ level: 2 }).run(),\n active: (e) => e.isActive(\"heading\", { level: 2 }),\n },\n {\n id: \"h3\",\n icon: \"heading-3\",\n label: \"Subheading\",\n run: (e) => e.chain().focus().toggleHeading({ level: 3 }).run(),\n active: (e) => e.isActive(\"heading\", { level: 3 }),\n },\n {\n id: \"quote\",\n icon: \"quote\",\n label: \"Quote\",\n run: (e) => e.chain().focus().toggleBlockquote().run(),\n active: (e) => e.isActive(\"blockquote\"),\n },\n ],\n [\n {\n id: \"ul\",\n icon: \"list\",\n label: \"Bulleted list\",\n run: (e) => e.chain().focus().toggleBulletList().run(),\n active: (e) => e.isActive(\"bulletList\"),\n },\n {\n id: \"ol\",\n icon: \"list-ordered\",\n label: \"Numbered list\",\n run: (e) => e.chain().focus().toggleOrderedList().run(),\n active: (e) => e.isActive(\"orderedList\"),\n },\n ],\n [\n {\n id: \"undo\",\n icon: \"undo\",\n label: \"Undo\",\n run: (e) => e.chain().focus().undo().run(),\n },\n {\n id: \"redo\",\n icon: \"redo\",\n label: \"Redo\",\n run: (e) => e.chain().focus().redo().run(),\n },\n ],\n];\n\n/**\n * The editorial writing surface. Rich text plus links — the same field skin,\n * radius and states as `TextField`, with the toolbar inside the frame.\n */\nexport const RichTextEditor = forwardRef<HTMLDivElement, RichTextEditorProps>(\n function RichTextEditor(\n {\n defaultValue = \"\",\n onChange,\n placeholder = \"Write something…\",\n size = \"md\",\n isDisabled = false,\n isInvalid = false,\n label = \"Rich text editor\",\n className,\n toolbarExtra,\n },\n ref,\n ) {\n const [isFocused, setIsFocused] = useState(false);\n\n const editor = useEditor({\n immediatelyRender: false,\n editable: !isDisabled,\n content: defaultValue,\n extensions: [\n StarterKit.configure({ link: false }),\n Link.configure({ openOnClick: false, autolink: true }),\n Placeholder.configure({ placeholder }),\n ],\n editorProps: {\n attributes: { role: \"textbox\", \"aria-label\": label, \"aria-multiline\": \"true\" },\n },\n onFocus: () => setIsFocused(true),\n onBlur: () => setIsFocused(false),\n onUpdate: ({ editor: e }) => onChange?.(e.getHTML()),\n });\n\n const state = useEditorState({\n editor,\n selector: ({ editor: e }) =>\n e\n ? {\n active: Object.fromEntries(\n GROUPS.flat().map((t) => [t.id, t.active?.(e) ?? false]),\n ),\n linkActive: e.isActive(\"link\"),\n }\n : null,\n });\n\n const toggleLink = useCallback(() => {\n if (!editor) return;\n if (editor.isActive(\"link\")) {\n editor.chain().focus().unsetLink().run();\n return;\n }\n const href = window.prompt(\"Link to\");\n if (!href) return;\n editor.chain().focus().extendMarkRange(\"link\").setLink({ href }).run();\n }, [editor]);\n\n return (\n <div\n ref={ref}\n className={[\"ds-rte\", className].filter(Boolean).join(\" \")}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n aria-invalid={isInvalid || undefined}\n >\n <div className=\"ds-rte__toolbar\" role=\"toolbar\" aria-label={`${label} formatting`}>\n {GROUPS.map((group, i) => (\n <ButtonGroup key={i} aria-label={`Formatting ${i + 1}`}>\n {group.map((tool) => (\n <Button\n key={tool.id}\n size=\"sm\"\n isIconOnly\n iconStart={tool.icon}\n aria-label={tool.label}\n title={tool.label}\n aria-pressed={tool.active ? state?.active[tool.id] : undefined}\n variant={state?.active[tool.id] ? \"active\" : \"neutral\"}\n isDisabled={isDisabled || !editor}\n onClick={() => editor && tool.run(editor)}\n />\n ))}\n </ButtonGroup>\n ))}\n <ButtonGroup aria-label=\"Link\">\n <Button\n size=\"sm\"\n isIconOnly\n iconStart={state?.linkActive ? \"link-off\" : \"link\"}\n aria-label={state?.linkActive ? \"Remove link\" : \"Add link\"}\n title={state?.linkActive ? \"Remove link\" : \"Add link\"}\n variant={state?.linkActive ? \"active\" : \"neutral\"}\n isDisabled={isDisabled || !editor}\n onClick={toggleLink}\n />\n </ButtonGroup>\n {toolbarExtra}\n </div>\n <div className=\"ds-rte__content\" data-size={size}>\n <EditorContent editor={editor} />\n </div>\n </div>\n );\n },\n);\n"],"mappings":";;;;;;;;;;AAqCA,IAAMG,IAAuB;CAC3B;EACE;GACE,IAAI;GACJ,MAAM;GACN,OAAO;GACP,MAAM,MAAM,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI;GAC/C,SAAS,MAAM,EAAE,SAAS,MAAM;EAClC;EACA;GACE,IAAI;GACJ,MAAM;GACN,OAAO;GACP,MAAM,MAAM,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,C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