@flozy/editor 5.4.2 → 5.4.4

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.
@@ -18,7 +18,10 @@
18
18
  .ml-1 {
19
19
  margin-left: 10px;
20
20
  }
21
-
21
+ .m-0
22
+ {
23
+ margin: 0px
24
+ }
22
25
  .dflex {
23
26
  display: flex;
24
27
  }
@@ -21,7 +21,8 @@ const SimpleText = props => {
21
21
  attributes,
22
22
  children,
23
23
  customProps,
24
- isEmpty
24
+ isEmpty,
25
+ isChatEditor = false
25
26
  } = props;
26
27
  const {
27
28
  readOnly,
@@ -44,7 +45,7 @@ const SimpleText = props => {
44
45
  });
45
46
  const selected = useSelected();
46
47
  const path = ReactEditor.findPath(editor, element);
47
- const showPlaceHolder = !readOnly && path.length === 1 && isEmpty;
48
+ const showPlaceHolder = !readOnly && path.length === 1 && isEmpty && !isChatEditor;
48
49
  const isEmptyEditor = !readOnly && isEmpty && editor.children.length === 1 && !selected;
49
50
  const opacity = !isTextSelected(editor?.selection);
50
51
  const nextType = element?.children[0]?.type;
@@ -237,24 +237,30 @@ export const getBlock = props => {
237
237
  return /*#__PURE__*/_jsx("p", {
238
238
  ...attributes,
239
239
  ...element.attr,
240
- className: `content-editable ${isEmpty ? "empty" : ""}`
240
+ className: `content-editable ${isEmpty ? "empty" : ""} m-0`
241
241
  // placeholder="paragraph"
242
242
  ,
243
243
  children: children
244
244
  });
245
245
  case "headingOne":
246
- return /*#__PURE__*/_jsx("h1", {
246
+ return /*#__PURE__*/_jsx("h3", {
247
247
  ...attributes,
248
248
  ...element.attr,
249
+ style: {
250
+ margin: "10px 0px"
251
+ },
249
252
  className: `content-editable ${isEmpty ? "empty" : ""}`
250
253
  // placeholder="Heading 1"
251
254
  ,
252
255
  children: children
253
256
  });
254
257
  case "headingTwo":
255
- return /*#__PURE__*/_jsx("h2", {
258
+ return /*#__PURE__*/_jsx("h3", {
256
259
  ...attributes,
257
260
  ...element.attr,
261
+ style: {
262
+ margin: "10px 0px"
263
+ },
258
264
  className: `content-editable ${isEmpty ? "empty" : ""}`
259
265
  // placeholder="Heading 2"
260
266
  ,
@@ -264,18 +270,55 @@ export const getBlock = props => {
264
270
  return /*#__PURE__*/_jsx("h3", {
265
271
  ...attributes,
266
272
  ...element.attr,
267
- className: `content-editable ${isEmpty ? "empty" : ""}`,
273
+ style: {
274
+ margin: "10px 0px"
275
+ },
276
+ className: `content-editable ${isEmpty ? "empty" : ""} m-0`,
268
277
  children: children
269
278
  });
270
279
  case "headingThree":
271
280
  return /*#__PURE__*/_jsx("h3", {
272
281
  ...attributes,
273
282
  ...element.attr,
283
+ style: {
284
+ margin: "10px 0px"
285
+ },
274
286
  className: `content-editable ${isEmpty ? "empty" : ""}`
275
287
  // placeholder="Heading 3"
276
288
  ,
277
289
  children: children
278
290
  });
291
+ case "headingFour":
292
+ return /*#__PURE__*/_jsx("h4", {
293
+ ...attributes,
294
+ ...element.attr,
295
+ style: {
296
+ margin: "10px 0px"
297
+ },
298
+ className: `content-editable ${isEmpty ? "empty" : ""}`,
299
+ children: children
300
+ });
301
+ case "headingFive":
302
+ return /*#__PURE__*/_jsx("h5", {
303
+ ...attributes,
304
+ ...element.attr,
305
+ className: `content-editable ${isEmpty ? "empty" : ""} m-0`,
306
+ children: children
307
+ });
308
+ case "headingSix":
309
+ return /*#__PURE__*/_jsx("h6", {
310
+ ...attributes,
311
+ ...element.attr,
312
+ className: `content-editable ${isEmpty ? "empty" : ""}`,
313
+ children: children
314
+ });
315
+ case "headingSeven":
316
+ return /*#__PURE__*/_jsx("h7", {
317
+ ...attributes,
318
+ ...element.attr,
319
+ className: `content-editable ${isEmpty ? "empty" : ""} m-0`,
320
+ children: children
321
+ });
279
322
  case "blockquote":
280
323
  return /*#__PURE__*/_jsx("blockquote", {
281
324
  ...attributes,
@@ -327,7 +370,7 @@ export const getBlock = props => {
327
370
  return /*#__PURE__*/_jsx("li", {
328
371
  ...attributes,
329
372
  ...element.attr,
330
- className: `content-editable ${isEmpty ? "empty" : ""}`,
373
+ className: `content-editable ${isEmpty ? "empty" : ""} m-0`,
331
374
  placeholder: "List",
332
375
  style: {
333
376
  color: firstChildren?.color
@@ -344,7 +387,7 @@ export const getBlock = props => {
344
387
  return /*#__PURE__*/_jsx("p", {
345
388
  ...attributes,
346
389
  ...element.attr,
347
- className: `content-editable ${isEmpty ? "empty" : ""}`
390
+ className: `content-editable ${isEmpty ? "empty" : ""} m-0`
348
391
  // placeholder="paragraph"
349
392
  ,
350
393
  children: children
@@ -366,7 +409,8 @@ export const getBlock = props => {
366
409
  default:
367
410
  return /*#__PURE__*/_jsx(SimpleText, {
368
411
  ...props,
369
- isEmpty: isEmpty
412
+ isEmpty: isEmpty,
413
+ isChatEditor: true
370
414
  });
371
415
  }
372
416
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "5.4.2",
3
+ "version": "5.4.4",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"