ct-rich-text-editor 1.3.18 → 1.3.19

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.
@@ -2504,6 +2504,10 @@ video {
2504
2504
  vertical-align: middle;
2505
2505
  }
2506
2506
 
2507
+ .cteditor-font-arial{
2508
+ font-family: Arial, sans-serif;
2509
+ }
2510
+
2507
2511
  .cteditor-font-mono{
2508
2512
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
2509
2513
  }
@@ -4658,7 +4662,7 @@ body .EmojiPickerReact{
4658
4662
 
4659
4663
  .link {
4660
4664
  color: rgb(33, 111, 219);
4661
- text-decoration: none;
4665
+ text-decoration: underline;
4662
4666
  }
4663
4667
 
4664
4668
  .link:hover {
@@ -5059,8 +5063,13 @@ body .EmojiPickerReact{
5059
5063
  }
5060
5064
 
5061
5065
  .PlaygroundEditorTheme__paragraph {
5062
- margin: 0;
5066
+ margin: 0 0 1em 0;
5063
5067
  position: relative;
5068
+ line-height: 1.5;
5069
+ }
5070
+
5071
+ .PlaygroundEditorTheme__paragraph:last-child {
5072
+ margin-bottom: 0;
5064
5073
  }
5065
5074
 
5066
5075
  .PlaygroundEditorTheme__quote {
@@ -5068,6 +5077,7 @@ body .EmojiPickerReact{
5068
5077
  margin-left: 20px;
5069
5078
  margin-bottom: 10px;
5070
5079
  font-size: 15px;
5080
+ line-height: 1.5;
5071
5081
 
5072
5082
  border-left-width: 4px;
5073
5083
  border-left-style: solid;
@@ -5080,8 +5090,19 @@ body .EmojiPickerReact{
5080
5090
  .cteditor-content h5,
5081
5091
  .cteditor-content h6{
5082
5092
  font-weight:600;
5093
+ margin: 0.67em 0 0.5em 0;
5094
+ line-height: 1.5;
5095
+ /* Don't clear floats - allow content to wrap around floated images */
5083
5096
  }
5084
5097
 
5098
+ .cteditor-content h1:first-child,
5099
+ .cteditor-content h2:first-child,
5100
+ .cteditor-content h3:first-child,
5101
+ .cteditor-content h4:first-child,
5102
+ .cteditor-content h5:first-child,
5103
+ .cteditor-content h6:first-child {
5104
+ margin-top: 0;
5105
+ }
5085
5106
 
5086
5107
  .cteditor-content h1{
5087
5108
  font-size: 24px;
@@ -5103,6 +5124,43 @@ body .EmojiPickerReact{
5103
5124
  font-size: 11px;
5104
5125
  }
5105
5126
 
5127
+ /* Heading styles - CKEditor-like margins for better visual hierarchy */
5128
+ .PlaygroundEditorTheme__h1,
5129
+ .PlaygroundEditorTheme__h2,
5130
+ .PlaygroundEditorTheme__h3,
5131
+ .PlaygroundEditorTheme__h4,
5132
+ .PlaygroundEditorTheme__h5,
5133
+ .PlaygroundEditorTheme__h6 {
5134
+ /* Don't clear floats by default - allow text to wrap around floated images */
5135
+ margin-top: 0.83em; /* ~33px at 40px heading = CKEditor style */
5136
+ margin-bottom: 0.83em;
5137
+ }
5138
+
5139
+ /* First heading in editor shouldn't have top margin */
5140
+ .PlaygroundEditorTheme__h1:first-child,
5141
+ .PlaygroundEditorTheme__h2:first-child,
5142
+ .PlaygroundEditorTheme__h3:first-child,
5143
+ .PlaygroundEditorTheme__h4:first-child,
5144
+ .PlaygroundEditorTheme__h5:first-child,
5145
+ .PlaygroundEditorTheme__h6:first-child {
5146
+ margin-top: 0;
5147
+ }
5148
+
5149
+ /* Paragraph spacing for better readability - CKEditor uses ~1em */
5150
+ .PlaygroundEditorTheme__paragraph {
5151
+ margin-bottom: 1em;
5152
+ }
5153
+
5154
+ /* Heading after paragraph needs extra space above - CKEditor style */
5155
+ .PlaygroundEditorTheme__paragraph + .PlaygroundEditorTheme__h1,
5156
+ .PlaygroundEditorTheme__paragraph + .PlaygroundEditorTheme__h2,
5157
+ .PlaygroundEditorTheme__paragraph + .PlaygroundEditorTheme__h3,
5158
+ .PlaygroundEditorTheme__paragraph + .PlaygroundEditorTheme__h4,
5159
+ .PlaygroundEditorTheme__paragraph + .PlaygroundEditorTheme__h5,
5160
+ .PlaygroundEditorTheme__paragraph + .PlaygroundEditorTheme__h6 {
5161
+ margin-top: 1.5em;
5162
+ }
5163
+
5106
5164
  .PlaygroundEditorTheme__indent {
5107
5165
  --lexical-indent-base-value: 40px;
5108
5166
  }
@@ -5213,7 +5271,7 @@ body .EmojiPickerReact{
5213
5271
 
5214
5272
  .PlaygroundEditorTheme__link {
5215
5273
  color: rgb(33, 111, 219);
5216
- text-decoration: none;
5274
+ text-decoration: underline;
5217
5275
  }
5218
5276
 
5219
5277
  .PlaygroundEditorTheme__link:hover {
@@ -5843,6 +5901,89 @@ body .EmojiPickerReact{
5843
5901
  margin:6px;
5844
5902
  }
5845
5903
 
5904
+ /* Float-based image positioning for text wrapping */
5905
+ /* Floated images need display:block and appropriate margins */
5906
+ .editor-image[style*="float: left"],
5907
+ .editor-image[style*="float:left"] {
5908
+ display: block;
5909
+ margin: 0 1em 0.5em 0;
5910
+ }
5911
+
5912
+ .editor-image[style*="float: right"],
5913
+ .editor-image[style*="float:right"] {
5914
+ display: block;
5915
+ margin: 0 0 0.5em 1em;
5916
+ }
5917
+
5918
+ /* Paragraphs containing only a floated image (no text/caption) should not create block formatting context */
5919
+ /* This allows the float to affect subsequent sibling elements */
5920
+ .PlaygroundEditorTheme__paragraph:has(> .editor-image[style*="float"]):not(:has([data-lexical-text])) {
5921
+ display: contents;
5922
+ }
5923
+
5924
+ /* Paragraphs with floated image AND caption text should float as a unit */
5925
+ /* The paragraph itself becomes the float container with the image and caption inside */
5926
+ .PlaygroundEditorTheme__paragraph:has(.editor-image[style*="float"]):has([data-lexical-text]) {
5927
+ display: block;
5928
+ }
5929
+
5930
+ /* Paragraphs with right text-align containing images should float right as a unit */
5931
+ /* The paste plugin sets text-align on paragraphs with floated images + captions */
5932
+ .PlaygroundEditorTheme__paragraph[style*="text-align: right"]:has(> .editor-image),
5933
+ .PlaygroundEditorTheme__paragraph[style*="text-align:right"]:has(> .editor-image) {
5934
+ float: right !important;
5935
+ clear: right; /* Clear previous right floats so images stack vertically */
5936
+ max-width: 50% !important;
5937
+ margin-left: 1em !important;
5938
+ margin-bottom: 0.5em !important;
5939
+ text-align: center !important;
5940
+ background-color: hsla(var(--cteditorf47ac10b-foreground) / 0.05);
5941
+ padding: 0.5em;
5942
+ border-radius: 4px;
5943
+ }
5944
+
5945
+ /* Paragraphs with left text-align containing images should float left as a unit */
5946
+ .PlaygroundEditorTheme__paragraph[style*="text-align: left"]:has(> .editor-image),
5947
+ .PlaygroundEditorTheme__paragraph[style*="text-align:left"]:has(> .editor-image) {
5948
+ float: left !important;
5949
+ clear: left; /* Clear previous left floats so images stack vertically */
5950
+ max-width: 50% !important;
5951
+ margin-right: 1em !important;
5952
+ margin-bottom: 0.5em !important;
5953
+ text-align: center !important;
5954
+ background-color: hsla(var(--cteditorf47ac10b-foreground) / 0.05);
5955
+ padding: 0.5em;
5956
+ border-radius: 4px;
5957
+ }
5958
+
5959
+ /* Reset the float on the image when the paragraph handles floating */
5960
+ .PlaygroundEditorTheme__paragraph[style*="text-align: right"]:has(> .editor-image) > .editor-image,
5961
+ .PlaygroundEditorTheme__paragraph[style*="text-align:right"]:has(> .editor-image) > .editor-image,
5962
+ .PlaygroundEditorTheme__paragraph[style*="text-align: left"]:has(> .editor-image) > .editor-image,
5963
+ .PlaygroundEditorTheme__paragraph[style*="text-align:left"]:has(> .editor-image) > .editor-image {
5964
+ float: none !important;
5965
+ margin: 0 auto !important;
5966
+ max-width: 100% !important;
5967
+ display: block !important;
5968
+ }
5969
+
5970
+ /* Caption styling for floated image paragraphs */
5971
+ .PlaygroundEditorTheme__paragraph[style*="text-align: right"]:has(> .editor-image) > .PlaygroundEditorTheme__textItalic,
5972
+ .PlaygroundEditorTheme__paragraph[style*="text-align:right"]:has(> .editor-image) > .PlaygroundEditorTheme__textItalic,
5973
+ .PlaygroundEditorTheme__paragraph[style*="text-align: left"]:has(> .editor-image) > .PlaygroundEditorTheme__textItalic,
5974
+ .PlaygroundEditorTheme__paragraph[style*="text-align:left"]:has(> .editor-image) > .PlaygroundEditorTheme__textItalic,
5975
+ .PlaygroundEditorTheme__paragraph[style*="text-align: right"]:has(> .editor-image) > em,
5976
+ .PlaygroundEditorTheme__paragraph[style*="text-align:right"]:has(> .editor-image) > em,
5977
+ .PlaygroundEditorTheme__paragraph[style*="text-align: left"]:has(> .editor-image) > em,
5978
+ .PlaygroundEditorTheme__paragraph[style*="text-align:left"]:has(> .editor-image) > em {
5979
+ display: block;
5980
+ font-size: 0.85em;
5981
+ line-height: 1.4;
5982
+ color: hsla(var(--cteditorf47ac10b-foreground) / 0.75);
5983
+ padding: 0.5em 0.5em 0;
5984
+ word-wrap: break-word;
5985
+ }
5986
+
5846
5987
  .editor-image img {
5847
5988
  max-width: 100%;
5848
5989
  cursor: default;
@@ -1,6 +1,7 @@
1
1
  import { LexicalCommand, LexicalEditor, NodeKey } from '../../../node_modules/lexical';
2
+ import { ImagePosition } from '../../nodes/ImageNode';
2
3
  export declare const RIGHT_CLICK_IMAGE_COMMAND: LexicalCommand<MouseEvent>;
3
- export default function ImageComponent({ src, altText, nodeKey, width, height, maxWidth, resizable, showCaption, caption, captionsEnabled, originalPrompt, }: {
4
+ export default function ImageComponent({ src, altText, nodeKey, width, height, maxWidth, resizable, showCaption, caption, captionsEnabled, originalPrompt, position, }: {
4
5
  altText: string;
5
6
  caption: LexicalEditor;
6
7
  height: "inherit" | number;
@@ -12,4 +13,5 @@ export default function ImageComponent({ src, altText, nodeKey, width, height, m
12
13
  width: "inherit" | number;
13
14
  captionsEnabled: boolean;
14
15
  originalPrompt?: string;
16
+ position?: ImagePosition;
15
17
  }): JSX.Element;
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { g as getDefaultExportFromCjs, c as commonjsGlobal } from "./index-dbb526cd.js";
7
+ import { g as getDefaultExportFromCjs, c as commonjsGlobal } from "./index-23abcbd9.js";
8
8
  function _mergeNamespaces(n, m) {
9
9
  for (var i = 0; i < m.length; i++) {
10
10
  const e = m[i];
@@ -46125,4 +46125,4 @@ const html2pdf_bundle$1 = /* @__PURE__ */ _mergeNamespaces({
46125
46125
  export {
46126
46126
  html2pdf_bundle$1 as h
46127
46127
  };
46128
- //# sourceMappingURL=html2pdf.bundle-0a42a49f.js.map
46128
+ //# sourceMappingURL=html2pdf.bundle-a30dde70.js.map