cozy-ui 135.4.0 → 135.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/assets/icons/illus/assistant-color.svg +1 -0
- package/assets/icons/ui/expand.svg +1 -0
- package/assets/icons/ui/export.svg +1 -0
- package/assets/icons/ui/narrow.svg +1 -0
- package/package.json +1 -1
- package/react/ActionsMenu/Actions/exportToText.js +54 -0
- package/react/ActionsMenu/Actions/helpers.js +20 -0
- package/react/ActionsMenu/Actions/index.js +1 -0
- package/react/ActionsMenu/Actions/locales/en.json +2 -1
- package/react/ActionsMenu/Actions/locales/fr.json +2 -1
- package/react/ActionsMenu/Actions/locales/ru.json +3 -2
- package/react/ActionsMenu/Actions/locales/vi.json +3 -2
- package/react/ActionsMenu/Actions/pdfHelpers.js +187 -0
- package/react/Icon/Readme.md +10 -2
- package/react/Icons/AssistantColor.jsx +79 -0
- package/react/Icons/Expand.jsx +12 -0
- package/react/Icons/Export.jsx +13 -0
- package/react/Icons/Narrow.jsx +16 -0
- package/transpiled/react/ActionsMenu/Actions/exportToText.d.ts +13 -0
- package/transpiled/react/ActionsMenu/Actions/exportToText.js +84 -0
- package/transpiled/react/ActionsMenu/Actions/helpers.d.ts +1 -0
- package/transpiled/react/ActionsMenu/Actions/helpers.js +20 -1
- package/transpiled/react/ActionsMenu/Actions/index.d.ts +1 -0
- package/transpiled/react/ActionsMenu/Actions/index.js +2 -1
- package/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales.js +8 -4
- package/transpiled/react/ActionsMenu/Actions/pdfHelpers.d.ts +34 -0
- package/transpiled/react/ActionsMenu/Actions/pdfHelpers.js +242 -0
- package/transpiled/react/Icon/icons-sprite.d.ts +1 -1
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/AssistantColor.d.ts +2 -0
- package/transpiled/react/Icons/AssistantColor.js +85 -0
- package/transpiled/react/Icons/Expand.d.ts +2 -0
- package/transpiled/react/Icons/Expand.js +14 -0
- package/transpiled/react/Icons/Export.d.ts +2 -0
- package/transpiled/react/Icons/Export.js +16 -0
- package/transpiled/react/Icons/Narrow.d.ts +2 -0
- package/transpiled/react/Icons/Narrow.js +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [135.6.0](https://github.com/cozy/cozy-ui/compare/v135.5.0...v135.6.0) (2026-01-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Implement new actions ExportToText and new icons :sparkles: ([6714f4a](https://github.com/cozy/cozy-ui/commit/6714f4a))
|
|
7
|
+
|
|
8
|
+
# [135.5.0](https://github.com/cozy/cozy-ui/compare/v135.4.0...v135.5.0) (2026-01-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* Add assistant icon :sparkles: ([19b4b67](https://github.com/cozy/cozy-ui/commit/19b4b67))
|
|
14
|
+
|
|
1
15
|
# [135.4.0](https://github.com/cozy/cozy-ui/compare/v135.3.0...v135.4.0) (2026-01-21)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_19251_33606)"><path d="M6.626 10.332a1.333 1.333 0 0 0-.958-.958L1.578 8.32a.333.333 0 0 1 0-.642l4.09-1.055a1.333 1.333 0 0 0 .958-.957l1.055-4.09a.333.333 0 0 1 .642 0l1.054 4.09a1.333 1.333 0 0 0 .958.958l4.09 1.054a.333.333 0 0 1 0 .642l-4.09 1.054a1.333 1.333 0 0 0-.958.958l-1.055 4.09a.333.333 0 0 1-.642 0l-1.054-4.09Z" stroke="#868687" stroke-width="1.333" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.626 10.332a1.333 1.333 0 0 0-.958-.958L1.578 8.32a.333.333 0 0 1 0-.642l4.09-1.055a1.333 1.333 0 0 0 .958-.957l1.055-4.09a.333.333 0 0 1 .642 0l1.054 4.09a1.333 1.333 0 0 0 .958.958l4.09 1.054a.333.333 0 0 1 0 .642l-4.09 1.054a1.333 1.333 0 0 0-.958.958l-1.055 4.09a.333.333 0 0 1-.642 0l-1.054-4.09Z" stroke="url(#paint0_linear_19251_33606)" stroke-opacity=".9" stroke-width="1.333" stroke-linecap="round" stroke-linejoin="round"/><path d="M13.335 1.334c.368 0 .667.3.667.667v.666h.668a.667.667 0 0 1 0 1.334h-.668v.667a.667.667 0 0 1-1.334 0v-.667h-.665a.667.667 0 0 1 0-1.334h.665v-.666c0-.368.299-.667.667-.667Z" fill="url(#paint1_linear_19251_33606)" fill-opacity=".9"/><path d="M2.667 10.667c.368 0 .665.298.666.665a.667.667 0 0 1 .001 1.333v.002a.667.667 0 0 1-1.334 0v-.001h-.001a.667.667 0 0 1 0-1.334H2a.667.667 0 0 1 .667-.665Z" fill="url(#paint2_linear_19251_33606)" fill-opacity=".9"/></g><defs><linearGradient id="paint0_linear_19251_33606" x1="1.336" y1="7.999" x2="19.625" y2="7.999" gradientUnits="userSpaceOnUse"><stop stop-color="#00B7FF"/><stop offset=".567" stop-color="#E06DD1"/><stop offset="1" stop-color="#FF0"/></linearGradient><linearGradient id="paint1_linear_19251_33606" x1="11.336" y1="3.334" x2="16.822" y2="3.334" gradientUnits="userSpaceOnUse"><stop stop-color="#00B7FF"/><stop offset=".567" stop-color="#E06DD1"/><stop offset="1" stop-color="#FF0"/></linearGradient><linearGradient id="paint2_linear_19251_33606" x1="1.332" y1="12.001" x2="4.99" y2="12.001" gradientUnits="userSpaceOnUse"><stop stop-color="#00B7FF"/><stop offset=".567" stop-color="#E06DD1"/><stop offset="1" stop-color="#FF0"/></linearGradient><clipPath id="clip0_19251_33606"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.8 15.2a.8.8 0 0 0-.8-.8H2.8a.8.8 0 0 0 0 1.6H14a.8.8 0 0 0 .8-.8ZM14.8.8A.8.8 0 0 0 14 0H2.8a.8.8 0 1 0 0 1.6H14a.8.8 0 0 0 .8-.8ZM6.893 9.833a.799.799 0 0 0-1.128 1.132l1.928 1.928a1 1 0 0 0 1.414 0l1.928-1.928a.799.799 0 0 0-1.128-1.132l-.707.703V5.464l.707.703a.799.799 0 0 0 1.128-1.132L9.107 3.107a1 1 0 0 0-1.414 0L5.765 5.035a.799.799 0 0 0 1.128 1.132l.707-.703v5.072l-.707-.703Z" fill="#2C3038"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.8 4v10.4l-.008.159A1.6 1.6 0 0 1 13.2 16H3.6a1.6 1.6 0 0 1-1.014-.362l-.117-.107a1.6 1.6 0 0 1-.461-.972L2 14.4V1.6c0-.372.13-.73.362-1.014L2.47.469A1.6 1.6 0 0 1 3.599 0h7.2l4 4ZM3.6 14.4h9.6V5.6h-1.598a2.4 2.4 0 0 1-2.4-2.4V1.6H3.6v12.8Zm7.202-11.2a.8.8 0 0 0 .8.8h.935l-1.736-1.736V3.2Z" fill="#2C3038"/><path d="M8.401 7.2a.8.8 0 0 1 .8.799v2.867l1.034-1.032a.8.8 0 1 1 1.131 1.13l-2.4 2.401a.794.794 0 0 1-.436.222.817.817 0 0 1-.13.013.793.793 0 0 1-.127-.013.794.794 0 0 1-.438-.222l-2.4-2.4a.8.8 0 1 1 1.131-1.131l1.035 1.034V8a.8.8 0 0 1 .8-.8Z" fill="#2C3038"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.736.264a.9.9 0 0 1 0 1.274L12.07 5.204h2.027a.9.9 0 1 1 0 1.802H9.896a.9.9 0 0 1-.901-.9V1.901a.9.9 0 1 1 1.802 0V3.93L14.462.264a.9.9 0 0 1 1.274 0ZM1 9.895a.9.9 0 0 1 .902-.901h4.203a.9.9 0 0 1 .901.9v4.204a.9.9 0 0 1-1.802 0V12.07l-3.666 3.667a.9.9 0 0 1-1.274-1.274l3.667-3.666H1.9a.9.9 0 0 1-.9-.901Z" fill="#2C3038"/></svg>
|
package/package.json
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
|
+
|
|
3
|
+
import logger from 'cozy-logger'
|
|
4
|
+
|
|
5
|
+
import { downloadBlob } from './helpers'
|
|
6
|
+
import { getActionsI18n } from './locales/withActionsLocales'
|
|
7
|
+
import { makePdfBlobFromText } from './pdfHelpers'
|
|
8
|
+
import Icon from '../../Icon'
|
|
9
|
+
import ExportIcon from '../../Icons/Export'
|
|
10
|
+
import ListItemIcon from '../../ListItemIcon'
|
|
11
|
+
import ListItemText from '../../ListItemText'
|
|
12
|
+
import ActionsMenuItem from '../ActionsMenuItem'
|
|
13
|
+
|
|
14
|
+
const makeComponent = (label, icon) => {
|
|
15
|
+
const Component = forwardRef((props, ref) => {
|
|
16
|
+
return (
|
|
17
|
+
<ActionsMenuItem {...props} ref={ref}>
|
|
18
|
+
<ListItemIcon>
|
|
19
|
+
<Icon icon={icon} />
|
|
20
|
+
</ListItemIcon>
|
|
21
|
+
<ListItemText primary={label} />
|
|
22
|
+
</ActionsMenuItem>
|
|
23
|
+
)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
Component.displayName = 'exportToText'
|
|
27
|
+
|
|
28
|
+
return Component
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const exportToText = ({ exportedText, file }) => {
|
|
32
|
+
const { t } = getActionsI18n()
|
|
33
|
+
const icon = ExportIcon
|
|
34
|
+
const label = t('exportToText')
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
name: 'exportToText',
|
|
38
|
+
icon,
|
|
39
|
+
label,
|
|
40
|
+
displayCondition: () => !!exportedText,
|
|
41
|
+
Component: makeComponent(label, icon),
|
|
42
|
+
action: async () => {
|
|
43
|
+
try {
|
|
44
|
+
const blob = await makePdfBlobFromText(exportedText)
|
|
45
|
+
const baseName = file?.name
|
|
46
|
+
? `${file.name.replace(/\.[^/.]+$/, '')}_export`
|
|
47
|
+
: 'export'
|
|
48
|
+
downloadBlob(blob, `${baseName}.pdf`)
|
|
49
|
+
} catch (error) {
|
|
50
|
+
logger.error(error)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -238,3 +238,23 @@ export const makePdfBlob = async ({ client, docs, fetchBlobFileById }) => {
|
|
|
238
238
|
|
|
239
239
|
return blob
|
|
240
240
|
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Trigger a browser download for a given blob.
|
|
244
|
+
*
|
|
245
|
+
* @param {Blob} blob - File content
|
|
246
|
+
* @param {string} filename - Desired filename
|
|
247
|
+
* @returns {void}
|
|
248
|
+
*/
|
|
249
|
+
export const downloadBlob = (blob, filename) => {
|
|
250
|
+
if (!blob || !filename) return
|
|
251
|
+
|
|
252
|
+
const url = URL.createObjectURL(blob)
|
|
253
|
+
const a = document.createElement('a')
|
|
254
|
+
a.href = url
|
|
255
|
+
a.download = filename
|
|
256
|
+
a.style.display = 'none'
|
|
257
|
+
document.body.appendChild(a)
|
|
258
|
+
a.click()
|
|
259
|
+
a.remove()
|
|
260
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { PDFDocument, StandardFonts } from 'pdf-lib'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Wrap a string into multiple lines based on available width.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} opts
|
|
7
|
+
* @param {import('pdf-lib').PDFFont} opts.font - Embedded pdf-lib font
|
|
8
|
+
* @param {number} opts.fontSize - Font size
|
|
9
|
+
* @param {number} opts.maxLineWidth - Max line width in PDF units
|
|
10
|
+
* @param {string} opts.line - Text to wrap
|
|
11
|
+
* @returns {string[]} Wrapped lines
|
|
12
|
+
*/
|
|
13
|
+
export const wrapTextToLines = ({ font, fontSize, maxLineWidth, line }) => {
|
|
14
|
+
if (!line) return []
|
|
15
|
+
if (fontSize <= 0 || maxLineWidth <= 0) return [line]
|
|
16
|
+
|
|
17
|
+
const words = line.split(' ')
|
|
18
|
+
|
|
19
|
+
return words.reduce((lines, word) => {
|
|
20
|
+
const currentLine = lines[lines.length - 1]
|
|
21
|
+
|
|
22
|
+
if (!currentLine) {
|
|
23
|
+
return [word]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const testLine = `${currentLine} ${word}`
|
|
27
|
+
const testWidth = font.widthOfTextAtSize(testLine, fontSize)
|
|
28
|
+
|
|
29
|
+
if (testWidth <= maxLineWidth) {
|
|
30
|
+
lines[lines.length - 1] = testLine
|
|
31
|
+
} else {
|
|
32
|
+
lines.push(word)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return lines
|
|
36
|
+
}, [])
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Add a new page if there is not enough space to draw a new line.
|
|
41
|
+
*
|
|
42
|
+
* @param {object} opts
|
|
43
|
+
* @param {PDFDocument} opts.pdfDoc - pdf-lib document
|
|
44
|
+
* @param {import('pdf-lib').PDFPage} opts.page - Current page
|
|
45
|
+
* @param {number} opts.y - Current y cursor position
|
|
46
|
+
* @param {number} opts.requiredHeight - Height required before adding a new page
|
|
47
|
+
* @param {number} opts.marginTop - Top margin
|
|
48
|
+
* @param {number} opts.marginBottom - Bottom margin
|
|
49
|
+
* @returns {{ page: import('pdf-lib').PDFPage, y: number }} Updated page and y
|
|
50
|
+
*/
|
|
51
|
+
export const pushNewPageIfNeeded = ({
|
|
52
|
+
pdfDoc,
|
|
53
|
+
page,
|
|
54
|
+
y,
|
|
55
|
+
requiredHeight,
|
|
56
|
+
marginTop,
|
|
57
|
+
marginBottom
|
|
58
|
+
}) => {
|
|
59
|
+
if (!pdfDoc || !page) {
|
|
60
|
+
throw new Error('pdfDoc and page are required')
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const { width, height } = page.getSize()
|
|
64
|
+
|
|
65
|
+
if (y - requiredHeight < marginBottom) {
|
|
66
|
+
const newPage = pdfDoc.addPage([width, height])
|
|
67
|
+
return {
|
|
68
|
+
page: newPage,
|
|
69
|
+
y: height - marginTop
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return { page, y }
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Draws a plain text string onto a PDF, wrapping lines to max width and handling page breaks.
|
|
78
|
+
*
|
|
79
|
+
* @param {object} opts
|
|
80
|
+
* @param {PDFDocument} opts.pdfDoc - pdf-lib document
|
|
81
|
+
* @param {import('pdf-lib').PDFPage} opts.page - Current page
|
|
82
|
+
* @param {number} opts.y - Current y cursor position
|
|
83
|
+
* @param {string} opts.text - Text to draw
|
|
84
|
+
* @param {import('pdf-lib').PDFFont} opts.font - Embedded pdf-lib font
|
|
85
|
+
* @param {number} opts.fontSize - Font size
|
|
86
|
+
* @param {number} opts.lineHeight - Line height
|
|
87
|
+
* @param {number} opts.marginX - Left margin
|
|
88
|
+
* @param {number} opts.marginY - Top/bottom margin
|
|
89
|
+
* @param {number} opts.maxLineWidth - Max line width in PDF units
|
|
90
|
+
* @returns {{ page: import('pdf-lib').PDFPage, y: number }} Updated page and y
|
|
91
|
+
*/
|
|
92
|
+
export const drawWrappedText = ({
|
|
93
|
+
pdfDoc,
|
|
94
|
+
page,
|
|
95
|
+
y,
|
|
96
|
+
text,
|
|
97
|
+
font,
|
|
98
|
+
fontSize,
|
|
99
|
+
lineHeight,
|
|
100
|
+
marginX,
|
|
101
|
+
marginY,
|
|
102
|
+
maxLineWidth
|
|
103
|
+
}) => {
|
|
104
|
+
let currentPage = page
|
|
105
|
+
let currentY = y
|
|
106
|
+
|
|
107
|
+
const paragraphs = String(text ?? '').split(/\r?\n/)
|
|
108
|
+
|
|
109
|
+
const renderItems = paragraphs.flatMap(paragraph => {
|
|
110
|
+
const wrappedLines = wrapTextToLines({
|
|
111
|
+
font,
|
|
112
|
+
fontSize,
|
|
113
|
+
maxLineWidth,
|
|
114
|
+
line: paragraph
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
return [...wrappedLines, { type: 'paragraphGap' }]
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
for (const item of renderItems) {
|
|
121
|
+
if (typeof item === 'object' && item.type === 'paragraphGap') {
|
|
122
|
+
currentY -= lineHeight / 2
|
|
123
|
+
continue
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const nextState = pushNewPageIfNeeded({
|
|
127
|
+
pdfDoc,
|
|
128
|
+
page: currentPage,
|
|
129
|
+
y: currentY,
|
|
130
|
+
requiredHeight: lineHeight,
|
|
131
|
+
marginTop: marginY,
|
|
132
|
+
marginBottom: marginY
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
currentPage = nextState.page
|
|
136
|
+
currentY = nextState.y
|
|
137
|
+
|
|
138
|
+
currentPage.drawText(item, {
|
|
139
|
+
x: marginX,
|
|
140
|
+
y: currentY - fontSize,
|
|
141
|
+
size: fontSize,
|
|
142
|
+
font
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
currentY -= lineHeight
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return { page: currentPage, y: currentY }
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Creates a PDF Blob from a plain text string.
|
|
153
|
+
*
|
|
154
|
+
* @param {string} text - Text content to put into the PDF
|
|
155
|
+
* @returns {Promise<Blob>} PDF file as a Blob
|
|
156
|
+
*/
|
|
157
|
+
export const makePdfBlobFromText = async text => {
|
|
158
|
+
const pdfDoc = await PDFDocument.create()
|
|
159
|
+
const font = await pdfDoc.embedFont(StandardFonts.Helvetica)
|
|
160
|
+
|
|
161
|
+
const CONFIG = {
|
|
162
|
+
fontSize: 12,
|
|
163
|
+
lineHeight: 16,
|
|
164
|
+
marginX: 40,
|
|
165
|
+
marginY: 40,
|
|
166
|
+
pageSize: [595.28, 841.89] // A4
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const maxLineWidth = CONFIG.pageSize[0] - CONFIG.marginX * 2
|
|
170
|
+
const initialPage = pdfDoc.addPage(CONFIG.pageSize)
|
|
171
|
+
|
|
172
|
+
drawWrappedText({
|
|
173
|
+
pdfDoc,
|
|
174
|
+
page: initialPage,
|
|
175
|
+
y: CONFIG.pageSize[1] - CONFIG.marginY,
|
|
176
|
+
text,
|
|
177
|
+
font,
|
|
178
|
+
fontSize: CONFIG.fontSize,
|
|
179
|
+
lineHeight: CONFIG.lineHeight,
|
|
180
|
+
marginX: CONFIG.marginX,
|
|
181
|
+
marginY: CONFIG.marginY,
|
|
182
|
+
maxLineWidth
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
const pdfBytes = await pdfDoc.save()
|
|
186
|
+
return new Blob([pdfBytes], { type: 'application/pdf' })
|
|
187
|
+
}
|
package/react/Icon/Readme.md
CHANGED
|
@@ -170,7 +170,9 @@ import EmailOpen from 'cozy-ui/transpiled/react/Icons/EmailOpen'
|
|
|
170
170
|
import Eu from 'cozy-ui/transpiled/react/Icons/Eu'
|
|
171
171
|
import Euro from 'cozy-ui/transpiled/react/Icons/Euro'
|
|
172
172
|
import Exchange from 'cozy-ui/transpiled/react/Icons/Exchange'
|
|
173
|
+
import Expand from 'cozy-ui/transpiled/react/Icons/Expand'
|
|
173
174
|
import Expert from 'cozy-ui/transpiled/react/Icons/Expert'
|
|
175
|
+
import Export from 'cozy-ui/transpiled/react/Icons/Export'
|
|
174
176
|
import Eye from 'cozy-ui/transpiled/react/Icons/Eye'
|
|
175
177
|
import EyeClosed from 'cozy-ui/transpiled/react/Icons/EyeClosed'
|
|
176
178
|
import FaceId from 'cozy-ui/transpiled/react/Icons/FaceId'
|
|
@@ -245,6 +247,7 @@ import MovementOut from 'cozy-ui/transpiled/react/Icons/MovementOut'
|
|
|
245
247
|
import Moveto from 'cozy-ui/transpiled/react/Icons/Moveto'
|
|
246
248
|
import MultiFiles from 'cozy-ui/transpiled/react/Icons/MultiFiles'
|
|
247
249
|
import Music from 'cozy-ui/transpiled/react/Icons/Music'
|
|
250
|
+
import Narrow from 'cozy-ui/transpiled/react/Icons/Narrow'
|
|
248
251
|
import New from 'cozy-ui/transpiled/react/Icons/New'
|
|
249
252
|
import Next from 'cozy-ui/transpiled/react/Icons/Next'
|
|
250
253
|
import Note from 'cozy-ui/transpiled/react/Icons/Note'
|
|
@@ -461,7 +464,9 @@ const icons = [
|
|
|
461
464
|
Eu,
|
|
462
465
|
Euro,
|
|
463
466
|
Exchange,
|
|
467
|
+
Expand,
|
|
464
468
|
Expert,
|
|
469
|
+
Export,
|
|
465
470
|
Eye,
|
|
466
471
|
EyeClosed,
|
|
467
472
|
FaceId,
|
|
@@ -536,6 +541,7 @@ const icons = [
|
|
|
536
541
|
Moveto,
|
|
537
542
|
MultiFiles,
|
|
538
543
|
Music,
|
|
544
|
+
Narrow,
|
|
539
545
|
New,
|
|
540
546
|
Next,
|
|
541
547
|
Note,
|
|
@@ -715,6 +721,7 @@ import DemoProvider from 'cozy-ui/docs/components/DemoProvider'
|
|
|
715
721
|
import cx from 'classnames'
|
|
716
722
|
|
|
717
723
|
import AccountIcon from 'cozy-ui/transpiled/react/Icons/Account'
|
|
724
|
+
import AssistantColorIcon from 'cozy-ui/transpiled/react/Icons/AssistantColor'
|
|
718
725
|
import BottomSelectIcon from 'cozy-ui/transpiled/react/Icons/BottomSelect'
|
|
719
726
|
import CreditCardLargeIcon from 'cozy-ui/transpiled/react/Icons/CreditCardLarge'
|
|
720
727
|
import ChatIcon from 'cozy-ui/transpiled/react/Icons/Chat'
|
|
@@ -769,6 +776,7 @@ import TwakeWorkplace from 'cozy-ui/transpiled/react/Icons/TwakeWorkplace'
|
|
|
769
776
|
|
|
770
777
|
const icons = [
|
|
771
778
|
AccountIcon,
|
|
779
|
+
AssistantColorIcon,
|
|
772
780
|
BottomSelectIcon,
|
|
773
781
|
ChatIcon,
|
|
774
782
|
CheckWhiteIcon,
|
|
@@ -1012,7 +1020,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
|
1012
1020
|
|
|
1013
1021
|
const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
|
|
1014
1022
|
let i = 0
|
|
1015
|
-
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp', 'article', 'assign-admin','assign-moderator','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud-rainbow','cloud-plus-outlined','cloud','cloud2','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','database','debit','desktop-download','devices','discuss','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email-open','email','eu','euro','exchange','expert','eye-closed','eye','face-id','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder-open','folder','forbidden','from-user','gear','globe','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','key2','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','matrix','merge','moped','mosaic','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','number','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','peoples','percent-circle','percent','person-add','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','planet','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','secutiry','select-all','send','server','setting','share-circle','share','shield','shield-infected','shield-clean','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','tag','target','task','team','telecom','telephone','text','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
|
|
1023
|
+
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp', 'article', 'assign-admin','assign-moderator','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud-rainbow','cloud-plus-outlined','cloud','cloud2','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','database','debit','desktop-download','devices','discuss','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email-open','email','eu','euro','exchange','expand','expert','export','eye-closed','eye','face-id','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder-open','folder','forbidden','from-user','gear','globe','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','key2','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','matrix','merge','moped','mosaic','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','narrow','new','next','note','notification-email','number','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','peoples','percent-circle','percent','person-add','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','planet','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','secutiry','select-all','send','server','setting','share-circle','share','shield','shield-infected','shield-clean','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','tag','target','task','team','telecom','telephone','text','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
|
|
1016
1024
|
;
|
|
1017
1025
|
|
|
1018
1026
|
<Grid container spacing={2}>
|
|
@@ -1044,7 +1052,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
|
1044
1052
|
import Grid from 'cozy-ui/transpiled/react/Grid'
|
|
1045
1053
|
import Sprite from 'cozy-ui/transpiled/react/Icon/Sprite'
|
|
1046
1054
|
|
|
1047
|
-
const availableIcons = ['account', 'bottom-select', 'check-white', 'cloud-broken', 'contacts', 'cozy-authentification', 'cozy-logo', 'cozy-upgrade', 'credit-card-large', 'dash-white', 'device-browser', 'device-laptop', 'device-phone', 'device-tablet', 'file-type-audio', 'file-type-banking-account' , 'file-type-bin', 'file-type-code', 'file-type-files', 'file-type-folder', 'file-type-server', 'file-type-shared-drive', 'file-type-shared-drive-grey', 'file-type-image', 'file-type-note', 'file-type-pdf', 'file-type-sheet', 'file-type-slide', 'file-type-text', 'file-type-video', 'file-type-zip', 'forbidden-sign', 'google', 'keychain', 'logout-large', 'papers', 'only-office', 'store', 'top-select', 'trash-duotone', 'cozy'];
|
|
1055
|
+
const availableIcons = ['account', 'assistant-color', 'bottom-select', 'check-white', 'cloud-broken', 'contacts', 'cozy-authentification', 'cozy-logo', 'cozy-upgrade', 'credit-card-large', 'dash-white', 'device-browser', 'device-laptop', 'device-phone', 'device-tablet', 'file-type-audio', 'file-type-banking-account' , 'file-type-bin', 'file-type-code', 'file-type-files', 'file-type-folder', 'file-type-server', 'file-type-shared-drive', 'file-type-shared-drive-grey', 'file-type-image', 'file-type-note', 'file-type-pdf', 'file-type-sheet', 'file-type-slide', 'file-type-text', 'file-type-video', 'file-type-zip', 'forbidden-sign', 'google', 'keychain', 'logout-large', 'papers', 'only-office', 'store', 'top-select', 'trash-duotone', 'cozy'];
|
|
1048
1056
|
|
|
1049
1057
|
<Grid container spacing={2}>
|
|
1050
1058
|
<Sprite />
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/illus/assistant-color.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgAssistantColor(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 16 16" fill="none" {...props}>
|
|
7
|
+
<g clipPath="url(#assistant-color_svg__clip0_19251_33606)">
|
|
8
|
+
<path
|
|
9
|
+
d="M6.626 10.332a1.333 1.333 0 00-.958-.958L1.578 8.32a.333.333 0 010-.642l4.09-1.055a1.333 1.333 0 00.958-.957l1.055-4.09a.333.333 0 01.642 0l1.054 4.09a1.333 1.333 0 00.958.958l4.09 1.054a.333.333 0 010 .642l-4.09 1.054a1.333 1.333 0 00-.958.958l-1.055 4.09a.333.333 0 01-.642 0l-1.054-4.09z"
|
|
10
|
+
stroke="#868687"
|
|
11
|
+
strokeWidth={1.333}
|
|
12
|
+
strokeLinecap="round"
|
|
13
|
+
strokeLinejoin="round"
|
|
14
|
+
/>
|
|
15
|
+
<path
|
|
16
|
+
d="M6.626 10.332a1.333 1.333 0 00-.958-.958L1.578 8.32a.333.333 0 010-.642l4.09-1.055a1.333 1.333 0 00.958-.957l1.055-4.09a.333.333 0 01.642 0l1.054 4.09a1.333 1.333 0 00.958.958l4.09 1.054a.333.333 0 010 .642l-4.09 1.054a1.333 1.333 0 00-.958.958l-1.055 4.09a.333.333 0 01-.642 0l-1.054-4.09z"
|
|
17
|
+
stroke="url(#assistant-color_svg__paint0_linear_19251_33606)"
|
|
18
|
+
strokeOpacity={0.9}
|
|
19
|
+
strokeWidth={1.333}
|
|
20
|
+
strokeLinecap="round"
|
|
21
|
+
strokeLinejoin="round"
|
|
22
|
+
/>
|
|
23
|
+
<path
|
|
24
|
+
d="M13.335 1.334c.368 0 .667.3.667.667v.666h.668a.667.667 0 010 1.334h-.668v.667a.667.667 0 01-1.334 0v-.667h-.665a.667.667 0 010-1.334h.665v-.666c0-.368.299-.667.667-.667z"
|
|
25
|
+
fill="url(#assistant-color_svg__paint1_linear_19251_33606)"
|
|
26
|
+
fillOpacity={0.9}
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
d="M2.667 10.667c.368 0 .665.298.666.665a.667.667 0 01.001 1.333v.002a.667.667 0 01-1.334 0v-.001h-.001a.667.667 0 010-1.334H2a.667.667 0 01.667-.665z"
|
|
30
|
+
fill="url(#assistant-color_svg__paint2_linear_19251_33606)"
|
|
31
|
+
fillOpacity={0.9}
|
|
32
|
+
/>
|
|
33
|
+
</g>
|
|
34
|
+
<defs>
|
|
35
|
+
<linearGradient
|
|
36
|
+
id="assistant-color_svg__paint0_linear_19251_33606"
|
|
37
|
+
x1={1.336}
|
|
38
|
+
y1={7.999}
|
|
39
|
+
x2={19.625}
|
|
40
|
+
y2={7.999}
|
|
41
|
+
gradientUnits="userSpaceOnUse"
|
|
42
|
+
>
|
|
43
|
+
<stop stopColor="#00B7FF" />
|
|
44
|
+
<stop offset={0.567} stopColor="#E06DD1" />
|
|
45
|
+
<stop offset={1} stopColor="#FF0" />
|
|
46
|
+
</linearGradient>
|
|
47
|
+
<linearGradient
|
|
48
|
+
id="assistant-color_svg__paint1_linear_19251_33606"
|
|
49
|
+
x1={11.336}
|
|
50
|
+
y1={3.334}
|
|
51
|
+
x2={16.822}
|
|
52
|
+
y2={3.334}
|
|
53
|
+
gradientUnits="userSpaceOnUse"
|
|
54
|
+
>
|
|
55
|
+
<stop stopColor="#00B7FF" />
|
|
56
|
+
<stop offset={0.567} stopColor="#E06DD1" />
|
|
57
|
+
<stop offset={1} stopColor="#FF0" />
|
|
58
|
+
</linearGradient>
|
|
59
|
+
<linearGradient
|
|
60
|
+
id="assistant-color_svg__paint2_linear_19251_33606"
|
|
61
|
+
x1={1.332}
|
|
62
|
+
y1={12.001}
|
|
63
|
+
x2={4.99}
|
|
64
|
+
y2={12.001}
|
|
65
|
+
gradientUnits="userSpaceOnUse"
|
|
66
|
+
>
|
|
67
|
+
<stop stopColor="#00B7FF" />
|
|
68
|
+
<stop offset={0.567} stopColor="#E06DD1" />
|
|
69
|
+
<stop offset={1} stopColor="#FF0" />
|
|
70
|
+
</linearGradient>
|
|
71
|
+
<clipPath id="assistant-color_svg__clip0_19251_33606">
|
|
72
|
+
<path fill="#fff" d="M0 0h16v16H0z" />
|
|
73
|
+
</clipPath>
|
|
74
|
+
</defs>
|
|
75
|
+
</svg>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default SvgAssistantColor
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/expand.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgExpand(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 16 16" fill="none" {...props}>
|
|
7
|
+
<path d="M14.8 15.2a.8.8 0 00-.8-.8H2.8a.8.8 0 000 1.6H14a.8.8 0 00.8-.8zm0-14.4A.8.8 0 0014 0H2.8a.8.8 0 100 1.6H14a.8.8 0 00.8-.8zM6.893 9.833a.799.799 0 00-1.128 1.132l1.928 1.928a1 1 0 001.414 0l1.928-1.928a.799.799 0 00-1.128-1.132l-.707.703V5.464l.707.703a.799.799 0 001.128-1.132L9.107 3.107a1 1 0 00-1.414 0L5.765 5.035a.799.799 0 001.128 1.132l.707-.703v5.072l-.707-.703z" />
|
|
8
|
+
</svg>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default SvgExpand
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/export.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgExport(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 16 16" fill="none" {...props}>
|
|
7
|
+
<path d="M14.8 4v10.4l-.008.159A1.6 1.6 0 0113.2 16H3.6a1.6 1.6 0 01-1.014-.362l-.117-.107a1.6 1.6 0 01-.461-.972L2 14.4V1.6c0-.372.13-.73.362-1.014L2.47.469A1.6 1.6 0 013.599 0h7.2l4 4zM3.6 14.4h9.6V5.6h-1.598a2.4 2.4 0 01-2.4-2.4V1.6H3.6v12.8zm7.202-11.2a.8.8 0 00.8.8h.935l-1.736-1.736V3.2z" />
|
|
8
|
+
<path d="M8.401 7.2a.8.8 0 01.8.799v2.867l1.034-1.032a.8.8 0 111.131 1.13l-2.4 2.401a.794.794 0 01-.436.222.817.817 0 01-.13.013.793.793 0 01-.127-.013.794.794 0 01-.438-.222l-2.4-2.4a.8.8 0 111.131-1.131l1.035 1.034V8a.8.8 0 01.8-.8z" />
|
|
9
|
+
</svg>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default SvgExport
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/narrow.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgNarrow(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 16 16" fill="none" {...props}>
|
|
7
|
+
<path
|
|
8
|
+
fillRule="evenodd"
|
|
9
|
+
clipRule="evenodd"
|
|
10
|
+
d="M15.736.264a.9.9 0 010 1.274L12.07 5.204h2.027a.9.9 0 110 1.802H9.896a.9.9 0 01-.901-.9V1.901a.9.9 0 111.802 0V3.93L14.462.264a.9.9 0 011.274 0zM1 9.895a.9.9 0 01.902-.901h4.203a.9.9 0 01.901.9v4.204a.9.9 0 01-1.802 0V12.07l-3.666 3.667a.9.9 0 01-1.274-1.274l3.667-3.666H1.9a.9.9 0 01-.9-.901z"
|
|
11
|
+
/>
|
|
12
|
+
</svg>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default SvgNarrow
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function exportToText({ exportedText, file }: {
|
|
2
|
+
exportedText: any;
|
|
3
|
+
file: any;
|
|
4
|
+
}): {
|
|
5
|
+
name: string;
|
|
6
|
+
icon: typeof ExportIcon;
|
|
7
|
+
label: any;
|
|
8
|
+
displayCondition: () => boolean;
|
|
9
|
+
Component: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
10
|
+
action: () => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
import ExportIcon from "../../Icons/Export";
|
|
13
|
+
import React from "react";
|