@blocknote/xl-ai 0.32.0-hackdays.0 → 0.33.0

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 (361) hide show
  1. package/dist/blocknote-xl-ai.cjs +9 -9
  2. package/dist/blocknote-xl-ai.cjs.map +1 -1
  3. package/dist/blocknote-xl-ai.js +505 -456
  4. package/dist/blocknote-xl-ai.js.map +1 -1
  5. package/dist/locales.cjs +1 -1
  6. package/dist/locales.cjs.map +1 -1
  7. package/dist/locales.js +98 -27
  8. package/dist/locales.js.map +1 -1
  9. package/dist/webpack-stats.json +1 -1
  10. package/package.json +10 -8
  11. package/src/api/LLMRequest.ts +20 -4
  12. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_4ed20a68d545bbcac0a6974406d9b1b1.json +15 -0
  13. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_a8c0f5688c447808ea40e16816bc9d88.json +15 -0
  14. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_4200cbf42b5dd56e2fb7c1dc4c0e5c95.json +15 -0
  15. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_3cecc2859589d59d7b2a73b271a02ebb.json +15 -0
  16. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_0b6e5ba7c365aa004ab09915db4747d2.json +15 -0
  17. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_f09fb671c15594eba4367376e1de7404.json +15 -0
  18. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_039df897cf40b1464a3e77597698630f.json → Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a list (end)_1_9ca128e303da5f76048c82f2c1928b5f.json } +2 -2
  19. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_69863686209bcd70d5d432c6c5646ec6.json → Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (empty doc)_1_fedaaecc10d6ddf733d85168d2167795.json } +2 -2
  20. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_cec06b764f3e6538c0a0baeb04d60587.json → Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_fe965ef7a99beb3acc090a9f597b4279.json } +2 -2
  21. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_0b00b5e42872d9f249427436ed23ca40.json → Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (start)_1_232100784a2397a470c08d82001cb7fb.json } +2 -2
  22. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_da4995473884c05440ca118c6ae41453.json +15 -0
  23. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_ca41f979b0669b1a9285363b55a53b23.json → Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_bcc7319416c9b14368ea5ad861f9b722.json } +2 -2
  24. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_ecfba97d707a7df556c8be55a94491bd.json → Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_8fd66df698028c81b94d9c3da3f48565.json } +2 -2
  25. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_18c554c2e45b6f5a1f491396916dcb46.json → Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_1df9f2bee04498ef092f332ebce02289.json } +2 -2
  26. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_c8cc1e445e2ea3a61af98fae49719bb2.json → Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_ddea32bf65559924075cf5a378ff52a9.json } +2 -2
  27. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_411b9303baf0445a2b3d22af986dcbd7.json +15 -0
  28. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_15ae85e2a52e28738a9cd2f4585a5e87.json → Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_b62f9dcc3af6272c847eb867f28464e4.json } +2 -2
  29. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_62ccc02aa192415d17e9a1f5c53dffb1.json → Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_e3538aed67ed181c709f2c76ebd3b88c.json } +2 -2
  30. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_e5c648bb981ba9ce20b93054446c721d.json → Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_4da2dc377fad46f51e531f5cb2594b48.json } +2 -2
  31. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_b8c66592925ae0e551a329b7b2f3b3e2.json → Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_9a1739085965869c82a4ab025a9b426c.json } +2 -2
  32. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_91d754a12d792f37fe1483d19a7b4e64.json +15 -0
  33. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_1b9c5367195624176c28a1ca3684ebac.json +15 -0
  34. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_bda56d4903fe73aa33304a959057957d.json +15 -0
  35. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_731edbb5fc3b6e4a927978b9e203f336.json +15 -0
  36. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_56f9b395b16c8dc222ce13deb68cd412.json +15 -0
  37. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a16755b57abd9123bc8d138ece2fc206.json +15 -0
  38. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_9d3466520f605a356f2c31458954e816.json +15 -0
  39. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_051b564433dad882d26853a2d2e41841.json +15 -0
  40. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_0ca431ee9c56812e10198e60552a536f.json +1 -1
  41. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_8ef78aa1880fd8536fa49acb127f51c0.json +15 -0
  42. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_04f9e76ff73eff953288564e5385dbd4.json +1 -1
  43. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_e9e8ca04b228ebbec6f48d24c147fbcf.json +15 -0
  44. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_f5cd402d603bead3d759ebb5485f39c3.json +1 -1
  45. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_2551adfcc4ecd63e37094152b44c1144.json +15 -0
  46. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_fc5837fa3ab53d1a511a8092a926d87d.json +1 -1
  47. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_a4ec61146ba0a517742770cb5843201f.json +15 -0
  48. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/delete first block_1_ee24300ba2c8986f54c02b0d2aec9691.json +15 -0
  49. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_21ad45e4791e6ce60e52c20228c507ff.json +15 -0
  50. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_002ed2fb069e97008c626fe8c2d43637.json +15 -0
  51. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/delete first block_1_af53bf5e53a86669deaae43b9ab27c67.json +15 -0
  52. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_a97a8a61e45a5cfa1f37771aefbf06ba.json +15 -0
  53. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_80d39d8c2f69d28a6aec0dee64eb7b4f.json +15 -0
  54. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_64d59c27de629179d00d268836aebcba.json +15 -0
  55. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_7cb863416d6d953446640251160e084e.json +15 -0
  56. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_c6025cf7f6efc3b57f721752b1f49801.json +15 -0
  57. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_b3b73d97f68d26aba18541b8c809ec4d.json +15 -0
  58. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_f6a509381d62c4242864af576bb7ba61.json +15 -0
  59. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_61539d923364c797cda8519b7d6dbb77.json +15 -0
  60. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_a73907775c98b6c395eac24591e7f1d4.json +15 -0
  61. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_1821b0f5da6b0bdb28f9444c6eaca222.json +15 -0
  62. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_82f2d8a07824544fad31d34c8a554af1.json +15 -0
  63. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c8bc122a4cb48783ca677fc4aa6cd947.json +15 -0
  64. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_686bfcd92e4eb65462c1811ad4a3976d.json +15 -0
  65. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_2968b738a7996331d8faf2692d652c3c.json +15 -0
  66. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_dd8e963f842a261deec745e8d4608bfd.json +15 -0
  67. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_06943ba0bda62a61f058ba07379ab4b7.json +15 -0
  68. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9e53c774c99f178f06b3c7b3608d1605.json +15 -0
  69. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_c9a31b6237ae08647b85c7348edd052f.json → Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_2b911dce06e556a512fa22d1a0042b5a.json } +2 -2
  70. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_f7d042c6ddd42b02098b813fe6e2da2b.json +15 -0
  71. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_0cbaaf87b0c6b588f7d7e21f72ed7a7c.json +15 -0
  72. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_d190a41cfce34eb5362468031cb608fe.json +15 -0
  73. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_963338caea5317fbaa588fed459f0895.json +15 -0
  74. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_da09ee8bda5dc347edc748b59bc3bb16.json +15 -0
  75. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_90482aba878618976330fda1af8f6766.json +15 -0
  76. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_5c149679babf73b41810f291fcb4d558.json +15 -0
  77. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_0c9d3ace7da95353a998edbaff79177d.json +15 -0
  78. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_57893638a0ceb0edac342346fa706076.json +15 -0
  79. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_ef01870ca5f4083b4ea345e00d3c52ff.json +15 -0
  80. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/{drop mark and link and change text within mark_1_6b9ad94993b0b3dc39ee8fab8057b967.json → styles + ic in target block, add mark (paragraph)_1_ee8107efdf5fd19552a7fff0b08f6657.json } +2 -2
  81. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_ca95d8d83853d5deb4765c6768a2563f.json +15 -0
  82. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_674d4ec4b8af2ac528ec90892731f67a.json +1 -1
  83. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/turn paragraphs into list_1_1ec910c96203d1d86b7dcce97e352e91.json +1 -1
  84. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/delete first block_1_d857ced55373d86233599394800f1a63.json → Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_e09825f3b2477a73e86972716897a19e.json } +2 -2
  85. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_cf54cfb6c7dfc32b6429ca1a2302a2b6.json +15 -0
  86. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading and code block_1_5790f7702887daff99c884204e6ae3df.json → Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_efeeda50dc4be1869d555c44cc00a5f5.json } +2 -2
  87. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_e3ff518cb46e814abe773f4184678323.json +15 -0
  88. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_c335661f5c1022666f7905497d4a3189.json +15 -0
  89. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_73db91187a949699f0fd921ebe60d841.json +15 -0
  90. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_57f7d170977b8d3400a3a1d7182790b0.json +15 -0
  91. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_67b27460b36b3013a36967448a8522c4.json +15 -0
  92. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_abd6ba31606c51fb682ca64b85af7008.json +15 -0
  93. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_bcb2fc9b7ec7eb1ae370d9387dc7e505.json +15 -0
  94. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_9e6d5cd399d444173556b9dc0afc3334.json +15 -0
  95. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_e1d72f9616d34022fba9ea219eb13748.json +15 -0
  96. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_bd11c0a3efe0e2b04a0133c6ca73a5cd.json +15 -0
  97. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{drop mark and link and change text within mark_1_60a05ae4a6b034fe6eaafb2b7bfb9638.json → styles + ic in target block, add mark (paragraph)_1_c865fea79947e8f5885f8c7ebc7dd91a.json } +2 -2
  98. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_e155e7bf26070976e31928b82bb13fbc.json +15 -0
  99. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_54ec8515dd6ab214d8b92c5cf4f09529.json +1 -1
  100. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_ec7bd4074c354be223256a9d0ab17e64.json +1 -1
  101. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_f88ee2c9e0a85200bb5550e4502fc0e5.json → Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_a935b00dc3276d6713bffbfb1fdf211e.json } +2 -2
  102. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_21d1130a166f73bca224130b84ed37c4.json +15 -0
  103. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_084f72a77d80ec6bb6cd2081b3b1d301.json → Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_8798a9655a7eb7a651bb81f5f811fc60.json } +2 -2
  104. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_001ea299cc5ab0754d17884094fa9d86.json +15 -0
  105. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_3b7f9df9f7701d51e2ccf274e5280a7d.json +15 -0
  106. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_3b9c9ee90eacd058e510ca1c82cbd554.json +15 -0
  107. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_2e588074658964fdee8f372a25645e39.json +15 -0
  108. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_8aa8c7ee6f4c17a92493df542b131069.json +15 -0
  109. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_7c37aad8ce27e926dc486960a90f35eb.json +15 -0
  110. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_a9fa6b0be7fae1d70499aa6ecfea6704.json +15 -0
  111. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_4d4299b8044479fe9e15a4a168707806.json +15 -0
  112. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_c6fa894a14f6be81fb568283e4724af9.json +15 -0
  113. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_aa627d12493a30d6fa1bbf6d282b6ecd.json +15 -0
  114. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/{drop mark and link and change text within mark_1_feb4bd702156a044fe3c72729f12d83c.json → styles + ic in target block, add mark (paragraph)_1_711e7638278935cce832085d8cce0abc.json } +2 -2
  115. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_739768c550cdc9eb5af10dbacc7c6d22.json +15 -0
  116. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_83bf8aa261516bf197d1391294bbcb06.json +1 -1
  117. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_5aa207db4b8600962363d2352bf0b1c4.json +1 -1
  118. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_c2ce81529453c6009b31fc3e2d3f8aea.json → Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_12e64702225f7eb521a176feffbdde9a.json } +2 -2
  119. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_b81e29ddb0de05a668236685bd2df42c.json +15 -0
  120. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_f48c2d1d72f4c3514c346629fb7f4d0d.json +15 -0
  121. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_c357b571feb374378ba1b288c39b6c31.json +15 -0
  122. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_782caee9bbb515bfdae481d31ea48e48.json +15 -0
  123. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_92e8df7af02866607d407a52926d4f52.json +15 -0
  124. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_69dfced69472e5cf7789a98b3ccbbdd8.json +15 -0
  125. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_f5d03fb0433b5e5b912f40dbffd9f462.json +15 -0
  126. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_d0386ebc8dc8350f33c44c2251cd1d3c.json +15 -0
  127. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_83b1ed76da3ba0a764fdc6fb4d25e47a.json +15 -0
  128. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_dd48a67d4d41880db75515d0a95a53dc.json +15 -0
  129. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_e21784bb9948aac3dd70492535dff192.json +15 -0
  130. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72b362e3a2e48e9e1d5dad68fc3da63c.json +15 -0
  131. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_968bf60fd7c9520b848955d47ea8a568.json +15 -0
  132. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_45c3fcc7757ac314a77786102326e125.json +15 -0
  133. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_8cfca4c1847085a8a31be1818346738e.json +1 -1
  134. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_2f31610c836b996af773c3856634d5c3.json +1 -1
  135. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_94cf62e3727b3443984720bc54218659.json +15 -0
  136. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_19432d3e11d58717813be52d54eb6edd.json +15 -0
  137. package/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts +20 -9
  138. package/src/api/formats/html-blocks/htmlBlocks.test.ts +9 -0
  139. package/src/api/formats/html-blocks/htmlPromptData.ts +4 -1
  140. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_da23f47c1267f17138027b6bd115b251.json +15 -0
  141. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_215b02f86ce29cdb7f8834b39d073041.json +15 -0
  142. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_56cad0142b200cfff68d9ff03f02e930.json +15 -0
  143. package/src/api/formats/json/__snapshots__/json.test.ts/{Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_6330ddde52ebd48c1e8914a970ad7849.json → Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_87a85aa54d0e545e325753089c3843b2.json } +3 -3
  144. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_572761dc235c6278ed438821af019645.json +15 -0
  145. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_a5e8aef512955120d014d7b2fc72d306.json +15 -0
  146. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_97ac96ad778b2e833c0e43c1a2221a4f.json +15 -0
  147. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_25dfbd403ed079997ccc162bd02defa7.json +15 -0
  148. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_240d8ee34ce9447499e1ea1058a6d6e3.json +15 -0
  149. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_ccaaaa4df61f9ed8a174034e7eb066af.json +15 -0
  150. package/src/api/formats/json/__snapshots__/json.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_923d9eef4b0b2e7367fd68983678a41a.json +15 -0
  151. package/src/api/formats/json/__snapshots__/json.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/{add paragraph and update selection_1_caeb25fbcd6743ad509ab18526f09180.json → add paragraph and update selection_1_ca185676c21707be2b3524b104786716.json } +3 -3
  152. package/src/api/formats/json/__snapshots__/json.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_6a4c9cc869ec961e3662b788540af827.json +15 -0
  153. package/src/api/formats/json/__snapshots__/json.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_8092e1583e60700c3cff810383dbf5ad.json +15 -0
  154. package/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_f36354147821c0e68c7e4d2ff18e8a95.json +15 -0
  155. package/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/delete first block_1_4ac561ca5a33ecb3cbb77482471e2477.json +15 -0
  156. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/clear block formatting_1_4479e5ad2d77e8d9f6b49330a706a3af.json +15 -0
  157. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_d8be2007761d56dcf271fa44d6e8a232.json +15 -0
  158. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_ce3a8d756277935c395939e94ffbdfb1.json +15 -0
  159. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_65bac275d973af0c7b46b2b8d5d324fe.json +15 -0
  160. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_e23642dde85b3d958c556c5e4f86ac38.json +15 -0
  161. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_b2b46f2ea1174691cf498ebb089d464a.json +15 -0
  162. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_94dcefb2b5844b8a3f64f32f87115a14.json +15 -0
  163. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_276903909ec4f878e8adc9c6bd53d0cf.json +15 -0
  164. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_e494072895d2e9d6bd0465582b9034f6.json +15 -0
  165. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_0781fecd32901229a780bd5675e62163.json +15 -0
  166. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_2d779ce68436ee4e33b6781e66c95d4d.json +15 -0
  167. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_03a2f68b3d126b81618ffeebec9f2c7f.json +15 -0
  168. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/{drop mark and link and change text within mark_1_c94d4dbaf7e20ccafc3a87f8933afd6a.json → styles + ic in target block, add mark (paragraph)_1_7875145fec05f9cae7e28537ac95bc84.json } +3 -3
  169. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_0fe47d4cbf760327d6622e9e27c734c4.json +15 -0
  170. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/{translate selection_1_e06a86826098274cfb35046f8f5f67a5.json → translate selection_1_a1c443203ee18f4ec6d71349d0c57311.json } +3 -3
  171. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/{turn paragraphs into list_1_c704dd8060467f285e008fcfa10bd3b9.json → turn paragraphs into list_1_641282d2e6c4ebf728bf3d68a286275b.json } +3 -3
  172. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/{styles + ic in source block, update mention prop_1_c2fb024d9d7218c5051012323c39fa0d.json → update block prop and content_1_535c3a219eb5cf340184d102273a2cf4.json } +3 -3
  173. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_c7c286b44674e4f6141b1e95819b7f60.json +15 -0
  174. package/src/api/formats/json/__snapshots__/json.test.ts/{Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_5515f1ecee9bd348f415319f4a843add.json → Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_901d3a54e64251f1be4ee227b9fb4522.json } +3 -3
  175. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_90c759912d4965fb8ce694e2a63e26fb.json +15 -0
  176. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_49a8b14dc6c4c5cc452e22c79dae5b62.json +15 -0
  177. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_2c278aa8dd1cb7a5f35e306e9a02c487.json +15 -0
  178. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_8349974ecc8b2268c1b5b42aa93563b7.json +15 -0
  179. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_3773830b2cf364532410c9c5498a1355.json +15 -0
  180. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_c0dd9920ce66da75022907181066f5c8.json +15 -0
  181. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_255c7e8a0fd687acb58e373b4b4e7bee.json +15 -0
  182. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_462e7956999f00b4e3ff89faa46d3d4d.json +15 -0
  183. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_c7c6246b702c9417679fec382dfa34d1.json +15 -0
  184. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_5eb79311fbbec3ee0ed02e0178b3bee6.json +15 -0
  185. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_5d52b9a4787e7d80ebeabb4ebd975206.json +15 -0
  186. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_18ed7c60005c23092d68b0d1f73af517.json +15 -0
  187. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_b2017bfc7ff6e6440d2459f1042a8a49.json +15 -0
  188. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_b68a744287cba99975e82279562eb768.json +15 -0
  189. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_a435c74c2ca086ce0225445d217e9a2e.json +15 -0
  190. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/{translate selection_1_3f8ef537734ef9b7d2142c49bde8cbdd.json → translate selection_1_ac70d79d18996d3e08a6559885013c70.json } +3 -3
  191. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_92a38569e8e9c873af8553e1607a7ba7.json +15 -0
  192. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_470bec988f3c558f26928b2f29b50637.json +15 -0
  193. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_7e88e61010d66486f9882befa48894db.json +15 -0
  194. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_1c088e30cb25a7508d30c2079426a225.json +15 -0
  195. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_9fed5f51d881546a9031bc6308ff465c.json +15 -0
  196. package/src/api/formats/json/defaultJSONPromptBuilder.ts +52 -6
  197. package/src/api/formats/json/json.test.ts +1 -1
  198. package/src/api/formats/json/jsonPromptData.ts +4 -1
  199. package/src/api/formats/markdown-blocks/markdownPromptData.ts +4 -1
  200. package/src/api/promptHelpers/trimEmptyBlocks.ts +2 -1
  201. package/src/api/schema/__snapshots__/schemaToJSONSchema.test.ts.snap +8 -0
  202. package/src/components/AIMenu/BlockPositioner.tsx +12 -1
  203. package/src/components/AIMenu/getDefaultAIMenuItems.tsx +1 -1
  204. package/src/i18n/locales/he.ts +73 -0
  205. package/src/i18n/locales/index.ts +1 -0
  206. package/src/prosemirror/__snapshots__/agent.test.ts.snap +23 -12
  207. package/src/prosemirror/__snapshots__/changeset.test.ts.snap +2 -0
  208. package/src/streamTool/callLLMWithStreamTools.ts +12 -2
  209. package/src/testUtil/cases/addOperationTestCases.ts +14 -1
  210. package/src/testUtil/cases/editors/emptyEditor.ts +21 -0
  211. package/src/testUtil/cases/index.ts +4 -1
  212. package/src/testUtil/testAIModels.ts +6 -0
  213. package/types/src/api/promptHelpers/trimEmptyBlocks.d.ts +1 -0
  214. package/types/src/components/AIMenu/BlockPositioner.d.ts +4 -1
  215. package/types/src/i18n/locales/he.d.ts +2 -0
  216. package/types/src/i18n/locales/index.d.ts +1 -0
  217. package/types/src/testUtil/cases/editors/blockFormatting.d.ts +42 -2
  218. package/types/src/testUtil/cases/editors/emptyEditor.d.ts +584 -0
  219. package/types/src/testUtil/cases/editors/formattingAndMentions.d.ts +42 -2
  220. package/types/src/testUtil/cases/editors/simpleEditor.d.ts +84 -4
  221. package/types/src/testUtil/cases/editors/tables.d.ts +42 -2
  222. package/types/src/testUtil/cases/schemas/mention.d.ts +42 -2
  223. package/types/src/testUtil/testAIModels.d.ts +1 -0
  224. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/Add heading (h1) and code block_1_112bacb4ae22459e8e8b87c510a5a1ab.json +0 -15
  225. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/add a list (end)_1_fd2cdf7edb597b5eee87ae1b4c9d8a9e.json +0 -15
  226. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/add a new paragraph (end)_1_f9f8cec49b3218519501c03ff5c4a3ba.json +0 -15
  227. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/add a new paragraph (start)_1_d152c585ba7d2fa6e68b1d4b063f266c.json +0 -15
  228. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (streaming)/add a new paragraph (start)_1_ae61114b97c12fbf57d14d6c64ffd647.json +0 -15
  229. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading and code block_1_c9a31b6237ae08647b85c7348edd052f.json +0 -15
  230. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a list (end)_1_db45f2ba8778e15e8a5f7a320508be46.json +0 -15
  231. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_f3eaf50ddad718f55acaa05dcc1a2809.json +0 -15
  232. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (start)_1_33db3205ea17e8f6ea3a5e2728b6f10e.json +0 -15
  233. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_5790f7702887daff99c884204e6ae3df.json +0 -15
  234. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_321607ef45a4235ca02c411097005de2.json +0 -15
  235. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_709e808af3f5fb39418413416804a03e.json +0 -15
  236. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_034fd3f9b57eba789a6449d5ff3714c4.json +0 -15
  237. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading and code block_1_084f72a77d80ec6bb6cd2081b3b1d301.json +0 -15
  238. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_5c081c7846ad89b59477ceda44c2a349.json +0 -15
  239. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_97770b1d0462a25cfacd049807a59110.json +0 -15
  240. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_ecf9943025fd7f7183aac8d86c4e0b6c.json +0 -15
  241. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_b19471ad74a7a4bf4b288369edf35407.json +0 -15
  242. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading and code block_1_b19471ad74a7a4bf4b288369edf35407.json +0 -15
  243. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_8105f57bbca898c1626edd5cd33308ed.json +0 -15
  244. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_2f4aa2dfa4f6046506c9e133c5d60e76.json +0 -15
  245. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_7352df4919df344c441fb32b5cdae62b.json +0 -15
  246. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/add and update paragraph_1_861b7da5f0734c4350466fb42da57dfe.json +0 -15
  247. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/add paragraph and update selection_1_4821f5b399d9ebc5b564c530740345ea.json +0 -15
  248. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_0d6f9f822d5ba2310e9cb3b5330d1ef0.json +0 -15
  249. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_96cb428c4df1b42645632abe5969170c.json +0 -15
  250. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_80b906ff9d95e8b88b30c4efd246dc4b.json +0 -15
  251. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_e0a277e6c9c61c532876788f8c914f42.json +0 -15
  252. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/delete first block_1_ba835c26344e8e2082ee1f404bacb992.json +0 -15
  253. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/delete first block_1_90f8de8d41648f556395ecf223aa0e6e.json +0 -15
  254. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link and change text within mark_1_953804d0569e88c225ebe8711ac1d209.json +0 -15
  255. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link_1_9cfdcdc629e0d2c8ba65e699037e007c.json +0 -15
  256. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/modify nested content_1_595e0413e677a7d0e1cf7024e2cdbf11.json +0 -15
  257. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/modify parent content_1_8a40e8e484dd5e6352b3019e81255567.json +0 -15
  258. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/plain source block, add mention_1_03e2c4dfae2ceb146b12fc9a266da98e.json +0 -15
  259. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_f65e23072a2f6be046fc618e0dbf3949.json +0 -15
  260. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mark_1_3e4d4d1ba3f4c2e80cb1d38f35425665.json +0 -15
  261. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mention_1_7c0c0ebbf2e5eb36903b25d3e63f2a96.json +0 -15
  262. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, replace content_1_f8c8827fbecd6977bdb2e5152b493530.json +0 -15
  263. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, update mention prop_1_f4e5d300be72cb5a6c2ef33c32ce7325.json +0 -15
  264. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, update text_1_388a274079ba06bcec0049a35278fc01.json +0 -15
  265. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c7be52683c9d405365815f334ed1f4db.json +0 -15
  266. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark (word)_1_9bc0da43041ca4b3a188fbdfd9562bae.json +0 -15
  267. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/translate selection_1_6f0c6d98d9a99081b01869826a538c74.json +0 -15
  268. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/turn paragraphs into list_1_122467a8b6979ad2a47b0417976218a9.json +0 -15
  269. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type and content_1_ace9cde890d5c4b2a131f8867e7b5596.json +0 -15
  270. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type_1_d356646093fb778e9c8bce47f7133ef8.json +0 -15
  271. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_bde418f70f7c93522d3cff713cb6e8b2.json +0 -15
  272. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_6d6efada9f514cd6b5d479b784960905.json +0 -15
  273. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_a0f2a68ef2f46c1a3c014966a1d41463.json +0 -15
  274. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_26a2249225e49ac962f2ffc4d186f048.json +0 -15
  275. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_8a9dfa091990b0ea68d8b5e600e5ded4.json +0 -15
  276. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_b5da218448fab4a6144aee7b49fe7cfd.json +0 -15
  277. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_93cd31cde8f8a9d7bcc6ec163bd82e32.json +0 -15
  278. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_98388769d4b6c534a448363e38006369.json +0 -15
  279. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_56b6b0d7b3b4585a4ca5598979ccc319.json +0 -15
  280. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_df81f4ea9e9cda25c1ef6b1d0de62e6e.json +0 -15
  281. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_c473102de44b6890149109c418f224a7.json +0 -15
  282. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_e6db90ec1ad4b48b7e225a5ef7b7ea08.json +0 -15
  283. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_afb308d981984d812bf89191d498ddac.json +0 -15
  284. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_7d6962e90a2fb300f8efab2620d77389.json +0 -15
  285. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_a13d0c4ae92fddfbcbef8c619c092951.json +0 -15
  286. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_8d4842fb70ad278064faa2c3c6efa73e.json +0 -15
  287. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_70a3e6c68033303f4dce207ea802bba9.json +0 -15
  288. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_3f639531f292bf1edb20bbb65c6ad0e0.json +0 -15
  289. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_f3cba828671b95cae0b485ad554942cd.json +0 -15
  290. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_d0dca6e4fab1bc2c56ba2099e199fb05.json +0 -15
  291. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_1e8bbd364a267db768002ed243692a79.json +0 -15
  292. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_b48a9c33b3a0d37850bd38f4c95b310f.json +0 -15
  293. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_196e976a8d5748fd3b667cc39b96cc4d.json +0 -15
  294. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_ab9642000a9e81712bf7bf3292769536.json +0 -15
  295. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_aedf9aba96ec8de63204dc0bd079cce0.json +0 -15
  296. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_4032f8de849b4d06146cea086f5faee0.json +0 -15
  297. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_37c8ad3a742c0e37960ee3c688ecff05.json +0 -15
  298. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_34b0f8d08eec54b64843fe3f13048db5.json +0 -15
  299. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_49c10b96b8a5342b3afe37277f0b2ec0.json +0 -15
  300. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_fa30ce9145d3237fa4a0b86a61965fb3.json +0 -15
  301. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_148394a5f5658c93445adc9e68410296.json +0 -15
  302. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_b61d90f1021054f8bcf1258cf9d11fe4.json +0 -15
  303. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_6dcc3499f6996bd4b16327d079c23b21.json +0 -15
  304. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_efbe6b2b8f77c628de12b4ae99dc6939.json +0 -15
  305. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_c3ec555a7988880acc8c448befdc501d.json +0 -15
  306. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_7f328ec2574aff0eba83678fedea486a.json +0 -15
  307. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_2246a490805512b4459ec130c3f7b028.json +0 -15
  308. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_089c1b96e5eef0e337d6ae0646f3670d.json +0 -15
  309. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_1b70479170637ef990c696b81982a9ff.json +0 -15
  310. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_8fc18a40e2b4ccc90a9be4a3a826572b.json +0 -15
  311. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_7187509500683cd511ef79bc79adf45e.json +0 -15
  312. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_263f9c25f7a85f762b255a3778136737.json +0 -15
  313. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_030b36dcdf89ff60ac373c9797f5caa8.json +0 -15
  314. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_6bc68512d0085273aa59c32b20ff22b9.json +0 -15
  315. package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_171c87db8855dba2d6bbcd06ae45fbb5.json +0 -15
  316. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4b13d164d4335cc9e201d217c288f3a0.json +0 -15
  317. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_2e1b3d58032f40317616d76bf4fea81c.json +0 -15
  318. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_4267ae57d44c64aa8b70a89aab67f159.json +0 -15
  319. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_9d50ec65e996e7a56294ea29bc698367.json +0 -15
  320. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_8c55f5cd009ab351956e1b40605abc34.json +0 -15
  321. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_eabec381f0f6973116f9e49dc86810d4.json +0 -15
  322. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_018cc4d3757dfb60819403609f61a74d.json +0 -15
  323. package/src/api/formats/json/__snapshots__/json.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_aeee8d53d8e28d27a45229e9f04bfd02.json +0 -15
  324. package/src/api/formats/json/__snapshots__/json.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_46911433377fbe117de27b4ebef430f5.json +0 -15
  325. package/src/api/formats/json/__snapshots__/json.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_049c64f71763963c05852957cdcd40bd.json +0 -15
  326. package/src/api/formats/json/__snapshots__/json.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_d7907adc86da5742363bfc4422e490e6.json +0 -15
  327. package/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/delete first block_1_7c35b931bd8677fa1920b9e5f8128f4a.json +0 -15
  328. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/clear block formatting_1_25bc98ef490234deedb61e16a00d439e.json +0 -15
  329. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_164602425b43f343ccbfb3c2f1509b58.json +0 -15
  330. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_60470c62411dbe76f9d1ebb97160e62c.json +0 -15
  331. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_603268f548d2c26969d79e4e170bd524.json +0 -15
  332. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_dc3adc84764ea9dd8f20a906a4633334.json +0 -15
  333. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_aa396a89a86700c7c1531127331c95b9.json +0 -15
  334. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_e1de4a145c9a98804f8d1fd1ae811da4.json +0 -15
  335. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_ce587e62f1783dd0652ffea5d558fda6.json +0 -15
  336. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_e2f62ab4415528c63105a90c35e202f3.json +0 -15
  337. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_fb966bb5f366d489cd267e48a7455c72.json +0 -15
  338. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_10409eb8f8e256c2c07ee05c2558a2a9.json +0 -15
  339. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_be4a66aa5ee43a3fd916166e56052ad0.json +0 -15
  340. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_697c8f64d854e5a824cb735c81d9b7ea.json +0 -15
  341. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_6b93af6e60c455fec9f8bde5b44e587d.json +0 -15
  342. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_fd7ea265becc91c2e55258021a82a016.json +0 -15
  343. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_e9409ed44af8d5b1f3ec7d3b7125386a.json +0 -15
  344. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_35579261c0f297cf664524f0c5e08ff1.json +0 -15
  345. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_d7303b2c5a80c7a016ba6caa2ae7be04.json +0 -15
  346. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_55d150e200dccb9c1ac1b325aa8d5a43.json +0 -15
  347. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_34fba8f0eb2af6cd8d1af416390d9dc4.json +0 -15
  348. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_ae41cefb5832864a8a9b2e67c04c65b4.json +0 -15
  349. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_a7a20bf9510adbbafe889498aa22f0ce.json +0 -15
  350. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_db2880a42dbde80ff9950f502ef1ab8f.json +0 -15
  351. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_48523af48bae8448f99a3d4108bb8a55.json +0 -15
  352. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_024c55cd1b3177f362a2d606090ca19a.json +0 -15
  353. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_549dd0fe54084e4a98588be963db9361.json +0 -15
  354. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_dbf2fb610e354e0daa60de0cbdd77aba.json +0 -15
  355. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_8369c3cd3da93d0e734ed7092c0acf40.json +0 -15
  356. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_7033d19147879fada8c8142ee2be4803.json +0 -15
  357. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_f8fd91cad88cfec6db2a906b564d39d3.json +0 -15
  358. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_708c779a29da274a24e34cea53755e3b.json +0 -15
  359. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_67d9ce65ebaaf76b1dde8492176299fc.json +0 -15
  360. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_f9b7241b0cb9e9e098e13a58b47bfa62.json +0 -15
  361. package/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_dbb1b2b807becf642bb03a71e34b8e21.json +0 -15
@@ -1,34 +1,34 @@
1
1
  var et = Object.defineProperty;
2
2
  var tt = (e, t, o) => t in e ? et(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var j = (e, t, o) => tt(e, typeof t != "symbol" ? t + "" : t, o);
3
+ var $ = (e, t, o) => tt(e, typeof t != "symbol" ? t + "" : t, o);
4
4
  import { getPmSchema as ot, UnreachableCaseError as Pe, getNodeById as rt, updateBlockTr as nt, insertBlocks as st, trackPosition as se, removeAndInsertBlocks as it, getBlock as Oe, defaultProps as Me, isStyledTextInlineContent as at, isLinkInlineContent as ct, BlockNoteExtension as lt, filterSuggestionItems as ut, mergeCSSClasses as dt } from "@blocknote/core";
5
- import { applySuggestions as Be, suggestChanges as ft, revertSuggestions as ie } from "@blocknote/prosemirror-suggest-changes";
6
- import { jsonSchema as Le, streamObject as pt, generateObject as mt, APICallError as ht, RetryError as yt } from "ai";
7
- import { TextSelection as kt, Plugin as xe, PluginKey as _e } from "prosemirror-state";
8
- import { fixTablesKey as gt } from "prosemirror-tables";
5
+ import { applySuggestions as Be, suggestChanges as mt, revertSuggestions as ie } from "@blocknote/prosemirror-suggest-changes";
6
+ import { jsonSchema as xe, streamObject as ft, generateObject as pt, APICallError as ht, RetryError as yt } from "ai";
7
+ import { TextSelection as gt, Plugin as Le, PluginKey as _e } from "prosemirror-state";
8
+ import { fixTablesKey as kt } from "prosemirror-tables";
9
9
  import bt from "lodash.isequal";
10
10
  import { Slice as Y, Fragment as ae } from "prosemirror-model";
11
- import { Transform as N, Mapping as Ie, ReplaceStep as x, ReplaceAroundStep as St } from "prosemirror-transform";
11
+ import { Transform as A, Mapping as Ie, ReplaceStep as _, ReplaceAroundStep as St } from "prosemirror-transform";
12
12
  import { ChangeSet as ce, simplifyChanges as wt } from "prosemirror-changeset";
13
13
  import { DecorationSet as le, Decoration as ue } from "prosemirror-view";
14
14
  import { defaultSelectionBuilder as Tt } from "y-prosemirror";
15
15
  import { jsxs as vt, jsx as y } from "react/jsx-runtime";
16
16
  import { useBlockNoteContext as Ct, useComponentsContext as G, useSuggestionMenuKeyboardHandler as Pt, useBlockNoteEditor as K, useUIElementPositioning as Ot } from "@blocknote/react";
17
- import B, { useState as Ee, useCallback as $, useMemo as I, useEffect as Ne } from "react";
17
+ import B, { useState as Ee, useCallback as D, useMemo as E, useEffect as Ne } from "react";
18
18
  import { useStore as Ae } from "zustand";
19
- import { offset as Mt, size as Bt, autoUpdate as Lt } from "@floating-ui/react";
19
+ import { offset as Mt, size as Bt, autoUpdate as xt } from "@floating-ui/react";
20
20
  const de = (e) => {
21
21
  let t;
22
- const o = /* @__PURE__ */ new Set(), r = (u, p) => {
22
+ const o = /* @__PURE__ */ new Set(), r = (u, f) => {
23
23
  const l = typeof u == "function" ? u(t) : u;
24
24
  if (!Object.is(l, t)) {
25
- const m = t;
26
- t = p ?? (typeof l != "object" || l === null) ? l : Object.assign({}, t, l), o.forEach((f) => f(t, m));
25
+ const p = t;
26
+ t = f ?? (typeof l != "object" || l === null) ? l : Object.assign({}, t, l), o.forEach((m) => m(t, p));
27
27
  }
28
- }, n = () => t, s = { setState: r, getState: n, getInitialState: () => c, subscribe: (u) => (o.add(u), () => o.delete(u)) }, c = t = e(r, n, s);
29
- return s;
30
- }, fe = (e) => e ? de(e) : de;
31
- function xt(e) {
28
+ }, n = () => t, i = { setState: r, getState: n, getInitialState: () => c, subscribe: (u) => (o.add(u), () => o.delete(u)) }, c = t = e(r, n, i);
29
+ return i;
30
+ }, me = (e) => e ? de(e) : de;
31
+ function Lt(e) {
32
32
  const { properties: t, required: o, $defs: r, ...n } = e.parameters;
33
33
  return {
34
34
  schema: {
@@ -49,7 +49,7 @@ function xt(e) {
49
49
  };
50
50
  }
51
51
  function je(e) {
52
- const t = e.map((r) => xt(r)), o = {};
52
+ const t = e.map((r) => Lt(r)), o = {};
53
53
  for (const r of t)
54
54
  for (const n in r.$defs) {
55
55
  if (o[n] && !bt(o[n], r.$defs[n]))
@@ -84,7 +84,7 @@ function _t(e) {
84
84
  }
85
85
  });
86
86
  }
87
- function E(e) {
87
+ function N(e) {
88
88
  if (e.locked)
89
89
  throw new Error(
90
90
  "Stream (source) is already locked and cannot be iterated."
@@ -103,22 +103,22 @@ function E(e) {
103
103
  }, t;
104
104
  }
105
105
  function $e(e) {
106
- return E(_t(e));
106
+ return N(_t(e));
107
107
  }
108
108
  async function* It(e) {
109
109
  var n;
110
110
  let t = 0, o = !0, r;
111
- for await (const i of e)
112
- if ((n = i.operations) != null && n.length) {
113
- for (let a = t; a < i.operations.length; a++) {
114
- const s = i.operations[a];
115
- r = s, yield {
116
- partialOperation: s,
111
+ for await (const s of e)
112
+ if ((n = s.operations) != null && n.length) {
113
+ for (let a = t; a < s.operations.length; a++) {
114
+ const i = s.operations[a];
115
+ r = i, yield {
116
+ partialOperation: i,
117
117
  isUpdateToPreviousOperation: a === t && !o,
118
- isPossiblyPartial: a === i.operations.length - 1
118
+ isPossiblyPartial: a === s.operations.length - 1
119
119
  }, o = !1;
120
120
  }
121
- t = i.operations.length - 1;
121
+ t = s.operations.length - 1;
122
122
  }
123
123
  if (!r)
124
124
  throw new Error("No operations seen");
@@ -145,7 +145,7 @@ async function* De(e, t) {
145
145
  async function* Re(e, t) {
146
146
  for await (const o of e) {
147
147
  const r = t.find(
148
- (i) => i.name === o.partialOperation.type
148
+ (s) => s.name === o.partialOperation.type
149
149
  );
150
150
  if (!r) {
151
151
  yield {
@@ -196,30 +196,31 @@ async function At(e, t) {
196
196
  throw new Error(
197
197
  "Cannot provide output or schema in _generateObjectOptions"
198
198
  );
199
- const i = {
199
+ const s = {
200
200
  // non-overridable options for streamObject
201
201
  output: "object",
202
- schema: Le(je(e)),
202
+ schema: xe(je(e)),
203
203
  // configurable options for streamObject
204
204
  // - optional, with defaults
205
205
  // mistral somehow needs "auto", while groq/llama needs "tool"
206
+ // google needs "auto" because https://github.com/vercel/ai/issues/6959
206
207
  // TODO: further research this and / or make configurable
207
208
  // for now stick to "tool" by default as this has been tested mostly
208
- mode: r.model.provider === "mistral.chat" ? "auto" : "tool",
209
+ mode: r.model.provider === "mistral.chat" || r.model.provider === "google.generative-ai" ? "auto" : "tool",
209
210
  // - mandatory ones:
210
211
  ...r,
211
212
  // extra options for streamObject
212
213
  ...o ?? {}
213
- }, a = await mt(i), s = jt(a.object);
214
- if (!s.ok)
215
- throw new Error(s.error);
214
+ }, a = await pt(s), i = jt(a.object);
215
+ if (!i.ok)
216
+ throw new Error(i.error);
216
217
  let c;
217
218
  return {
218
219
  streamObjectResult: void 0,
219
220
  generateObjectResult: a,
220
221
  get operationsSource() {
221
222
  return c || (c = $e(
222
- Nt(s.value, e)
223
+ Nt(i.value, e)
223
224
  )), c;
224
225
  },
225
226
  async getGeneratedOperations() {
@@ -255,32 +256,33 @@ async function $t(e, t, o = () => {
255
256
  const a = {
256
257
  // non-overridable options for streamObject
257
258
  output: "object",
258
- schema: Le(je(e)),
259
+ schema: xe(je(e)),
259
260
  // configurable options for streamObject
260
261
  // - optional, with defaults
261
262
  // mistral somehow needs "auto", while groq/llama needs "tool"
263
+ // google needs "auto" because https://github.com/vercel/ai/issues/6959
262
264
  // TODO: further research this and / or make configurable
263
265
  // for now stick to "tool" by default as this has been tested mostly
264
- mode: n.model.provider === "mistral.chat" ? "auto" : "tool",
266
+ mode: n.model.provider === "mistral.chat" || n.model.provider === "google.generative-ai" ? "auto" : "tool",
265
267
  // - mandatory ones:
266
268
  ...n,
267
269
  // extra options for streamObject
268
270
  ...t._streamObjectOptions ?? {}
269
- }, s = pt(a);
271
+ }, i = ft(a);
270
272
  let c;
271
- const [u, p] = s.fullStream.tee(), l = (async () => {
272
- let m = {
273
+ const [u, f] = i.fullStream.tee(), l = (async () => {
274
+ let p = {
273
275
  operations: []
274
276
  };
275
- const f = E(
276
- Ht(p)
277
+ const m = N(
278
+ Ht(f)
277
279
  );
278
- for await (const h of f)
279
- h && typeof h == "object" && "operations" in h && (m = h);
280
- return m;
280
+ for await (const h of m)
281
+ h && typeof h == "object" && "operations" in h && (p = h);
282
+ return p;
281
283
  })();
282
284
  return {
283
- streamObjectResult: s,
285
+ streamObjectResult: i,
284
286
  generateObjectResult: void 0,
285
287
  get operationsSource() {
286
288
  return c || (c = $e(
@@ -288,7 +290,7 @@ async function $t(e, t, o = () => {
288
290
  It(
289
291
  Dt(
290
292
  Rt(
291
- E(u)
293
+ N(u)
292
294
  ),
293
295
  o
294
296
  )
@@ -308,7 +310,7 @@ async function* Dt(e, t) {
308
310
  o && (t(), o = !1), yield r;
309
311
  }
310
312
  function Rt(e) {
311
- return E(
313
+ return N(
312
314
  e.pipeThrough(
313
315
  new TransformStream({
314
316
  transform(t, o) {
@@ -333,7 +335,7 @@ function Rt(e) {
333
335
  );
334
336
  }
335
337
  function Ht(e) {
336
- return E(
338
+ return N(
337
339
  e.pipeThrough(
338
340
  new TransformStream({
339
341
  transform(t, o) {
@@ -394,14 +396,32 @@ class qt {
394
396
  console.log(JSON.stringify(t, null, 2));
395
397
  }
396
398
  }
397
- function U(e, t) {
399
+ function Ut(e, t, o = !0, r = !0) {
400
+ let n = 0, s = e.length;
401
+ if (o)
402
+ for (; n < s && t(e[n]); )
403
+ n++;
404
+ if (r)
405
+ for (; s > n && t(e[s - 1]); )
406
+ s--;
407
+ return e.slice(n, s);
408
+ }
409
+ function x(e, t) {
410
+ return Ut(
411
+ e,
412
+ (r) => X(r) && (t == null ? void 0 : t.cursorBlockId) !== r.id,
413
+ (t == null ? void 0 : t.trimStart) ?? !1,
414
+ (t == null ? void 0 : t.trimEnd) ?? !0
415
+ );
416
+ }
417
+ function F(e, t) {
398
418
  const o = e.getTextCursorPosition(), r = [];
399
419
  for (const n of t) {
400
- const i = n.id === o.block.id;
420
+ const s = n.id === o.block.id;
401
421
  r.push({
402
422
  id: n.id,
403
423
  block: n.block
404
- }), i && r.push({
424
+ }), s && r.push({
405
425
  cursor: !0
406
426
  });
407
427
  }
@@ -428,33 +448,17 @@ function L(e) {
428
448
  id: `${t.id}$`
429
449
  } : t);
430
450
  }
431
- function zt(e, t, o = !0, r = !0) {
432
- let n = 0, i = e.length;
433
- if (o)
434
- for (; n < i && t(e[n]); )
435
- n++;
436
- if (r)
437
- for (; i > n && t(e[i - 1]); )
438
- i--;
439
- return e.slice(n, i);
440
- }
441
- function F(e, t) {
442
- return zt(
443
- e,
444
- (r) => X(r),
445
- (t == null ? void 0 : t.trimStart) ?? !1,
446
- (t == null ? void 0 : t.trimEnd) ?? !0
447
- );
448
- }
449
451
  async function He(e, t) {
450
- const o = F(e.document), r = await C(
451
- T(o),
452
- async (s) => e.blocksToHTMLLossy([s])
453
- ), i = U(e, r).filter(
454
- (s) => "cursor" in s || !(t.excludeBlockIds || []).includes(s.id)
452
+ const o = e.getTextCursorPosition().block.id, r = x(e.document, {
453
+ cursorBlockId: o
454
+ }), n = await C(
455
+ T(r),
456
+ async (c) => e.blocksToHTMLLossy([c])
457
+ ), a = F(e, n).filter(
458
+ (c) => "cursor" in c || !(t.excludeBlockIds || []).includes(c.id)
455
459
  );
456
460
  return {
457
- htmlBlocks: L(i)
461
+ htmlBlocks: L(a)
458
462
  };
459
463
  }
460
464
  async function qe(e, t) {
@@ -468,7 +472,7 @@ async function qe(e, t) {
468
472
  // strip ids so LLM can't accidentally issue updates to ids not in selection
469
473
  };
470
474
  }
471
- function Ut(e) {
475
+ function zt(e) {
472
476
  return [
473
477
  {
474
478
  role: "system",
@@ -506,6 +510,10 @@ function Ft(e) {
506
510
  role: "system",
507
511
  content: JSON.stringify(e.htmlBlocks)
508
512
  },
513
+ {
514
+ role: "system",
515
+ content: 'First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\n EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\n \n ' + (e.isEmptyDocument ? "Because the document is empty, first update the empty block before adding new blocks." : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question).")
516
+ },
509
517
  {
510
518
  role: "system",
511
519
  content: "The user asks you to do the following:"
@@ -513,16 +521,13 @@ function Ft(e) {
513
521
  {
514
522
  role: "user",
515
523
  content: e.userPrompt
516
- },
517
- {
518
- role: "system",
519
- content: 'First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\n EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\n \n Prefer updating existing blocks over removing and adding (but this also depends on the user\'s question).'
520
524
  }
521
525
  ];
522
526
  }
523
527
  const Jt = async (e, t) => {
528
+ const o = x(e.document).length === 0;
524
529
  if (t.selectedBlocks) {
525
- const o = await qe(e, {
530
+ const r = await qe(e, {
526
531
  selectedBlocks: t.selectedBlocks
527
532
  });
528
533
  return t.previousMessages ? [
@@ -534,7 +539,7 @@ const Jt = async (e, t) => {
534
539
  },
535
540
  {
536
541
  role: "system",
537
- content: JSON.stringify(o.htmlSelectedBlocks)
542
+ content: JSON.stringify(r.htmlSelectedBlocks)
538
543
  },
539
544
  {
540
545
  role: "system",
@@ -542,7 +547,7 @@ const Jt = async (e, t) => {
542
547
  },
543
548
  {
544
549
  role: "system",
545
- content: JSON.stringify(o.htmlDocument)
550
+ content: JSON.stringify(r.htmlDocument)
546
551
  },
547
552
  {
548
553
  role: "system",
@@ -555,12 +560,12 @@ const Jt = async (e, t) => {
555
560
  role: "user",
556
561
  content: t.userPrompt
557
562
  }
558
- ] : Ut({
559
- ...o,
563
+ ] : zt({
564
+ ...r,
560
565
  userPrompt: t.userPrompt
561
566
  });
562
567
  } else {
563
- const o = await He(e, t);
568
+ const r = await He(e, t);
564
569
  return t.previousMessages ? [
565
570
  ...t.previousMessages,
566
571
  {
@@ -570,7 +575,7 @@ const Jt = async (e, t) => {
570
575
  },
571
576
  {
572
577
  role: "system",
573
- content: JSON.stringify(o.htmlBlocks)
578
+ content: JSON.stringify(r.htmlBlocks)
574
579
  },
575
580
  {
576
581
  role: "system",
@@ -584,8 +589,9 @@ const Jt = async (e, t) => {
584
589
  content: t.userPrompt
585
590
  }
586
591
  ] : Ft({
587
- ...o,
588
- userPrompt: t.userPrompt
592
+ ...r,
593
+ userPrompt: t.userPrompt,
594
+ isEmptyDocument: o
589
595
  });
590
596
  }
591
597
  };
@@ -593,47 +599,47 @@ function Vt(e) {
593
599
  let t, o = !1;
594
600
  return e.descendants((r, n) => o ? !1 : (r.isText && (o = !0, t = n), !0)), t;
595
601
  }
596
- function D(e) {
597
- var i;
598
- const t = ot(e), { modification: o } = t.marks, r = [], n = new N(e.before);
602
+ function R(e) {
603
+ var s;
604
+ const t = ot(e), { modification: o } = t.marks, r = [], n = new A(e.before);
599
605
  for (let a = 0; a < e.steps.length; a++) {
600
- const s = e.steps[a], c = new Ie(e.mapping.maps.slice(0, a)).invert();
601
- if (s.structure) {
602
- if (s instanceof x) {
603
- if (s.to !== s.from + 1 || s.slice.openStart !== 0 || s.slice.openEnd !== 1 || s.slice.content.size !== 2)
606
+ const i = e.steps[a], c = new Ie(e.mapping.maps.slice(0, a)).invert();
607
+ if (i.structure) {
608
+ if (i instanceof _) {
609
+ if (i.to !== i.from + 1 || i.slice.openStart !== 0 || i.slice.openEnd !== 1 || i.slice.content.size !== 2)
604
610
  throw new Error(
605
611
  "Structure change is not in expected format (ReplaceStep)"
606
612
  );
607
- } else if (s instanceof St) {
608
- if (s.insert !== 1 || s.slice.size !== 2 || s.gapTo !== s.to - 1 || s.gapFrom !== s.from + 1)
613
+ } else if (i instanceof St) {
614
+ if (i.insert !== 1 || i.slice.size !== 2 || i.gapTo !== i.to - 1 || i.gapFrom !== i.from + 1)
609
615
  throw new Error(
610
616
  "Structure change is not in expected format (ReplaceAroundStep)"
611
617
  );
612
618
  } else
613
619
  throw new Error("Step is not a ReplaceStep or ReplaceAroundStep");
614
- const b = c.map(s.from), k = s.slice.content.firstChild, g = n.doc.resolve(n.mapping.map(b)).nodeAfter;
615
- let w = k.marks || [];
616
- k.type !== g.type && (w = o.create({
620
+ const b = c.map(i.from), g = i.slice.content.firstChild, k = n.doc.resolve(n.mapping.map(b)).nodeAfter;
621
+ let w = g.marks || [];
622
+ g.type !== k.type && (w = o.create({
617
623
  type: "nodeType",
618
- previousValue: g.type.name,
619
- newValue: k.type.name
624
+ previousValue: k.type.name,
625
+ newValue: g.type.name
620
626
  }).addToSet(w));
621
- const A = /* @__PURE__ */ new Set([
622
- ...Object.keys(k.attrs),
623
- ...Object.keys(g.attrs)
627
+ const j = /* @__PURE__ */ new Set([
628
+ ...Object.keys(g.attrs),
629
+ ...Object.keys(k.attrs)
624
630
  ]);
625
- for (const P of A)
626
- k.attrs[P] !== g.attrs[P] && (w = o.create({
631
+ for (const P of j)
632
+ g.attrs[P] !== k.attrs[P] && (w = o.create({
627
633
  type: "attr",
628
634
  attrName: P,
629
- previousValue: g.attrs[P],
630
- newValue: k.attrs[P]
635
+ previousValue: k.attrs[P],
636
+ newValue: g.attrs[P]
631
637
  }).addToSet(w));
632
638
  const M = n.steps.length;
633
639
  n.setNodeMarkup(
634
640
  n.mapping.map(b),
635
- k.type,
636
- k.attrs,
641
+ g.type,
642
+ g.attrs,
637
643
  w
638
644
  ), r.push({
639
645
  prosemirrorSteps: n.steps.slice(M),
@@ -642,10 +648,10 @@ function D(e) {
642
648
  });
643
649
  continue;
644
650
  }
645
- if (!(s instanceof x))
651
+ if (!(i instanceof _))
646
652
  throw new Error("Step is not a ReplaceStep");
647
- const u = c.map(s.from), p = c.map(s.to);
648
- if (s.slice.openStart > 0 || s.slice.openEnd > 0)
653
+ const u = c.map(i.from), f = c.map(i.to);
654
+ if (i.slice.openStart > 0 || i.slice.openEnd > 0)
649
655
  throw new Error(
650
656
  "Slice has openStart or openEnd > 0, but structure=false"
651
657
  );
@@ -653,32 +659,32 @@ function D(e) {
653
659
  prosemirrorSteps: [],
654
660
  selection: {
655
661
  anchor: n.mapping.map(u),
656
- head: n.mapping.map(p)
662
+ head: n.mapping.map(f)
657
663
  },
658
664
  type: "select"
659
665
  });
660
- const l = s.slice.content.textBetween(0, s.slice.size), m = l === n.doc.textBetween(n.mapping.map(u), n.mapping.map(p));
661
- let f;
662
- if (m)
663
- f = s.slice.content.size;
666
+ const l = i.slice.content.textBetween(0, i.slice.size), p = l === n.doc.textBetween(n.mapping.map(u), n.mapping.map(f));
667
+ let m;
668
+ if (p)
669
+ m = i.slice.content.size;
664
670
  else if (l.length === 0)
665
- f = s.slice.content.size;
671
+ m = i.slice.content.size;
666
672
  else {
667
- const b = Vt(s.slice.content);
673
+ const b = Vt(i.slice.content);
668
674
  if (b === void 0)
669
675
  throw new Error("unexpected: no first character found");
670
- f = b + 1;
676
+ m = b + 1;
671
677
  }
672
- let h = n.mapping.map(p);
673
- const d = n.mapping.map(p);
678
+ let h = n.mapping.map(f);
679
+ const d = n.mapping.map(f);
674
680
  let S = !0;
675
- for (let b = f; b <= s.slice.content.size; b++) {
676
- const k = S && u !== p, g = n.steps.length;
677
- if (k) {
681
+ for (let b = m; b <= i.slice.content.size; b++) {
682
+ const g = S && u !== f, k = n.steps.length;
683
+ if (g) {
678
684
  const M = n.doc.resolve(n.mapping.map(u));
679
- (i = M.nodeAfter) != null && i.isBlock && n.addNodeMark(M.pos, t.mark("deletion", {})), n.addMark(M.pos, h, t.mark("deletion", {})), h = n.mapping.map(p);
685
+ (s = M.nodeAfter) != null && s.isBlock && n.addNodeMark(M.pos, t.mark("deletion", {})), n.addMark(M.pos, h, t.mark("deletion", {})), h = n.mapping.map(f);
680
686
  }
681
- const w = new Y(s.slice.content.cut(0, b), 0, 0);
687
+ const w = new Y(i.slice.content.cut(0, b), 0, 0);
682
688
  n.replace(d, h, w).addMark(
683
689
  d,
684
690
  d + w.content.size,
@@ -687,18 +693,18 @@ function D(e) {
687
693
  d,
688
694
  d + w.content.size,
689
695
  (M, P) => P < d || P > d + w.content.size ? !0 : (M.isBlock && n.addNodeMark(P, t.mark("insertion", {})), !1)
690
- ), h = n.mapping.slice(g).map(h);
691
- const A = kt.near(
696
+ ), h = n.mapping.slice(k).map(h);
697
+ const j = gt.near(
692
698
  n.doc.resolve(d + w.content.size),
693
699
  -1
694
700
  );
695
701
  r.push({
696
- prosemirrorSteps: n.steps.slice(g),
702
+ prosemirrorSteps: n.steps.slice(k),
697
703
  selection: {
698
- anchor: A.from,
699
- head: A.from
704
+ anchor: j.from,
705
+ head: j.from
700
706
  },
701
- type: k ? "replace" : "insert"
707
+ type: g ? "replace" : "insert"
702
708
  // 3. Insert the replacement character by character
703
709
  }), S = !1;
704
710
  }
@@ -729,52 +735,52 @@ function ee(e, t) {
729
735
  return e;
730
736
  }
731
737
  function Zt(e, t, o) {
732
- const r = new N(t);
738
+ const r = new A(t);
733
739
  for (const a of e) {
734
- const s = new x(
740
+ const i = new _(
735
741
  r.mapping.map(a.fromA),
736
742
  r.mapping.map(a.toA),
737
743
  o.slice(a.fromB, a.toB)
738
744
  );
739
- r.step(s);
745
+ r.step(i);
740
746
  }
741
747
  const n = r.mapping.invert();
742
- let i = r.doc.content.findDiffStart(o.content);
743
- for (; i !== null; ) {
744
- const a = o.resolve(i).nodeAfter, s = r.doc.resolve(i).nodeAfter;
745
- if (!a || !s)
748
+ let s = r.doc.content.findDiffStart(o.content);
749
+ for (; s !== null; ) {
750
+ const a = o.resolve(s).nodeAfter, i = r.doc.resolve(s).nodeAfter;
751
+ if (!a || !i)
746
752
  throw new Error("diffNode not found");
747
- const c = !a.isLeaf && a.content.eq(s.content), u = c ? 1 : Math.min(a.nodeSize, s.nodeSize), p = i + u, l = n.map(i), m = n.map(p);
748
- let f = e.length;
753
+ const c = !a.isLeaf && a.content.eq(i.content), u = c ? 1 : Math.min(a.nodeSize, i.nodeSize), f = s + u, l = n.map(s), p = n.map(f);
754
+ let m = e.length;
749
755
  for (let d = 0; d < e.length; d++)
750
- if (e[d].fromA >= m) {
751
- f = d;
756
+ if (e[d].fromA >= p) {
757
+ m = d;
752
758
  break;
753
759
  }
754
- e.splice(f, 0, {
760
+ e.splice(m, 0, {
755
761
  fromA: l,
756
- toA: m,
757
- fromB: i,
758
- toB: p,
762
+ toA: p,
763
+ fromB: s,
764
+ toB: f,
759
765
  deleted: [],
760
766
  inserted: [],
761
767
  type: c ? "node-type-or-attr-update" : "mark-update"
762
768
  }), r.step(
763
- new x(
764
- i,
765
- p,
766
- o.slice(i, p),
769
+ new _(
770
+ s,
771
+ f,
772
+ o.slice(s, f),
767
773
  c
768
774
  )
769
775
  );
770
776
  const h = r.doc.content.findDiffStart(o.content);
771
- if (h === i)
777
+ if (h === s)
772
778
  throw new Error("diffStart not moving");
773
- i = h;
779
+ s = h;
774
780
  }
775
781
  return e;
776
782
  }
777
- const pe = (e, t) => {
783
+ const fe = (e, t) => {
778
784
  const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
779
785
  e.descendants((a) => {
780
786
  a.type.name === "tableCell" && o.add(JSON.stringify(a.toJSON()));
@@ -788,90 +794,90 @@ const pe = (e, t) => {
788
794
  encodeCharacter: (a) => a,
789
795
  encodeNodeStart: (a) => {
790
796
  if (a.type.name === "tableCell") {
791
- const s = JSON.stringify(a.toJSON());
792
- return n.has(s) ? s : a.type.name;
797
+ const i = JSON.stringify(a.toJSON());
798
+ return n.has(i) ? i : a.type.name;
793
799
  }
794
800
  return a.type.name;
795
801
  },
796
802
  encodeNodeEnd: (a) => {
797
803
  if (a.type.name === "tableCell") {
798
- const s = JSON.stringify(a.toJSON());
799
- return n.has(s) ? s : -1;
804
+ const i = JSON.stringify(a.toJSON());
805
+ return n.has(i) ? i : -1;
800
806
  }
801
807
  return -1;
802
808
  },
803
- compareTokens: (a, s) => a === s
809
+ compareTokens: (a, i) => a === i
804
810
  };
805
811
  };
806
812
  function J(e, t, o = !1, r, n) {
807
- const i = rt(e.id, t), a = new N(t);
813
+ const s = rt(e.id, t), a = new A(t);
808
814
  nt(
809
815
  a,
810
- i.posBeforeNode,
816
+ s.posBeforeNode,
811
817
  e.block,
812
818
  r,
813
819
  n
814
820
  );
815
- let s = a.doc, c = ce.create(
821
+ let i = a.doc, c = ce.create(
816
822
  t,
817
823
  void 0,
818
- pe(t, s)
824
+ fe(t, i)
819
825
  );
820
- if (c = c.addSteps(s, a.mapping.maps, 0), o && c.changes.length > 0) {
821
- const l = c.changes[c.changes.length - 1], m = l.toA - l.fromA, f = l.toB - l.fromB;
822
- if (m > f) {
826
+ if (c = c.addSteps(i, a.mapping.maps, 0), o && c.changes.length > 0) {
827
+ const l = c.changes[c.changes.length - 1], p = l.toA - l.fromA, m = l.toB - l.fromB;
828
+ if (p > m) {
823
829
  const h = t.slice(
824
- l.fromA + f,
830
+ l.fromA + m,
825
831
  l.toA
826
832
  );
827
833
  a.step(
828
- new x(l.toB, l.toB, h)
829
- ), s = a.doc, c = ce.create(
834
+ new _(l.toB, l.toB, h)
835
+ ), i = a.doc, c = ce.create(
830
836
  c.startDoc,
831
837
  void 0,
832
- pe(c.startDoc, s)
833
- ), c = c.addSteps(s, a.mapping.maps, 0);
838
+ fe(c.startDoc, i)
839
+ ), c = c.addSteps(i, a.mapping.maps, 0);
834
840
  }
835
841
  }
836
- const u = [], p = wt(
842
+ const u = [], f = wt(
837
843
  c.changes,
838
- s
844
+ i
839
845
  );
840
- for (let l = 0; l < p.length; l++) {
841
- const m = p[l], f = s.slice(m.fromB, m.toB);
842
- if (f.openEnd === 1 && f.openStart === 0 && (m.type = "node-type-or-attr-update", f.size > 2)) {
846
+ for (let l = 0; l < f.length; l++) {
847
+ const p = f[l], m = i.slice(p.fromB, p.toB);
848
+ if (m.openEnd === 1 && m.openStart === 0 && (p.type = "node-type-or-attr-update", m.size > 2)) {
843
849
  const h = {
844
- fromA: m.fromA,
845
- toA: m.fromA + 1,
846
- fromB: m.fromB,
847
- toB: m.fromB + 1,
850
+ fromA: p.fromA,
851
+ toA: p.fromA + 1,
852
+ fromB: p.fromB,
853
+ toB: p.fromB + 1,
848
854
  deleted: [],
849
855
  inserted: [],
850
856
  type: "node-type-or-attr-update"
851
857
  }, d = {
852
- fromA: m.fromA + 1,
853
- toA: m.toA,
854
- fromB: m.fromB + 1,
855
- toB: m.toB,
858
+ fromA: p.fromA + 1,
859
+ toA: p.toA,
860
+ fromB: p.fromB + 1,
861
+ toB: p.toB,
856
862
  deleted: [],
857
863
  inserted: []
858
864
  };
859
- p.splice(l, 1, h, d), l++;
865
+ f.splice(l, 1, h, d), l++;
860
866
  }
861
867
  }
862
- Zt(p, t, s);
863
- for (let l = 0; l < p.length; l++) {
864
- const m = p[l], f = s.slice(m.fromB, m.toB);
865
- if (f.openEnd > 0 && f.size > 1)
868
+ Zt(f, t, i);
869
+ for (let l = 0; l < f.length; l++) {
870
+ const p = f[l], m = i.slice(p.fromB, p.toB);
871
+ if (m.openEnd > 0 && m.size > 1)
866
872
  throw new Error(
867
873
  "unexpected, openEnd > 0 and size > 1, this should have been split into two steps"
868
874
  );
869
- l === p.length - 1 && o && m.type === "mark-update" || u.push(
870
- new x(
871
- m.fromA,
872
- m.toA,
873
- f,
874
- m.type === "node-type-or-attr-update"
875
+ l === f.length - 1 && o && p.type === "mark-update" || u.push(
876
+ new _(
877
+ p.fromA,
878
+ p.toA,
879
+ m,
880
+ p.type === "node-type-or-attr-update"
875
881
  )
876
882
  );
877
883
  }
@@ -940,83 +946,83 @@ function te(e) {
940
946
  ok: !1,
941
947
  error: "referenceId and blocks are required"
942
948
  };
943
- let i = n.referenceId;
949
+ let s = n.referenceId;
944
950
  if (o.idsSuffixed) {
945
- if (!(i != null && i.endsWith("$")))
951
+ if (!(s != null && s.endsWith("$")))
946
952
  return {
947
953
  ok: !1,
948
954
  error: "referenceId must end with $"
949
955
  };
950
- i = i.slice(0, -1);
956
+ s = s.slice(0, -1);
951
957
  }
952
- if (!t.getBlock(i))
958
+ if (!t.getBlock(s))
953
959
  return {
954
960
  ok: !1,
955
961
  error: "referenceId not found"
956
962
  };
957
- const s = Wt(
963
+ const i = Wt(
958
964
  n.blocks,
959
965
  (c) => e.validateBlock(c, t)
960
966
  );
961
- return s.ok ? {
967
+ return i.ok ? {
962
968
  ok: !0,
963
969
  value: {
964
970
  type: n.type,
965
- referenceId: i,
971
+ referenceId: s,
966
972
  position: n.position,
967
- blocks: s.value
973
+ blocks: i.value
968
974
  }
969
- } : s;
975
+ } : i;
970
976
  },
971
977
  // Note: functionality mostly tested in jsontools.test.ts
972
978
  // would be nicer to add a direct unit test
973
979
  execute: async function* (n) {
974
- var s;
975
- let i = [];
980
+ var i;
981
+ let s = [];
976
982
  const a = {};
977
983
  for await (const c of n) {
978
- if (c.isUpdateToPreviousOperation || (i = []), c.operation.type !== "add") {
984
+ if (c.isUpdateToPreviousOperation || (s = []), c.operation.type !== "add") {
979
985
  yield c;
980
986
  continue;
981
987
  }
982
- const u = c.operation, p = await e.toJSONToolCall(t, {
988
+ const u = c.operation, f = await e.toJSONToolCall(t, {
983
989
  ...c,
984
990
  operation: u
985
991
  });
986
- if (p && !(c.isPossiblyPartial && X(
987
- p.blocks[p.blocks.length - 1]
992
+ if (f && !(c.isPossiblyPartial && X(
993
+ f.blocks[f.blocks.length - 1]
988
994
  ))) {
989
- for (let l = 0; l < p.blocks.length; l++) {
990
- const m = p.blocks[l], f = t.prosemirrorState.tr;
995
+ for (let l = 0; l < f.blocks.length; l++) {
996
+ const p = f.blocks[l], m = t.prosemirrorState.tr;
991
997
  let h = [];
992
- if (l < i.length) {
993
- const d = await e.rebaseTool(i[l], t), b = J(
998
+ if (l < s.length) {
999
+ const d = await e.rebaseTool(s[l], t), b = J(
994
1000
  {
995
- id: i[l],
996
- block: m
1001
+ id: s[l],
1002
+ block: p
997
1003
  },
998
1004
  d.doc,
999
1005
  !1
1000
- ).map((k) => k.map(d.invertMap));
1001
- for (const k of b)
1002
- f.step(k.map(f.mapping));
1003
- h = D(f), h = h.filter((k) => k.type !== "select");
1006
+ ).map((g) => g.map(d.invertMap));
1007
+ for (const g of b)
1008
+ m.step(g.map(m.mapping));
1009
+ h = R(m), h = h.filter((g) => g.type !== "select");
1004
1010
  } else {
1005
1011
  const d = u.position === "after" ? a[u.referenceId] : void 0, S = st(
1006
- f,
1007
- [m],
1008
- l > 0 ? i[l - 1] : d || u.referenceId,
1012
+ m,
1013
+ [p],
1014
+ l > 0 ? s[l - 1] : d || u.referenceId,
1009
1015
  l > 0 ? "after" : u.position
1010
1016
  );
1011
- i.push(...S.map((b) => b.id)), h = D(f);
1017
+ s.push(...S.map((b) => b.id)), h = R(m);
1012
1018
  }
1013
1019
  h.find((d) => d.type === "replace");
1014
1020
  for (const d of h)
1015
1021
  o.withDelays && await Q(d), t.transact((S) => {
1016
1022
  ee(S, d);
1017
- }), (s = o.onBlockUpdate) == null || s.call(o, i[l]);
1023
+ }), (i = o.onBlockUpdate) == null || i.call(o, s[l]);
1018
1024
  }
1019
- c.isPossiblyPartial || u.position === "after" && (a[u.referenceId] = i[i.length - 1]);
1025
+ c.isPossiblyPartial || u.position === "after" && (a[u.referenceId] = s[s.length - 1]);
1020
1026
  }
1021
1027
  }
1022
1028
  }
@@ -1052,42 +1058,42 @@ function oe(e) {
1052
1058
  ok: !1,
1053
1059
  error: "id is required"
1054
1060
  };
1055
- let i = n.id;
1061
+ let s = n.id;
1056
1062
  if (o.idsSuffixed) {
1057
- if (!(i != null && i.endsWith("$")))
1063
+ if (!(s != null && s.endsWith("$")))
1058
1064
  return {
1059
1065
  ok: !1,
1060
1066
  error: "id must end with $"
1061
1067
  };
1062
- i = i.slice(0, -1);
1068
+ s = s.slice(0, -1);
1063
1069
  }
1064
1070
  if (!n.block)
1065
1071
  return {
1066
1072
  ok: !1,
1067
1073
  error: "block is required"
1068
1074
  };
1069
- const a = t.getBlock(i);
1075
+ const a = t.getBlock(s);
1070
1076
  if (!a)
1071
- return console.error("BLOCK NOT FOUND", i), {
1077
+ return console.error("BLOCK NOT FOUND", s), {
1072
1078
  ok: !1,
1073
1079
  error: "block not found"
1074
1080
  };
1075
- const s = e.validateBlock(n.block, t, a.type);
1076
- return s.ok ? {
1081
+ const i = e.validateBlock(n.block, t, a.type);
1082
+ return i.ok ? {
1077
1083
  ok: !0,
1078
1084
  value: {
1079
1085
  type: n.type,
1080
- id: i,
1081
- block: s.value
1086
+ id: s,
1087
+ block: i.value
1082
1088
  }
1083
- } : s;
1089
+ } : i;
1084
1090
  },
1085
1091
  // Note: functionality mostly tested in jsontools.test.ts
1086
1092
  // would be nicer to add a direct unit test
1087
1093
  execute: async function* (n) {
1088
1094
  var c;
1089
1095
  let a = 50;
1090
- const s = o.updateSelection ? {
1096
+ const i = o.updateSelection ? {
1091
1097
  from: se(t, o.updateSelection.from),
1092
1098
  to: se(t, o.updateSelection.to)
1093
1099
  } : void 0;
@@ -1096,34 +1102,34 @@ function oe(e) {
1096
1102
  yield u;
1097
1103
  continue;
1098
1104
  }
1099
- const p = u.operation;
1105
+ const f = u.operation;
1100
1106
  if (u.isPossiblyPartial) {
1101
- const g = JSON.stringify(p.block).length;
1102
- if (g < a)
1107
+ const k = JSON.stringify(f.block).length;
1108
+ if (k < a)
1103
1109
  continue;
1104
- a = g + 50;
1110
+ a = k + 50;
1105
1111
  } else
1106
1112
  a = 50;
1107
- const l = await e.rebaseTool(p.id, t), m = s ? l.invertMap.invert().map(s.from()) : void 0, f = s ? l.invertMap.invert().map(s.to()) : void 0, h = await e.toJSONToolCall(t, u);
1113
+ const l = await e.rebaseTool(f.id, t), p = i ? l.invertMap.invert().map(i.from()) : void 0, m = i ? l.invertMap.invert().map(i.to()) : void 0, h = await e.toJSONToolCall(t, u);
1108
1114
  if (!h)
1109
1115
  continue;
1110
1116
  const d = J(
1111
1117
  h,
1112
1118
  l.doc,
1113
1119
  u.isPossiblyPartial,
1114
- m,
1115
- f
1120
+ p,
1121
+ m
1116
1122
  );
1117
1123
  if (d.length === 1 && u.isPossiblyPartial)
1118
1124
  continue;
1119
- const S = d.map((g) => g.map(l.invertMap)), b = new N(t.prosemirrorState.doc);
1120
- for (const g of S)
1121
- b.step(g.map(b.mapping));
1122
- const k = D(b);
1123
- for (const g of k)
1124
- o.withDelays && await Q(g), t.transact((w) => {
1125
- ee(w, g);
1126
- }), (c = o.onBlockUpdate) == null || c.call(o, p.id);
1125
+ const S = d.map((k) => k.map(l.invertMap)), b = new A(t.prosemirrorState.doc);
1126
+ for (const k of S)
1127
+ b.step(k.map(b.mapping));
1128
+ const g = R(b);
1129
+ for (const k of g)
1130
+ o.withDelays && await Q(k), t.transact((w) => {
1131
+ ee(w, k);
1132
+ }), (c = o.onBlockUpdate) == null || c.call(o, f.id);
1127
1133
  }
1128
1134
  }
1129
1135
  };
@@ -1182,17 +1188,17 @@ const re = (e, t) => ({
1182
1188
  yield n;
1183
1189
  continue;
1184
1190
  }
1185
- const i = n.operation, a = e.prosemirrorState.tr;
1186
- it(a, [i.id], []);
1187
- const s = D(a);
1188
- for (const c of s)
1191
+ const s = n.operation, a = e.prosemirrorState.tr;
1192
+ it(a, [s.id], []);
1193
+ const i = R(a);
1194
+ for (const c of i)
1189
1195
  t.withDelays && await Q(c), e.transact((u) => {
1190
1196
  ee(u, c);
1191
- }), (r = t.onBlockUpdate) == null || r.call(t, i.id);
1197
+ }), (r = t.onBlockUpdate) == null || r.call(t, s.id);
1192
1198
  }
1193
1199
  }
1194
1200
  });
1195
- function me(e) {
1201
+ function pe(e) {
1196
1202
  const t = e.lastIndexOf("<"), o = e.lastIndexOf(">");
1197
1203
  let r = e;
1198
1204
  if (t > o && (r = e.substring(0, t), !r.trim()))
@@ -1202,13 +1208,13 @@ function me(e) {
1202
1208
  0,
1203
1209
  r.length - n[0].length
1204
1210
  ));
1205
- const s = new DOMParser().parseFromString(
1211
+ const i = new DOMParser().parseFromString(
1206
1212
  `<div>${r}</div>`,
1207
1213
  "text/html"
1208
1214
  ).body.firstChild;
1209
- return s ? s.innerHTML : "";
1215
+ return i ? i.innerHTML : "";
1210
1216
  }
1211
- function R(e) {
1217
+ function H(e) {
1212
1218
  let t;
1213
1219
  if (Be(e.prosemirrorState, (o) => {
1214
1220
  t = o;
@@ -1216,7 +1222,7 @@ function R(e) {
1216
1222
  throw new Error("applySuggestionsTr is not set");
1217
1223
  return t;
1218
1224
  }
1219
- function H(e, t) {
1225
+ function q(e, t) {
1220
1226
  const o = t.mapping.invert();
1221
1227
  return {
1222
1228
  doc: t.doc,
@@ -1224,7 +1230,7 @@ function H(e, t) {
1224
1230
  * Return a new transform that has the projection applied.
1225
1231
  * You can add new operations to this transform and later rebase those on the original document with `rebaseTr`
1226
1232
  */
1227
- tr: () => new N(t.doc),
1233
+ tr: () => new A(t.doc),
1228
1234
  /**
1229
1235
  * Invert map created by the projection.
1230
1236
  * You can use this to map positions on the "clean" document (the projection) to positions on the original document
@@ -1238,8 +1244,8 @@ function H(e, t) {
1238
1244
  if (r.steps.length === 0)
1239
1245
  throw new Error("No steps to apply");
1240
1246
  let n = e.prosemirrorState.tr;
1241
- for (const i of r.steps) {
1242
- const a = i.map(o);
1247
+ for (const s of r.steps) {
1248
+ const a = s.map(o);
1243
1249
  if (!a)
1244
1250
  throw new Error("Step is not mapped");
1245
1251
  n = n.step(a);
@@ -1250,7 +1256,7 @@ function H(e, t) {
1250
1256
  }
1251
1257
  async function he(e, t) {
1252
1258
  var u;
1253
- const o = R(t), r = Oe(o.doc, e);
1259
+ const o = H(t), r = Oe(o.doc, e);
1254
1260
  if (!r)
1255
1261
  throw new Error("block not found");
1256
1262
  const n = await t.blocksToHTMLLossy([
@@ -1258,19 +1264,19 @@ async function he(e, t) {
1258
1264
  ...r,
1259
1265
  children: []
1260
1266
  }
1261
- ]), i = (u = window.__TEST_OPTIONS) == null ? void 0 : u.mockID, a = await t.tryParseHTMLToBlocks(n);
1262
- if (window.__TEST_OPTIONS && (window.__TEST_OPTIONS.mockID = i), a.length !== 1)
1267
+ ]), s = (u = window.__TEST_OPTIONS) == null ? void 0 : u.mockID, a = await t.tryParseHTMLToBlocks(n);
1268
+ if (window.__TEST_OPTIONS && (window.__TEST_OPTIONS.mockID = s), a.length !== 1)
1263
1269
  throw new Error("html diff invalid block count");
1264
- const s = a[0];
1265
- if (s.id = e, J(
1270
+ const i = a[0];
1271
+ if (i.id = e, J(
1266
1272
  {
1267
1273
  id: e,
1268
- block: s
1274
+ block: i
1269
1275
  },
1270
1276
  o.doc
1271
1277
  ).length)
1272
1278
  throw new Error("html diff");
1273
- return H(t, o);
1279
+ return q(t, o);
1274
1280
  }
1275
1281
  function ye(e) {
1276
1282
  return typeof e != "string" ? {
@@ -1300,10 +1306,10 @@ const V = {
1300
1306
  toJSONToolCall: async (e, t) => {
1301
1307
  var n;
1302
1308
  const o = (n = window.__TEST_OPTIONS) == null ? void 0 : n.mockID, r = (await Promise.all(
1303
- t.operation.blocks.map(async (i) => {
1304
- const a = t.isPossiblyPartial ? me(i) : i;
1309
+ t.operation.blocks.map(async (s) => {
1310
+ const a = t.isPossiblyPartial ? pe(s) : s;
1305
1311
  return a ? (await e.tryParseHTMLToBlocks(a)).map(
1306
- (s) => (delete s.id, s)
1312
+ (i) => (delete i.id, i)
1307
1313
  ) : [];
1308
1314
  })
1309
1315
  )).flat();
@@ -1330,7 +1336,7 @@ const V = {
1330
1336
  validateBlock: ye,
1331
1337
  rebaseTool: he,
1332
1338
  toJSONToolCall: async (e, t) => {
1333
- const o = t.isPossiblyPartial ? me(t.operation.block) : t.operation.block;
1339
+ const o = t.isPossiblyPartial ? pe(t.operation.block) : t.operation.block;
1334
1340
  if (!o)
1335
1341
  return;
1336
1342
  const r = (await e.tryParseHTMLToBlocks(o))[0];
@@ -1343,14 +1349,14 @@ const V = {
1343
1349
  delete: re
1344
1350
  };
1345
1351
  function Yt(e, t, o, r, n) {
1346
- const i = {
1352
+ const s = {
1347
1353
  add: !0,
1348
1354
  update: !0,
1349
1355
  delete: !0,
1350
1356
  ...o
1351
1357
  };
1352
1358
  return [
1353
- ...i.update ? [
1359
+ ...s.update ? [
1354
1360
  V.update(e, {
1355
1361
  idsSuffixed: !0,
1356
1362
  withDelays: t,
@@ -1358,11 +1364,11 @@ function Yt(e, t, o, r, n) {
1358
1364
  onBlockUpdate: n
1359
1365
  })
1360
1366
  ] : [],
1361
- ...i.add ? [V.add(e, { idsSuffixed: !0, withDelays: t, onBlockUpdate: n })] : [],
1362
- ...i.delete ? [V.delete(e, { idsSuffixed: !0, withDelays: t, onBlockUpdate: n })] : []
1367
+ ...s.add ? [V.add(e, { idsSuffixed: !0, withDelays: t, onBlockUpdate: n })] : [],
1368
+ ...s.delete ? [V.delete(e, { idsSuffixed: !0, withDelays: t, onBlockUpdate: n })] : []
1363
1369
  ];
1364
1370
  }
1365
- const ze = {
1371
+ const Ue = {
1366
1372
  /**
1367
1373
  * Function to get the stream tools that can apply HTML block updates to the editor
1368
1374
  */
@@ -1385,24 +1391,28 @@ async function Gt(e, t) {
1385
1391
  userPrompt: o,
1386
1392
  useSelection: r,
1387
1393
  deleteEmptyCursorBlock: n,
1388
- stream: i,
1394
+ stream: s,
1389
1395
  onStart: a,
1390
- withDelays: s,
1396
+ withDelays: i,
1391
1397
  dataFormat: c,
1392
1398
  previousResponse: u,
1393
- ...p
1399
+ ...f
1394
1400
  } = {
1395
1401
  maxRetries: 2,
1396
1402
  deleteEmptyCursorBlock: !0,
1397
1403
  stream: !0,
1398
1404
  withDelays: !0,
1399
- dataFormat: ze,
1405
+ dataFormat: Ue,
1400
1406
  ...t
1401
- }, l = t.promptBuilder ?? c.defaultPromptBuilder, m = c.getStreamTools, f = r ? void 0 : e.getTextCursorPosition().block, h = f && n && X(f) ? f.id : void 0, d = r ? e.getSelectionCutBlocks() : void 0;
1407
+ }, l = t.promptBuilder ?? c.defaultPromptBuilder, p = c.getStreamTools, m = r ? void 0 : e.getTextCursorPosition().block, h = m && n && X(m) && x(e.document).length > 0 ? m.id : void 0, d = r ? e.getSelectionCutBlocks() : void 0;
1402
1408
  let S;
1403
- u && (S = u.messages, S.push({
1404
- role: "assistant",
1405
- content: `These are the operations returned by a previous LLM call:
1409
+ u && (S = u.messages.map((w) => w.role === "user" && typeof w.content == "string" ? {
1410
+ role: "system",
1411
+ content: `USER_MESSAGE: ${w.content}`
1412
+ } : w), S.push({
1413
+ role: "system",
1414
+ // using "assistant" here doesn't work with gemini because we can't mix system / assistant messages
1415
+ content: `ASSISTANT_MESSAGE: These are the operations returned by a previous LLM call:
1406
1416
  ` + JSON.stringify(
1407
1417
  await u.llmResult.getGeneratedOperations()
1408
1418
  )
@@ -1412,40 +1422,42 @@ async function Gt(e, t) {
1412
1422
  userPrompt: o,
1413
1423
  excludeBlockIds: h ? [h] : void 0,
1414
1424
  previousMessages: S
1415
- }), k = m(
1425
+ }), g = p(
1416
1426
  e,
1417
- s,
1427
+ i,
1418
1428
  t.defaultStreamTools,
1419
1429
  d ? { from: d._meta.startPos, to: d._meta.endPos } : void 0,
1420
1430
  t.onBlockUpdate
1421
1431
  );
1422
- let g;
1423
- return i ? g = await $t(
1424
- k,
1432
+ let k;
1433
+ return s ? k = await $t(
1434
+ g,
1425
1435
  {
1426
1436
  messages: b,
1427
- ...p
1437
+ ...f
1428
1438
  },
1429
1439
  () => {
1430
1440
  h && e.removeBlocks([h]), a == null || a();
1431
1441
  }
1432
- ) : (g = await At(k, {
1442
+ ) : (k = await At(g, {
1433
1443
  messages: b,
1434
- ...p
1435
- }), h && e.removeBlocks([h]), a == null || a()), new qt(b, g, k);
1436
- }
1437
- async function Ue(e, t) {
1438
- const o = F(e.document), r = await C(
1439
- T(o),
1440
- async (s) => ({
1441
- ...s,
1444
+ ...f
1445
+ }), h && e.removeBlocks([h]), a == null || a()), new qt(b, k, g);
1446
+ }
1447
+ async function ze(e, t) {
1448
+ const o = e.getTextCursorPosition().block.id, r = x(e.document, {
1449
+ cursorBlockId: o
1450
+ }), n = await C(
1451
+ T(r),
1452
+ async (c) => ({
1453
+ ...c,
1442
1454
  children: void 0
1443
1455
  })
1444
- ), i = U(e, r).filter(
1445
- (s) => "cursor" in s || !(t.excludeBlockIds || []).includes(s.id)
1456
+ ), a = F(e, n).filter(
1457
+ (c) => "cursor" in c || !(t.excludeBlockIds || []).includes(c.id)
1446
1458
  );
1447
1459
  return {
1448
- jsonBlocks: L(i)
1460
+ jsonBlocks: L(a)
1449
1461
  };
1450
1462
  }
1451
1463
  async function Fe(e, t) {
@@ -1506,50 +1518,84 @@ function Xt(e) {
1506
1518
  role: "system",
1507
1519
  content: JSON.stringify(e.jsonBlocks)
1508
1520
  },
1521
+ ...e.isEmptyDocument ? [
1522
+ {
1523
+ role: "system",
1524
+ content: "Because the actual document is empty, this is an example document to understand the schema:"
1525
+ },
1526
+ {
1527
+ role: "system",
1528
+ content: JSON.stringify({
1529
+ id: "ref3",
1530
+ type: "paragraph",
1531
+ content: [
1532
+ {
1533
+ type: "text",
1534
+ text: "Hello, world! ",
1535
+ styles: {}
1536
+ },
1537
+ {
1538
+ type: "text",
1539
+ text: "Bold text. ",
1540
+ styles: {
1541
+ bold: !0
1542
+ }
1543
+ },
1544
+ {
1545
+ type: "link",
1546
+ href: "https://www.w3.org",
1547
+ content: "Link."
1548
+ }
1549
+ ]
1550
+ })
1551
+ }
1552
+ ] : [],
1509
1553
  {
1510
1554
  role: "system",
1511
1555
  content: "The user asks you to do the following:"
1512
1556
  },
1513
1557
  {
1514
- role: "user",
1515
- content: e.userPrompt
1558
+ role: "system",
1559
+ content: 'First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\n EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\n \n ' + (e.isEmptyDocument ? "Because the document is empty, first update the empty block before adding new blocks." : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question).")
1516
1560
  },
1517
1561
  {
1518
- role: "system",
1519
- content: 'First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\n EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\n \n Prefer updating blocks over adding or removing (but this also depends on the user\'s question).'
1562
+ role: "user",
1563
+ content: e.userPrompt
1520
1564
  }
1521
1565
  ];
1522
1566
  }
1523
1567
  const Qt = async (e, t) => {
1568
+ const o = x(e.document).length === 0;
1524
1569
  if (t.selectedBlocks) {
1525
- const o = await Fe(e, {
1570
+ const r = await Fe(e, {
1526
1571
  selectedBlocks: t.selectedBlocks
1527
1572
  });
1528
1573
  return Kt({
1529
- ...o,
1574
+ ...r,
1530
1575
  userPrompt: t.userPrompt
1531
1576
  });
1532
1577
  } else {
1533
- const o = await Ue(e, t);
1578
+ const r = await ze(e, t);
1534
1579
  return Xt({
1535
- ...o,
1536
- userPrompt: t.userPrompt
1580
+ ...r,
1581
+ userPrompt: t.userPrompt,
1582
+ isEmptyDocument: o
1537
1583
  });
1538
1584
  }
1539
1585
  };
1540
1586
  function eo(e) {
1541
1587
  const t = {}, o = {};
1542
1588
  return e.forEach((n) => {
1543
- const { type: i, ...a } = n.properties, s = JSON.stringify(a);
1544
- t[s] ? t[s].push(i.enum[0]) : (t[s] = [i.enum[0]], o[s] = n);
1589
+ const { type: s, ...a } = n.properties, i = JSON.stringify(a);
1590
+ t[i] ? t[i].push(s.enum[0]) : (t[i] = [s.enum[0]], o[i] = n);
1545
1591
  }), Object.keys(
1546
1592
  t
1547
1593
  ).map((n) => {
1548
- const i = o[n];
1594
+ const s = o[n];
1549
1595
  return {
1550
- ...i,
1596
+ ...s,
1551
1597
  properties: {
1552
- ...i.properties,
1598
+ ...s.properties,
1553
1599
  type: {
1554
1600
  type: "string",
1555
1601
  enum: t[n]
@@ -1715,7 +1761,7 @@ function so(e) {
1715
1761
  }
1716
1762
  };
1717
1763
  }
1718
- function ke(e) {
1764
+ function ge(e) {
1719
1765
  return e = so(e).removeFileBlocks().removeDefaultProps().get(), {
1720
1766
  $defs: {
1721
1767
  styles: to(e.styleSchema),
@@ -1730,7 +1776,7 @@ function ke(e) {
1730
1776
  function Ve(e, t) {
1731
1777
  return !t.schema.inlineContentSchema[e.type] || at(e) && !("text" in e) ? !1 : ct(e) ? !("content" in e) || !("href" in e) ? !1 : Ve(e.content, t) : !0;
1732
1778
  }
1733
- function ge(e, t, o) {
1779
+ function ke(e, t, o) {
1734
1780
  const r = e.type || o, n = t.schema.blockSchema[r];
1735
1781
  if (!n)
1736
1782
  return {
@@ -1759,7 +1805,7 @@ function ge(e, t, o) {
1759
1805
  ok: !0,
1760
1806
  value: e
1761
1807
  };
1762
- if (!e.content.every((i) => Ve(i, t)))
1808
+ if (!e.content.every((s) => Ve(s, t)))
1763
1809
  return {
1764
1810
  ok: !1,
1765
1811
  error: "block content must be an array of inline content"
@@ -1777,10 +1823,10 @@ const Z = {
1777
1823
  block: {
1778
1824
  $ref: "#/$defs/block"
1779
1825
  },
1780
- ...ke(e.schema)
1826
+ ...ge(e.schema)
1781
1827
  }),
1782
- validateBlock: ge,
1783
- rebaseTool: async (e, t) => H(t, R(t)),
1828
+ validateBlock: ke,
1829
+ rebaseTool: async (e, t) => q(t, H(t)),
1784
1830
  toJSONToolCall: async (e, t) => t.operation
1785
1831
  }),
1786
1832
  update: oe({
@@ -1789,10 +1835,10 @@ const Z = {
1789
1835
  block: {
1790
1836
  $ref: "#/$defs/block"
1791
1837
  },
1792
- ...ke(e.schema)
1838
+ ...ge(e.schema)
1793
1839
  }),
1794
- validateBlock: ge,
1795
- rebaseTool: async (e, t) => H(t, R(t)),
1840
+ validateBlock: ke,
1841
+ rebaseTool: async (e, t) => q(t, H(t)),
1796
1842
  toJSONToolCall: async (e, t) => {
1797
1843
  const o = Object.fromEntries(
1798
1844
  Object.entries(Me).map(([r, n]) => [r, n.default])
@@ -1844,19 +1890,21 @@ const ao = {
1844
1890
  * Helper functions which can be used when implementing a custom PromptBuilder
1845
1891
  */
1846
1892
  promptHelpers: {
1847
- getDataForPromptNoSelection: Ue,
1893
+ getDataForPromptNoSelection: ze,
1848
1894
  getDataForPromptWithSelection: Fe
1849
1895
  }
1850
1896
  };
1851
1897
  async function Ze(e, t) {
1852
- const o = F(e.document), r = await C(
1853
- T(o),
1854
- async (s) => e.blocksToMarkdownLossy([s])
1855
- ), i = U(e, r).filter(
1856
- (s) => "cursor" in s || !(t.excludeBlockIds || []).includes(s.id)
1898
+ const o = e.getTextCursorPosition().block.id, r = x(e.document, {
1899
+ cursorBlockId: o
1900
+ }), n = await C(
1901
+ T(r),
1902
+ async (c) => e.blocksToMarkdownLossy([c])
1903
+ ), a = F(e, n).filter(
1904
+ (c) => "cursor" in c || !(t.excludeBlockIds || []).includes(c.id)
1857
1905
  );
1858
1906
  return {
1859
- markdownBlocks: L(i)
1907
+ markdownBlocks: L(a)
1860
1908
  };
1861
1909
  }
1862
1910
  async function We(e, t) {
@@ -1944,20 +1992,20 @@ const uo = async (e, t) => {
1944
1992
  }
1945
1993
  };
1946
1994
  async function be(e, t) {
1947
- const o = R(t), r = await t.blocksToMarkdownLossy([Oe(o.doc, e)]), n = await t.tryParseMarkdownToBlocks(r), i = J(
1995
+ const o = H(t), r = await t.blocksToMarkdownLossy([Oe(o.doc, e)]), n = await t.tryParseMarkdownToBlocks(r), s = J(
1948
1996
  {
1949
1997
  id: e,
1950
1998
  block: n[0]
1951
1999
  },
1952
2000
  o.doc
1953
2001
  ), a = new Ie();
1954
- for (const s of i) {
1955
- const c = s.map(a);
2002
+ for (const i of s) {
2003
+ const c = i.map(a);
1956
2004
  if (!c)
1957
2005
  throw new Error("Failed to map step");
1958
2006
  o.step(c), a.appendMap(c.getMap());
1959
2007
  }
1960
- return H(t, o);
2008
+ return q(t, o);
1961
2009
  }
1962
2010
  function Se(e) {
1963
2011
  return typeof e != "string" ? {
@@ -2016,7 +2064,7 @@ const W = {
2016
2064
  }),
2017
2065
  delete: re
2018
2066
  };
2019
- function fo(e, t, o, r) {
2067
+ function mo(e, t, o, r) {
2020
2068
  const n = {
2021
2069
  add: !0,
2022
2070
  update: !0,
@@ -2035,11 +2083,11 @@ function fo(e, t, o, r) {
2035
2083
  ...n.delete ? [W.delete(e, { idsSuffixed: !0, withDelays: t })] : []
2036
2084
  ];
2037
2085
  }
2038
- const po = {
2086
+ const fo = {
2039
2087
  /**
2040
2088
  * Function to get the stream tools that can apply BlockNote Markdown block updates to the editor
2041
2089
  */
2042
- getStreamTools: fo,
2090
+ getStreamTools: mo,
2043
2091
  /**
2044
2092
  * The default PromptBuilder that determines how a userPrompt is converted to an array of
2045
2093
  * LLM Messages (CoreMessage[])
@@ -2053,18 +2101,18 @@ const po = {
2053
2101
  getDataForPromptWithSelection: We
2054
2102
  }
2055
2103
  }, ir = {
2056
- addCursorPosition: U,
2104
+ addCursorPosition: F,
2057
2105
  flattenBlocks: T,
2058
2106
  suffixIDs: L,
2059
- trimEmptyBlocks: F,
2107
+ trimEmptyBlocks: x,
2060
2108
  convertBlocks: C
2061
- }, mo = {
2109
+ }, po = {
2062
2110
  _experimental_json: ao,
2063
- _experimental_markdown: po,
2064
- html: ze
2111
+ _experimental_markdown: fo,
2112
+ html: Ue
2065
2113
  }, we = new _e("blocknote-agent-cursor");
2066
2114
  function ho(e) {
2067
- return new xe({
2115
+ return new Le({
2068
2116
  key: we,
2069
2117
  view: (t) => ({}),
2070
2118
  state: {
@@ -2091,9 +2139,9 @@ function ho(e) {
2091
2139
  side: 10
2092
2140
  })
2093
2141
  );
2094
- const i = Math.min(r.anchor, r.head), a = Math.max(r.anchor, r.head);
2142
+ const s = Math.min(r.anchor, r.head), a = Math.max(r.anchor, r.head);
2095
2143
  return n.push(
2096
- ue.inline(i, a, Tt(e), {
2144
+ ue.inline(s, a, Tt(e), {
2097
2145
  inclusiveEnd: !0,
2098
2146
  inclusiveStart: !1
2099
2147
  })
@@ -2109,37 +2157,37 @@ const yo = (e) => {
2109
2157
  o.setAttribute("contentedEditable", "false"), o.classList.add("bn-collaboration-cursor__caret"), o.setAttribute("style", `background-color: ${e.color}`);
2110
2158
  const r = document.createElement("span");
2111
2159
  return r.classList.add("bn-collaboration-cursor__label"), r.setAttribute("style", `background-color: ${e.color}`), r.insertBefore(document.createTextNode(e.name), null), o.insertBefore(r, null), t.insertBefore(document.createTextNode("⁠"), null), t.insertBefore(o, null), t.insertBefore(document.createTextNode("⁠"), null), t;
2112
- }, ko = new _e("blocknote-ai-plugin");
2160
+ }, go = new _e("blocknote-ai-plugin");
2113
2161
  class Ye extends lt {
2114
2162
  /**
2115
2163
  * @internal use `createAIExtension` instead
2116
2164
  */
2117
2165
  constructor(o, r) {
2118
2166
  super();
2119
- j(this, "previousRequestOptions");
2167
+ $(this, "previousRequestOptions");
2120
2168
  // internal store including setters
2121
- j(this, "_store", fe()((o) => ({
2169
+ $(this, "_store", me()((o) => ({
2122
2170
  aiMenuState: "closed"
2123
2171
  })));
2124
2172
  /**
2125
2173
  * Returns a zustand store with the global configuration of the AI Extension.
2126
2174
  * These options are used by default across all LLM calls when calling {@link doLLMRequest}
2127
2175
  */
2128
- j(this, "options");
2129
- this.editor = o, this.options = fe()((n) => ({
2130
- dataFormat: mo.html,
2176
+ $(this, "options");
2177
+ this.editor = o, this.options = me()((n) => ({
2178
+ dataFormat: po.html,
2131
2179
  stream: !0,
2132
2180
  ...r
2133
2181
  })), this.addProsemirrorPlugin(
2134
- new xe({
2135
- key: ko,
2182
+ new Le({
2183
+ key: go,
2136
2184
  filterTransaction: (n) => {
2137
2185
  var a;
2138
- const i = this.store.getState().aiMenuState;
2139
- return !(i !== "closed" && i.status === "ai-writing" && (a = n.getMeta(gt)) != null && a.fixTables);
2186
+ const s = this.store.getState().aiMenuState;
2187
+ return !(s !== "closed" && s.status === "ai-writing" && (a = n.getMeta(kt)) != null && a.fixTables);
2140
2188
  }
2141
2189
  })
2142
- ), this.addProsemirrorPlugin(ft()), this.addProsemirrorPlugin(
2190
+ ), this.addProsemirrorPlugin(mt()), this.addProsemirrorPlugin(
2143
2191
  ho(
2144
2192
  r.agentCursor || { name: "AI", color: "#8bc6ff" }
2145
2193
  )
@@ -2180,18 +2228,18 @@ class Ye extends lt {
2180
2228
  acceptChanges() {
2181
2229
  var r;
2182
2230
  const o = this.editor.prosemirrorState.doc;
2183
- this.editor.exec((n, i) => ie(n, (a) => {
2184
- i == null || i(a.setMeta("addToHistory", !1));
2185
- })), this.editor.exec((n, i) => {
2231
+ this.editor.exec((n, s) => ie(n, (a) => {
2232
+ s == null || s(a.setMeta("addToHistory", !1));
2233
+ })), this.editor.exec((n, s) => {
2186
2234
  const a = n.tr;
2187
2235
  a.replace(
2188
2236
  0,
2189
2237
  a.doc.content.size,
2190
2238
  new Y(ae.from(o), 0, 0)
2191
2239
  );
2192
- const s = n.apply(a);
2193
- return Be(s, (c) => {
2194
- i == null || i(
2240
+ const i = n.apply(a);
2241
+ return Be(i, (c) => {
2242
+ s == null || s(
2195
2243
  a.replace(
2196
2244
  0,
2197
2245
  a.doc.content.size,
@@ -2206,8 +2254,8 @@ class Ye extends lt {
2206
2254
  */
2207
2255
  rejectChanges() {
2208
2256
  var o;
2209
- this.editor.exec((r, n) => ie(r, (i) => {
2210
- n == null || n(i.setMeta("addToHistory", !1));
2257
+ this.editor.exec((r, n) => ie(r, (s) => {
2258
+ n == null || n(s.setMeta("addToHistory", !1));
2211
2259
  })), (o = this.editor.forkYDocPlugin) == null || o.merge({ keepChanges: !1 }), this.closeAIMenu();
2212
2260
  }
2213
2261
  /**
@@ -2265,34 +2313,34 @@ class Ye extends lt {
2265
2313
  this.setAIResponseStatus("thinking"), (n = this.editor.forkYDocPlugin) == null || n.fork();
2266
2314
  let r;
2267
2315
  try {
2268
- const i = {
2316
+ const s = {
2269
2317
  ...this.options.getState(),
2270
2318
  ...o,
2271
2319
  previousResponse: this.store.getState().llmResponse
2272
2320
  };
2273
- this.previousRequestOptions = i, r = await Gt(this.editor, {
2274
- ...i,
2321
+ this.previousRequestOptions = s, r = await Gt(this.editor, {
2322
+ ...s,
2275
2323
  onStart: () => {
2276
2324
  var a;
2277
2325
  this.setAIResponseStatus("ai-writing"), (a = o.onStart) == null || a.call(o);
2278
2326
  },
2279
2327
  onBlockUpdate: (a) => {
2280
- var s;
2328
+ var i;
2281
2329
  this._store.setState({
2282
2330
  aiMenuState: {
2283
2331
  blockId: a,
2284
2332
  status: "ai-writing"
2285
2333
  }
2286
- }), (s = o.onBlockUpdate) == null || s.call(o, a);
2334
+ }), (i = o.onBlockUpdate) == null || i.call(o, a);
2287
2335
  }
2288
2336
  }), this._store.setState({
2289
2337
  llmResponse: r
2290
2338
  }), await r.execute(), this.setAIResponseStatus("user-reviewing");
2291
- } catch (i) {
2339
+ } catch (s) {
2292
2340
  this.setAIResponseStatus({
2293
2341
  status: "error",
2294
- error: i
2295
- }), console.warn("Error calling LLM", i);
2342
+ error: s
2343
+ }), console.warn("Error calling LLM", s);
2296
2344
  }
2297
2345
  return r;
2298
2346
  }
@@ -2303,8 +2351,8 @@ function ar(e) {
2303
2351
  function O(e) {
2304
2352
  return e.extension(Ye);
2305
2353
  }
2306
- const go = (e, t) => async (o, r) => {
2307
- const n = new Request(o, r), i = new Request(
2354
+ const ko = (e, t) => async (o, r) => {
2355
+ const n = new Request(o, r), s = new Request(
2308
2356
  `${e}?provider=${encodeURIComponent(
2309
2357
  t
2310
2358
  )}&url=${encodeURIComponent(n.url)}`,
@@ -2318,7 +2366,7 @@ const go = (e, t) => async (o, r) => {
2318
2366
  }
2319
2367
  );
2320
2368
  try {
2321
- return await fetch(i);
2369
+ return await fetch(s);
2322
2370
  } catch (a) {
2323
2371
  throw new TypeError("fetch failed", {
2324
2372
  cause: a
@@ -2342,7 +2390,7 @@ function cr(e) {
2342
2390
  */
2343
2391
  getProviderSettings: (t) => ({
2344
2392
  apiKey: e.apiKey,
2345
- fetch: go(e.baseURL, t)
2393
+ fetch: ko(e.baseURL, t)
2346
2394
  })
2347
2395
  };
2348
2396
  }
@@ -2357,9 +2405,9 @@ function So(e, t) {
2357
2405
  if (e == null) return {};
2358
2406
  var o = wo(e, t), r, n;
2359
2407
  if (Object.getOwnPropertySymbols) {
2360
- var i = Object.getOwnPropertySymbols(e);
2361
- for (n = 0; n < i.length; n++)
2362
- r = i[n], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
2408
+ var s = Object.getOwnPropertySymbols(e);
2409
+ for (n = 0; n < s.length; n++)
2410
+ r = s[n], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
2363
2411
  }
2364
2412
  return o;
2365
2413
  }
@@ -2373,15 +2421,15 @@ function wo(e, t) {
2373
2421
  }
2374
2422
  return o;
2375
2423
  }
2376
- function q() {
2377
- return q = Object.assign ? Object.assign.bind() : function(e) {
2424
+ function U() {
2425
+ return U = Object.assign ? Object.assign.bind() : function(e) {
2378
2426
  for (var t = 1; t < arguments.length; t++) {
2379
2427
  var o = arguments[t];
2380
2428
  for (var r in o)
2381
2429
  Object.prototype.hasOwnProperty.call(o, r) && (e[r] = o[r]);
2382
2430
  }
2383
2431
  return e;
2384
- }, q.apply(this, arguments);
2432
+ }, U.apply(this, arguments);
2385
2433
  }
2386
2434
  function ve(e, t) {
2387
2435
  var o = Object.keys(e);
@@ -2427,7 +2475,7 @@ function Ke(e) {
2427
2475
  }, t.attr), Ke(t.child)));
2428
2476
  }
2429
2477
  function v(e) {
2430
- return (t) => /* @__PURE__ */ B.createElement(Po, q({
2478
+ return (t) => /* @__PURE__ */ B.createElement(Po, U({
2431
2479
  attr: z({}, e.attr)
2432
2480
  }, t), Ke(e.child));
2433
2481
  }
@@ -2436,9 +2484,9 @@ function Po(e) {
2436
2484
  var {
2437
2485
  attr: r,
2438
2486
  size: n,
2439
- title: i
2440
- } = e, a = So(e, bo), s = n || o.size || "1em", c;
2441
- return o.className && (c = o.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ B.createElement("svg", q({
2487
+ title: s
2488
+ } = e, a = So(e, bo), i = n || o.size || "1em", c;
2489
+ return o.className && (c = o.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ B.createElement("svg", U({
2442
2490
  stroke: "currentColor",
2443
2491
  fill: "currentColor",
2444
2492
  strokeWidth: "0"
@@ -2447,10 +2495,10 @@ function Po(e) {
2447
2495
  style: z(z({
2448
2496
  color: e.color || o.color
2449
2497
  }, o.style), e.style),
2450
- height: s,
2451
- width: s,
2498
+ height: i,
2499
+ width: i,
2452
2500
  xmlns: "http://www.w3.org/2000/svg"
2453
- }), i && /* @__PURE__ */ B.createElement("title", null, i), e.children);
2501
+ }), s && /* @__PURE__ */ B.createElement("title", null, s), e.children);
2454
2502
  };
2455
2503
  return Te !== void 0 ? /* @__PURE__ */ B.createElement(Te.Consumer, null, (o) => t(o)) : t(Ge);
2456
2504
  }
@@ -2469,10 +2517,10 @@ function Mo(e) {
2469
2517
  function Bo(e) {
2470
2518
  return v({ attr: { viewBox: "0 0 24 24", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M15 18H16.5C17.8807 18 19 16.8807 19 15.5C19 14.1193 17.8807 13 16.5 13H3V11H16.5C18.9853 11 21 13.0147 21 15.5C21 17.9853 18.9853 20 16.5 20H15V22L11 19L15 16V18ZM3 4H21V6H3V4ZM9 18V20H3V18H9Z" }, child: [] }] })(e);
2471
2519
  }
2472
- function Lo(e) {
2520
+ function xo(e) {
2473
2521
  return v({ attr: { viewBox: "0 0 24 24", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M13 6V21H11V6H5V4H19V6H13Z" }, child: [] }] })(e);
2474
2522
  }
2475
- function xo(e) {
2523
+ function Lo(e) {
2476
2524
  return v({ attr: { viewBox: "0 0 24 24", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M6.23509 6.45329C4.85101 7.89148 4 9.84636 4 12C4 16.4183 7.58172 20 12 20C13.0808 20 14.1116 19.7857 15.0521 19.3972C15.1671 18.6467 14.9148 17.9266 14.8116 17.6746C14.582 17.115 13.8241 16.1582 12.5589 14.8308C12.2212 14.4758 12.2429 14.2035 12.3636 13.3943L12.3775 13.3029C12.4595 12.7486 12.5971 12.4209 14.4622 12.1248C15.4097 11.9746 15.6589 12.3533 16.0043 12.8777C16.0425 12.9358 16.0807 12.9928 16.1198 13.0499C16.4479 13.5297 16.691 13.6394 17.0582 13.8064C17.2227 13.881 17.428 13.9751 17.7031 14.1314C18.3551 14.504 18.3551 14.9247 18.3551 15.8472V15.9518C18.3551 16.3434 18.3168 16.6872 18.2566 16.9859C19.3478 15.6185 20 13.8854 20 12C20 8.70089 18.003 5.8682 15.1519 4.64482C14.5987 5.01813 13.8398 5.54726 13.575 5.91C13.4396 6.09538 13.2482 7.04166 12.6257 7.11976C12.4626 7.14023 12.2438 7.12589 12.012 7.11097C11.3905 7.07058 10.5402 7.01606 10.268 7.75495C10.0952 8.2232 10.0648 9.49445 10.6239 10.1543C10.7134 10.2597 10.7307 10.4547 10.6699 10.6735C10.59 10.9608 10.4286 11.1356 10.3783 11.1717C10.2819 11.1163 10.0896 10.8931 9.95938 10.7412C9.64554 10.3765 9.25405 9.92233 8.74797 9.78176C8.56395 9.73083 8.36166 9.68867 8.16548 9.64736C7.6164 9.53227 6.99443 9.40134 6.84992 9.09302C6.74442 8.8672 6.74488 8.55621 6.74529 8.22764C6.74529 7.8112 6.74529 7.34029 6.54129 6.88256C6.46246 6.70541 6.35689 6.56446 6.23509 6.45329ZM12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22Z" }, child: [] }] })(e);
2477
2525
  }
2478
2526
  function _o(e) {
@@ -2487,36 +2535,36 @@ function Eo(e) {
2487
2535
  function ne(e) {
2488
2536
  return v({ attr: { viewBox: "0 0 24 24", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M17.0007 1.20825 18.3195 3.68108 20.7923 4.99992 18.3195 6.31876 17.0007 8.79159 15.6818 6.31876 13.209 4.99992 15.6818 3.68108 17.0007 1.20825ZM8.00065 4.33325 10.6673 9.33325 15.6673 11.9999 10.6673 14.6666 8.00065 19.6666 5.33398 14.6666.333984 11.9999 5.33398 9.33325 8.00065 4.33325ZM19.6673 16.3333 18.0007 13.2083 16.334 16.3333 13.209 17.9999 16.334 19.6666 18.0007 22.7916 19.6673 19.6666 22.7923 17.9999 19.6673 16.3333Z" }, child: [] }] })(e);
2489
2537
  }
2490
- function _(e) {
2538
+ function I(e) {
2491
2539
  if (!e.dictionary.ai)
2492
2540
  throw new Error("AI dictionary not found");
2493
2541
  return e.dictionary.ai;
2494
2542
  }
2495
2543
  function Qe() {
2496
2544
  const e = Ct();
2497
- return _(e.editor);
2545
+ return I(e.editor);
2498
2546
  }
2499
2547
  const No = (e) => {
2500
- const t = G(), { onManualPromptSubmit: o, promptText: r, onPromptTextChange: n } = e, [i, a] = Ee(""), s = r || i, c = $(
2548
+ const t = G(), { onManualPromptSubmit: o, promptText: r, onPromptTextChange: n } = e, [s, a] = Ee(""), i = r || s, c = D(
2501
2549
  async (d) => {
2502
- d.key === "Enter" && o(s);
2550
+ d.key === "Enter" && o(i);
2503
2551
  },
2504
- [s, o]
2505
- ), u = $(
2552
+ [i, o]
2553
+ ), u = D(
2506
2554
  (d) => {
2507
2555
  const S = d.currentTarget.value;
2508
2556
  n && n(S), r === void 0 && a(S);
2509
2557
  },
2510
2558
  [n, a, r]
2511
- ), p = I(() => ut(e.items, s), [s, e.items]), { selectedIndex: l, setSelectedIndex: m, handler: f } = Pt(p, (d) => d.onItemClick()), h = $(
2559
+ ), f = E(() => ut(e.items, i), [i, e.items]), { selectedIndex: l, setSelectedIndex: p, handler: m } = Pt(f, (d) => d.onItemClick()), h = D(
2512
2560
  (d) => {
2513
- d.key === "Enter" ? p.length > 0 ? f(d) : c(d) : f(d);
2561
+ d.key === "Enter" ? f.length > 0 ? m(d) : c(d) : m(d);
2514
2562
  },
2515
- [c, f, p.length]
2563
+ [c, m, f.length]
2516
2564
  );
2517
2565
  return Ne(() => {
2518
- m(0);
2519
- }, [s, m]), /* @__PURE__ */ vt("div", { className: "bn-combobox", children: [
2566
+ p(0);
2567
+ }, [i, p]), /* @__PURE__ */ vt("div", { className: "bn-combobox", children: [
2520
2568
  /* @__PURE__ */ y(t.Generic.Form.Root, { children: /* @__PURE__ */ y(
2521
2569
  t.Generic.Form.TextInput,
2522
2570
  {
@@ -2524,7 +2572,7 @@ const No = (e) => {
2524
2572
  name: "ai-prompt",
2525
2573
  variant: "large",
2526
2574
  icon: e.icon,
2527
- value: s || "",
2575
+ value: i || "",
2528
2576
  autoFocus: !0,
2529
2577
  placeholder: e.placeholder,
2530
2578
  disabled: e.disabled,
@@ -2540,7 +2588,7 @@ const No = (e) => {
2540
2588
  {
2541
2589
  className: "bn-combobox-items",
2542
2590
  id: "ai-suggestion-menu",
2543
- children: p.map((d, S) => /* @__PURE__ */ y(
2591
+ children: f.map((d, S) => /* @__PURE__ */ y(
2544
2592
  t.SuggestionMenu.Item,
2545
2593
  {
2546
2594
  className: dt(
@@ -2559,7 +2607,7 @@ const No = (e) => {
2559
2607
  ] });
2560
2608
  };
2561
2609
  function Ao(e) {
2562
- const t = _(e), o = O(e);
2610
+ const t = I(e), o = O(e);
2563
2611
  return [
2564
2612
  {
2565
2613
  key: "continue_writing",
@@ -2568,7 +2616,7 @@ function Ao(e) {
2568
2616
  icon: /* @__PURE__ */ y(Ce, { size: 18 }),
2569
2617
  onItemClick: async () => {
2570
2618
  await o.callLLM({
2571
- userPrompt: "Continue writing: write more text at the current cursor position related to the previous text",
2619
+ userPrompt: "Continue writing at the current cursor position related to the previous text. Add multiple blocks if needed. If the document looks like a template / draft, follow the template. Be extensive if needed.",
2572
2620
  // By default, LLM will be able to add / update / delete blocks. For "continue writing", we only want to allow adding new blocks.
2573
2621
  defaultStreamTools: {
2574
2622
  add: !0,
@@ -2628,13 +2676,13 @@ function Ao(e) {
2628
2676
  ];
2629
2677
  }
2630
2678
  function jo(e) {
2631
- const t = _(e), o = O(e);
2679
+ const t = I(e), o = O(e);
2632
2680
  return [
2633
2681
  {
2634
2682
  key: "improve_writing",
2635
2683
  title: t.ai_default_commands.improve_writing.title,
2636
2684
  aliases: t.ai_default_commands.improve_writing.aliases,
2637
- icon: /* @__PURE__ */ y(Lo, { size: 18 }),
2685
+ icon: /* @__PURE__ */ y(xo, { size: 18 }),
2638
2686
  onItemClick: async () => {
2639
2687
  await o.callLLM({
2640
2688
  useSelection: !0,
@@ -2672,7 +2720,7 @@ function jo(e) {
2672
2720
  key: "translate",
2673
2721
  title: t.ai_default_commands.translate.title,
2674
2722
  aliases: t.ai_default_commands.translate.aliases,
2675
- icon: /* @__PURE__ */ y(xo, { size: 18 }),
2723
+ icon: /* @__PURE__ */ y(Lo, { size: 18 }),
2676
2724
  onItemClick: (r) => {
2677
2725
  r(t.ai_default_commands.translate.prompt_placeholder);
2678
2726
  },
@@ -2700,7 +2748,7 @@ function jo(e) {
2700
2748
  ];
2701
2749
  }
2702
2750
  function $o(e) {
2703
- const t = _(e), o = O(e);
2751
+ const t = I(e), o = O(e);
2704
2752
  return [
2705
2753
  {
2706
2754
  key: "accept",
@@ -2725,7 +2773,7 @@ function $o(e) {
2725
2773
  ];
2726
2774
  }
2727
2775
  function Do(e) {
2728
- const t = _(e), o = O(e);
2776
+ const t = I(e), o = O(e);
2729
2777
  return [
2730
2778
  {
2731
2779
  key: "retry",
@@ -2753,38 +2801,38 @@ function Ro(e, t) {
2753
2801
  return t === "user-input" ? e.getSelection() ? jo(e) : Ao(e) : t === "user-reviewing" ? $o(e) : t === "error" ? Do(e) : [];
2754
2802
  }
2755
2803
  const Ho = (e) => {
2756
- const t = K(), [o, r] = Ee(""), n = Qe(), i = G(), a = O(t), s = Ae(
2804
+ const t = K(), [o, r] = Ee(""), n = Qe(), s = G(), a = O(t), i = Ae(
2757
2805
  a.store,
2758
- (f) => f.aiMenuState !== "closed" ? f.aiMenuState.status : "closed"
2759
- ), { items: c } = e, u = I(() => {
2760
- let f = [];
2761
- return c ? f = c(t, s) : f = Ro(t, s), f.map((h) => ({
2806
+ (m) => m.aiMenuState !== "closed" ? m.aiMenuState.status : "closed"
2807
+ ), { items: c } = e, u = E(() => {
2808
+ let m = [];
2809
+ return c ? m = c(t, i) : m = Ro(t, i), m.map((h) => ({
2762
2810
  ...h,
2763
2811
  onItemClick: () => {
2764
2812
  h.onItemClick(r);
2765
2813
  }
2766
2814
  }));
2767
- }, [c, s, t]), p = $(
2768
- async (f) => {
2815
+ }, [c, i, t]), f = D(
2816
+ async (m) => {
2769
2817
  await a.callLLM({
2770
- userPrompt: f,
2818
+ userPrompt: m,
2771
2819
  useSelection: t.getSelection() !== void 0
2772
2820
  });
2773
2821
  },
2774
2822
  [a, t]
2775
2823
  );
2776
2824
  Ne(() => {
2777
- (s === "user-reviewing" || s === "error") && r("");
2778
- }, [s]);
2779
- const l = I(() => s === "thinking" ? n.ai_menu.status.thinking : s === "ai-writing" ? n.ai_menu.status.editing : s === "error" ? n.ai_menu.status.error : n.ai_menu.input_placeholder, [s, n]), m = I(() => {
2780
- if (s === "thinking" || s === "ai-writing")
2825
+ (i === "user-reviewing" || i === "error") && r("");
2826
+ }, [i]);
2827
+ const l = E(() => i === "thinking" ? n.ai_menu.status.thinking : i === "ai-writing" ? n.ai_menu.status.editing : i === "error" ? n.ai_menu.status.error : n.ai_menu.input_placeholder, [i, n]), p = E(() => {
2828
+ if (i === "thinking" || i === "ai-writing")
2781
2829
  return /* @__PURE__ */ y(
2782
- i.SuggestionMenu.Loader,
2830
+ s.SuggestionMenu.Loader,
2783
2831
  {
2784
2832
  className: "bn-suggestion-menu-loader bn-combobox-right-section"
2785
2833
  }
2786
2834
  );
2787
- if (s === "error")
2835
+ if (i === "error")
2788
2836
  return /* @__PURE__ */ y("div", { className: "bn-combobox-right-section bn-combobox-error", children: /* @__PURE__ */ y(
2789
2837
  "svg",
2790
2838
  {
@@ -2796,25 +2844,25 @@ const Ho = (e) => {
2796
2844
  children: /* @__PURE__ */ y("path", { d: "M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm0-160q17 0 28.5-11.5T520-480v-160q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640v160q0 17 11.5 28.5T480-440Zm0 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z" })
2797
2845
  }
2798
2846
  ) });
2799
- }, [i, s]);
2847
+ }, [s, i]);
2800
2848
  return /* @__PURE__ */ y(
2801
2849
  No,
2802
2850
  {
2803
- onManualPromptSubmit: e.onManualPromptSubmit || p,
2851
+ onManualPromptSubmit: e.onManualPromptSubmit || f,
2804
2852
  items: u,
2805
2853
  promptText: o,
2806
2854
  onPromptTextChange: r,
2807
2855
  placeholder: l,
2808
- disabled: s === "thinking" || s === "ai-writing",
2856
+ disabled: i === "thinking" || i === "ai-writing",
2809
2857
  icon: /* @__PURE__ */ y("div", { className: "bn-combobox-icon", children: /* @__PURE__ */ y(ne, {}) }),
2810
- rightSection: m
2858
+ rightSection: p
2811
2859
  }
2812
2860
  );
2813
2861
  }, qo = (e) => {
2814
- const t = e.blockID ? document.querySelector(`[data-id="${e.blockID}"]`) : void 0, o = I(() => t ? {
2862
+ const t = e.blockID ? document.querySelector(`[data-id="${e.blockID}"]`) : void 0, o = E(() => t ? {
2815
2863
  getBoundingClientRect: () => t.getBoundingClientRect(),
2816
2864
  contextElement: t
2817
- } : null, [t]), { isMounted: r, ref: n, style: i, getFloatingProps: a, isPositioned: s } = Ot(!!t, o, 3e3, {
2865
+ } : null, [t]), { isMounted: r, ref: n, style: s, getFloatingProps: a, isPositioned: i } = Ot(!!t, o, 3e3, {
2818
2866
  canDismiss: {
2819
2867
  enabled: !0,
2820
2868
  escapeKey: !0,
@@ -2833,23 +2881,24 @@ const Ho = (e) => {
2833
2881
  })
2834
2882
  ],
2835
2883
  onOpenChange: e.onOpenChange,
2836
- whileElementsMounted: (c, u, p) => Lt(c, u, p, {
2884
+ whileElementsMounted: (c, u, f) => xt(c, u, f, {
2837
2885
  animationFrame: !0
2838
- })
2886
+ }),
2887
+ ...e.floatingOptions
2839
2888
  });
2840
2889
  return r ? /* @__PURE__ */ y(
2841
2890
  "div",
2842
2891
  {
2843
2892
  ref: n,
2844
2893
  style: {
2845
- ...i
2894
+ ...s
2846
2895
  },
2847
2896
  ...a(),
2848
- children: s && e.children
2897
+ children: i && e.children
2849
2898
  }
2850
2899
  ) : null;
2851
2900
  }, lr = (e) => {
2852
- const t = K(), o = O(t), r = Ae(o.store, (a) => a.aiMenuState), n = r === "closed" ? void 0 : r.blockId, i = e.aiMenu || Ho;
2901
+ const t = K(), o = O(t), r = Ae(o.store, (a) => a.aiMenuState), n = r === "closed" ? void 0 : r.blockId, s = e.aiMenu || Ho;
2853
2902
  return /* @__PURE__ */ y(
2854
2903
  qo,
2855
2904
  {
@@ -2858,16 +2907,16 @@ const Ho = (e) => {
2858
2907
  onOpenChange: (a) => {
2859
2908
  a || r === "closed" || (r.status === "user-input" ? o.closeAIMenu() : (r.status === "user-reviewing" || r.status === "error") && o.rejectChanges());
2860
2909
  },
2861
- children: /* @__PURE__ */ y(i, {})
2910
+ children: /* @__PURE__ */ y(s, {})
2862
2911
  }
2863
2912
  );
2864
2913
  }, ur = () => {
2865
2914
  const e = Qe(), t = G(), o = K(), r = O(o), n = () => {
2866
2915
  o.formattingToolbar.closeMenu();
2867
- const i = o.getSelection();
2868
- if (!i)
2916
+ const s = o.getSelection();
2917
+ if (!s)
2869
2918
  throw new Error("No selection");
2870
- const a = i.blocks[i.blocks.length - 1].id;
2919
+ const a = s.blocks[s.blocks.length - 1].id;
2871
2920
  r.openAIMenuAtBlock(a);
2872
2921
  };
2873
2922
  return o.isEditable ? /* @__PURE__ */ y(
@@ -2880,7 +2929,7 @@ const Ho = (e) => {
2880
2929
  onClick: n
2881
2930
  }
2882
2931
  ) : null;
2883
- }, zo = {
2932
+ }, Uo = {
2884
2933
  AI: ne
2885
2934
  };
2886
2935
  function dr(e) {
@@ -2893,8 +2942,8 @@ function dr(e) {
2893
2942
  r.block.content && Array.isArray(r.block.content) && // isarray check not ideal
2894
2943
  r.block.content.length === 0 && r.prevBlock ? t.openAIMenuAtBlock(r.prevBlock.id) : t.openAIMenuAtBlock(r.block.id);
2895
2944
  },
2896
- ..._(e).slash_menu.ai,
2897
- icon: /* @__PURE__ */ y(zo.AI, {})
2945
+ ...I(e).slash_menu.ai,
2946
+ icon: /* @__PURE__ */ y(Uo.AI, {})
2898
2947
  }
2899
2948
  ];
2900
2949
  }
@@ -2908,11 +2957,11 @@ export {
2908
2957
  Gt as callLLM,
2909
2958
  ar as createAIExtension,
2910
2959
  cr as createBlockNoteAIClient,
2911
- _ as getAIDictionary,
2960
+ I as getAIDictionary,
2912
2961
  O as getAIExtension,
2913
2962
  dr as getAISlashMenuItems,
2914
2963
  Ro as getDefaultAIMenuItems,
2915
- mo as llmFormats,
2964
+ po as llmFormats,
2916
2965
  ir as promptHelpers
2917
2966
  };
2918
2967
  //# sourceMappingURL=blocknote-xl-ai.js.map