@elcrm/telegram 0.0.74 → 0.0.76

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.
@@ -4,6 +4,7 @@ export type TFooter = {
4
4
  children?: any;
5
5
  className?: string;
6
6
  page?: string;
7
+ toHide?: boolean;
7
8
  direction?: "row" | "column";
8
9
  onPageChange?: (page: string) => void;
9
10
  };
@@ -13,6 +14,6 @@ export type TAction = {
13
14
  page?: string;
14
15
  callback?: () => void;
15
16
  };
16
- declare const Footer: ({ actions, children, className, page, onPageChange, direction, }: TFooter) => import("react/jsx-runtime").JSX.Element;
17
+ declare const Footer: ({ actions, children, className, toHide, page, onPageChange, direction, }: TFooter) => import("react/jsx-runtime").JSX.Element;
17
18
  export default Footer;
18
19
  export { events };
@@ -0,0 +1,6 @@
1
+ export type TSafeArea = {
2
+ className?: string;
3
+ children?: React.ReactNode;
4
+ };
5
+ declare const SafeArea: ({ className, children }: TSafeArea) => import("react/jsx-runtime").JSX.Element;
6
+ export default SafeArea;
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0}html{height:-webkit-fill-available}body{background-color:var(--tg-theme-bg-color);color:var(--tg-theme-text-color);-webkit-font-smoothing:antialiased;font-family:sans-serif;font-variant:no-common-ligatures;text-rendering:optimizeLegibility;padding:0;margin:0}body{overflow:hidden!important}body::-webkit-scrollbar{width:0px;height:0px;display:none!important;-ms-overflow-style:none;scrollbar-width:none}body:has(.debug){--tg-viewport-height: calc(100dvh - 50px) }.debug{height:50px;font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;background:var(--tg-theme-header-bg-color);color:var(--tg-theme-text-color);display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--tg-theme-bg-color);z-index:222;position:sticky;top:0}.debug .b,.debug .o{padding:0 15px;cursor:pointer}.mb{bottom:0;position:fixed;left:0;right:0;padding:10px}.mb button{width:100%}.tm{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;display:flex;flex-direction:column;background-color:var(--tg-theme-bg-color);border-radius:10px;box-shadow:0 10px 20px #40404026;width:200px;position:absolute;right:5px;z-index:999;border:1px solid var(--tg-theme-hint-color)}.tm ul{list-style-type:none;margin:0;display:block;width:100%;padding:8px;border-top:1px solid var(--tg-theme-hint-color)}.tm ul:first-child{border-top:0}.tm ol{list-style-type:none;display:none;padding:8px;background-color:var(--tg-theme-bg-color);border-radius:10px;box-shadow:0 10px 20px #40404026;position:absolute;right:100%;left:-180px;z-index:100;width:100%;top:0;flex-direction:column;border:1px solid var(--tg-theme-hint-color)}.tm ol:hover{display:flex}.tm li{position:relative}.tm button{font:inherit;border:0;padding:8px 36px 8px 8px;width:100%;border-radius:8px;text-align:left;display:flex;align-items:center;position:relative;color:var(--tg-theme-text-color);background-color:var(--tg-theme-bg-color)}.tm button:hover{background-color:var(--tg-theme-button-color)}.tm button:hover+ol{display:flex}.ta{margin:0;width:100vw;height:100vh;display:-webkit-flex;display:flex;justify-content:center;align-items:center;background-color:#0006}.ta .--body{font-family:-apple-system,BlinkMacSystemFont;-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;box-sizing:border-box;font-size:17px;overflow:hidden;width:270px;height:auto;background-color:#ffffff73;border-radius:12px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:var(--tg-theme-bg-color-alpha);z-index:11;display:flex;align-items:flex-end;justify-content:center;animation:fadeIn .3s ease}.modal-overlay.closing{animation:fadeOut .3s ease}.modal-popup{position:relative;width:100%;min-height:var(--modal-height);max-width:500px;max-height:var(--modal-height);overflow:hidden;animation:slideUp .3s ease;background:var(--tg-theme-bg-color)}.modal-popup.closing{animation:slideDown .3s ease}.notice{position:fixed;top:0;z-index:999;max-height:0px}.notice .item{display:block;color:#fff;overflow:hidden;cursor:pointer;display:flex;margin:20px 20px 10px;border-radius:10px;padding-left:10px;gap:10px;width:calc(100vw - 40px)}.notice svg{margin-top:7px}.notice .text{padding:9px 0;flex:1}.notice .error{background:#f44336}.notice .success{background:#4caf50}.notice .warning{background:#ff9800}.notice .item.thema{background:var(--tg-theme-secondary-bg-color);color:var(--tg-theme-text-color)}.notice .item.error.thema svg{color:#f44336}.notice .item.success.thema svg{color:#4caf50}.notice .item.warning.thema svg{color:#ff9800}.footer-menu-overlay{position:fixed;top:auto;left:0;right:0;bottom:0;z-index:10;display:flex;align-items:flex-end;justify-content:center;transition:opacity .5s ease-out;opacity:1}.footer-menu-overlay.is-overlay{background:var(--tg-theme-bg-color-alpha);top:0}.footer-menu-overlay.closing{opacity:0}.footer-menu-popup-book{position:relative;-webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px);border-radius:20px 20px 0 0;width:100%;max-width:500px;max-height:70vh;overflow:hidden;animation:slideUp .3s ease;box-shadow:0 -10px 30px #00000080;box-shadow:0 -.5px #0000001a;background:var(--tg-theme-secondary-bg-color-alpha);margin-bottom:calc(var(--tg-safe-area-inset-bottom) + 40px);border-bottom:1px solid var(--tg-theme-section-separator-color)}.footer-menu-popup-book.closing{animation:slideDown .3s ease}.footer-menu-header{position:relative;display:flex;opacity:.8;justify-content:space-between;align-items:center;padding:20px;border-bottom:1px solid var(--tg-theme-section-separator-color);z-index:1}.footer-menu-header h3{margin:0;color:var(--tg-theme-text-color);font-size:18px;font-weight:600}.footer-menu-close-btn{background:none;border:none;color:var(--tg-theme-text-color);font-size:20px;cursor:pointer;padding:5px;border-radius:50%;width:30px;height:30px;display:flex;align-items:center;justify-content:center;transition:background-color .2s ease,transform .15s ease-in-out}.footer-menu-close-btn:active{transform:scale(1.1)}.chapters-list{position:relative;max-height:60vh;overflow-y:auto;overflow-x:hidden;padding:10px 0 20px;z-index:1}.chapter-item{display:flex;justify-content:space-between;align-items:center;padding:15px 20px;cursor:pointer;transition:background-color .2s ease,transform .15s ease-in-out;border-bottom:1px solid var(--tg-theme-section-separator-color)}.chapter-item:active{transform:scale(1.02)}.chapter-item:hover{background-color:#ffffff0d}.chapter-item.active{background-color:#ffffff1a}.chapter-info-item{display:flex;align-items:center;gap:12px}.chapter-number{background:var(--tg-theme-bg-color);color:var(--tg-theme-text-color);min-width:24px;min-height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600}.chapter-item.active .chapter-number{background:var(--tg-theme-button-color);color:var(--tg-theme-button-text-color)}.chapter-title{color:var(--tg-theme-text-color);font-size:16px;font-weight:400}.chapter-title p{font-size:10px;color:var(--tg-subtitle_text_color);font-weight:400}.chapter-title b{font-size:16px;font-weight:400}.chapter-duration{color:var(--tg-theme-text-color);opacity:.8;font-size:14px;font-weight:400}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes slideUp{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideDown{0%{transform:translateY(0)}to{transform:translateY(100%)}}.chapters-list::-webkit-scrollbar{width:6px}.chapters-list::-webkit-scrollbar-track{background:#333}.chapters-list::-webkit-scrollbar-thumb{background:#666;border-radius:3px}.chapters-list::-webkit-scrollbar-thumb:hover{background:#888}@media (max-width: 375px){.chapter-progress{padding:15px 10px 5px}.chapters-popup{max-height:80vh}.chapter-item{padding:12px 15px}.chapter-title{font-size:14px}.chapter-duration{font-size:12px}}._h_rl5ga_1{z-index:2;position:fixed;bottom:0;left:0;right:0;display:flex;padding:5px 16px 0;gap:10px;background-color:var(--tg-theme-footer-bg);padding-bottom:calc(var(--tg-safe-area-inset-bottom) + var(--tg-content-safe-area-inset-bottom, 0px))}._h_rl5ga_1._row_rl5ga_14{flex-direction:row}._h_rl5ga_1._column_rl5ga_17{flex-direction:column}._h_rl5ga_1 div[data-active]{flex:1;text-align:center;padding:10px 0 0}._h_rl5ga_1 div[data-active=true]{color:var(--tg-theme-button-color)}._h_rl5ga_1 button{flex:1}
1
+ *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0}html{height:-webkit-fill-available}body{background-color:var(--tg-theme-bg-color);color:var(--tg-theme-text-color);-webkit-font-smoothing:antialiased;font-family:sans-serif;font-variant:no-common-ligatures;text-rendering:optimizeLegibility;padding:0;margin:0}body{overflow:hidden!important}body::-webkit-scrollbar{width:0px;height:0px;display:none!important;-ms-overflow-style:none;scrollbar-width:none}.debug{height:50px;font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;background:var(--tg-theme-header-bg-color);color:var(--tg-theme-text-color);display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--tg-theme-bg-color);z-index:222;position:fixed;top:0;left:0;right:0}.debug .b,.debug .o{padding:0 15px;cursor:pointer}.mb{bottom:0;position:fixed;left:0;right:0;padding:10px}.mb button{width:100%}.tm{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;display:flex;flex-direction:column;background-color:var(--tg-theme-bg-color);border-radius:10px;box-shadow:0 10px 20px #40404026;width:200px;position:absolute;right:5px;z-index:999;border:1px solid var(--tg-theme-hint-color)}.tm ul{list-style-type:none;margin:0;display:block;width:100%;padding:8px;border-top:1px solid var(--tg-theme-hint-color)}.tm ul:first-child{border-top:0}.tm ol{list-style-type:none;display:none;padding:8px;background-color:var(--tg-theme-bg-color);border-radius:10px;box-shadow:0 10px 20px #40404026;position:absolute;right:100%;left:-180px;z-index:100;width:100%;top:0;flex-direction:column;border:1px solid var(--tg-theme-hint-color)}.tm ol:hover{display:flex}.tm li{position:relative}.tm button{font:inherit;border:0;padding:8px 36px 8px 8px;width:100%;border-radius:8px;text-align:left;display:flex;align-items:center;position:relative;color:var(--tg-theme-text-color);background-color:var(--tg-theme-bg-color)}.tm button:hover{background-color:var(--tg-theme-button-color)}.tm button:hover+ol{display:flex}.ta{margin:0;width:100vw;height:100vh;display:-webkit-flex;display:flex;justify-content:center;align-items:center;background-color:#0006}.ta .--body{font-family:-apple-system,BlinkMacSystemFont;-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;box-sizing:border-box;font-size:17px;overflow:hidden;width:270px;height:auto;background-color:#ffffff73;border-radius:12px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:var(--tg-theme-bg-color-alpha);z-index:11;display:flex;align-items:flex-end;justify-content:center;animation:fadeIn .3s ease}.modal-overlay.closing{animation:fadeOut .3s ease}.modal-popup{position:relative;width:100%;min-height:var(--modal-height);max-width:500px;max-height:var(--modal-height);overflow:hidden;animation:slideUp .3s ease;background:var(--tg-theme-bg-color)}.modal-popup.closing{animation:slideDown .3s ease}.notice{position:fixed;top:0;z-index:999;max-height:0px}.notice .item{display:block;color:#fff;overflow:hidden;cursor:pointer;display:flex;margin:20px 20px 10px;border-radius:10px;padding-left:10px;gap:10px;width:calc(100vw - 40px)}.notice svg{margin-top:7px}.notice .text{padding:9px 0;flex:1}.notice .error{background:#f44336}.notice .success{background:#4caf50}.notice .warning{background:#ff9800}.notice .item.thema{background:var(--tg-theme-secondary-bg-color);color:var(--tg-theme-text-color)}.notice .item.error.thema svg{color:#f44336}.notice .item.success.thema svg{color:#4caf50}.notice .item.warning.thema svg{color:#ff9800}.footer-menu-overlay{position:fixed;top:auto;left:0;right:0;bottom:0;z-index:10;display:flex;align-items:flex-end;justify-content:center;transition:opacity .5s ease-out;opacity:1}.footer-menu-overlay.is-overlay{background:var(--tg-theme-bg-color-alpha);top:0}.footer-menu-overlay.closing{opacity:0}.footer-menu-popup-book{position:relative;-webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px);border-radius:20px 20px 0 0;width:100%;max-width:500px;max-height:70vh;overflow:hidden;animation:slideUp .3s ease;box-shadow:0 -10px 30px #00000080;box-shadow:0 -.5px #0000001a;background:var(--tg-theme-secondary-bg-color-alpha);margin-bottom:calc(var(--tg-safe-area-inset-bottom) + 40px);border-bottom:1px solid var(--tg-theme-section-separator-color)}.footer-menu-popup-book.closing{animation:slideDown .3s ease}.footer-menu-header{position:relative;display:flex;opacity:.8;justify-content:space-between;align-items:center;padding:20px;border-bottom:1px solid var(--tg-theme-section-separator-color);z-index:1}.footer-menu-header h3{margin:0;color:var(--tg-theme-text-color);font-size:18px;font-weight:600}.footer-menu-close-btn{background:none;border:none;color:var(--tg-theme-text-color);font-size:20px;cursor:pointer;padding:5px;border-radius:50%;width:30px;height:30px;display:flex;align-items:center;justify-content:center;transition:background-color .2s ease,transform .15s ease-in-out}.footer-menu-close-btn:active{transform:scale(1.1)}.chapters-list{position:relative;max-height:60vh;overflow-y:auto;overflow-x:hidden;padding:10px 0 20px;z-index:1}.chapter-item{display:flex;justify-content:space-between;align-items:center;padding:15px 20px;cursor:pointer;transition:background-color .2s ease,transform .15s ease-in-out;border-bottom:1px solid var(--tg-theme-section-separator-color)}.chapter-item:active{transform:scale(1.02)}.chapter-item:hover{background-color:#ffffff0d}.chapter-item.active{background-color:#ffffff1a}.chapter-info-item{display:flex;align-items:center;gap:12px}.chapter-number{background:var(--tg-theme-bg-color);color:var(--tg-theme-text-color);min-width:24px;min-height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600}.chapter-item.active .chapter-number{background:var(--tg-theme-button-color);color:var(--tg-theme-button-text-color)}.chapter-title{color:var(--tg-theme-text-color);font-size:16px;font-weight:400}.chapter-title p{font-size:10px;color:var(--tg-subtitle_text_color);font-weight:400}.chapter-title b{font-size:16px;font-weight:400}.chapter-duration{color:var(--tg-theme-text-color);opacity:.8;font-size:14px;font-weight:400}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes slideUp{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideDown{0%{transform:translateY(0)}to{transform:translateY(100%)}}.chapters-list::-webkit-scrollbar{width:6px}.chapters-list::-webkit-scrollbar-track{background:#333}.chapters-list::-webkit-scrollbar-thumb{background:#666;border-radius:3px}.chapters-list::-webkit-scrollbar-thumb:hover{background:#888}@media (max-width: 375px){.chapter-progress{padding:15px 10px 5px}.chapters-popup{max-height:80vh}.chapter-item{padding:12px 15px}.chapter-title{font-size:14px}.chapter-duration{font-size:12px}}._h_rl5ga_1{z-index:2;position:fixed;bottom:0;left:0;right:0;display:flex;padding:5px 16px 0;gap:10px;background-color:var(--tg-theme-footer-bg);padding-bottom:calc(var(--tg-safe-area-inset-bottom) + var(--tg-content-safe-area-inset-bottom, 0px))}._h_rl5ga_1._row_rl5ga_14{flex-direction:row}._h_rl5ga_1._column_rl5ga_17{flex-direction:column}._h_rl5ga_1 div[data-active]{flex:1;text-align:center;padding:10px 0 0}._h_rl5ga_1 div[data-active=true]{color:var(--tg-theme-button-color)}._h_rl5ga_1 button{flex:1}._p_1aqjt_1{padding-bottom:calc(var(--tg-safe-area-inset-bottom) + var(--tg-content-safe-area-inset-bottom, 0px));padding-top:calc(var(--tg-safe-area-inset-top) + var(--tg-content-safe-area-inset-top, 0px));padding-left:calc(var(--tg-safe-area-inset-left) + var(--tg-content-safe-area-inset-left, 0px));padding-right:calc(var(--tg-safe-area-inset-right) + var(--tg-content-safe-area-inset-right, 0px))}._m_1aqjt_8{margin-bottom:calc(var(--tg-safe-area-inset-bottom) + var(--tg-content-safe-area-inset-bottom, 0px));margin-top:calc(var(--tg-safe-area-inset-top) + var(--tg-content-safe-area-inset-top, 0px));margin-left:calc(var(--tg-safe-area-inset-left) + var(--tg-content-safe-area-inset-left, 0px));margin-right:calc(var(--tg-safe-area-inset-right) + var(--tg-content-safe-area-inset-right, 0px))}
package/dist/index.d.ts CHANGED
@@ -29,8 +29,9 @@ declare namespace Telegram {
29
29
  * @param {string} [page] - Текущая страница для определения активного действия
30
30
  * @param {"row"|"column"} [direction="row"] - Направление расположения элементов футера
31
31
  * @param {(page: string) => void} [onPageChange] - Функция для обработки смены страницы
32
+ * @param {boolean} [toHide=false] - Скрывать при открытой клавиатуре
32
33
  */
33
- const Footer: ({ actions, children, className, page, onPageChange, direction, }: import("./Footer").TFooter) => import("react/jsx-runtime").JSX.Element;
34
+ const Footer: ({ actions, children, className, toHide, page, onPageChange, direction, }: import("./Footer").TFooter) => import("react/jsx-runtime").JSX.Element;
34
35
  /**
35
36
  * @param {object} props - параметры компонента
36
37
  * @param {React.ReactNode} props.children - Контент внутри шита
@@ -43,6 +44,7 @@ declare namespace Telegram {
43
44
  isOverlay?: boolean;
44
45
  }) => import("react/jsx-runtime").JSX.Element;
45
46
  const toggleBottomSheet: () => void;
47
+ const SafeArea: ({ className, children }: import("./SafeArea").TSafeArea) => import("react/jsx-runtime").JSX.Element;
46
48
  const Modal: typeof _Modal;
47
49
  const MainButton: {
48
50
  callback: never[];
@@ -65,8 +67,9 @@ declare namespace Telegram {
65
67
  * @param {string} [page] - Текущая страница для определения активного действия
66
68
  * @param {"row"|"column"} [direction="row"] - Направление расположения элементов футера
67
69
  * @param {(page: string) => void} [onPageChange] - Функция для обработки смены страницы
70
+ * @param {boolean} [toHide=false] - Скрывать при открытой клавиатуре
68
71
  */
69
- export declare const Footer: ({ actions, children, className, page, onPageChange, direction, }: import('./Footer').TFooter) => import("react/jsx-runtime").JSX.Element;
72
+ export declare const Footer: ({ actions, children, className, toHide, page, onPageChange, direction, }: import('./Footer').TFooter) => import("react/jsx-runtime").JSX.Element;
70
73
  /**
71
74
  * @param {object} props - параметры компонента
72
75
  * @param {React.ReactNode} props.children - Контент внутри шита
@@ -98,6 +101,7 @@ export declare const BackButton: (params: boolean | {
98
101
  * Notice({type: 'success', text: 'Операция выполнена', thema: true});
99
102
  */
100
103
  export declare const Notice: (type: any, text?: any, thema?: any) => void;
104
+ export declare const SafeArea: ({ className, children }: import('./SafeArea').TSafeArea) => import("react/jsx-runtime").JSX.Element;
101
105
  export declare const Header: () => import("react/jsx-runtime").JSX.Element, toggleBottomSheet: () => void, Modal: typeof _Modal, MainButton: {
102
106
  callback: never[];
103
107
  set: (j: MainButton | boolean) => void;