diff --git a/.versionrc.json b/.versionrc.json new file mode 100644 index 0000000..b4a1cf4 --- /dev/null +++ b/.versionrc.json @@ -0,0 +1,12 @@ +{ + "types": [ + { "type": "feat", "section": "Features" }, + { "type": "fix", "section": "Bug Fixes" }, + { "type": "chore" }, + { "type": "docs" }, + { "type": "style", "hidden": false }, + { "type": "refactor", "hidden": false }, + { "type": "perf", "hidden": false }, + { "type": "test", "hidden": false } + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md index c50aa46..de66627 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ -## Next +# Changelog -* Add svench. -* Switch to Sveltekit. +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [2.1.0](///compare/v2.0.0...v2.1.0) (2022-04-07) + + +### Features + +* add localStorage memory bf7206a +* can move main system comps in the print output b425f4a + + +* add standard-version 2fd047f diff --git a/jsconfig.json b/jsconfig.json index 893781f..345083f 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,9 +1,10 @@ { - "compilerOptions": { - "baseUrl": ".", - "paths": { - "$lib/*": ["src/lib/*"] - } - }, - "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"] + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "baseUrl": ".", + "paths": { + "$lib/*": ["src/lib/*"] + } + }, + "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"] } diff --git a/package.json b/package.json index a9123fa..013f938 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,8 @@ { - "name": "~TODO~", - "version": "0.0.1", + "name": "aotds-docks", + "version": "2.1.0", + "type": "module", + "private": true, "scripts": { "dev": "svelte-kit dev", "build": "svelte-kit build", @@ -24,11 +26,11 @@ "eslint-plugin-svelte3": "^3.4.1", "prettier": "~2.5.1", "prettier-plugin-svelte": "^2.6.0", + "standard-version": "^9.3.2", "storybook-builder-vite": "0.1.21", "svelte": "^3.46.4", "vite": "^2.7.0" }, - "type": "module", "dependencies": { "@storybook/addon-essentials": "^6.4.19", "@storybook/addon-svelte-csf": "^1.1.0", @@ -43,6 +45,7 @@ "rollup-plugin-analyzer": "^4.0.0", "svelte-chota": "^1.8.6", "svelte-knobby": "^0.3.4", + "svelte-moveable": "^0.20.0", "ts-action": "^11.0.0", "updux": "link:/home/yanick/work/javascript/updux-js/", "webpack": "5" diff --git a/src/lib/components/Output/Print/MainSystems/Movable.svelte b/src/lib/components/Output/Print/MainSystems/Movable.svelte new file mode 100644 index 0000000..e69ddcd --- /dev/null +++ b/src/lib/components/Output/Print/MainSystems/Movable.svelte @@ -0,0 +1,42 @@ + { + e.dragStart && e.dragStart.set(frame.translate); + }} + on:dragOrigin={({ detail: e }) => { + frame.translate = e.drag.beforeTranslate; + frame.transformOrigin = e.transformOrigin; + }} + on:dragStart={({ detail: e }) => { + e.set(frame.translate); + }} + on:drag={({ detail: e }) => { + frame.translate = e.beforeTranslate; + }} + on:render={({ detail: e }) => { + const { translate, rotate, transformOrigin } = frame; + e.target.style.transformOrigin = transformOrigin; + e.target.style.transform = + `translate(${translate[0]}px, ${translate[1]}px)` + + ` rotate(${rotate}deg)`; + }} +/> + + diff --git a/src/lib/components/Output/Print/MainSystems/index.svelte b/src/lib/components/Output/Print/MainSystems/index.svelte index 1595607..29d68a2 100644 --- a/src/lib/components/Output/Print/MainSystems/index.svelte +++ b/src/lib/components/Output/Print/MainSystems/index.svelte @@ -1,26 +1,53 @@
{#if ftl !== "none"} - ftl drive + ftl drive + + {#if movable} + + {/if} {/if} {#if engine > 0} -
{engine}
+
+ {engine} +
+ {#if movable} + + {/if} {/if} internal systems + {#if movable} + + {/if}
diff --git a/src/lib/store/ship.js b/src/lib/store/ship.js index d86f1ed..d4d2211 100644 --- a/src/lib/store/ship.js +++ b/src/lib/store/ship.js @@ -3,6 +3,7 @@ import { readable, get, derived } from "svelte/store"; import { compose, applyMiddleware } from "redux"; import shipDux from "../shipDux/index.js"; +import { initial } from "lodash"; let composeEnhancers = compose; @@ -11,7 +12,16 @@ if (dev && browser && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) { } export default () => { - const duxStore = shipDux.createStore(undefined, (mw) => + + let initialState = undefined; + + if( browser ) { + const i =localStorage.getItem('ship'); + + if(i) initialState = JSON.parse(localStorage.getItem('ship')); + } + + const duxStore = shipDux.createStore(initialState, (mw) => composeEnhancers(applyMiddleware(mw)) ); @@ -21,6 +31,7 @@ export default () => { if (previous === duxStore.getState()) return; previous = duxStore.getState(); set(previous); + if( browser ) localStorage.setItem('ship', JSON.stringify(previous)); }); }); diff --git a/svelte.config.js b/svelte.config.js index a1fe60a..8940ae6 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,21 +1,19 @@ import adapter from "@sveltejs/adapter-static"; import analyze from "rollup-plugin-analyzer"; -const dev = process.env.NODE_ENV === 'development'; - - +const dev = process.env.NODE_ENV === "development"; /** @type {import('@sveltejs/kit').Config} */ export default { - kit: { - adapter: adapter({ fallback: 'index.html' }), - paths: { base: dev? '' : "/aotds-docks" }, - vite: { - build: { - rollupOptions: { - plugins: [analyze()], - // external: ['updux','@yanick/updeep'] - }, - }, + kit: { + adapter: adapter({ fallback: "index.html" }), + paths: { base: dev ? "" : "/aotds-docks" }, + vite: { + build: { + rollupOptions: { + plugins: [analyze()], + // external: ['updux','@yanick/updeep'] }, + }, }, + }, };