Skip Typescript compilation on packaging
This commit is contained in:
parent
252c812125
commit
f70f670ed3
7
.githooks/pre-push
Normal file
7
.githooks/pre-push
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
pnpm lint
|
||||||
|
pnpm check
|
||||||
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@ -24,3 +24,21 @@ jobs:
|
|||||||
run: pnpm lint
|
run: pnpm lint
|
||||||
- name: Run check
|
- name: Run check
|
||||||
run: pnpm check
|
run: pnpm check
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: [lint]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Publish
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
run: |
|
||||||
|
cd package
|
||||||
|
pnpm publish --no-git-checks --tag alpha
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
- uses: EndBug/add-and-commit@v9
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
with:
|
||||||
|
message: "Bump package version [skip ci]"
|
||||||
|
default_author: github_actions
|
||||||
|
|||||||
50
.github/workflows/release.yml
vendored
50
.github/workflows/release.yml
vendored
@ -1,50 +0,0 @@
|
|||||||
name: Release
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2.1.0
|
|
||||||
with:
|
|
||||||
version: 6.32.0
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '18'
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
|
|
||||||
- name: Cache pnpm modules
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ~/.pnpm-store
|
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Package
|
|
||||||
run: |
|
|
||||||
pnpm version patch --commit-hooks false --git-tag-version false
|
|
||||||
pnpm package
|
|
||||||
|
|
||||||
- name: Publish
|
|
||||||
run: |
|
|
||||||
cd package
|
|
||||||
pnpm publish --no-git-checks --tag alpha
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
|
|
||||||
- uses: EndBug/add-and-commit@v9
|
|
||||||
with:
|
|
||||||
message: 'Bump package version [skip ci]'
|
|
||||||
default_author: github_actions
|
|
||||||
29
.npmignore
Normal file
29
.npmignore
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules/
|
||||||
|
build/
|
||||||
|
.svelte-kit/
|
||||||
|
package/
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
.vercel
|
||||||
|
generated/
|
||||||
|
.githooks/
|
||||||
|
.github/
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
docs/
|
||||||
|
generated/
|
||||||
|
locales/
|
||||||
|
.eslintrc.cjs
|
||||||
|
.gitignore
|
||||||
|
.gitmodules
|
||||||
|
.npmignore
|
||||||
|
.npmrc
|
||||||
|
.prettierignore
|
||||||
|
.prettierrc
|
||||||
|
postcss.config.cjs
|
||||||
|
mdsvex.config.js
|
||||||
|
svelte.config.js
|
||||||
|
tsconfig.json
|
||||||
|
pnpm-lock.yaml
|
||||||
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -11,6 +11,7 @@
|
|||||||
"gitlens.hovers.enabled": false,
|
"gitlens.hovers.enabled": false,
|
||||||
"svelte.enable-ts-plugin": true,
|
"svelte.enable-ts-plugin": true,
|
||||||
"svelte.ask-to-enable-ts-plugin": false,
|
"svelte.ask-to-enable-ts-plugin": false,
|
||||||
|
"svelte.plugin.svelte.useNewTransformation": true,
|
||||||
"yaml.schemas": {
|
"yaml.schemas": {
|
||||||
"https://json.schemastore.org/github-workflow.json": "file:///Users/sha/Code/Modrinth/knossos/.github/workflows/deploy.yml"
|
"https://json.schemastore.org/github-workflow.json": "file:///Users/sha/Code/Modrinth/knossos/.github/workflows/deploy.yml"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
import IconChat from 'virtual:icons/heroicons-outline/chat-alt-2'
|
import IconChat from 'virtual:icons/heroicons-outline/chat-alt-2'
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
|
|
||||||
let headerElement
|
let headerElement: HTMLElement
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
let lastScrollTop: number
|
let lastScrollTop: number
|
||||||
|
|||||||
1
docs/global.d.ts
vendored
1
docs/global.d.ts
vendored
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
declare module '$assets/images/*'
|
declare module '$assets/images/*'
|
||||||
declare module '$locales/*'
|
declare module '$locales/*'
|
||||||
|
declare module 'insane'
|
||||||
|
|
||||||
declare module '*.svg' {
|
declare module '*.svg' {
|
||||||
export { SvelteComponentDev as default } from 'svelte/internal'
|
export { SvelteComponentDev as default } from 'svelte/internal'
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
$page.url.pathname.replace('/', '') || 'index'
|
$page.url.pathname.replace('/', '') || 'index'
|
||||||
}.md`
|
}.md`
|
||||||
|
|
||||||
let api
|
let api = { props: [], events: [], slots: [] }
|
||||||
if ($page.url.pathname.includes('components')) {
|
if ($page.url.pathname.includes('components')) {
|
||||||
if (import.meta.env.DEV) {
|
if (import.meta.env.DEV) {
|
||||||
import(`../../src/components/${title}.svelte?raw&sveld`).then(
|
import(`../../src/components/${title}.svelte?raw&sveld`).then(
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { ComponentParser } from 'sveld'
|
|||||||
import * as svelte from 'svelte/compiler'
|
import * as svelte from 'svelte/compiler'
|
||||||
import fs from 'fs/promises'
|
import fs from 'fs/promises'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { preprocess } from '../../src/config/svelte.config.js'
|
import { preprocess } from '../../src/config/svelte.js'
|
||||||
|
|
||||||
export default function sveld() {
|
export default function sveld() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
<Button color="primary" slot="button"><IconArrowRight /> Continue</Button>
|
<Button color="primary" slot="button"><IconArrowRight /> Continue</Button>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal let:trigger size='sm'>
|
<Modal let:trigger size="sm">
|
||||||
<Button on:click={trigger} slot="trigger">Confirm modal</Button>
|
<Button on:click={trigger} slot="trigger">Confirm modal</Button>
|
||||||
|
|
||||||
Are you sure you want to delete this gallery image?
|
Are you sure you want to delete this gallery image?
|
||||||
|
|||||||
@ -3,7 +3,11 @@
|
|||||||
import { ModalDeletion, Button } from 'omorphia'
|
import { ModalDeletion, Button } from 'omorphia'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ModalDeletion type="account" key="venashial" let:trigger on:deletion={() => console.log('Do something...')}>
|
<ModalDeletion
|
||||||
|
type="account"
|
||||||
|
key="venashial"
|
||||||
|
let:trigger
|
||||||
|
on:deletion={() => console.log('Do something...')}>
|
||||||
<Button slot="trigger" color="danger" on:click={trigger}>Delete account</Button>
|
<Button slot="trigger" color="danger" on:click={trigger}>Delete account</Button>
|
||||||
</ModalDeletion>
|
</ModalDeletion>
|
||||||
```
|
```
|
||||||
|
|||||||
@ -9,7 +9,7 @@ To make use of the built-in icons, styles, and plugins in omorphia, you will nee
|
|||||||
Add the following parts to your `svelte.config.js` file:
|
Add the following parts to your `svelte.config.js` file:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { preprocess, plugins } from 'omorphia/config/svelte.config'
|
import { preprocess, plugins } from 'omorphia/config/svelte.js'
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
const config = {
|
const config = {
|
||||||
@ -32,5 +32,5 @@ Create a `postcss.config.cjs` file in the root of your project.
|
|||||||
Add the following line to that file:
|
Add the following line to that file:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
module.exports = require('omorphia/config/postcss.config.cjs')
|
module.exports = require('omorphia/config/postcss.cjs')
|
||||||
```
|
```
|
||||||
|
|||||||
@ -23,13 +23,15 @@ The `markdown` parser is designed for bodies of markdown text and supports image
|
|||||||
#### An image \n\
|
#### An image \n\
|
||||||
'
|
'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="card markdown">
|
<div class="card markdown">
|
||||||
{@html markdown(source)}
|
{@html markdown(source)}
|
||||||
{@html markdown(
|
{@html markdown(
|
||||||
` | Syntax | Description |
|
` | Syntax | Description |
|
||||||
| ----------- | ----------- |
|
| ----------- | ----------- |
|
||||||
| Header | Title |
|
| Header | Title |
|
||||||
| Paragraph | Text |`)}
|
| Paragraph | Text |`
|
||||||
|
)}
|
||||||
{@html markdown('```js\nconsole.log("test")\n```')}
|
{@html markdown('```js\nconsole.log("test")\n```')}
|
||||||
</div>
|
</div>
|
||||||
````
|
````
|
||||||
|
|||||||
53
package.json
53
package.json
@ -14,28 +14,6 @@
|
|||||||
"lint": "prettier --ignore-path .prettierignore --check --plugin-search-dir=. . && eslint --ignore-path .prettierignore .",
|
"lint": "prettier --ignore-path .prettierignore --check --plugin-search-dir=. . && eslint --ignore-path .prettierignore .",
|
||||||
"format": "prettier --ignore-path .prettierignore --write --plugin-search-dir=. ."
|
"format": "prettier --ignore-path .prettierignore --write --plugin-search-dir=. ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
|
||||||
"@sveltejs/adapter-static": "^1.0.0-next.29",
|
|
||||||
"@sveltejs/kit": "next",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
||||||
"@typescript-eslint/parser": "^5.10.1",
|
|
||||||
"eslint": "^7.32.0",
|
|
||||||
"eslint-config-prettier": "^8.3.0",
|
|
||||||
"eslint-plugin-svelte3": "^3.2.1",
|
|
||||||
"mdsvex": "^0.10.5",
|
|
||||||
"mdsvexamples": "^0.3.0",
|
|
||||||
"nodemon": "^2.0.15",
|
|
||||||
"prettier": "^2.6.2",
|
|
||||||
"prettier-plugin-svelte": "^2.7.0",
|
|
||||||
"sveld": "^0.13.4",
|
|
||||||
"svelte": "^3.48.0",
|
|
||||||
"svelte-check": "^2.2.6",
|
|
||||||
"svelte-intl-precompile": "^0.11.1",
|
|
||||||
"svelte-preprocess": "^4.10.1",
|
|
||||||
"svelte2tsx": "^0.5.5",
|
|
||||||
"tslib": "^2.3.1",
|
|
||||||
"typescript": "~4.6.2"
|
|
||||||
},
|
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"svelte": "index.js",
|
"svelte": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -53,6 +31,37 @@
|
|||||||
"url": "https://github.com/modrinth/omorphia/issues"
|
"url": "https://github.com/modrinth/omorphia/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://omorphia.modrinth.com",
|
"homepage": "https://omorphia.modrinth.com",
|
||||||
|
"exports": {
|
||||||
|
".": "./src/index",
|
||||||
|
"./utils": "./src//utils/index.ts",
|
||||||
|
"./styles": "./src/styles.postcss",
|
||||||
|
"./plugins": "./src/plugins/index.js",
|
||||||
|
"./config/postcss": "./src/config/postcss.cjs",
|
||||||
|
"./config/svelte": "./src/config/svelte.js"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@sveltejs/adapter-static": "^1.0.0-next.29",
|
||||||
|
"@sveltejs/kit": "next",
|
||||||
|
"@types/marked": "^4.0.3",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
||||||
|
"@typescript-eslint/parser": "^5.10.1",
|
||||||
|
"eslint": "^7.32.0",
|
||||||
|
"eslint-config-prettier": "^8.3.0",
|
||||||
|
"eslint-plugin-svelte3": "^3.2.1",
|
||||||
|
"mdsvex": "^0.10.5",
|
||||||
|
"mdsvexamples": "^0.3.0",
|
||||||
|
"nodemon": "^2.0.15",
|
||||||
|
"prettier": "^2.6.2",
|
||||||
|
"prettier-plugin-svelte": "^2.7.0",
|
||||||
|
"sveld": "^0.13.4",
|
||||||
|
"svelte": "^3.48.0",
|
||||||
|
"svelte-check": "^2.7.2",
|
||||||
|
"svelte-intl-precompile": "^0.11.1",
|
||||||
|
"svelte-preprocess": "^4.10.1",
|
||||||
|
"svelte2tsx": "^0.5.5",
|
||||||
|
"tslib": "^2.3.1",
|
||||||
|
"typescript": "~4.6.2"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@iconify-json/carbon": "^1.1.1",
|
"@iconify-json/carbon": "^1.1.1",
|
||||||
"@iconify-json/fa-regular": "^1.1.1",
|
"@iconify-json/fa-regular": "^1.1.1",
|
||||||
|
|||||||
17
pnpm-lock.yaml
generated
17
pnpm-lock.yaml
generated
@ -10,6 +10,7 @@ specifiers:
|
|||||||
'@poppanator/sveltekit-svg': ^0.3.1
|
'@poppanator/sveltekit-svg': ^0.3.1
|
||||||
'@sveltejs/adapter-static': ^1.0.0-next.29
|
'@sveltejs/adapter-static': ^1.0.0-next.29
|
||||||
'@sveltejs/kit': next
|
'@sveltejs/kit': next
|
||||||
|
'@types/marked': ^4.0.3
|
||||||
'@typescript-eslint/eslint-plugin': ^5.10.1
|
'@typescript-eslint/eslint-plugin': ^5.10.1
|
||||||
'@typescript-eslint/parser': ^5.10.1
|
'@typescript-eslint/parser': ^5.10.1
|
||||||
cli-progress: ^3.11.1
|
cli-progress: ^3.11.1
|
||||||
@ -39,7 +40,7 @@ specifiers:
|
|||||||
sanitize.css: ^13.0.0
|
sanitize.css: ^13.0.0
|
||||||
sveld: ^0.13.4
|
sveld: ^0.13.4
|
||||||
svelte: ^3.48.0
|
svelte: ^3.48.0
|
||||||
svelte-check: ^2.2.6
|
svelte-check: ^2.7.2
|
||||||
svelte-intl-precompile: ^0.11.1
|
svelte-intl-precompile: ^0.11.1
|
||||||
svelte-preprocess: ^4.10.1
|
svelte-preprocess: ^4.10.1
|
||||||
svelte-tiny-virtual-list: ^2.0.1
|
svelte-tiny-virtual-list: ^2.0.1
|
||||||
@ -85,6 +86,7 @@ dependencies:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
'@sveltejs/adapter-static': 1.0.0-next.29
|
'@sveltejs/adapter-static': 1.0.0-next.29
|
||||||
'@sveltejs/kit': 1.0.0-next.350_svelte@3.48.0
|
'@sveltejs/kit': 1.0.0-next.350_svelte@3.48.0
|
||||||
|
'@types/marked': 4.0.3
|
||||||
'@typescript-eslint/eslint-plugin': 5.14.0_4p27j37cxves4nxlnqogdhp4ta
|
'@typescript-eslint/eslint-plugin': 5.14.0_4p27j37cxves4nxlnqogdhp4ta
|
||||||
'@typescript-eslint/parser': 5.14.0_e6rt7vlgxfprtuallp2t3cvyi4
|
'@typescript-eslint/parser': 5.14.0_e6rt7vlgxfprtuallp2t3cvyi4
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
@ -97,7 +99,7 @@ devDependencies:
|
|||||||
prettier-plugin-svelte: 2.7.0_kkjbqzpydplecjtkxrgomroeru
|
prettier-plugin-svelte: 2.7.0_kkjbqzpydplecjtkxrgomroeru
|
||||||
sveld: 0.13.4_jw3wiphoy34i6ad2hx6ga3jifa
|
sveld: 0.13.4_jw3wiphoy34i6ad2hx6ga3jifa
|
||||||
svelte: 3.48.0
|
svelte: 3.48.0
|
||||||
svelte-check: 2.4.5_2pvebpkgu3ohgo43qaf5qmcxwm
|
svelte-check: 2.7.2_2pvebpkgu3ohgo43qaf5qmcxwm
|
||||||
svelte-intl-precompile: 0.11.1_svelte@3.48.0
|
svelte-intl-precompile: 0.11.1_svelte@3.48.0
|
||||||
svelte-preprocess: 4.10.4_44qe5g6fi6uxvss56imdgyaaty
|
svelte-preprocess: 4.10.4_44qe5g6fi6uxvss56imdgyaaty
|
||||||
svelte2tsx: 0.5.5_c64miirrcucob5yjzfkddrmila
|
svelte2tsx: 0.5.5_c64miirrcucob5yjzfkddrmila
|
||||||
@ -1143,6 +1145,10 @@ packages:
|
|||||||
'@types/node': 17.0.21
|
'@types/node': 17.0.21
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@types/marked/4.0.3:
|
||||||
|
resolution: {integrity: sha512-HnMWQkLJEf/PnxZIfbm0yGJRRZYYMhb++O9M36UCTA9z53uPvVoSlAwJr3XOpDEryb7Hwl1qAx/MV6YIW1RXxg==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@types/node/16.9.1:
|
/@types/node/16.9.1:
|
||||||
resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==}
|
resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==}
|
||||||
dev: false
|
dev: false
|
||||||
@ -4866,19 +4872,18 @@ packages:
|
|||||||
- sugarss
|
- sugarss
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/svelte-check/2.4.5_2pvebpkgu3ohgo43qaf5qmcxwm:
|
/svelte-check/2.7.2_2pvebpkgu3ohgo43qaf5qmcxwm:
|
||||||
resolution: {integrity: sha512-nRft8BbG2wcxyCdHDZ7X43xLcvDzua3xLwq6wzHGcAF3ka3Jyhv2rvgq0+SF9NwHLMefp9C2XkM6etzsxK/cMQ==}
|
resolution: {integrity: sha512-TuVX4YtXHbRM8sVuK5Jk+mKWdm3f0d6hvAC6qCTp8yUszGZewpEBCo2V5fRWZCiz+0J4OCiDHOS+DFMxv39rJA==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
svelte: ^3.24.0
|
svelte: ^3.24.0
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@jridgewell/trace-mapping': 0.3.13
|
||||||
chokidar: 3.5.3
|
chokidar: 3.5.3
|
||||||
fast-glob: 3.2.11
|
fast-glob: 3.2.11
|
||||||
import-fresh: 3.3.0
|
import-fresh: 3.3.0
|
||||||
minimist: 1.2.5
|
|
||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
sade: 1.8.1
|
sade: 1.8.1
|
||||||
source-map: 0.7.3
|
|
||||||
svelte: 3.48.0
|
svelte: 3.48.0
|
||||||
svelte-preprocess: 4.10.4_44qe5g6fi6uxvss56imdgyaaty
|
svelte-preprocess: 4.10.4_44qe5g6fi6uxvss56imdgyaaty
|
||||||
typescript: 4.6.2
|
typescript: 4.6.2
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
module.exports = require('./src/config/postcss.config.cjs')
|
module.exports = require('./src/config/postcss.cjs')
|
||||||
|
|||||||
@ -18,13 +18,13 @@
|
|||||||
floatUp && 'avatar--float-up',
|
floatUp && 'avatar--float-up',
|
||||||
])
|
])
|
||||||
|
|
||||||
let img
|
let img: HTMLImageElement
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if (img && img.naturalWidth) {
|
if (img && img.naturalWidth) {
|
||||||
const isPixelated = () => {
|
const isPixelated = () => {
|
||||||
if (img.naturalWidth < 96 && img.naturalWidth > 0) {
|
if (img.naturalWidth < 96 && img.naturalWidth > 0) {
|
||||||
img.style = 'image-rendering: pixelated;'
|
img.style.imageRendering = 'pixelated'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,8 +8,8 @@
|
|||||||
/** Wrap the options horizontally */
|
/** Wrap the options horizontally */
|
||||||
export let wrap = false
|
export let wrap = false
|
||||||
|
|
||||||
const handleChange = (e, key) => {
|
const handleChange = (event: any, key: string | number) => {
|
||||||
if (e.target.checked) {
|
if (event.target.checked) {
|
||||||
if (!value) value = []
|
if (!value) value = []
|
||||||
value = [key, ...value]
|
value = [key, ...value]
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -11,8 +11,8 @@
|
|||||||
export let value = []
|
export let value = []
|
||||||
export let options: Option[] = []
|
export let options: Option[] = []
|
||||||
|
|
||||||
const handleChange = (e, key) => {
|
const handleChange = (event: any, key: string | number) => {
|
||||||
if (e.target.checked) {
|
if (event.target.checked) {
|
||||||
if (!value) value = []
|
if (!value) value = []
|
||||||
value = [key, ...value]
|
value = [key, ...value]
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
import IconUpload from 'virtual:icons/heroicons-outline/upload'
|
import IconUpload from 'virtual:icons/heroicons-outline/upload'
|
||||||
import IconFile from 'virtual:icons/lucide/file'
|
import IconFile from 'virtual:icons/lucide/file'
|
||||||
import { t } from 'svelte-intl-precompile'
|
import { t } from 'svelte-intl-precompile'
|
||||||
import Button from 'omorphia/components/Button.svelte'
|
import Button from './Button.svelte'
|
||||||
import { classCombine } from 'omorphia/utils/classCombine'
|
import { classCombine } from '../utils/classCombine'
|
||||||
|
|
||||||
export let multiple = false
|
export let multiple = false
|
||||||
export let accept: string
|
export let accept: string
|
||||||
|
|||||||
@ -19,8 +19,11 @@
|
|||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal title={$t(`modal.deletion.${type}.title`)} bind:open let:trigger bind:data>
|
<!-- @ts-ignore -->
|
||||||
<slot slot="trigger" name="trigger" {trigger} />
|
<Modal title={$t(`modal.deletion.${type}.title`)} bind:open bind:data>
|
||||||
|
<svelte:fragment slot="trigger" let:trigger>
|
||||||
|
<slot name="trigger" {trigger} />
|
||||||
|
</svelte:fragment>
|
||||||
|
|
||||||
{#if type === 'account' || 'project'}
|
{#if type === 'account' || 'project'}
|
||||||
<div class="important-banner">
|
<div class="important-banner">
|
||||||
@ -35,11 +38,10 @@
|
|||||||
{id} />
|
{id} />
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
|
<svelte:fragment slot="button" let:close>
|
||||||
<Button
|
<Button
|
||||||
color="danger"
|
color="danger"
|
||||||
slot="button"
|
|
||||||
disabled={key !== data.key}
|
disabled={key !== data.key}
|
||||||
let:close
|
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
close()
|
close()
|
||||||
dispatch('deletion')
|
dispatch('deletion')
|
||||||
@ -47,6 +49,7 @@
|
|||||||
<IconTrash />
|
<IconTrash />
|
||||||
{$t(`modal.deletion.${type}.action`)}
|
{$t(`modal.deletion.${type}.action`)}
|
||||||
</Button>
|
</Button>
|
||||||
|
</svelte:fragment>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<style lang="postcss">
|
<style lang="postcss">
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { SvelteComponent } from 'svelte/internal'
|
|
||||||
|
|
||||||
export let placeholder = ''
|
export let placeholder = ''
|
||||||
export let icon: SvelteComponent = undefined
|
/** A Svelte component */
|
||||||
|
export let icon: any = undefined
|
||||||
export let value = ''
|
export let value = ''
|
||||||
export let multiline = false
|
export let multiline = false
|
||||||
|
/** An ID for better accessibility */
|
||||||
export let id: string = undefined
|
export let id: string = undefined
|
||||||
export let fill = false
|
export let fill = false
|
||||||
</script>
|
</script>
|
||||||
@ -41,14 +41,14 @@
|
|||||||
border: none;
|
border: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
||||||
&.has-icon {
|
|
||||||
padding-left: 2.5rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
padding: 0.25rem 1rem;
|
padding: 0.25rem 1rem;
|
||||||
|
|
||||||
|
&.has-icon {
|
||||||
|
padding-left: 2.5rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
|
|||||||
1
src/plugins/index.js
Normal file
1
src/plugins/index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { default as Generator } from './generator/index.js'
|
||||||
@ -1,3 +1,3 @@
|
|||||||
export function classCombine(names) {
|
export function classCombine(names: string[]) {
|
||||||
return names.filter((name) => name && !name.includes('undefined')).join(' ')
|
return names.filter((name) => name && !name.includes('undefined')).join(' ')
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,8 +76,8 @@ export function formatVersions(versionArray: string[]): string {
|
|||||||
return output.join(', ')
|
return output.join(', ')
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getPrimary = (files) => files.find((file) => file.primary) || files[0]
|
export const getPrimary = (files: any[]) => files.find((file) => file.primary) || files[0]
|
||||||
|
|
||||||
export function downloadUrl(file): string {
|
export function downloadUrl(file: any): string {
|
||||||
return import.meta.env.VITE_API_URL + `version_file/${file?.hashes.sha1}/download`
|
return import.meta.env.VITE_API_URL + `version_file/${file?.hashes.sha1}/download`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import adapter from '@sveltejs/adapter-static'
|
|||||||
import examples from 'mdsvexamples/vite'
|
import examples from 'mdsvexamples/vite'
|
||||||
import sveld from './docs/plugins/sveld.js'
|
import sveld from './docs/plugins/sveld.js'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { preprocess, plugins } from './src/config/svelte.config.js'
|
import { preprocess, plugins } from './src/config/svelte.js'
|
||||||
import Generator from './src/plugins/generator/index.js'
|
import Generator from './src/plugins/generator/index.js'
|
||||||
import precompileIntl from 'svelte-intl-precompile/sveltekit-plugin'
|
import precompileIntl from 'svelte-intl-precompile/sveltekit-plugin'
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"paths": {
|
"paths": {
|
||||||
"omorphia/utils": ["package/utils"],
|
"omorphia/utils": ["src/utils"],
|
||||||
"omorphia/*": ["package/*"],
|
"omorphia/*": ["src/*"],
|
||||||
"omorphia": ["package"],
|
"omorphia": ["src"],
|
||||||
"$generated/*": ["generated/*"],
|
"$generated/*": ["generated/*"],
|
||||||
"$lib": ["src"],
|
"$lib": ["src"],
|
||||||
"$lib/*": ["src/*"]
|
"$lib/*": ["src/*"]
|
||||||
@ -11,5 +11,14 @@
|
|||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": true
|
"esModuleInterop": true
|
||||||
},
|
},
|
||||||
|
"include": [
|
||||||
|
"./docs/**/*.js",
|
||||||
|
"./docs/**/*.ts",
|
||||||
|
"./docs/**/*.svelte",
|
||||||
|
"./src/**/*.js",
|
||||||
|
"./src/**/*.ts",
|
||||||
|
"./src/**/*.svelte"
|
||||||
|
],
|
||||||
|
"exclude": ["./node_modules/**", "./.svelte-kit/**"],
|
||||||
"extends": "./.svelte-kit/tsconfig.json"
|
"extends": "./.svelte-kit/tsconfig.json"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user