@namroodinc/liquid-editorial 0.10.1 → 0.11.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.
- package/README.md +10 -0
- package/UPGRADING.md +113 -0
- package/dist/chunks/{Board-B8wK079I.js → Board-Cnyqrc-R.js} +2 -2
- package/dist/chunks/{Board-B8wK079I.js.map → Board-Cnyqrc-R.js.map} +1 -1
- package/dist/chunks/{Board-CMf5Azt0.cjs → Board-DFuJt2Oh.cjs} +2 -2
- package/dist/chunks/{Board-CMf5Azt0.cjs.map → Board-DFuJt2Oh.cjs.map} +1 -1
- package/dist/chunks/{ColourField-C1qjpIfB.cjs → ColourField--rS9KDpq.cjs} +2 -2
- package/dist/chunks/{ColourField-C1qjpIfB.cjs.map → ColourField--rS9KDpq.cjs.map} +1 -1
- package/dist/chunks/{ColourField-Ce2oaVcd.js → ColourField-DkO8tjeB.js} +2 -2
- package/dist/chunks/{ColourField-Ce2oaVcd.js.map → ColourField-DkO8tjeB.js.map} +1 -1
- package/dist/chunks/{DatePicker-CnVmsCwO.js → DatePicker-B8tllGYy.js} +2 -2
- package/dist/chunks/{DatePicker-CnVmsCwO.js.map → DatePicker-B8tllGYy.js.map} +1 -1
- package/dist/chunks/{DatePicker-BCnzFJFF.cjs → DatePicker-OiqjoO-f.cjs} +2 -2
- package/dist/chunks/{DatePicker-BCnzFJFF.cjs.map → DatePicker-OiqjoO-f.cjs.map} +1 -1
- package/dist/chunks/EntryPicker-BI_7g2Wg.cjs +2 -0
- package/dist/chunks/EntryPicker-BI_7g2Wg.cjs.map +1 -0
- package/dist/chunks/EntryPicker-KxHZzZsh.js +160 -0
- package/dist/chunks/EntryPicker-KxHZzZsh.js.map +1 -0
- package/dist/chunks/FormEditor-BJcAIVcL.cjs +2 -0
- package/dist/chunks/FormEditor-BJcAIVcL.cjs.map +1 -0
- package/dist/chunks/{FormEditor-BEOp5EW-.js → FormEditor-CdLqPaKK.js} +112 -108
- package/dist/chunks/FormEditor-CdLqPaKK.js.map +1 -0
- package/dist/chunks/Icon-CD3oeiNA.cjs +2 -0
- package/dist/chunks/Icon-CD3oeiNA.cjs.map +1 -0
- package/dist/chunks/Icon-CYXOo0Kt.js +88 -0
- package/dist/chunks/Icon-CYXOo0Kt.js.map +1 -0
- package/dist/chunks/{Message-CaX8Y1Xb.js → Message-CyLq9ef-.js} +2 -2
- package/dist/chunks/{Message-CaX8Y1Xb.js.map → Message-CyLq9ef-.js.map} +1 -1
- package/dist/chunks/{Message-DU31JAb3.cjs → Message-D3b8HDhm.cjs} +2 -2
- package/dist/chunks/{Message-DU31JAb3.cjs.map → Message-D3b8HDhm.cjs.map} +1 -1
- package/dist/chunks/{NumberField-Ccjpa_1d.cjs → NumberField-BrWFmPkW.cjs} +2 -2
- package/dist/chunks/{NumberField-Ccjpa_1d.cjs.map → NumberField-BrWFmPkW.cjs.map} +1 -1
- package/dist/chunks/{NumberField-CVsK4l9P.js → NumberField-C90eJGny.js} +13 -13
- package/dist/chunks/{NumberField-CVsK4l9P.js.map → NumberField-C90eJGny.js.map} +1 -1
- package/dist/chunks/RichTextEditor-BXyhSeJd.cjs +2 -0
- package/dist/chunks/RichTextEditor-BXyhSeJd.cjs.map +1 -0
- package/dist/chunks/RichTextEditor-DmNM63Wg.js +1123 -0
- package/dist/chunks/RichTextEditor-DmNM63Wg.js.map +1 -0
- package/dist/chunks/use-picker-session-BDEWL2jK.js +712 -0
- package/dist/chunks/use-picker-session-BDEWL2jK.js.map +1 -0
- package/dist/chunks/use-picker-session-C4FGinLN.cjs +2 -0
- package/dist/chunks/use-picker-session-C4FGinLN.cjs.map +1 -0
- package/dist/components/AssetCard/index.cjs +1 -1
- package/dist/components/AssetCard/index.js +1 -1
- package/dist/components/AssetGrid/index.cjs +1 -1
- package/dist/components/AssetGrid/index.js +1 -1
- package/dist/components/Banner/index.cjs +1 -1
- package/dist/components/Banner/index.js +1 -1
- package/dist/components/Board/index.cjs +1 -1
- package/dist/components/Board/index.js +1 -1
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ColourField/index.cjs +1 -1
- package/dist/components/ColourField/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/EditLayout/index.cjs +1 -1
- package/dist/components/EditLayout/index.js +1 -1
- package/dist/components/EntryPicker/index.cjs +1 -1
- package/dist/components/EntryPicker/index.d.cts.map +1 -1
- package/dist/components/EntryPicker/index.d.ts.map +1 -1
- package/dist/components/EntryPicker/index.js +1 -1
- package/dist/components/EntryPicker/use-picker-session.d.cts +110 -0
- package/dist/components/EntryPicker/use-picker-session.d.cts.map +1 -0
- package/dist/components/EntryPicker/use-picker-session.d.ts +110 -0
- package/dist/components/EntryPicker/use-picker-session.d.ts.map +1 -0
- package/dist/components/EntryPicker/use-selected-items.d.cts +9 -2
- package/dist/components/EntryPicker/use-selected-items.d.cts.map +1 -1
- package/dist/components/EntryPicker/use-selected-items.d.ts +9 -2
- package/dist/components/EntryPicker/use-selected-items.d.ts.map +1 -1
- package/dist/components/FormEditor/README.md +118 -0
- package/dist/components/FormEditor/control.d.cts +3 -1
- package/dist/components/FormEditor/control.d.cts.map +1 -1
- package/dist/components/FormEditor/control.d.ts +3 -1
- package/dist/components/FormEditor/control.d.ts.map +1 -1
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.d.cts +3 -1
- package/dist/components/FormEditor/index.d.cts.map +1 -1
- package/dist/components/FormEditor/index.d.ts +3 -1
- package/dist/components/FormEditor/index.d.ts.map +1 -1
- package/dist/components/FormEditor/index.js +1 -1
- package/dist/components/FormEditor/model.d.cts.map +1 -1
- package/dist/components/FormEditor/model.d.ts.map +1 -1
- package/dist/components/Icon/icons.d.cts +3 -0
- package/dist/components/Icon/icons.d.cts.map +1 -1
- package/dist/components/Icon/icons.d.ts +3 -0
- package/dist/components/Icon/icons.d.ts.map +1 -1
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/NumberField/index.cjs +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/RichTextEditor/document.d.cts +7 -1
- package/dist/components/RichTextEditor/document.d.cts.map +1 -1
- package/dist/components/RichTextEditor/document.d.ts +7 -1
- package/dist/components/RichTextEditor/document.d.ts.map +1 -1
- package/dist/components/RichTextEditor/embed-context.d.cts +36 -0
- package/dist/components/RichTextEditor/embed-context.d.cts.map +1 -0
- package/dist/components/RichTextEditor/embed-context.d.ts +36 -0
- package/dist/components/RichTextEditor/embed-context.d.ts.map +1 -0
- package/dist/components/RichTextEditor/embed-types.d.cts +27 -0
- package/dist/components/RichTextEditor/embed-types.d.cts.map +1 -0
- package/dist/components/RichTextEditor/embed-types.d.ts +27 -0
- package/dist/components/RichTextEditor/embed-types.d.ts.map +1 -0
- package/dist/components/RichTextEditor/expansion.d.cts +6 -1
- package/dist/components/RichTextEditor/expansion.d.cts.map +1 -1
- package/dist/components/RichTextEditor/expansion.d.ts +6 -1
- package/dist/components/RichTextEditor/expansion.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.d.cts +4 -0
- package/dist/components/RichTextEditor/index.d.cts.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts +4 -0
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RichTextEditor/storyblock-view.d.cts +3 -0
- package/dist/components/RichTextEditor/storyblock-view.d.cts.map +1 -0
- package/dist/components/RichTextEditor/storyblock-view.d.ts +3 -0
- package/dist/components/RichTextEditor/storyblock-view.d.ts.map +1 -0
- package/dist/components/RichTextEditor/storyblock.d.cts +19 -0
- package/dist/components/RichTextEditor/storyblock.d.cts.map +1 -0
- package/dist/components/RichTextEditor/storyblock.d.ts +19 -0
- package/dist/components/RichTextEditor/storyblock.d.ts.map +1 -0
- package/dist/components/RichTextEditor/style.css +147 -0
- package/dist/components/RichTextEditor/use-embeds.d.cts +31 -0
- package/dist/components/RichTextEditor/use-embeds.d.cts.map +1 -0
- package/dist/components/RichTextEditor/use-embeds.d.ts +31 -0
- package/dist/components/RichTextEditor/use-embeds.d.ts.map +1 -0
- package/dist/components/SearchField/index.cjs +1 -1
- package/dist/components/SearchField/index.js +1 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SideNav/index.cjs +1 -1
- package/dist/components/SideNav/index.js +1 -1
- package/dist/components/SortableList/index.cjs +1 -1
- package/dist/components/SortableList/index.js +1 -1
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/SubNav/index.cjs +1 -1
- package/dist/components/SubNav/index.js +1 -1
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/TopNav/index.cjs +1 -1
- package/dist/components/TopNav/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -18
- package/package.json +1 -1
- package/dist/chunks/EntryPicker-BhApdZtE.cjs +0 -2
- package/dist/chunks/EntryPicker-BhApdZtE.cjs.map +0 -1
- package/dist/chunks/EntryPicker-LBj_56_e.js +0 -803
- package/dist/chunks/EntryPicker-LBj_56_e.js.map +0 -1
- package/dist/chunks/FormEditor-B5A38LZ4.cjs +0 -2
- package/dist/chunks/FormEditor-B5A38LZ4.cjs.map +0 -1
- package/dist/chunks/FormEditor-BEOp5EW-.js.map +0 -1
- package/dist/chunks/Icon-WOhlu6Rp.cjs +0 -2
- package/dist/chunks/Icon-WOhlu6Rp.cjs.map +0 -1
- package/dist/chunks/Icon-spaFBU4S.js +0 -85
- package/dist/chunks/Icon-spaFBU4S.js.map +0 -1
- package/dist/chunks/RichTextEditor-CuZnjiy2.js +0 -483
- package/dist/chunks/RichTextEditor-CuZnjiy2.js.map +0 -1
- package/dist/chunks/RichTextEditor-DcbLho2Q.cjs +0 -2
- package/dist/chunks/RichTextEditor-DcbLho2Q.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Icon-WOhlu6Rp.cjs","names":["AlertTriangle","Archive","Blocks","Film","AudioLines","Bold","Code","Heading2","Heading3","Italic","Link2Off","List","ListOrdered","Quote","Redo2","Strikethrough","Undo2","ArrowLeft","ArrowRight","Calendar","Check","ChevronDown","ChevronLeft","ChevronUp","Minus","ChevronRight","Clock","Copy","Download","Eye","ExternalLink","Filter","Bell","ChevronsLeft","ChevronsRight","FileText","FolderClosed","Globe","Home","LayoutGrid","Menu","Maximize2","Minimize2","Users","GripHorizontal","GripVertical","Image","Info","Link","KeyRound","Loader2","MoreHorizontal","Pencil","Pipette","Plus","RotateCcw","RotateCw","Search","Settings","Trash2","Upload","User","X","forwardRef","react","lucide_react","react_jsx_runtime","icons","iconNames","Icon","rest","Glyph","name","size","className"],"sources":["../../src/components/Icon/icons.ts","../../src/components/Icon/index.tsx"],"sourcesContent":["import {\n AlertTriangle,\n Blocks,\n Film,\n AudioLines,\n Bold,\n Code,\n Heading2,\n Heading3,\n Italic,\n Link2Off,\n List,\n ListOrdered,\n Quote,\n Redo2,\n Strikethrough,\n Undo2,\n Archive,\n ArrowLeft,\n ArrowRight,\n Calendar,\n Check,\n ChevronDown,\n ChevronLeft,\n ChevronUp,\n Minus,\n ChevronRight,\n Clock,\n Copy,\n Download,\n Eye,\n ExternalLink,\n Filter,\n Bell,\n ChevronsLeft,\n ChevronsRight,\n FileText,\n FolderClosed,\n Globe,\n Home,\n LayoutGrid,\n Menu,\n Maximize2,\n Minimize2,\n Users,\n GripHorizontal,\n GripVertical,\n Image,\n Info,\n Link,\n KeyRound,\n Loader2,\n MoreHorizontal,\n Pencil,\n Pipette,\n Plus,\n RotateCcw,\n RotateCw,\n Search,\n Settings,\n Trash2,\n Upload,\n User,\n X,\n} from \"lucide-react\";\n\n/**\n * The finite icon set. Adding a glyph means adding a line here — a visible\n * decision rather than an import someone typed at a call site.\n */\nexport const icons = {\n \"alert-triangle\": AlertTriangle,\n archive: Archive,\n blocks: Blocks,\n film: Film,\n \"audio-lines\": AudioLines,\n bold: Bold,\n code: Code,\n \"heading-2\": Heading2,\n \"heading-3\": Heading3,\n italic: Italic,\n \"link-off\": Link2Off,\n list: List,\n \"list-ordered\": ListOrdered,\n quote: Quote,\n redo: Redo2,\n strikethrough: Strikethrough,\n undo: Undo2,\n \"arrow-left\": ArrowLeft,\n \"arrow-right\": ArrowRight,\n calendar: Calendar,\n check: Check,\n \"chevron-down\": ChevronDown,\n \"chevron-left\": ChevronLeft,\n \"chevron-up\": ChevronUp,\n minus: Minus,\n \"chevron-right\": ChevronRight,\n clock: Clock,\n copy: Copy,\n download: Download,\n eye: Eye,\n \"external-link\": ExternalLink,\n filter: Filter,\n bell: Bell,\n \"chevrons-left\": ChevronsLeft,\n \"chevrons-right\": ChevronsRight,\n \"file-text\": FileText,\n folder: FolderClosed,\n globe: Globe,\n home: Home,\n \"layout-grid\": LayoutGrid,\n menu: Menu,\n \"maximize-2\": Maximize2,\n \"minimize-2\": Minimize2,\n users: Users,\n \"grip-horizontal\": GripHorizontal,\n \"grip-vertical\": GripVertical,\n image: Image,\n info: Info,\n link: Link,\n \"key-round\": KeyRound,\n spinner: Loader2,\n \"more-horizontal\": MoreHorizontal,\n pencil: Pencil,\n pipette: Pipette,\n plus: Plus,\n \"rotate-ccw\": RotateCcw,\n \"rotate-cw\": RotateCw,\n search: Search,\n settings: Settings,\n trash: Trash2,\n upload: Upload,\n user: User,\n x: X,\n} as const;\n\nexport type IconName = keyof typeof icons;\n\nexport const iconNames = Object.keys(icons) as IconName[];\n","import { forwardRef, type SVGProps } from \"react\";\nimport { icons, type IconName } from \"./icons\";\nimport \"./style.css\";\n\nexport type IconSize = 16 | 20 | 24;\n\nexport interface IconProps extends Omit<SVGProps<SVGSVGElement>, \"ref\"> {\n /** Glyph name from the curated set in `icons.ts`. */\n name: IconName;\n /** 16 inside controls, 20 standalone, 24 for empty states. No other sizes. */\n size?: IconSize;\n}\n\n/**\n * A glyph that clarifies an action or a status. Inherits `currentColor`, so it\n * takes its colour from the control it sits in — it never carries its own.\n */\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(\n { name, size = 16, className, ...rest },\n ref,\n) {\n const Glyph = icons[name];\n return (\n <Glyph\n ref={ref}\n width={size}\n height={size}\n className={[\"ds-icon\", className].filter(Boolean).join(\" \")}\n role={rest[\"aria-label\"] ? \"img\" : undefined}\n aria-hidden={rest[\"aria-label\"] ? undefined : true}\n focusable=\"false\"\n {...rest}\n />\n );\n});\n"],"mappings":"A,gFAsEA,IAAamE,EAAQ,CACnB,iBAAkBnE,EAAAA,cAClB,QAASC,EAAAA,QACT,OAAQC,EAAAA,OACR,KAAMC,EAAAA,KACN,cAAeC,EAAAA,WACf,KAAMC,EAAAA,KACN,KAAMC,EAAAA,KACN,YAAaC,EAAAA,SACb,YAAaC,EAAAA,SACb,OAAQC,EAAAA,OACR,WAAYC,EAAAA,SACZ,KAAMC,EAAAA,KACN,eAAgBC,EAAAA,YAChB,MAAOC,EAAAA,MACP,KAAMC,EAAAA,MACN,cAAeC,EAAAA,cACf,KAAMC,EAAAA,MACN,aAAcC,EAAAA,UACd,cAAeC,EAAAA,WACf,SAAUC,EAAAA,SACV,MAAOC,EAAAA,MACP,eAAgBC,EAAAA,YAChB,eAAgBC,EAAAA,YAChB,aAAcC,EAAAA,UACd,MAAOC,EAAAA,MACP,gBAAiBC,EAAAA,aACjB,MAAOC,EAAAA,MACP,KAAMC,EAAAA,KACN,SAAUC,EAAAA,SACV,IAAKC,EAAAA,IACL,gBAAiBC,EAAAA,aACjB,OAAQC,EAAAA,OACR,KAAMC,EAAAA,KACN,gBAAiBC,EAAAA,aACjB,iBAAkBC,EAAAA,cAClB,YAAaC,EAAAA,SACb,OAAQC,EAAAA,aACR,MAAOC,EAAAA,MACP,KAAMC,EAAAA,KACN,cAAeC,EAAAA,WACf,KAAMC,EAAAA,KACN,aAAcC,EAAAA,UACd,aAAcC,EAAAA,UACd,MAAOC,EAAAA,MACP,kBAAmBC,EAAAA,eACnB,gBAAiBC,EAAAA,aACjB,MAAOC,EAAAA,MACP,KAAMC,EAAAA,KACN,KAAMC,EAAAA,KACN,YAAaC,EAAAA,SACb,QAASC,EAAAA,QACT,kBAAmBC,EAAAA,eACnB,OAAQC,EAAAA,OACR,QAASC,EAAAA,QACT,KAAMC,EAAAA,KACN,aAAcC,EAAAA,UACd,YAAaC,EAAAA,SACb,OAAQC,EAAAA,OACR,SAAUC,EAAAA,SACV,MAAOC,EAAAA,OACP,OAAQC,EAAAA,OACR,KAAMC,EAAAA,KACN,EAAGC,EAAAA,CACL,EAIaM,EAAY,OAAO,KAAKD,CAAK,ECzH7BE,GAAA,EAAON,EAAAA,WAAAA,CAAqC,SACvD,CAAE,OAAM,OAAO,GAAI,YAAW,GAAGO,GACjC,EACA,CACA,IAAMC,EAAQJ,EAAMK,GACpB,OACE,EAAAN,EAAA,IAAA,CAACK,EAAD,CACO,MACL,MAAOE,EACP,OAAQA,EACR,UAAW,CAAC,UAAWC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC1D,KAAMJ,EAAK,cAAgB,MAAQ,IAAA,GACnC,cAAa,GAAK,eAAgB,IAAA,GAClC,UAAU,QACV,GAAIA,CACL,CAAA,CAEL,CAAC,E"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { forwardRef as e } from "react";
|
|
2
|
-
import { AlertTriangle as t, Archive as n, ArrowLeft as r, ArrowRight as i, AudioLines as a, Bell as ee, Blocks as te, Bold as o, Calendar as s, Check as c, ChevronDown as l, ChevronLeft as u, ChevronRight as d, ChevronUp as f, ChevronsLeft as p, ChevronsRight as m, Clock as h, Code as g, Copy as _, Download as v, ExternalLink as y, Eye as b, FileText as x, Film as S, Filter as C, FolderClosed as w, Globe as T, GripHorizontal as E, GripVertical as D, Heading2 as O, Heading3 as k, Home as A, Image as j, Info as M, Italic as N, KeyRound as ne, LayoutGrid as P, Link as F, Link2Off as I, List as L, ListOrdered as R, Loader2 as z, Maximize2 as B, Menu as V, Minimize2 as H, Minus as U, MoreHorizontal as W, Pencil as G, Pipette as K, Plus as q, Quote as J, Redo2 as Y, RotateCcw as X, RotateCw as Z, Search as re, Settings as ie, Strikethrough as ae, Trash2 as oe, Undo2 as se, Upload as Q, User as ce, Users as le, X as ue } from "lucide-react";
|
|
3
|
-
import { jsx as de } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/Icon/icons.ts
|
|
5
|
-
var $ = {
|
|
6
|
-
"alert-triangle": t,
|
|
7
|
-
archive: n,
|
|
8
|
-
blocks: te,
|
|
9
|
-
film: S,
|
|
10
|
-
"audio-lines": a,
|
|
11
|
-
bold: o,
|
|
12
|
-
code: g,
|
|
13
|
-
"heading-2": O,
|
|
14
|
-
"heading-3": k,
|
|
15
|
-
italic: N,
|
|
16
|
-
"link-off": I,
|
|
17
|
-
list: L,
|
|
18
|
-
"list-ordered": R,
|
|
19
|
-
quote: J,
|
|
20
|
-
redo: Y,
|
|
21
|
-
strikethrough: ae,
|
|
22
|
-
undo: se,
|
|
23
|
-
"arrow-left": r,
|
|
24
|
-
"arrow-right": i,
|
|
25
|
-
calendar: s,
|
|
26
|
-
check: c,
|
|
27
|
-
"chevron-down": l,
|
|
28
|
-
"chevron-left": u,
|
|
29
|
-
"chevron-up": f,
|
|
30
|
-
minus: U,
|
|
31
|
-
"chevron-right": d,
|
|
32
|
-
clock: h,
|
|
33
|
-
copy: _,
|
|
34
|
-
download: v,
|
|
35
|
-
eye: b,
|
|
36
|
-
"external-link": y,
|
|
37
|
-
filter: C,
|
|
38
|
-
bell: ee,
|
|
39
|
-
"chevrons-left": p,
|
|
40
|
-
"chevrons-right": m,
|
|
41
|
-
"file-text": x,
|
|
42
|
-
folder: w,
|
|
43
|
-
globe: T,
|
|
44
|
-
home: A,
|
|
45
|
-
"layout-grid": P,
|
|
46
|
-
menu: V,
|
|
47
|
-
"maximize-2": B,
|
|
48
|
-
"minimize-2": H,
|
|
49
|
-
users: le,
|
|
50
|
-
"grip-horizontal": E,
|
|
51
|
-
"grip-vertical": D,
|
|
52
|
-
image: j,
|
|
53
|
-
info: M,
|
|
54
|
-
link: F,
|
|
55
|
-
"key-round": ne,
|
|
56
|
-
spinner: z,
|
|
57
|
-
"more-horizontal": W,
|
|
58
|
-
pencil: G,
|
|
59
|
-
pipette: K,
|
|
60
|
-
plus: q,
|
|
61
|
-
"rotate-ccw": X,
|
|
62
|
-
"rotate-cw": Z,
|
|
63
|
-
search: re,
|
|
64
|
-
settings: ie,
|
|
65
|
-
trash: oe,
|
|
66
|
-
upload: Q,
|
|
67
|
-
user: ce,
|
|
68
|
-
x: ue
|
|
69
|
-
}, fe = Object.keys($), pe = e(function({ name: e, size: t = 16, className: n, ...r }, i) {
|
|
70
|
-
let a = $[e];
|
|
71
|
-
return /* @__PURE__ */ de(a, {
|
|
72
|
-
ref: i,
|
|
73
|
-
width: t,
|
|
74
|
-
height: t,
|
|
75
|
-
className: ["ds-icon", n].filter(Boolean).join(" "),
|
|
76
|
-
role: r["aria-label"] ? "img" : void 0,
|
|
77
|
-
"aria-hidden": !r["aria-label"] || void 0,
|
|
78
|
-
focusable: "false",
|
|
79
|
-
...r
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
//#endregion
|
|
83
|
-
export { fe as n, $ as r, pe as t };
|
|
84
|
-
|
|
85
|
-
//# sourceMappingURL=Icon-spaFBU4S.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Icon-spaFBU4S.js","names":["icons","AlertTriangle","Archive","Blocks","Film","AudioLines","Bold","Code","Heading2","Heading3","Italic","Link2Off","List","ListOrdered","Quote","Redo2","Strikethrough","Undo2","ArrowLeft","ArrowRight","Calendar","Check","ChevronDown","ChevronLeft","ChevronUp","Minus","ChevronRight","Clock","Copy","Download","Eye","ExternalLink","Filter","Bell","ChevronsLeft","ChevronsRight","FileText","FolderClosed","Globe","Home","LayoutGrid","Menu","Maximize2","Minimize2","Users","GripHorizontal","GripVertical","Image","Info","Link","KeyRound","Loader2","MoreHorizontal","Pencil","Pipette","Plus","RotateCcw","RotateCw","Search","Settings","Trash2","Upload","User","X","iconNames","Icon","forwardRef","rest","Glyph","name","size","className"],"sources":["../../src/components/Icon/icons.ts","../../src/components/Icon/index.tsx"],"sourcesContent":["import {\n AlertTriangle,\n Blocks,\n Film,\n AudioLines,\n Bold,\n Code,\n Heading2,\n Heading3,\n Italic,\n Link2Off,\n List,\n ListOrdered,\n Quote,\n Redo2,\n Strikethrough,\n Undo2,\n Archive,\n ArrowLeft,\n ArrowRight,\n Calendar,\n Check,\n ChevronDown,\n ChevronLeft,\n ChevronUp,\n Minus,\n ChevronRight,\n Clock,\n Copy,\n Download,\n Eye,\n ExternalLink,\n Filter,\n Bell,\n ChevronsLeft,\n ChevronsRight,\n FileText,\n FolderClosed,\n Globe,\n Home,\n LayoutGrid,\n Menu,\n Maximize2,\n Minimize2,\n Users,\n GripHorizontal,\n GripVertical,\n Image,\n Info,\n Link,\n KeyRound,\n Loader2,\n MoreHorizontal,\n Pencil,\n Pipette,\n Plus,\n RotateCcw,\n RotateCw,\n Search,\n Settings,\n Trash2,\n Upload,\n User,\n X,\n} from \"lucide-react\";\n\n/**\n * The finite icon set. Adding a glyph means adding a line here — a visible\n * decision rather than an import someone typed at a call site.\n */\nexport const icons = {\n \"alert-triangle\": AlertTriangle,\n archive: Archive,\n blocks: Blocks,\n film: Film,\n \"audio-lines\": AudioLines,\n bold: Bold,\n code: Code,\n \"heading-2\": Heading2,\n \"heading-3\": Heading3,\n italic: Italic,\n \"link-off\": Link2Off,\n list: List,\n \"list-ordered\": ListOrdered,\n quote: Quote,\n redo: Redo2,\n strikethrough: Strikethrough,\n undo: Undo2,\n \"arrow-left\": ArrowLeft,\n \"arrow-right\": ArrowRight,\n calendar: Calendar,\n check: Check,\n \"chevron-down\": ChevronDown,\n \"chevron-left\": ChevronLeft,\n \"chevron-up\": ChevronUp,\n minus: Minus,\n \"chevron-right\": ChevronRight,\n clock: Clock,\n copy: Copy,\n download: Download,\n eye: Eye,\n \"external-link\": ExternalLink,\n filter: Filter,\n bell: Bell,\n \"chevrons-left\": ChevronsLeft,\n \"chevrons-right\": ChevronsRight,\n \"file-text\": FileText,\n folder: FolderClosed,\n globe: Globe,\n home: Home,\n \"layout-grid\": LayoutGrid,\n menu: Menu,\n \"maximize-2\": Maximize2,\n \"minimize-2\": Minimize2,\n users: Users,\n \"grip-horizontal\": GripHorizontal,\n \"grip-vertical\": GripVertical,\n image: Image,\n info: Info,\n link: Link,\n \"key-round\": KeyRound,\n spinner: Loader2,\n \"more-horizontal\": MoreHorizontal,\n pencil: Pencil,\n pipette: Pipette,\n plus: Plus,\n \"rotate-ccw\": RotateCcw,\n \"rotate-cw\": RotateCw,\n search: Search,\n settings: Settings,\n trash: Trash2,\n upload: Upload,\n user: User,\n x: X,\n} as const;\n\nexport type IconName = keyof typeof icons;\n\nexport const iconNames = Object.keys(icons) as IconName[];\n","import { forwardRef, type SVGProps } from \"react\";\nimport { icons, type IconName } from \"./icons\";\nimport \"./style.css\";\n\nexport type IconSize = 16 | 20 | 24;\n\nexport interface IconProps extends Omit<SVGProps<SVGSVGElement>, \"ref\"> {\n /** Glyph name from the curated set in `icons.ts`. */\n name: IconName;\n /** 16 inside controls, 20 standalone, 24 for empty states. No other sizes. */\n size?: IconSize;\n}\n\n/**\n * A glyph that clarifies an action or a status. Inherits `currentColor`, so it\n * takes its colour from the control it sits in — it never carries its own.\n */\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(\n { name, size = 16, className, ...rest },\n ref,\n) {\n const Glyph = icons[name];\n return (\n <Glyph\n ref={ref}\n width={size}\n height={size}\n className={[\"ds-icon\", className].filter(Boolean).join(\" \")}\n role={rest[\"aria-label\"] ? \"img\" : undefined}\n aria-hidden={rest[\"aria-label\"] ? undefined : true}\n focusable=\"false\"\n {...rest}\n />\n );\n});\n"],"mappings":";;;;AAsEA,IAAaA,IAAQ;CACnB,kBAAkBC;CAClB,SAASC;CACT,QAAQC;CACR,MAAMC;CACN,eAAeC;CACf,MAAMC;CACN,MAAMC;CACN,aAAaC;CACb,aAAaC;CACb,QAAQC;CACR,YAAYC;CACZ,MAAMC;CACN,gBAAgBC;CAChB,OAAOC;CACP,MAAMC;CACN,eAAeC;CACf,MAAMC;CACN,cAAcC;CACd,eAAeC;CACf,UAAUC;CACV,OAAOC;CACP,gBAAgBC;CAChB,gBAAgBC;CAChB,cAAcC;CACd,OAAOC;CACP,iBAAiBC;CACjB,OAAOC;CACP,MAAMC;CACN,UAAUC;CACV,KAAKC;CACL,iBAAiBC;CACjB,QAAQC;CACR,MAAMC;CACN,iBAAiBC;CACjB,kBAAkBC;CAClB,aAAaC;CACb,QAAQC;CACR,OAAOC;CACP,MAAMC;CACN,eAAeC;CACf,MAAMC;CACN,cAAcC;CACd,cAAcC;CACd,OAAOC;CACP,mBAAmBC;CACnB,iBAAiBC;CACjB,OAAOC;CACP,MAAMC;CACN,MAAMC;CACN,aAAaC;CACb,SAASC;CACT,mBAAmBC;CACnB,QAAQC;CACR,SAASC;CACT,MAAMC;CACN,cAAcC;CACd,aAAaC;CACb,QAAQC;CACR,UAAUC;CACV,OAAOC;CACP,QAAQC;CACR,MAAMC;CACN,GAAGC;AACL,GAIaC,KAAY,OAAO,KAAKhE,CAAK,GCzH7BiE,KAAOC,EAAqC,SACvD,EAAE,SAAM,UAAO,IAAI,cAAW,GAAGC,KACjC,GACA;CACA,IAAMC,IAAQpE,EAAMqE;CACpB,OACE,mBAACD,GAAD;EACO;EACL,OAAOE;EACP,QAAQA;EACR,WAAW,CAAC,WAAWC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC1D,MAAMJ,EAAK,gBAAgB,QAAQ,KAAA;EACnC,eAAa,GAAK,iBAAgB,KAAA;EAClC,WAAU;EACV,GAAIA;CACL,CAAA;AAEL,CAAC"}
|
|
@@ -1,483 +0,0 @@
|
|
|
1
|
-
import { Button as e } from "../components/Button/index.js";
|
|
2
|
-
import { t } from "./mergeRefs-C6_5pADN.js";
|
|
3
|
-
import { d as n, f as r, s as i } from "./overlayLayer-IuoPVwTO.js";
|
|
4
|
-
import { a, o } from "./dialogLabel-D18maX-p.js";
|
|
5
|
-
import { t as s } from "./useIsomorphicLayoutEffect-Bc9hxFMc.js";
|
|
6
|
-
import { ButtonGroup as c } from "../components/ButtonGroup/index.js";
|
|
7
|
-
/* empty css */
|
|
8
|
-
import { Field as l } from "../components/Field/index.js";
|
|
9
|
-
import { Modal as u } from "../components/Modal/index.js";
|
|
10
|
-
import { TextField as d } from "../components/TextField/index.js";
|
|
11
|
-
import { forwardRef as f, useCallback as p, useEffect as m, useId as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
12
|
-
import { createPortal as y } from "react-dom";
|
|
13
|
-
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
14
|
-
import { EditorContent as C, createDocument as w, getMarkRange as T, getSchema as E, useEditor as D, useEditorState as O } from "@tiptap/react";
|
|
15
|
-
import { Placeholder as k } from "@tiptap/extension-placeholder";
|
|
16
|
-
import { StarterKit as A } from "@tiptap/starter-kit";
|
|
17
|
-
import { Link as j } from "@tiptap/extension-link";
|
|
18
|
-
//#region src/components/RichTextEditor/expansion.tsx
|
|
19
|
-
function M(e, t) {
|
|
20
|
-
let n = t.querySelector(".ds-rte__content");
|
|
21
|
-
if (!n) return;
|
|
22
|
-
let r = e.view.coordsAtPos(e.state.selection.head), i = n.getBoundingClientRect();
|
|
23
|
-
(r.top < i.top || r.bottom > i.bottom) && (n.scrollTop += r.top - i.top - i.height / 2);
|
|
24
|
-
}
|
|
25
|
-
function N({ editor: t, disabled: i, invalid: c, label: l, labelledBy: d, expandedWidth: f, frameRef: m }) {
|
|
26
|
-
let g = o("ds-rte__host"), [b, S] = v(!1), [C, w] = v(0), T = _(null), E = _(null), D = _(null), O = _(!1), k = _(!1), A = h();
|
|
27
|
-
b && i && S(!1);
|
|
28
|
-
let j = p(() => {
|
|
29
|
-
O.current = document.activeElement === D.current, S(!1);
|
|
30
|
-
}, []);
|
|
31
|
-
s(() => {
|
|
32
|
-
g && (a(g, b ? E.current : T.current), k.current !== b && (k.current = b, i || !t ? n(document.activeElement) && r(m.current, { preventScroll: !0 }) : (M(t, g), !b && O.current ? D.current?.focus() : (t.view.focus(), t.commands.scrollIntoView()), O.current = !1)));
|
|
33
|
-
}, [
|
|
34
|
-
g,
|
|
35
|
-
b,
|
|
36
|
-
t,
|
|
37
|
-
i,
|
|
38
|
-
m
|
|
39
|
-
]);
|
|
40
|
-
let N = b ? "Collapse editor" : "Expand editor";
|
|
41
|
-
return {
|
|
42
|
-
expanded: b,
|
|
43
|
-
toggle: /* @__PURE__ */ x(e, {
|
|
44
|
-
ref: D,
|
|
45
|
-
size: "sm",
|
|
46
|
-
isIconOnly: !0,
|
|
47
|
-
iconStart: b ? "minimize-2" : "maximize-2",
|
|
48
|
-
className: "ds-rte__expand",
|
|
49
|
-
"aria-label": N,
|
|
50
|
-
title: N,
|
|
51
|
-
"aria-expanded": b,
|
|
52
|
-
"aria-controls": b ? A : void 0,
|
|
53
|
-
isDisabled: i || !t || !g,
|
|
54
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
55
|
-
onClick: () => {
|
|
56
|
-
b ? j() : (w(m.current.getBoundingClientRect().height), S(!0));
|
|
57
|
-
}
|
|
58
|
-
}),
|
|
59
|
-
surfaceSlot: (e) => /* @__PURE__ */ x("div", {
|
|
60
|
-
ref: T,
|
|
61
|
-
className: "ds-rte__slot",
|
|
62
|
-
children: g ? y(e, g) : e
|
|
63
|
-
}),
|
|
64
|
-
dialog: /* @__PURE__ */ x(u, {
|
|
65
|
-
id: A,
|
|
66
|
-
isOpen: b,
|
|
67
|
-
onClose: j,
|
|
68
|
-
title: l,
|
|
69
|
-
hasHeader: !1,
|
|
70
|
-
size: f === "full" ? "full" : "wide",
|
|
71
|
-
className: "ds-rte__modal",
|
|
72
|
-
"data-invalid": c || void 0,
|
|
73
|
-
"aria-labelledby": d,
|
|
74
|
-
children: /* @__PURE__ */ x("div", {
|
|
75
|
-
ref: E,
|
|
76
|
-
className: "ds-rte__expanded-slot"
|
|
77
|
-
})
|
|
78
|
-
}),
|
|
79
|
-
frameStyle: b ? { minBlockSize: C } : void 0
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/components/RichTextEditor/document.ts
|
|
84
|
-
var P = {
|
|
85
|
-
type: "doc",
|
|
86
|
-
content: [{ type: "paragraph" }]
|
|
87
|
-
};
|
|
88
|
-
function F() {
|
|
89
|
-
return [A.configure({ link: !1 }), j.configure({
|
|
90
|
-
openOnClick: !1,
|
|
91
|
-
autolink: !0
|
|
92
|
-
})];
|
|
93
|
-
}
|
|
94
|
-
var I = E(F());
|
|
95
|
-
function L(e) {
|
|
96
|
-
return e.content?.length ? e : {
|
|
97
|
-
...e,
|
|
98
|
-
content: P.content
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function R(e) {
|
|
102
|
-
try {
|
|
103
|
-
if (!e || typeof e != "object" || !("type" in e) || e.type !== "doc") throw Error();
|
|
104
|
-
let t = (e) => {
|
|
105
|
-
let n = I.nodes[e.type ?? ""];
|
|
106
|
-
if (!n || Object.keys(e).some((e) => ![
|
|
107
|
-
"type",
|
|
108
|
-
"attrs",
|
|
109
|
-
"content",
|
|
110
|
-
"marks",
|
|
111
|
-
"text"
|
|
112
|
-
].includes(e)) || e.text !== void 0 && e.type !== "text" || e.attrs && Object.keys(e.attrs).some((e) => !Object.hasOwn(n.spec.attrs ?? {}, e))) throw Error();
|
|
113
|
-
for (let t of e.marks ?? []) {
|
|
114
|
-
let e = I.marks[t.type];
|
|
115
|
-
if (!e || Object.keys(t).some((e) => !["type", "attrs"].includes(e)) || Object.keys(t.attrs ?? {}).some((t) => !Object.hasOwn(e.spec.attrs ?? {}, t))) throw Error();
|
|
116
|
-
}
|
|
117
|
-
e.content?.forEach(t);
|
|
118
|
-
}, n = e;
|
|
119
|
-
t(n), I.nodeFromJSON(L(n)).check();
|
|
120
|
-
} catch {
|
|
121
|
-
return "Unsupported or invalid rich-text document.";
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/components/RichTextEditor/index.tsx
|
|
126
|
-
function z({ editor: t, selection: n, onClose: r }) {
|
|
127
|
-
let [i, a] = v(n.href), [o, s] = v(), c = h();
|
|
128
|
-
m(() => {
|
|
129
|
-
let e = () => {
|
|
130
|
-
t.state.doc.eq(n.document) || r();
|
|
131
|
-
};
|
|
132
|
-
return t.on("transaction", e), () => {
|
|
133
|
-
t.off("transaction", e);
|
|
134
|
-
};
|
|
135
|
-
}, [
|
|
136
|
-
t,
|
|
137
|
-
n,
|
|
138
|
-
r
|
|
139
|
-
]);
|
|
140
|
-
let f = () => !t.isDestroyed && t.isEditable && t.state.doc.eq(n.document), p = () => {
|
|
141
|
-
if (!f()) {
|
|
142
|
-
r();
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
let e = i.trim();
|
|
146
|
-
if (!e || !t.can().setLink({ href: e })) {
|
|
147
|
-
s(e ? "Enter a valid link URL." : "Enter a link URL.");
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
let a = t.chain().focus().setTextSelection({
|
|
151
|
-
from: n.from,
|
|
152
|
-
to: n.to
|
|
153
|
-
});
|
|
154
|
-
n.from === n.to && !n.isEditing ? a.setLink({ href: e }).insertContent({
|
|
155
|
-
type: "text",
|
|
156
|
-
text: e,
|
|
157
|
-
marks: [{
|
|
158
|
-
type: "link",
|
|
159
|
-
attrs: { href: e }
|
|
160
|
-
}]
|
|
161
|
-
}).run() : a.setLink({ href: e }).run(), r();
|
|
162
|
-
};
|
|
163
|
-
return /* @__PURE__ */ x(u, {
|
|
164
|
-
isOpen: !0,
|
|
165
|
-
title: n.isEditing ? "Edit link" : "Add link",
|
|
166
|
-
size: "dialog",
|
|
167
|
-
onClose: r,
|
|
168
|
-
footer: /* @__PURE__ */ S(b, { children: [
|
|
169
|
-
n.isEditing && /* @__PURE__ */ x(e, {
|
|
170
|
-
variant: "danger",
|
|
171
|
-
onClick: () => {
|
|
172
|
-
f() && t.chain().focus().setTextSelection({
|
|
173
|
-
from: n.from,
|
|
174
|
-
to: n.to
|
|
175
|
-
}).unsetLink().run(), r();
|
|
176
|
-
},
|
|
177
|
-
children: "Remove link"
|
|
178
|
-
}),
|
|
179
|
-
/* @__PURE__ */ x(e, {
|
|
180
|
-
onClick: r,
|
|
181
|
-
children: "Cancel"
|
|
182
|
-
}),
|
|
183
|
-
/* @__PURE__ */ x(e, {
|
|
184
|
-
variant: "primary",
|
|
185
|
-
type: "submit",
|
|
186
|
-
form: c,
|
|
187
|
-
children: "Save"
|
|
188
|
-
})
|
|
189
|
-
] }),
|
|
190
|
-
children: /* @__PURE__ */ x("form", {
|
|
191
|
-
id: c,
|
|
192
|
-
noValidate: !0,
|
|
193
|
-
onSubmit: (e) => {
|
|
194
|
-
e.preventDefault(), e.stopPropagation(), p();
|
|
195
|
-
},
|
|
196
|
-
children: /* @__PURE__ */ x(l, {
|
|
197
|
-
label: "URL",
|
|
198
|
-
isRequired: !0,
|
|
199
|
-
error: o,
|
|
200
|
-
children: (e) => /* @__PURE__ */ x(d, {
|
|
201
|
-
...e,
|
|
202
|
-
value: i,
|
|
203
|
-
inputMode: "url",
|
|
204
|
-
autoComplete: "url",
|
|
205
|
-
placeholder: "https://example.com",
|
|
206
|
-
onChange: (e) => {
|
|
207
|
-
a(e.target.value), s(void 0);
|
|
208
|
-
}
|
|
209
|
-
})
|
|
210
|
-
})
|
|
211
|
-
})
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
var B = [
|
|
215
|
-
[
|
|
216
|
-
{
|
|
217
|
-
id: "bold",
|
|
218
|
-
icon: "bold",
|
|
219
|
-
label: "Bold",
|
|
220
|
-
run: (e) => e.chain().focus().toggleBold().run(),
|
|
221
|
-
active: (e) => e.isActive("bold")
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
id: "italic",
|
|
225
|
-
icon: "italic",
|
|
226
|
-
label: "Italic",
|
|
227
|
-
run: (e) => e.chain().focus().toggleItalic().run(),
|
|
228
|
-
active: (e) => e.isActive("italic")
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
id: "strike",
|
|
232
|
-
icon: "strikethrough",
|
|
233
|
-
label: "Strikethrough",
|
|
234
|
-
run: (e) => e.chain().focus().toggleStrike().run(),
|
|
235
|
-
active: (e) => e.isActive("strike")
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
id: "code",
|
|
239
|
-
icon: "code",
|
|
240
|
-
label: "Inline code",
|
|
241
|
-
run: (e) => e.chain().focus().toggleCode().run(),
|
|
242
|
-
active: (e) => e.isActive("code")
|
|
243
|
-
}
|
|
244
|
-
],
|
|
245
|
-
[
|
|
246
|
-
{
|
|
247
|
-
id: "h2",
|
|
248
|
-
icon: "heading-2",
|
|
249
|
-
label: "Heading",
|
|
250
|
-
run: (e) => e.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
251
|
-
active: (e) => e.isActive("heading", { level: 2 })
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
id: "h3",
|
|
255
|
-
icon: "heading-3",
|
|
256
|
-
label: "Subheading",
|
|
257
|
-
run: (e) => e.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
258
|
-
active: (e) => e.isActive("heading", { level: 3 })
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
id: "quote",
|
|
262
|
-
icon: "quote",
|
|
263
|
-
label: "Quote",
|
|
264
|
-
run: (e) => e.chain().focus().toggleBlockquote().run(),
|
|
265
|
-
active: (e) => e.isActive("blockquote")
|
|
266
|
-
}
|
|
267
|
-
],
|
|
268
|
-
[{
|
|
269
|
-
id: "ul",
|
|
270
|
-
icon: "list",
|
|
271
|
-
label: "Bulleted list",
|
|
272
|
-
run: (e) => e.chain().focus().toggleBulletList().run(),
|
|
273
|
-
active: (e) => e.isActive("bulletList")
|
|
274
|
-
}, {
|
|
275
|
-
id: "ol",
|
|
276
|
-
icon: "list-ordered",
|
|
277
|
-
label: "Numbered list",
|
|
278
|
-
run: (e) => e.chain().focus().toggleOrderedList().run(),
|
|
279
|
-
active: (e) => e.isActive("orderedList")
|
|
280
|
-
}],
|
|
281
|
-
[{
|
|
282
|
-
id: "undo",
|
|
283
|
-
icon: "undo",
|
|
284
|
-
label: "Undo",
|
|
285
|
-
run: (e) => e.chain().focus().undo().run()
|
|
286
|
-
}, {
|
|
287
|
-
id: "redo",
|
|
288
|
-
icon: "redo",
|
|
289
|
-
label: "Redo",
|
|
290
|
-
run: (e) => e.chain().focus().redo().run()
|
|
291
|
-
}]
|
|
292
|
-
];
|
|
293
|
-
function ee({ editor: t, state: n, disabled: r, label: i, toolbarExtra: a, openLink: o, expandControl: s }) {
|
|
294
|
-
return /* @__PURE__ */ S("div", {
|
|
295
|
-
className: "ds-rte__toolbar",
|
|
296
|
-
role: "toolbar",
|
|
297
|
-
"aria-label": `${i} formatting`,
|
|
298
|
-
children: [
|
|
299
|
-
B.map((i, a) => /* @__PURE__ */ x(c, {
|
|
300
|
-
"aria-label": `Formatting ${a + 1}`,
|
|
301
|
-
children: i.map((i) => /* @__PURE__ */ x(e, {
|
|
302
|
-
size: "sm",
|
|
303
|
-
isIconOnly: !0,
|
|
304
|
-
iconStart: i.icon,
|
|
305
|
-
"aria-label": i.label,
|
|
306
|
-
title: i.label,
|
|
307
|
-
"aria-pressed": i.active ? n?.active[i.id] : void 0,
|
|
308
|
-
variant: n?.active[i.id] ? "active" : "neutral",
|
|
309
|
-
isDisabled: r || !t,
|
|
310
|
-
onClick: () => t && i.run(t)
|
|
311
|
-
}, i.id))
|
|
312
|
-
}, a)),
|
|
313
|
-
/* @__PURE__ */ x(c, {
|
|
314
|
-
"aria-label": "Link",
|
|
315
|
-
children: /* @__PURE__ */ x(e, {
|
|
316
|
-
size: "sm",
|
|
317
|
-
isIconOnly: !0,
|
|
318
|
-
iconStart: "link",
|
|
319
|
-
"aria-label": n?.linkActive ? "Edit link" : "Add link",
|
|
320
|
-
title: n?.linkActive ? "Edit link" : "Add link",
|
|
321
|
-
variant: n?.linkActive ? "active" : "neutral",
|
|
322
|
-
isDisabled: r || !t,
|
|
323
|
-
onClick: () => t && o(t.state, t.isActive("link") ? t.state.selection.from : void 0)
|
|
324
|
-
})
|
|
325
|
-
}),
|
|
326
|
-
a,
|
|
327
|
-
s
|
|
328
|
-
]
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
var te = f(function({ scopeRef: e, className: t, expansion: n, isFocused: r, disabled: a, invalid: o, contentError: s, errorId: c, surface: l, children: u }, d) {
|
|
332
|
-
return /* @__PURE__ */ x(i.Provider, {
|
|
333
|
-
value: e,
|
|
334
|
-
children: /* @__PURE__ */ S("div", {
|
|
335
|
-
ref: d,
|
|
336
|
-
className: ["ds-rte", t].filter(Boolean).join(" "),
|
|
337
|
-
style: n.frameStyle,
|
|
338
|
-
"data-expanded": n.expanded || void 0,
|
|
339
|
-
"data-focused": r && !n.expanded || void 0,
|
|
340
|
-
"data-disabled": a || void 0,
|
|
341
|
-
"aria-invalid": o || void 0,
|
|
342
|
-
children: [
|
|
343
|
-
s && /* @__PURE__ */ x("p", {
|
|
344
|
-
id: c,
|
|
345
|
-
role: "alert",
|
|
346
|
-
className: "ds-field__error",
|
|
347
|
-
children: s
|
|
348
|
-
}),
|
|
349
|
-
n.expanded && /* @__PURE__ */ x("p", {
|
|
350
|
-
className: "ds-rte__placeholder",
|
|
351
|
-
children: "Editing in expanded view. Press Esc to return."
|
|
352
|
-
}),
|
|
353
|
-
n.surfaceSlot(/* @__PURE__ */ x("div", {
|
|
354
|
-
className: "ds-rte__surface",
|
|
355
|
-
hidden: !!s,
|
|
356
|
-
"data-invalid": o || void 0,
|
|
357
|
-
children: l
|
|
358
|
-
})),
|
|
359
|
-
n.dialog,
|
|
360
|
-
u
|
|
361
|
-
]
|
|
362
|
-
})
|
|
363
|
-
});
|
|
364
|
-
});
|
|
365
|
-
function ne(e, t) {
|
|
366
|
-
return t.key !== "Escape" || t.isComposing ? !1 : (e.someProp("handleKeyDown", (n) => n(e, t)) && t.preventDefault(), !0);
|
|
367
|
-
}
|
|
368
|
-
var V = f(function(e, n) {
|
|
369
|
-
let { placeholder: r = "Write something…", size: i = "md", expandedWidth: a = "wide", isDisabled: o = !1, isInvalid: s = !1, label: c = "Rich text editor", className: l, toolbarExtra: u, id: d, isRequired: f, required: y, "aria-label": E, "aria-labelledby": A, "aria-describedby": j, "aria-invalid": M } = e, I = _(null), V = g(() => t(I, n), [n]), [re, H] = v(!1), [U, W] = v(null), ie = p(() => W(null), []), [ae] = v(() => e.defaultValue ?? (e.format === "json" ? P : "")), G = e.value === void 0 ? ae : e.value, K = g(() => e.format === "json" ? R(G) : void 0, [e.format, G]), oe = h(), q = s || !!K || M, J = o || !!K;
|
|
370
|
-
J && U && W(null);
|
|
371
|
-
let Y = p((e, t) => {
|
|
372
|
-
if (J) return;
|
|
373
|
-
let n = t === void 0 ? void 0 : T(e.doc.resolve(t), e.schema.marks.link), r = n && e.doc.nodeAt(n.from)?.marks.find((t) => t.type === e.schema.marks.link);
|
|
374
|
-
W({
|
|
375
|
-
from: n?.from ?? e.selection.from,
|
|
376
|
-
to: n?.to ?? e.selection.to,
|
|
377
|
-
href: r?.attrs.href ?? "",
|
|
378
|
-
isEditing: !!r,
|
|
379
|
-
document: e.doc
|
|
380
|
-
});
|
|
381
|
-
}, [J]), X = g(() => ({
|
|
382
|
-
role: "textbox",
|
|
383
|
-
...A ? {} : { "aria-label": E ?? c },
|
|
384
|
-
"aria-multiline": "true",
|
|
385
|
-
...d ? { id: d } : {},
|
|
386
|
-
...A ? { "aria-labelledby": A } : {},
|
|
387
|
-
...j ? { "aria-describedby": j } : {},
|
|
388
|
-
...q ? { "aria-invalid": String(q) } : {},
|
|
389
|
-
...f || y ? { "aria-required": "true" } : {}
|
|
390
|
-
}), [
|
|
391
|
-
c,
|
|
392
|
-
E,
|
|
393
|
-
d,
|
|
394
|
-
A,
|
|
395
|
-
j,
|
|
396
|
-
q,
|
|
397
|
-
f,
|
|
398
|
-
y
|
|
399
|
-
]), Z = g(() => ({
|
|
400
|
-
attributes: X,
|
|
401
|
-
handleDOMEvents: {
|
|
402
|
-
keydown: ne,
|
|
403
|
-
click: (e, t) => {
|
|
404
|
-
let n = t.target instanceof Element ? t.target.closest("a") : null;
|
|
405
|
-
return !n || !e.dom.contains(n) ? !1 : (t.preventDefault(), e.editable && Y(e.state, e.posAtDOM(n, 0)), !0);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}), [X, Y]), Q = D({
|
|
409
|
-
immediatelyRender: !1,
|
|
410
|
-
editable: !J,
|
|
411
|
-
content: K ? P : typeof G == "string" ? G : L(G),
|
|
412
|
-
extensions: [...F(), k.configure({ placeholder: r })],
|
|
413
|
-
editorProps: Z,
|
|
414
|
-
onFocus: () => H(!0),
|
|
415
|
-
onBlur: () => H(!1),
|
|
416
|
-
onUpdate: ({ editor: t }) => {
|
|
417
|
-
J || (e.format === "json" ? e.onChange?.(t.getJSON()) : e.onChange?.(t.getHTML()));
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
m(() => {
|
|
421
|
-
Q && (Q.setEditable(!J, !1), Q.setOptions({ editorProps: Z }));
|
|
422
|
-
}, [
|
|
423
|
-
Q,
|
|
424
|
-
J,
|
|
425
|
-
Z
|
|
426
|
-
]), m(() => {
|
|
427
|
-
if (!Q || e.value === void 0 || K) return;
|
|
428
|
-
let t = typeof e.value == "string" ? w(e.value, Q.schema) : Q.schema.nodeFromJSON(L(e.value));
|
|
429
|
-
t.eq(Q.state.doc) || Q.commands.setContent(t, { emitUpdate: !1 });
|
|
430
|
-
}, [
|
|
431
|
-
Q,
|
|
432
|
-
e.value,
|
|
433
|
-
K
|
|
434
|
-
]);
|
|
435
|
-
let se = O({
|
|
436
|
-
editor: Q,
|
|
437
|
-
selector: ({ editor: e }) => e ? {
|
|
438
|
-
active: Object.fromEntries(B.flat().map((t) => [t.id, t.active?.(e) ?? !1])),
|
|
439
|
-
linkActive: e.isActive("link")
|
|
440
|
-
} : null
|
|
441
|
-
}), $ = N({
|
|
442
|
-
editor: Q,
|
|
443
|
-
disabled: J,
|
|
444
|
-
invalid: !!q,
|
|
445
|
-
label: E ?? c,
|
|
446
|
-
labelledBy: A,
|
|
447
|
-
expandedWidth: a,
|
|
448
|
-
frameRef: I
|
|
449
|
-
});
|
|
450
|
-
return /* @__PURE__ */ x(te, {
|
|
451
|
-
ref: V,
|
|
452
|
-
scopeRef: I,
|
|
453
|
-
className: l,
|
|
454
|
-
expansion: $,
|
|
455
|
-
isFocused: re,
|
|
456
|
-
disabled: J,
|
|
457
|
-
invalid: !!q,
|
|
458
|
-
contentError: K,
|
|
459
|
-
errorId: oe,
|
|
460
|
-
surface: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(ee, {
|
|
461
|
-
editor: Q,
|
|
462
|
-
state: se,
|
|
463
|
-
disabled: J,
|
|
464
|
-
label: c,
|
|
465
|
-
toolbarExtra: u,
|
|
466
|
-
openLink: Y,
|
|
467
|
-
expandControl: $.toggle
|
|
468
|
-
}), /* @__PURE__ */ x("div", {
|
|
469
|
-
className: "ds-rte__content",
|
|
470
|
-
"data-size": i,
|
|
471
|
-
children: /* @__PURE__ */ x(C, { editor: Q })
|
|
472
|
-
})] }),
|
|
473
|
-
children: Q && U && !J && /* @__PURE__ */ x(z, {
|
|
474
|
-
editor: Q,
|
|
475
|
-
selection: U,
|
|
476
|
-
onClose: ie
|
|
477
|
-
})
|
|
478
|
-
});
|
|
479
|
-
});
|
|
480
|
-
//#endregion
|
|
481
|
-
export { R as n, P as r, V as t };
|
|
482
|
-
|
|
483
|
-
//# sourceMappingURL=RichTextEditor-CuZnjiy2.js.map
|