@codewithshin/svelte-utterances
Advanced tools
Comparing version 0.2.2 to 0.2.4
@@ -5,2 +5,23 @@ # Changelog | ||
### [0.2.4](https://github.com/shinokada/svelte-uttrances/compare/v0.2.3...v0.2.4) (2022-10-21) | ||
### [0.2.3](https://github.com/shinokada/svelte-uttrances/compare/v0.2.2...v0.2.3) (2022-10-21) | ||
### Features | ||
* add localStorage and Svelte store ([eeed32e](https://github.com/shinokada/svelte-uttrances/commit/eeed32e0326c9ccc1e046026c7ea09bca5c29294)) | ||
* add theme switch page ([9cd1afc](https://github.com/shinokada/svelte-uttrances/commit/9cd1afc17ea709ddf4912ea3ca0b0ffd929e4cf7)) | ||
### Bug Fixes | ||
* add select ([7e20f41](https://github.com/shinokada/svelte-uttrances/commit/7e20f4160168efd4f50e9f01dea7e5afd70d6ab0)) | ||
* keep the theme after refresh ([69898be](https://github.com/shinokada/svelte-uttrances/commit/69898bea29beea992679cc7d6188d04e90c8535e)) | ||
* merge conflict ([2e2642e](https://github.com/shinokada/svelte-uttrances/commit/2e2642e02df4498426bf3ba8e75e6865d2de9f10)) | ||
* scripts in package.json ([99d0d1d](https://github.com/shinokada/svelte-uttrances/commit/99d0d1df59770cebc0af272ccfc9453e8c8a8b68)) | ||
* theme select ([69b4cb7](https://github.com/shinokada/svelte-uttrances/commit/69b4cb7b03c1922851b010f34e4bccda4c946775)) | ||
* update demo site ([683b607](https://github.com/shinokada/svelte-uttrances/commit/683b607c10d246df509cbec1a88a2fe942f250d2)) | ||
* use browser false for Svelte (not Kit) and use getElementsByClassName for multiple iframes ([be7ef03](https://github.com/shinokada/svelte-uttrances/commit/be7ef03499738facebc4975e96c7311d35b8869d)) | ||
### 0.2.2 (2022-04-11) | ||
@@ -7,0 +28,0 @@ |
@@ -1,2 +0,2 @@ | ||
export { Utterances }; | ||
import Utterances from "./Utterances.svelte"; | ||
export { default as Utterances } from "./Utterances.svelte"; | ||
export { default as utterancesTheme } from "./theme"; |
@@ -1,3 +0,2 @@ | ||
import Utterances from "./Utterances.svelte" | ||
export {Utterances} | ||
export { default as Utterances } from "./Utterances.svelte" | ||
export { default as utterancesTheme } from "./theme" |
{ | ||
"name": "@codewithshin/svelte-utterances", | ||
"version": "0.2.2", | ||
"version": "0.2.4", | ||
"description": "Svelte Utterances Component", | ||
@@ -14,6 +14,29 @@ "author": { | ||
"devDependencies": { | ||
"@playwright/test": "^1.25.0", | ||
"@popperjs/core": "^2.11.6", | ||
"@sveltejs/adapter-auto": "next", | ||
"@sveltejs/kit": "next", | ||
"@sveltejs/package": "next", | ||
"@typescript-eslint/eslint-plugin": "^5.27.0", | ||
"@typescript-eslint/parser": "^5.27.0", | ||
"autoprefixer": "^10.4.7", | ||
"classnames": "^2.3.2", | ||
"eslint": "^8.16.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-svelte3": "^4.0.0", | ||
"flowbite": "^1.5.3", | ||
"flowbite-svelte": "^0.27.9", | ||
"mdsvex": "^0.10.6", | ||
"postcss": "^8.4.14", | ||
"postcss-load-config": "^4.0.1", | ||
"prettier": "^2.6.2", | ||
"prettier-plugin-svelte": "^2.7.0", | ||
"prism-themes": "^1.9.0", | ||
"svelte": "^3.44.0", | ||
"svelte2tsx": "^0.5.5" | ||
"svelte-check": "^2.7.1", | ||
"svelte-preprocess": "^4.10.7", | ||
"tailwindcss": "^3.1.5", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.7.4", | ||
"vite": "^3.1.0" | ||
}, | ||
@@ -33,5 +56,6 @@ "type": "module", | ||
"./Utterances.svelte": "./Utterances.svelte", | ||
".": "./index.js" | ||
".": "./index.js", | ||
"./theme": "./theme.js" | ||
}, | ||
"svelte": "./index.js" | ||
} |
@@ -7,3 +7,2 @@ # svelte-utterances | ||
## Installation | ||
@@ -15,8 +14,2 @@ | ||
After cloning this repo, you can see Svelte-Utterances in action in the demo-site branch. | ||
```sh | ||
git checkout demo-site | ||
``` | ||
## Props | ||
@@ -57,76 +50,5 @@ | ||
```js | ||
<script> | ||
import { Utterances } from '@codewithshin/svelte-utterances' | ||
</script> | ||
- [Default](https://svelte-utterances.vercel.app/) | ||
- [Dynamic](https://svelte-utterances.vercel.app/dynamic) | ||
<Utterances | ||
theme="github-dark" | ||
reponame="yourname/repo-name" | ||
/> | ||
``` | ||
Check more details [Svelte-Utterances](https://svelte-utterances.vercel.app/) | ||
## Theme switch | ||
You can toggle between two themes. | ||
```html | ||
<script> | ||
import Utterances from "@codewithshin/svelte-utterances"; | ||
import {Button} from 'flowbite-svelte' | ||
let theme = "github-light"; | ||
const switchTheme = () => { | ||
theme = theme === "github-light" ? "github-dark" : "github-light"; | ||
}; | ||
</script> | ||
<Button on:click={switchTheme} name="Toggle theme" /> | ||
<Utterances reponame="shinokada/svelte-utterances" {theme} /> | ||
``` | ||
## Dynamic theme switching | ||
This is an example of how to reactively change the theme. | ||
Install `Flowbite-Svelte`: | ||
```sh | ||
npm i -D flowbite-svelte | ||
``` | ||
```html | ||
<script> | ||
import { Utterances } from "@codewithshin/svelte-utterances"; | ||
import { Select } from "flowbite-svelte"; | ||
let theme = "github-light"; | ||
let selectprops = { | ||
id: "theme-select", | ||
name: "theme-select", | ||
label: "Select your theme", | ||
}; | ||
let selectClass = | ||
"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-48 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"; | ||
</script> | ||
<div class="my-16 relative"> | ||
<Select {...selectprops} bind:value={theme} {selectClass}> | ||
<option value="github-light">GitHub Light</option> | ||
<option value="github-dark">GitHub Dark</option> | ||
<option value="github-dark-orange">GitHub Dark Orange</option> | ||
<option value="icy-dark">Icy Dark</option> | ||
<option value="dark-blue">Dark Blue</option> | ||
<option value="photon-dark">Photon Dark</option> | ||
<option value="boxy-light">Boxy Light</option> | ||
<option value="gruvbox-dark">Gruvbox Dark</option> | ||
</Select> | ||
<Utterances reponame="shinokada/svelte-utterances" {theme} /> | ||
</div> | ||
``` | ||
Check more details [Utterances](https://utteranc.es/) | ||
## Credits | ||
@@ -133,0 +55,0 @@ |
@@ -6,5 +6,5 @@ /** @typedef {typeof __propDef.props} UtterancesProps */ | ||
reponame: string; | ||
issueTerm?: string; | ||
label?: string; | ||
theme?: string; | ||
issueTerm?: string | undefined; | ||
label?: string | undefined; | ||
theme?: string | undefined; | ||
}, { | ||
@@ -21,5 +21,5 @@ [evt: string]: CustomEvent<any>; | ||
reponame: string; | ||
issueTerm?: string; | ||
label?: string; | ||
theme?: string; | ||
issueTerm?: string | undefined; | ||
label?: string | undefined; | ||
theme?: string | undefined; | ||
}; | ||
@@ -26,0 +26,0 @@ events: { |
Sorry, the diff of this file is not supported yet
7949
9
45
27
58