@rocketspark/domain-checker 0.0.13 → 0.0.14

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.
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="JavaScriptLibraryMappings">
4
+ <includedPredefinedLibrary name="Node.js Core" />
5
+ </component>
6
+ </project>
package/.idea/php.xml ADDED
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="MessDetectorOptionsConfiguration">
4
+ <option name="transferred" value="true" />
5
+ </component>
6
+ <component name="PHPCSFixerOptionsConfiguration">
7
+ <option name="transferred" value="true" />
8
+ </component>
9
+ <component name="PHPCodeSnifferOptionsConfiguration">
10
+ <option name="highlightLevel" value="WARNING" />
11
+ <option name="transferred" value="true" />
12
+ </component>
13
+ <component name="PhpStanOptionsConfiguration">
14
+ <option name="transferred" value="true" />
15
+ </component>
16
+ <component name="PsalmOptionsConfiguration">
17
+ <option name="transferred" value="true" />
18
+ </component>
19
+ </project>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rocketspark/domain-checker",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Embeddable Domain Checker for Rocketspark",
5
5
  "main": "build/index.js",
6
6
  "types": "build/types/index.d.ts",
@@ -1,20 +0,0 @@
1
- import { Options } from '../Interfaces/options';
2
- export default class DomainSearch {
3
- readonly element: HTMLElement;
4
- readonly input: HTMLRsInputElement;
5
- private readonly button;
6
- private classNames;
7
- private readonly locale;
8
- private readonly fetchURL;
9
- private canClaim;
10
- private readonly searchAgain;
11
- constructor({ element, config: { classNames, fetchURL }, locale }: {
12
- element: HTMLElement;
13
- config: Partial<Options>;
14
- locale: string;
15
- });
16
- setCanClaim(state: boolean): this;
17
- setDomain(domain: string): this;
18
- private addEventListeners;
19
- private submit;
20
- }
@@ -1,34 +0,0 @@
1
- import { Options } from '../Interfaces/options';
2
- import { Status } from './SearchStatus';
3
- import { DomainSuggestions } from '../Helpers/Fetch';
4
- export default class PopupContainer {
5
- readonly element: HTMLElement;
6
- private readonly classNames;
7
- private readonly container;
8
- private heading;
9
- private status;
10
- private readonly locale;
11
- private readonly fetchURL;
12
- private domainSearch;
13
- private searchResultText;
14
- private closeIcon;
15
- private domainAlternatives;
16
- constructor({ element, config: { classNames, container, fetchURL }, locale }: {
17
- element: HTMLElement;
18
- config: Options;
19
- locale: string;
20
- });
21
- open(): this;
22
- close(): this;
23
- setStatus(status?: Status): this;
24
- setHeading(heading: string): this;
25
- setPrice(price?: string): this;
26
- setCaptionMessage(message: string): this;
27
- setCanClaim(state: boolean): this;
28
- setDomain(domain: string): this;
29
- fetchAlternativeDomains(suggestions: DomainSuggestions): this;
30
- private resetLoadingUi;
31
- private getTemplate;
32
- private build;
33
- private initObserver;
34
- }
@@ -1,25 +0,0 @@
1
- import { ClassNames } from '../Interfaces/class-names';
2
- export default class SearchAlternativeRow {
3
- readonly element: HTMLRsHeaderElement;
4
- private readonly classNames;
5
- private readonly header;
6
- private readonly prefix;
7
- private readonly suffix;
8
- private getItNow;
9
- private readonly domain;
10
- private locale;
11
- private isAvailable;
12
- private pricing;
13
- private blurb;
14
- constructor({ element, prefix, suffix, classNames, locale }: {
15
- element: HTMLRsHeaderElement;
16
- prefix: string;
17
- suffix: string;
18
- classNames: ClassNames;
19
- locale: string;
20
- });
21
- private build;
22
- private buildDomain;
23
- private addListeners;
24
- private fetchDetails;
25
- }
@@ -1,15 +0,0 @@
1
- import { ClassNames } from '../Interfaces/class-names';
2
- import { DomainSuggestions } from '../Helpers/Fetch';
3
- export default class SearchAlternatives {
4
- readonly element: HTMLRsHeaderElement;
5
- private readonly classNames;
6
- private readonly locale;
7
- constructor({ element, classNames, locale }: {
8
- element: HTMLRsHeaderElement;
9
- classNames: ClassNames;
10
- locale: string;
11
- });
12
- showAlternatives(suggestions: DomainSuggestions): this;
13
- private removeAllRows;
14
- private getTemplate;
15
- }
@@ -1,8 +0,0 @@
1
- export default class SearchHeading {
2
- set heading(value: string);
3
- readonly element: HTMLRsHeaderElement;
4
- private _heading;
5
- constructor({ element }: {
6
- element: HTMLRsHeaderElement;
7
- });
8
- }
@@ -1,14 +0,0 @@
1
- import { ClassNames } from '../Interfaces/class-names';
2
- export default class SearchResultCaption {
3
- set price(value: string | null);
4
- readonly element: HTMLRsHeaderElement;
5
- private _price;
6
- private readonly base;
7
- private classNames;
8
- constructor({ element, classNames }: {
9
- element: HTMLRsHeaderElement;
10
- classNames: ClassNames;
11
- });
12
- setMessage(message: string): this;
13
- removeMessage(): this;
14
- }
@@ -1,13 +0,0 @@
1
- import { ClassNames } from '../Interfaces/class-names';
2
- export declare type Status = 'loading' | 'available' | 'unavailable';
3
- export default class SearchStatus {
4
- element: HTMLElement;
5
- private readonly searchLoader;
6
- private readonly icon;
7
- private readonly classNames;
8
- constructor({ classNames }: {
9
- classNames: ClassNames;
10
- });
11
- setStatus(status?: Status): this;
12
- private getTemplate;
13
- }
@@ -1,12 +0,0 @@
1
- export interface DomainSuggestions {
2
- prefix: string;
3
- suffixes: string[];
4
- }
5
- export interface DomainResponse {
6
- isAvailable: boolean;
7
- formattedPrice: string;
8
- success: boolean;
9
- error: string;
10
- domainSuggestions: DomainSuggestions;
11
- }
12
- export declare const FetchDomain: (domainName: string, locale: string, limit?: number) => Promise<DomainResponse>;
@@ -1,2 +0,0 @@
1
- import { Options } from '../Interfaces/options';
2
- export declare const DEFAULT_CONFIG: Options;
@@ -1,15 +0,0 @@
1
- import { Options } from '../Interfaces/options';
2
- import { ClassNames } from '../Interfaces/class-names';
3
- declare const templates: {
4
- container({ classNames: { containerOuter } }: Options): HTMLDivElement;
5
- inputContainer({ classNames: { inputContainer } }: Options): HTMLDivElement;
6
- domainSearch({ classNames: { inputContainer, domainInput, searchButton }, }: Options): HTMLDivElement;
7
- popupContainer({ classNames: { popupContainer }, }: Options): HTMLDivElement;
8
- searchHeading({ classNames: { searchHeading }, }: Options): HTMLRsHeaderElement;
9
- searchLoader({ classNames: { popupSearchSpinner }, }: Options): HTMLRsSpinnerElement;
10
- icon(classNames: Partial<ClassNames>, className: string): HTMLRsIconElement;
11
- searchResultText({ classNames: { searchResultCaption }, }: Options): HTMLRsContentElement;
12
- searchAlternatives({ classNames: { searchAlternativeContainer, searchAlternativeHeader } }: Options): HTMLDivElement;
13
- searchAlternativeRow({ classNames: { searchAlternativeRow, searchAlternativeRowHeader, searchAlternativeGetItNow, searchAlternativeRowFetching, searchAlternativeSpinner, searchAlternativeGetItNowContainer, searchAlternativePricingContainer } }: Options): HTMLDivElement;
14
- };
15
- export default templates;
@@ -1 +0,0 @@
1
- export declare const wrap: (element: HTMLElement, wrapper?: HTMLElement) => HTMLElement;
@@ -1,4 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
- export {};
@@ -1,34 +0,0 @@
1
- /** Classes added to HTML generated by default classnames follow the BEM notation. */
2
- export interface ClassNames {
3
- element: string;
4
- containerOuter: string;
5
- inputContainer: string;
6
- inputContainerSearching: string;
7
- domainInput: string;
8
- searchButton: string;
9
- popupContainer: string;
10
- popupContainerActive: string;
11
- popupSearchContainer: string;
12
- popupClose: string;
13
- popupSearchSpinner: string;
14
- searchHeading: string;
15
- searchAgain: string;
16
- searchAgainActive: string;
17
- searchResultCaption: string;
18
- searchResultCaptionPrice: string;
19
- searchResultCaptionActive: string;
20
- searchAlternativeContainer: string;
21
- searchAlternativeContainerActive: string;
22
- searchAlternativeHeader: string;
23
- searchAlternativeRow: string;
24
- searchAlternativeRowUnavailable: string;
25
- searchAlternativeRowFetching: string;
26
- searchAlternativeRowHeader: string;
27
- searchAlternativeDomainSuffix: string;
28
- searchAlternativePricingContainer: string;
29
- searchAlternativePricing: string;
30
- searchAlternativePricingBlurb: string;
31
- searchAlternativeGetItNowContainer: string;
32
- searchAlternativeGetItNow: string;
33
- searchAlternativeSpinner: string;
34
- }
@@ -1,9 +0,0 @@
1
- import { ClassNames } from './class-names';
2
- interface OptionalOptions {
3
- classNames: ClassNames;
4
- }
5
- export interface Options extends Partial<OptionalOptions> {
6
- container: string;
7
- fetchURL: string;
8
- }
9
- export {};
@@ -1,23 +0,0 @@
1
- import './index.css';
2
- import { Options } from './Interfaces/options';
3
- import '@rocketspark/flint-ui/dist/rocketspark/rocketspark.css';
4
- import PopupContainer from './Components/PopupContainer';
5
- import { DomainResponse } from './Helpers/Fetch';
6
- declare class DomainChecker {
7
- static PRODUCTION_GET_IT_NOW: string;
8
- static DEVELOPMENT_GET_IT_NOW: string;
9
- static PRODUCTION_FETCH: string;
10
- static DEVELOPMENT_FETCH: string;
11
- private readonly element;
12
- private readonly config;
13
- private readonly locale;
14
- private readonly allowedLocales;
15
- private domainSearch;
16
- private popupContainer;
17
- constructor(element: HTMLElement, options?: Partial<Options>);
18
- static setPopupStatus(popupContainer: PopupContainer, { success, isAvailable, formattedPrice, error }: Partial<DomainResponse>): void;
19
- private init;
20
- private getTemplate;
21
- private startListening;
22
- }
23
- export default DomainChecker;
@@ -1,4 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
- export {};