diff --git a/bun.lockb b/bun.lockb
index be3af48..304a9ee 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index d274a3a..3e0730d 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,7 @@
],
"scripts": {
"dev": "bun --cwd web dev",
+ "build": "bun --cwd npm build",
"check": "bun --cwd npm check && bun --cwd web check",
"prepare": "simple-git-hooks"
},
diff --git a/web/components/SettingsTab.vue b/web/components/SettingsTab.vue
index a65bb07..afd99b1 100644
--- a/web/components/SettingsTab.vue
+++ b/web/components/SettingsTab.vue
@@ -1,8 +1,24 @@
@@ -11,10 +27,14 @@ const showPartNumbers = useShowPartNumbers();
-
+
+
+
+
+
diff --git a/web/composables/useBladeWidth.ts b/web/composables/useBladeWidth.ts
index 884e70d..3048a5a 100644
--- a/web/composables/useBladeWidth.ts
+++ b/web/composables/useBladeWidth.ts
@@ -5,5 +5,6 @@ import { Distance } from '@aklinker1/cutlist';
*/
export default function () {
const bladeWidth = useBladeWidthSetting();
- return computed(() => new Distance(bladeWidth.value + 'in').m);
+ const unit = useDistanceUnit();
+ return computed(() => new Distance(bladeWidth.value + unit.value).m);
}
diff --git a/web/composables/useCutlistConfig.ts b/web/composables/useCutlistConfig.ts
index bd7a035..457bec6 100644
--- a/web/composables/useCutlistConfig.ts
+++ b/web/composables/useCutlistConfig.ts
@@ -3,9 +3,11 @@ import type { Config } from '@aklinker1/cutlist';
export default createSharedComposable(() => {
const bladeWidth = useBladeWidth();
const optimize = useOptimizeFor();
+ const extraSpace = useExtraSpace();
return computed(() => ({
bladeWidth: bladeWidth.value,
optimize: optimize.value,
+ extraSpace: extraSpace.value,
}));
});
diff --git a/web/composables/useExtraSpace.ts b/web/composables/useExtraSpace.ts
new file mode 100644
index 0000000..8e93a84
--- /dev/null
+++ b/web/composables/useExtraSpace.ts
@@ -0,0 +1,10 @@
+import { Distance } from '@aklinker1/cutlist';
+
+/**
+ * Returns the extra space in standard units based off the settings.
+ */
+export default function () {
+ const extraSpace = useExtraSpaceSetting();
+ const unit = useDistanceUnit();
+ return computed(() => new Distance(extraSpace.value + unit.value).m);
+}
diff --git a/web/composables/useExtraSpaceSetting.ts b/web/composables/useExtraSpaceSetting.ts
new file mode 100644
index 0000000..14548a6
--- /dev/null
+++ b/web/composables/useExtraSpaceSetting.ts
@@ -0,0 +1,8 @@
+/**
+ * Stores the preference from the settings page directly. Unless you're on the
+ * settings page, you should probably use `useExtraSpace` instead for the
+ * standardized value.
+ */
+export default createGlobalState(() =>
+ useLocalStorage('@cutlist/extra-space', '0'),
+);