cozy-ui 113.3.0 → 113.5.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 CHANGED
@@ -1,3 +1,18 @@
1
+ # [113.5.0](https://github.com/cozy/cozy-ui/compare/v113.4.0...v113.5.0) (2024-11-27)
2
+
3
+
4
+ ### Features
5
+
6
+ * **Icons:** Add CloudPlusOutlined icon ([e66cb72](https://github.com/cozy/cozy-ui/commit/e66cb72))
7
+
8
+ # [113.4.0](https://github.com/cozy/cozy-ui/compare/v113.3.0...v113.4.0) (2024-11-25)
9
+
10
+
11
+ ### Features
12
+
13
+ * **Actions:** Add viewInDrive ([36bd091](https://github.com/cozy/cozy-ui/commit/36bd091))
14
+ * **Icon:** Add folderOpen ([6d72a55](https://github.com/cozy/cozy-ui/commit/6d72a55))
15
+
1
16
  # [113.3.0](https://github.com/cozy/cozy-ui/compare/v113.2.0...v113.3.0) (2024-11-18)
2
17
 
3
18
 
@@ -0,0 +1 @@
1
+ <svg width="18" height="16" viewBox="0 0 18 16" xmlns="http://www.w3.org/2000/svg"><path d="M3.297 4.297a5.002 5.002 0 0 1 9.406 0 5.008 5.008 0 0 1 3.213 3.787 5.027 5.027 0 0 0-2.045.044A3.001 3.001 0 0 0 11 6a3 3 0 0 0-6 0 3 3 0 1 0 0 6h5.1a5.022 5.022 0 0 0 0 2H5a5 5 0 0 1-1.703-9.703ZM14 11a1 1 0 1 1 2 0v1h1a1 1 0 1 1 0 2h-1v1a1 1 0 1 1-2 0v-1h-1a1 1 0 1 1 0-2h1v-1Z"/></svg>
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "113.3.0",
3
+ "version": "113.5.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -6,4 +6,5 @@ export { call } from './call'
6
6
  export { emailTo } from './emailTo'
7
7
  export { print } from './print'
8
8
  export { viewInContacts } from './viewInContacts'
9
+ export { viewInDrive } from './viewInDrive'
9
10
  export { others } from './others'
@@ -1,5 +1,6 @@
1
1
  {
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",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "viewInContacts": "Voir dans Cozy Contacts",
3
+ "viewInDrive": "Ouvrir",
3
4
  "modify": "Modifier",
4
5
  "emailTo": "Envoyer un e-mail",
5
6
  "smsTo": "Envoyer un message",
@@ -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
 
@@ -111,6 +111,7 @@ import Clock from 'cozy-ui/transpiled/react/Icons/Clock'
111
111
  import ClockOutline from 'cozy-ui/transpiled/react/Icons/ClockOutline'
112
112
  import Cloud from 'cozy-ui/transpiled/react/Icons/Cloud'
113
113
  import CloudHappy from 'cozy-ui/transpiled/react/Icons/CloudHappy'
114
+ import CloudPlusOutlined from 'cozy-ui/transpiled/react/Icons/CloudPlusOutlined'
114
115
  import Collect from 'cozy-ui/transpiled/react/Icons/Collect'
115
116
  import Cocktail from 'cozy-ui/transpiled/react/Icons/Cocktail'
116
117
  import Comment from 'cozy-ui/transpiled/react/Icons/Comment'
@@ -176,6 +177,7 @@ import Flashlight from 'cozy-ui/transpiled/react/Icons/Flashlight'
176
177
  import Folder from 'cozy-ui/transpiled/react/Icons/Folder'
177
178
  import FolderAdd from 'cozy-ui/transpiled/react/Icons/FolderAdd'
178
179
  import FolderMoveto from 'cozy-ui/transpiled/react/Icons/FolderMoveto'
180
+ import FolderOpen from 'cozy-ui/transpiled/react/Icons/FolderOpen'
179
181
  import Forbidden from 'cozy-ui/transpiled/react/Icons/Forbidden'
180
182
  import FromUser from 'cozy-ui/transpiled/react/Icons/FromUser'
181
183
  import Gear from 'cozy-ui/transpiled/react/Icons/Gear'
@@ -376,6 +378,7 @@ const icons = [
376
378
  ClockOutline,
377
379
  Cloud,
378
380
  CloudHappy,
381
+ CloudPlusOutlined,
379
382
  Collect,
380
383
  Cocktail,
381
384
  Comment,
@@ -441,6 +444,7 @@ const icons = [
441
444
  Folder,
442
445
  FolderAdd,
443
446
  FolderMoveto,
447
+ FolderOpen,
444
448
  Forbidden,
445
449
  FromUser,
446
450
  Gear,
@@ -929,7 +933,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
929
933
 
930
934
  const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
931
935
  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']
936
+ 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-plus-outlined','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
937
  ;
934
938
  <div style={{ fontSize: '2rem', display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)' }}>
935
939
  <Sprite />
@@ -0,0 +1,12 @@
1
+ // Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/cloud-plus-outlined.svg` to regenerate;
2
+ import React from 'react'
3
+
4
+ function SvgCloudPlusOutlined(props) {
5
+ return (
6
+ <svg viewBox="0 0 18 16" {...props}>
7
+ <path d="M3.297 4.297a5.002 5.002 0 019.406 0 5.008 5.008 0 013.213 3.787 5.027 5.027 0 00-2.045.044A3.001 3.001 0 0011 6a3 3 0 00-6 0 3 3 0 100 6h5.1a5.022 5.022 0 000 2H5a5 5 0 01-1.703-9.703zM14 11a1 1 0 112 0v1h1a1 1 0 110 2h-1v1a1 1 0 11-2 0v-1h-1a1 1 0 110-2h1v-1z" />
8
+ </svg>
9
+ )
10
+ }
11
+
12
+ export default SvgCloudPlusOutlined
@@ -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
@@ -6,4 +6,5 @@ export { call } from './call';
6
6
  export { emailTo } from './emailTo';
7
7
  export { print } from './print';
8
8
  export { viewInContacts } from './viewInContacts';
9
+ export { viewInDrive } from './viewInDrive';
9
10
  export { others } from './others';
@@ -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
+ };