-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use lit element to refactor search component (#18)
Signed-off-by: Ryan Wang <[email protected]>
- Loading branch information
Showing
47 changed files
with
2,557 additions
and
5,143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<link rel="icon" href="/favicon.ico"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Vite App</title> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + Lit + TS</title> | ||
<script type="module" src="/src/main.ts"></script> | ||
<style> | ||
:root { | ||
--halo-bg: #000; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
<search-modal baseUrl="https://ryanc.cc"></search-modal> | ||
<search-form baseUrl="http://127.0.0.1:8090"></search-form> | ||
<button id="btn">点开</button> | ||
<script> | ||
const btn = document.getElementById("btn"); | ||
btn.addEventListener("click", () => { | ||
const searchModal = document.querySelector("search-modal"); | ||
searchModal.open = true; | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
import { createApp } from "vue"; | ||
import App from "./App.vue"; | ||
|
||
createApp(App).mount("#app"); | ||
import "@halo-dev/search-widget"; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
{ | ||
"extends": "@vue/tsconfig/tsconfig.web.json", | ||
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"], | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
} | ||
}, | ||
|
||
"references": [ | ||
{ | ||
"path": "./tsconfig.config.json" | ||
} | ||
] | ||
"extends": "../../tsconfig.json", | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"env": { | ||
"browser": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"singleQuote": true, | ||
"bracketSpacing": true, | ||
"arrowParens": "always" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,31 @@ | ||
{ | ||
"name": "@halo-dev/search-widget", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js" | ||
} | ||
}, | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"type": "module", | ||
"main": "./dist/halo-search-widget.es.js", | ||
"module": "./dist/halo-search-widget.es.js", | ||
"unpkg": "./dist/halo-search-widget.iife.js", | ||
"jsdelivr": "./dist/halo-search-widget.iife.js", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"dev": "vite build --watch", | ||
"build": "run-p type-check build-only", | ||
"preview": "vite preview", | ||
"test:unit": "vitest --environment jsdom --root src/", | ||
"build-only": "vite build", | ||
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false", | ||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", | ||
"release": "release-it" | ||
"dev": "tsc -w", | ||
"build": "tsc", | ||
"lint": "lit-analyzer && eslint 'src/**/*.ts'", | ||
"prettier": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --ignore-path ./.gitignore --write" | ||
}, | ||
"dependencies": { | ||
"@halo-dev/components": "^1.5.0", | ||
"@vueuse/core": "^9.13.0", | ||
"axios": "^1.4.0", | ||
"lodash.debounce": "^4.0.8" | ||
"lit": "^3.0.0", | ||
"lodash-es": "^4.17.21" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash.debounce": "^4.0.7", | ||
"autoprefixer": "^10.4.14", | ||
"postcss": "^8.4.24", | ||
"release-it": "^15.10.3", | ||
"tailwindcss": "^3.3.2" | ||
}, | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/halo-search-widget.es.js" | ||
}, | ||
"./dist/style.css": "./dist/style.css" | ||
"@types/lodash-es": "^4.17.10", | ||
"lit-analyzer": "^1.2.1" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.