diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8ee70f8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +.svench +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index f139294..48386d5 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,20 @@ # Colorpicker 🎨 + A multi format Colorpicker built with Svelte. The Colorpicker accepts and sets hex(a), rgb(a) and hsl(a) colors. ![Image](./img/colorpicker.png) ### Features -* Choose your color by clicking or dragging on a palette. -* Set the hue and opacity of your chosen color using Slider controls. -* Convert your selected color to your preferred color format (hexa, rgba, hsla). -* Set your color by typing into an input. -* A swatch panel for keeping track of recent colours or for passing favourite colors so they can be easily set again. -* Handy keyboard events to tab through control panel, set colors and close the Colorpicker. -* Colorpicker anchors to its preview element which displays the selected color and acts as a button to display the Colorpicker. -* Viewport positional awareness - the colorpicker centers by default but will adapt and position itself appropriately based on available space. -* Colorpicker renders outside the dom structure which prevents problems with overflow clipping in scrolling containers. + +- Choose your color by clicking or dragging on a palette. +- Set the hue and opacity of your chosen color using Slider controls. +- Convert your selected color to your preferred color format (hexa, rgba, hsla). +- Set your color by typing into an input. +- A swatch panel for keeping track of recent colours or for passing favourite colors so they can be easily set again. +- Handy keyboard events to tab through control panel, set colors and close the Colorpicker. +- Colorpicker anchors to its preview element which displays the selected color and acts as a button to display the Colorpicker. +- Viewport positional awareness - the colorpicker centers by default but will adapt and position itself appropriately based on available space. +- Colorpicker renders outside the dom structure which prevents problems with overflow clipping in scrolling containers. ### Installation @@ -20,21 +22,22 @@ A multi format Colorpicker built with Svelte. The Colorpicker accepts and sets h 2. Run `yarn add @budibase/colorpicker`. 3. Or use npm `npm i @budibase/colorpicker`. -### Usage +### Usage + ```javascript import Colorpicker from "@budibase/colorpicker" {}} /> ``` + ### Events + The Colorpicker exposes the following events. In each case, the color will be provided as the first parameter to the bound function. **Change Event** -`on:change={selectedColor: string => {}}` +`on:change={selectedColor: string => {}}` The on change event will be invoked whenever a color has been set in the Colorpicker via the palette, the hue slider, the alpha slider or by typing into the input. **Add Swatch** @@ -61,13 +66,13 @@ The add swatch event will be invoked when a user adds a swatch by clicking the a The remove swatch will be invoked when a user clicks the delete button that appears when hovering over a swatch. ### Swatches -* By default, added swatches are saved to local storage so that they can be displayed across all Colorpickers in your application. -* Only 12 or less swatches can be displayed in the Coloricker at any any one time. -* If more than 12 have been passed the Colorpicker will display the first 12 and warn in the console. -* An array of swatches can be passed to the Colorpicker to set up a dedicated panel of swatches. This will use provided swatches instead of locally stored swatches. Swatches added will still be saved to local storage. -* You can disable swatch functionality by passing the `disableSwatches={true}` property to the Colorpicker. - - +- By default, added swatches are saved to local storage so that they can be displayed across all Colorpickers in your application. +- Only 12 or less swatches can be displayed in the Coloricker at any any one time. +- If more than 12 have been passed the Colorpicker will display the first 12 and warn in the console. +- An array of swatches can be passed to the Colorpicker to set up a dedicated panel of swatches. This will use provided swatches instead of locally stored swatches. Swatches added will still be saved to local storage. +- You can disable swatch functionality by passing the `disableSwatches={true}` property to the Colorpicker. +## Development +To work with the Colorpicker locally clone, ` yarn``` and `yarn svench`. Follow the URL in the terminal. diff --git a/actions/drag.js b/actions/drag.js deleted file mode 100644 index 4f1a0f8..0000000 --- a/actions/drag.js +++ /dev/null @@ -1,23 +0,0 @@ -export default function(node) { - function handleMouseDown() { - window.addEventListener("mousemove", handleMouseMove) - window.addEventListener("mouseup", handleMouseUp) - node.dispatchEvent(new CustomEvent("dragstart")) - } - - function handleMouseMove(event) { - node.dispatchEvent( - new CustomEvent("drag", { - detail: { mouseX: event.clientX, mouseY: event.clientY }, - }) - ) - } - - function handleMouseUp() { - window.removeEventListener("mousedown", handleMouseDown) - window.removeEventListener("mousemove", handleMouseMove) - node.dispatchEvent(new CustomEvent("dragend")) - } - - node.addEventListener("mousedown", handleMouseDown) -} diff --git a/components/Portal.svelte b/components/Portal.svelte deleted file mode 100644 index 462a176..0000000 --- a/components/Portal.svelte +++ /dev/null @@ -1,37 +0,0 @@ - - -
- -
diff --git a/img/colorpicker.png b/img/colorpicker.png deleted file mode 100644 index e546573..0000000 Binary files a/img/colorpicker.png and /dev/null differ diff --git a/index.js b/index.js deleted file mode 100644 index 80a44b8..0000000 --- a/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import Colorpreview from "./components/Colorpreview.svelte" -export default Colorpreview diff --git a/package.json b/package.json new file mode 100644 index 0000000..0eb17df --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "@budibase/colorpicker", + "version": "1.1.2", + "main": "src/index.js", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/Budibase/Colorpicker.git" + }, + "author": "Budibase ", + "license": "MIT", + "devDependencies": { + "rollup-plugin-svelte-hot": "^1.0.0-3", + "svelte": "^3.35.0", + "svelte-portal": "^2.1.1", + "svench": "^0.2.0-8", + "vite": "^2.0.5" + }, + "bugs": { + "url": "https://github.com/Budibase/Colorpicker/issues" + }, + "homepage": "https://github.com/Budibase/Colorpicker#readme", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "description": "" +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..cc141af --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,1377 @@ +devDependencies: + rollup-plugin-svelte-hot: 1.0.0-3_svelte@3.35.0 + svelte: 3.35.0 + svelte-portal: 2.1.1 + svench: 0.2.0-8_svelte@3.35.0 + vite: 2.0.5 +lockfileVersion: 5.2 +packages: + /0http/3.0.0: + dependencies: + lru-cache: 6.0.0 + trouter: 3.1.0 + dev: true + engines: + node: '>=10.x' + resolution: + integrity: sha512-/sbuk573Y7Mm/Joq+XnFtK8Kg6WoFvGeg9p8w1/MAntx2qKF87OIdgMRw8R3hJMX23VtoPVBwaYKLBLDhrAbpw== + /@rollup/pluginutils/3.1.0: + dependencies: + '@types/estree': 0.0.39 + estree-walker: 1.0.1 + picomatch: 2.2.2 + dev: true + engines: + node: '>= 8.0.0' + optional: true + peerDependencies: + rollup: ^1.20.0||^2.0.0 + resolution: + integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== + /@rollup/pluginutils/4.1.0: + dependencies: + estree-walker: 2.0.2 + picomatch: 2.2.2 + dev: true + engines: + node: '>= 8.0.0' + peerDependencies: + rollup: ^1.20.0||^2.0.0 + resolution: + integrity: sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ== + /@types/estree/0.0.39: + dev: true + optional: true + resolution: + integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== + /@types/unist/2.0.3: + dev: true + resolution: + integrity: sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== + /accepts/1.3.7: + dependencies: + mime-types: 2.1.29 + negotiator: 0.6.2 + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + /acorn/8.0.5: + dev: true + engines: + node: '>=0.4.0' + hasBin: true + optional: true + resolution: + integrity: sha512-v+DieK/HJkJOpFBETDJioequtc3PfxsWMaxIdIwujtF7FEV/MAyDQLlm6/zPvr7Mix07mLh6ccVwIsloceodlg== + /anymatch/3.1.1: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.2.2 + dev: true + engines: + node: '>= 8' + optional: true + resolution: + integrity: sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + /array-flatten/1.1.1: + dev: true + optional: true + resolution: + integrity: sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + /async-limiter/1.0.1: + dev: true + optional: true + resolution: + integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== + /bcp-47-match/1.0.3: + dev: true + resolution: + integrity: sha512-LggQ4YTdjWQSKELZF5JwchnBa1u0pIQSZf5lSdOHEdbVP55h0qICA/FUp3+W99q0xqxYa1ZQizTUH87gecII5w== + /big-integer/1.6.48: + dev: true + engines: + node: '>=0.6' + optional: true + resolution: + integrity: sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== + /binary-extensions/2.2.0: + dev: true + engines: + node: '>=8' + optional: true + resolution: + integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + /body-parser/1.19.0: + dependencies: + bytes: 3.1.0 + content-type: 1.0.4 + debug: 2.6.9 + depd: 1.1.2 + http-errors: 1.7.2 + iconv-lite: 0.4.24 + on-finished: 2.3.0 + qs: 6.7.0 + raw-body: 2.4.0 + type-is: 1.6.18 + dev: true + engines: + node: '>= 0.8' + optional: true + resolution: + integrity: sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + /boolbase/1.0.0: + dev: true + resolution: + integrity: sha1-aN/1++YMUes3cl6p4+0xDcwed24= + /bplist-parser/0.1.1: + dependencies: + big-integer: 1.6.48 + dev: true + optional: true + resolution: + integrity: sha1-1g1dzCDLptx+HymbNdPh+V2vuuY= + /braces/3.0.2: + dependencies: + fill-range: 7.0.1 + dev: true + engines: + node: '>=8' + optional: true + resolution: + integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + /bytes/3.1.0: + dev: true + engines: + node: '>= 0.8' + optional: true + resolution: + integrity: sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + /cac/6.7.2: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-w0bH1IF9rEjdi0a6lTtlXYT+vBZEJL9oytaXXRdsD68MH6+SrZGOGsu7s2saHQvYXqwo/wBdkW75tt8wFpj+mw== + /cheap-watch/1.0.3: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-xC5CruMhLzjPwJ5ecUxGu1uGmwJQykUhqd2QrCrYbwvsFYdRyviu6jG9+pccwDXJR/OpmOTOJ9yLFunVgQu9wg== + /chokidar/3.5.1: + dependencies: + anymatch: 3.1.1 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.1 + normalize-path: 3.0.0 + readdirp: 3.5.0 + dev: true + engines: + node: '>= 8.10.0' + optional: true + optionalDependencies: + fsevents: 2.3.2 + resolution: + integrity: sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== + /clipboard/2.0.7: + dependencies: + good-listener: 1.2.2 + select: 1.1.2 + tiny-emitter: 2.1.0 + dev: true + resolution: + integrity: sha512-8M8WEZcIvs0hgOma+wAPkrUxpv0PMY1L6VsAJh/2DOKARIMpyWe6ZLcEoe1qktl6/ced5ceYHs+oGedSbgZ3sg== + /color-js/1.0.5: + dev: true + resolution: + integrity: sha512-KgOTVz7fupb3lOXu4lixP6BR2CdMaTtCnGmLfHZWhq8NU3MABd6U9KjWtJVuYChGS/gIaoA8LakKKQfWhQgwYQ== + /colorette/1.2.2: + dev: true + resolution: + integrity: sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== + /comma-separated-tokens/1.0.8: + dev: true + resolution: + integrity: sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== + /content-disposition/0.5.3: + dependencies: + safe-buffer: 5.1.2 + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== + /content-type/1.0.4: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + /convert-source-map/1.7.0: + dependencies: + safe-buffer: 5.1.2 + dev: true + optional: true + resolution: + integrity: sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + /cookie-signature/1.0.6: + dev: true + optional: true + resolution: + integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + /cookie/0.4.0: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + /css-selector-parser/1.4.1: + dev: true + resolution: + integrity: sha512-HYPSb7y/Z7BNDCOrakL4raGO2zltZkbeXyAd6Tg9obzix6QhzxCotdBl6VT0Dv4vZfJGVz3WL/xaEI9Ly3ul0g== + /debug/2.6.9: + dependencies: + ms: 2.0.0 + dev: true + optional: true + resolution: + integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + /debug/3.2.7: + dependencies: + ms: 2.1.3 + dev: true + optional: true + resolution: + integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + /dedent/0.7.0: + dev: true + resolution: + integrity: sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= + /default-browser-id/2.0.0: + dependencies: + bplist-parser: 0.1.1 + pify: 2.3.0 + untildify: 2.1.0 + dev: true + engines: + node: '>=4' + optional: true + resolution: + integrity: sha1-AezONxpx6F8VoXF354YwR+c9vn0= + /delegate/3.2.0: + dev: true + resolution: + integrity: sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw== + /depd/1.1.2: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + /destroy/1.0.4: + dev: true + optional: true + resolution: + integrity: sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + /direction/1.0.4: + dev: true + hasBin: true + resolution: + integrity: sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ== + /ee-first/1.1.1: + dev: true + optional: true + resolution: + integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + /emoji-regex/6.1.1: + dev: true + resolution: + integrity: sha1-xs0OwbBkLio8Z6ETfvxeeW2k+I4= + /encodeurl/1.0.2: + dev: true + engines: + node: '>= 0.8' + optional: true + resolution: + integrity: sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + /es6-promise/4.2.8: + dev: true + optional: true + resolution: + integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + /esbuild/0.8.57: + dev: true + hasBin: true + requiresBuild: true + resolution: + integrity: sha512-j02SFrUwFTRUqiY0Kjplwjm1psuzO1d6AjaXKuOR9hrY0HuPsT6sV42B6myW34h1q4CRy+Y3g4RU/cGJeI/nNA== + /escape-html/1.0.3: + dev: true + optional: true + resolution: + integrity: sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + /esm/3.2.25: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA== + /estree-walker/0.6.1: + dev: true + optional: true + resolution: + integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== + /estree-walker/1.0.1: + dev: true + optional: true + resolution: + integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== + /estree-walker/2.0.2: + dev: true + resolution: + integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + /etag/1.8.1: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + /express-history-api-fallback/2.2.1: + dev: true + optional: true + resolution: + integrity: sha1-OirSf3vryQ/FM9EQ18bYMJe80Fc= + /express-http-proxy/1.6.2: + dependencies: + debug: 3.2.7 + es6-promise: 4.2.8 + raw-body: 2.4.1 + dev: true + engines: + node: '>=6.0.0' + optional: true + resolution: + integrity: sha512-soP7UXySFdLbeeMYL1foBkEoZj6HELq9BDAOCr1sLRpqjPaFruN5o6+bZeC+7U4USWIl4JMKEiIvTeKJ2WQdlQ== + /express-ws/4.0.0_express@4.17.1: + dependencies: + express: 4.17.1 + ws: 5.2.2 + dev: true + engines: + node: '>=4.5.0' + optional: true + peerDependencies: + express: ^4.0.0 || ^5.0.0-alpha.1 + resolution: + integrity: sha512-KEyUw8AwRET2iFjFsI1EJQrJ/fHeGiJtgpYgEWG3yDv4l/To/m3a2GaYfeGyB3lsWdvbesjF5XCMx+SVBgAAYw== + /express/4.17.1: + dependencies: + accepts: 1.3.7 + array-flatten: 1.1.1 + body-parser: 1.19.0 + content-disposition: 0.5.3 + content-type: 1.0.4 + cookie: 0.4.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 1.1.2 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.1.2 + fresh: 0.5.2 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.3.0 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.6 + qs: 6.7.0 + range-parser: 1.2.1 + safe-buffer: 5.1.2 + send: 0.17.1 + serve-static: 1.14.1 + setprototypeof: 1.1.1 + statuses: 1.5.0 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + dev: true + engines: + node: '>= 0.10.0' + optional: true + resolution: + integrity: sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + /extend/3.0.2: + dev: true + resolution: + integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + /fill-keys/1.0.2: + dependencies: + is-object: 1.0.2 + merge-descriptors: 1.0.1 + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA= + /fill-range/7.0.1: + dependencies: + to-regex-range: 5.0.1 + dev: true + engines: + node: '>=8' + optional: true + resolution: + integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + /finalhandler/1.1.2: + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.3.0 + parseurl: 1.3.3 + statuses: 1.5.0 + unpipe: 1.0.0 + dev: true + engines: + node: '>= 0.8' + optional: true + resolution: + integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== + /forwarded/0.1.2: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= + /fresh/0.5.2: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + /fsevents/2.3.2: + dev: true + engines: + node: ^8.16.0 || ^10.6.0 || >=11.0.0 + optional: true + os: + - darwin + resolution: + integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + /function-bind/1.1.1: + dev: true + resolution: + integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + /github-slugger/1.3.0: + dependencies: + emoji-regex: 6.1.1 + dev: true + resolution: + integrity: sha512-gwJScWVNhFYSRDvURk/8yhcFBee6aFjye2a7Lhb2bUyRulpIoek9p0I9Kt7PT67d/nUlZbFu8L9RLiA0woQN8Q== + /glob-parent/5.1.2: + dependencies: + is-glob: 4.0.1 + dev: true + engines: + node: '>= 6' + optional: true + resolution: + integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + /good-listener/1.2.2: + dependencies: + delegate: 3.2.0 + dev: true + resolution: + integrity: sha1-1TswzfkxPf+33JoNR3CWqm0UXFA= + /has/1.0.3: + dependencies: + function-bind: 1.1.1 + dev: true + engines: + node: '>= 0.4.0' + resolution: + integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + /hast-util-has-property/1.0.4: + dev: true + resolution: + integrity: sha512-ghHup2voGfgFoHMGnaLHOjbYFACKrRh9KFttdCzMCbFoBMJXiNi2+XTrPP8+q6cDJM/RSqlCfVWrjp1H201rZg== + /hast-util-is-element/1.1.0: + dev: true + resolution: + integrity: sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ== + /hast-util-select/4.0.2: + dependencies: + bcp-47-match: 1.0.3 + comma-separated-tokens: 1.0.8 + css-selector-parser: 1.4.1 + direction: 1.0.4 + hast-util-has-property: 1.0.4 + hast-util-is-element: 1.1.0 + hast-util-to-string: 1.0.4 + hast-util-whitespace: 1.0.4 + not: 0.1.0 + nth-check: 2.0.0 + property-information: 5.6.0 + space-separated-tokens: 1.1.5 + unist-util-visit: 2.0.3 + zwitch: 1.0.5 + dev: true + resolution: + integrity: sha512-8EEG2//bN5rrzboPWD2HdS3ugLijNioS1pqOTIolXNf67xxShYw4SQEmVXd3imiBG+U2bC2nVTySr/iRAA7Cjg== + /hast-util-to-string/1.0.4: + dev: true + resolution: + integrity: sha512-eK0MxRX47AV2eZ+Lyr18DCpQgodvaS3fAQO2+b9Two9F5HEoRPhiUMNzoXArMJfZi2yieFzUBMRl3HNJ3Jus3w== + /hast-util-whitespace/1.0.4: + dev: true + resolution: + integrity: sha512-I5GTdSfhYfAPNztx2xJRQpG8cuDSNt599/7YUn7Gx/WxNMsG+a835k97TDkFgk123cwjfwINaZknkKkphx/f2A== + /http-errors/1.7.2: + dependencies: + depd: 1.1.2 + inherits: 2.0.3 + setprototypeof: 1.1.1 + statuses: 1.5.0 + toidentifier: 1.0.0 + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + /http-errors/1.7.3: + dependencies: + depd: 1.1.2 + inherits: 2.0.4 + setprototypeof: 1.1.1 + statuses: 1.5.0 + toidentifier: 1.0.0 + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + /iconv-lite/0.4.24: + dependencies: + safer-buffer: 2.1.2 + dev: true + engines: + node: '>=0.10.0' + optional: true + resolution: + integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + /inherits/2.0.3: + dev: true + optional: true + resolution: + integrity: sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + /inherits/2.0.4: + dev: true + optional: true + resolution: + integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + /ipaddr.js/1.9.1: + dev: true + engines: + node: '>= 0.10' + optional: true + resolution: + integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + /is-binary-path/2.1.0: + dependencies: + binary-extensions: 2.2.0 + dev: true + engines: + node: '>=8' + optional: true + resolution: + integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + /is-core-module/2.2.0: + dependencies: + has: 1.0.3 + dev: true + resolution: + integrity: sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== + /is-docker/2.1.1: + dev: true + engines: + node: '>=8' + hasBin: true + optional: true + resolution: + integrity: sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw== + /is-extglob/2.1.1: + dev: true + engines: + node: '>=0.10.0' + optional: true + resolution: + integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + /is-glob/4.0.1: + dependencies: + is-extglob: 2.1.1 + dev: true + engines: + node: '>=0.10.0' + optional: true + resolution: + integrity: sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + /is-number/7.0.0: + dev: true + engines: + node: '>=0.12.0' + optional: true + resolution: + integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + /is-object/1.0.2: + dev: true + resolution: + integrity: sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== + /is-wsl/2.2.0: + dependencies: + is-docker: 2.1.1 + dev: true + engines: + node: '>=8' + optional: true + resolution: + integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + /lru-cache/6.0.0: + dependencies: + yallist: 4.0.0 + dev: true + engines: + node: '>=10' + resolution: + integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + /magic-string/0.25.7: + dependencies: + sourcemap-codec: 1.4.8 + dev: true + optional: true + resolution: + integrity: sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== + /mdsvex/0.8.9_svelte@3.35.0: + dependencies: + '@types/unist': 2.0.3 + prismjs: 1.23.0 + svelte: 3.35.0 + vfile-message: 2.0.4 + dev: true + peerDependencies: + svelte: 3.x + resolution: + integrity: sha512-9CDBDV29IVNJsJWDlCg1UwascU8QmuHsYEXJH2ZGsf7lCCWUDSwbOmR+I77tm8D2YQrPsbLCLq/UndUMJck3Cw== + /media-typer/0.3.0: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + /merge-descriptors/1.0.1: + dev: true + resolution: + integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + /methods/1.1.2: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + /mime-db/1.46.0: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ== + /mime-types/2.1.29: + dependencies: + mime-db: 1.46.0 + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ== + /mime/1.6.0: + dev: true + engines: + node: '>=4' + hasBin: true + optional: true + resolution: + integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + /module-not-found-error/1.0.1: + dev: true + resolution: + integrity: sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA= + /ms/2.0.0: + dev: true + optional: true + resolution: + integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + /ms/2.1.1: + dev: true + optional: true + resolution: + integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + /ms/2.1.3: + dev: true + optional: true + resolution: + integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + /nanoid/3.1.20: + dev: true + engines: + node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1 + hasBin: true + resolution: + integrity: sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw== + /navaid/1.2.0: + dependencies: + regexparam: 1.3.0 + dev: true + engines: + node: '>= 6' + resolution: + integrity: sha512-Yh5mix394WrT5go29GFeFD4Gp4W0Xj1Ejs0KHXXCA24KKW74pq3PY3fwP3o18KveYO/pjUI2zzcAAp8kY98aNA== + /negotiator/0.6.2: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + /nollup/0.15.3: + dependencies: + '@rollup/pluginutils': 3.1.0 + acorn: 8.0.5 + chokidar: 3.5.1 + convert-source-map: 1.7.0 + express: 4.17.1 + express-history-api-fallback: 2.2.1 + express-http-proxy: 1.6.2 + express-ws: 4.0.0_express@4.17.1 + magic-string: 0.25.7 + mime-types: 2.1.29 + source-map: 0.5.7 + source-map-fast: /source-map/0.7.3 + dev: true + hasBin: true + optional: true + resolution: + integrity: sha512-rSQYGw8/tApYppyRGcCKLQ2Vp7jYykKVXf7eOawsVrcPSCc8u+a1z/PskifIBspiEYcGAdKMY3c5f3XJA6/edQ== + /normalize-path/3.0.0: + dev: true + engines: + node: '>=0.10.0' + optional: true + resolution: + integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + /not/0.1.0: + dev: true + resolution: + integrity: sha1-yWkcF0bFXc++VMvYvU/wQbwrUZ0= + /nth-check/2.0.0: + dependencies: + boolbase: 1.0.0 + dev: true + resolution: + integrity: sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q== + /on-finished/2.3.0: + dependencies: + ee-first: 1.1.1 + dev: true + engines: + node: '>= 0.8' + optional: true + resolution: + integrity: sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + /open/7.4.2: + dependencies: + is-docker: 2.1.1 + is-wsl: 2.2.0 + dev: true + engines: + node: '>=8' + optional: true + resolution: + integrity: sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + /os-homedir/1.0.2: + dev: true + engines: + node: '>=0.10.0' + optional: true + resolution: + integrity: sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + /overlayscrollbars/1.13.1: + dev: true + resolution: + integrity: sha512-gIQfzgGgu1wy80EB4/6DaJGHMEGmizq27xHIESrzXq0Y/J0Ay1P3DWk6tuVmEPIZH15zaBlxeEJOqdJKmowHCQ== + /parseurl/1.3.3: + dev: true + engines: + node: '>= 0.8' + optional: true + resolution: + integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + /path-parse/1.0.6: + dev: true + resolution: + integrity: sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + /path-to-regexp/0.1.7: + dev: true + optional: true + resolution: + integrity: sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + /picomatch/2.2.2: + dev: true + engines: + node: '>=8.6' + resolution: + integrity: sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + /pify/2.3.0: + dev: true + engines: + node: '>=0.10.0' + optional: true + resolution: + integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + /postcss/8.2.7: + dependencies: + colorette: 1.2.2 + nanoid: 3.1.20 + source-map: 0.6.1 + dev: true + engines: + node: ^10 || ^12 || >=14 + resolution: + integrity: sha512-DsVLH3xJzut+VT+rYr0mtvOtpTjSyqDwPf5EZWXcb0uAKfitGpTY9Ec+afi2+TgdN8rWS9Cs88UDYehKo/RvOw== + /prism-svelte/0.4.7: + dev: true + resolution: + integrity: sha512-yABh19CYbM24V7aS7TuPYRNMqthxwbvx6FF/Rw920YbyBWO3tnyPIqRMgHuSVsLmuHkkBS1Akyof463FVdkeDQ== + /prismjs/1.23.0: + dev: true + optionalDependencies: + clipboard: 2.0.7 + resolution: + integrity: sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA== + /property-information/5.6.0: + dependencies: + xtend: 4.0.2 + dev: true + resolution: + integrity: sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA== + /proxy-addr/2.0.6: + dependencies: + forwarded: 0.1.2 + ipaddr.js: 1.9.1 + dev: true + engines: + node: '>= 0.10' + optional: true + resolution: + integrity: sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== + /proxyquire/2.1.3: + dependencies: + fill-keys: 1.0.2 + module-not-found-error: 1.0.1 + resolve: 1.20.0 + dev: true + resolution: + integrity: sha512-BQWfCqYM+QINd+yawJz23tbBM40VIGXOdDw3X344KcclI/gtBbdWF6SlQ4nK/bYhF9d27KYug9WzljHC6B9Ysg== + /qs/6.7.0: + dev: true + engines: + node: '>=0.6' + optional: true + resolution: + integrity: sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + /range-parser/1.2.1: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + /raw-body/2.4.0: + dependencies: + bytes: 3.1.0 + http-errors: 1.7.2 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + engines: + node: '>= 0.8' + optional: true + resolution: + integrity: sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== + /raw-body/2.4.1: + dependencies: + bytes: 3.1.0 + http-errors: 1.7.3 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + engines: + node: '>= 0.8' + optional: true + resolution: + integrity: sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== + /readdirp/3.5.0: + dependencies: + picomatch: 2.2.2 + dev: true + engines: + node: '>=8.10.0' + optional: true + resolution: + integrity: sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== + /regexparam/1.3.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g== + /rehype-autolink-headings/3.0.0: + dependencies: + extend: 3.0.2 + hast-util-has-property: 1.0.4 + hast-util-is-element: 1.1.0 + unist-util-visit: 2.0.3 + dev: true + resolution: + integrity: sha512-Kit6caYCGvH7OSeXgEq0F4b4vXFg92owru/26ckSLCODjvbD4TogAOvYvzcvkaeIO0uDpnmCg0MsmHJtHXBvyQ== + /rehype-slug/3.0.0: + dependencies: + github-slugger: 1.3.0 + hast-util-has-property: 1.0.4 + hast-util-is-element: 1.1.0 + hast-util-to-string: 1.0.4 + unist-util-visit: 2.0.3 + dev: true + resolution: + integrity: sha512-zFnj5BCEJXV6+URwaz8yW+9BdjDwO5iVzlQui3+7cCJ9MXlIEL0IY8VefcT/03Gw+2Hutdrx+zXnS7bnOrepZg== + /require-relative/0.8.7: + dev: true + resolution: + integrity: sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4= + /resolve/1.20.0: + dependencies: + is-core-module: 2.2.0 + path-parse: 1.0.6 + dev: true + resolution: + integrity: sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + /restana/4.8.1: + dependencies: + 0http: 3.0.0 + dev: true + engines: + node: '>=10.x' + requiresBuild: true + resolution: + integrity: sha512-1EWtvy9Px8xpKP+TbIpdvsQgdZZo3K7Pfio165bNXdLMPw8NwQttPfVCXRUjMzzQ0yoJV5AAXhKqLkdGOW2YSg== + /rollup-plugin-hot-nollup/0.1.2: + dependencies: + '@rollup/pluginutils': 3.1.0 + dev: true + optional: true + resolution: + integrity: sha512-QE4/CO7CFWSwZDmp/K+bMEOdP+i9aZiEw2u1sF+BiYE+0VQTu/FfzhJUxI0PDthBjzLZfEW31rwQJhVueuSL8w== + /rollup-plugin-svelte-hot/0.11.2_svelte@3.35.0: + dependencies: + require-relative: 0.8.7 + rollup-plugin-hot-nollup: 0.1.2 + rollup-pluginutils: 2.8.2 + sourcemap-codec: 1.4.8 + svelte: 3.35.0 + svelte-hmr: 0.11.6_svelte@3.35.0 + dev: true + optional: true + optionalDependencies: + nollup: 0.15.3 + peerDependencies: + rollup: '>=1.19.2' + svelte: '>=3.19.0' + resolution: + integrity: sha512-3cQnFZlrQbknbEwtEwxC2TcT2HO3BYR4/9A/7Dfzm93sQ4lvyAYlCh4JS4FximrR1jWrI/mgaOtUKYDudGIkmg== + /rollup-plugin-svelte-hot/1.0.0-3_svelte@3.35.0: + dependencies: + '@rollup/pluginutils': 4.1.0 + require-relative: 0.8.7 + svelte: 3.35.0 + svelte-hmr: 0.12.9_svelte@3.35.0 + dev: true + engines: + node: '>=10' + peerDependencies: + rollup: '>=2.0.0' + svelte: '>=3.5.0' + resolution: + integrity: sha512-iheuqAL6qBsNtBw86MOJByBTzi3E3uoL8x7s9YWCWDLlw75hsARsoio9giyArsMOa9MsEAHlFKq3Clr40K3FUA== + /rollup-pluginutils/2.8.2: + dependencies: + estree-walker: 0.6.1 + dev: true + optional: true + resolution: + integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== + /rollup/2.40.0: + dev: true + engines: + node: '>=10.0.0' + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + resolution: + integrity: sha512-WiOGAPbXoHu+TOz6hyYUxIksOwsY/21TRWoO593jgYt8mvYafYqQl+axaA8y1z2HFazNUUrsMSjahV2A6/2R9A== + /routix/0.1.0-5: + dependencies: + cheap-watch: 1.0.3 + dev: true + resolution: + integrity: sha512-ZWg5tJsaQpzOB9MP7ONft6TUle4Ga6eGP6JnkjejR5H3U0a1X+lpfz6FxH4gQjZGgWm6zMr+Z8YRoaUDcNzBfw== + /safe-buffer/5.1.2: + dev: true + optional: true + resolution: + integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + /safer-buffer/2.1.2: + dev: true + optional: true + resolution: + integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + /select/1.1.2: + dev: true + resolution: + integrity: sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0= + /send/0.17.1: + dependencies: + debug: 2.6.9 + depd: 1.1.2 + destroy: 1.0.4 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 1.7.3 + mime: 1.6.0 + ms: 2.1.1 + on-finished: 2.3.0 + range-parser: 1.2.1 + statuses: 1.5.0 + dev: true + engines: + node: '>= 0.8.0' + optional: true + resolution: + integrity: sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== + /serve-static/1.14.1: + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.17.1 + dev: true + engines: + node: '>= 0.8.0' + optional: true + resolution: + integrity: sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== + /setprototypeof/1.1.1: + dev: true + optional: true + resolution: + integrity: sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + /snowpack/3.0.13: + dependencies: + default-browser-id: 2.0.0 + esbuild: 0.8.57 + open: 7.4.2 + resolve: 1.20.0 + rollup: 2.40.0 + dev: true + engines: + node: '>=10.19.0' + hasBin: true + optional: true + optionalDependencies: + fsevents: 2.3.2 + resolution: + integrity: sha512-USTcpfJ68rbuFvUygw+3n9qS1CC/tGsr/JNVc6FNk0ZRfGBE4OmB+Mmk5nWtdxi546GeCr/GvveJenYLen/WpA== + /source-map/0.5.7: + dev: true + engines: + node: '>=0.10.0' + optional: true + resolution: + integrity: sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + /source-map/0.6.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + /source-map/0.7.3: + dev: true + engines: + node: '>= 8' + optional: true + resolution: + integrity: sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + /sourcemap-codec/1.4.8: + dev: true + optional: true + resolution: + integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== + /space-separated-tokens/1.1.5: + dev: true + resolution: + integrity: sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== + /stack-chain/2.0.0: + dev: true + resolution: + integrity: sha512-GGrHXePi305aW7XQweYZZwiRwR7Js3MWoK/EHzzB9ROdc75nCnjSJVi21rdAGxFl+yCx2L2qdfl5y7NO4lTyqg== + /statuses/1.5.0: + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + /svelte-hmr/0.11.6_svelte@3.35.0: + dependencies: + svelte: 3.35.0 + dev: true + optional: true + peerDependencies: + svelte: '>=3.19.0' + resolution: + integrity: sha512-XUYcp7W26q/fF8tABZfCYGklwL4TDH48gc1KOjuBQNlTiMW63l/+rRqmfVOE/qKG5vns0J2NPo3zFjdahkwoHA== + /svelte-hmr/0.12.9_svelte@3.35.0: + dependencies: + svelte: 3.35.0 + dev: true + peerDependencies: + svelte: '>=3.19.0' + resolution: + integrity: sha512-SGE7Odznj4dqZtUVIWcoPCvZ9gHImxVIIjrz+O3DDSi0j4OaSLim6MRF4UdhlBKeW3glSRc+tXNSKYvM5x+Dyw== + /svelte-portal/2.1.1: + dev: true + resolution: + integrity: sha512-B61Bem/3cqgPGVMRM09RhEmZKBGbv3EFVO15GWbFWltNy9dN6sdLK5rV5VEOdZRDNaqgYai9caCHMDuYMpW/1w== + /svelte/3.35.0: + dev: true + engines: + node: '>= 8' + resolution: + integrity: sha512-gknlZkR2sXheu/X+B7dDImwANVvK1R0QGQLd8CNIfxxGPeXBmePnxfzb6fWwTQRsYQG7lYkZXvpXJvxvpsoB7g== + /svench/0.2.0-8_svelte@3.35.0: + dependencies: + cac: 6.7.2 + cheap-watch: 1.0.3 + clipboard: 2.0.7 + color-js: 1.0.5 + dedent: 0.7.0 + esm: 3.2.25 + hast-util-select: 4.0.2 + mdsvex: 0.8.9_svelte@3.35.0 + navaid: 1.2.0 + overlayscrollbars: 1.13.1 + prism-svelte: 0.4.7 + prismjs: 1.23.0 + proxyquire: 2.1.3 + regexparam: 1.3.0 + rehype-autolink-headings: 3.0.0 + rehype-slug: 3.0.0 + require-relative: 0.8.7 + restana: 4.8.1 + routix: 0.1.0-5 + stack-chain: 2.0.0 + svelte: 3.35.0 + trace: 3.1.1 + zingtouch: 1.0.6 + dev: true + hasBin: true + optionalDependencies: + nollup: 0.15.3 + rollup-plugin-svelte-hot: 0.11.2_svelte@3.35.0 + snowpack: 3.0.13 + vite: 2.0.5 + peerDependencies: + svelte: ^3.0.0 + resolution: + integrity: sha512-Alo3pVdMlRW1BnvmdTswcQAOkFMhMpBK/zS2xqCXp3DqPvBw6g6K5abyxlEyw+/Vac2eH4At8XIkhLZGU8cFeA== + /tiny-emitter/2.1.0: + dev: true + resolution: + integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q== + /to-regex-range/5.0.1: + dependencies: + is-number: 7.0.0 + dev: true + engines: + node: '>=8.0' + optional: true + resolution: + integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + /toidentifier/1.0.0: + dev: true + engines: + node: '>=0.6' + optional: true + resolution: + integrity: sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + /trace/3.1.1: + dependencies: + stack-chain: 2.0.0 + dev: true + engines: + node: '>=8.0' + resolution: + integrity: sha512-iVxFnDKps8bCRQ6kXj66rHYFJY3fNkoYPHeFTFZn89YdwmmQ9Hz97IFPf3NdfbCF3zuqUqFpRNTu6N9+eZR2qg== + /trouter/3.1.0: + dependencies: + regexparam: 1.3.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-3Swwu638QQWOefHLss9cdyLi5/9BKYmXZEXpH0KOFfB9YZwUAwHbDAcoYxaHfqAeFvbi/LqAK7rGkhCr1v1BJA== + /type-is/1.6.18: + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.29 + dev: true + engines: + node: '>= 0.6' + optional: true + resolution: + integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + /unist-util-is/4.1.0: + dev: true + resolution: + integrity: sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== + /unist-util-stringify-position/2.0.3: + dependencies: + '@types/unist': 2.0.3 + dev: true + resolution: + integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g== + /unist-util-visit-parents/3.1.1: + dependencies: + '@types/unist': 2.0.3 + unist-util-is: 4.1.0 + dev: true + resolution: + integrity: sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== + /unist-util-visit/2.0.3: + dependencies: + '@types/unist': 2.0.3 + unist-util-is: 4.1.0 + unist-util-visit-parents: 3.1.1 + dev: true + resolution: + integrity: sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== + /unpipe/1.0.0: + dev: true + engines: + node: '>= 0.8' + optional: true + resolution: + integrity: sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + /untildify/2.1.0: + dependencies: + os-homedir: 1.0.2 + dev: true + engines: + node: '>=0.10.0' + optional: true + resolution: + integrity: sha1-F+soB5h/dpUunASF/DEdBqgmouA= + /utils-merge/1.0.1: + dev: true + engines: + node: '>= 0.4.0' + optional: true + resolution: + integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + /vary/1.1.2: + dev: true + engines: + node: '>= 0.8' + optional: true + resolution: + integrity: sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + /vfile-message/2.0.4: + dependencies: + '@types/unist': 2.0.3 + unist-util-stringify-position: 2.0.3 + dev: true + resolution: + integrity: sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ== + /vite/2.0.5: + dependencies: + esbuild: 0.8.57 + postcss: 8.2.7 + resolve: 1.20.0 + rollup: 2.40.0 + dev: true + engines: + node: '>=12.0.0' + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + resolution: + integrity: sha512-QTgEDbq1WsTtr6j+++ewjhBFEk6c8v0xz4fb/OWJQKNYU8ZZtphOshwOqAlnarSstPBtWCBR0tsugXx6ajfoUg== + /ws/5.2.2: + dependencies: + async-limiter: 1.0.1 + dev: true + optional: true + resolution: + integrity: sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== + /xtend/4.0.2: + dev: true + engines: + node: '>=0.4' + resolution: + integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + /yallist/4.0.0: + dev: true + resolution: + integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + /zingtouch/1.0.6: + dev: true + resolution: + integrity: sha512-S7jcR7cSRy28VmQBO0Tq7ZJV4pzfvvrTU9FrrL0K1QPpfBal9wm0oKhoCuifc+PPCq+hQMTJr5E9XKUQDm00VA== + /zwitch/1.0.5: + dev: true + resolution: + integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== +specifiers: + rollup-plugin-svelte-hot: ^1.0.0-3 + svelte: ^3.35.0 + svelte-portal: ^2.1.1 + svench: ^0.2.0-8 + vite: ^2.0.5 diff --git a/src/Colorpicker.svench b/src/Colorpicker.svench new file mode 100644 index 0000000..2268420 --- /dev/null +++ b/src/Colorpicker.svench @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/src/actions/drag.js b/src/actions/drag.js new file mode 100644 index 0000000..1b7416c --- /dev/null +++ b/src/actions/drag.js @@ -0,0 +1,43 @@ +export default function (node) { + let mouseButtonIsPressed = false; + const mouseNotPressed = () => (mouseButtonIsPressed = false); + const mouseIsPressed = (event) => { + mouseButtonIsPressed = true; + dispatchEvent(node, event); + }; + + function handleMouseMove(event) { + if (!mouseButtonIsPressed) return; + dispatchEvent(node, event); + } + + window.addEventListener("mousedown", mouseIsPressed); + window.addEventListener("mouseup", mouseNotPressed); + window.addEventListener("mousemove", handleMouseMove); + + return { + destroy() { + window.removeEventListener("mousedown", mouseIsPressed); + window.removeEventListener("mouseup", mouseNotPressed); + window.removeEventListener("mousemove", handleMouseMove); + }, + }; +} + +function mouseIsInsideContainer(x, y, width, height) { + return x > 0 && y > 0 && x < width && y < height; +} + +function dispatchEvent(node, event) { + const { left, top, width, height } = node.getBoundingClientRect(); + let x = event.clientX - left; + let y = event.clientY - top; + + if (mouseIsInsideContainer(x, y, width, height)) { + node.dispatchEvent( + new CustomEvent("drag", { + detail: { mouseX: x, mouseY: y }, + }) + ); + } +} diff --git a/actions/index.js b/src/actions/index.js similarity index 100% rename from actions/index.js rename to src/actions/index.js diff --git a/actions/key-events.js b/src/actions/key-events.js similarity index 100% rename from actions/key-events.js rename to src/actions/key-events.js diff --git a/components/ButtonGroup.svelte b/src/components/ButtonGroup.svelte similarity index 100% rename from components/ButtonGroup.svelte rename to src/components/ButtonGroup.svelte diff --git a/components/CheckedBackground.svelte b/src/components/CheckedBackground.svelte similarity index 93% rename from components/CheckedBackground.svelte rename to src/components/CheckedBackground.svelte index c1a3c2f..13497ed 100644 --- a/components/CheckedBackground.svelte +++ b/src/components/CheckedBackground.svelte @@ -1,5 +1,5 @@ @@ -42,15 +37,11 @@ bind:this={palette} bind:clientHeight={paletteHeight} bind:clientWidth={paletteWidth} - on:click={event => handePaletteChange({ - mouseX: event.clientX, - mouseY: event.clientY, - })} class="palette" + use:drag + on:drag={event => handlePaletteChange(event.detail)} {style}>
handePaletteChange(event.detail)} class="picker" style={pickerStyle} />
diff --git a/components/Slider.svelte b/src/components/Slider.svelte similarity index 81% rename from components/Slider.svelte rename to src/components/Slider.svelte index 36b683c..6e12836 100644 --- a/components/Slider.svelte +++ b/src/components/Slider.svelte @@ -14,16 +14,12 @@ const isWithinLimit = value => value >= 0 && value <= upperLimit - function onSliderChange({ mouseX }, isDrag = false) { - const { left, width } = slider.getBoundingClientRect() - - let clickPosition = mouseX - left - - let percentageClick = (clickPosition / sliderWidth).toFixed(2) + function onSliderChange({ mouseX }) { + let percentageClick = (mouseX / sliderWidth).toFixed(2) if (percentageClick >= 0 && percentageClick <= 1) { let value = type === "hue" ? 360 * percentageClick : percentageClick - dispatch("change", { color: value, isDrag }) + dispatch("change", { color: value }) } } @@ -43,10 +39,6 @@ } } - function handleDragEnd() { - dispatch("dragend") - } - $: thumbPosition = type === "hue" ? sliderWidth * (value / 360) : sliderWidth * value @@ -57,15 +49,13 @@ tabindex="0" bind:this={slider} use:keyevents={{ 37: handleLeftKey, 39: handleRightKey }} + use:drag + on:drag={e => onSliderChange(e.detail, true)} bind:clientWidth={sliderWidth} - on:click={event => onSliderChange({ mouseX: event.clientX })} class="color-format-slider" class:hue={type === 'hue'} class:alpha={type === 'alpha'}>
onSliderChange(e.detail, true)} - on:dragend={handleDragEnd} class="slider-thumb" {style} />
diff --git a/components/Swatch.svelte b/src/components/Swatch.svelte similarity index 100% rename from components/Swatch.svelte rename to src/components/Swatch.svelte diff --git a/helpers.js b/src/helpers/index.js similarity index 100% rename from helpers.js rename to src/helpers/index.js diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..5d3ebe4 --- /dev/null +++ b/src/index.js @@ -0,0 +1,2 @@ +import Colorpreview from "./components/ColorPreview.svelte"; +export default Colorpreview; diff --git a/utils.js b/src/utils/index.js similarity index 100% rename from utils.js rename to src/utils/index.js diff --git a/utils.test.js b/src/utils/utils.test.js similarity index 100% rename from utils.test.js rename to src/utils/utils.test.js