@mobilon-dev/chotto 0.3.124 → 0.3.126

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 (26) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue.js +2 -2
  3. package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue2.js +41 -31
  4. package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue.js +2 -2
  5. package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue2.js +51 -30
  6. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +2 -2
  7. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +286 -270
  8. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +3 -3
  9. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +40 -34
  10. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +1 -1
  11. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +282 -259
  12. package/dist/components/3_compounds/Feed/composables/useFeedScroll.js +79 -59
  13. package/dist/functions/parseMarkdown.js +7 -6
  14. package/dist/hooks/messages/useImageFeedSrc.js +50 -0
  15. package/dist/index.js +118 -113
  16. package/dist/themes/dark.css +1 -1
  17. package/dist/themes/default.css +1 -1
  18. package/dist/themes/glass.css +1 -1
  19. package/dist/themes/green.css +1 -1
  20. package/dist/themes/mobilon1.css +1 -1
  21. package/dist/types/src/components/2_feed_elements/ImageMessage/stories/ImageMessage.stories.d.ts +2 -0
  22. package/dist/types/src/components/3_compounds/Feed/composables/useFeedScroll.d.ts +3 -0
  23. package/dist/types/src/components/4_layouts/ChatWrapper/styles/types.d.ts +4 -0
  24. package/dist/types/src/hooks/messages/index.d.ts +1 -0
  25. package/dist/types/src/hooks/messages/useImageFeedSrc.d.ts +29 -0
  26. package/package.json +1 -1
@@ -21,6 +21,8 @@ export declare const RightMessageWithReplyCall: Story;
21
21
  export declare const LeftMessageWithPreviewLink: Story;
22
22
  export declare const WithImagePreviewUrl: Story;
23
23
  export declare const RightWithImagePreviewUrl: Story;
24
+ /** preview 404 → после @error в ленте показывается original url */
25
+ export declare const BrokenPreviewFallsBackToUrl: Story;
24
26
  export declare const RightMessageWithPreviewLink: Story;
25
27
  export declare const AlbumTwoImages: Story;
26
28
  export declare const AlbumThreeImages: Story;
@@ -6,6 +6,9 @@ import { Ref } from 'vue';
6
6
  * режим stick-to-bottom: при открытии чата лента прижимается вниз
7
7
  * и остаётся там, пока растёт контент (картинки, клавиатура и т.п.).
8
8
  * Любой пользовательский скролл сразу выключает этот режим.
9
+ *
10
+ * При сжатии viewport (рост поля ввода) тоже удерживаем низ, если
11
+ * пользователь был у последних сообщений — как в Telegram.
9
12
  */
10
13
  interface UseFeedScrollOptions<T = unknown> {
11
14
  /** Ссылка на DOM-элемент контейнера ленты */
@@ -12,6 +12,8 @@ export interface ChatWrapperThemeCSSVariables {
12
12
  '--chotto-chatwrapper-align-items': string;
13
13
  /** Высота выбранного чата */
14
14
  '--chotto-chatwrapper-selected-chat-height': string;
15
+ /** Минимальная высота выбранного чата (для сжатия ленты при росте инпута) */
16
+ '--chotto-chatwrapper-selected-chat-min-height': string;
15
17
  /** Ширина выбранного чата */
16
18
  '--chotto-chatwrapper-selected-chat-width': string;
17
19
  /** Отображение выбранного чата */
@@ -20,6 +22,8 @@ export interface ChatWrapperThemeCSSVariables {
20
22
  '--chotto-chatwrapper-selected-chat-flex-direction': string;
21
23
  /** Выравнивание элементов выбранного чата по вертикали */
22
24
  '--chotto-chatwrapper-selected-chat-align-items': string;
25
+ /** Overflow выбранного чата */
26
+ '--chotto-chatwrapper-selected-chat-overflow': string;
23
27
  /** Цвет фона панели чата */
24
28
  '--chotto-chatwrapper-chat-panel-background-color': string;
25
29
  /** Эффект размытия фона панели чата (для glassmorphism) */
@@ -13,6 +13,7 @@ export * from './canStartEditLastSent';
13
13
  export * from './buildReplyPayload';
14
14
  export * from './getImageMessageItems';
15
15
  export * from './getFileMessageItems';
16
+ export * from './useImageFeedSrc';
16
17
  export * from './buildEditPayload';
17
18
  export * from './getEditTooltipLines';
18
19
  export * from './getDeletedOriginalText';
@@ -0,0 +1,29 @@
1
+ import { type Ref } from 'vue';
2
+ /**
3
+ * Можно ли один раз переключить битый preview на original url.
4
+ * Не ретраим, если preview === url или url пустой (избежать цикла).
5
+ */
6
+ export declare function canFallbackImagePreviewToUrl(currentSrc: string, imagePreviewUrl?: string, url?: string): boolean;
7
+ export declare function getImageFeedSrc(imagePreviewUrl?: string, url?: string, preferOriginal?: boolean): string;
8
+ type ImageSrcSource = () => string | undefined;
9
+ /**
10
+ * Src для ленты: сначала imagePreviewUrl, при @error — однократно url.
11
+ */
12
+ export declare function useImageFeedSrc(getPreviewUrl: ImageSrcSource, getUrl: ImageSrcSource): {
13
+ displaySrc: import("vue").ComputedRef<string>;
14
+ onImageError: () => void;
15
+ preferOriginal: Ref<boolean, boolean>;
16
+ };
17
+ export interface AlbumFeedImageItem {
18
+ imagePreviewUrl?: string;
19
+ url?: string;
20
+ }
21
+ /**
22
+ * Per-tile fallback для альбома: битый preview одного tile не трогает остальные.
23
+ */
24
+ export declare function useAlbumImageFeedSrc(getItems: () => AlbumFeedImageItem[]): {
25
+ getItemSrc: (item: AlbumFeedImageItem) => string;
26
+ onItemError: (item: AlbumFeedImageItem) => void;
27
+ failedPreviews: Ref<Set<string>, Set<string>>;
28
+ };
29
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilon-dev/chotto",
3
- "version": "0.3.124",
3
+ "version": "0.3.126",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",