@integry/sdk 4.6.26 → 4.6.28

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integry/sdk",
3
- "version": "4.6.26",
3
+ "version": "4.6.28",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -515,10 +515,29 @@ const TagList = ({
515
515
  }));
516
516
  };
517
517
 
518
+ const escapeHTMLIfNeeded = (input: any) => {
519
+ if (typeof input !== 'string') {
520
+ return input;
521
+ }
522
+ const isHTML = /<\/?[a-z][\s\S]*>/i.test(input);
523
+
524
+ const output = isHTML
525
+ ? input
526
+ .replace(/&/g, '&amp;')
527
+ .replace(/</g, '&lt;')
528
+ .replace(/>/g, '&gt;')
529
+ .replace(/"/g, '&quot;')
530
+ .replace(/'/g, '&#039;')
531
+ : input;
532
+
533
+ return output.length > 200 ? `${output.slice(0, 200)}...` : output;
534
+ };
535
+
518
536
  const highlightSearchTerm = (text: string, term: string) => {
519
- if (!term) return text;
537
+ const textModified = escapeHTMLIfNeeded(text);
538
+ if (!term) return textModified;
520
539
  const regex = new RegExp(`(${term})`, 'gi');
521
- return text.replace(regex, '<mark>$1</mark>');
540
+ return textModified.replace(regex, '<mark>$1</mark>');
522
541
  };
523
542
 
524
543
  // Update the filterTags function with proper type checking
@@ -718,7 +737,11 @@ const TagList = ({
718
737
  const tagPath = `${activeTab}.${extractStepsFromOutputPath(
719
738
  currentPath,
720
739
  )}`;
721
- onSelect({ currentPath: tagPath, key, value });
740
+ onSelect({
741
+ currentPath: tagPath,
742
+ key,
743
+ value: escapeHTMLIfNeeded(value),
744
+ });
722
745
  }
723
746
  }}
724
747
  class="${styles.listItemContent}"
@@ -1011,45 +1034,21 @@ const TabMenu = ({ data, onSelect, onOptionClick }: TagMenuProps) => {
1011
1034
  if (name.includes('parameter')) {
1012
1035
  return html`
1013
1036
  <svg
1014
- width="18"
1015
- height="18"
1037
+ xmlns="http://www.w3.org/2000/svg"
1038
+ width="20"
1039
+ height="20"
1016
1040
  viewBox="0 0 24 24"
1017
1041
  fill="none"
1018
- xmlns="http://www.w3.org/2000/svg"
1042
+ stroke="currentColor"
1043
+ stroke-width="2"
1044
+ stroke-linecap="round"
1045
+ stroke-linejoin="round"
1046
+ class="lucide lucide-variable"
1019
1047
  >
1020
- <path
1021
- d="M4 6H14"
1022
- stroke="currentColor"
1023
- stroke-width="2"
1024
- stroke-linecap="round"
1025
- />
1026
- <circle cx="18" cy="6" r="2" stroke="currentColor" stroke-width="2" />
1027
- <path
1028
- d="M4 12H10"
1029
- stroke="currentColor"
1030
- stroke-width="2"
1031
- stroke-linecap="round"
1032
- />
1033
- <circle
1034
- cx="14"
1035
- cy="12"
1036
- r="2"
1037
- stroke="currentColor"
1038
- stroke-width="2"
1039
- />
1040
- <path
1041
- d="M4 18H12"
1042
- stroke="currentColor"
1043
- stroke-width="2"
1044
- stroke-linecap="round"
1045
- />
1046
- <circle
1047
- cx="16"
1048
- cy="18"
1049
- r="2"
1050
- stroke="currentColor"
1051
- stroke-width="2"
1052
- />
1048
+ <path d="M8 21s-4-3-4-9 4-9 4-9" />
1049
+ <path d="M16 3s4 3 4 9-4 9-4 9" />
1050
+ <line x1="15" x2="9" y1="9" y2="15" />
1051
+ <line x1="9" x2="15" y1="9" y2="15" />
1053
1052
  </svg>
1054
1053
  `;
1055
1054
  }
@@ -1104,7 +1104,7 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1104
1104
  fieldId: string,
1105
1105
  data: Record<string, { parentFields: string[] | null }>,
1106
1106
  ): boolean => {
1107
- const parentFields = data[fieldId]?.parentFields;
1107
+ const parentFields = data?.[fieldId]?.parentFields;
1108
1108
  return Array.isArray(parentFields) && parentFields.length > 0;
1109
1109
  };
1110
1110