@semcore/core 16.0.0-prerelease.15 → 16.0.0-prerelease.17

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/CHANGELOG.md CHANGED
@@ -9,6 +9,16 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
9
9
  - `utils` functions as part of Core.
10
10
  - `LastInteractionType` class to check last interaction was from keyboard or mouse.
11
11
 
12
+ ### Fixed
13
+
14
+ - Return type for `fincComponent` util. It could be only `ReactElement` or `undefined`.
15
+
16
+ ## [2.39.2] - 2025-04-04
17
+
18
+ ### Changed
19
+
20
+ - Version patch update due to children dependencies update (`@semcore/utils` [4.48.1 ~> 4.48.2]).
21
+
12
22
  ## [2.39.1] - 2025-03-20
13
23
 
14
24
  ### Changed
@@ -1,5 +1,5 @@
1
- import { ReactElement, ReactNode, MutableRefObject } from 'react';
2
- declare function findComponent(Children: any, names: string[], recursively?: boolean, limit?: number): Exclude<ReactNode, boolean | null | undefined> | undefined;
1
+ import { ReactElement, MutableRefObject } from 'react';
2
+ declare function findComponent<P = any>(Children: any, names: string[], recursively?: boolean, limit?: number): ReactElement<P> | undefined;
3
3
  export declare function isAdvanceMode(Children: any, name: string[], recursively?: boolean): boolean;
4
4
  type IntergalacticComponent = ReactElement & {
5
5
  ref?: MutableRefObject<HTMLElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"findComponent.js","names":["_react","_interopRequireDefault","require","_getOriginChildren","_symbols","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","CHILDREN_COMPONENT","getOriginChildren","React","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","INHERITED_NAME","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push","extractFrom","extracted","rest","extractor","_default","exports"],"sources":["../../src/utils/findComponent.ts"],"sourcesContent":["import React, { ReactElement, ReactNode, MutableRefObject } from 'react';\nimport getOriginChildren from './getOriginChildren';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from '../core-types/symbols';\n\nfunction findComponent(\n Children: any,\n names: string[],\n recursively?: boolean,\n limit = 100,\n): Exclude<ReactNode, boolean | null | undefined> | undefined {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n return React.Children.toArray(children).find((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return findComponent(child.props.children, names, recursively, limit);\n }\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const result = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (!result && child.props.children && recursively && limit > 0) {\n return findComponent(child.props.children, names, recursively, limit - 1);\n }\n\n return result;\n }\n });\n}\n\nexport function isAdvanceMode(Children: any, name: string[], recursively?: boolean) {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n if (!children) return false;\n if (typeof children === 'function') {\n return true;\n }\n return !!findComponent(children, name, recursively);\n}\n\ntype IntergalacticComponent = ReactElement & {\n ref?: MutableRefObject<HTMLElement>;\n};\n\nexport function findAllComponents(Children: any, names: string[]): IntergalacticComponent[] {\n const result: IntergalacticComponent[] = [];\n\n const findAllAndAdd = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n findAllAndAdd(child.props.children);\n } else if (\n typeof child.type === 'function' &&\n CHILDREN_COMPONENT in child.type &&\n child.type[CHILDREN_COMPONENT]\n ) {\n findAllAndAdd(child.type);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n result.push(child);\n }\n\n if (child.props.children) {\n return findAllAndAdd(child.props.children);\n }\n }\n }\n });\n };\n\n findAllAndAdd(Children);\n\n return result;\n}\n\n/**\n * Extract some components from Children and return them and rest of components as tuple.\n */\nexport function extractFrom(Children: any, names: string[]): IntergalacticComponent[][] {\n const extracted: IntergalacticComponent[] = [];\n const rest: IntergalacticComponent[] = [];\n\n const extractor = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n extractor(child.props.children);\n } else if (\n typeof child.type === 'function' &&\n CHILDREN_COMPONENT in child.type &&\n child.type[CHILDREN_COMPONENT]\n ) {\n extractor(child.type);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n extracted.push(child);\n } else {\n rest.push(child);\n }\n }\n }\n });\n };\n\n extractor(Children);\n\n return [extracted, rest];\n}\n\nexport default findComponent;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,SAASG,aAAaA,CACpBC,QAAa,EACbC,KAAe,EACfC,WAAqB,EAEuC;EAAA,IAD5DC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EAEX,IAAMG,QAAQ,GAAGP,QAAQ,CAACQ,2BAAkB,CAAC,GAAG,IAAAC,6BAAiB,EAACT,QAAQ,CAAC,GAAGA,QAAQ;EACtF,OAAOU,iBAAK,CAACV,QAAQ,CAACW,OAAO,CAACJ,QAAQ,CAAC,CAACK,IAAI,CAAC,UAACC,KAAK,EAAK;IACtD,kBAAIH,iBAAK,CAACI,cAAc,CAACD,KAAK,CAAC,EAAE;MAC/B,IAAIA,KAAK,CAACE,IAAI,KAAKL,iBAAK,CAACM,QAAQ,EAAE;QACjC,OAAOjB,aAAa,CAACc,KAAK,CAACI,KAAK,CAACV,QAAQ,EAAEN,KAAK,EAAEC,WA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getOriginChildren","_symbols","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","CHILDREN_COMPONENT","getOriginChildren","React","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","INHERITED_NAME","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push","extractFrom","extracted","rest","extractor","_default","exports"],"sources":["../../src/utils/findComponent.ts"],"sourcesContent":["import React, { ReactElement, MutableRefObject } from 'react';\nimport getOriginChildren from './getOriginChildren';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from '../core-types/symbols';\n\nfunction findComponent<P = any>(\n Children: any,\n names: string[],\n recursively?: boolean,\n limit = 100,\n): ReactElement<P> | undefined {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n return React.Children.toArray(children).find((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return findComponent(child.props.children, names, recursively, limit);\n }\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const result = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (!result && child.props.children && recursively && limit > 0) {\n return findComponent(child.props.children, names, recursively, limit - 1);\n }\n\n return result;\n }\n }) as ReactElement<P> | undefined;\n}\n\nexport function isAdvanceMode(Children: any, name: string[], recursively?: boolean) {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n if (!children) return false;\n if (typeof children === 'function') {\n return true;\n }\n return !!findComponent(children, name, recursively);\n}\n\ntype IntergalacticComponent = ReactElement & {\n ref?: MutableRefObject<HTMLElement>;\n};\n\nexport function findAllComponents(Children: any, names: string[]): IntergalacticComponent[] {\n const result: IntergalacticComponent[] = [];\n\n const findAllAndAdd = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n findAllAndAdd(child.props.children);\n } else if (\n typeof child.type === 'function' &&\n CHILDREN_COMPONENT in child.type &&\n child.type[CHILDREN_COMPONENT]\n ) {\n findAllAndAdd(child.type);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n result.push(child);\n }\n\n if (child.props.children) {\n return findAllAndAdd(child.props.children);\n }\n }\n }\n });\n };\n\n findAllAndAdd(Children);\n\n return result;\n}\n\n/**\n * Extract some components from Children and return them and rest of components as tuple.\n */\nexport function extractFrom(Children: any, names: string[]): IntergalacticComponent[][] {\n const extracted: IntergalacticComponent[] = [];\n const rest: IntergalacticComponent[] = [];\n\n const extractor = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n extractor(child.props.children);\n } else if (\n typeof child.type === 'function' &&\n CHILDREN_COMPONENT in child.type &&\n child.type[CHILDREN_COMPONENT]\n ) {\n extractor(child.type);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n extracted.push(child);\n } else {\n rest.push(child);\n }\n }\n }\n });\n };\n\n extractor(Children);\n\n return [extracted, rest];\n}\n\nexport default findComponent;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,SAASG,aAAaA,CACpBC,QAAa,EACbC,KAAe,EACfC,WAAqB,EAEQ;EAAA,IAD7BC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EAEX,IAAMG,QAAQ,GAAGP,QAAQ,CAACQ,2BAAkB,CAAC,GAAG,IAAAC,6BAAiB,EAACT,QAAQ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,CAAChB,KAAK,CAAC;UACvB,CAAC,MAAM;YACLmB,IAAI,CAACH,IAAI,CAAChB,KAAK,CAAC;UAClB;QACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC;EAEDoB,SAAS,CAACjC,QAAQ,CAAC;EAEnB,OAAO,CAAC+B,SAAS,EAAEC,IAAI,CAAC;AAC1B;AAAC,IAAAE,QAAA,GAEcnC,aAAa;AAAAoC,OAAA,cAAAD,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"findComponent.mjs","names":["React","getOriginChildren","CHILDREN_COMPONENT","INHERITED_NAME","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push","extractFrom","extracted","rest","extractor"],"sources":["../../src/utils/findComponent.ts"],"sourcesContent":["import React, { ReactElement, ReactNode, MutableRefObject } from 'react';\nimport getOriginChildren from './getOriginChildren';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from '../core-types/symbols';\n\nfunction findComponent(\n Children: any,\n names: string[],\n recursively?: boolean,\n limit = 100,\n): Exclude<ReactNode, boolean | null | undefined> | undefined {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n return React.Children.toArray(children).find((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return findComponent(child.props.children, names, recursively, limit);\n }\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const result = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (!result && child.props.children && recursively && limit > 0) {\n return findComponent(child.props.children, names, recursively, limit - 1);\n }\n\n return result;\n }\n });\n}\n\nexport function isAdvanceMode(Children: any, name: string[], recursively?: boolean) {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n if (!children) return false;\n if (typeof children === 'function') {\n return true;\n }\n return !!findComponent(children, name, recursively);\n}\n\ntype IntergalacticComponent = ReactElement & {\n ref?: MutableRefObject<HTMLElement>;\n};\n\nexport function findAllComponents(Children: any, names: string[]): IntergalacticComponent[] {\n const result: IntergalacticComponent[] = [];\n\n const findAllAndAdd = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n findAllAndAdd(child.props.children);\n } else if (\n typeof child.type === 'function' &&\n CHILDREN_COMPONENT in child.type &&\n child.type[CHILDREN_COMPONENT]\n ) {\n findAllAndAdd(child.type);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n result.push(child);\n }\n\n if (child.props.children) {\n return findAllAndAdd(child.props.children);\n }\n }\n }\n });\n };\n\n findAllAndAdd(Children);\n\n return result;\n}\n\n/**\n * Extract some components from Children and return them and rest of components as tuple.\n */\nexport function extractFrom(Children: any, names: string[]): IntergalacticComponent[][] {\n const extracted: IntergalacticComponent[] = [];\n const rest: IntergalacticComponent[] = [];\n\n const extractor = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n extractor(child.props.children);\n } else if (\n typeof child.type === 'function' &&\n CHILDREN_COMPONENT in child.type &&\n child.type[CHILDREN_COMPONENT]\n ) {\n extractor(child.type);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n extracted.push(child);\n } else {\n rest.push(child);\n }\n }\n }\n });\n };\n\n extractor(Children);\n\n return [extracted, rest];\n}\n\nexport default findComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqD,OAAO;AACxE,OAAOC,iBAAiB,MAAM,yBAAqB;AACnD,SAASC,kBAAkB,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E,IAAI,CAACd,cAAc,CAAC,IAAI,CAACY,KAAK,CAACE,IAAI,CAACI,WAAW,CAAC;UAC7E,IAAMQ,SAAS,GAAG,CAAC,CAACT,cAAc,CAACN,IAAI,CAAC,UAACS,IAAY;YAAA,OAAKjB,KAAK,CAACkB,QAAQ,CAACD,IAAI,CAAC;UAAA,EAAC;UAE/E,IAAIM,SAAS,EAAE;YACbG,SAAS,CAACF,IAAI,CAACf,KAAK,CAAC;UACvB,CAAC,MAAM;YACLkB,IAAI,CAACH,IAAI,CAACf,KAAK,CAAC;UAClB;QACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC;EAEDmB,SAAS,CAAC7B,QAAQ,CAAC;EAEnB,OAAO,CAAC2B,SAAS,EAAEC,IAAI,CAAC;AAC1B;AAEA,eAAe7B,aAAa"}
1
+ {"version":3,"file":"findComponent.mjs","names":["React","getOriginChildren","CHILDREN_COMPONENT","INHERITED_NAME","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push","extractFrom","extracted","rest","extractor"],"sources":["../../src/utils/findComponent.ts"],"sourcesContent":["import React, { ReactElement, MutableRefObject } from 'react';\nimport getOriginChildren from './getOriginChildren';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from '../core-types/symbols';\n\nfunction findComponent<P = any>(\n Children: any,\n names: string[],\n recursively?: boolean,\n limit = 100,\n): ReactElement<P> | undefined {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n return React.Children.toArray(children).find((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return findComponent(child.props.children, names, recursively, limit);\n }\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const result = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (!result && child.props.children && recursively && limit > 0) {\n return findComponent(child.props.children, names, recursively, limit - 1);\n }\n\n return result;\n }\n }) as ReactElement<P> | undefined;\n}\n\nexport function isAdvanceMode(Children: any, name: string[], recursively?: boolean) {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n if (!children) return false;\n if (typeof children === 'function') {\n return true;\n }\n return !!findComponent(children, name, recursively);\n}\n\ntype IntergalacticComponent = ReactElement & {\n ref?: MutableRefObject<HTMLElement>;\n};\n\nexport function findAllComponents(Children: any, names: string[]): IntergalacticComponent[] {\n const result: IntergalacticComponent[] = [];\n\n const findAllAndAdd = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n findAllAndAdd(child.props.children);\n } else if (\n typeof child.type === 'function' &&\n CHILDREN_COMPONENT in child.type &&\n child.type[CHILDREN_COMPONENT]\n ) {\n findAllAndAdd(child.type);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n result.push(child);\n }\n\n if (child.props.children) {\n return findAllAndAdd(child.props.children);\n }\n }\n }\n });\n };\n\n findAllAndAdd(Children);\n\n return result;\n}\n\n/**\n * Extract some components from Children and return them and rest of components as tuple.\n */\nexport function extractFrom(Children: any, names: string[]): IntergalacticComponent[][] {\n const extracted: IntergalacticComponent[] = [];\n const rest: IntergalacticComponent[] = [];\n\n const extractor = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n extractor(child.props.children);\n } else if (\n typeof child.type === 'function' &&\n CHILDREN_COMPONENT in child.type &&\n child.type[CHILDREN_COMPONENT]\n ) {\n extractor(child.type);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n extracted.push(child);\n } else {\n rest.push(child);\n }\n }\n }\n });\n };\n\n extractor(Children);\n\n return [extracted, rest];\n}\n\nexport default findComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA0C,OAAO;AAC7D,OAAOC,iBAAiB,MAAM,yBAAqB;AACnD,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,2BAAuB;AAE1E,SAASC,aAAaA,CACpBC,QAAa,EACbC,KAAe,EACfC,WAAqB,EAEQ;EAAA,IAD7BC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EAEX,IAAMG,QAAQ,GAAGP,QAAQ,CAACH,kBAAkB,CAAC,GAAGD,iBAAiB,CAACI,QAAQ,CAAC,GAAGA,QAAQ;EACtF,OAAOL,KAAK,CAACK,QAAQ,CAACQ,OAAO,CAACD,QAAQ,CAAC,CAACE,IAAI,CAAC,UAACC,KAAK,EAAK;IACtD,kBAAIf,KAAK,CAACgB,cAAc,CAACD,KAAK,CAAC,EAAE;MAC/B,IAAIA,KAAK,CAACE,IAAI,KAAKjB,KAAK,CAACkB,QAAQ,EAAE;QACjC,OAAOd,aAAa,CAACW,KAAK,CAACI,KAAK,CAACP,QAAQ,EAAEN,KAAK,EAAEC,WAAW,EAAEC,KAAK,CAAC;MACvE;MACA;MACA,IAAMY,cAAc,GAAGL,KAAK,CAACE,IAAI,CAACd,cAAc,CAAC,IAAI,CAACY,KAAK,CAACE,IAAI,CAACI,WAAW,CAAC;MAC7E,IAAMC,MAAM,GAAG,CAAC,CAACF,cAAc,CAACN,IAAI,CAAC,UAACS,IAAY;QAAA,OAAKjB,KAAK,CAACkB,QAAQ,CAACD,IAAI,CAAC;MAAA,EAAC;MAE5E,IAAI,CAACD,MAAM,IAAIP,KAAK,CAACI,KAAK,CAACP,QAAQ,IAAIL,WAAW,IAAIC,KAAK,GAAG,CAAC,EAAE;QAC/D,OAAOJ,aAAa,CAAC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AI,KAAK,UAAU,IAChCf,kBAAkB,IAAIa,KAAK,CAACE,IAAI,IAChCF,KAAK,CAACE,IAAI,CAACf,kBAAkB,CAAC,EAC9B;UACAgC,SAAS,CAACnB,KAAK,CAACE,IAAI,CAAC;QACvB,CAAC,MAAM;UACL;UACA,IAAMG,cAAc,GAAGL,KAAK,CAACE,IAAI,CAACd,cAAc,CAAC,IAAI,CAACY,KAAK,CAACE,IAAI,CAACI,WAAW,CAAC;UAC7E,IAAMQ,SAAS,GAAG,CAAC,CAACT,cAAc,CAACN,IAAI,CAAC,UAACS,IAAY;YAAA,OAAKjB,KAAK,CAACkB,QAAQ,CAACD,IAAI,CAAC;UAAA,EAAC;UAE/E,IAAIM,SAAS,EAAE;YACbG,SAAS,CAACF,IAAI,CAACf,KAAK,CAAC;UACvB,CAAC,MAAM;YACLkB,IAAI,CAACH,IAAI,CAACf,KAAK,CAAC;UAClB;QACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC;EAEDmB,SAAS,CAAC7B,QAAQ,CAAC;EAEnB,OAAO,CAAC2B,SAAS,EAAEC,IAAI,CAAC;AAC1B;AAEA,eAAe7B,aAAa"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/core",
3
3
  "description": "Semrush Core Component",
4
- "version": "16.0.0-prerelease.15",
4
+ "version": "16.0.0-prerelease.17",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
7
7
  "typings": "lib/index.d.ts",
@@ -18,19 +18,19 @@
18
18
  "import": "./src/index.ts",
19
19
  "types": "./src/index.ts"
20
20
  },
21
- "./lib/themes/default.css": {
21
+ "./lib/theme/themes/default.css": {
22
22
  "require": "./lib/theme/themes/default.css",
23
23
  "import": "./lib/theme/themes/default.css"
24
24
  },
25
- "./lib/themes/light.css": {
25
+ "./lib/theme/themes/light.css": {
26
26
  "require": "./lib/theme/themes/light.css",
27
27
  "import": "./lib/theme/themes/light.css"
28
28
  },
29
- "./lib/themes/dark.css": {
29
+ "./lib/theme/themes/dark.css": {
30
30
  "require": "./lib/theme/themes/dark.css",
31
31
  "import": "./lib/theme/themes/dark.css"
32
32
  },
33
- "./lib/themes/auto.css": {
33
+ "./lib/theme/themes/auto.css": {
34
34
  "require": "./lib/theme/themes/auto.css",
35
35
  "import": "./lib/theme/themes/auto.css"
36
36
  },
@@ -44,6 +44,11 @@
44
44
  "import": "./lib/utils/focus-lock/isFocusable.mjs",
45
45
  "types": "./lib/utils/focus-lock/isFocusable.d.ts"
46
46
  },
47
+ "./lib/utils/focus-lock/isFocusInside": {
48
+ "require": "./lib/utils/focus-lock/isFocusInside.js",
49
+ "import": "./lib/utils/focus-lock/isFocusInside.mjs",
50
+ "types": "./lib/utils/focus-lock/isFocusInside.d.ts"
51
+ },
47
52
  "./lib/utils/enhances/a11yEnhance": {
48
53
  "require": "./lib/utils/enhances/a11yEnhance.js",
49
54
  "import": "./lib/utils/enhances/a11yEnhance.mjs",
@@ -164,6 +169,11 @@
164
169
  "import": "./lib/utils/getAccessibleName.mjs",
165
170
  "types": "./lib/utils/getAccessibleName.d.ts"
166
171
  },
172
+ "./lib/utils/getDisplayName": {
173
+ "require": "./lib/utils/getDisplayName.js",
174
+ "import": "./lib/utils/getDisplayName.mjs",
175
+ "types": "./lib/utils/getDisplayName.d.ts"
176
+ },
167
177
  "./lib/utils/getEventTarget": {
168
178
  "require": "./lib/utils/getEventTarget.js",
169
179
  "import": "./lib/utils/getEventTarget.mjs",
@@ -234,6 +244,11 @@
234
244
  "import": "./lib/utils/ref.mjs",
235
245
  "types": "./lib/utils/ref.d.ts"
236
246
  },
247
+ "./lib/utils/setRef": {
248
+ "require": "./lib/utils/setRef.js",
249
+ "import": "./lib/utils/setRef.mjs",
250
+ "types": "./lib/utils/setRef.d.ts"
251
+ },
237
252
  "./lib/utils/ScreenReaderOnly": {
238
253
  "require": "./lib/utils/ScreenReaderOnly.js",
239
254
  "import": "./lib/utils/ScreenReaderOnly.mjs",