@emailmaker/filemanager 0.0.8 → 0.10.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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Folder, MenuItem, LibraryMenuKey } from '../../types';
2
+ import { Folder, LibraryMenuKey, MenuItem } from '../../types';
3
3
  interface FolderSidebarProps {
4
4
  selectedFolder: string | null;
5
5
  generateMenuItems: () => MenuItem[];
@@ -0,0 +1,40 @@
1
+ import type { PixieConfig } from 'pixie/dist/types/src/config/default-config';
2
+ import { Tools } from 'pixie/dist/types/src/tools/init-tools';
3
+ export declare const PIXIE_CONTAINER_CLASS_NAME = "fm-pixie-editor";
4
+ /**
5
+ * Контроллер для работы с редактором Pixie.
6
+ * Pixie использует глобальное состояние, поэтому повторная инициализация вызывает ошибки.
7
+ * Этот класс сохраняет контейнер, в который рендерится Pixie, и переиспользует его.
8
+ * Для поддержки нескольких экземпляров Pixie потребуется переработка.
9
+ */
10
+ export declare class PixieController {
11
+ /** Контейнер для рендера Pixie */
12
+ private readonly _container;
13
+ /** Экземпляр Pixie */
14
+ private _instance;
15
+ constructor();
16
+ /** Возвращает селектор контейнера */
17
+ get className(): string;
18
+ /** Получает HTMLCanvasElement редактора, если он инициализирован */
19
+ get canvas(): HTMLCanvasElement | null;
20
+ /** Получает инструменты Pixie, если редактор инициализирован */
21
+ get tools(): Tools | undefined;
22
+ /** Проверяет, инициализирован ли редактор */
23
+ isLoaded(): boolean;
24
+ /**
25
+ * Устанавливает конфигурацию Pixie
26
+ * @param config Конфигурация Pixie
27
+ */
28
+ private _setConfig;
29
+ /**
30
+ * Отображает редактор Pixie в указанном родительском элементе
31
+ * @param config Конфигурация Pixie
32
+ * @param parent Родительский элемент, куда вставляется редактор
33
+ * @param nextSibling Элемент перед которым вставляется контейнер (по умолчанию первый ребёнок)
34
+ */
35
+ show(config: PixieConfig, parent: ParentNode, nextSibling?: ChildNode | null): Promise<void>;
36
+ /** Закрывает редактор Pixie, удаляя контейнер из DOM */
37
+ close(): void;
38
+ }
39
+ /** Глобальный экземпляр контроллера Pixie */
40
+ export declare const pixieController: PixieController;
package/file-manager.css CHANGED
@@ -392,6 +392,8 @@
392
392
  .em-filemanager .uploadButton {
393
393
  display: grid;
394
394
  grid-template-columns: 3fr 1fr;
395
+ width: 100%;
396
+ margin-bottom: 8px;
395
397
  }
396
398
 
397
399
  .em-filemanager .folderMenu {
@@ -463,15 +465,36 @@
463
465
  margin: 12px 0 !important;
464
466
  }
465
467
 
466
- /* Стили для кнопки загрузки */
467
- .em-filemanager .uploadButton {
468
- width: 100%;
469
- margin-bottom: 8px;
468
+ .em-filemanager .uploadButton .ant-btn {
469
+ display: flex;
470
+ align-items: center;
471
+ justify-content: center;
472
+ gap: 8px;
470
473
  }
471
474
 
472
475
  /* .folderMenu :global(.ant-tree-treenode-selected) .folderLabelItem {
473
476
  color: #1890ff !important;
474
477
  } */
478
+
479
+ .em-filemanager .buttonWrapper {
480
+ overflow: hidden;
481
+ margin-bottom: 24px;
482
+ border-radius: calc(var(--borderRadius) * 1px);
483
+ }
484
+
485
+ .em-filemanager .uploadButtonTitle {
486
+ white-space: nowrap;
487
+ overflow: hidden;
488
+ text-overflow: ellipsis;
489
+ }
490
+
491
+ .em-filemanager .emptyFolderContainer {
492
+ margin-left: -40px;
493
+ -webkit-user-select: none;
494
+ user-select: none;
495
+ cursor: default;
496
+ color: var(--colorTextTertiary);
497
+ }
475
498
  .em-filemanager .container {
476
499
  position: fixed;
477
500
  top: 20px;
@@ -1062,7 +1085,7 @@
1062
1085
  }
1063
1086
 
1064
1087
  .em-filemanager .status {
1065
- margin: 3px 0 0 0;
1088
+ margin: calc(var(--margin) * 1px) 0 0 0;
1066
1089
  }
1067
1090
 
1068
1091
  .em-filemanager .carousel {
@@ -1204,8 +1227,9 @@
1204
1227
  }
1205
1228
  .em-filemanager .file-manager__layout .file-manager-sider .ant-dropdown-button {
1206
1229
  grid-template-columns: 10fr 40px;
1207
- margin-bottom: 24px;
1230
+ margin-bottom: 0;
1208
1231
  gap: 2px;
1232
+ border-radius: calc(var(--borderRadius) * 1px);
1209
1233
  }
1210
1234
  .em-filemanager .file-manager__layout .file-manager-sider .ant-dropdown-button button {
1211
1235
  height: 44px;
@@ -1214,6 +1238,7 @@
1214
1238
  .em-filemanager .file-manager__layout .file-manager-sider .ant-dropdown-button .ant-btn-compact-first-item {
1215
1239
  justify-content: flex-start;
1216
1240
  width: 100%;
1241
+ min-width: 160px;
1217
1242
  border-radius: calc(var(--borderRadius) * 1px) 2px 2px calc(var(--borderRadius) * 1px);
1218
1243
  background-color: var(--colorPrimary);
1219
1244
  }
@@ -1273,9 +1298,10 @@
1273
1298
  width: inherit;
1274
1299
  }
1275
1300
  .em-filemanager .file-manager__layout .file-manager-sider .ant-tree .ant-tree-switcher {
1276
- height: 40px;
1277
- width: 40px;
1278
- margin-top: 0;
1301
+ height: 36px;
1302
+ width: 36px;
1303
+ margin-top: 2px;
1304
+ margin-left: -4px;
1279
1305
  display: flex;
1280
1306
  align-items: center;
1281
1307
  justify-content: center;
@@ -1283,8 +1309,15 @@
1283
1309
  flex-shrink: 0; /* Запрещаем сжатие переключателя */
1284
1310
  }
1285
1311
  .em-filemanager .file-manager__layout .file-manager-sider .ant-tree .ant-tree-switcher:before {
1286
- height: 40px;
1287
- width: 40px;
1312
+ margin-top: 2px;
1313
+ margin-left: -2px;
1314
+ height: 36px;
1315
+ width: 36px;
1316
+ }
1317
+ .em-filemanager .file-manager__layout .file-manager-sider .ant-tree .ant-tree-switcher > .anticon {
1318
+ font-size: 14px;
1319
+ margin-left: -4px;
1320
+ margin-top: 2px;
1288
1321
  }
1289
1322
  .em-filemanager .file-manager__layout .file-manager-sider .ant-tree .folder-item-container {
1290
1323
  width: 100%;
@@ -1516,6 +1549,7 @@
1516
1549
  .em-filemanager .file-manager__layout .sidebar-container {
1517
1550
  height: 100%;
1518
1551
  padding: 36px 24px 36px 40px;
1552
+ overflow: hidden;
1519
1553
  }
1520
1554
  .em-filemanager .file-manager__layout .sidebar-container .ant-tree-treenode {
1521
1555
  display: flex;