@antscorp/antsomi-ui 1.3.5-beta.752 → 1.3.5-beta.754

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.
@@ -29,6 +29,7 @@ export declare const parseTagString: (input: string, acceptableTagPattern: Array
29
29
  */
30
30
  export declare function convertInputString(input: string): string;
31
31
  export declare const getLinkLineURLImage: (productId?: string, code?: string) => string;
32
+ export declare const getImageSourceViberEmoji: (fileName?: string) => any;
32
33
  /**
33
34
  * Processes the input text to replace emojis based on the specified collection type.
34
35
  *
@@ -4,7 +4,6 @@ import stringReplaceToArray from 'string-replace-to-array';
4
4
  import { CUSTOM_FN, EMOJI, EMOJI_COLLECTIONS, PREFIX_PATTERN_LINE_MESSAGE, PROMOTION_CODE, SHORT_LINK, } from './constants';
5
5
  import { iconsViber } from './iconsViber';
6
6
  // Utils
7
- import { getImagePath } from './generateImagePath';
8
7
  import { acceptablePatternChecking, getCachedRegex, patternHandlers } from './patternHandlers';
9
8
  /**
10
9
  * Parses the input string and replaces matching patterns with processed tags.
@@ -102,24 +101,20 @@ export function convertInputString(input) {
102
101
  return result.trim(); // Remove any trailing whitespace
103
102
  }
104
103
  export const getLinkLineURLImage = (productId = '', code = '') => `https://stickershop.line-scdn.net/sticonshop/v1/sticon/${productId}/android/${code}.png?detect-emoji=line-message&v=1`;
104
+ export const getImageSourceViberEmoji = (fileName = '') => {
105
+ // eslint-disable-next-line global-require, import/no-dynamic-require
106
+ const src = require(`../../../assets/images/viber/96x96/${fileName}`);
107
+ return src.default || src;
108
+ };
105
109
  /**
106
110
  * Creates a renderer function for Viber emojis that maps specific filenames to emojis.
107
111
  *
108
112
  * @returns {Function} A function that takes a filename extension and returns a corresponding image source URL
109
113
  * or undefined if the image path is not found.
110
114
  *
111
- * The renderer replaces certain filenames with their corresponding special characters (e.g., 'exclamation' with '!').
112
115
  */
113
116
  const makeViberEmojiRenderer = () => function renderViberEmoji(fileNameExtension) {
114
- const findIndexOfDot = fileNameExtension.indexOf('.');
115
- let fileNameWithoutExtension = fileNameExtension.slice(0, findIndexOfDot);
116
- if (fileNameWithoutExtension === 'exclamation') {
117
- fileNameWithoutExtension = '!';
118
- }
119
- if (fileNameWithoutExtension === 'dollars') {
120
- fileNameWithoutExtension = '$';
121
- }
122
- const src = getImagePath(fileNameWithoutExtension);
117
+ const src = getImageSourceViberEmoji(fileNameExtension);
123
118
  return src;
124
119
  };
125
120
  /**
@@ -191,7 +191,7 @@
191
191
  "_BLOCK_DEVICE_CUS": "Devices",
192
192
  "_BLOCK_IDENTITY_GRAPH_CUS": "Identity Graph",
193
193
  "_BLOCK_INTEREST_CUS": "Interests",
194
- "_BLOCK_PRODUCT_RECOMMEND_CUS": "Item recommendation",
194
+ "_BLOCK_PRODUCT_RECOMMEND_CUS": "Recommendations",
195
195
  "_BLOCK_REVENUE_CUS": "Revenue",
196
196
  "_BLOCK_SEARCHES_CUS": "Searches",
197
197
  "_BLOCK_SUCCESS_ORDER_CUS": "Success orders",
@@ -191,7 +191,7 @@
191
191
  "_BLOCK_DEVICE_CUS": "デバイス",
192
192
  "_BLOCK_IDENTITY_GRAPH_CUS": "アイデンティティグラフ",
193
193
  "_BLOCK_INTEREST_CUS": "興味のあること",
194
- "_BLOCK_PRODUCT_RECOMMEND_CUS": "アイテムのおすすめ",
194
+ "_BLOCK_PRODUCT_RECOMMEND_CUS": "推奨事項",
195
195
  "_BLOCK_REVENUE_CUS": "収益",
196
196
  "_BLOCK_SEARCHES_CUS": "検索",
197
197
  "_BLOCK_SUCCESS_ORDER_CUS": "成功した注文",
@@ -191,7 +191,7 @@
191
191
  "_BLOCK_DEVICE_CUS": "Thiết bị",
192
192
  "_BLOCK_IDENTITY_GRAPH_CUS": "Biểu đồ nhận dạng",
193
193
  "_BLOCK_INTEREST_CUS": "Sở thích",
194
- "_BLOCK_PRODUCT_RECOMMEND_CUS": "Đề xuất sản phẩm",
194
+ "_BLOCK_PRODUCT_RECOMMEND_CUS": "Đề xuất",
195
195
  "_BLOCK_REVENUE_CUS": "Doanh thu",
196
196
  "_BLOCK_SEARCHES_CUS": "Tìm kiếm",
197
197
  "_BLOCK_SUCCESS_ORDER_CUS": "Đơn hàng thành công",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.752",
3
+ "version": "1.3.5-beta.754",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -1 +0,0 @@
1
- export declare function getImagePath(fileName: string): string | undefined;
@@ -1,17 +0,0 @@
1
- var _a;
2
- // Preload all images in the 96x96 directory
3
- const images = import.meta.glob('../../../assets/images/viber/96x96/*.png', {
4
- eager: true,
5
- });
6
- // Map the imported images to a usable format
7
- const imageMap = {};
8
- // Populate imageMap with filenames as keys
9
- for (const path in images) {
10
- const fileName = (_a = path.split('/').pop()) === null || _a === void 0 ? void 0 : _a.split('.').shift(); // Extract the file name without extension
11
- if (fileName) {
12
- imageMap[fileName] = path; // Map fileName to the correct path
13
- }
14
- }
15
- export function getImagePath(fileName) {
16
- return imageMap[fileName]; // Return the correct image path
17
- }