@emailmaker/filemanager 0.10.87 → 0.10.88

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.
@@ -1,2 +1,2 @@
1
- export{D as FileContent,J as FileManagerApiError,C as FileManagerApp,x as FileManagerAppWithContext,E as FileModals,G as FolderSidebar,P as PixieOnlyApp,B as default,v as init,A as initFileManager,y as initPixieEditor,H as installResizeObserverErrorHandler,K as mapHttpStatusToErrorCode,I as uninstallResizeObserverErrorHandler,w as unmount,z as unmountPixieEditor}from"./file-manager-index-CDath1LU.js";import"react/jsx-runtime";import"react";import"react-dom/client";import"antd";import"antd/es/alert/ErrorBoundary";import"@ant-design/icons";import"react-dom";
1
+ export{D as FileContent,J as FileManagerApiError,C as FileManagerApp,x as FileManagerAppWithContext,E as FileModals,G as FolderSidebar,P as PixieOnlyApp,B as default,v as init,A as initFileManager,y as initPixieEditor,H as installResizeObserverErrorHandler,K as mapHttpStatusToErrorCode,I as uninstallResizeObserverErrorHandler,w as unmount,z as unmountPixieEditor}from"./file-manager-index-DL8wzCQG.js";import"react/jsx-runtime";import"react";import"react-dom/client";import"antd";import"antd/es/alert/ErrorBoundary";import"@ant-design/icons";import"react-dom";
2
2
  //# sourceMappingURL=file-manager.esm.js.map
package/file-manager.js CHANGED
@@ -28789,6 +28789,37 @@ const RU_TO_EN = {
28789
28789
  * Включает: < > : " / \ | ? * ( ) # и control characters (0x00-0x1f)
28790
28790
  */
28791
28791
  const FORBIDDEN_CHARS_PATTERN = /[<>:"/\\|?*()#\x00-\x1f]/g;
28792
+ /** Дефисы и минусы: en/em dash, minus sign, non-breaking hyphen, fullwidth hyphen */
28793
+ const DASH_LIKE_CHARS = /[\u2010-\u2015\u2212\uFE63\uFF0D]/g;
28794
+ /** Знак умножения и декоративные крестики (из Word, иконок) */
28795
+ const MULTIPLICATION_LIKE_CHARS = /[\u00D7\u2715\u2716\u2A2F]/g;
28796
+ /** Неразрывные и прочие Unicode-пробелы (часто из Word/PDF/веба) */
28797
+ const UNICODE_SPACE_CHARS = /[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g;
28798
+ /** Нулевой ширины и мягкий перенос — невидимы, удаляем */
28799
+ const INVISIBLE_CHARS = /[\u00AD\u200B-\u200D\u2060\uFEFF]/g;
28800
+ /** Типографские, «ёлочки» и ASCII-кавычки — удаляем */
28801
+ const QUOTE_CHARS = /[\u2018\u2019\u201A\u201B\u00AB\u00BB\u201C\u201D\u201E\u201F'"`]/g;
28802
+ /** Маркеры списков, дробная черта, точка по центру */
28803
+ const BULLET_LIKE_CHARS = /[\u2022\u2044]/g;
28804
+ /**
28805
+ * Заменяет типографские символы на ASCII-эквиваленты.
28806
+ * Типичные источники: Word, Google Docs, PDF, копипаст из браузера.
28807
+ */
28808
+ function replaceSpecialChars(text) {
28809
+ return text
28810
+ .replace(/\u2026/g, '...')
28811
+ .replace(DASH_LIKE_CHARS, '-')
28812
+ .replace(MULTIPLICATION_LIKE_CHARS, 'x')
28813
+ .replace(UNICODE_SPACE_CHARS, ' ')
28814
+ .replace(INVISIBLE_CHARS, '')
28815
+ .replace(QUOTE_CHARS, '')
28816
+ .replace(BULLET_LIKE_CHARS, '-')
28817
+ .replace(/\u00B7/g, '-')
28818
+ .replace(/\u00A9/g, 'c')
28819
+ .replace(/\u00AE/g, 'r')
28820
+ .replace(/\u2122/g, 'tm')
28821
+ .replace(/\./g, '-');
28822
+ }
28792
28823
  const DEFAULT_OPTIONS = {
28793
28824
  transliterate: true,
28794
28825
  replaceSpaces: true,
@@ -28815,23 +28846,27 @@ function normalizeName(name, options) {
28815
28846
  if (options.transliterate) {
28816
28847
  result = transliterateRuToEn(result);
28817
28848
  }
28818
- // 2. Удаление запрещенных символов
28849
+ // 2. NFKC: fullwidth-символы (A, -, 1) → обычные ASCII
28850
+ result = result.normalize('NFKC');
28851
+ // 3. Замена типографских символов на ASCII
28852
+ result = replaceSpecialChars(result);
28853
+ // 4. Удаление запрещенных символов
28819
28854
  if (options.removeForbiddenChars) {
28820
28855
  result = result.replace(FORBIDDEN_CHARS_PATTERN, '_');
28821
28856
  }
28822
- // 3. Замена пробелов на подчеркивание
28857
+ // 5. Замена пробелов на подчеркивание
28823
28858
  if (options.replaceSpaces) {
28824
28859
  result = result.replace(/\s+/g, '_');
28825
28860
  }
28826
- // 4. Приведение к нижнему регистру
28861
+ // 6. Приведение к нижнему регистру
28827
28862
  if (options.toLowerCase) {
28828
28863
  result = result.toLowerCase();
28829
28864
  }
28830
- // 5. Убираем множественные подчеркивания
28865
+ // 7. Убираем множественные подчеркивания
28831
28866
  result = result.replace(/_{2,}/g, '_');
28832
- // 6. Убираем подчеркивания в начале и конце
28867
+ // 8. Убираем подчеркивания в начале и конце
28833
28868
  result = result.replace(/^_+|_+$/g, '');
28834
- // 7. Ограничиваем длину (максимум для большинства файловых систем)
28869
+ // 9. Ограничиваем длину (максимум для большинства файловых систем)
28835
28870
  if (result.length > 255) {
28836
28871
  result = result.substring(0, 255);
28837
28872
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emailmaker/filemanager",
3
- "version": "0.10.87",
3
+ "version": "0.10.88",
4
4
  "main": "./file-manager.js",
5
5
  "module": "./file-manager.esm.js",
6
6
  "types": "./index.d.ts",