Offline flow separation #304
@ -270,21 +270,10 @@ export const getToolboxLabelByMarkType = (markType: MarkType) => {
|
|||||||
return DEFAULT_TOOLBOX.find((t) => t.identifier === markType)?.label
|
return DEFAULT_TOOLBOX.find((t) => t.identifier === markType)?.label
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getOptimizedPathsWithStrokeWidth = (svgString: string) => {
|
export const encryptAndUploadMarks = async (
|
||||||
const parser = new DOMParser()
|
marks: Mark[],
|
||||||
const xmlDoc = parser.parseFromString(svgString, 'image/svg+xml')
|
encryptionKey?: string
|
||||||
const paths = xmlDoc.querySelectorAll('path')
|
) => {
|
||||||
const tuples: string[][] = []
|
|
||||||
paths.forEach((path) => {
|
|
||||||
const d = path.getAttribute('d') ?? ''
|
|
||||||
const strokeWidth = path.getAttribute('stroke-width') ?? ''
|
|
||||||
tuples.push([d, strokeWidth])
|
|
||||||
})
|
|
||||||
|
|
||||||
return tuples
|
|
||||||
}
|
|
||||||
|
|
||||||
export const processMarks = async (marks: Mark[], encryptionKey?: string) => {
|
|
||||||
const _marks = [...marks]
|
const _marks = [...marks]
|
||||||
for (let i = 0; i < _marks.length; i++) {
|
for (let i = 0; i < _marks.length; i++) {
|
||||||
const mark = _marks[i]
|
const mark = _marks[i]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user