@novaprose/core 0.6.0 → 0.7.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 (132) hide show
  1. package/README.md +7 -4
  2. package/dist/{advlist-K2U3VPH2.js → advlist-5FNKPLUX.js} +10 -19
  3. package/dist/advlist-5FNKPLUX.js.map +1 -0
  4. package/dist/{autolink-XWDTLY37.js → autolink-45LTODWB.js} +6 -3
  5. package/dist/{autolink-XWDTLY37.js.map → autolink-45LTODWB.js.map} +1 -1
  6. package/dist/{autosave-MWNRUNU3.js → autosave-GMWJ5BPE.js} +6 -10
  7. package/dist/autosave-GMWJ5BPE.js.map +1 -0
  8. package/dist/{charmap-ADLYOIB3.js → charmap-2GC7LF7G.js} +6 -11
  9. package/dist/charmap-2GC7LF7G.js.map +1 -0
  10. package/dist/{chunk-NPKAIW34.js → chunk-5AW2HHG6.js} +6 -1
  11. package/dist/chunk-5AW2HHG6.js.map +1 -0
  12. package/dist/{chunk-46RIM5KP.js → chunk-DWZLSZDG.js} +689 -974
  13. package/dist/chunk-DWZLSZDG.js.map +1 -0
  14. package/dist/{chunk-7ON7PR5R.js → chunk-FCMZ7TUQ.js} +213 -20
  15. package/dist/chunk-FCMZ7TUQ.js.map +1 -0
  16. package/dist/{chunk-HZRIBOPW.js → chunk-JPJVTB45.js} +38 -2
  17. package/dist/chunk-JPJVTB45.js.map +1 -0
  18. package/dist/{chunk-435CRWKA.js → chunk-KPE3QRPB.js} +163 -422
  19. package/dist/chunk-KPE3QRPB.js.map +1 -0
  20. package/dist/chunk-KWXFL4WS.js +174 -0
  21. package/dist/chunk-KWXFL4WS.js.map +1 -0
  22. package/dist/chunk-ND2CWNVG.js +51 -0
  23. package/dist/chunk-ND2CWNVG.js.map +1 -0
  24. package/dist/chunk-PVFKXRID.js +27 -0
  25. package/dist/chunk-PVFKXRID.js.map +1 -0
  26. package/dist/chunk-R2UMUCVI.js +351 -0
  27. package/dist/chunk-R2UMUCVI.js.map +1 -0
  28. package/dist/{chunk-GHEFKKRC.js → chunk-T3GY6IVK.js} +41 -24
  29. package/dist/chunk-T3GY6IVK.js.map +1 -0
  30. package/dist/{comments-panel-FYJE3U64.js → comments-panel-HXMWSRAW.js} +5 -3
  31. package/dist/comments-panel-HXMWSRAW.js.map +1 -0
  32. package/dist/{directionality-XOHJFSL6.js → directionality-5JLWQGP2.js} +12 -10
  33. package/dist/directionality-5JLWQGP2.js.map +1 -0
  34. package/dist/editor-CXkltf1R.d.ts +1886 -0
  35. package/dist/editor-CgSBFTke.d.cts +1886 -0
  36. package/dist/{emoticons-TP4N4ZGY.js → emoticons-ZD6ZRIWG.js} +6 -11
  37. package/dist/emoticons-ZD6ZRIWG.js.map +1 -0
  38. package/dist/form-dialog-QH6KAERD.js +180 -0
  39. package/dist/form-dialog-QH6KAERD.js.map +1 -0
  40. package/dist/html-rules-api-D3fKQi-R.d.cts +40 -0
  41. package/dist/html-rules-api-D3fKQi-R.d.ts +40 -0
  42. package/dist/html-rules.cjs +480 -0
  43. package/dist/html-rules.cjs.map +1 -0
  44. package/dist/html-rules.d.cts +87 -0
  45. package/dist/html-rules.d.ts +87 -0
  46. package/dist/html-rules.js +413 -0
  47. package/dist/html-rules.js.map +1 -0
  48. package/dist/i18n/de.cjs +324 -0
  49. package/dist/i18n/de.cjs.map +1 -0
  50. package/dist/i18n/de.d.cts +9 -0
  51. package/dist/i18n/de.d.ts +9 -0
  52. package/dist/i18n/de.js +303 -0
  53. package/dist/i18n/de.js.map +1 -0
  54. package/dist/i18n/es.cjs +324 -0
  55. package/dist/i18n/es.cjs.map +1 -0
  56. package/dist/i18n/es.d.cts +9 -0
  57. package/dist/i18n/es.d.ts +9 -0
  58. package/dist/i18n/es.js +303 -0
  59. package/dist/i18n/es.js.map +1 -0
  60. package/dist/i18n/fr.cjs +324 -0
  61. package/dist/i18n/fr.cjs.map +1 -0
  62. package/dist/i18n/fr.d.cts +9 -0
  63. package/dist/i18n/fr.d.ts +9 -0
  64. package/dist/i18n/fr.js +303 -0
  65. package/dist/i18n/fr.js.map +1 -0
  66. package/dist/i18n/it.cjs +324 -0
  67. package/dist/i18n/it.cjs.map +1 -0
  68. package/dist/i18n/it.d.cts +9 -0
  69. package/dist/i18n/it.d.ts +9 -0
  70. package/dist/i18n/it.js +303 -0
  71. package/dist/i18n/it.js.map +1 -0
  72. package/dist/i18n/pt-BR.cjs +324 -0
  73. package/dist/i18n/pt-BR.cjs.map +1 -0
  74. package/dist/i18n/pt-BR.d.cts +9 -0
  75. package/dist/i18n/pt-BR.d.ts +9 -0
  76. package/dist/i18n/pt-BR.js +303 -0
  77. package/dist/i18n/pt-BR.js.map +1 -0
  78. package/dist/i18n/ru.cjs +324 -0
  79. package/dist/i18n/ru.cjs.map +1 -0
  80. package/dist/i18n/ru.d.cts +10 -0
  81. package/dist/i18n/ru.d.ts +10 -0
  82. package/dist/i18n/ru.js +303 -0
  83. package/dist/i18n/ru.js.map +1 -0
  84. package/dist/index-C603bU6r.d.cts +216 -0
  85. package/dist/index-C603bU6r.d.ts +216 -0
  86. package/dist/index.cjs +2159 -1178
  87. package/dist/index.cjs.map +1 -1
  88. package/dist/index.d.cts +46 -1788
  89. package/dist/index.d.ts +46 -1788
  90. package/dist/index.js +96 -152
  91. package/dist/index.js.map +1 -1
  92. package/dist/{insertdatetime-T4SEMQWP.js → insertdatetime-CRO7TJAQ.js} +9 -15
  93. package/dist/insertdatetime-CRO7TJAQ.js.map +1 -0
  94. package/dist/markdown.cjs +273 -0
  95. package/dist/markdown.cjs.map +1 -0
  96. package/dist/markdown.d.cts +23 -0
  97. package/dist/markdown.d.ts +23 -0
  98. package/dist/markdown.js +241 -0
  99. package/dist/markdown.js.map +1 -0
  100. package/dist/{nonbreaking-HG5HV6AL.js → nonbreaking-66LFZV2W.js} +7 -6
  101. package/dist/nonbreaking-66LFZV2W.js.map +1 -0
  102. package/dist/paste-office-F3QW4WWO.js +440 -0
  103. package/dist/paste-office-F3QW4WWO.js.map +1 -0
  104. package/dist/{quickbars-4NU4SIPL.js → quickbars-7E2QRS7J.js} +12 -8
  105. package/dist/quickbars-7E2QRS7J.js.map +1 -0
  106. package/dist/{revisionhistory-3YQPLPLM.js → revisionhistory-DXE7KU4R.js} +17 -31
  107. package/dist/revisionhistory-DXE7KU4R.js.map +1 -0
  108. package/dist/table-SSNABG5W.js +301 -0
  109. package/dist/table-SSNABG5W.js.map +1 -0
  110. package/dist/{visualblocks-RTAYJOGR.js → visualblocks-6DLBXYOA.js} +7 -6
  111. package/dist/visualblocks-6DLBXYOA.js.map +1 -0
  112. package/package.json +45 -5
  113. package/src/style.css +187 -31
  114. package/dist/advlist-K2U3VPH2.js.map +0 -1
  115. package/dist/autosave-MWNRUNU3.js.map +0 -1
  116. package/dist/charmap-ADLYOIB3.js.map +0 -1
  117. package/dist/chunk-435CRWKA.js.map +0 -1
  118. package/dist/chunk-46RIM5KP.js.map +0 -1
  119. package/dist/chunk-6RJENZXT.js +0 -104
  120. package/dist/chunk-6RJENZXT.js.map +0 -1
  121. package/dist/chunk-7ON7PR5R.js.map +0 -1
  122. package/dist/chunk-GHEFKKRC.js.map +0 -1
  123. package/dist/chunk-HZRIBOPW.js.map +0 -1
  124. package/dist/chunk-NPKAIW34.js.map +0 -1
  125. package/dist/comments-panel-FYJE3U64.js.map +0 -1
  126. package/dist/directionality-XOHJFSL6.js.map +0 -1
  127. package/dist/emoticons-TP4N4ZGY.js.map +0 -1
  128. package/dist/insertdatetime-T4SEMQWP.js.map +0 -1
  129. package/dist/nonbreaking-HG5HV6AL.js.map +0 -1
  130. package/dist/quickbars-4NU4SIPL.js.map +0 -1
  131. package/dist/revisionhistory-3YQPLPLM.js.map +0 -1
  132. package/dist/visualblocks-RTAYJOGR.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ API_CHANGE_META,
2
3
  ContentRules,
3
4
  DEFAULT_MENUBAR,
4
5
  DEFAULT_MENUS,
@@ -7,17 +8,16 @@ import {
7
8
  HTMLSerializer,
8
9
  KNOWN_STYLES,
9
10
  KNOWN_TAGS,
11
+ REMOTE_CHANGE_META,
10
12
  clearSearch,
11
13
  countWords,
12
14
  createEditor,
13
- createTranslator,
14
15
  defaultColors,
15
16
  defaultFontFamilies,
16
17
  defaultFontSizes,
17
18
  defaultLineHeights,
18
19
  defaultSlashCommands,
19
20
  defaultToolbar,
20
- en,
21
21
  findMatches,
22
22
  findNext,
23
23
  formatHTML,
@@ -33,15 +33,13 @@ import {
33
33
  parserFor,
34
34
  printContent,
35
35
  rankSlashCommands,
36
- registerLanguage,
37
36
  replaceAll,
38
37
  replaceCurrent,
39
- ru,
40
38
  setLineHeight,
41
39
  setSearch,
42
40
  setStyle,
43
41
  toggleFullscreen
44
- } from "./chunk-46RIM5KP.js";
42
+ } from "./chunk-DWZLSZDG.js";
45
43
  import {
46
44
  COMMENT_ID_RE,
47
45
  COMMENT_MAX_LENGTH,
@@ -53,39 +51,17 @@ import {
53
51
  import {
54
52
  applyLink,
55
53
  attachFilePicker,
56
- createTable,
57
54
  getSelectedImage,
58
- hasHeaderColumn,
59
- hasHeaderRow,
60
- insertTable,
61
- isInTable,
62
55
  normalizeUrl,
63
56
  openImageAltDialog,
64
57
  openImageDialog,
65
58
  openLinkDialog,
66
59
  removeLink,
67
- setCellBackground,
68
60
  setImageAttrs,
69
61
  setImageWidthFraction,
70
- tableCommands,
71
62
  textField,
72
63
  uploadImages
73
- } from "./chunk-435CRWKA.js";
74
- import {
75
- createSchema,
76
- cssValue,
77
- imageSize,
78
- schema
79
- } from "./chunk-7ON7PR5R.js";
80
- import {
81
- pickLabels
82
- } from "./chunk-6RJENZXT.js";
83
- import {
84
- h
85
- } from "./chunk-HZRIBOPW.js";
86
- import {
87
- icons
88
- } from "./chunk-NPKAIW34.js";
64
+ } from "./chunk-KPE3QRPB.js";
89
65
  import {
90
66
  commands,
91
67
  getActiveAlign,
@@ -94,17 +70,50 @@ import {
94
70
  isCommandActive,
95
71
  isMarkActive,
96
72
  isNodeActive,
97
- isSafeImageUrl,
98
- isSafeLinkUrl,
99
73
  marksOf,
100
74
  nodesOf,
101
75
  setLink
102
- } from "./chunk-GHEFKKRC.js";
76
+ } from "./chunk-T3GY6IVK.js";
77
+ import {
78
+ createTable,
79
+ hasHeaderColumn,
80
+ hasHeaderRow,
81
+ insertTable,
82
+ setCellBackground,
83
+ tableCommands
84
+ } from "./chunk-KWXFL4WS.js";
85
+ import {
86
+ createSchema,
87
+ cssValue,
88
+ imageSize,
89
+ isInTable,
90
+ schema
91
+ } from "./chunk-FCMZ7TUQ.js";
92
+ import {
93
+ createTranslator,
94
+ en,
95
+ getPluginMessages,
96
+ pickLabels,
97
+ registerLanguage
98
+ } from "./chunk-R2UMUCVI.js";
99
+ import {
100
+ icons
101
+ } from "./chunk-5AW2HHG6.js";
103
102
  import {
104
103
  definePlugin,
105
104
  isPluginRegistered,
106
105
  registerPlugin
107
106
  } from "./chunk-HPLT3XRZ.js";
107
+ import {
108
+ h
109
+ } from "./chunk-JPJVTB45.js";
110
+ import {
111
+ registerHtmlRules
112
+ } from "./chunk-ND2CWNVG.js";
113
+ import {
114
+ isSafeImageUrl,
115
+ isSafeLinkUrl
116
+ } from "./chunk-PVFKXRID.js";
108
117
 
109
118
  // src/plugins/anchor.ts
110
119
  import { NodeSelection } from "prosemirror-state";
@@ -116,13 +125,6 @@ var LABELS = {
116
125
  hint: "Letters, digits, \u201C-\u201D, \u201C_\u201D, \u201C.\u201D; must start with a letter. Link to it with #ID.",
117
126
  invalid: "Use letters, digits, \u201C-\u201D, \u201C_\u201D or \u201C.\u201D, starting with a letter",
118
127
  save: "Save"
119
- },
120
- ru: {
121
- title: "\u042F\u043A\u043E\u0440\u044C",
122
- id: "\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440",
123
- hint: "\u041B\u0430\u0442\u0438\u043D\u0441\u043A\u0438\u0435 \u0431\u0443\u043A\u0432\u044B, \u0446\u0438\u0444\u0440\u044B, \xAB-\xBB, \xAB_\xBB, \xAB.\xBB; \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0441 \u0431\u0443\u043A\u0432\u044B. \u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 \u044F\u043A\u043E\u0440\u044C \u2014 #\u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440.",
124
- invalid: "\u0422\u043E\u043B\u044C\u043A\u043E \u043B\u0430\u0442\u0438\u043D\u0441\u043A\u0438\u0435 \u0431\u0443\u043A\u0432\u044B, \u0446\u0438\u0444\u0440\u044B, \xAB-\xBB, \xAB_\xBB \u0438\u043B\u0438 \xAB.\xBB, \u043F\u0435\u0440\u0432\u0430\u044F \u2014 \u0431\u0443\u043A\u0432\u0430",
125
- save: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C"
126
128
  }
127
129
  };
128
130
  var ID_RE = /^[A-Za-z][\w.-]{0,63}$/;
@@ -157,7 +159,7 @@ var anchor_default = definePlugin({
157
159
  }
158
160
  },
159
161
  setup(editor) {
160
- const labels = pickLabels(editor, LABELS);
162
+ const labels = pickLabels(editor, "anchor", LABELS);
161
163
  const selectedAnchor = () => {
162
164
  const { selection } = editor.view.state;
163
165
  return selection instanceof NodeSelection && selection.node.type.name === "anchor" ? selection : null;
@@ -203,8 +205,7 @@ import { keymap } from "prosemirror-keymap";
203
205
 
204
206
  // src/plugins/mentions.ts
205
207
  var LABELS2 = {
206
- en: { list: "People", empty: "No matches" },
207
- ru: { list: "\u041B\u044E\u0434\u0438", empty: "\u041D\u0438\u043A\u043E\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E" }
208
+ en: { list: "People", empty: "No matches" }
208
209
  };
209
210
  var MENTION_ID_RE = /^[\w.@:+-]{1,128}$/;
210
211
  var MAX_NAME = 80;
@@ -265,7 +266,7 @@ var mentions_default = definePlugin({
265
266
  console.warn("[nova] mentions: set pluginOptions.mentions.fetch to search people");
266
267
  return;
267
268
  }
268
- const labels = pickLabels(editor, LABELS2);
269
+ const labels = pickLabels(editor, "mentions", LABELS2);
269
270
  const max = options.maxResults ?? 8;
270
271
  let found = /* @__PURE__ */ new Map();
271
272
  editor.ui.registry.addAutocompleter("mentions", {
@@ -324,34 +325,6 @@ var LABELS3 = {
324
325
  edited: "edited",
325
326
  you: "you",
326
327
  count: "{count} comments"
327
- },
328
- ru: {
329
- add: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439",
330
- show: "\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438",
331
- panel: "\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438",
332
- guest: "\u0413\u043E\u0441\u0442\u044C",
333
- newComment: "\u041D\u043E\u0432\u044B\u0439 \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439",
334
- placeholder: "\u041D\u0430\u043F\u0438\u0448\u0438\u0442\u0435 \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\u2026",
335
- replyPlaceholder: "\u041E\u0442\u0432\u0435\u0442\u0438\u0442\u044C\u2026",
336
- comment: "\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
337
- reply: "\u041E\u0442\u0432\u0435\u0442\u0438\u0442\u044C",
338
- cancel: "\u041E\u0442\u043C\u0435\u043D\u0430",
339
- save: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C",
340
- edit: "\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C",
341
- remove: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
342
- resolve: "\u0420\u0435\u0448\u0435\u043D\u043E",
343
- reopen: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u043D\u043E\u0432\u0430",
344
- deleteThread: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043E\u0431\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0435",
345
- close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438",
346
- showResolved: "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0440\u0435\u0448\u0451\u043D\u043D\u044B\u0435",
347
- resolvedBy: "\u0420\u0435\u0448\u0435\u043D\u043E: {name}",
348
- orphan: "\u041F\u0440\u043E\u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u043A\u0441\u0442 \u0443\u0434\u0430\u043B\u0451\u043D",
349
- empty: "\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0435\u0432 \u043F\u043E\u043A\u0430 \u043D\u0435\u0442. \u0412\u044B\u0434\u0435\u043B\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442 \u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 \xAB\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\xBB ({shortcut}).",
350
- people: "\u041B\u044E\u0434\u0438",
351
- noPeople: "\u041D\u0438\u043A\u043E\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E",
352
- edited: "\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u043E",
353
- you: "\u0432\u044B",
354
- count: "\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0435\u0432: {count}"
355
328
  }
356
329
  };
357
330
  var ICON_ADD = icons.commentAdd;
@@ -479,7 +452,7 @@ var comments_default = definePlugin({
479
452
  ];
480
453
  },
481
454
  setup(editor) {
482
- const labels = pickLabels(editor, LABELS3);
455
+ const labels = pickLabels(editor, "comments", LABELS3);
483
456
  const options = editor.options.pluginOptions?.comments ?? {};
484
457
  const store = options.store ?? createCommentStore(options.threads ?? [], options.onChange);
485
458
  const author = {
@@ -511,12 +484,29 @@ var comments_default = definePlugin({
511
484
  const dispatchMeta = (meta) => editor.view.dispatch(editor.view.state.tr.setMeta(commentsKey, meta));
512
485
  let panel = null;
513
486
  let panelOpen = false;
514
- let loading = null;
515
- const content = editor.view.dom.parentElement;
516
- const body = document.createElement("div");
517
- body.className = "nova-body";
518
- content.parentElement.insertBefore(body, content);
519
- body.append(content);
487
+ editor.ui.registry.addSidebar("comments", {
488
+ title: labels.panel,
489
+ button: false,
490
+ header: false,
491
+ render: async (container) => {
492
+ const { createCommentsPanel } = await import("./comments-panel-HXMWSRAW.js");
493
+ panel = createCommentsPanel(controller);
494
+ container.append(panel.el);
495
+ return () => panel?.destroy();
496
+ },
497
+ onShow: () => {
498
+ panelOpen = true;
499
+ if (panel) panel.el.hidden = false;
500
+ editor.root.classList.add("nova-comments-open");
501
+ panel?.render();
502
+ },
503
+ onHide: () => {
504
+ panelOpen = false;
505
+ if (panel) panel.el.hidden = true;
506
+ editor.root.classList.remove("nova-comments-open");
507
+ if (pluginState().pending) dispatchMeta({ pending: null });
508
+ }
509
+ });
520
510
  const controller = {
521
511
  editor,
522
512
  store,
@@ -602,30 +592,10 @@ var comments_default = definePlugin({
602
592
  },
603
593
  canEdit: (comment) => options.canEdit ? options.canEdit(comment, author) : comment.author.id === author.id,
604
594
  isPanelOpen: () => panelOpen,
605
- async openPanel() {
606
- if (!panel) {
607
- loading ??= import("./comments-panel-FYJE3U64.js").then(({ createCommentsPanel }) => {
608
- if (editor.view.isDestroyed) return;
609
- panel = createCommentsPanel(controller);
610
- body.append(panel.el);
611
- });
612
- await loading;
613
- }
614
- if (!panel || panelOpen) return;
615
- editor.ui.closeOverlays();
616
- panelOpen = true;
617
- panel.el.hidden = false;
618
- editor.root.classList.add("nova-comments-open");
619
- panel.render();
620
- editor.updateUI();
621
- },
595
+ openPanel: () => editor.ui.sidebar.show("comments"),
622
596
  closePanel() {
623
- if (!panel || !panelOpen) return;
624
- panelOpen = false;
625
- panel.el.hidden = true;
626
- editor.root.classList.remove("nova-comments-open");
627
- if (pluginState().pending) dispatchMeta({ pending: null });
628
- editor.updateUI();
597
+ if (!panelOpen) return;
598
+ editor.ui.sidebar.hide({ restoreFocus: false });
629
599
  editor.focus();
630
600
  }
631
601
  };
@@ -666,7 +636,6 @@ var comments_default = definePlugin({
666
636
  });
667
637
  return () => {
668
638
  unsubscribe();
669
- panel?.destroy();
670
639
  controllers.delete(editor);
671
640
  };
672
641
  }
@@ -680,12 +649,6 @@ var LABELS4 = {
680
649
  search: "Variables",
681
650
  empty: "No variables found",
682
651
  unknown: "Unknown variable"
683
- },
684
- ru: {
685
- insert: "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0443\u044E",
686
- search: "\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435",
687
- empty: "\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B",
688
- unknown: "\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F"
689
652
  }
690
653
  };
691
654
  var KEY_RE = /^[\w.:-]{1,100}$/;
@@ -738,7 +701,7 @@ function buildNodes(editor) {
738
701
  // Документ мог прийти из JSON — ключ проверяем и на выходе.
739
702
  toDOM: (node) => {
740
703
  const key = KEY_RE.test(node.attrs.key) ? node.attrs.key : "";
741
- const label = node.attrs.label || key;
704
+ const label = node.attrs.label == null || node.attrs.label === "" ? key : String(node.attrs.label);
742
705
  return ["span", { [attribute]: key, contenteditable: "false" }, label];
743
706
  }
744
707
  }
@@ -799,7 +762,7 @@ var mergetags_default = definePlugin({
799
762
  toolbar: "mergetags",
800
763
  nodes: buildNodes,
801
764
  prosemirrorPlugins: (editor) => {
802
- const labels = pickLabels(editor, LABELS4);
765
+ const labels = pickLabels(editor, "mergetags", LABELS4);
803
766
  return [
804
767
  new PMPlugin({
805
768
  props: {
@@ -811,7 +774,7 @@ var mergetags_default = definePlugin({
811
774
  ];
812
775
  },
813
776
  setup(editor) {
814
- const labels = pickLabels(editor, LABELS4);
777
+ const labels = pickLabels(editor, "mergetags", LABELS4);
815
778
  editor.ui.registry.addMenuButton("mergetags", {
816
779
  icon: icons.mergeTags,
817
780
  tooltip: labels.insert,
@@ -882,21 +845,6 @@ var LABELS5 = {
882
845
  toolbar: "Suggestion",
883
846
  guest: "Guest",
884
847
  none: "No suggestions"
885
- },
886
- ru: {
887
- toggle: "\u041F\u0440\u0435\u0434\u043B\u0430\u0433\u0430\u0442\u044C \u043F\u0440\u0430\u0432\u043A\u0438",
888
- review: "\u041F\u0440\u0430\u0432\u043A\u0438",
889
- accept: "\u041F\u0440\u0438\u043D\u044F\u0442\u044C",
890
- reject: "\u041E\u0442\u043A\u043B\u043E\u043D\u0438\u0442\u044C",
891
- acceptAll: "\u041F\u0440\u0438\u043D\u044F\u0442\u044C \u0432\u0441\u0435 \u043F\u0440\u0430\u0432\u043A\u0438",
892
- rejectAll: "\u041E\u0442\u043A\u043B\u043E\u043D\u0438\u0442\u044C \u0432\u0441\u0435 \u043F\u0440\u0430\u0432\u043A\u0438",
893
- next: "\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0430\u044F \u043F\u0440\u0430\u0432\u043A\u0430",
894
- previous: "\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0430\u044F \u043F\u0440\u0430\u0432\u043A\u0430",
895
- inserted: "\u0412\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u043E: {name}",
896
- deleted: "\u0423\u0434\u0430\u043B\u0435\u043D\u043E: {name}",
897
- toolbar: "\u041F\u0440\u0430\u0432\u043A\u0430",
898
- guest: "\u0413\u043E\u0441\u0442\u044C",
899
- none: "\u041F\u0440\u0430\u0432\u043E\u043A \u043D\u0435\u0442"
900
848
  }
901
849
  };
902
850
  var ICON_TOGGLE = icons.suggest;
@@ -908,7 +856,7 @@ var OWN = "nova-suggestions-own";
908
856
  var PALETTE = ["#1a7f37", "#8250df", "#bf3989", "#0969da", "#bc4c00", "#1b7c83"];
909
857
  function colorFor(key) {
910
858
  let hash = 0;
911
- for (const ch of key) hash = hash * 31 + ch.charCodeAt(0) | 0;
859
+ for (const ch of String(key ?? "")) hash = hash * 31 + ch.charCodeAt(0) | 0;
912
860
  return PALETTE[Math.abs(hash) % PALETTE.length];
913
861
  }
914
862
  function newId() {
@@ -1152,7 +1100,7 @@ var suggestions_default = definePlugin({
1152
1100
  attributes: (state) => suggestionsKey.getState(state)?.enabled ? { class: "nova-suggesting" } : {},
1153
1101
  decorations(state) {
1154
1102
  if (cache?.doc === state.doc) return cache.set;
1155
- const labels = pickLabels(editor, LABELS5);
1103
+ const labels = pickLabels(editor, "suggestions", LABELS5);
1156
1104
  const time = new Intl.DateTimeFormat(editor.options.language ?? "en", {
1157
1105
  dateStyle: "medium",
1158
1106
  timeStyle: "short"
@@ -1188,7 +1136,7 @@ var suggestions_default = definePlugin({
1188
1136
  transformTransaction(tr, state, editor) {
1189
1137
  if (!isSuggesting(state)) return tr;
1190
1138
  const options = editor.options.pluginOptions?.suggestions ?? {};
1191
- const labels = pickLabels(editor, LABELS5);
1139
+ const labels = pickLabels(editor, "suggestions", LABELS5);
1192
1140
  const author = {
1193
1141
  id: USER_ID_RE.test(options.author?.id ?? "") ? options.author.id : "guest",
1194
1142
  name: String(options.author?.name || labels.guest).slice(0, 80)
@@ -1197,7 +1145,7 @@ var suggestions_default = definePlugin({
1197
1145
  },
1198
1146
  setup(editor) {
1199
1147
  const options = editor.options.pluginOptions?.suggestions ?? {};
1200
- const labels = pickLabels(editor, LABELS5);
1148
+ const labels = pickLabels(editor, "suggestions", LABELS5);
1201
1149
  const canReview = options.canReview !== false;
1202
1150
  const dispatch = (tr) => editor.view.dispatch(tr);
1203
1151
  const current = () => suggestionAt(editor.view.state);
@@ -1289,6 +1237,7 @@ var YOUTUBE = /^https?:\/\/(?:www\.|m\.)?(?:youtube(?:-nocookie)?\.com\/(?:watch
1289
1237
  var VIMEO = /^https?:\/\/(?:www\.|player\.)?vimeo\.com\/(?:video\/)?(\d{1,12})(?:[/?#]|$)/i;
1290
1238
  var VIDEO_FILE = /^https:\/\/[^\s"'<>]+\.(?:mp4|webm|ogv|ogg)(?:\?[^\s"'<>#]*)?$/i;
1291
1239
  function parseMediaUrl(url) {
1240
+ if (typeof url !== "string") return null;
1292
1241
  const value = url.trim();
1293
1242
  const youtube = value.match(YOUTUBE);
1294
1243
  if (youtube)
@@ -1307,14 +1256,6 @@ var LABELS6 = {
1307
1256
  name: "Title (for screen readers)",
1308
1257
  invalid: "This video address is not supported",
1309
1258
  save: "Insert"
1310
- },
1311
- ru: {
1312
- title: "\u0412\u0438\u0434\u0435\u043E",
1313
- url: "\u0410\u0434\u0440\u0435\u0441 \u0432\u0438\u0434\u0435\u043E",
1314
- hint: "YouTube, Vimeo \u0438\u043B\u0438 \u0441\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 \u0444\u0430\u0439\u043B .mp4 / .webm",
1315
- name: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 (\u0434\u043B\u044F \u044D\u043A\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0434\u0438\u043A\u0442\u043E\u0440\u0430)",
1316
- invalid: "\u042D\u0442\u043E\u0442 \u0430\u0434\u0440\u0435\u0441 \u0432\u0438\u0434\u0435\u043E \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F",
1317
- save: "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C"
1318
1259
  }
1319
1260
  };
1320
1261
  function mediaAttrs(dom, src) {
@@ -1419,7 +1360,7 @@ var media_default = definePlugin({
1419
1360
  })
1420
1361
  ],
1421
1362
  setup(editor) {
1422
- const labels = pickLabels(editor, LABELS6);
1363
+ const labels = pickLabels(editor, "media", LABELS6);
1423
1364
  const selected = () => {
1424
1365
  const { selection } = editor.view.state;
1425
1366
  return selection instanceof NodeSelection2 && selection.node.type.name === "media" ? selection : null;
@@ -1473,7 +1414,7 @@ var media_default = definePlugin({
1473
1414
 
1474
1415
  // src/plugins/pagebreak.ts
1475
1416
  var ICON3 = icons.pageBreak;
1476
- var LABELS7 = { en: { title: "Page break" }, ru: { title: "\u0420\u0430\u0437\u0440\u044B\u0432 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B" } };
1417
+ var LABELS7 = { en: { title: "Page break" } };
1477
1418
  var pagebreak_default = definePlugin({
1478
1419
  name: "pagebreak",
1479
1420
  toolbar: "pagebreak",
@@ -1498,7 +1439,7 @@ var pagebreak_default = definePlugin({
1498
1439
  }
1499
1440
  },
1500
1441
  setup(editor) {
1501
- const { title } = pickLabels(editor, LABELS7);
1442
+ const { title } = pickLabels(editor, "pagebreak", LABELS7);
1502
1443
  const insert = () => {
1503
1444
  const { state, dispatch } = editor.view;
1504
1445
  const type = editor.schema.nodes.pagebreak;
@@ -1516,15 +1457,15 @@ var pagebreak_default = definePlugin({
1516
1457
  });
1517
1458
 
1518
1459
  // src/plugins/index.ts
1519
- registerPlugin("insertdatetime", () => import("./insertdatetime-T4SEMQWP.js"));
1520
- registerPlugin("quickbars", () => import("./quickbars-4NU4SIPL.js"));
1521
- registerPlugin("charmap", () => import("./charmap-ADLYOIB3.js"));
1522
- registerPlugin("emoticons", () => import("./emoticons-TP4N4ZGY.js"));
1523
- registerPlugin("nonbreaking", () => import("./nonbreaking-HG5HV6AL.js"));
1524
- registerPlugin("autolink", () => import("./autolink-XWDTLY37.js"));
1525
- registerPlugin("autosave", () => import("./autosave-MWNRUNU3.js"));
1460
+ registerPlugin("insertdatetime", () => import("./insertdatetime-CRO7TJAQ.js"));
1461
+ registerPlugin("quickbars", () => import("./quickbars-7E2QRS7J.js"));
1462
+ registerPlugin("charmap", () => import("./charmap-2GC7LF7G.js"));
1463
+ registerPlugin("emoticons", () => import("./emoticons-ZD6ZRIWG.js"));
1464
+ registerPlugin("nonbreaking", () => import("./nonbreaking-66LFZV2W.js"));
1465
+ registerPlugin("autolink", () => import("./autolink-45LTODWB.js"));
1466
+ registerPlugin("autosave", () => import("./autosave-GMWJ5BPE.js"));
1526
1467
  registerPlugin("autoresize", () => import("./autoresize-UB3GOA6D.js"));
1527
- registerPlugin("visualblocks", () => import("./visualblocks-RTAYJOGR.js"));
1468
+ registerPlugin("visualblocks", () => import("./visualblocks-6DLBXYOA.js"));
1528
1469
  registerPlugin("anchor", anchor_default);
1529
1470
  registerPlugin("pagebreak", pagebreak_default);
1530
1471
  registerPlugin("media", media_default);
@@ -1532,10 +1473,11 @@ registerPlugin("comments", comments_default);
1532
1473
  registerPlugin("mentions", mentions_default);
1533
1474
  registerPlugin("mergetags", mergetags_default);
1534
1475
  registerPlugin("suggestions", suggestions_default);
1535
- registerPlugin("directionality", () => import("./directionality-XOHJFSL6.js"));
1536
- registerPlugin("advlist", () => import("./advlist-K2U3VPH2.js"));
1537
- registerPlugin("revisionhistory", () => import("./revisionhistory-3YQPLPLM.js"));
1476
+ registerPlugin("directionality", () => import("./directionality-5JLWQGP2.js"));
1477
+ registerPlugin("advlist", () => import("./advlist-5FNKPLUX.js"));
1478
+ registerPlugin("revisionhistory", () => import("./revisionhistory-DXE7KU4R.js"));
1538
1479
  export {
1480
+ API_CHANGE_META,
1539
1481
  ContentRules,
1540
1482
  DEFAULT_MENUBAR,
1541
1483
  DEFAULT_MENUS,
@@ -1545,6 +1487,7 @@ export {
1545
1487
  KNOWN_STYLES,
1546
1488
  KNOWN_TAGS,
1547
1489
  MENTION_ID_RE,
1490
+ REMOTE_CHANGE_META,
1548
1491
  applyLink,
1549
1492
  clearSearch,
1550
1493
  commands,
@@ -1571,6 +1514,7 @@ export {
1571
1514
  getLineHeight,
1572
1515
  getLinkAt,
1573
1516
  getMentions,
1517
+ getPluginMessages,
1574
1518
  getSearchState,
1575
1519
  getSelectedImage,
1576
1520
  getStyle,
@@ -1605,13 +1549,13 @@ export {
1605
1549
  parserFor,
1606
1550
  printContent,
1607
1551
  rankSlashCommands,
1552
+ registerHtmlRules,
1608
1553
  registerLanguage,
1609
1554
  registerPlugin,
1610
1555
  removeLink,
1611
1556
  replaceAll,
1612
1557
  replaceCurrent,
1613
1558
  resolveSuggestions,
1614
- ru,
1615
1559
  sanitizeThread,
1616
1560
  schema,
1617
1561
  setCellBackground,