@rocketspark/domain-checker 0.0.7 → 0.0.11

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.
Files changed (79) hide show
  1. package/.idea/domain-checker.iml +3 -1
  2. package/.idea/inspectionProfiles/Project_Default.xml +16 -0
  3. package/.idea/jsonSchemas.xml +25 -0
  4. package/README.md +9 -57
  5. package/build/130.index.js +1 -1
  6. package/build/145.index.js +1 -1
  7. package/build/171.index.js +1 -1
  8. package/build/190.index.js +1 -1
  9. package/build/204fba429a5386123889.svg +266 -0
  10. package/build/228.index.js +1 -1
  11. package/build/23.index.js +1 -1
  12. package/build/253.index.js +1 -1
  13. package/build/269.index.js +1 -1
  14. package/build/307.index.js +1 -1
  15. package/build/314.index.js +1 -1
  16. package/build/330.index.js +1 -1
  17. package/build/346.index.js +1 -1
  18. package/build/385.index.js +1 -1
  19. package/build/431.index.js +1 -1
  20. package/build/447.index.js +1 -1
  21. package/build/482.index.js +1 -1
  22. package/build/525.index.js +1 -1
  23. package/build/536.index.js +1 -1
  24. package/build/548.index.js +1 -1
  25. package/build/565.index.js +1 -1
  26. package/build/577.index.js +1 -1
  27. package/build/655.index.js +1 -1
  28. package/build/66.index.js +1 -1
  29. package/build/669.index.js +1 -1
  30. package/build/677.index.js +1 -1
  31. package/build/678.index.js +1 -1
  32. package/build/69.index.js +1 -1
  33. package/build/690.index.js +1 -1
  34. package/build/694.index.js +1 -1
  35. package/build/698.index.js +1 -1
  36. package/build/716.index.js +1 -1
  37. package/build/717.index.js +1 -1
  38. package/build/724.index.js +1 -1
  39. package/build/738.index.js +1 -1
  40. package/build/799.index.js +1 -1
  41. package/build/82.index.js +1 -1
  42. package/build/858.index.js +1 -1
  43. package/build/8723cc99516819ff0917.svg +266 -0
  44. package/build/882.index.js +1 -1
  45. package/build/895.index.js +1 -1
  46. package/build/903.index.js +1 -1
  47. package/build/911.index.js +1 -1
  48. package/build/912.index.js +1 -1
  49. package/build/927.index.js +1 -1
  50. package/build/953.index.js +1 -1
  51. package/build/955.index.js +1 -1
  52. package/build/994.index.js +1 -1
  53. package/build/css/index.css +2 -2
  54. package/build/css/index.css.map +1 -1
  55. package/build/index.js +2 -2
  56. package/build/index.js.map +1 -1
  57. package/build/types/Components/PopupContainer.d.ts +5 -0
  58. package/build/types/Components/SearchAlternativeRow.d.ts +25 -0
  59. package/build/types/Components/SearchAlternatives.d.ts +15 -0
  60. package/build/types/Components/SearchResultCaption.d.ts +2 -0
  61. package/build/types/Helpers/Fetch.d.ts +7 -1
  62. package/build/types/Helpers/templates.d.ts +3 -1
  63. package/build/types/Helpers/wrap.test.d.ts +4 -0
  64. package/build/types/{interfaces → Interfaces}/class-names.d.ts +14 -0
  65. package/build/types/{interfaces → Interfaces}/options.d.ts +0 -0
  66. package/build/types/index.d.ts +6 -4
  67. package/build/types/index.test.d.ts +4 -0
  68. package/package.json +4 -2
  69. package/tsconfig.json +23 -15
  70. package/webpack.config.demo.js +2 -6
  71. package/.github-test/FUNDING.yml +0 -1
  72. package/.github-test/dependabot.yml +0 -10
  73. package/.github-test/workflows/main.yml +0 -28
  74. package/.github-test/workflows/publish.yml +0 -49
  75. package/.github-test/workflows/pull_request.yml +0 -24
  76. package/.github-test/workflows/pull_request_dependabot.yml +0 -48
  77. package/LICENSE +0 -21
  78. package/build/3cce2bffb56fb72f4f99.svg +0 -521
  79. package/build/a8181c51f10ef59913b0.svg +0 -266
@@ -1,5 +1,6 @@
1
1
  import { Options } from '../Interfaces/options';
2
2
  import { Status } from './SearchStatus';
3
+ import { DomainSuggestions } from '../Helpers/Fetch';
3
4
  export default class PopupContainer {
4
5
  readonly element: HTMLElement;
5
6
  private readonly classNames;
@@ -11,6 +12,7 @@ export default class PopupContainer {
11
12
  private domainSearch;
12
13
  private searchResultText;
13
14
  private closeIcon;
15
+ private domainAlternatives;
14
16
  constructor({ element, config: { classNames, container, fetchURL }, locale }: {
15
17
  element: HTMLElement;
16
18
  config: Options;
@@ -21,9 +23,12 @@ export default class PopupContainer {
21
23
  setStatus(status?: Status): this;
22
24
  setHeading(heading: string): this;
23
25
  setPrice(price?: string): this;
26
+ setCaptionMessage(message: string): this;
24
27
  setCanClaim(state: boolean): this;
25
28
  setDomain(domain: string): this;
29
+ fetchAlternativeDomains(suggestions: DomainSuggestions): this;
26
30
  private resetLoadingUi;
27
31
  private getTemplate;
28
32
  private build;
33
+ private initObserver;
29
34
  }
@@ -0,0 +1,25 @@
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
+ }
@@ -0,0 +1,15 @@
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
+ }
@@ -9,4 +9,6 @@ export default class SearchResultCaption {
9
9
  element: HTMLRsHeaderElement;
10
10
  classNames: ClassNames;
11
11
  });
12
+ setMessage(message: string): this;
13
+ removeMessage(): this;
12
14
  }
@@ -1,6 +1,12 @@
1
+ export interface DomainSuggestions {
2
+ prefix: string;
3
+ suffixes: string[];
4
+ }
1
5
  export interface DomainResponse {
2
6
  isAvailable: boolean;
3
7
  formattedPrice: string;
4
8
  success: boolean;
9
+ error: string;
10
+ domainSuggestions: DomainSuggestions;
5
11
  }
6
- export declare const DomainFetch: (url: string, domainName: string, locale: string) => Promise<DomainResponse>;
12
+ export declare const FetchDomain: (domainName: string, locale: string, limit?: number) => Promise<DomainResponse>;
@@ -1,4 +1,4 @@
1
- import { Options } from '../interfaces/options';
1
+ import { Options } from '../Interfaces/options';
2
2
  import { ClassNames } from '../Interfaces/class-names';
3
3
  declare const templates: {
4
4
  container({ classNames: { containerOuter } }: Options): HTMLDivElement;
@@ -9,5 +9,7 @@ declare const templates: {
9
9
  searchLoader({ classNames: { popupSearchSpinner }, }: Options): HTMLRsSpinnerElement;
10
10
  icon(classNames: Partial<ClassNames>, className: string): HTMLRsIconElement;
11
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;
12
14
  };
13
15
  export default templates;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ export {};
@@ -17,4 +17,18 @@ export interface ClassNames {
17
17
  searchResultCaption: string;
18
18
  searchResultCaptionPrice: string;
19
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;
20
34
  }
@@ -1,19 +1,21 @@
1
1
  import './index.css';
2
- import { Options } from './interfaces/options';
2
+ import { Options } from './Interfaces/options';
3
3
  import '@rocketspark/flint-ui/dist/rocketspark/rocketspark.css';
4
4
  import PopupContainer from './Components/PopupContainer';
5
5
  import { DomainResponse } from './Helpers/Fetch';
6
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;
7
11
  private readonly element;
8
12
  private readonly config;
9
13
  private readonly locale;
10
14
  private readonly allowedLocales;
11
- private readonly PRODUCTION_FETCH;
12
- private readonly DEVELOPMENT_FETCH;
13
15
  private domainSearch;
14
16
  private popupContainer;
15
17
  constructor(element: HTMLElement, options?: Partial<Options>);
16
- static setPopupStatus(popupContainer: PopupContainer, { success, isAvailable, formattedPrice }: DomainResponse): void;
18
+ static setPopupStatus(popupContainer: PopupContainer, { success, isAvailable, formattedPrice, error }: Partial<DomainResponse>): void;
17
19
  private init;
18
20
  private getTemplate;
19
21
  private startListening;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rocketspark/domain-checker",
3
- "version": "0.0.7",
3
+ "version": "0.0.11",
4
4
  "description": "Embeddable Domain Checker for Rocketspark",
5
5
  "main": "build/index.js",
6
6
  "types": "build/types/index.d.ts",
@@ -12,7 +12,8 @@
12
12
  "test": "jest --silent",
13
13
  "coverage": "npm run test -- --coverage",
14
14
  "prepare": "npm run build",
15
- "publish:patch": "npm version patch -m \"Patch upgrade to %s [skip ci]\" && npm publish || true"
15
+ "publish:patch": "npm version patch -m \"Patch upgrade to %s [skip ci]\" && npm publish || true",
16
+ "publish": "npm publish"
16
17
  },
17
18
  "browserslist": [
18
19
  "defaults",
@@ -56,6 +57,7 @@
56
57
  "file-loader": "^6.2.0",
57
58
  "html-webpack-plugin": "^5.5.0",
58
59
  "jest": "^28.1.0",
60
+ "jest-environment-jsdom": "^28.1.0",
59
61
  "mini-css-extract-plugin": "^2.6.0",
60
62
  "optimize-css-assets-webpack-plugin": "^6.0.1",
61
63
  "postcss-loader": "^3.0.0",
package/tsconfig.json CHANGED
@@ -1,17 +1,25 @@
1
1
  {
2
- "compilerOptions": {
3
- "noImplicitAny": true,
4
- "outDir": "build/types",
5
- "module": "esnext",
6
- "target": "es5",
7
- "allowJs": true,
8
- "sourceMap": true,
9
- "declaration": true,
10
- "emitDeclarationOnly": true,
11
- "suppressImplicitAnyIndexErrors": true,
12
- "lib": ["es2018", "dom"],
13
- "moduleResolution": "node",
14
- },
15
- "include": ["src/lib"],
16
- "exclude": ["src/lib/**/tests"],
2
+ "compilerOptions": {
3
+ "noImplicitAny": true,
4
+ "outDir": "build/types",
5
+ "module": "esnext",
6
+ "target": "es5",
7
+ "allowJs": true,
8
+ "sourceMap": true,
9
+ "declaration": true,
10
+ "emitDeclarationOnly": true,
11
+ "suppressImplicitAnyIndexErrors": true,
12
+ "lib": [
13
+ "es2018",
14
+ "dom"
15
+ ],
16
+ "moduleResolution": "node",
17
+ "forceConsistentCasingInFileNames": true
18
+ },
19
+ "include": [
20
+ "src/lib"
21
+ ],
22
+ "exclude": [
23
+ "src/lib/**/tests"
24
+ ]
17
25
  }
@@ -12,14 +12,10 @@ module.exports = {
12
12
  minimize: false,
13
13
  },
14
14
  devServer: {
15
- open: true,
15
+ open: ['http://localhost:9000'],
16
16
  hot: true,
17
17
  host: '0.0.0.0',
18
- // host: 'localhost',
19
18
  port: 9000,
20
- // client: {
21
- // webSocketURL: 'https://f6bf11c423d4.au.ngrok.io'
22
- // }
23
19
  },
24
20
  module: {
25
21
  rules: [
@@ -34,7 +30,7 @@ module.exports = {
34
30
  test: /\.(sa|sc|c)ss$/,
35
31
  use: [
36
32
  MiniCssExtractPlugin.loader,
37
- {loader: 'css-loader', options: {sourceMap: true}},
33
+ { loader: 'css-loader', options: { sourceMap: true } },
38
34
  {
39
35
  loader: 'postcss-loader',
40
36
  options: {
@@ -1 +0,0 @@
1
- custom: https://hge.to/thanks
@@ -1,10 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: npm
4
- directory: "/"
5
- schedule:
6
- interval: daily
7
- time: "04:00"
8
- timezone: America/Montreal
9
- open-pull-requests-limit: 5
10
- versioning-strategy: increase
@@ -1,28 +0,0 @@
1
- name: Build
2
-
3
- on:
4
- push:
5
- paths-ignore:
6
- - README.md
7
- - .gitignore
8
- - .github/**
9
-
10
- jobs:
11
- build:
12
- runs-on: ${{ matrix.os }}
13
- strategy:
14
- matrix:
15
- node-version: [12.x]
16
- os: [ubuntu-latest]
17
- steps:
18
- - uses: actions/checkout@v1
19
- - name: Use Node.js ${{ matrix.node_version }}
20
- uses: actions/setup-node@v1
21
- with:
22
- node-version: ${{ matrix.node_version }}
23
- - name: npm install, build, and test
24
- run: |
25
- npm install
26
- npm run test
27
- env:
28
- CI: true
@@ -1,49 +0,0 @@
1
- name: Publish
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- paths-ignore:
8
- - README.md
9
- - .gitignore
10
- - .github/**
11
-
12
- jobs:
13
- publish:
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: actions/checkout@v1
17
- - uses: actions/setup-node@v1
18
- with:
19
- node-version: 12
20
- - run: npm install
21
- - run: npm run test
22
-
23
- - name: Setup GIT
24
- run: |
25
- git reset --hard
26
- git config --local --list
27
- git checkout master
28
- git config user.email "$GH_EMAIL"
29
- git config user.name "Francisco Hodge"
30
- env:
31
- GH_EMAIL: ${{secrets.GH_EMAIL}}
32
-
33
- - name: Bump version
34
- run: |
35
- git reset --hard
36
- npm version patch
37
- npm run build
38
- git add . || true
39
- git commit -m "Build update" || true
40
- git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY"
41
- env:
42
- GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
43
-
44
- - name: npm publish
45
- run: |
46
- npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
47
- npm run trypublish
48
- env:
49
- NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
@@ -1,24 +0,0 @@
1
- name: Build PR (Standard)
2
-
3
- on: pull_request
4
-
5
- jobs:
6
- build:
7
- runs-on: ${{ matrix.os }}
8
- if: ${{ github.actor != 'dependabot[bot]' }}
9
- strategy:
10
- matrix:
11
- node-version: [12.x]
12
- os: [ubuntu-latest]
13
- steps:
14
- - uses: actions/checkout@v1
15
- - name: Use Node.js ${{ matrix.node_version }}
16
- uses: actions/setup-node@v1
17
- with:
18
- node-version: ${{ matrix.node_version }}
19
- - name: npm install, build, and test
20
- run: |
21
- npm install
22
- npm run test
23
- env:
24
- CI: true
@@ -1,48 +0,0 @@
1
- name: Build PR (Dependabot)
2
-
3
- on: pull_request_target
4
-
5
- jobs:
6
- build:
7
- runs-on: ${{ matrix.os }}
8
- if: ${{ github.actor == 'dependabot[bot]' }}
9
- strategy:
10
- matrix:
11
- node-version: [12.x]
12
- os: [ubuntu-latest]
13
- steps:
14
- - uses: actions/checkout@v2
15
- with:
16
- ref: ${{ github.event.pull_request.head.sha }}
17
- - name: Use Node.js ${{ matrix.node_version }}
18
- uses: actions/setup-node@v1
19
- with:
20
- node-version: ${{ matrix.node_version }}
21
- - name: npm install, build, and test
22
- run: |
23
- npm install
24
- npm run test
25
- env:
26
- CI: true
27
- - name: Merge PR
28
- if: success()
29
- uses: "actions/github-script@v2"
30
- with:
31
- github-token: "${{ secrets.GH_KEY }}"
32
- script: |
33
- const pullRequest = context.payload.pull_request
34
- const repository = context.repo
35
-
36
- await github.pulls.merge({
37
- merge_method: "merge",
38
- owner: repository.owner,
39
- pull_number: pullRequest.number,
40
- repo: repository.repo,
41
- })
42
- - name: Reject PR
43
- if: failure()
44
- uses: peter-evans/close-pull@v1
45
- with:
46
- pull-request-number: ${{github.event.number}}
47
- comment: "Closing PR due to failing tests."
48
- delete-branch: true
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 Francisco Hodge
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.