@antscorp/antsomi-ui 1.3.5-beta.948 → 1.3.5-beta.949

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,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { PayloadInfo } from '@antscorp/antsomi-ui/es/types';
3
2
  export type TDisplayFormat = 'number' | 'percentage' | 'currency' | 'datetime';
4
3
  type DisplayFormatProps = {
@@ -16,7 +16,7 @@ import '@yaireo/tagify/dist/tagify.css';
16
16
  // Styled
17
17
  import { TagTextArea, TagifyWrapper, WrapperPlaceHolder } from './styled';
18
18
  // Utils
19
- import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, } from './utils';
19
+ import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, isCustomTagType, } from './utils';
20
20
  import { acceptablePatternChecking, detectURLRegex, getCachedRegex, getCustomTagId, getPersonalizeTagInfo, getShortLinkTagInfo, patternHandlers, } from './patternHandlers';
21
21
  // Constants
22
22
  import { DETECT_LINK, EMOJI, ERROR_TAG, FORCE_SHOW_TOOLTIP, INVALID_TAG, MESSAGE_TAG, PERSONALIZE_PTN, PROMOTION_CODE, READONLY_TAG, SHORT_LINK, SHORT_LINK_PTN, SHORT_LINK_V2, WARNING_TAG, TAG_TYPE, defaultCssVariables, tagifyDefaultProps, } from './constants';
@@ -561,7 +561,12 @@ const TagifyInput = forwardRef((props, ref) => {
561
561
  * NOTE: Do not actually affect raw data
562
562
  */
563
563
  if (tagTextNode) {
564
- tagTextNode.textContent = tagLabel;
564
+ const isCustomTag = isCustomTagType(type);
565
+ // NOTE: Custom tag type [CUSTOM_TAG] does not need to get label from map attribute
566
+ // It's just get from [tagProperties] instead
567
+ if (!isCustomTag) {
568
+ tagTextNode.textContent = tagLabel;
569
+ }
565
570
  // Clear all previous attributes
566
571
  tagElement.removeAttribute(INVALID_TAG);
567
572
  tagElement.removeAttribute(ERROR_TAG);
@@ -47,6 +47,7 @@ export declare const emojiManufacturer: (text: string, collectionType: EmojiColl
47
47
  export declare const getEmojiTag: ({ src, emoji, code }: EmojiTag) => string;
48
48
  export declare const isPersonalizeTagType: (type: TagType) => boolean;
49
49
  export declare const isShortLinkTagType: (type: TagType) => boolean;
50
+ export declare const isCustomTagType: (type: TagType) => boolean;
50
51
  export declare const generateTagContent: (params: {
51
52
  tagData: TagDataCustomize;
52
53
  content: string;
@@ -1,11 +1,11 @@
1
1
  // Libraries
2
2
  import stringReplaceToArray from 'string-replace-to-array';
3
3
  // Constants
4
- import { CUSTOM_TAG, EMOJI_COLLECTIONS, PREFIX_PATTERN_LINE_MESSAGE, READONLY_TAG, SHORT_LINK_V2, TAG_TYPE, } from './constants';
4
+ import { EMOJI_COLLECTIONS, PREFIX_PATTERN_LINE_MESSAGE, READONLY_TAG, SHORT_LINK_V2, TAG_TYPE, } from './constants';
5
5
  import { iconsViber } from './iconsViber';
6
6
  // Utils
7
7
  import { acceptablePatternChecking, detectURLRegex, getCachedRegex, patternHandlers, tagRegexStringPattern, } from './patternHandlers';
8
- const { CUSTOMER, VISITOR, EVENT, JOURNEY, CAMPAIGN, VARIANT, PROMOTION_CODE, CUSTOM_FN, OBJECT_WIDGET, CONTENT_SOURCE_GROUP, ALLOCATED_CODE, } = TAG_TYPE;
8
+ const { CUSTOMER, VISITOR, EVENT, JOURNEY, CAMPAIGN, VARIANT, PROMOTION_CODE, CUSTOM_FN, OBJECT_WIDGET, CONTENT_SOURCE_GROUP, ALLOCATED_CODE, CUSTOM_TAG, } = TAG_TYPE;
9
9
  /*
10
10
  * Custom error type for JSON parse errors
11
11
  */
@@ -404,6 +404,7 @@ export const isPersonalizeTagType = (type) => [
404
404
  CUSTOM_TAG,
405
405
  ].includes(type);
406
406
  export const isShortLinkTagType = (type) => [SHORT_LINK_V2].includes(type);
407
+ export const isCustomTagType = (type) => type === CUSTOM_TAG;
407
408
  export const generateTagContent = (params) => {
408
409
  const { tagData, content } = params;
409
410
  let dataAttrsString = '';
@@ -3,5 +3,4 @@
3
3
  * Asynchronously loads the component for TemplateListing
4
4
  *
5
5
  */
6
- /// <reference types="react" />
7
6
  export declare const TemplateListing: (props: import("./types").TemplateListingProps<{}>) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.948",
3
+ "version": "1.3.5-beta.949",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",