cozy-ui-plus 14.1.15 → 15.0.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 +13 -0
- package/babel.config.js +1 -1
- package/dist/AppIcon/index.js +53 -84
- package/dist/AppLinker/index.js +38 -75
- package/dist/AppLinker/native.config.js +1 -8
- package/dist/AppLinker/native.js +16 -35
- package/dist/AppSections/Sections.js +69 -105
- package/dist/AppSections/_mockApps.js +2 -10
- package/dist/AppSections/_testApps.js +2 -10
- package/dist/AppSections/categories.js +23 -33
- package/dist/AppSections/components/AppsSection.js +29 -52
- package/dist/AppSections/components/DropdownFilter.js +26 -49
- package/dist/AppSections/constants.js +3 -11
- package/dist/AppSections/generateI18nConfig.js +4 -16
- package/dist/AppSections/helpers.js +8 -24
- package/dist/AppSections/index.js +3 -24
- package/dist/AppSections/search.js +15 -35
- package/dist/AppTile/helpers.js +6 -25
- package/dist/AppTile/index.js +39 -69
- package/dist/CipherIcon/index.js +34 -57
- package/dist/CollectionField/index.js +35 -57
- package/dist/ContactPicker/index.js +32 -51
- package/dist/Contacts/AddModal/ContactAddressDialog/helpers.js +8 -19
- package/dist/Contacts/AddModal/ContactAddressDialog/index.js +24 -43
- package/dist/Contacts/AddModal/ContactAddressDialog/locales/index.js +2 -9
- package/dist/Contacts/AddModal/ContactForm/FieldInput.js +55 -85
- package/dist/Contacts/AddModal/ContactForm/FieldInputAccordion.js +23 -43
- package/dist/Contacts/AddModal/ContactForm/FieldInputArray.js +26 -45
- package/dist/Contacts/AddModal/ContactForm/FieldInputLayout.js +31 -50
- package/dist/Contacts/AddModal/ContactForm/FieldInputWrapper.js +15 -32
- package/dist/Contacts/AddModal/ContactForm/HasValueCondition.js +9 -21
- package/dist/Contacts/AddModal/ContactForm/RelatedContactList.js +13 -29
- package/dist/Contacts/AddModal/ContactForm/RemoveButton.js +9 -22
- package/dist/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.js +24 -47
- package/dist/Contacts/AddModal/ContactForm/TextFieldPhone/ButtonBase.js +4 -16
- package/dist/Contacts/AddModal/ContactForm/TextFieldPhone/CustomInput.js +6 -19
- package/dist/Contacts/AddModal/ContactForm/TextFieldPhone/FlagBottomSheet.js +25 -50
- package/dist/Contacts/AddModal/ContactForm/TextFieldPhone/FlagImage.js +10 -24
- package/dist/Contacts/AddModal/ContactForm/TextFieldPhone/FlagMenu.js +19 -37
- package/dist/Contacts/AddModal/ContactForm/TextFieldPhone/index.js +20 -40
- package/dist/Contacts/AddModal/ContactForm/TextFieldSelect.js +20 -37
- package/dist/Contacts/AddModal/ContactForm/contactToFormValues.js +20 -32
- package/dist/Contacts/AddModal/ContactForm/fieldsConfig.js +21 -34
- package/dist/Contacts/AddModal/ContactForm/formValuesToContact.js +15 -26
- package/dist/Contacts/AddModal/ContactForm/helpers.js +58 -142
- package/dist/Contacts/AddModal/ContactForm/index.js +41 -77
- package/dist/Contacts/AddModal/ContactForm/locales/index.js +2 -9
- package/dist/Contacts/AddModal/CustomLabelDialog/index.js +37 -62
- package/dist/Contacts/AddModal/CustomLabelDialog/locales/index.js +2 -9
- package/dist/Contacts/AddModal/index.js +25 -48
- package/dist/Contacts/AddModal/locales/index.js +2 -9
- package/dist/Contacts/AddModal/mocks.js +4 -13
- package/dist/Contacts/AddModal/types.js +36 -51
- package/dist/Contacts/GroupsSelect/GroupCreation.js +47 -66
- package/dist/Contacts/GroupsSelect/GroupsSelect.js +44 -70
- package/dist/Contacts/GroupsSelect/GroupsSelectProvider.js +14 -36
- package/dist/Contacts/GroupsSelect/SelectBox/Control.js +15 -31
- package/dist/Contacts/GroupsSelect/SelectBox/EditGroupName.js +12 -30
- package/dist/Contacts/GroupsSelect/SelectBox/Menu.js +16 -31
- package/dist/Contacts/GroupsSelect/SelectBox/Option.js +18 -32
- package/dist/Contacts/GroupsSelect/SelectBox/SelectContainer.js +7 -20
- package/dist/Contacts/GroupsSelect/helpers.js +6 -21
- package/dist/Contacts/GroupsSelect/locales/index.js +2 -9
- package/dist/Contacts/GroupsSelect/useGroupSelect.js +23 -40
- package/dist/Contacts/Header/GroupsSelection.js +22 -39
- package/dist/Contacts/Header/ImportDropdown.js +32 -57
- package/dist/Contacts/Header/SearchInput.js +7 -23
- package/dist/Contacts/Header/index.js +32 -52
- package/dist/Contacts/Header/locales/index.js +2 -9
- package/dist/ContactsList/ContactCell.js +6 -19
- package/dist/ContactsList/ContactRow.js +26 -48
- package/dist/ContactsList/Contacts/ContactCozy.js +6 -19
- package/dist/ContactsList/Contacts/ContactEmail.js +6 -19
- package/dist/ContactsList/Contacts/ContactIdentity.js +23 -42
- package/dist/ContactsList/Contacts/ContactName.js +10 -23
- package/dist/ContactsList/Contacts/ContactPhone.js +6 -19
- package/dist/ContactsList/ContactsList.js +24 -47
- package/dist/ContactsList/helpers.js +9 -35
- package/dist/ContactsList/index.js +2 -13
- package/dist/ContactsList/locales/withContactsListLocales.js +3 -15
- package/dist/ContactsListModal/AddContact/AddContactActions.js +6 -19
- package/dist/ContactsListModal/AddContact/AddContactContent.js +21 -40
- package/dist/ContactsListModal/AddContact/AddContactDialog.js +17 -38
- package/dist/ContactsListModal/AddContact/AddContactTitle.js +4 -16
- package/dist/ContactsListModal/AddContact/helpers.js +6 -19
- package/dist/ContactsListModal/ContactsListContent.js +14 -31
- package/dist/ContactsListModal/ContactsListModal.js +50 -82
- package/dist/ContactsListModal/ContactsListModalWithQuery.js +15 -30
- package/dist/ContactsListModal/EmptyMessage.js +10 -24
- package/dist/ContactsListModal/MobileHeader.js +16 -32
- package/dist/ContactsListModal/index.js +17 -36
- package/dist/ContactsListModal/mockClient.js +3 -14
- package/dist/ContactsListModal/queries.js +7 -19
- package/dist/ContactsListModal/withContactsListLocales.js +3 -13
- package/dist/Dialogs/AuthentificationDialog/index.js +31 -57
- package/dist/Dialogs/AuthentificationDialog/withSpecificDialogsLocales.js +3 -15
- package/dist/Field/index.js +65 -93
- package/dist/FileImageLoader/checkImageSource.js +6 -18
- package/dist/FileImageLoader/index.js +50 -77
- package/dist/Intent/IntentDialogOpener/index.js +37 -60
- package/dist/Intent/IntentIframe/index.js +57 -79
- package/dist/Paywall/AiAssistantPaywall.js +6 -18
- package/dist/Paywall/MaxAccountsByKonnectorPaywall.js +14 -31
- package/dist/Paywall/MaxAccountsPaywall.js +13 -30
- package/dist/Paywall/MaxDaysToCapturePaywall.js +13 -30
- package/dist/Paywall/MaxPapersPaywall.js +13 -30
- package/dist/Paywall/OnlyOfficePaywall.js +11 -25
- package/dist/Paywall/PasswordSharingPaywall.js +10 -24
- package/dist/Paywall/Paywall.js +49 -82
- package/dist/Paywall/QuotaPaywall.js +11 -25
- package/dist/Paywall/helpers.js +5 -14
- package/dist/Paywall/index.js +8 -71
- package/dist/Paywall/locales/withPaywallLocales.js +2 -13
- package/dist/Qualification/QualificationIcon/index.js +44 -60
- package/dist/Qualification/QualificationModal/helpers.js +18 -42
- package/dist/Qualification/QualificationModal/index.js +26 -49
- package/dist/Qualification/QualificationModal/locales/index.js +2 -9
- package/dist/ShortcutTile/index.js +12 -29
- package/dist/SquareAppIcon/index.js +64 -98
- package/dist/Storage/StorageButton.js +17 -34
- package/dist/Storage/StorageProgress.js +20 -37
- package/dist/Storage/index.js +14 -31
- package/dist/Storage/locales/index.js +2 -9
- package/dist/Tile/index.js +32 -62
- package/dist/hooks/useClientErrors.js +18 -36
- package/dist/proptypes.js +15 -30
- package/dist/providers/CozyTheme/CozyThemeWithQuery.js +12 -28
- package/dist/providers/CozyTheme/index.js +16 -40
- package/dist/providers/CozyTheme/queries.js +5 -17
- package/dist/providers/DemoProvider.js +9 -22
- package/dist/types.d.js +0 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [15.0.0](https://github.com/cozy/cozy-libs/compare/cozy-ui-plus@14.1.15...cozy-ui-plus@15.0.0) (2026-11-09)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **cozy-ui-plus:** Ship ES modules in dist ([433932c](https://github.com/cozy/cozy-libs/commit/433932c7956f9399c3597d67ce669b9cce8a48b6))
|
|
11
|
+
|
|
12
|
+
### BREAKING CHANGES
|
|
13
|
+
|
|
14
|
+
- **cozy-ui-plus:** dist now contains ES modules. Apps must add cozy-ui-plus
|
|
15
|
+
to Jest transformIgnorePatterns so it gets transformed.
|
|
16
|
+
|
|
17
|
+
Assisted-by: LLM
|
|
18
|
+
|
|
6
19
|
## [14.1.15](https://github.com/cozy/cozy-libs/compare/cozy-ui-plus@14.1.14...cozy-ui-plus@14.1.15) (2026-11-05)
|
|
7
20
|
|
|
8
21
|
**Note:** Version bump only for package cozy-ui-plus
|
package/babel.config.js
CHANGED
package/dist/AppIcon/index.js
CHANGED
|
@@ -1,86 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
19
|
-
|
|
20
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
-
|
|
22
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
-
|
|
24
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
|
-
|
|
26
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
-
|
|
28
|
-
var _twakeIcons = require("@linagora/twake-icons");
|
|
29
|
-
|
|
30
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
31
|
-
|
|
32
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
33
|
-
|
|
34
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
35
|
-
|
|
36
|
-
var _cozyClient = require("cozy-client");
|
|
37
|
-
|
|
38
|
-
var _helpers = require("../AppSections/helpers");
|
|
39
|
-
|
|
40
|
-
var _ShortcutTile = require("../ShortcutTile");
|
|
41
|
-
|
|
42
|
-
var _proptypes = require("../proptypes");
|
|
43
|
-
|
|
44
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
45
|
-
|
|
46
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
47
|
-
|
|
48
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
|
+
|
|
11
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
49
12
|
|
|
50
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
51
14
|
|
|
15
|
+
import { Icon, Cube } from '@linagora/twake-icons';
|
|
16
|
+
import cx from 'classnames';
|
|
17
|
+
import PropTypes from 'prop-types';
|
|
18
|
+
import React, { Component } from 'react';
|
|
19
|
+
import { withClient } from 'cozy-client';
|
|
52
20
|
var styles = {
|
|
53
21
|
"c-loading-placeholder": "styles__c-loading-placeholder___3Q5Co",
|
|
54
22
|
"placeHolderShimmer": "styles__placeHolderShimmer___1L4im",
|
|
55
23
|
"c-app-icon": "styles__c-app-icon___2W1cp",
|
|
56
24
|
"c-app-icon-default": "styles__c-app-icon-default___1Bus5"
|
|
57
25
|
};
|
|
26
|
+
import { isShortcutFile } from '../AppSections/helpers';
|
|
27
|
+
import { ShortcutTile } from '../ShortcutTile';
|
|
28
|
+
import { AppDoctype } from '../proptypes';
|
|
58
29
|
var DONE = 'done';
|
|
59
30
|
var ERRORED = 'errored';
|
|
60
31
|
var FETCHING = 'fetching';
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
(0, _inherits2.default)(AppIcon, _Component);
|
|
32
|
+
export var AppIcon = /*#__PURE__*/function (_Component) {
|
|
33
|
+
_inherits(AppIcon, _Component);
|
|
64
34
|
|
|
65
35
|
var _super = _createSuper(AppIcon);
|
|
66
36
|
|
|
67
37
|
function AppIcon(props, context) {
|
|
68
38
|
var _this;
|
|
69
39
|
|
|
70
|
-
(
|
|
40
|
+
_classCallCheck(this, AppIcon);
|
|
41
|
+
|
|
71
42
|
_this = _super.call(this, props, context);
|
|
72
|
-
|
|
43
|
+
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
73
45
|
error: null,
|
|
74
46
|
icon: null,
|
|
75
47
|
status: _this.props.client ? FETCHING : ERRORED
|
|
76
48
|
});
|
|
49
|
+
|
|
77
50
|
_this.isUnmounting = false;
|
|
78
|
-
_this.handleError = _this.handleError.bind((
|
|
79
|
-
_this.fetchIcon = _this.fetchIcon.bind((
|
|
51
|
+
_this.handleError = _this.handleError.bind(_assertThisInitialized(_this));
|
|
52
|
+
_this.fetchIcon = _this.fetchIcon.bind(_assertThisInitialized(_this));
|
|
80
53
|
return _this;
|
|
81
54
|
}
|
|
82
55
|
|
|
83
|
-
(
|
|
56
|
+
_createClass(AppIcon, [{
|
|
84
57
|
key: "componentWillUnmount",
|
|
85
58
|
value: function componentWillUnmount() {
|
|
86
59
|
this.isUnmounting = true;
|
|
@@ -107,7 +80,7 @@ var AppIcon = /*#__PURE__*/function (_Component) {
|
|
|
107
80
|
priority = _this$props.priority,
|
|
108
81
|
client = _this$props.client; // Shortcut files used in cozy-store have their own icon in their doctype metadata
|
|
109
82
|
|
|
110
|
-
if (
|
|
83
|
+
if (isShortcutFile(app)) return;
|
|
111
84
|
return client.getStackClient().getIconURL({
|
|
112
85
|
type: type,
|
|
113
86
|
slug: app.slug || app,
|
|
@@ -125,10 +98,10 @@ var AppIcon = /*#__PURE__*/function (_Component) {
|
|
|
125
98
|
}, {
|
|
126
99
|
key: "load",
|
|
127
100
|
value: function () {
|
|
128
|
-
var _load = (
|
|
101
|
+
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
129
102
|
var _this$props2, app, fetchIcon, onReady, client, loadFn, loadedUrl, loadError, domain, secure, cozyURL;
|
|
130
103
|
|
|
131
|
-
return
|
|
104
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
132
105
|
while (1) {
|
|
133
106
|
switch (_context.prev = _context.next) {
|
|
134
107
|
case 0:
|
|
@@ -193,23 +166,23 @@ var AppIcon = /*#__PURE__*/function (_Component) {
|
|
|
193
166
|
icon = _this$state.icon,
|
|
194
167
|
status = _this$state.status;
|
|
195
168
|
|
|
196
|
-
if (
|
|
197
|
-
return /*#__PURE__*/
|
|
169
|
+
if (isShortcutFile(this.props.app)) {
|
|
170
|
+
return /*#__PURE__*/React.createElement(ShortcutTile, {
|
|
198
171
|
file: this.props.app
|
|
199
172
|
});
|
|
200
173
|
}
|
|
201
174
|
|
|
202
175
|
switch (status) {
|
|
203
176
|
case FETCHING:
|
|
204
|
-
return /*#__PURE__*/
|
|
177
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
205
178
|
role: "progressbar",
|
|
206
|
-
className: (
|
|
179
|
+
className: cx(styles['c-loading-placeholder'], styles['c-app-icon'], className)
|
|
207
180
|
});
|
|
208
181
|
|
|
209
182
|
case DONE:
|
|
210
|
-
return /*#__PURE__*/
|
|
183
|
+
return /*#__PURE__*/React.createElement("img", {
|
|
211
184
|
alt: alt,
|
|
212
|
-
className: (
|
|
185
|
+
className: cx(styles['c-app-icon'], className),
|
|
213
186
|
onError: this.handleError,
|
|
214
187
|
ref: this.props.iconRef,
|
|
215
188
|
src: icon
|
|
@@ -217,10 +190,10 @@ var AppIcon = /*#__PURE__*/function (_Component) {
|
|
|
217
190
|
|
|
218
191
|
case ERRORED:
|
|
219
192
|
default:
|
|
220
|
-
return /*#__PURE__*/
|
|
221
|
-
className: (
|
|
193
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
194
|
+
className: cx(styles['c-app-icon'], styles['c-app-icon-default'], className),
|
|
222
195
|
height: "100%",
|
|
223
|
-
icon: fallbackIcon ||
|
|
196
|
+
icon: fallbackIcon || Cube,
|
|
224
197
|
width: "100%",
|
|
225
198
|
color: "var(--coolGrey)",
|
|
226
199
|
iconRef: this.props.iconRef
|
|
@@ -228,36 +201,32 @@ var AppIcon = /*#__PURE__*/function (_Component) {
|
|
|
228
201
|
}
|
|
229
202
|
}
|
|
230
203
|
}]);
|
|
231
|
-
return AppIcon;
|
|
232
|
-
}(_react.Component);
|
|
233
204
|
|
|
234
|
-
|
|
205
|
+
return AppIcon;
|
|
206
|
+
}(Component);
|
|
235
207
|
AppIcon.propTypes = {
|
|
236
|
-
alt:
|
|
208
|
+
alt: PropTypes.string,
|
|
237
209
|
|
|
238
210
|
/** Required if fetchIcon is not provided */
|
|
239
|
-
app:
|
|
211
|
+
app: PropTypes.oneOfType([AppDoctype, PropTypes.string]),
|
|
240
212
|
|
|
241
213
|
/** Icon to fallback on error (optional), default cube icon */
|
|
242
|
-
fallbackIcon:
|
|
214
|
+
fallbackIcon: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]),
|
|
243
215
|
|
|
244
216
|
/** Custom implementation of how to fetch icon */
|
|
245
|
-
fetchIcon:
|
|
246
|
-
client:
|
|
247
|
-
className:
|
|
248
|
-
onReady:
|
|
217
|
+
fetchIcon: PropTypes.func,
|
|
218
|
+
client: PropTypes.object.isRequired,
|
|
219
|
+
className: PropTypes.string,
|
|
220
|
+
onReady: PropTypes.func,
|
|
249
221
|
|
|
250
222
|
/** Type of application */
|
|
251
|
-
type:
|
|
223
|
+
type: PropTypes.oneOf(['app', 'konnector']),
|
|
252
224
|
|
|
253
225
|
/** First source to fetch the icon. If nothing is found, there is a second try with the other source */
|
|
254
|
-
priority:
|
|
226
|
+
priority: PropTypes.oneOf(['stack', 'registry'])
|
|
255
227
|
};
|
|
256
228
|
AppIcon.defaultProps = {
|
|
257
229
|
type: 'app',
|
|
258
230
|
priority: 'stack'
|
|
259
231
|
};
|
|
260
|
-
|
|
261
|
-
var _default = (0, _cozyClient.withClient)(AppIcon);
|
|
262
|
-
|
|
263
|
-
exports.default = _default;
|
|
232
|
+
export default withClient(AppIcon);
|
package/dist/AppLinker/index.js
CHANGED
|
@@ -1,90 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = exports.AppLinker = void 0;
|
|
9
|
-
Object.defineProperty(exports, "generateUniversalLink", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function get() {
|
|
12
|
-
return _native.generateUniversalLink;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "generateWebLink", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function get() {
|
|
18
|
-
return _native.generateWebLink;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
Object.defineProperty(exports, "getUniversalLinkDomain", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _native.getUniversalLinkDomain;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
29
|
-
|
|
30
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
31
|
-
|
|
32
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
33
|
-
|
|
34
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
35
|
-
|
|
36
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
37
|
-
|
|
38
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
39
|
-
|
|
40
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
41
|
-
|
|
42
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
43
|
-
|
|
44
|
-
var _react = _interopRequireDefault(require("react"));
|
|
45
|
-
|
|
46
|
-
var _cozyClient = require("cozy-client");
|
|
47
|
-
|
|
48
|
-
var _cozyDeviceHelper = require("cozy-device-helper");
|
|
49
|
-
|
|
50
|
-
var _cozyIntent = require("cozy-intent");
|
|
51
|
-
|
|
52
|
-
var _cozyLogger = _interopRequireDefault(require("cozy-logger"));
|
|
53
|
-
|
|
54
|
-
var _native = require("./native");
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
55
8
|
|
|
56
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
57
10
|
|
|
58
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
59
12
|
|
|
60
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (
|
|
13
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
61
14
|
|
|
62
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
63
16
|
|
|
64
|
-
|
|
65
|
-
|
|
17
|
+
import PropTypes from 'prop-types';
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { withClient } from 'cozy-client';
|
|
20
|
+
import { isFlagshipApp } from 'cozy-device-helper';
|
|
21
|
+
import { WebviewContext } from 'cozy-intent';
|
|
22
|
+
import logger from 'cozy-logger';
|
|
23
|
+
import { generateUniversalLink, generateWebLink, getUniversalLinkDomain } from './native';
|
|
24
|
+
export var AppLinker = /*#__PURE__*/function (_React$Component) {
|
|
25
|
+
_inherits(AppLinker, _React$Component);
|
|
66
26
|
|
|
67
27
|
var _super = _createSuper(AppLinker);
|
|
68
28
|
|
|
69
29
|
function AppLinker(props) {
|
|
70
30
|
var _this;
|
|
71
31
|
|
|
72
|
-
(
|
|
32
|
+
_classCallCheck(this, AppLinker);
|
|
33
|
+
|
|
73
34
|
_this = _super.call(this, props);
|
|
74
|
-
|
|
35
|
+
|
|
36
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
75
37
|
imgRef: null
|
|
76
38
|
});
|
|
77
|
-
|
|
39
|
+
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "setImgRef", function (img) {
|
|
78
41
|
_this.imgRef = img;
|
|
79
42
|
|
|
80
43
|
_this.setState({
|
|
81
44
|
imgRef: _this.imgRef
|
|
82
45
|
});
|
|
83
46
|
});
|
|
47
|
+
|
|
84
48
|
return _this;
|
|
85
49
|
}
|
|
86
50
|
|
|
87
|
-
(
|
|
51
|
+
_createClass(AppLinker, [{
|
|
88
52
|
key: "render",
|
|
89
53
|
value: function render() {
|
|
90
54
|
var children = this.props.children;
|
|
@@ -113,7 +77,7 @@ var AppLinker = /*#__PURE__*/function (_React$Component) {
|
|
|
113
77
|
var href = props.href;
|
|
114
78
|
var onClick = null;
|
|
115
79
|
|
|
116
|
-
if (
|
|
80
|
+
if (isFlagshipApp()) {
|
|
117
81
|
var _ref = client ? client.getInstanceOptions() : undefined,
|
|
118
82
|
currentApp = _ref.app;
|
|
119
83
|
|
|
@@ -123,7 +87,7 @@ var AppLinker = /*#__PURE__*/function (_React$Component) {
|
|
|
123
87
|
onClick: function onClick(event) {
|
|
124
88
|
event.preventDefault();
|
|
125
89
|
onAppSwitch === null || onAppSwitch === void 0 ? void 0 : onAppSwitch();
|
|
126
|
-
context ? context.call('openApp', href, app, imgPayload) :
|
|
90
|
+
context ? context.call('openApp', href, app, imgPayload) : logger.error("Failed to \"openApp(".concat(app, ")\". WebviewService has the following falsy value \"").concat(context, "\" in AppLinker's context."));
|
|
127
91
|
},
|
|
128
92
|
href: '#'
|
|
129
93
|
};
|
|
@@ -136,24 +100,23 @@ var AppLinker = /*#__PURE__*/function (_React$Component) {
|
|
|
136
100
|
};
|
|
137
101
|
}
|
|
138
102
|
}]);
|
|
103
|
+
|
|
139
104
|
return AppLinker;
|
|
140
|
-
}(
|
|
105
|
+
}(React.Component);
|
|
106
|
+
|
|
107
|
+
_defineProperty(AppLinker, "contextType", WebviewContext);
|
|
141
108
|
|
|
142
|
-
exports.AppLinker = AppLinker;
|
|
143
|
-
(0, _defineProperty2.default)(AppLinker, "contextType", _cozyIntent.WebviewContext);
|
|
144
109
|
AppLinker.propTypes = {
|
|
145
110
|
/*
|
|
146
111
|
Full web url : Used by default on desktop browser
|
|
147
112
|
Used as a fallback_uri on mobile web
|
|
148
113
|
*/
|
|
149
|
-
href:
|
|
150
|
-
onAppSwitch:
|
|
151
|
-
app:
|
|
114
|
+
href: PropTypes.string,
|
|
115
|
+
onAppSwitch: PropTypes.func,
|
|
116
|
+
app: PropTypes.shape({
|
|
152
117
|
// Slug of the app : drive / banks ...
|
|
153
|
-
slug:
|
|
118
|
+
slug: PropTypes.string.isRequired
|
|
154
119
|
}).isRequired
|
|
155
120
|
};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
exports.default = _default;
|
|
121
|
+
export default withClient(AppLinker);
|
|
122
|
+
export { getUniversalLinkDomain, generateWebLink, generateUniversalLink };
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.UNIVERSAL_LINK_URL = void 0;
|
|
7
|
-
var UNIVERSAL_LINK_URL = 'https://links.mycozy.cloud';
|
|
8
|
-
exports.UNIVERSAL_LINK_URL = UNIVERSAL_LINK_URL;
|
|
1
|
+
export var UNIVERSAL_LINK_URL = 'https://links.mycozy.cloud';
|
package/dist/AppLinker/native.js
CHANGED
|
@@ -1,37 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.getUniversalLinkDomain = exports.generateWebLink = exports.generateUniversalLink = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
-
|
|
14
|
-
var _cozyClient = require("cozy-client");
|
|
15
|
-
|
|
16
|
-
var _native = require("./native.config");
|
|
17
|
-
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
18
3
|
var _excluded = ["nativePath"];
|
|
19
4
|
|
|
20
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
6
|
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
8
|
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
/* eslint-disable no-console */
|
|
10
|
+
import { generateWebLink as generateWebLinkClient, ensureFirstSlash } from 'cozy-client';
|
|
11
|
+
import { UNIVERSAL_LINK_URL } from './native.config';
|
|
12
|
+
export var getUniversalLinkDomain = function getUniversalLinkDomain() {
|
|
13
|
+
return UNIVERSAL_LINK_URL;
|
|
26
14
|
};
|
|
27
|
-
|
|
28
|
-
exports.getUniversalLinkDomain = getUniversalLinkDomain;
|
|
29
|
-
|
|
30
|
-
var generateWebLink = function generateWebLink(_ref) {
|
|
15
|
+
export var generateWebLink = function generateWebLink(_ref) {
|
|
31
16
|
var nativePath = _ref.nativePath,
|
|
32
|
-
props = (
|
|
17
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
|
|
33
19
|
console.warn('Deprecated: you should use generateWebLink from cozy-client instead');
|
|
34
|
-
return (
|
|
20
|
+
return generateWebLinkClient(_objectSpread({
|
|
35
21
|
pathname: '/',
|
|
36
22
|
hash: nativePath
|
|
37
23
|
}, props));
|
|
@@ -47,23 +33,20 @@ var generateWebLink = function generateWebLink(_ref) {
|
|
|
47
33
|
* @return {string} - https://links.cozy.cloud/drive/?fallback...
|
|
48
34
|
*/
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
exports.generateWebLink = generateWebLink;
|
|
52
|
-
|
|
53
|
-
var generateUniversalLink = function generateUniversalLink(options) {
|
|
36
|
+
export var generateUniversalLink = function generateUniversalLink(options) {
|
|
54
37
|
var slug = options.slug,
|
|
55
38
|
cozyUrl = options.cozyUrl,
|
|
56
39
|
subDomainType = options.subDomainType;
|
|
57
40
|
var fallbackUrl = options.fallbackUrl,
|
|
58
41
|
nativePath = options.nativePath;
|
|
59
|
-
nativePath =
|
|
42
|
+
nativePath = ensureFirstSlash(nativePath);
|
|
60
43
|
|
|
61
44
|
if (!cozyUrl && !fallbackUrl) {
|
|
62
45
|
throw new Error('Must have either cozyUrl or fallbackUrl to generate universal link.');
|
|
63
46
|
}
|
|
64
47
|
|
|
65
48
|
if (cozyUrl && !fallbackUrl) {
|
|
66
|
-
fallbackUrl = (
|
|
49
|
+
fallbackUrl = generateWebLinkClient({
|
|
67
50
|
cozyUrl: cozyUrl,
|
|
68
51
|
pathname: '/',
|
|
69
52
|
hash: nativePath,
|
|
@@ -76,6 +59,4 @@ var generateUniversalLink = function generateUniversalLink(options) {
|
|
|
76
59
|
var urlObj = new URL(url);
|
|
77
60
|
urlObj.searchParams.append('fallback', fallbackUrl);
|
|
78
61
|
return urlObj.toString();
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
exports.generateUniversalLink = generateUniversalLink;
|
|
62
|
+
};
|