@griddo/ax 11.14.1 → 11.14.2-rc.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/ax",
3
3
  "description": "Griddo Author Experience",
4
- "version": "11.14.1",
4
+ "version": "11.14.2-rc.0",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -217,5 +217,5 @@
217
217
  "publishConfig": {
218
218
  "access": "public"
219
219
  },
220
- "gitHead": "e5aea08976bf7de8fa5c0732992813d09401efd2"
220
+ "gitHead": "b93ad3eedf58a5187667f87764045b815c87cc68"
221
221
  }
@@ -71,7 +71,8 @@ describe("KeywordsPreviewModal component rendering", () => {
71
71
  renderComponent({ ...defaultProps, isOpen: true, keywordsFilter: ["seo"] });
72
72
 
73
73
  expect(screen.getByText("Show keyword:")).toBeTruthy();
74
- expect(screen.getByText("seo")).toBeTruthy();
74
+ const seoElements = screen.getAllByText("seo");
75
+ expect(seoElements.length).toBeGreaterThan(0);
75
76
  });
76
77
 
77
78
  it("should not render the filter section when keywordsFilter is empty", () => {
@@ -87,8 +88,8 @@ describe("KeywordsPreviewModal component events", () => {
87
88
 
88
89
  renderComponent({ ...defaultProps, isOpen: true, toggleModal: toggleModalMock });
89
90
 
90
- const closeButton = screen.getByTestId("icon-action-component");
91
- fireEvent.click(closeButton);
91
+ const closeButtons = screen.getAllByTestId("icon-action-component");
92
+ fireEvent.click(closeButtons[0]);
92
93
  expect(toggleModalMock).toBeCalled();
93
94
  });
94
95
 
@@ -1,7 +1,7 @@
1
1
  import { useState } from "react";
2
2
 
3
+ import { FieldsBehavior, Modal } from "@ax/components";
3
4
  import type { IModal } from "@ax/types";
4
- import { Modal, FieldsBehavior } from "@ax/components";
5
5
 
6
6
  import * as S from "./style";
7
7
 
@@ -39,7 +39,7 @@ const AddKeywordsModal = (props: IAddKeywordsModal) => {
39
39
  secondaryAction={secondaryModalAction}
40
40
  mainAction={mainModalAction}
41
41
  size="S"
42
- height={282}
42
+ height={288}
43
43
  >
44
44
  <S.ModalContent>
45
45
  <FieldsBehavior
@@ -69,16 +69,16 @@ const KeywordsPreviewModal = (props: IKeywordsPreviewProps) => {
69
69
  )}
70
70
  <S.KeywordsListWrapper>
71
71
  {keywords.length === 0 && <S.StyledSummaryButton />}
72
- {Object.keys(keywordCounts).map((key, index) => {
73
- const isSelected = keywordsFilter.includes(key);
72
+ {keywords.map((keyword, index) => {
73
+ const isSelected = keywordsFilter.includes(keyword);
74
74
  return (
75
75
  <KeywordItem
76
- keyword={key}
77
- count={keywordCounts[key]}
76
+ keyword={keyword}
77
+ count={keywordCounts[keyword] ?? 0}
78
78
  isSelected={isSelected}
79
- onClick={handleAddTag(key)}
79
+ onClick={handleAddTag(keyword)}
80
80
  deleteKeyword={handleDeleteKeyword}
81
- key={`${key}-${index}`}
81
+ key={`${keyword}-${index}`}
82
82
  />
83
83
  );
84
84
  })}
@@ -6,11 +6,11 @@ const countKeywords = (html: HTMLDivElement, keywords: string[]) => {
6
6
  return {};
7
7
  }
8
8
 
9
- const htmlContent = frameContent.innerText.toLowerCase();
9
+ const htmlContent = frameContent.innerText.toLowerCase().normalize("NFC");
10
10
  const keywordCounts: Record<string, number> = {};
11
11
 
12
12
  keywords.forEach((keyword) => {
13
- const lowerKeyword = keyword.toLowerCase();
13
+ const lowerKeyword = keyword.toLowerCase().normalize("NFC");
14
14
  const regex = new RegExp(lowerKeyword.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gi");
15
15
  const matches = htmlContent.match(regex);
16
16
  keywordCounts[keyword] = matches ? matches.length : 0;