@emailmaker/filemanager 0.10.46 → 0.10.48

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 (36) hide show
  1. package/components/FileContent/FileContent.d.ts +1 -0
  2. package/components/FileManagerApp/ActionsHeader.d.ts +4 -0
  3. package/components/FileModals/FileModals.d.ts +4 -1
  4. package/components/ImageIcons/IconsControls.d.ts +26 -0
  5. package/components/ImageIcons/IconsGrid.d.ts +26 -0
  6. package/components/ImageIcons/IconsSearchForm.d.ts +13 -0
  7. package/components/ImageIcons/IconsTab.d.ts +4 -0
  8. package/components/ImageIcons/useIconsCopyToFolder.d.ts +28 -0
  9. package/components/ImageIcons/useStreamlineApi.d.ts +47 -0
  10. package/components/index.d.ts +1 -0
  11. package/constants/index.d.ts +2 -0
  12. package/file-manager.css +495 -21
  13. package/file-manager.esm.js +9 -9
  14. package/file-manager.esm.js.map +1 -1
  15. package/file-manager.js +1 -1
  16. package/file-manager.js.LICENSE.txt +2 -0
  17. package/hooks/core/files/actions/useFilesCopy.d.ts +1 -0
  18. package/hooks/core/files/useFilesAPI.d.ts +2 -1
  19. package/hooks/core/files/useFilesSelection.d.ts +1 -0
  20. package/hooks/core/types.d.ts +6 -1
  21. package/hooks/core/useFiles.d.ts +1 -0
  22. package/hooks/useCustomIcons.d.ts +1 -0
  23. package/hooks/useFileActions.d.ts +6 -1
  24. package/hooks/useFolderSelectionMenu.d.ts +26 -0
  25. package/notification.d.ts +27 -8
  26. package/package.json +1 -1
  27. package/types.d.ts +80 -7
  28. package/utils/errorMessages.d.ts +39 -2
  29. package/utils/fileFormatUtils.d.ts +39 -0
  30. package/utils/fileValidation.d.ts +23 -0
  31. package/utils/imageCompression.d.ts +1 -0
  32. package/utils/jsonDataProvider.d.ts +8 -0
  33. package/utils/mimeUtils.d.ts +12 -0
  34. package/utils/nameNormalization.d.ts +23 -0
  35. package/utils/svgParseUtils.d.ts +47 -0
  36. package/utils/svgToPng.d.ts +11 -0
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Утилиты для парсинга SVG: определение количества цветов, толщины линий и стиля иконок.
3
+ * Поддерживает атрибуты и inline style, градиенты (linear и radial), различные форматы цветов.
4
+ */
5
+ /** Конвертирует цвет в hex для ColorPicker (rgb, rgba, имя → #rrggbb) */
6
+ export declare function colorToHex(raw: string): string;
7
+ /** Нормализует цвет к hex для сравнения (без учёта прозрачности для уникальности) */
8
+ export declare function normalizeColorForCompare(raw: string): string | null;
9
+ export interface SvgParseResult {
10
+ /** Уникальные цвета (fill/stroke/stop-color) */
11
+ colors: string[];
12
+ /** Количество элементов с fill */
13
+ fillsCount: number;
14
+ /** Количество элементов с stroke */
15
+ strokesCount: number;
16
+ /** Есть градиенты */
17
+ hasGradient: boolean;
18
+ /** Извлечённый stroke-width или undefined */
19
+ strokeWidth: number | undefined;
20
+ }
21
+ /** Парсит SVG и возвращает метаданные для определения стиля family */
22
+ export declare function parseSvgForFamily(svg: string): SvgParseResult;
23
+ /** Агрегирует результаты по нескольким SVG */
24
+ export declare function aggregateSvgParseResults(results: SvgParseResult[]): SvgParseResult;
25
+ /**
26
+ * Строит карту: нормализованный цвет → индекс переменной (1, 2, 3...).
27
+ * Порядок — по первому появлению цвета (сначала svg, затем shape-элементы).
28
+ */
29
+ export declare function buildFillColorToVarIndexMap(svg: string): Map<string, number>;
30
+ /**
31
+ * Единая карта цветов: fill и stroke в порядке появления.
32
+ * Используется для правильного отображения обводки (stroke) как отдельного цвета.
33
+ */
34
+ export declare function buildUnifiedColorToVarIndexMap(svg: string): Map<string, number>;
35
+ /** Аналогично для stroke. Учитывает stroke на <svg> — наследуется paths. */
36
+ export declare function buildStrokeColorToVarIndexMap(svg: string): Map<string, number>;
37
+ /**
38
+ * Извлекает цвета из SVG в том же порядке, что и buildUnifiedColorToVarIndexMap.
39
+ * Возвращает [color1, color2, color3] — сырые значения для пикеров.
40
+ */
41
+ export declare function extractColorsInUnifiedOrder(svg: string): string[];
42
+ /** Извлекает цвета для установки в пикеры (stops, fills, strokes по приоритету) */
43
+ export declare function extractColorsForPickers(svg: string): {
44
+ fills: string[];
45
+ strokes: string[];
46
+ stops: string[];
47
+ };
@@ -0,0 +1,11 @@
1
+ export type SvgColorOptions = {
2
+ colorHex: string;
3
+ colorHex2: string;
4
+ colorHex3: string;
5
+ };
6
+ export declare function applyInlineColors(svg: string, colors: SvgColorOptions): string;
7
+ export declare function computeSvgTargetDimensions(svgText: string, targetSize: number): {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ export declare function rasterizeSvgToPng(svgText: string, outW: number, outH: number, bg?: string): Promise<string>;