Offline flow separation #304

Merged
b merged 13 commits from 231-offline-flow into staging 2025-01-22 13:05:30 +00:00
Showing only changes of commit b6a84dedbe - Show all commits

View File

@ -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]