@harbour-enterprises/superdoc 0.14.0-next.2 → 0.14.0-next.21

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 (99) hide show
  1. package/dist/chunks/{eventemitter3-BrspJk8q.es.js → eventemitter3-BIPEy-pY.es.js} +1 -1
  2. package/dist/chunks/{eventemitter3-DfVviFzP.cjs → eventemitter3-DGnD-HK9.cjs} +1 -1
  3. package/dist/chunks/{index-Diu6UKHt.es.js → index-BvK-G6B1.es.js} +4 -4
  4. package/dist/chunks/{index-B4J7wgs6.cjs → index-CCRVYhTn.cjs} +2 -2
  5. package/dist/chunks/{index-Cdsq63Xq.cjs → index-CgJ5KVh6.cjs} +4 -4
  6. package/dist/chunks/{index-Hr3Um-Bg.es.js → index-oHslWah4.es.js} +2 -2
  7. package/dist/chunks/{jszip-DckFs3A7.es.js → jszip-CYDYUNnI.es.js} +1 -1
  8. package/dist/chunks/{jszip-BTAcmbVg.cjs → jszip-D5XoMX4C.cjs} +1 -1
  9. package/dist/chunks/{super-editor.es-C6TRTeBI.es.js → super-editor.es-Cu7C5Ezf.es.js} +3414 -2237
  10. package/dist/chunks/{super-editor.es-DFls-Ipj.cjs → super-editor.es-DM3LYkiV.cjs} +3402 -2225
  11. package/dist/chunks/{url-BIzg4y2i.cjs → url-BG1Z_Z2_.cjs} +2 -2
  12. package/dist/chunks/{url-CHayXMZH.es.js → url-Dvx6wrNT.es.js} +2 -2
  13. package/dist/chunks/{vue-Bi1uWinj.es.js → vue-lU0o_RlU.es.js} +35 -15
  14. package/dist/chunks/{vue-HIY1g7dm.cjs → vue-tQYF719J.cjs} +24 -4
  15. package/dist/chunks/{xml-js-BjqmFOSP.cjs → xml-js-BHJlXtfU.cjs} +13 -6
  16. package/dist/chunks/{xml-js-CfClL-1b.es.js → xml-js-DNISVjNF.es.js} +13 -6
  17. package/dist/composables/use-ai.d.ts +1 -3
  18. package/dist/composables/use-ai.d.ts.map +1 -1
  19. package/dist/core/SuperDoc.d.ts +5 -0
  20. package/dist/core/SuperDoc.d.ts.map +1 -1
  21. package/dist/helpers/floor.d.ts +2 -0
  22. package/dist/helpers/floor.d.ts.map +1 -0
  23. package/dist/stores/hrbr-fields-store.d.ts.map +1 -1
  24. package/dist/style.css +407 -291
  25. package/dist/super-editor/ai-writer.es.js +18 -33
  26. package/dist/super-editor/chunks/{converter-2R-ZXcMD.js → converter-BnCzxu5M.js} +1685 -1609
  27. package/dist/super-editor/chunks/{docx-zipper-D1Hg-x9a.js → docx-zipper-BPw_B6hI.js} +1 -1
  28. package/dist/super-editor/chunks/{editor-DYjOoB1N.js → editor-DD4MGOZb.js} +1788 -1251
  29. package/dist/super-editor/chunks/{toolbar-WyGfV3qj.js → toolbar-BCtZctWE.js} +33 -38
  30. package/dist/super-editor/components/cursor-helpers.d.ts +23 -0
  31. package/dist/super-editor/components/cursor-helpers.d.ts.map +1 -1
  32. package/dist/super-editor/components/slash-menu/constants.d.ts +64 -0
  33. package/dist/super-editor/components/slash-menu/constants.d.ts.map +1 -0
  34. package/dist/super-editor/components/slash-menu/menuItems.d.ts +35 -0
  35. package/dist/super-editor/components/slash-menu/menuItems.d.ts.map +1 -0
  36. package/dist/super-editor/components/slash-menu/utils.d.ts +10 -0
  37. package/dist/super-editor/components/slash-menu/utils.d.ts.map +1 -0
  38. package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
  39. package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
  40. package/dist/super-editor/components/toolbar/toolbarIcons.d.ts +3 -12
  41. package/dist/super-editor/components/toolbar/toolbarTexts.d.ts +0 -11
  42. package/dist/super-editor/converter.es.js +1 -1
  43. package/dist/super-editor/core/Editor.d.ts +12 -4
  44. package/dist/super-editor/core/Editor.d.ts.map +1 -1
  45. package/dist/super-editor/core/InputRule.d.ts.map +1 -1
  46. package/dist/super-editor/core/commands/decreaseListIndent.d.ts.map +1 -1
  47. package/dist/super-editor/core/commands/deleteListItem.d.ts.map +1 -1
  48. package/dist/super-editor/core/commands/deleteSelection.d.ts +2 -0
  49. package/dist/super-editor/core/commands/deleteSelection.d.ts.map +1 -1
  50. package/dist/super-editor/core/commands/increaseListIndent.d.ts.map +1 -1
  51. package/dist/super-editor/core/commands/joinBackward.d.ts.map +1 -1
  52. package/dist/super-editor/core/commands/joinForward.d.ts.map +1 -1
  53. package/dist/super-editor/core/commands/splitListItem.d.ts.map +1 -1
  54. package/dist/super-editor/core/commands/toggleList.d.ts +5 -1
  55. package/dist/super-editor/core/commands/toggleList.d.ts.map +1 -1
  56. package/dist/super-editor/core/extensions/keymap.d.ts.map +1 -1
  57. package/dist/super-editor/core/helpers/list-numbering-helpers.d.ts +6 -5
  58. package/dist/super-editor/core/helpers/list-numbering-helpers.d.ts.map +1 -1
  59. package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
  60. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  61. package/dist/super-editor/core/super-converter/v2/importer/annotationImporter.d.ts +1 -1
  62. package/dist/super-editor/core/super-converter/v2/importer/annotationImporter.d.ts.map +1 -1
  63. package/dist/super-editor/core/super-converter/v2/importer/hyperlinkImporter.d.ts.map +1 -1
  64. package/dist/super-editor/core/super-converter/v2/importer/listImporter.d.ts.map +1 -1
  65. package/dist/super-editor/core/super-converter/v2/importer/paragraphNodeImporter.d.ts.map +1 -1
  66. package/dist/super-editor/core/utilities/clipboardUtils.d.ts +27 -0
  67. package/dist/super-editor/core/utilities/clipboardUtils.d.ts.map +1 -0
  68. package/dist/super-editor/core/utilities/index.d.ts +1 -0
  69. package/dist/super-editor/docx-zipper.es.js +2 -2
  70. package/dist/super-editor/editor.es.js +3 -3
  71. package/dist/super-editor/extensions/ai/ai-plugin.d.ts.map +1 -1
  72. package/dist/super-editor/extensions/bullet-list/bullet-list.d.ts.map +1 -1
  73. package/dist/super-editor/extensions/field-annotation/fieldAnnotationHelpers/findRemovedFieldAnnotations.d.ts.map +1 -1
  74. package/dist/super-editor/extensions/index.d.ts.map +1 -1
  75. package/dist/super-editor/extensions/list-item/list-item.d.ts.map +1 -1
  76. package/dist/super-editor/extensions/noderesizer/noderesizer.d.ts +0 -3
  77. package/dist/super-editor/extensions/noderesizer/noderesizer.d.ts.map +1 -1
  78. package/dist/super-editor/extensions/ordered-list/helpers/orderedListSyncPlugin.d.ts.map +1 -1
  79. package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts.map +1 -1
  80. package/dist/super-editor/extensions/pagination/pagination.d.ts.map +1 -1
  81. package/dist/super-editor/extensions/paragraph/paragraph.d.ts.map +1 -1
  82. package/dist/super-editor/extensions/slash-menu/index.d.ts +2 -0
  83. package/dist/super-editor/extensions/slash-menu/index.d.ts.map +1 -0
  84. package/dist/super-editor/extensions/slash-menu/slash-menu.d.ts +4 -0
  85. package/dist/super-editor/extensions/slash-menu/slash-menu.d.ts.map +1 -0
  86. package/dist/super-editor/extensions/table/table.d.ts.map +1 -1
  87. package/dist/super-editor/file-zipper.es.js +1 -1
  88. package/dist/super-editor/index.d.ts +1 -1
  89. package/dist/super-editor/index.d.ts.map +1 -1
  90. package/dist/super-editor/style.css +368 -261
  91. package/dist/super-editor/super-editor.es.js +1202 -608
  92. package/dist/super-editor/toolbar.es.js +2 -2
  93. package/dist/super-editor.cjs +3 -2
  94. package/dist/super-editor.es.js +15 -14
  95. package/dist/superdoc.cjs +89 -76
  96. package/dist/superdoc.es.js +141 -128
  97. package/dist/superdoc.umd.js +3716 -2509
  98. package/dist/superdoc.umd.js.map +1 -1
  99. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter-2R-ZXcMD.js";
3
- import { _ as _export_sfc } from "./chunks/editor-DYjOoB1N.js";
2
+ import { T as TextSelection } from "./chunks/converter-BnCzxu5M.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-DD4MGOZb.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -261,39 +261,21 @@ const _sfc_main = {
261
261
  endpoint: {
262
262
  type: String,
263
263
  required: false
264
- },
265
- /**
266
- * AIWriter component is used both in the superToolbar and SuperDoc directly
267
- * When we are rending in the toolbar menu, our events are emitted through toolbar to Superdoc
268
- * When we are rendering directly in SuperDoc, we need to emit the events through Superdoc and do not need to
269
- * emit any events through
270
- */
271
- superToolbar: {
272
- type: Object
273
264
  }
274
265
  },
275
- emits: ["ai-highlight"],
276
- setup(__props, { emit: __emit }) {
266
+ setup(__props) {
277
267
  const props = __props;
278
- const emits = __emit;
279
268
  const selectionState = ref(null);
280
269
  const aiWriterRef = ref(null);
281
270
  const handleClickOutside = (event) => {
282
271
  if (aiWriterRef.value && !aiWriterRef.value.contains(event.target)) {
283
272
  if (!isLoading.value) {
284
- emitAiHighlight("remove");
273
+ props.editor.commands.removeAiMark();
285
274
  }
286
275
  props.handleClose();
287
276
  }
288
277
  };
289
278
  const editableRef = ref(null);
290
- const emitAiHighlight = (type, data = null) => {
291
- if (props.superToolbar) {
292
- props.superToolbar.emit("ai-highlight", { type, data });
293
- } else {
294
- emits("ai-highlight", { type, data });
295
- }
296
- };
297
279
  const saveSelection = () => {
298
280
  if (props.selectedText) {
299
281
  selectionState.value = {
@@ -302,15 +284,17 @@ const _sfc_main = {
302
284
  to: props.editor.state.selection.to
303
285
  };
304
286
  props.editor.commands.setMeta("storedSelection", selectionState.value);
305
- emitAiHighlight("add");
287
+ props.editor.commands.insertAiMark();
306
288
  }
307
289
  };
308
290
  const focusTextarea = () => {
309
- nextTick(() => {
310
- if (editableRef.value) {
311
- editableRef.value.focus();
312
- }
313
- });
291
+ setTimeout(() => {
292
+ nextTick(() => {
293
+ if (editableRef.value) {
294
+ editableRef.value.focus();
295
+ }
296
+ });
297
+ }, 0);
314
298
  };
315
299
  const addEventListeners = () => {
316
300
  document.addEventListener("mousedown", handleClickOutside);
@@ -327,7 +311,7 @@ const _sfc_main = {
327
311
  });
328
312
  onUnmounted(() => {
329
313
  if (!isLoading.value) {
330
- emitAiHighlight("remove");
314
+ props.editor.commands.removeAiMark();
331
315
  }
332
316
  removeEventListeners();
333
317
  });
@@ -361,7 +345,7 @@ const _sfc_main = {
361
345
  try {
362
346
  props.editor.commands.removeAiNode("aiLoaderNode");
363
347
  if (props.selectedText && !textProcessingStarted.value) {
364
- emitAiHighlight("remove");
348
+ props.editor.commands.removeAiMark();
365
349
  props.editor.commands.clearAiHighlightStyle();
366
350
  if (selectionState.value) {
367
351
  const { state } = props.editor;
@@ -433,7 +417,7 @@ const _sfc_main = {
433
417
  await runSafeFormat();
434
418
  setTimeout(() => {
435
419
  props.editor.commands.removeAiMark("aiAnimationMark");
436
- emitAiHighlight("remove");
420
+ props.editor.commands.removeAiMark();
437
421
  }, 1e3);
438
422
  };
439
423
  const handleSubmit = async () => {
@@ -444,7 +428,8 @@ const _sfc_main = {
444
428
  try {
445
429
  props.handleClose();
446
430
  if (props.selectedText) {
447
- emitAiHighlight("update");
431
+ props.editor.commands.updateAiHighlightStyle("sd-ai-highlight-pulse");
432
+ props.editor.commands.removeSelectionAfterAiPulse();
448
433
  } else {
449
434
  props.editor.commands.insertContent({
450
435
  type: "aiLoaderNode"
@@ -531,7 +516,7 @@ const _sfc_main = {
531
516
  };
532
517
  }
533
518
  };
534
- const AIWriter = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4cf86e1f"]]);
519
+ const AIWriter = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fa653ccf"]]);
535
520
  export {
536
521
  AIWriter as default
537
522
  };