@constructor-io/constructorio-ui-autocomplete 1.18.1 → 1.19.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/README.md +2 -2
- package/dist/constructorio-ui-autocomplete-bundled.js +12 -12
- package/lib/cjs/components/Autocomplete/AutocompleteResults/AutocompleteResults.js +20 -1
- package/lib/cjs/components/Autocomplete/SectionItemsList/SectionItemsList.js +19 -2
- package/lib/cjs/constants.js +11 -5
- package/lib/cjs/hooks/useCioAutocomplete.js +58 -7
- package/lib/cjs/hooks/useDebouncedFetchSections.js +8 -6
- package/lib/cjs/hooks/useFetchRecommendationPod.js +3 -3
- package/lib/cjs/hooks/useRecommendationsObserver.js +2 -1
- package/lib/cjs/hooks/useSections.js +3 -2
- package/lib/cjs/typeGuards.js +10 -2
- package/lib/cjs/utils.js +24 -12
- package/lib/cjs/version.js +1 -1
- package/lib/mjs/components/Autocomplete/AutocompleteResults/AutocompleteResults.js +20 -1
- package/lib/mjs/components/Autocomplete/SectionItemsList/SectionItemsList.js +19 -2
- package/lib/mjs/constants.js +11 -5
- package/lib/mjs/hooks/useCioAutocomplete.js +59 -8
- package/lib/mjs/hooks/useDebouncedFetchSections.js +8 -6
- package/lib/mjs/hooks/useFetchRecommendationPod.js +5 -2
- package/lib/mjs/hooks/useRecommendationsObserver.js +2 -1
- package/lib/mjs/hooks/useSections.js +3 -2
- package/lib/mjs/typeGuards.js +7 -1
- package/lib/mjs/utils.js +23 -12
- package/lib/mjs/version.js +1 -1
- package/lib/types/constants.d.ts +2 -2
- package/lib/types/hooks/useDebouncedFetchSections.d.ts +2 -2
- package/lib/types/hooks/useFetchRecommendationPod.d.ts +2 -2
- package/lib/types/hooks/useSections.d.ts +1 -1
- package/lib/types/typeGuards.d.ts +3 -1
- package/lib/types/types.d.ts +21 -9
- package/lib/types/utils.d.ts +3 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,10 @@ const useFetchRecommendationPod = (cioClient, recommendationPods) => {
|
|
|
5
5
|
if (!cioClient || !Array.isArray(recommendationPods) || recommendationPods.length === 0)
|
|
6
6
|
return;
|
|
7
7
|
const fetchRecommendationResults = async () => {
|
|
8
|
-
const responses = await Promise.all(recommendationPods.map(({
|
|
8
|
+
const responses = await Promise.all(recommendationPods.map(({ podId, indexSectionName, ...parameters }) => cioClient.recommendations.getRecommendations(podId, {
|
|
9
|
+
...parameters,
|
|
10
|
+
section: indexSectionName,
|
|
11
|
+
})));
|
|
9
12
|
const recommendationPodResults = {};
|
|
10
13
|
responses.forEach(({ response }, index) => {
|
|
11
14
|
const { pod, results } = response;
|
|
@@ -13,7 +16,7 @@ const useFetchRecommendationPod = (cioClient, recommendationPods) => {
|
|
|
13
16
|
recommendationPodResults[pod.id] = results?.map((item) => ({
|
|
14
17
|
...item,
|
|
15
18
|
id: item?.data?.id,
|
|
16
|
-
section: recommendationPods[index]?.
|
|
19
|
+
section: recommendationPods[index]?.indexSectionName,
|
|
17
20
|
podId: pod.id,
|
|
18
21
|
}));
|
|
19
22
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
+
import { isRecommendationsSection } from '../typeGuards';
|
|
2
3
|
/**
|
|
3
4
|
* Custom hook that observes the visibility of recommendation sections and calls trackRecommendationView event.
|
|
4
5
|
* This is done by using the IntersectionObserver API to observe the visibility of each recommendation section.
|
|
@@ -14,7 +15,7 @@ import { useEffect } from 'react';
|
|
|
14
15
|
function useRecommendationsObserver(menuIsOpen, sections, constructorIO, trackRecommendationView) {
|
|
15
16
|
// Get refs for each section
|
|
16
17
|
const refs = sections
|
|
17
|
-
.filter((section) => section
|
|
18
|
+
.filter((section) => isRecommendationsSection(section))
|
|
18
19
|
.map((section) => section.ref);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const intersectionObserverOptions = {
|
|
@@ -3,14 +3,15 @@ import { createRef, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
3
3
|
import { getActiveSectionsWithData } from '../utils';
|
|
4
4
|
import useDebouncedFetchSection from './useDebouncedFetchSections';
|
|
5
5
|
import useFetchRecommendationPod from './useFetchRecommendationPod';
|
|
6
|
+
import { isAutocompleteSection, isRecommendationsSection } from '../typeGuards';
|
|
6
7
|
export default function useSections(query, cioClient, sections, zeroStateSections, advancedParameters) {
|
|
7
8
|
const zeroStateActiveSections = !query.length && zeroStateSections;
|
|
8
9
|
// Define All Sections
|
|
9
10
|
const activeSections = zeroStateActiveSections ? zeroStateSections : sections;
|
|
10
11
|
const sectionsRefs = useRef(activeSections.map(() => createRef()));
|
|
11
12
|
const [activeSectionsWithData, setActiveSectionsWithData] = useState([]);
|
|
12
|
-
const autocompleteSections = useMemo(() => activeSections?.filter((config) => config
|
|
13
|
-
const recommendationsSections = useMemo(() => activeSections?.filter((config) => config
|
|
13
|
+
const autocompleteSections = useMemo(() => activeSections?.filter((config) => isAutocompleteSection(config)), [activeSections]);
|
|
14
|
+
const recommendationsSections = useMemo(() => activeSections?.filter((config) => isRecommendationsSection(config)), [activeSections]);
|
|
14
15
|
// Fetch Autocomplete Results
|
|
15
16
|
const { sectionsData: autocompleteResults, request } = useDebouncedFetchSection(query, cioClient, autocompleteSections, advancedParameters);
|
|
16
17
|
// Fetch Recommendations Results
|
package/lib/mjs/typeGuards.js
CHANGED
|
@@ -8,5 +8,11 @@ export function isInGroupSuggestion(item) {
|
|
|
8
8
|
return item.groupName !== undefined;
|
|
9
9
|
}
|
|
10
10
|
export function isCustomSection(config) {
|
|
11
|
-
return config.
|
|
11
|
+
return config.type === 'custom';
|
|
12
|
+
}
|
|
13
|
+
export function isAutocompleteSection(config) {
|
|
14
|
+
return config.type === 'autocomplete' || !config.type;
|
|
15
|
+
}
|
|
16
|
+
export function isRecommendationsSection(config) {
|
|
17
|
+
return config.type === 'recommendations';
|
|
12
18
|
}
|
package/lib/mjs/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ConstructorIOClient from '@constructor-io/constructorio-client-javascript';
|
|
2
|
-
import {
|
|
2
|
+
import { isRecommendationsSection } from './typeGuards';
|
|
3
3
|
import version from './version';
|
|
4
4
|
export function getSearchSuggestionFeatures(request) {
|
|
5
5
|
let featureDisplaySearchSuggestionImages = false;
|
|
@@ -35,6 +35,11 @@ export const camelToStartCase = (camelCaseString) => camelCaseString
|
|
|
35
35
|
.replace(/([A-Z])/g, ' $1')
|
|
36
36
|
// uppercase the first character
|
|
37
37
|
.replace(/^./, (str) => str.toUpperCase());
|
|
38
|
+
export const toKebabCase = (str) => str
|
|
39
|
+
.replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')
|
|
40
|
+
.replace(/([a-z])([A-Z])/g, '$1-$2')
|
|
41
|
+
.replace(/[\s_]+/g, '-')
|
|
42
|
+
.toLowerCase();
|
|
38
43
|
export function isTrackingRequestSent(trackingRequestUrl) {
|
|
39
44
|
// eslint-disable-next-line
|
|
40
45
|
const trackingRequestsQueue = window.localStorage?._constructorio_requests;
|
|
@@ -110,17 +115,22 @@ export const getCioClient = (apiKey, cioJsClientOptions) => {
|
|
|
110
115
|
export const getActiveSectionsWithData = (activeSections, sectionResults, sectionsRefs) => {
|
|
111
116
|
const activeSectionsWithData = [];
|
|
112
117
|
activeSections?.forEach((sectionConfig, index) => {
|
|
113
|
-
const {
|
|
118
|
+
const { type } = sectionConfig;
|
|
114
119
|
let sectionData;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
switch (type) {
|
|
121
|
+
case 'recommendations':
|
|
122
|
+
sectionData = sectionResults[sectionConfig.podId];
|
|
123
|
+
break;
|
|
124
|
+
case 'custom':
|
|
125
|
+
// Copy id from data to the top level
|
|
126
|
+
sectionData = sectionConfig.data.map((item) => ({
|
|
127
|
+
...item,
|
|
128
|
+
id: item?.id || item?.data?.id,
|
|
129
|
+
}));
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
// Autocomplete
|
|
133
|
+
sectionData = sectionResults[sectionConfig.indexSectionName];
|
|
124
134
|
}
|
|
125
135
|
if (Array.isArray(sectionData)) {
|
|
126
136
|
const section = {
|
|
@@ -141,7 +151,8 @@ export const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, '\
|
|
|
141
151
|
export const trackRecommendationView = (target, activeSectionsWithData, cioClient) => {
|
|
142
152
|
if (target.dataset.cnstrcRecommendationsPodId) {
|
|
143
153
|
// Pull recommendations from activeSectionsWithData by podId surfaced on target
|
|
144
|
-
const recommendationSection = activeSectionsWithData.find((section) => section
|
|
154
|
+
const recommendationSection = activeSectionsWithData.find((section) => isRecommendationsSection(section) &&
|
|
155
|
+
section.podId === target.dataset.cnstrcRecommendationsPodId);
|
|
145
156
|
const recommendationItems = recommendationSection?.data.map((item) => ({
|
|
146
157
|
itemId: item.data?.id,
|
|
147
158
|
itemName: item.value,
|
package/lib/mjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.
|
|
1
|
+
export default '1.19.0';
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { AutocompleteSubmitEvent } from './types';
|
|
|
2
2
|
export declare const apiKey = "key_M57QS8SMPdLdLx4x";
|
|
3
3
|
export declare const componentDescription = "- import `CioAutocomplete` to render in your JSX.\n- This component handles state management, data fetching, and rendering logic.\n- To use this component, an `apiKey` or `cioJsClient` are required, and an `onSubmit` callback must be passed. All other values are optional.\n- Use different props to configure the behavior of this component.\n- The following stories shows how different props affect the component's behavior\n\n> Note: when we say `cioJsClient`, we are referring to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n";
|
|
4
4
|
export declare const hookDescription = "- import `useCioAutocomplete` and call this custom hook in a functional component.\n- This hook leaves rendering logic up to you, while handling:\n - state management\n - data fetching\n - keyboard navigation\n - mouse interactions\n - focus and submit event handling\n- To use this hook, an `apiKey` or `cioJsClient` are required, and an `onSubmit` callback must be passed to the `useCioAutocomplete` hook to configure behavior. All other values are optional.\n- use the <a href=\"https://kentcdodds.com/blog/how-to-give-rendering-control-to-users-with-prop-getters\" target=\"__blank\">prop getters</a> and other variables returned by this hook (below) to leverage the functionality described above with jsx elements in your react component definitions\n\nCalling the `useCioAutocomplete` hook returns an object with the following keys:\n\n```jsx\nconst {\n // must be used for a hooks integrations\n query: string, // current input field value\n sections: [{...}], // array of sections data to render in menu list\n getFormProps: () => ({...})), // prop getter for jsx form element\n getInputProps: () => ({...})), // prop getter for jsx input element\n getMenuProps: () => ({...})), // prop getter for jsx element rendering the results container\n getItemProps: (item) => ({...})), // prop getter for jsx element rendering each result\n getSectionProps: (section: Section) => ({...})), // prop getter for jsx element rendering each section.\n\n // available for use, but not required for all use cases\n selectedItem: item, // undefined or current selected item (via hover or arrow keys)\n isOpen: boolean, // current state of the menu list\n openMenu: () => void, // open menu\n closeMenu: () => void, // close menu\n setQuery: () => void, // update the current input field value\n getLabelProps: () => ({...})), // prop getter for a jsx label element\n cioJsClient, // instance of constructorio-client-javascript\n } = useCioAutocomplete(args);\n```\n\n> Note: when we say `cioJsClient`, we are referring to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n\nThe following stories show how different options affect the hook's behavior!\n";
|
|
5
|
-
export declare const sectionsDescription = "- by default, typing a query will fetch data for
|
|
5
|
+
export declare const sectionsDescription = "- by default, typing a query will fetch data for Search Suggestions and Products\n- to override this, pass an array of sections objects\n- the order of the objects in the `sections` array determines the order of the results\n- each autocomplete section object must have a `indexSectionName`\n- each recommendation section object must have a `podId`\n- each custom section object must have a `displayName`\n- each section object can specify a `type`\n- each section object can override the default `numResults` of 8\n\n`indexSectionName` refers to a section under an index. The default sections are \"Products\" and \"Search Suggestions\". You can find all the sections that exist in your index under the \"Indexes\" tab of Constructor dashboard.\n\nWhen no values are passed for the `sections` argument, the following defaults are used:\n\n```jsx\n[\n {\n indexSectionName: 'Search Suggestions',\n type: 'autocomplete',\n numResults: 8\n },\n {\n indexSectionName: 'Products',\n type: 'autocomplete',\n numResults: 8\n }\n]\n```\n";
|
|
6
6
|
export declare const userEventsDescription = "- pass callback functions to respond to user events\n- if provided, the onFocus callback function will be called each time the user focuses on the text input field\n- if provided, the onChange callback function will be called each time the user changes the value in the text input field\n- the onSubmit callback function will be called each time the user submits the form\n- the user can submit the form by pressing the enter key in the text input field, clicking a submit button within the form, clicking on a result, or pressing enter while a result is selected\n\n> \u26A0\uFE0F NOTE \u26A0\uFE0F Use the Storybook Canvas Actions tab to explore the behavior of all of these `OnEvent` callback functions as you interact with our Default User Events example rendered in the Canvas. In the stories below, Storybook Canvas Actions have been disabled to focus on each of these callback functions in isolation. Each of the example callback functions in the stories below log output to the console tab of the browser's developer tools.";
|
|
7
|
-
export declare const zeroStateDescription = "- when the text input field has no text, we call this zero state\n- by default, the autocomplete shows nothing in the menu it's for zero state\n- to show zero state results, pass an array of section objects for `zeroStateSections`\n- when `zeroStateSections` has sections, the menu will open on user focus by default\n- set `openOnFocus` to false, to only show `zeroStateSections` after user has typed and then cleared the text input, instead of as soon as the user focuses on the text input\n- the order of the objects in the `zeroStateSections` array determines the order of the results\n- each section object must have
|
|
7
|
+
export declare const zeroStateDescription = "- when the text input field has no text, we call this zero state\n- by default, the autocomplete shows nothing in the menu it's for zero state\n- to show zero state results, pass an array of section objects for `zeroStateSections`\n- when `zeroStateSections` has sections, the menu will open on user focus by default\n- set `openOnFocus` to false, to only show `zeroStateSections` after user has typed and then cleared the text input, instead of as soon as the user focuses on the text input\n- the order of the objects in the `zeroStateSections` array determines the order of the results\n- each autocomplete section object must have a `indexSectionName`\n- each recommendation section object must have a `podId`\n- each custom section object must have a `displayName`\n- each section object can specify a `type`\n- each section object can override the default `numResults` of 8";
|
|
8
8
|
export declare const fullFeaturedAndStyledExampleDescription = "Using the default options, the library displays clean and minimal visual elements, with the intent of making it easy for consumers to easily extend and customize the styles to suit unique needs. The example below shows a full featured and styled example to demonstrate what is possible using Constructor.io's advanced Autocomplete UI library.";
|
|
9
9
|
export declare const apiKeyDescription = "Pass an `apiKey` to request results from constructor's servers";
|
|
10
10
|
export declare const cioJsClientDescription = "If you are already using an instance of the `ConstructorIOClient`, you can pass a `cioJsClient` instead of an `apiKey` to request results from constructor's servers\n\n> Note: when we say `cioJsClient`, we are referring to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ConstructorIOClient from '@constructor-io/constructorio-client-javascript';
|
|
2
2
|
import { Nullable } from '@constructor-io/constructorio-client-javascript/lib/types';
|
|
3
|
-
import { AutocompleteResultSections,
|
|
4
|
-
declare const useDebouncedFetchSection: (query: string, cioClient: Nullable<ConstructorIOClient>, autocompleteSections:
|
|
3
|
+
import { AutocompleteResultSections, AdvancedParameters, AutocompleteSectionConfiguration } from '../types';
|
|
4
|
+
declare const useDebouncedFetchSection: (query: string, cioClient: Nullable<ConstructorIOClient>, autocompleteSections: AutocompleteSectionConfiguration[], advancedParameters?: AdvancedParameters) => AutocompleteResultSections;
|
|
5
5
|
export default useDebouncedFetchSection;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ConstructorIOClient from '@constructor-io/constructorio-client-javascript';
|
|
2
2
|
import { Nullable } from '@constructor-io/constructorio-client-javascript/lib/types';
|
|
3
|
-
import {
|
|
4
|
-
declare const useFetchRecommendationPod: (cioClient: Nullable<ConstructorIOClient>, recommendationPods:
|
|
3
|
+
import { SectionsData, RecommendationsSectionConfiguration } from '../types';
|
|
4
|
+
declare const useFetchRecommendationPod: (cioClient: Nullable<ConstructorIOClient>, recommendationPods: RecommendationsSectionConfiguration[]) => SectionsData;
|
|
5
5
|
export default useFetchRecommendationPod;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ConstructorIO from '@constructor-io/constructorio-client-javascript';
|
|
2
2
|
import { Nullable } from '@constructor-io/constructorio-client-javascript/lib/types';
|
|
3
|
-
import { AdvancedParameters,
|
|
3
|
+
import { AdvancedParameters, UserDefinedSection, Section } from '../types';
|
|
4
4
|
export default function useSections(query: string, cioClient: Nullable<ConstructorIO>, sections: UserDefinedSection[], zeroStateSections: UserDefinedSection[] | undefined, advancedParameters?: AdvancedParameters): {
|
|
5
5
|
activeSections: UserDefinedSection[];
|
|
6
6
|
activeSectionsWithData: Section[];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { CustomSection, InGroupSuggestion, Item, Product, UserDefinedSection, SearchSuggestion } from './types';
|
|
1
|
+
import { CustomSection, InGroupSuggestion, Item, Product, UserDefinedSection, SearchSuggestion, AutocompleteSection, RecommendationsSection } from './types';
|
|
2
2
|
export declare function isProduct(item: Item): item is Product;
|
|
3
3
|
export declare function isSearchSuggestion(item: Item): item is SearchSuggestion;
|
|
4
4
|
export declare function isInGroupSuggestion(item: Item): item is InGroupSuggestion;
|
|
5
5
|
export declare function isCustomSection(config: UserDefinedSection): config is CustomSection;
|
|
6
|
+
export declare function isAutocompleteSection(config: UserDefinedSection): config is AutocompleteSection;
|
|
7
|
+
export declare function isRecommendationsSection(config: UserDefinedSection): config is RecommendationsSection;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export type GetAutocompleteResultsOptions = {
|
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
export type SectionsData = {
|
|
54
|
-
[key: string]: Item[]
|
|
54
|
+
[key: string]: Item[];
|
|
55
55
|
};
|
|
56
56
|
/** CIO API Response Data */
|
|
57
57
|
export type AutocompleteResultSections = {
|
|
@@ -61,29 +61,41 @@ export type AutocompleteResultSections = {
|
|
|
61
61
|
type SectionType = 'autocomplete' | 'recommendations' | 'custom';
|
|
62
62
|
export type SectionConfiguration = {
|
|
63
63
|
type?: SectionType;
|
|
64
|
-
identifier: string;
|
|
65
64
|
displayName?: string;
|
|
66
65
|
numResults?: number;
|
|
67
66
|
displaySearchTermHighlights?: boolean;
|
|
68
67
|
ref?: React.RefObject<HTMLElement>;
|
|
69
68
|
};
|
|
70
|
-
export interface
|
|
69
|
+
export interface AutocompleteSectionConfiguration extends SectionConfiguration {
|
|
71
70
|
type?: 'autocomplete';
|
|
72
|
-
|
|
71
|
+
indexSectionName: string;
|
|
72
|
+
/** @deprecated use indexSectionName field instead */
|
|
73
|
+
identifier?: string;
|
|
73
74
|
}
|
|
74
|
-
export interface
|
|
75
|
+
export interface RecommendationsSectionConfiguration extends SectionConfiguration {
|
|
75
76
|
type: 'recommendations';
|
|
76
|
-
|
|
77
|
+
indexSectionName?: string;
|
|
78
|
+
podId: string;
|
|
77
79
|
itemIds?: string[];
|
|
78
|
-
section?: string;
|
|
79
80
|
term?: string;
|
|
81
|
+
/** @deprecated use podId field instead */
|
|
82
|
+
identifier?: string;
|
|
80
83
|
}
|
|
81
|
-
export interface
|
|
84
|
+
export interface CustomSectionConfiguration extends SectionConfiguration {
|
|
82
85
|
type: 'custom';
|
|
86
|
+
displayName: string;
|
|
87
|
+
}
|
|
88
|
+
export interface AutocompleteSection extends AutocompleteSectionConfiguration {
|
|
89
|
+
data: Item[];
|
|
90
|
+
}
|
|
91
|
+
export interface RecommendationsSection extends RecommendationsSectionConfiguration {
|
|
92
|
+
data: Item[];
|
|
93
|
+
}
|
|
94
|
+
export interface CustomSection extends CustomSectionConfiguration {
|
|
83
95
|
data: Item[];
|
|
84
96
|
}
|
|
85
97
|
export type Section = AutocompleteSection | RecommendationsSection | CustomSection;
|
|
86
|
-
export type UserDefinedSection =
|
|
98
|
+
export type UserDefinedSection = AutocompleteSectionConfiguration | RecommendationsSectionConfiguration | CustomSection;
|
|
87
99
|
export type Product = ProductFromClient & {
|
|
88
100
|
section: 'Products';
|
|
89
101
|
};
|
package/lib/types/utils.d.ts
CHANGED
|
@@ -15,9 +15,10 @@ export declare function getSearchSuggestionFeatures(request: Partial<Autocomplet
|
|
|
15
15
|
export declare const getItemPosition: GetItemPosition;
|
|
16
16
|
type CamelToStartCase = (camelCaseString: string) => string;
|
|
17
17
|
export declare const camelToStartCase: CamelToStartCase;
|
|
18
|
-
export declare
|
|
18
|
+
export declare const toKebabCase: (str: string) => string;
|
|
19
|
+
export declare function isTrackingRequestSent(trackingRequestUrl: string): any;
|
|
19
20
|
export declare function clearConstructorRequests(): void;
|
|
20
|
-
export declare function sleep(ms:
|
|
21
|
+
export declare function sleep(ms: number): Promise<unknown>;
|
|
21
22
|
export declare const getStoryParams: (storyCode: any, templateCode: any, importCode: any) => {
|
|
22
23
|
docs: {
|
|
23
24
|
source: {
|
package/lib/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.
|
|
1
|
+
declare const _default: "1.19.0";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED