Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CV/Job offer form #126

Merged
merged 14 commits into from
Sep 11, 2023
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"tailwindCSS.experimental.classRegex": [["class:([^=]*)"]]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У скелетона вообще нередко встречаются пропсы для модификации классов компонентов, но тк у них свои названия - интеллисенс для тейлвинда их не видит, но это можно кастомизировать. Можно на примере этого в будущем добавлять сюда по необходимости новые паттерны, чтоб было удобнее работать.

Жаль, преттиер не сортирует классы в этих кейсах все равно, к сожалению

"tailwindCSS.experimental.classRegex": [["class:([^=]*)"], ["region.+=\"([^\"]*)\""]]
}
2 changes: 1 addition & 1 deletion frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ node_modules
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
package-lock.json
src/openapi.d.ts
src/lib/openapi.d.ts
14 changes: 11 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
"version": "0.0.1",
"private": true,
"type": "module",
"packageManager": "pnpm@8.6.12",
"packageManager": "pnpm@8.7.4",
"scripts": {
"dev": "vite dev --host 0.0.0.0",
"docker-dev": "tsx --tsconfig scripts/tsconfig.json scripts/docker-dev.ts",
"openapi-gen": "tsx --tsconfig scripts/tsconfig.json scripts/openapi-gen.ts",
"build": "vite build",
"preview": "vite preview",
"analyze": "pnpm vite-bundle-visualizer",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier . -l -w --plugin prettier-plugin-svelte --plugin prettier-plugin-tailwindcss"
},
"dependencies": {
"@floating-ui/dom": "^1.5.1",
"@skeletonlabs/skeleton": "^2.0.0",
"@skeletonlabs/tw-plugin": "^0.1.0",
"@tanstack/svelte-query": "5.0.0-beta.20",
Expand All @@ -32,11 +34,14 @@
"@types/node": "^20.5.6",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"autoprefixer": "^10.4.14",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte": "^2.33.0",
"nodemon": "^3.0.1",
"openapi-typescript": "^6.5.3",
"postcss": "^8.4.24",
"postcss-load-config": "^4.0.1",
"prettier": "^3.0.2",
"prettier-plugin-svelte": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.3",
Expand All @@ -45,11 +50,14 @@
"tslib": "^2.6.2",
"tsx": "^3.12.7",
"typescript": "^5.2.2",
"vite": "^4.4.9"
"vite": "^4.4.9",
"vite-bundle-visualizer": "^0.10.0"
},
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
"[email protected]": "patches/[email protected]",
"@sveltejs/[email protected]": "patches/@[email protected]",
"@skeletonlabs/[email protected]": "patches/@[email protected]"
}
}
}
88 changes: 88 additions & 0 deletions frontend/patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
diff --git a/dist/components/Autocomplete/Autocomplete.svelte b/dist/components/Autocomplete/Autocomplete.svelte
index 75b8b949c1e26d9c7b78ff01fb99140ce4ac983e..21ac8498fbbe15999fe5585031d580cc1b08113c 100644
--- a/dist/components/Autocomplete/Autocomplete.svelte
+++ b/dist/components/Autocomplete/Autocomplete.svelte
@@ -74,14 +74,14 @@ $:
{#if optionsFiltered.length > 0}
<nav class="autocomplete-nav {classesNav}">
<ul class="autocomplete-list {classesList}">
- {#each optionsFiltered.slice(0, sliceLimit) as option (option)}
+ {#each sliceLimit ? optionsFiltered.slice(0, sliceLimit) : optionsFiltered as option (option)}
<li
class="autocomplete-item {classesItem}"
in:dynamicTransition|local={{ transition: transitionIn, params: transitionInParams, enabled: transitions }}
out:dynamicTransition|local={{ transition: transitionOut, params: transitionOutParams, enabled: transitions }}
>
<button class="autocomplete-button {classesButton}" type="button" on:click={() => onSelection(option)} on:click on:keypress>
- {@html option.label}
+ {option.label}
</button>
</li>
{/each}
diff --git a/dist/components/Autocomplete/Autocomplete.svelte.d.ts b/dist/components/Autocomplete/Autocomplete.svelte.d.ts
index e4f3b4dd9ae4983bba4c7c84fa807ea68d03d07e..a8cc2e6cd4051d866ad56675ba51acaa25e190fe 100644
--- a/dist/components/Autocomplete/Autocomplete.svelte.d.ts
+++ b/dist/components/Autocomplete/Autocomplete.svelte.d.ts
@@ -1,16 +1,16 @@
-import { SvelteComponentTyped } from "svelte";
+import { SvelteComponent } from "svelte";
import { slide } from 'svelte/transition';
import { type Transition, type TransitionParams } from '../../index.js';
-type SlideTransition = typeof slide;
import type { AutocompleteOption } from './types.js';
-declare class __sveltets_Render<TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> {
+type SlideTransition = typeof slide;
+declare class __sveltets_Render<Value, TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> {
props(): {
[x: string]: any;
- input?: unknown;
- options?: AutocompleteOption[] | undefined;
+ input?: Value;
+ options?: AutocompleteOption<Value>[] | undefined;
limit?: number | undefined;
- allowlist?: unknown[] | undefined;
- denylist?: unknown[] | undefined;
+ allowlist?: Value[] | undefined;
+ denylist?: Value[] | undefined;
emptyState?: string | undefined;
regionNav?: string | undefined;
regionList?: string | undefined;
@@ -26,15 +26,16 @@ declare class __sveltets_Render<TransitionIn extends Transition = SlideTransitio
events(): {
click: MouseEvent;
keypress: KeyboardEvent;
- selection: CustomEvent<AutocompleteOption>;
+ selection: CustomEvent<AutocompleteOption<Value>>;
} & {
[evt: string]: CustomEvent<any>;
};
slots(): {};
}
-export type AutocompleteProps<TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> = ReturnType<__sveltets_Render<TransitionIn, TransitionOut>['props']>;
-export type AutocompleteEvents<TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> = ReturnType<__sveltets_Render<TransitionIn, TransitionOut>['events']>;
-export type AutocompleteSlots<TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> = ReturnType<__sveltets_Render<TransitionIn, TransitionOut>['slots']>;
-export default class Autocomplete<TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> extends SvelteComponentTyped<AutocompleteProps<TransitionIn, TransitionOut>, AutocompleteEvents<TransitionIn, TransitionOut>, AutocompleteSlots<TransitionIn, TransitionOut>> {
+export type AutocompleteProps<Value, TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> = ReturnType<__sveltets_Render<Value, TransitionIn, TransitionOut>['props']>;
+export type AutocompleteEvents<Value, TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> = ReturnType<__sveltets_Render<Value, TransitionIn, TransitionOut>['events']>;
+export type AutocompleteSlots<Value, TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> = ReturnType<__sveltets_Render<Value, TransitionIn, TransitionOut>['slots']>;
+export default class Autocomplete<Value, TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> extends SvelteComponent<AutocompleteProps<Value, TransitionIn, TransitionOut>, AutocompleteEvents<Value, TransitionIn, TransitionOut>, AutocompleteSlots<Value, TransitionIn, TransitionOut>> {
}
-export {};
+export { };
+
diff --git a/dist/components/Autocomplete/types.d.ts b/dist/components/Autocomplete/types.d.ts
index f3c35163bc4d6c9b20a7fd2e29a0b8b98cdf3f25..14649c466c40b2d74aec3428ae4554dd0109768c 100644
--- a/dist/components/Autocomplete/types.d.ts
+++ b/dist/components/Autocomplete/types.d.ts
@@ -1,8 +1,8 @@
-export interface AutocompleteOption {
- /** provide a unique display label per option. Supports HTML. */
+export interface AutocompleteOption<Value = unknown> {
+ /** Provide a unique display label per option. */
label: string;
/** Provide a unique option value. */
- value: unknown;
+ value: Value;
/** Provide a comma separated list of keywords. */
keywords?: any;
/** Pass arbitrary data per option. */
14 changes: 14 additions & 0 deletions frontend/patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/src/core/sync/write_tsconfig.js b/src/core/sync/write_tsconfig.js
index 9f3a083649fe8645380e9a3558c6bef5c44530ff..cbda8cdc76ba32282c2975a60d2adf70dedce05a 100644
--- a/src/core/sync/write_tsconfig.js
+++ b/src/core/sync/write_tsconfig.js
@@ -88,7 +88,8 @@ export function get_tsconfig(kit, include_base_url) {
const include = new Set([
'ambient.d.ts',
'./types/**/$types.d.ts',
- config_relative('vite.config.ts')
+ config_relative('vite.config.ts'),
+ config_relative('tailwind.config.ts')
]);
// TODO(v2): find a better way to include all src files. We can't just use routes/lib only because
// people might have other folders/files in src that they want included.
16 changes: 8 additions & 8 deletions frontend/patches/[email protected]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/dist/index.cjs b/dist/index.cjs
index bf7da635b18425dd8647f7be013899f1bb841142..d2836c29ccf2d92d0ba206c10d4d597b4024cd2a 100644
index bf7da635b18425dd8647f7be013899f1bb841142..b7fba1a90fec54a02242ed544a537e9ce3d7d896 100644
--- a/dist/index.cjs
+++ b/dist/index.cjs
@@ -32,16 +32,36 @@ var DEFAULT_HEADERS = {
Expand Down Expand Up @@ -38,7 +38,7 @@ index bf7da635b18425dd8647f7be013899f1bb841142..d2836c29ccf2d92d0ba206c10d4d597b
+ headers,
+ params.header
+ );
+ const requestInit = Object.assign(options, init, { headers: finalHeaders });
+ const requestInit = Object.assign(init, options, { headers: finalHeaders });
+ requestInit.redirect ??= "follow";
if (requestBody)
requestInit.body = bodySerializer(requestBody);
Expand Down Expand Up @@ -152,7 +152,7 @@ index 5403066621b7b4ff4517a9bb3c325bb26f47cfb0..d2221dd771e14468015fe01277bbb055
/** serialize query params to string */
export declare function defaultQuerySerializer<T = unknown>(q: T): string;
diff --git a/dist/index.js b/dist/index.js
index 59b3aa56d4a795021e89bd12bb06476ee37bdd32..c80b12175b9d7be8e8889702b8fdc37dc5c6dd57 100644
index 59b3aa56d4a795021e89bd12bb06476ee37bdd32..6978e0c5cf81a16f0fc2324bad1f44ec750025f7 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -4,31 +4,39 @@ const DEFAULT_HEADERS = {
Expand All @@ -174,7 +174,7 @@ index 59b3aa56d4a795021e89bd12bb06476ee37bdd32..c80b12175b9d7be8e8889702b8fdc37d
const finalHeaders = mergeHeaders(DEFAULT_HEADERS, clientOptions?.headers, headers, params.header);
// fetch!
- const requestInit = { redirect: "follow", ...options, ...init, headers: finalHeaders };
+ const requestInit = Object.assign(options, init, { headers: finalHeaders });
+ const requestInit = Object.assign(init, options, { headers: finalHeaders });
+ requestInit.redirect ??= "follow";
if (requestBody)
requestInit.body = bodySerializer(requestBody);
Expand Down Expand Up @@ -308,14 +308,14 @@ index 5403066621b7b4ff4517a9bb3c325bb26f47cfb0..d2221dd771e14468015fe01277bbb055
/** serialize query params to string */
export declare function defaultQuerySerializer<T = unknown>(q: T): string;
diff --git a/dist/index.min.js b/dist/index.min.js
index f6785d94824b6e8a6b615d4bbf4eebee633e8ac4..c440dcc2151d5ce1dd4ee22c09ef2d89041c4c9b 100644
index f6785d94824b6e8a6b615d4bbf4eebee633e8ac4..8f8abe0a8126cb485b58b181aa1752911cd45b9b 100644
--- a/dist/index.min.js
+++ b/dist/index.min.js
@@ -1 +1 @@
-var x={"Content-Type":"application/json"},S=/\/*$/;function g(s={}){let{fetch:r=globalThis.fetch,querySerializer:n,bodySerializer:a,...p}=s;async function o(e,t){let{headers:T,body:u,params:l={},parseAs:d="json",querySerializer:O=n??F,bodySerializer:R=a??q,...b}=t||{},m=M(e,{baseUrl:p.baseUrl,params:l,querySerializer:O}),P=z(x,s?.headers,T,l.header),y={redirect:"follow",...p,...b,headers:P};u&&(y.body=R(u)),y.body instanceof FormData&&P.delete("Content-Type");let i=await r(m,y);if(i.status===204||i.headers.get("Content-Length")==="0")return i.ok?{data:{},response:i}:{error:{},response:i};if(i.ok){let f=i.body;if(d!=="stream"){let c=i.clone();f=typeof c[d]=="function"?await c[d]():await c.text()}return{data:f,response:i}}let h={};try{h=await i.clone().json()}catch{h=await i.clone().text()}return{error:h,response:i}}return{async GET(e,t){return o(e,{...t,method:"GET"})},async PUT(e,t){return o(e,{...t,method:"PUT"})},async POST(e,t){return o(e,{...t,method:"POST"})},async DELETE(e,t){return o(e,{...t,method:"DELETE"})},async OPTIONS(e,t){return o(e,{...t,method:"OPTIONS"})},async HEAD(e,t){return o(e,{...t,method:"HEAD"})},async PATCH(e,t){return o(e,{...t,method:"PATCH"})},async TRACE(e,t){return o(e,{...t,method:"TRACE"})}}}function F(s){let r=new URLSearchParams;if(s&&typeof s=="object")for(let[n,a]of Object.entries(s))a!=null&&r.set(n,a);return r.toString()}function q(s){return JSON.stringify(s)}function M(s,r){let n=`${r.baseUrl?r.baseUrl.replace(S,""):""}${s}`;if(r.params.path)for(let[a,p]of Object.entries(r.params.path))n=n.replace(`{${a}}`,encodeURIComponent(String(p)));if(r.params.query){let a=r.querySerializer(r.params.query);a&&(n+=`?${a}`)}return n}function z(...s){let r=new Headers;for(let n of s){if(!n||typeof n!="object")continue;let a=n instanceof Headers?n.entries():Object.entries(n);for(let[p,o]of a)o===null?r.delete(p):o!==void 0&&r.set(p,o)}return r}export{M as createFinalURL,g as default,q as defaultBodySerializer,F as defaultQuerySerializer,z as mergeHeaders};
+var g={"Content-Type":"application/json"},m=/\/*$/;function S(i={}){let{querySerializer:r,bodySerializer:n,...a}=i;async function o(t,e,s=globalThis.fetch){let{headers:f,body:c,params:u={},parseAs:d="json",querySerializer:T=r??F,bodySerializer:O=n??q,...b}=e||{},R=M(t,{baseUrl:a.baseUrl,params:u,querySerializer:T}),x=z(g,i?.headers,f,u.header),h=Object.assign(a,b,{headers:x});h.redirect??="follow",c&&(h.body=O(c));let p=await s(R,h);if(p.status===204||p.headers.get("Content-Length")==="0")return p.ok?{data:{},response:p}:{error:{},response:p};if(p.ok){let P=p.body;if(d!=="stream"){let l=p.clone();P=typeof l[d]=="function"?await l[d]():await l.text()}return{data:P,response:p}}let y={};try{y=await p.clone().json()}catch{y=await p.clone().text()}return{error:y,response:p}}return{async GET(t,e,s=globalThis.fetch){return e.method="GET",o(t,e,s)},async PUT(t,e,s=globalThis.fetch){return e.method="PUT",o(t,e),s},async POST(t,e,s=globalThis.fetch){return e.method="POST",o(t,e,s)},async DELETE(t,e,s=globalThis.fetch){return e.method="DELETE",o(t,e,s)},async OPTIONS(t,e,s=globalThis.fetch){return e.method="OPTIONS",o(t,e,s)},async HEAD(t,e,s=globalThis.fetch){return e.method="HEAD",o(t,e,s)},async PATCH(t,e,s=globalThis.fetch){return e.method="PATCH",o(t,e,s)},async TRACE(t,e,s=globalThis.fetch){return e.method="TRACE",o(t,e,s)}}}function F(i){let r=new URLSearchParams;if(i&&typeof i=="object")for(let[n,a]of Object.entries(i))a!=null&&r.set(n,a);return r.toString()}function q(i){return JSON.stringify(i)}function M(i,r){let n=`${r.baseUrl?r.baseUrl.replace(m,""):""}${i}`;if(r.params.path)for(let[a,o]of Object.entries(r.params.path))n=n.replace(`{${a}}`,encodeURIComponent(String(o)));if(r.params.query){let a=r.querySerializer(r.params.query);a&&(n+=`?${a}`)}return n}function z(...i){let r=new Headers;for(let n of i){if(!n||typeof n!="object")continue;let a=n instanceof Headers?n.entries():Object.entries(n);for(let[o,t]of a)t===null?r.delete(o):t!==void 0&&r.set(o,t)}return r}export{M as createFinalURL,S as default,q as defaultBodySerializer,F as defaultQuerySerializer,z as mergeHeaders};
+var g={"Content-Type":"application/json"},m=/\/*$/;function S(i={}){let{querySerializer:r,bodySerializer:n,...a}=i;async function o(t,e,s=globalThis.fetch){let{headers:f,body:c,params:u={},parseAs:d="json",querySerializer:T=r??F,bodySerializer:O=n??q,...b}=e||{},R=M(t,{baseUrl:a.baseUrl,params:u,querySerializer:T}),x=z(g,i?.headers,f,u.header),h=Object.assign(b,a,{headers:x});h.redirect??="follow",c&&(h.body=O(c));let p=await s(R,h);if(p.status===204||p.headers.get("Content-Length")==="0")return p.ok?{data:{},response:p}:{error:{},response:p};if(p.ok){let P=p.body;if(d!=="stream"){let l=p.clone();P=typeof l[d]=="function"?await l[d]():await l.text()}return{data:P,response:p}}let y={};try{y=await p.clone().json()}catch{y=await p.clone().text()}return{error:y,response:p}}return{async GET(t,e,s=globalThis.fetch){return e.method="GET",o(t,e,s)},async PUT(t,e,s=globalThis.fetch){return e.method="PUT",o(t,e),s},async POST(t,e,s=globalThis.fetch){return e.method="POST",o(t,e,s)},async DELETE(t,e,s=globalThis.fetch){return e.method="DELETE",o(t,e,s)},async OPTIONS(t,e,s=globalThis.fetch){return e.method="OPTIONS",o(t,e,s)},async HEAD(t,e,s=globalThis.fetch){return e.method="HEAD",o(t,e,s)},async PATCH(t,e,s=globalThis.fetch){return e.method="PATCH",o(t,e,s)},async TRACE(t,e,s=globalThis.fetch){return e.method="TRACE",o(t,e,s)}}}function F(i){let r=new URLSearchParams;if(i&&typeof i=="object")for(let[n,a]of Object.entries(i))a!=null&&r.set(n,a);return r.toString()}function q(i){return JSON.stringify(i)}function M(i,r){let n=`${r.baseUrl?r.baseUrl.replace(m,""):""}${i}`;if(r.params.path)for(let[a,o]of Object.entries(r.params.path))n=n.replace(`{${a}}`,encodeURIComponent(String(o)));if(r.params.query){let a=r.querySerializer(r.params.query);a&&(n+=`?${a}`)}return n}function z(...i){let r=new Headers;for(let n of i){if(!n||typeof n!="object")continue;let a=n instanceof Headers?n.entries():Object.entries(n);for(let[o,t]of a)t===null?r.delete(o):t!==void 0&&r.set(o,t)}return r}export{M as createFinalURL,S as default,q as defaultBodySerializer,F as defaultQuerySerializer,z as mergeHeaders};
diff --git a/src/index.ts b/src/index.ts
index 619f82a8582e984f79ef13e9c9f6712050083411..42f4799726e3ee0dc4fa65d2fd7a28979918b624 100644
index 619f82a8582e984f79ef13e9c9f6712050083411..67e2ce116448f69662096539df71fba31e72ab95 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,4 +1,13 @@
Expand Down Expand Up @@ -433,7 +433,7 @@ index 619f82a8582e984f79ef13e9c9f6712050083411..42f4799726e3ee0dc4fa65d2fd7a2897

// fetch!
- const requestInit: RequestInit = { redirect: "follow", ...options, ...init, headers: finalHeaders };
+ const requestInit: RequestInit = Object.assign(options, init, { headers: finalHeaders });
+ const requestInit: RequestInit = Object.assign(init, options, { headers: finalHeaders });
+ requestInit.redirect ??= "follow";
+
if (requestBody) requestInit.body = bodySerializer(requestBody as any);
Expand Down
Loading