svelte-tel-input 0.1.0 → 0.4.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/.eslintignore +1 -2
- package/.github/workflows/release.yml +11 -5
- package/CHANGELOG.md +42 -4
- package/LICENSE.md +21 -0
- package/README.md +3 -3
- package/docker-compose.yml +0 -2
- package/package.json +13 -15
- package/scripts/changelog-github-custom.cjs +0 -6
- package/scripts/changelog-github-custom.ts +1 -1
- package/src/lib/models/types/DynamicSvelteComponent.type.ts +21 -2
- package/src/lib/stores/index.ts +2 -2
- package/svelte.config.js +1 -7
- package/.storybook/main.cjs +0 -38
- package/.storybook/preview-head.html +0 -1
- package/.storybook/preview.cjs +0 -39
- package/src/lib/components/LazyLoad/LazyLoad.svelte +0 -23
package/.eslintignore
CHANGED
|
@@ -22,29 +22,35 @@ jobs:
|
|
|
22
22
|
node-version: 16.x
|
|
23
23
|
|
|
24
24
|
- name: Install dependencies
|
|
25
|
-
run: npm install --frozen-lockfile
|
|
25
|
+
run: npm install --frozen-lockfile --prefer-offline --ignore-scripts
|
|
26
26
|
|
|
27
27
|
- name: Packaging
|
|
28
28
|
run: |
|
|
29
29
|
npm run package
|
|
30
|
-
|
|
31
|
-
# cd package
|
|
32
|
-
# npm publish
|
|
30
|
+
ls -l package
|
|
33
31
|
|
|
34
32
|
- name: Creating .npmrc
|
|
35
33
|
run: |
|
|
36
34
|
cat << EOF > "$HOME/.npmrc"
|
|
37
35
|
//registry.npmjs.org/:_authToken=$NPM_TOKEN
|
|
38
36
|
EOF
|
|
37
|
+
ls package
|
|
38
|
+
cp $HOME/.npmrc package
|
|
39
39
|
env:
|
|
40
40
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
41
41
|
|
|
42
|
+
- name: Bump version if changeset available.
|
|
43
|
+
run: |
|
|
44
|
+
npm run changeset:version
|
|
45
|
+
env:
|
|
46
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
47
|
+
|
|
42
48
|
- name: Create Release Pull Request or Publish to npm
|
|
43
49
|
id: changesets
|
|
44
50
|
uses: changesets/action@v1
|
|
45
51
|
with:
|
|
46
52
|
# This expects you to have a script called release which does a build for your packages and calls changeset publish
|
|
47
|
-
publish: npm
|
|
53
|
+
publish: npm publish
|
|
48
54
|
env:
|
|
49
55
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
50
56
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,61 @@
|
|
|
1
1
|
# svelte-tel-input
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
4
5
|
### Minor Changes
|
|
5
6
|
|
|
7
|
+
- fix: rework ci
|
|
6
8
|
|
|
9
|
+
### Patch Changes
|
|
7
10
|
|
|
8
|
-
-
|
|
11
|
+
- fix: minor ci fix ([#34](https://github.com/gyurielf/svelte-tel-input/pull/34))
|
|
12
|
+
|
|
13
|
+
* fix: fix ci again
|
|
14
|
+
|
|
15
|
+
- fix: last ci fix for today ([#36](https://github.com/gyurielf/svelte-tel-input/pull/36))
|
|
16
|
+
|
|
17
|
+
* fix: ci fixxx ([#33](https://github.com/gyurielf/svelte-tel-input/pull/33))
|
|
9
18
|
|
|
19
|
+
- fix: ci extend 321 ([#32](https://github.com/gyurielf/svelte-tel-input/pull/32))
|
|
20
|
+
|
|
21
|
+
## 0.3.2
|
|
10
22
|
|
|
11
23
|
### Patch Changes
|
|
12
24
|
|
|
25
|
+
- feat: add MIT license ([#29](https://github.com/gyurielf/svelte-tel-input/pull/29))
|
|
13
26
|
|
|
27
|
+
* fix: fix readme deps ([#29](https://github.com/gyurielf/svelte-tel-input/pull/29))
|
|
14
28
|
|
|
15
|
-
|
|
29
|
+
## 0.3.1
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
16
32
|
|
|
33
|
+
- fix: lets check with different folder structure ([#25](https://github.com/gyurielf/svelte-tel-input/pull/25))
|
|
34
|
+
|
|
35
|
+
## 0.3.0
|
|
36
|
+
|
|
37
|
+
### Minor Changes
|
|
17
38
|
|
|
39
|
+
- fix: ci modifications ([#22](https://github.com/gyurielf/svelte-tel-input/pull/22))
|
|
18
40
|
|
|
19
|
-
|
|
41
|
+
## 0.2.0
|
|
20
42
|
|
|
43
|
+
### Minor Changes
|
|
44
|
+
|
|
45
|
+
- remove unused packages, cleanup, fix ci ([#19](https://github.com/gyurielf/svelte-tel-input/pull/19))
|
|
46
|
+
|
|
47
|
+
* fix: another CI fix ([#20](https://github.com/gyurielf/svelte-tel-input/pull/20))
|
|
48
|
+
|
|
49
|
+
## 0.1.0
|
|
50
|
+
|
|
51
|
+
### Minor Changes
|
|
52
|
+
|
|
53
|
+
- test_1
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- szo
|
|
21
58
|
|
|
59
|
+
* test 2
|
|
22
60
|
|
|
23
61
|
- test3
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 - Present Gyorgy Kallai, Budapest, Hungary.
|
|
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.
|
package/README.md
CHANGED
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-tel-input",
|
|
3
3
|
"description": "svelte-tel-input",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/gyurielf/svelte-tel-input.git"
|
|
8
8
|
},
|
|
9
9
|
"homepage": "https://github.com/gyurielf/svelte-tel-input#readme",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"svelte",
|
|
12
|
+
"tel input",
|
|
13
|
+
"phone",
|
|
14
|
+
"phone input",
|
|
15
|
+
"intl",
|
|
16
|
+
"intl tel input"
|
|
17
|
+
],
|
|
10
18
|
"engines": {
|
|
11
19
|
"npm": ">= 7",
|
|
12
20
|
"yarn": "please-use-npm",
|
|
@@ -14,7 +22,7 @@
|
|
|
14
22
|
},
|
|
15
23
|
"scripts": {
|
|
16
24
|
"build": "svelte-kit build",
|
|
17
|
-
"
|
|
25
|
+
"changeset:version": "changeset version && npm i --lockfile-only",
|
|
18
26
|
"dev": "svelte-kit dev",
|
|
19
27
|
"eslint": "eslint --ext .js,.ts,.svelte .",
|
|
20
28
|
"eslint:fix": "eslint --fix",
|
|
@@ -26,14 +34,11 @@
|
|
|
26
34
|
"prettier:fix": "prettier --write --plugin-search-dir=. .",
|
|
27
35
|
"prepare": "husky install",
|
|
28
36
|
"preview": "svelte-kit preview",
|
|
29
|
-
"release": "
|
|
30
|
-
"svelte-check": "svelte-check --ignore 'dist,build,coverage,.
|
|
31
|
-
"storybook": "start-storybook -p 6006",
|
|
32
|
-
"build-storybook": "build-storybook",
|
|
37
|
+
"release": "npx changeset publish",
|
|
38
|
+
"svelte-check": "svelte-check --ignore 'dist,build,coverage,.svelte-kit,package' --threshold warning --fail-on-warnings",
|
|
33
39
|
"test": "jest",
|
|
34
40
|
"test:watch": "jest --watch",
|
|
35
|
-
"ts": "tsc --noEmit"
|
|
36
|
-
"changeset:version": "changeset version && npm i --lockfile-only"
|
|
41
|
+
"ts": "tsc --noEmit"
|
|
37
42
|
},
|
|
38
43
|
"dependencies": {
|
|
39
44
|
"libphonenumber-js": "^1.9.44"
|
|
@@ -44,12 +49,6 @@
|
|
|
44
49
|
"@changesets/cli": "^2.19.0",
|
|
45
50
|
"@changesets/get-github-info": "^0.5.0",
|
|
46
51
|
"@changesets/types": "^4.0.2",
|
|
47
|
-
"@storybook/addon-a11y": "^6.4.13",
|
|
48
|
-
"@storybook/addon-actions": "^6.4.13",
|
|
49
|
-
"@storybook/addon-essentials": "^6.4.13",
|
|
50
|
-
"@storybook/addon-links": "^6.4.13",
|
|
51
|
-
"@storybook/addon-svelte-csf": "^1.1.0",
|
|
52
|
-
"@storybook/svelte": "^6.4.13",
|
|
53
52
|
"@sveltejs/adapter-static": "^1.0.0-next.26",
|
|
54
53
|
"@sveltejs/kit": "^1.0.0-next.229",
|
|
55
54
|
"@testing-library/jest-dom": "^5.16.1",
|
|
@@ -77,7 +76,6 @@
|
|
|
77
76
|
"prettier-plugin-svelte": "^2.6.0",
|
|
78
77
|
"standard-changelog": "^2.0.27",
|
|
79
78
|
"standard-version": "^9.3.2",
|
|
80
|
-
"storybook-dark-mode": "^1.0.8",
|
|
81
79
|
"svelte": "^3.46.2",
|
|
82
80
|
"svelte-check": "^2.3.0",
|
|
83
81
|
"svelte-inview": "^2.1.1",
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// taken from https://raw.githubusercontent.com/sveltejs/vite-plugin-svelte/master/scripts/changelog-github-custom.js
|
|
2
|
-
// based on https://github.com/atlassian/changesets/blob/main/packages/changelog-github/src/index.ts
|
|
3
|
-
// modifications to improve readability:
|
|
4
|
-
// - removed thanks notes. We're thanking contributors in the PRs or acknowledge their work in different ways
|
|
5
|
-
// - moved issue links to end of first line
|
|
6
|
-
|
|
7
1
|
const { config } = require('dotenv');
|
|
8
2
|
const { getInfo, getInfoFromPullRequest } = require('@changesets/get-github-info');
|
|
9
3
|
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SvelteComponentTyped } from 'svelte';
|
|
2
2
|
|
|
3
|
+
// TEMPORARY DISABLED
|
|
3
4
|
export type DynamicSvelteComponent = {
|
|
4
|
-
component: typeof
|
|
5
|
+
component: typeof SvelteComponentTyped;
|
|
5
6
|
props?: Record<string, any>;
|
|
6
7
|
slot?: any;
|
|
7
8
|
click?: any;
|
|
8
9
|
input?: any;
|
|
9
10
|
};
|
|
11
|
+
|
|
12
|
+
// declare const __propDef: {
|
|
13
|
+
// props: {};
|
|
14
|
+
// slots: {};
|
|
15
|
+
// events: {
|
|
16
|
+
// [evt: string]: CustomEvent<any>;
|
|
17
|
+
// };
|
|
18
|
+
// };
|
|
19
|
+
|
|
20
|
+
// export declare type DynamicSvelteComponentProps = typeof __propDef.props;
|
|
21
|
+
// export declare type DynamicSvelteComponentEvents = typeof __propDef.events;
|
|
22
|
+
// export declare type DynamicSvelteComponentSlots = typeof __propDef.slots;
|
|
23
|
+
|
|
24
|
+
// export default class DynamicSvelteComponent extends SvelteComponentTyped<
|
|
25
|
+
// DynamicSvelteComponentProps,
|
|
26
|
+
// DynamicSvelteComponentEvents,
|
|
27
|
+
// DynamicSvelteComponentSlots
|
|
28
|
+
// > {}
|
package/src/lib/stores/index.ts
CHANGED
|
@@ -13,11 +13,11 @@ export const booleanStore = (initial: boolean) => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
// StatefulSwap (transition)
|
|
16
|
-
export const statefulSwap = (initialState:
|
|
16
|
+
export const statefulSwap = (initialState: boolean | null) => {
|
|
17
17
|
const transitionState = writable(initialState);
|
|
18
18
|
let nextState = initialState;
|
|
19
19
|
|
|
20
|
-
const transitionTo = (newState:
|
|
20
|
+
const transitionTo = (newState: boolean | null) => {
|
|
21
21
|
if (nextState === newState) return;
|
|
22
22
|
nextState = newState;
|
|
23
23
|
transitionState.set(null);
|
package/svelte.config.js
CHANGED
|
@@ -18,13 +18,7 @@ export default {
|
|
|
18
18
|
return mm.all(filepath, ['!**/_*.scss', '!**/*.test.*']);
|
|
19
19
|
},
|
|
20
20
|
files: (filepath) => {
|
|
21
|
-
return mm.all(filepath, [
|
|
22
|
-
'!**/.*',
|
|
23
|
-
'!**/*.test.*',
|
|
24
|
-
'!**/*.stories.*',
|
|
25
|
-
'!**/Storybook/Style.svelte',
|
|
26
|
-
'!**/*.sh'
|
|
27
|
-
]);
|
|
21
|
+
return mm.all(filepath, ['!**/.*', '!**/*.test.*', '!**/*.sh']);
|
|
28
22
|
}
|
|
29
23
|
},
|
|
30
24
|
adapter: staticAdapter(),
|
package/.storybook/main.cjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const sveltePreprocess = require('svelte-preprocess');
|
|
2
|
-
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const autoprefixer = require('autoprefixer');
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|mdx|svelte)'],
|
|
8
|
-
addons: [
|
|
9
|
-
'@storybook/addon-links',
|
|
10
|
-
'@storybook/addon-essentials',
|
|
11
|
-
'@storybook/addon-svelte-csf',
|
|
12
|
-
'storybook-dark-mode',
|
|
13
|
-
'@storybook/addon-a11y'
|
|
14
|
-
],
|
|
15
|
-
svelteOptions: {
|
|
16
|
-
preprocess: [
|
|
17
|
-
sveltePreprocess({
|
|
18
|
-
postcss: {
|
|
19
|
-
plugins: [autoprefixer]
|
|
20
|
-
},
|
|
21
|
-
scss: {
|
|
22
|
-
// Should replaced to tailwind..
|
|
23
|
-
// prependData: `@import 'src/lib/styles/init/all.scss';`,
|
|
24
|
-
outputStyle: 'compressed'
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
webpackFinal: async (config) => {
|
|
30
|
-
config.resolve.plugins.push(
|
|
31
|
-
new TsconfigPathsPlugin({
|
|
32
|
-
configFile: path.resolve(__dirname, '../tsconfig.json')
|
|
33
|
-
})
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return config;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!--gitlab_visual_review-->
|
package/.storybook/preview.cjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { themes } from '@storybook/theming';
|
|
2
|
-
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
|
|
3
|
-
|
|
4
|
-
export const parameters = {
|
|
5
|
-
darkMode: {
|
|
6
|
-
// Override the default dark theme
|
|
7
|
-
dark: { ...themes.dark, appBg: 'black' },
|
|
8
|
-
// Override the default light theme
|
|
9
|
-
light: { ...themes.normal, appBg: 'white' },
|
|
10
|
-
classTarget: 'html',
|
|
11
|
-
stylePreview: true,
|
|
12
|
-
darkClass: 'dark',
|
|
13
|
-
lightClass: 'light'
|
|
14
|
-
},
|
|
15
|
-
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
16
|
-
controls: {
|
|
17
|
-
matchers: {
|
|
18
|
-
color: /(background|color)$/i,
|
|
19
|
-
date: /Date$/
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
backgrounds: {
|
|
23
|
-
default: '',
|
|
24
|
-
values: [
|
|
25
|
-
{
|
|
26
|
-
name: 'Light',
|
|
27
|
-
value: '#f5f6fa'
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'Dark',
|
|
31
|
-
value: '#1b2431'
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
target: 'html'
|
|
35
|
-
},
|
|
36
|
-
viewport: {
|
|
37
|
-
viewports: INITIAL_VIEWPORTS
|
|
38
|
-
}
|
|
39
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { inview } from 'svelte-inview';
|
|
3
|
-
|
|
4
|
-
let loadComponent: any;
|
|
5
|
-
export { loadComponent as this };
|
|
6
|
-
|
|
7
|
-
let isShowingComponent = false;
|
|
8
|
-
let componentPromise: any;
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
{#if !isShowingComponent}
|
|
12
|
-
<div
|
|
13
|
-
use:inview
|
|
14
|
-
on:enter={() => {
|
|
15
|
-
componentPromise = loadComponent();
|
|
16
|
-
isShowingComponent = true;
|
|
17
|
-
}}
|
|
18
|
-
/>
|
|
19
|
-
{:else}
|
|
20
|
-
{#await componentPromise then { default: Component }}
|
|
21
|
-
<slot name="component" {Component} />
|
|
22
|
-
{/await}
|
|
23
|
-
{/if}
|