cozy-ui 113.3.0 → 113.4.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 +8 -0
- package/assets/icons/ui/folder-open.svg +1 -0
- package/package.json +1 -1
- package/react/ActionsMenu/Actions/index.js +1 -0
- package/react/ActionsMenu/Actions/locales/en.json +1 -0
- package/react/ActionsMenu/Actions/locales/fr.json +1 -0
- package/react/ActionsMenu/Actions/viewInDrive.js +52 -0
- package/react/ActionsMenu/Readme.md +2 -2
- package/react/Icon/Readme.md +3 -1
- package/react/Icons/FolderOpen.jsx +12 -0
- package/transpiled/react/ActionsMenu/Actions/index.js +1 -0
- package/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales.js +2 -0
- package/transpiled/react/ActionsMenu/Actions/viewInDrive.js +49 -0
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/FolderOpen.js +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# [113.4.0](https://github.com/cozy/cozy-ui/compare/v113.3.0...v113.4.0) (2024-11-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **Actions:** Add viewInDrive ([36bd091](https://github.com/cozy/cozy-ui/commit/36bd091))
|
|
7
|
+
* **Icon:** Add folderOpen ([6d72a55](https://github.com/cozy/cozy-ui/commit/6d72a55))
|
|
8
|
+
|
|
1
9
|
# [113.3.0](https://github.com/cozy/cozy-ui/compare/v113.2.0...v113.3.0) (2024-11-18)
|
|
2
10
|
|
|
3
11
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M0 13V3a2 2 0 0 1 2-2h3.172a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 8.828 3H12a2 2 0 0 1 2 2H3.5a.5.5 0 0 0-.474.342l-2 6a.5.5 0 1 0 .948.316L3.86 6h11.142a1 1 0 0 1 .952 1.304l-2.01 6.304A2 2 0 0 1 12.039 15H2a2 2 0 0 1-2-2Z"/></svg>
|
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
|
+
|
|
3
|
+
import { generateWebLink } from 'cozy-client'
|
|
4
|
+
|
|
5
|
+
import { getActionsI18n } from './locales/withActionsLocales'
|
|
6
|
+
import Icon from '../../Icon'
|
|
7
|
+
import FolderOpenIcon from '../../Icons/FolderOpen'
|
|
8
|
+
import ListItemIcon from '../../ListItemIcon'
|
|
9
|
+
import ListItemText from '../../ListItemText'
|
|
10
|
+
import ActionsMenuItem from '../ActionsMenuItem'
|
|
11
|
+
|
|
12
|
+
const makeComponent = (label, icon) => {
|
|
13
|
+
const Component = forwardRef((props, ref) => {
|
|
14
|
+
return (
|
|
15
|
+
<ActionsMenuItem {...props} ref={ref}>
|
|
16
|
+
<ListItemIcon>
|
|
17
|
+
<Icon icon={icon} />
|
|
18
|
+
</ListItemIcon>
|
|
19
|
+
<ListItemText primary={label} />
|
|
20
|
+
</ActionsMenuItem>
|
|
21
|
+
)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
Component.displayName = 'viewInDrive'
|
|
25
|
+
|
|
26
|
+
return Component
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const viewInDrive = () => {
|
|
30
|
+
const { t } = getActionsI18n()
|
|
31
|
+
const icon = FolderOpenIcon
|
|
32
|
+
const label = t('viewInDrive')
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
name: 'viewInDrive',
|
|
36
|
+
icon,
|
|
37
|
+
label,
|
|
38
|
+
Component: makeComponent(label, icon),
|
|
39
|
+
action: (docs, { client }) => {
|
|
40
|
+
const dirId = docs[0].dir_id
|
|
41
|
+
const webLink = generateWebLink({
|
|
42
|
+
slug: 'drive',
|
|
43
|
+
cozyUrl: client.getStackClient().uri,
|
|
44
|
+
subDomainType: client.getInstanceOptions().subdomain,
|
|
45
|
+
pathname: '/',
|
|
46
|
+
hash: `folder/${dirId}`
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
window.open(webLink, '_blank')
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -65,7 +65,7 @@ import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
|
65
65
|
import FileTypeText from 'cozy-ui/transpiled/react/Icons/FileTypeText'
|
|
66
66
|
import FileIcon from 'cozy-ui/transpiled/react/Icons/File'
|
|
67
67
|
|
|
68
|
-
import { makeActions, modify, emailTo, print, viewInContacts, divider, smsTo, call } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
68
|
+
import { makeActions, modify, emailTo, print, viewInContacts, viewInDrive, divider, smsTo, call } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
69
69
|
|
|
70
70
|
initialState = { showMenu: isTesting() }
|
|
71
71
|
|
|
@@ -100,7 +100,7 @@ const customAction = () => ({
|
|
|
100
100
|
})
|
|
101
101
|
})
|
|
102
102
|
|
|
103
|
-
const actions = makeActions([ modify, viewInContacts, divider, call, smsTo, emailTo, print, divider, customAction ])
|
|
103
|
+
const actions = makeActions([ modify, viewInContacts, viewInDrive, divider, call, smsTo, emailTo, print, divider, customAction ])
|
|
104
104
|
|
|
105
105
|
;
|
|
106
106
|
|
package/react/Icon/Readme.md
CHANGED
|
@@ -176,6 +176,7 @@ import Flashlight from 'cozy-ui/transpiled/react/Icons/Flashlight'
|
|
|
176
176
|
import Folder from 'cozy-ui/transpiled/react/Icons/Folder'
|
|
177
177
|
import FolderAdd from 'cozy-ui/transpiled/react/Icons/FolderAdd'
|
|
178
178
|
import FolderMoveto from 'cozy-ui/transpiled/react/Icons/FolderMoveto'
|
|
179
|
+
import FolderOpen from 'cozy-ui/transpiled/react/Icons/FolderOpen'
|
|
179
180
|
import Forbidden from 'cozy-ui/transpiled/react/Icons/Forbidden'
|
|
180
181
|
import FromUser from 'cozy-ui/transpiled/react/Icons/FromUser'
|
|
181
182
|
import Gear from 'cozy-ui/transpiled/react/Icons/Gear'
|
|
@@ -441,6 +442,7 @@ const icons = [
|
|
|
441
442
|
Folder,
|
|
442
443
|
FolderAdd,
|
|
443
444
|
FolderMoveto,
|
|
445
|
+
FolderOpen,
|
|
444
446
|
Forbidden,
|
|
445
447
|
FromUser,
|
|
446
448
|
Gear,
|
|
@@ -929,7 +931,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
|
929
931
|
|
|
930
932
|
const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
|
|
931
933
|
let i = 0
|
|
932
|
-
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','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','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','debit','devices','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email','eu','euro','exchange','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','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','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','merge','moped','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','percent-circle','percent','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','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','select-all','server','setting','share-circle','share','shield','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-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']
|
|
934
|
+
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','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','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','debit','devices','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email','eu','euro','exchange','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','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','merge','moped','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','percent-circle','percent','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','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','select-all','server','setting','share-circle','share','shield','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-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']
|
|
933
935
|
;
|
|
934
936
|
<div style={{ fontSize: '2rem', display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)' }}>
|
|
935
937
|
<Sprite />
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/folder-open.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgFolderOpen(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 16 16" {...props}>
|
|
7
|
+
<path d="M0 13V3a2 2 0 012-2h3.172a2 2 0 011.414.586l.828.828A2 2 0 008.828 3H12a2 2 0 012 2H3.5a.5.5 0 00-.474.342l-2 6a.5.5 0 10.948.316L3.86 6h11.142a1 1 0 01.952 1.304l-2.01 6.304A2 2 0 0112.039 15H2a2 2 0 01-2-2z" />
|
|
8
|
+
</svg>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default SvgFolderOpen
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var en = {
|
|
2
2
|
viewInContacts: "View in Cozy Contacts",
|
|
3
|
+
viewInDrive: "Open",
|
|
3
4
|
modify: "Modify",
|
|
4
5
|
emailTo: "Send an email",
|
|
5
6
|
smsTo: "Send a message",
|
|
@@ -9,6 +10,7 @@ var en = {
|
|
|
9
10
|
};
|
|
10
11
|
var fr = {
|
|
11
12
|
viewInContacts: "Voir dans Cozy Contacts",
|
|
13
|
+
viewInDrive: "Ouvrir",
|
|
12
14
|
modify: "Modifier",
|
|
13
15
|
emailTo: "Envoyer un e-mail",
|
|
14
16
|
smsTo: "Envoyer un message",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { generateWebLink } from 'cozy-client';
|
|
4
|
+
import { getActionsI18n } from "cozy-ui/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales";
|
|
5
|
+
import Icon from "cozy-ui/transpiled/react/Icon";
|
|
6
|
+
import FolderOpenIcon from "cozy-ui/transpiled/react/Icons/FolderOpen";
|
|
7
|
+
import ListItemIcon from "cozy-ui/transpiled/react/ListItemIcon";
|
|
8
|
+
import ListItemText from "cozy-ui/transpiled/react/ListItemText";
|
|
9
|
+
import ActionsMenuItem from "cozy-ui/transpiled/react/ActionsMenu/ActionsMenuItem";
|
|
10
|
+
|
|
11
|
+
var makeComponent = function makeComponent(label, icon) {
|
|
12
|
+
var Component = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
13
|
+
return /*#__PURE__*/React.createElement(ActionsMenuItem, _extends({}, props, {
|
|
14
|
+
ref: ref
|
|
15
|
+
}), /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Icon, {
|
|
16
|
+
icon: icon
|
|
17
|
+
})), /*#__PURE__*/React.createElement(ListItemText, {
|
|
18
|
+
primary: label
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
Component.displayName = 'viewInDrive';
|
|
22
|
+
return Component;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export var viewInDrive = function viewInDrive() {
|
|
26
|
+
var _getActionsI18n = getActionsI18n(),
|
|
27
|
+
t = _getActionsI18n.t;
|
|
28
|
+
|
|
29
|
+
var icon = FolderOpenIcon;
|
|
30
|
+
var label = t('viewInDrive');
|
|
31
|
+
return {
|
|
32
|
+
name: 'viewInDrive',
|
|
33
|
+
icon: icon,
|
|
34
|
+
label: label,
|
|
35
|
+
Component: makeComponent(label, icon),
|
|
36
|
+
action: function action(docs, _ref) {
|
|
37
|
+
var client = _ref.client;
|
|
38
|
+
var dirId = docs[0].dir_id;
|
|
39
|
+
var webLink = generateWebLink({
|
|
40
|
+
slug: 'drive',
|
|
41
|
+
cozyUrl: client.getStackClient().uri,
|
|
42
|
+
subDomainType: client.getInstanceOptions().subdomain,
|
|
43
|
+
pathname: '/',
|
|
44
|
+
hash: "folder/".concat(dirId)
|
|
45
|
+
});
|
|
46
|
+
window.open(webLink, '_blank');
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|