@dialpad/dialtone-vue 3.12.0 → 3.16.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.
@@ -714,7 +714,8 @@ function shortcodeToEmojiData(shortcode) {
714
714
  return reference;
715
715
  } // Takes in an emoji unicode character(s) and converts it to an emoji string in the format the emoji data object expects
716
716
  // as a key. There can be multiple unicode characters in an emoji to denote the emoji itself, skin tone, gender
717
- // and such.
717
+ // and such. Note that this function does NOT return variation selectors (fe0f) or zero width joiners (200d), as these
718
+ // are not included as part of the key in the emoji.json.
718
719
  //
719
720
  // Example:
720
721
  // return value for smile emoji (no skin tone): 1f600
@@ -724,6 +725,10 @@ function unicodeToString(emoji) {
724
725
  let key = '';
725
726
 
726
727
  for (const codePoint of emoji) {
728
+ const codepoint = codePoint.codePointAt(0).toString(16); // skip 200d and fe0f as these are not included in emoji_strategy.json keys
729
+
730
+ if (['200d', 'fe0f'].includes(codepoint)) continue;
731
+
727
732
  if (key !== '') {
728
733
  key = key + '-';
729
734
  }
@@ -775,7 +780,7 @@ function findEmojis(textContent) {
775
780
  }
776
781
  ;// CONCATENATED MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
777
782
  const external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject = require("vue");
778
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/emoji/emoji.vue?vue&type=template&id=263332ba
783
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/emoji/emoji.vue?vue&type=template&id=334ba6aa
779
784
 
780
785
  const _hoisted_1 = ["aria-label", "alt", "title", "src"];
781
786
  function render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -791,7 +796,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
791
796
  contentClass: $options.skeletonSizeClass,
792
797
  size: 'auto'
793
798
  }
794
- }, null, 8, ["class", "shape-option"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.vShow, $data.imgLoading]]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withDirectives)((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("img", {
799
+ }, null, 8, ["class", "shape-option"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.vShow, $data.imgLoading && $props.showSkeleton]]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withDirectives)((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("img", {
795
800
  ref: "emojiImg",
796
801
  class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.normalizeClass)([$props.size, $props.imgClass]),
797
802
  "aria-label": $options.emojiLabel,
@@ -806,7 +811,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
806
811
  })
807
812
  }, null, 42, _hoisted_1), [[external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.vShow, !$data.imgLoading]])], 2);
808
813
  }
809
- ;// CONCATENATED MODULE: ./components/emoji/emoji.vue?vue&type=template&id=263332ba
814
+ ;// CONCATENATED MODULE: ./components/emoji/emoji.vue?vue&type=template&id=334ba6aa
810
815
 
811
816
  ;// CONCATENATED MODULE: ./components/emoji/emoji_constants.js
812
817
  const EMOJI_SIZES = {
@@ -937,8 +942,8 @@ const SKELETON_HEADING_HEIGHTS = {
937
942
 
938
943
  const animationDelay = this.skeletonOffset * SKELETON_RIPPLE_DURATION / 1000;
939
944
  const animationDuration = this.animationDuration === -1 ? 1000 : this.animationDuration;
940
- style.animationDelay = "".concat(animationDelay, "ms");
941
- style.animationDuration = "".concat(animationDuration, "ms");
945
+ style.animationDelay = `${animationDelay}ms`;
946
+ style.animationDuration = `${animationDuration}ms`;
942
947
  return style;
943
948
  }
944
949
 
@@ -1218,7 +1223,7 @@ const validator = number => number !== '' && !Number.isNaN(Number(number));
1218
1223
  randomWidthPercentage() {
1219
1224
  const min = Math.min(this.minWidth, this.maxWidth);
1220
1225
  const max = Math.max(this.minWidth, this.maxWidth);
1221
- return "".concat(Math.round(Math.random() * (max - min)) + min, "%");
1226
+ return `${Math.round(Math.random() * (max - min)) + min}%`;
1222
1227
  },
1223
1228
 
1224
1229
  getSizeParagraphRow(row) {
@@ -1387,10 +1392,10 @@ const skeleton_list_item_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)
1387
1392
  });
1388
1393
 
1389
1394
  if (filtered.length >= 2) {
1390
- const errorMessage = "Use only one of ".concat(filtered.map(_ref2 => {
1395
+ const errorMessage = `Use only one of ${filtered.map(_ref2 => {
1391
1396
  let [key] = _ref2;
1392
1397
  return key;
1393
- }).join(' | '), " options at the same time");
1398
+ }).join(' | ')} options at the same time`;
1394
1399
  console.error(errorMessage);
1395
1400
  }
1396
1401
  }
@@ -1470,6 +1475,14 @@ const skeleton_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(skeletonv
1470
1475
  ariaLabel: {
1471
1476
  type: String,
1472
1477
  default: null
1478
+ },
1479
+
1480
+ /**
1481
+ * Shows a skeleton loader while the emoji asset is loading.
1482
+ */
1483
+ showSkeleton: {
1484
+ type: Boolean,
1485
+ default: true
1473
1486
  }
1474
1487
  },
1475
1488
 
@@ -1603,7 +1616,7 @@ const emoji_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(emojivue_typ
1603
1616
  * @returns {Array<VNode|string>}
1604
1617
  */
1605
1618
  replaceDtEmojis(replaceList, textContent) {
1606
- const regexp = new RegExp("(".concat(replaceList.join('|'), ")"), 'g');
1619
+ const regexp = new RegExp(`(${replaceList.join('|')})`, 'g');
1607
1620
  const split = textContent.split(regexp);
1608
1621
  return split.map(item => {
1609
1622
  if (replaceList.includes(item)) {
package/dist/emoji.umd.js CHANGED
@@ -732,7 +732,8 @@ function shortcodeToEmojiData(shortcode) {
732
732
  return reference;
733
733
  } // Takes in an emoji unicode character(s) and converts it to an emoji string in the format the emoji data object expects
734
734
  // as a key. There can be multiple unicode characters in an emoji to denote the emoji itself, skin tone, gender
735
- // and such.
735
+ // and such. Note that this function does NOT return variation selectors (fe0f) or zero width joiners (200d), as these
736
+ // are not included as part of the key in the emoji.json.
736
737
  //
737
738
  // Example:
738
739
  // return value for smile emoji (no skin tone): 1f600
@@ -742,6 +743,10 @@ function unicodeToString(emoji) {
742
743
  let key = '';
743
744
 
744
745
  for (const codePoint of emoji) {
746
+ const codepoint = codePoint.codePointAt(0).toString(16); // skip 200d and fe0f as these are not included in emoji_strategy.json keys
747
+
748
+ if (['200d', 'fe0f'].includes(codepoint)) continue;
749
+
745
750
  if (key !== '') {
746
751
  key = key + '-';
747
752
  }
@@ -793,7 +798,7 @@ function findEmojis(textContent) {
793
798
  }
794
799
  // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
795
800
  var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(203);
796
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/emoji/emoji.vue?vue&type=template&id=263332ba
801
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/emoji/emoji.vue?vue&type=template&id=334ba6aa
797
802
 
798
803
  const _hoisted_1 = ["aria-label", "alt", "title", "src"];
799
804
  function render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -809,7 +814,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
809
814
  contentClass: $options.skeletonSizeClass,
810
815
  size: 'auto'
811
816
  }
812
- }, null, 8, ["class", "shape-option"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_.vShow, $data.imgLoading]]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withDirectives)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("img", {
817
+ }, null, 8, ["class", "shape-option"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_.vShow, $data.imgLoading && $props.showSkeleton]]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withDirectives)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("img", {
813
818
  ref: "emojiImg",
814
819
  class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeClass)([$props.size, $props.imgClass]),
815
820
  "aria-label": $options.emojiLabel,
@@ -824,7 +829,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
824
829
  })
825
830
  }, null, 42, _hoisted_1), [[external_commonjs_vue_commonjs2_vue_root_Vue_.vShow, !$data.imgLoading]])], 2);
826
831
  }
827
- ;// CONCATENATED MODULE: ./components/emoji/emoji.vue?vue&type=template&id=263332ba
832
+ ;// CONCATENATED MODULE: ./components/emoji/emoji.vue?vue&type=template&id=334ba6aa
828
833
 
829
834
  ;// CONCATENATED MODULE: ./components/emoji/emoji_constants.js
830
835
  const EMOJI_SIZES = {
@@ -955,8 +960,8 @@ const SKELETON_HEADING_HEIGHTS = {
955
960
 
956
961
  const animationDelay = this.skeletonOffset * SKELETON_RIPPLE_DURATION / 1000;
957
962
  const animationDuration = this.animationDuration === -1 ? 1000 : this.animationDuration;
958
- style.animationDelay = "".concat(animationDelay, "ms");
959
- style.animationDuration = "".concat(animationDuration, "ms");
963
+ style.animationDelay = `${animationDelay}ms`;
964
+ style.animationDuration = `${animationDuration}ms`;
960
965
  return style;
961
966
  }
962
967
 
@@ -1236,7 +1241,7 @@ const validator = number => number !== '' && !Number.isNaN(Number(number));
1236
1241
  randomWidthPercentage() {
1237
1242
  const min = Math.min(this.minWidth, this.maxWidth);
1238
1243
  const max = Math.max(this.minWidth, this.maxWidth);
1239
- return "".concat(Math.round(Math.random() * (max - min)) + min, "%");
1244
+ return `${Math.round(Math.random() * (max - min)) + min}%`;
1240
1245
  },
1241
1246
 
1242
1247
  getSizeParagraphRow(row) {
@@ -1405,10 +1410,10 @@ const skeleton_list_item_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)
1405
1410
  });
1406
1411
 
1407
1412
  if (filtered.length >= 2) {
1408
- const errorMessage = "Use only one of ".concat(filtered.map(_ref2 => {
1413
+ const errorMessage = `Use only one of ${filtered.map(_ref2 => {
1409
1414
  let [key] = _ref2;
1410
1415
  return key;
1411
- }).join(' | '), " options at the same time");
1416
+ }).join(' | ')} options at the same time`;
1412
1417
  console.error(errorMessage);
1413
1418
  }
1414
1419
  }
@@ -1488,6 +1493,14 @@ const skeleton_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(skeletonv
1488
1493
  ariaLabel: {
1489
1494
  type: String,
1490
1495
  default: null
1496
+ },
1497
+
1498
+ /**
1499
+ * Shows a skeleton loader while the emoji asset is loading.
1500
+ */
1501
+ showSkeleton: {
1502
+ type: Boolean,
1503
+ default: true
1491
1504
  }
1492
1505
  },
1493
1506
 
@@ -1621,7 +1634,7 @@ const emoji_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(emojivue_typ
1621
1634
  * @returns {Array<VNode|string>}
1622
1635
  */
1623
1636
  replaceDtEmojis(replaceList, textContent) {
1624
- const regexp = new RegExp("(".concat(replaceList.join('|'), ")"), 'g');
1637
+ const regexp = new RegExp(`(${replaceList.join('|')})`, 'g');
1625
1638
  const split = textContent.split(regexp);
1626
1639
  return split.map(item => {
1627
1640
  if (replaceList.includes(item)) {