@delali/web-editor 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/styles.css CHANGED
@@ -1756,9 +1756,6 @@
1756
1756
  --tw-border-style: solid;
1757
1757
  border-style: solid;
1758
1758
  }
1759
- .border-\[\#0C66E4\]\/35 {
1760
- border-color: color-mix(in oklab, #0C66E4 35%, transparent);
1761
- }
1762
1759
  .border-blue-200 {
1763
1760
  border-color: var(--color-blue-200);
1764
1761
  }
@@ -1771,6 +1768,12 @@
1771
1768
  .border-destructive {
1772
1769
  border-color: var(--destructive);
1773
1770
  }
1771
+ .border-editor-link\/35 {
1772
+ border-color: var(--editor-link, var(--primary));
1773
+ @supports (color: color-mix(in lab, red, red)) {
1774
+ border-color: color-mix(in oklab, var(--editor-link, var(--primary)) 35%, transparent);
1775
+ }
1776
+ }
1774
1777
  .border-foreground\/15 {
1775
1778
  border-color: var(--foreground);
1776
1779
  @supports (color: color-mix(in lab, red, red)) {
@@ -1894,9 +1897,6 @@
1894
1897
  .bg-\(--cellBackground\) {
1895
1898
  background-color: var(--cellBackground);
1896
1899
  }
1897
- .bg-\[\#0C66E4\] {
1898
- background-color: #0C66E4;
1899
- }
1900
1900
  .bg-\[rgb\(247\,246\,245\)\] {
1901
1901
  background-color: rgb(247,246,245);
1902
1902
  }
@@ -2026,6 +2026,9 @@
2026
2026
  .bg-destructive {
2027
2027
  background-color: var(--destructive);
2028
2028
  }
2029
+ .bg-editor-link {
2030
+ background-color: var(--editor-link, var(--primary));
2031
+ }
2029
2032
  .bg-emerald-500\/15 {
2030
2033
  background-color: color-mix(in srgb, oklch(69.6% 0.17 162.48) 15%, transparent);
2031
2034
  @supports (color: color-mix(in lab, red, red)) {
@@ -2632,9 +2635,6 @@
2632
2635
  .whitespace-pre-wrap {
2633
2636
  white-space: pre-wrap;
2634
2637
  }
2635
- .text-\[\#0C66E4\] {
2636
- color: #0C66E4;
2637
- }
2638
2638
  .text-\[\#4C9A2A\] {
2639
2639
  color: #4C9A2A;
2640
2640
  }
@@ -2686,6 +2686,9 @@
2686
2686
  .text-destructive-foreground {
2687
2687
  color: var(--destructive-foreground);
2688
2688
  }
2689
+ .text-editor-link {
2690
+ color: var(--editor-link, var(--primary));
2691
+ }
2689
2692
  .text-emerald-700 {
2690
2693
  color: var(--color-emerald-700);
2691
2694
  }
@@ -3993,10 +3996,10 @@
3993
3996
  }
3994
3997
  }
3995
3998
  }
3996
- .hover\:border-\[\#0C66E4\] {
3999
+ .hover\:border-editor-link {
3997
4000
  &:hover {
3998
4001
  @media (hover: hover) {
3999
- border-color: #0C66E4;
4002
+ border-color: var(--editor-link, var(--primary));
4000
4003
  }
4001
4004
  }
4002
4005
  }
@@ -4027,13 +4030,6 @@
4027
4030
  }
4028
4031
  }
4029
4032
  }
4030
- .hover\:bg-\[\#0C66E4\]\/5 {
4031
- &:hover {
4032
- @media (hover: hover) {
4033
- background-color: color-mix(in oklab, #0C66E4 5%, transparent);
4034
- }
4035
- }
4036
- }
4037
4033
  .hover\:bg-accent {
4038
4034
  &:hover {
4039
4035
  @media (hover: hover) {
@@ -4118,6 +4114,16 @@
4118
4114
  }
4119
4115
  }
4120
4116
  }
4117
+ .hover\:bg-editor-link\/5 {
4118
+ &:hover {
4119
+ @media (hover: hover) {
4120
+ background-color: var(--editor-link, var(--primary));
4121
+ @supports (color: color-mix(in lab, red, red)) {
4122
+ background-color: color-mix(in oklab, var(--editor-link, var(--primary)) 5%, transparent);
4123
+ }
4124
+ }
4125
+ }
4126
+ }
4121
4127
  .hover\:bg-emerald-500\/15 {
4122
4128
  &:hover {
4123
4129
  @media (hover: hover) {
@@ -4346,10 +4352,13 @@
4346
4352
  }
4347
4353
  }
4348
4354
  }
4349
- .hover\:outline-\[\#0C66E4\]\/30 {
4355
+ .hover\:outline-editor-link\/30 {
4350
4356
  &:hover {
4351
4357
  @media (hover: hover) {
4352
- outline-color: color-mix(in oklab, #0C66E4 30%, transparent);
4358
+ outline-color: var(--editor-link, var(--primary));
4359
+ @supports (color: color-mix(in lab, red, red)) {
4360
+ outline-color: color-mix(in oklab, var(--editor-link, var(--primary)) 30%, transparent);
4361
+ }
4353
4362
  }
4354
4363
  }
4355
4364
  }
@@ -5517,6 +5526,28 @@
5517
5526
  }
5518
5527
  }
5519
5528
  }
5529
+ .dark-or-inherit\:border-editor-link\/35\! {
5530
+ &:where(.dark *, [data-editor-theme="inherit"] *) {
5531
+ border-color: var(--editor-link, var(--primary)) !important;
5532
+ @supports (color: color-mix(in lab, red, red)) {
5533
+ border-color: color-mix(in oklab, var(--editor-link, var(--primary)) 35%, transparent) !important;
5534
+ }
5535
+ }
5536
+ }
5537
+ .dark-or-inherit\:text-primary-foreground {
5538
+ &:where(.dark *, [data-editor-theme="inherit"] *) {
5539
+ color: var(--primary-foreground);
5540
+ }
5541
+ }
5542
+ .dark-or-inherit\:hover\:border-editor-link\! {
5543
+ &:where(.dark *, [data-editor-theme="inherit"] *) {
5544
+ &:hover {
5545
+ @media (hover: hover) {
5546
+ border-color: var(--editor-link, var(--primary)) !important;
5547
+ }
5548
+ }
5549
+ }
5550
+ }
5520
5551
  .\[\&_\.katex-display\]\:my-0 {
5521
5552
  & .katex-display {
5522
5553
  margin-block: calc(var(--spacing) * 0);
@@ -6104,6 +6135,7 @@
6104
6135
  --popover: oklch(1 0 0);
6105
6136
  --popover-foreground: oklch(0.145 0 0);
6106
6137
  --primary: oklch(0.205 0 0);
6138
+ --editor-link: #0c66e4;
6107
6139
  --primary-foreground: oklch(0.985 0 0);
6108
6140
  --secondary: oklch(0.97 0 0);
6109
6141
  --secondary-foreground: oklch(0.205 0 0);
@@ -6129,6 +6161,7 @@
6129
6161
  --popover: oklch(0.205 0 0);
6130
6162
  --popover-foreground: oklch(0.985 0 0);
6131
6163
  --primary: oklch(0.922 0 0);
6164
+ --editor-link: #85b8ff;
6132
6165
  --primary-foreground: oklch(0.205 0 0);
6133
6166
  --secondary: oklch(0.269 0 0);
6134
6167
  --secondary-foreground: oklch(0.985 0 0);
@@ -6219,6 +6252,7 @@
6219
6252
  }
6220
6253
  .web-editor-root[data-editor-theme="inherit"],
6221
6254
  .web-editor-portals[data-editor-theme="inherit"] {
6255
+ --editor-link: var(--primary);
6222
6256
  --brand: var(--primary);
6223
6257
  --brand-foreground: var(--primary-foreground);
6224
6258
  --brand-active: var(--primary);
@@ -103,6 +103,7 @@ export interface TocConfig {
103
103
  export type EditorVariant = 'default' | 'demo' | 'fullWidth' | 'versionHistory' | 'comment' | 'select' | 'ai' | 'aiChat' | 'update' | 'viewer';
104
104
  export declare const EditorThemes: readonly ["editor", "inherit"];
105
105
  export type EditorTheme = (typeof EditorThemes)[number];
106
+ export type TextFieldAttributes = Readonly<Record<`data-${string}`, string | number | boolean | null | undefined>>;
106
107
  export interface WebEditorProps {
107
108
  initialValue?: Value;
108
109
  onChange?: (value: Value) => void;
@@ -135,6 +136,7 @@ export interface WebEditorProps {
135
136
  className?: string;
136
137
  containerClassName?: string;
137
138
  editorClassName?: string;
139
+ textFieldAttributes?: TextFieldAttributes;
138
140
  placeholder?: string;
139
141
  autoFocus?: boolean;
140
142
  showToc?: boolean;
@@ -4,4 +4,5 @@ export declare const inputVariants: (props?: ({
4
4
  variant?: "search" | "link" | "flat" | "default" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export type InputProps = React.ComponentProps<'input'> & VariantProps<typeof inputVariants>;
7
+ export declare function UnstyledInput({ type, ...props }: React.ComponentProps<'input'>): React.JSX.Element;
7
8
  export declare function Input({ className, variant, ...props }: InputProps): React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  export declare const FILE_DISPLAY_MODES: readonly ["inline", "url", "embed"];
2
2
  export type FileDisplayMode = (typeof FILE_DISPLAY_MODES)[number];
3
3
  export declare const DEFAULT_FILE_DISPLAY_MODE: FileDisplayMode;
4
+ export declare const FILE_URL_CLASS_NAME = "inline-flex max-w-full items-center gap-1 break-all border-b border-editor-link/35 font-medium text-editor-link dark-or-inherit:border-editor-link/35!";
4
5
  export declare const normalizeFileDisplayMode: (value: unknown) => FileDisplayMode;
5
6
  /**
6
7
  * Reports whether the browser can render this file inline in a frame. Embed mode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delali/web-editor",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "A rich text editor for React, built on Plate, with Yjs multi-user editing, comments, AI, uploads, and Markdown, MDX, and HTML conversion.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -241,9 +241,9 @@
241
241
  "@types/react-dom": "19.2.4",
242
242
  "@types/react-lazy-load-image-component": "^1",
243
243
  "@vitest/coverage-v8": "4.1.12",
244
- "concurrently": "9.2.1",
244
+ "concurrently": "9.2.5",
245
245
  "jsdom": "29.1.1",
246
- "postcss": "8.5.10",
246
+ "postcss": "8.5.23",
247
247
  "postcss-cli": "11.0.1",
248
248
  "react": "19.2.8",
249
249
  "react-dom": "19.2.8",