@thangph2146/lexical-editor 0.0.5 → 0.0.7

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 (40) hide show
  1. package/README.md +47 -0
  2. package/dist/editor-x/editor.cjs +610 -493
  3. package/dist/editor-x/editor.cjs.map +1 -1
  4. package/dist/editor-x/editor.css +157 -69
  5. package/dist/editor-x/editor.css.map +1 -1
  6. package/dist/editor-x/editor.d.cts +2 -1
  7. package/dist/editor-x/editor.d.ts +2 -1
  8. package/dist/editor-x/editor.js +350 -233
  9. package/dist/editor-x/editor.js.map +1 -1
  10. package/dist/index.cjs +620 -501
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.css +157 -69
  13. package/dist/index.css.map +1 -1
  14. package/dist/index.d.cts +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +354 -235
  17. package/dist/index.js.map +1 -1
  18. package/package.json +3 -1
  19. package/src/components/lexical-editor.tsx +2 -0
  20. package/src/editor-x/editor.tsx +4 -2
  21. package/src/editor-x/plugins.tsx +7 -6
  22. package/src/plugins/images-plugin.tsx +3 -2
  23. package/src/plugins/layout-plugin.tsx +96 -61
  24. package/src/themes/_mixins.scss +12 -7
  25. package/src/themes/_variables.scss +2 -1
  26. package/src/themes/core/_reset.scss +10 -6
  27. package/src/themes/plugins/_color-picker.scss +1 -0
  28. package/src/themes/plugins/_layout.scss +3 -7
  29. package/src/themes/plugins/_list-color.scss +2 -0
  30. package/src/themes/plugins/_toolbar.scss +7 -7
  31. package/src/themes/ui-components/_button.scss +3 -3
  32. package/src/themes/ui-components/_flex.scss +2 -0
  33. package/src/themes/ui-components/_number-input.scss +81 -0
  34. package/src/themes/ui-components/_text-utilities.scss +1 -1
  35. package/src/themes/ui-components.scss +1 -0
  36. package/src/ui/flex.tsx +9 -2
  37. package/src/ui/number-input.tsx +104 -0
  38. package/src/themes/editor-theme copy.scss +0 -763
  39. package/src/themes/plugins copy.scss +0 -656
  40. package/src/themes/ui-components copy.scss +0 -1335
package/package.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "@thangph2146/lexical-editor",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
+ "description": "Rich Text Editor library based on Lexical for React/Next.js",
5
+ "license": "MIT",
4
6
  "type": "module",
5
7
  "private": false,
6
8
  "main": "./dist/index.cjs",
@@ -30,6 +30,7 @@ export function LexicalEditor({
30
30
  onChange,
31
31
  readOnly = false,
32
32
  className,
33
+ placeholder = "",
33
34
  }: LexicalEditorProps) {
34
35
  // Parse initial value as SerializedEditorState
35
36
  const [editorState, setEditorState] = useState<SerializedEditorState | undefined>(() => {
@@ -132,6 +133,7 @@ export function LexicalEditor({
132
133
  editorSerializedState={editorState}
133
134
  onSerializedChange={handleSerializedChange}
134
135
  readOnly={readOnly}
136
+ placeholder={placeholder}
135
137
  />
136
138
  </div>
137
139
  )
@@ -39,19 +39,21 @@ export function Editor({
39
39
  onChange,
40
40
  onSerializedChange,
41
41
  readOnly = false,
42
+ placeholder = "",
42
43
  }: {
43
44
  editorState?: EditorState
44
45
  editorSerializedState?: SerializedEditorState
45
46
  onChange?: (editorState: EditorState) => void
46
47
  onSerializedChange?: (editorSerializedState: SerializedEditorState) => void
47
48
  readOnly?: boolean
49
+ placeholder?: string
48
50
  }) {
49
51
  const { ref: editorRef, width: editorWidth } = useElementSize<HTMLDivElement>()
50
52
  const editorMaxWidth = editorWidth || undefined
51
53
 
52
54
  const [config, setConfig] = useState<{
53
55
  nodes: InitialConfigType["nodes"]
54
- Plugins: React.ComponentType<{ readOnly?: boolean }>
56
+ Plugins: React.ComponentType<{ readOnly?: boolean; placeholder?: string }>
55
57
  } | null>(null)
56
58
 
57
59
  useEffect(() => {
@@ -111,7 +113,7 @@ export function Editor({
111
113
  }}
112
114
  >
113
115
  <TooltipProvider>
114
- <Plugins readOnly={readOnly} />
116
+ <Plugins readOnly={readOnly} placeholder={placeholder} />
115
117
 
116
118
  {!readOnly && (
117
119
  <OnChangePlugin
@@ -110,13 +110,14 @@ import { TABLE } from "../transformers/markdown-table-transformer"
110
110
  import { TWEET } from "../transformers/markdown-tweet-transformer"
111
111
  import { UNORDERED_LIST } from "../transformers/markdown-list-transformer"
112
112
  import { Separator } from "../ui/separator"
113
-
114
- const placeholder = "Press / for commands..."
113
+ import { Flex } from "../ui/flex"
115
114
 
116
115
  export function Plugins({
117
116
  readOnly = false,
117
+ placeholder = "",
118
118
  }: {
119
119
  readOnly?: boolean
120
+ placeholder?: string
120
121
  }) {
121
122
  const [floatingAnchorElem, setFloatingAnchorElem] =
122
123
  useState<HTMLDivElement | null>(null)
@@ -349,11 +350,11 @@ export function Plugins({
349
350
  {!readOnly && (
350
351
  <ActionsPlugin>
351
352
  <div className="editor-actions-bar">
352
- <div className="editor-flex-shrink-0">
353
+ <Flex align="center" className="editor-flex-shrink-0">
353
354
  <CounterCharacterPlugin charset="UTF-16" />
354
- </div>
355
+ </Flex>
355
356
  <div className="editor-flex-1" />
356
- <div className="editor-flex-shrink-0 editor-flex-end">
357
+ <Flex align="center" justify="end" gap={1} wrap="nowrap" className="editor-flex-shrink-0">
357
358
  <SpeechToTextPlugin />
358
359
  <ShareContentPlugin />
359
360
  <ImportExportPlugin />
@@ -376,7 +377,7 @@ export function Plugins({
376
377
  <EditModeTogglePlugin />
377
378
  <ClearEditorActionPlugin />
378
379
  <TreeViewPlugin />
379
- </div>
380
+ </Flex>
380
381
  </div>
381
382
  </ActionsPlugin>
382
383
  )}
@@ -41,6 +41,7 @@ import { Button } from "../ui/button"
41
41
  import { DialogFooter } from "../ui/dialog"
42
42
  import { Input } from "../ui/input"
43
43
  import { Label } from "../ui/label"
44
+ import { Flex } from "../ui/flex"
44
45
  import {
45
46
  Tabs,
46
47
  TabsContent,
@@ -337,9 +338,9 @@ export function InsertImageUploadsDialogBody({
337
338
  <div className="editor-form-item">
338
339
  <Label>Chọn hình ảnh từ thư viện</Label>
339
340
  {isLoading ? (
340
- <div className="editor-flex-center-justify-py-8">
341
+ <Flex align="center" justify="center" className="editor-py-8">
341
342
  <Loader2 className="editor-loader" />
342
- </div>
343
+ </Flex>
343
344
  ) : !folderTree || (folderTree.subfolders.length === 0 && folderTree.images.length === 0) ? (
344
345
  <div className="editor-empty-state">
345
346
  <TypographySpanSmallMuted>Chưa có hình ảnh nào được upload</TypographySpanSmallMuted>
@@ -43,6 +43,7 @@ import {
43
43
  LayoutItemNode,
44
44
  } from "../nodes/layout-item-node"
45
45
  import { Button } from "../ui/button"
46
+ import { NumberInput } from "../ui/number-input"
46
47
  import {
47
48
  Select,
48
49
  SelectContent,
@@ -82,14 +83,16 @@ type InsertLayoutPayload =
82
83
  | {
83
84
  template: string
84
85
  itemBackgroundColor?: string
85
- itemPaddingPx?: number
86
+ itemPaddingXPx?: number
87
+ itemPaddingYPx?: number
86
88
  itemBorderRadiusPx?: number
87
89
  }
88
90
 
89
91
  type LayoutDialogValues = {
90
92
  template: string
91
93
  itemBackgroundColor: string
92
- itemPaddingPx: number
94
+ itemPaddingXPx: number
95
+ itemPaddingYPx: number
93
96
  itemBorderRadiusPx: number
94
97
  }
95
98
 
@@ -116,13 +119,15 @@ export function InsertLayoutDialog({
116
119
  const [backgroundColor, setBackgroundColor] = useState(
117
120
  initialValues?.itemBackgroundColor ?? "#ffffff"
118
121
  )
119
- const [paddingPx, setPaddingPx] = useState(initialValues?.itemPaddingPx ?? 12)
122
+ const [paddingXPx, setPaddingXPx] = useState(initialValues?.itemPaddingXPx ?? 12)
123
+ const [paddingYPx, setPaddingYPx] = useState(initialValues?.itemPaddingYPx ?? 12)
120
124
  const [borderRadiusPx, setBorderRadiusPx] = useState(
121
125
  initialValues?.itemBorderRadiusPx ?? 8
122
126
  )
123
127
  const layoutRef = useRef(layout)
124
128
  const backgroundColorRef = useRef(backgroundColor)
125
- const paddingPxRef = useRef(paddingPx)
129
+ const paddingXPxRef = useRef(paddingXPx)
130
+ const paddingYPxRef = useRef(paddingYPx)
126
131
  const borderRadiusPxRef = useRef(borderRadiusPx)
127
132
 
128
133
  useEffect(() => {
@@ -132,8 +137,11 @@ export function InsertLayoutDialog({
132
137
  backgroundColorRef.current = backgroundColor
133
138
  }, [backgroundColor])
134
139
  useEffect(() => {
135
- paddingPxRef.current = paddingPx
136
- }, [paddingPx])
140
+ paddingXPxRef.current = paddingXPx
141
+ }, [paddingXPx])
142
+ useEffect(() => {
143
+ paddingYPxRef.current = paddingYPx
144
+ }, [paddingYPx])
137
145
  useEffect(() => {
138
146
  borderRadiusPxRef.current = borderRadiusPx
139
147
  }, [borderRadiusPx])
@@ -143,10 +151,16 @@ export function InsertLayoutDialog({
143
151
  setBackgroundColor(value)
144
152
  }
145
153
 
146
- const onPaddingChange = (next: number) => {
154
+ const onPaddingXChange = (next: number) => {
147
155
  const value = Math.min(Math.max(next, 0), 64)
148
- paddingPxRef.current = value
149
- setPaddingPx(value)
156
+ paddingXPxRef.current = value
157
+ setPaddingXPx(value)
158
+ }
159
+
160
+ const onPaddingYChange = (next: number) => {
161
+ const value = Math.min(Math.max(next, 0), 64)
162
+ paddingYPxRef.current = value
163
+ setPaddingYPx(value)
150
164
  }
151
165
 
152
166
  const onBorderRadiusChange = (next: number) => {
@@ -160,7 +174,8 @@ export function InsertLayoutDialog({
160
174
  const values: LayoutDialogValues = {
161
175
  template: layoutRef.current,
162
176
  itemBackgroundColor: backgroundColorRef.current,
163
- itemPaddingPx: paddingPxRef.current,
177
+ itemPaddingXPx: paddingXPxRef.current,
178
+ itemPaddingYPx: paddingYPxRef.current,
164
179
  itemBorderRadiusPx: borderRadiusPxRef.current,
165
180
  }
166
181
  logger.info("[Layout] Submit dialog values", {
@@ -177,7 +192,7 @@ export function InsertLayoutDialog({
177
192
  }
178
193
 
179
194
  return (
180
- <>
195
+ <Flex direction="column" gap={4}>
181
196
  <Select onValueChange={setLayout} value={layout}>
182
197
  <SelectTrigger className="editor-input-lg editor-w-full">
183
198
  <SelectValue placeholder={buttonLabel} />
@@ -191,7 +206,7 @@ export function InsertLayoutDialog({
191
206
  </SelectContent>
192
207
  </Select>
193
208
  <div className="editor-layout-dialog-grid">
194
- <div className="editor-layout-dialog-group">
209
+ <Flex direction="column" gap={1.5}>
195
210
  <div className="editor-text-xs-muted">Background</div>
196
211
  <ColorPicker
197
212
  modal
@@ -227,48 +242,37 @@ export function InsertLayoutDialog({
227
242
  <ColorPickerPresets />
228
243
  </ColorPickerContent>
229
244
  </ColorPicker>
230
- </div>
231
- <div className="editor-layout-dialog-group">
232
- <div className="editor-text-xs-muted">Padding (px)</div>
233
- <Input
234
- type="number"
245
+ </Flex>
246
+ <Flex direction="column" gap={1.5}>
247
+ <div className="editor-text-xs-muted">Padding X (px)</div>
248
+ <NumberInput
235
249
  min={0}
236
250
  max={64}
237
- step={1}
238
- value={paddingPx}
239
- onChange={(event) => {
240
- const next = Number.parseInt(event.target.value, 10)
241
- if (Number.isFinite(next)) {
242
- onPaddingChange(next)
243
- } else {
244
- onPaddingChange(0)
245
- }
246
- }}
247
- className="editor-input-lg editor-w-full"
251
+ value={paddingXPx}
252
+ onValueChange={onPaddingXChange}
248
253
  />
249
- </div>
250
- <div className="editor-layout-dialog-group">
254
+ </Flex>
255
+ <Flex direction="column" gap={1.5}>
256
+ <div className="editor-text-xs-muted">Padding Y (px)</div>
257
+ <NumberInput
258
+ min={0}
259
+ max={64}
260
+ value={paddingYPx}
261
+ onValueChange={onPaddingYChange}
262
+ />
263
+ </Flex>
264
+ <Flex direction="column" gap={1.5}>
251
265
  <div className="editor-text-xs-muted">Border radius (px)</div>
252
- <Input
253
- type="number"
266
+ <NumberInput
254
267
  min={0}
255
268
  max={64}
256
- step={1}
257
269
  value={borderRadiusPx}
258
- onChange={(event) => {
259
- const next = Number.parseInt(event.target.value, 10)
260
- if (Number.isFinite(next)) {
261
- onBorderRadiusChange(next)
262
- } else {
263
- onBorderRadiusChange(0)
264
- }
265
- }}
266
- className="editor-input-lg editor-w-full"
270
+ onValueChange={onBorderRadiusChange}
267
271
  />
268
- </div>
272
+ </Flex>
269
273
  </div>
270
274
  <Button onClick={onClick}>{submitLabel}</Button>
271
- </>
275
+ </Flex>
272
276
  )
273
277
  }
274
278
 
@@ -339,29 +343,42 @@ export function LayoutPlugin(): JSX.Element | null {
339
343
  return match?.[1]?.trim()
340
344
  }
341
345
 
342
- const extractNumericStyle = (style: string, property: string): number | undefined => {
346
+ const extractNumericStyle = (style: string, property: string): number[] | undefined => {
343
347
  const value = extractStyleValue(style, property)
344
348
  if (!value) {
345
349
  return undefined
346
350
  }
347
- const match = value.match(/^(\d+)px$/i)
348
- if (!match?.[1]) {
349
- return undefined
350
- }
351
- const parsed = Number.parseInt(match[1], 10)
352
- return Number.isFinite(parsed) ? parsed : undefined
351
+ // Remove !important and split by whitespace
352
+ const values = value.replace(/!important/gi, "").trim().split(/\s+/)
353
+ const parsedValues = values
354
+ .map((v) => {
355
+ const match = v.match(/^(\d+)px/i)
356
+ if (!match?.[1]) return null
357
+ const parsed = Number.parseInt(match[1], 10)
358
+ return Number.isFinite(parsed) ? parsed : null
359
+ })
360
+ .filter((v): v is number => v !== null)
361
+
362
+ if (parsedValues.length === 0) return undefined
363
+ return parsedValues
353
364
  }
354
365
 
355
366
  const buildLayoutItemStyle = ({
356
367
  itemBackgroundColor,
357
- itemPaddingPx,
368
+ itemPaddingXPx,
369
+ itemPaddingYPx,
358
370
  itemBorderRadiusPx,
359
371
  }: LayoutDialogValues): string => {
360
372
  const itemStyles: string[] = []
361
373
  if (itemBackgroundColor.trim()) {
362
374
  itemStyles.push(`background-color: ${itemBackgroundColor.trim()}`)
363
375
  }
364
- itemStyles.push(`padding: ${Math.min(Math.max(itemPaddingPx, 0), 64)}px`)
376
+ itemStyles.push(
377
+ `padding: ${Math.min(Math.max(itemPaddingYPx, 0), 64)}px ${Math.min(
378
+ Math.max(itemPaddingXPx, 0),
379
+ 64
380
+ )}px`
381
+ )
365
382
  itemStyles.push(
366
383
  `border-radius: ${Math.min(Math.max(itemBorderRadiusPx, 0), 64)}px`
367
384
  )
@@ -376,7 +393,10 @@ export function LayoutPlugin(): JSX.Element | null {
376
393
  }
377
394
 
378
395
  const background = values.itemBackgroundColor.trim()
379
- const padding = `${Math.min(Math.max(values.itemPaddingPx, 0), 64)}px`
396
+ const padding = `${Math.min(Math.max(values.itemPaddingYPx, 0), 64)}px ${Math.min(
397
+ Math.max(values.itemPaddingXPx, 0),
398
+ 64
399
+ )}px`
380
400
  const borderRadius = `${Math.min(Math.max(values.itemBorderRadiusPx, 0), 64)}px`
381
401
  if (background) {
382
402
  element.style.setProperty("background-color", background)
@@ -438,6 +458,9 @@ export function LayoutPlugin(): JSX.Element | null {
438
458
  }
439
459
 
440
460
  const style = layoutItem.getStyle()
461
+ const paddingValues = extractNumericStyle(style, "padding")
462
+ const borderRadiusValues = extractNumericStyle(style, "border-radius")
463
+
441
464
  payload = {
442
465
  containerKey: parentContainer.getKey(),
443
466
  layoutItemKey: layoutItem.getKey(),
@@ -445,8 +468,12 @@ export function LayoutPlugin(): JSX.Element | null {
445
468
  template: parentContainer.getTemplateColumns(),
446
469
  itemBackgroundColor:
447
470
  extractStyleValue(style, "background-color") ?? "#ffffff",
448
- itemPaddingPx: extractNumericStyle(style, "padding") ?? 12,
449
- itemBorderRadiusPx: extractNumericStyle(style, "border-radius") ?? 8,
471
+ itemPaddingXPx:
472
+ paddingValues && paddingValues.length > 1
473
+ ? paddingValues[1]
474
+ : (paddingValues?.[0] ?? 12),
475
+ itemPaddingYPx: paddingValues?.[0] ?? 12,
476
+ itemBorderRadiusPx: borderRadiusValues?.[0] ?? 8,
450
477
  },
451
478
  }
452
479
  logger.debug("[Layout] Resolved payload from target", payload)
@@ -566,12 +593,19 @@ export function LayoutPlugin(): JSX.Element | null {
566
593
  typeof payload === "string"
567
594
  ? undefined
568
595
  : payload.itemBackgroundColor?.trim()
569
- const itemPaddingPx =
596
+ const itemPaddingXPx =
597
+ typeof payload === "string"
598
+ ? undefined
599
+ : typeof payload.itemPaddingXPx === "number" &&
600
+ Number.isFinite(payload.itemPaddingXPx)
601
+ ? Math.min(Math.max(payload.itemPaddingXPx, 0), 64)
602
+ : undefined
603
+ const itemPaddingYPx =
570
604
  typeof payload === "string"
571
605
  ? undefined
572
- : typeof payload.itemPaddingPx === "number" &&
573
- Number.isFinite(payload.itemPaddingPx)
574
- ? Math.min(Math.max(payload.itemPaddingPx, 0), 64)
606
+ : typeof payload.itemPaddingYPx === "number" &&
607
+ Number.isFinite(payload.itemPaddingYPx)
608
+ ? Math.min(Math.max(payload.itemPaddingYPx, 0), 64)
575
609
  : undefined
576
610
  const itemBorderRadiusPx =
577
611
  typeof payload === "string"
@@ -584,7 +618,8 @@ export function LayoutPlugin(): JSX.Element | null {
584
618
  const itemStyle = buildLayoutItemStyle({
585
619
  template,
586
620
  itemBackgroundColor: itemBackgroundColor ?? "#ffffff",
587
- itemPaddingPx: itemPaddingPx ?? 12,
621
+ itemPaddingXPx: itemPaddingXPx ?? 12,
622
+ itemPaddingYPx: itemPaddingYPx ?? 12,
588
623
  itemBorderRadiusPx: itemBorderRadiusPx ?? 8,
589
624
  })
590
625
 
@@ -26,9 +26,14 @@
26
26
  justify-content: space-between;
27
27
  }
28
28
 
29
+ @mixin flex-row {
30
+ display: flex !important;
31
+ flex-direction: row !important;
32
+ }
33
+
29
34
  @mixin flex-col {
30
- display: flex;
31
- flex-direction: column;
35
+ display: flex !important;
36
+ flex-direction: column !important;
32
37
  }
33
38
 
34
39
  @mixin flex-center-justify {
@@ -63,19 +68,19 @@
63
68
  }
64
69
 
65
70
  @mixin shadow-sm {
66
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
71
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
67
72
  }
68
73
 
69
74
  @mixin shadow-md {
70
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
75
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
71
76
  }
72
77
 
73
78
  @mixin shadow-lg {
74
- box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
79
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
75
80
  }
76
81
 
77
82
  @mixin shadow-xl {
78
- box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
83
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
79
84
  }
80
85
 
81
86
  @mixin absolute-full {
@@ -138,7 +143,7 @@
138
143
  // --- Unified Hover Styles ---
139
144
  @mixin editor-hover-base {
140
145
  transform: translateY(-1px);
141
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
146
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
142
147
  }
143
148
 
144
149
  @mixin editor-active-base {
@@ -172,7 +172,8 @@ $editor-popover-max-height: 300px !default;
172
172
  $editor-format-select-width: 72px !default;
173
173
  $editor-floating-toolbar-max-width: 560px !default;
174
174
  $editor-color-picker-height: 160px !default;
175
- $editor-scroll-area-max-height: 350px !default;
175
+ $editor-color-picker-width: 380px !default;
176
+ $editor-scroll-area-max-height: 350px !default;
176
177
  $editor-link-editor-max-width: 400px !default;
177
178
  $editor-component-picker-width: 250px !default;
178
179
  $editor-mentions-width: 200px !default;
@@ -11,6 +11,15 @@
11
11
  }
12
12
  }
13
13
 
14
+ // Global resets
15
+ *, *::before, *::after {
16
+ box-sizing: border-box;
17
+
18
+ @supports (color: color-mix(in lab, red, red)) {
19
+ outline-color: color-mix(in oklab, var(--ring) 50%, transparent);
20
+ }
21
+ }
22
+
14
23
  // Lexical Editor Root
15
24
  .lexical-editor-root {
16
25
  font-family: $editor-font-family !important;
@@ -24,12 +33,7 @@
24
33
  text-align: left !important;
25
34
  box-sizing: border-box !important;
26
35
 
27
- // Reset common elements
28
- *, *::before, *::after {
29
- box-sizing: border-box;
30
- }
31
-
32
- p, ul, ol, li, span, strong, em, b, i, blockquote, h1, h2, h3, h4, h5, h6 {
36
+ p, div, ul, ol, li, span, strong, em, b, i, blockquote, h1, h2, h3, h4, h5, h6 {
33
37
  margin: 0 !important;
34
38
  padding: 0;
35
39
  border: 0 !important;
@@ -3,6 +3,7 @@
3
3
 
4
4
  .editor-color-picker-content {
5
5
  @include flex-col;
6
+ width: $editor-color-picker-width;
6
7
  gap: $editor-gap-4;
7
8
  padding: $editor-gap-4;
8
9
  }
@@ -4,17 +4,13 @@
4
4
  .editor-layout-dialog-grid {
5
5
  display: grid;
6
6
  grid-template-columns: repeat(1, minmax(0, 1fr));
7
- gap: $editor-gap-3;
7
+ gap: $editor-gap-4;
8
8
 
9
- @media (min-width: 768px) {
10
- grid-template-columns: repeat(3, minmax(0, 1fr));
9
+ @media (min-width: 480px) {
10
+ grid-template-columns: repeat(2, minmax(0, 1fr));
11
11
  }
12
12
  }
13
13
 
14
- .editor-layout-dialog-group {
15
- @include flex-col;
16
- gap: $editor-gap-1-5;
17
- }
18
14
 
19
15
  .editor-layout-color-trigger {
20
16
  height: $editor-control-size-xl; // h-11
@@ -2,6 +2,8 @@
2
2
  @use "../mixins" as *;
3
3
 
4
4
  .editor-list-color-dialog {
5
+ @include flex-col;
6
+ gap: $editor-gap-4;
5
7
  padding: $editor-gap-2 0;
6
8
  animation: editor-fade-in $editor-transition-slow;
7
9
  }
@@ -8,11 +8,11 @@
8
8
  @include flex-center;
9
9
  flex-wrap: wrap;
10
10
  gap: $editor-gap-1;
11
- border-bottom: $editor-border-width solid var(--border);
12
- border-top-left-radius: $editor-border-radius;
13
- border-top-right-radius: $editor-border-radius;
11
+ border-bottom: $editor-border-width solid var(--border) !important;
12
+ border-top-left-radius: $editor-border-radius !important;
13
+ border-top-right-radius: $editor-border-radius !important;
14
14
  @include backdrop-blur($editor-dialog-overlay-blur, rgba(255, 255, 255, 0.8));
15
- padding: $editor-gap-1;
15
+ padding: $editor-gap-2 !important;
16
16
  @include shadow-sm;
17
17
  width: 100%;
18
18
  overflow-x: visible;
@@ -23,7 +23,7 @@
23
23
  .editor-toolbar-group {
24
24
  @include flex-center;
25
25
  gap: $editor-gap-1;
26
- padding: $editor-gap-1;
26
+ padding: $editor-gap-1 !important;
27
27
  @include rounded-md;
28
28
  }
29
29
 
@@ -31,6 +31,6 @@
31
31
 
32
32
  .editor-toolbar-separator {
33
33
  height: $editor-icon-size-lg !important; // h-6 (standard separator height)
34
- margin-left: $editor-gap-1;
35
- margin-right: $editor-gap-1;
34
+ margin-left: $editor-gap-1 !important;
35
+ margin-right: $editor-gap-1 !important;
36
36
  }
@@ -17,6 +17,7 @@
17
17
  position: relative;
18
18
  padding: $editor-gap-2 $editor-gap-4;
19
19
  box-sizing: border-box; // Ensure consistent sizing
20
+ @include shadow-sm;
20
21
  @include editor-button-interactive;
21
22
 
22
23
  &:disabled {
@@ -53,7 +54,6 @@
53
54
  background-color: var(--primary);
54
55
  color: var(--primary-foreground);
55
56
  border-color: var(--primary);
56
- @include shadow-sm;
57
57
 
58
58
  &:hover {
59
59
  background-color: color-mix(in srgb, var(--primary), black 10%);
@@ -65,7 +65,6 @@
65
65
  background-color: var(--destructive);
66
66
  color: var(--destructive-foreground);
67
67
  border-color: var(--destructive);
68
- @include shadow-sm;
69
68
 
70
69
  &:hover {
71
70
  background-color: color-mix(in srgb, var(--destructive), black 10%);
@@ -114,11 +113,12 @@
114
113
  border: none;
115
114
  padding: 0;
116
115
  height: auto;
116
+ box-shadow: none !important;
117
117
 
118
118
  &:hover {
119
119
  text-decoration-line: underline;
120
120
  transform: none;
121
- box-shadow: none;
121
+ box-shadow: none !important;
122
122
  }
123
123
  }
124
124
 
@@ -66,6 +66,7 @@
66
66
  flex-direction: row;
67
67
  }
68
68
 
69
+ .editor-flex-column,
69
70
  .editor-flex-col {
70
71
  flex-direction: column;
71
72
  }
@@ -74,6 +75,7 @@
74
75
  flex-direction: row-reverse;
75
76
  }
76
77
 
78
+ .editor-flex-column-reverse,
77
79
  .editor-flex-col-reverse {
78
80
  flex-direction: column-reverse;
79
81
  }