diff --git a/plugins/plugin-theme/src/css.mjs b/plugins/plugin-theme/src/css.mjs
index 9a5c0bb4d8a..04e1c605af0 100644
--- a/plugins/plugin-theme/src/css.mjs
+++ b/plugins/plugin-theme/src/css.mjs
@@ -1,37 +1,41 @@
-export const paperlessStyle = `
-/* Paperless grid */
-svg.freesewing path.grid {
- fill: none;
+export const paperlessStyle = (stripped) => `
+${!stripped ? '/* Paperless grid */' : ''}
+${!stripped ? 'svg.freesewing ' : ''}path.grid {
stroke: #555;
stroke-width: 0.3;
}
-svg.freesewing path.gridline {
+${!stripped ? 'svg.freesewing ' : ''}path.gridline {
stroke: #555;
stroke-width: 0.2;
+ fill: none;
}
-svg.freesewing path.gridline-lg {
+${!stripped ? 'svg.freesewing ' : ''}path.gridline-lg {
stroke: #777;
stroke-width: 0.2;
stroke-dasharray: 1.5,1.5;
+ fill: none;
}
-svg.freesewing path.gridline-sm {
+${!stripped ? 'svg.freesewing ' : ''}path.gridline-sm {
stroke: #999;
stroke-width: 0.1;
+ fill: none;
}
-svg.freesewing path.gridline-xs {
+${!stripped ? 'svg.freesewing ' : ''}path.gridline-xs {
stroke: #999;
stroke-width: 0.1;
stroke-dasharray: 0.5,0.5;
+ fill: none;
}
-svg.freesewing path.gridbox {
+${!stripped ? 'svg.freesewing ' : ''}path.gridbox {
fill: url(#grid);
}`
-export const sampleStyle = `
-/* Sample classes */
-svg.freesewing path.sample {
+
+export const sampleStyle = (stripped) => `
+${!stripped ? '/* Sample classes */' : ''}
+${!stripped ? 'svg.freesewing ' : ''}path.sample {
stroke-width: 0.75
}
-svg.freesewing path.sample-focus {
+${!stripped ? 'svg.freesewing ' : ''}path.sample-focus {
stroke-width: 1.5; fill: rgba(0,0,0,0.1)
}`
diff --git a/plugins/plugin-theme/src/index.mjs b/plugins/plugin-theme/src/index.mjs
index 9fea50a860b..0456c45a52d 100644
--- a/plugins/plugin-theme/src/index.mjs
+++ b/plugins/plugin-theme/src/index.mjs
@@ -28,8 +28,8 @@ export const plugin = {
const current = svg.attributes.get('class')
if (!current || current.indexOf('freesewing') !== -1) {
svg.attributes.set('class', 'freesewing')
- svg.style += sampleStyle
- svg.style += paperlessStyle
+ svg.style += sampleStyle(data.stripped)
+ svg.style += paperlessStyle(data.stripped)
svg.style += buildStylesheet(svg.pattern.settings.scale, data.stripped)
let paperless = false
for (const set of svg.pattern.settings) {
@@ -40,10 +40,10 @@ export const plugin = {
? (svg.defs += grid.imperial)
: (svg.defs += grid.metric)
const parts = svg.pattern.parts[svg.pattern.activeSet]
- const skip = data.skipGrid || []
+ const skipGrid = data.skipGrid || []
for (const key in parts) {
const part = parts[key]
- if (!part.hidden && !data.skipGrid.includes(key) && svg.pattern.__needs(key)) {
+ if (!part.hidden && !skipGrid.includes(key) && svg.pattern.__needs(key)) {
const { Path, paths, getId, Point, points } = part.shorthand()
let anchor = new Point(0, 0)
if (typeof points.gridAnchor !== 'undefined') anchor = part.points.gridAnchor
diff --git a/sites/shared/components/workbench/draft/part/index.js b/sites/shared/components/workbench/draft/part/index.js
index 54b2bcb6ff3..b7b4f13e636 100644
--- a/sites/shared/components/workbench/draft/part/index.js
+++ b/sites/shared/components/workbench/draft/part/index.js
@@ -1,4 +1,4 @@
-import {forwardRef} from 'react'
+import { forwardRef } from 'react'
import Path from '../path'
import Point from '../point'
import Snippet from '../snippet'
@@ -17,11 +17,11 @@ const partInfo = (props) => (
Width
- {round(props.part.width,2)}mm
+ {round(props.part.width, 2)}mm
Height
- {round(props.part.height,2)}mm
+ {round(props.part.height, 2)}mm
Top Left
@@ -33,116 +33,124 @@ const partInfo = (props) => (
Attributes
-
+
+
+
- {props.gist?.only && props.gist.only.length > 0
- ? (
-
+ {props.gist?.only && props.gist.only.length > 0 ? (
+
) : (
+ >
+ Show only this part
+
)}
-
-
-
+
+
+
)
-const XrayPart = props => {
+const XrayPart = (props) => {
const { topLeft, bottomRight } = props.part
return (
- { evt.stopPropagation(); props.showInfo(partInfo(props)) }}
+ `}
+ className={`peer stroke-note lashed opacity-30 hover:opacity-90 fill-fabric hover:cursor-pointer hover:stroke-mark`}
+ style={{ fillOpacity: 0 }}
+ onClick={(evt) => {
+ evt.stopPropagation()
+ props.showInfo(partInfo(props))
+ }}
/>
)
}
export const PartInner = forwardRef((props, ref) => {
- const { partName, part, gist } = props
+ const { partName, part, gist, skipGrid } = props
- const Grid = gist.paperless ? (
-
- ) : null
-
- return (
- {Grid}
- {
- gist._state?.xray?.enabled &&
-
- }
- {Object.keys(part.paths).map((pathName) => (
-
- ))}
- {Object.keys(props.part.points).map((pointName) => (
-
- ))}
- {Object.keys(props.part.snippets).map((snippetName) => (
-
- ))}
- )
-})
-
-const Part = props => {
- const { partName, part} = props
+ ) : null
return (
-
-
-
+
+ {Grid}
+ {gist._state?.xray?.enabled && }
+ {Object.keys(part.paths).map((pathName) => (
+
+ ))}
+ {Object.keys(props.part.points).map((pointName) => (
+
+ ))}
+ {Object.keys(props.part.snippets).map((snippetName) => (
+
+ ))}
+
+ )
+})
+
+const Part = (props) => {
+ const { partName, part } = props
+
+ return (
+
+
+
)
}
/*
diff --git a/sites/shared/components/workbench/exporting/export-handler.js b/sites/shared/components/workbench/exporting/export-handler.js
index 40deeb725ce..c92160c3601 100644
--- a/sites/shared/components/workbench/exporting/export-handler.js
+++ b/sites/shared/components/workbench/exporting/export-handler.js
@@ -74,7 +74,7 @@ export const handleExport = async (format, gist, design, t, app, onComplete, onE
let pattern = new design({ ...gist, layout })
// add the theme and translation to the pattern
- pattern.use(themePlugin, { stripped: format !== 'svg' })
+ pattern.use(themePlugin, { stripped: format !== 'svg', skipGrid: ['pages'] })
pattern.use(
{
hooks: {
@@ -115,13 +115,13 @@ export const handleExport = async (format, gist, design, t, app, onComplete, onE
// add the svg and pages data to the worker args
workerArgs.pages = pattern.setStores[pattern.activeSet].get('pages')
+
+ // post a message to the worker with all needed data
+ worker.postMessage(workerArgs)
} catch (err) {
console.log(err)
app.stopLoading()
onError && onError(err)
}
}
-
- // post a message to the worker with all needed data
- worker.postMessage(workerArgs)
}
diff --git a/sites/shared/components/workbench/exporting/pdf-maker.js b/sites/shared/components/workbench/exporting/pdf-maker.js
index c62436d68bd..aaac060dc4b 100644
--- a/sites/shared/components/workbench/exporting/pdf-maker.js
+++ b/sites/shared/components/workbench/exporting/pdf-maker.js
@@ -3,9 +3,9 @@ import SVGtoPDF from 'svg-to-pdfkit'
import { path as logoPath } from 'shared/components/icons/freesewing.js'
/** an svg of the logo to put on the cover page */
-const logoSvg = `