cozy-ui-plus 1.1.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 +10 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/babel.config.js +24 -0
- package/dist/AppIcon/index.js +265 -0
- package/dist/AppLinker/index.js +159 -0
- package/dist/AppLinker/native.config.js +8 -0
- package/dist/AppLinker/native.js +81 -0
- package/dist/AppSections/Sections.js +461 -0
- package/dist/AppSections/_mockApps.js +210 -0
- package/dist/AppSections/_testApps.js +162 -0
- package/dist/AppSections/categories.js +183 -0
- package/dist/AppSections/components/AppsSection.js +112 -0
- package/dist/AppSections/components/DropdownFilter.js +101 -0
- package/dist/AppSections/constants.js +16 -0
- package/dist/AppSections/generateI18nConfig.js +37 -0
- package/dist/AppSections/helpers.js +28 -0
- package/dist/AppSections/index.js +24 -0
- package/dist/AppSections/search.js +161 -0
- package/dist/AppTile/helpers.js +41 -0
- package/dist/AppTile/index.js +171 -0
- package/dist/CipherIcon/index.js +102 -0
- package/dist/CollectionField/index.js +166 -0
- package/dist/ContactPicker/index.js +129 -0
- package/dist/Contacts/AddModal/ContactAddressDialog/helpers.js +31 -0
- package/dist/Contacts/AddModal/ContactAddressDialog/index.js +106 -0
- package/dist/Contacts/AddModal/ContactAddressDialog/locales/index.js +113 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInput.js +164 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputAccordion.js +91 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputArray.js +105 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputLayout.js +98 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputWrapper.js +51 -0
- package/dist/Contacts/AddModal/ContactForm/HasValueCondition.js +44 -0
- package/dist/Contacts/AddModal/ContactForm/RelatedContactList.js +55 -0
- package/dist/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.js +104 -0
- package/dist/Contacts/AddModal/ContactForm/TextFieldSelect.js +59 -0
- package/dist/Contacts/AddModal/ContactForm/contactToFormValues.js +119 -0
- package/dist/Contacts/AddModal/ContactForm/fieldsConfig.js +314 -0
- package/dist/Contacts/AddModal/ContactForm/formValuesToContact.js +110 -0
- package/dist/Contacts/AddModal/ContactForm/helpers.js +466 -0
- package/dist/Contacts/AddModal/ContactForm/index.js +184 -0
- package/dist/Contacts/AddModal/ContactForm/locales/index.js +313 -0
- package/dist/Contacts/AddModal/CustomLabelDialog/index.js +138 -0
- package/dist/Contacts/AddModal/CustomLabelDialog/locales/index.js +73 -0
- package/dist/Contacts/AddModal/index.js +134 -0
- package/dist/Contacts/AddModal/locales/index.js +65 -0
- package/dist/Contacts/AddModal/mocks.js +265 -0
- package/dist/Contacts/AddModal/types.js +110 -0
- package/dist/Contacts/GroupsSelect/GroupCreation.js +157 -0
- package/dist/Contacts/GroupsSelect/GroupsSelect.js +207 -0
- package/dist/Contacts/GroupsSelect/GroupsSelectProvider.js +60 -0
- package/dist/Contacts/GroupsSelect/SelectBox/Control.js +54 -0
- package/dist/Contacts/GroupsSelect/SelectBox/EditGroupName.js +89 -0
- package/dist/Contacts/GroupsSelect/SelectBox/Menu.js +49 -0
- package/dist/Contacts/GroupsSelect/SelectBox/Option.js +80 -0
- package/dist/Contacts/GroupsSelect/SelectBox/SelectContainer.js +25 -0
- package/dist/Contacts/GroupsSelect/helpers.js +45 -0
- package/dist/Contacts/GroupsSelect/locales/index.js +97 -0
- package/dist/Contacts/GroupsSelect/useGroupSelect.js +196 -0
- package/dist/Contacts/Header/GroupsSelection.js +101 -0
- package/dist/Contacts/Header/ImportDropdown.js +115 -0
- package/dist/Contacts/Header/SearchInput.js +40 -0
- package/dist/Contacts/Header/index.js +93 -0
- package/dist/Contacts/Header/locales/index.js +73 -0
- package/dist/ContactsList/ContactCell.js +45 -0
- package/dist/ContactsList/ContactRow.js +84 -0
- package/dist/ContactsList/Contacts/ContactCozy.js +44 -0
- package/dist/ContactsList/Contacts/ContactEmail.js +44 -0
- package/dist/ContactsList/Contacts/ContactIdentity.js +86 -0
- package/dist/ContactsList/Contacts/ContactName.js +48 -0
- package/dist/ContactsList/Contacts/ContactPhone.js +44 -0
- package/dist/ContactsList/ContactsList.js +74 -0
- package/dist/ContactsList/helpers.js +156 -0
- package/dist/ContactsList/index.js +13 -0
- package/dist/ContactsList/locales/withContactsListLocales.js +42 -0
- package/dist/ContactsListModal/AddContact/AddContactActions.js +32 -0
- package/dist/ContactsListModal/AddContact/AddContactContent.js +85 -0
- package/dist/ContactsListModal/AddContact/AddContactDialog.js +63 -0
- package/dist/ContactsListModal/AddContact/AddContactTitle.js +21 -0
- package/dist/ContactsListModal/AddContact/helpers.js +61 -0
- package/dist/ContactsListModal/ContactsListContent.js +88 -0
- package/dist/ContactsListModal/ContactsListModal.js +178 -0
- package/dist/ContactsListModal/ContactsListModalWithQuery.js +44 -0
- package/dist/ContactsListModal/EmptyMessage.js +33 -0
- package/dist/ContactsListModal/MobileHeader.js +67 -0
- package/dist/ContactsListModal/index.js +58 -0
- package/dist/ContactsListModal/mockClient.js +2009 -0
- package/dist/ContactsListModal/queries.js +26 -0
- package/dist/ContactsListModal/withContactsListLocales.js +40 -0
- package/dist/Dialogs/AuthenticationDialogs/index.js +139 -0
- package/dist/Field/index.js +297 -0
- package/dist/FileImageLoader/checkImageSource.js +61 -0
- package/dist/FileImageLoader/index.js +394 -0
- package/dist/FilePicker/FilePickerBody.js +108 -0
- package/dist/FilePicker/FilePickerBodyItem.js +132 -0
- package/dist/FilePicker/FilePickerBreadcrumb.js +74 -0
- package/dist/FilePicker/FilePickerFooter.js +91 -0
- package/dist/FilePicker/FilePickerHeader.js +110 -0
- package/dist/FilePicker/docs/DemoProvider.js +280 -0
- package/dist/FilePicker/helpers.js +57 -0
- package/dist/FilePicker/index.js +125 -0
- package/dist/FilePicker/queries.js +61 -0
- package/dist/Intent/IntentDialogOpener/index.js +142 -0
- package/dist/Intent/IntentIframe/index.js +182 -0
- package/dist/ListItem/ExpandedAttributes/ExpandedAttribute.js +64 -0
- package/dist/ListItem/ExpandedAttributes/helpers.js +263 -0
- package/dist/ListItem/ExpandedAttributes/index.js +90 -0
- package/dist/ListItem/ListItemBase/Renaming/RenameDialog.js +52 -0
- package/dist/ListItem/ListItemBase/Renaming/RenameInput.js +319 -0
- package/dist/ListItem/ListItemBase/Renaming/helpers.js +73 -0
- package/dist/ListItem/ListItemBase/index.js +153 -0
- package/dist/ListItem/ListItemByDoc/index.js +109 -0
- package/dist/ListItem/ListItemContact/helpers.js +39 -0
- package/dist/ListItem/ListItemContact/index.js +87 -0
- package/dist/ListItem/ListItemContact/useActions.js +28 -0
- package/dist/ListItem/ListItemFile/ExpirationAnnotation.js +54 -0
- package/dist/ListItem/ListItemFile/ItemIcon.js +61 -0
- package/dist/ListItem/ListItemFile/PrimaryText.js +47 -0
- package/dist/ListItem/ListItemFile/SecondaryText.js +41 -0
- package/dist/ListItem/ListItemFile/index.js +96 -0
- package/dist/ListItem/hoc/withListItemLocales.js +322 -0
- package/dist/Paywall/MaxAccountsByKonnectorPaywall.js +48 -0
- package/dist/Paywall/MaxAccountsPaywall.js +43 -0
- package/dist/Paywall/MaxDaysToCapturePaywall.js +43 -0
- package/dist/Paywall/MaxPapersPaywall.js +44 -0
- package/dist/Paywall/OnlyOfficePaywall.js +41 -0
- package/dist/Paywall/PasswordSharingPaywall.js +34 -0
- package/dist/Paywall/Paywall.js +205 -0
- package/dist/Paywall/QuotaPaywall.js +32 -0
- package/dist/Paywall/helpers.js +31 -0
- package/dist/Paywall/index.js +63 -0
- package/dist/Paywall/locales/withPaywallLocales.js +401 -0
- package/dist/Qualification/QualificationGrid/helpers.js +16 -0
- package/dist/Qualification/QualificationGrid/index.js +136 -0
- package/dist/Qualification/QualificationGrid/locales/withLocales.js +82 -0
- package/dist/Qualification/QualificationIcon/index.js +156 -0
- package/dist/Qualification/QualificationItem/index.js +87 -0
- package/dist/Qualification/QualificationModal/helpers.js +95 -0
- package/dist/Qualification/QualificationModal/index.js +121 -0
- package/dist/Qualification/QualificationModal/locales/index.js +37 -0
- package/dist/ShortcutTile/index.js +68 -0
- package/dist/SquareAppIcon/index.js +262 -0
- package/dist/Storage/StorageButton.js +54 -0
- package/dist/Storage/StorageProgress.js +68 -0
- package/dist/Storage/index.js +49 -0
- package/dist/Storage/locales/index.js +41 -0
- package/dist/UploadQueue/FileUploadProgress.js +86 -0
- package/dist/UploadQueue/Item.js +132 -0
- package/dist/UploadQueue/Pending.js +23 -0
- package/dist/UploadQueue/RemainingTime.js +59 -0
- package/dist/UploadQueue/helpers.js +13 -0
- package/dist/UploadQueue/index.js +277 -0
- package/dist/UploadQueue/useStatusIcon.js +60 -0
- package/dist/hooks/useClientErrors.js +185 -0
- package/dist/proptypes.js +33 -0
- package/dist/providers/CozyTheme/CozyThemeWithQuery.js +41 -0
- package/dist/providers/CozyTheme/index.js +58 -0
- package/dist/providers/CozyTheme/queries.js +25 -0
- package/dist/providers/DemoProvider.js +49 -0
- package/dist/providers/Intent/index.js +130 -0
- package/dist/src/AppIcon/index.d.ts +50 -0
- package/dist/src/AppIcon/index.spec.d.ts +1 -0
- package/dist/src/AppLinker/index.d.ts +35 -0
- package/dist/src/AppLinker/index.spec.d.ts +1 -0
- package/dist/src/AppLinker/native.config.d.ts +1 -0
- package/dist/src/AppLinker/native.d.ts +6 -0
- package/dist/src/AppLinker/native.spec.d.ts +1 -0
- package/dist/src/AppSections/Sections.d.ts +49 -0
- package/dist/src/AppSections/_mockApps.d.ts +242 -0
- package/dist/src/AppSections/_testApps.d.ts +203 -0
- package/dist/src/AppSections/categories.d.ts +7 -0
- package/dist/src/AppSections/categories.spec.d.ts +1 -0
- package/dist/src/AppSections/components/AppsSection.d.ts +20 -0
- package/dist/src/AppSections/components/AppsSection.spec.d.ts +1 -0
- package/dist/src/AppSections/components/DropdownFilter.d.ts +17 -0
- package/dist/src/AppSections/constants.d.ts +8 -0
- package/dist/src/AppSections/generateI18nConfig.d.ts +4 -0
- package/dist/src/AppSections/helpers.d.ts +2 -0
- package/dist/src/AppSections/helpers.spec.d.ts +1 -0
- package/dist/src/AppSections/index.d.ts +3 -0
- package/dist/src/AppSections/index.spec.d.ts +1 -0
- package/dist/src/AppSections/search.d.ts +3 -0
- package/dist/src/AppSections/search.spec.d.ts +1 -0
- package/dist/src/AppTile/AppTile.spec.d.ts +1 -0
- package/dist/src/AppTile/helpers.d.ts +9 -0
- package/dist/src/AppTile/index.d.ts +33 -0
- package/dist/src/CipherIcon/index.d.ts +2 -0
- package/dist/src/CipherIcon/index.spec.d.ts +1 -0
- package/dist/src/CollectionField/index.d.ts +23 -0
- package/dist/src/ContactPicker/index.d.ts +21 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/helpers.d.ts +4 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/helpers.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/index.d.ts +39 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInput.d.ts +39 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputAccordion.d.ts +12 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputArray.d.ts +14 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputLayout.d.ts +22 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputWrapper.d.ts +19 -0
- package/dist/src/Contacts/AddModal/ContactForm/HasValueCondition.d.ts +18 -0
- package/dist/src/Contacts/AddModal/ContactForm/HasValueCondition.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/RelatedContactList.d.ts +15 -0
- package/dist/src/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.d.ts +9 -0
- package/dist/src/Contacts/AddModal/ContactForm/TextFieldSelect.d.ts +5 -0
- package/dist/src/Contacts/AddModal/ContactForm/contactToFormValues.d.ts +6 -0
- package/dist/src/Contacts/AddModal/ContactForm/contactToFormValues.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/fieldsConfig.d.ts +4 -0
- package/dist/src/Contacts/AddModal/ContactForm/formValuesToContact.d.ts +7 -0
- package/dist/src/Contacts/AddModal/ContactForm/formValuesToContact.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/helpers.d.ts +35 -0
- package/dist/src/Contacts/AddModal/ContactForm/helpers.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/index.d.ts +17 -0
- package/dist/src/Contacts/AddModal/ContactForm/index.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/CustomLabelDialog/index.d.ts +22 -0
- package/dist/src/Contacts/AddModal/CustomLabelDialog/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/index.d.ts +8 -0
- package/dist/src/Contacts/AddModal/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/mocks.d.ts +276 -0
- package/dist/src/Contacts/AddModal/types.d.ts +188 -0
- package/dist/src/Contacts/GroupsSelect/GroupCreation.d.ts +3 -0
- package/dist/src/Contacts/GroupsSelect/GroupsSelect.d.ts +56 -0
- package/dist/src/Contacts/GroupsSelect/GroupsSelect.spec.d.ts +22 -0
- package/dist/src/Contacts/GroupsSelect/GroupsSelectProvider.d.ts +5 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/Control.d.ts +14 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/EditGroupName.d.ts +7 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/Menu.d.ts +7 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/Option.d.ts +18 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/SelectContainer.d.ts +2 -0
- package/dist/src/Contacts/GroupsSelect/helpers.d.ts +9 -0
- package/dist/src/Contacts/GroupsSelect/locales/index.d.ts +10 -0
- package/dist/src/Contacts/GroupsSelect/useGroupSelect.d.ts +11 -0
- package/dist/src/Contacts/Header/GroupsSelection.d.ts +7 -0
- package/dist/src/Contacts/Header/ImportDropdown.d.ts +4 -0
- package/dist/src/Contacts/Header/SearchInput.d.ts +4 -0
- package/dist/src/Contacts/Header/index.d.ts +26 -0
- package/dist/src/Contacts/Header/locales/index.d.ts +10 -0
- package/dist/src/ContactsList/ContactCell.d.ts +8 -0
- package/dist/src/ContactsList/ContactRow.d.ts +16 -0
- package/dist/src/ContactsList/ContactRow.spec.d.ts +1 -0
- package/dist/src/ContactsList/Contacts/ContactCozy.d.ts +14 -0
- package/dist/src/ContactsList/Contacts/ContactEmail.d.ts +14 -0
- package/dist/src/ContactsList/Contacts/ContactIdentity.d.ts +10 -0
- package/dist/src/ContactsList/Contacts/ContactName.d.ts +10 -0
- package/dist/src/ContactsList/Contacts/ContactPhone.d.ts +14 -0
- package/dist/src/ContactsList/ContactsList.d.ts +2 -0
- package/dist/src/ContactsList/helpers.d.ts +9 -0
- package/dist/src/ContactsList/helpers.spec.d.ts +1 -0
- package/dist/src/ContactsList/index.d.ts +2 -0
- package/dist/src/ContactsList/locales/withContactsListLocales.d.ts +12 -0
- package/dist/src/ContactsListModal/AddContact/AddContactActions.d.ts +2 -0
- package/dist/src/ContactsListModal/AddContact/AddContactContent.d.ts +2 -0
- package/dist/src/ContactsListModal/AddContact/AddContactDialog.d.ts +6 -0
- package/dist/src/ContactsListModal/AddContact/AddContactTitle.d.ts +2 -0
- package/dist/src/ContactsListModal/AddContact/helpers.d.ts +6 -0
- package/dist/src/ContactsListModal/AddContact/helpers.spec.d.ts +1 -0
- package/dist/src/ContactsListModal/ContactsListContent.d.ts +2 -0
- package/dist/src/ContactsListModal/ContactsListModal.d.ts +20 -0
- package/dist/src/ContactsListModal/ContactsListModalWithQuery.d.ts +12 -0
- package/dist/src/ContactsListModal/EmptyMessage.d.ts +2 -0
- package/dist/src/ContactsListModal/MobileHeader.d.ts +16 -0
- package/dist/src/ContactsListModal/index.d.ts +2 -0
- package/dist/src/ContactsListModal/mockClient.d.ts +3 -0
- package/dist/src/ContactsListModal/queries.d.ts +7 -0
- package/dist/src/ContactsListModal/withContactsListLocales.d.ts +7 -0
- package/dist/src/Dialogs/AuthenticationDialogs/index.d.ts +2 -0
- package/dist/src/Field/index.d.ts +53 -0
- package/dist/src/Field/index.spec.d.ts +1 -0
- package/dist/src/FileImageLoader/checkImageSource.d.ts +1 -0
- package/dist/src/FileImageLoader/index.d.ts +45 -0
- package/dist/src/FileImageLoader/index.spec.d.ts +1 -0
- package/dist/src/FilePicker/FilePickerBody.d.ts +19 -0
- package/dist/src/FilePicker/FilePickerBodyItem.d.ts +22 -0
- package/dist/src/FilePicker/FilePickerBodyItem.spec.d.ts +1 -0
- package/dist/src/FilePicker/FilePickerBreadcrumb.d.ts +13 -0
- package/dist/src/FilePicker/FilePickerFooter.d.ts +15 -0
- package/dist/src/FilePicker/FilePickerFooter.spec.d.ts +1 -0
- package/dist/src/FilePicker/FilePickerHeader.d.ts +14 -0
- package/dist/src/FilePicker/docs/DemoProvider.d.ts +23 -0
- package/dist/src/FilePicker/helpers.d.ts +3 -0
- package/dist/src/FilePicker/helpers.spec.d.ts +1 -0
- package/dist/src/FilePicker/index.d.ts +22 -0
- package/dist/src/FilePicker/queries.d.ts +14 -0
- package/dist/src/Intent/IntentDialogOpener/index.d.ts +32 -0
- package/dist/src/Intent/IntentIframe/index.d.ts +8 -0
- package/dist/src/ListItem/ExpandedAttributes/ExpandedAttribute.d.ts +14 -0
- package/dist/src/ListItem/ExpandedAttributes/helpers.d.ts +43 -0
- package/dist/src/ListItem/ExpandedAttributes/helpers.spec.d.ts +1 -0
- package/dist/src/ListItem/ExpandedAttributes/index.d.ts +2 -0
- package/dist/src/ListItem/ListItemBase/Renaming/RenameDialog.d.ts +2 -0
- package/dist/src/ListItem/ListItemBase/Renaming/RenameInput.d.ts +12 -0
- package/dist/src/ListItem/ListItemBase/Renaming/helpers.d.ts +1 -0
- package/dist/src/ListItem/ListItemBase/index.d.ts +2 -0
- package/dist/src/ListItem/ListItemByDoc/index.d.ts +46 -0
- package/dist/src/ListItem/ListItemContact/helpers.d.ts +1 -0
- package/dist/src/ListItem/ListItemContact/helpers.spec.d.ts +1 -0
- package/dist/src/ListItem/ListItemContact/index.d.ts +35 -0
- package/dist/src/ListItem/ListItemContact/useActions.d.ts +2 -0
- package/dist/src/ListItem/ListItemFile/ExpirationAnnotation.d.ts +2 -0
- package/dist/src/ListItem/ListItemFile/ItemIcon.d.ts +12 -0
- package/dist/src/ListItem/ListItemFile/PrimaryText.d.ts +12 -0
- package/dist/src/ListItem/ListItemFile/SecondaryText.d.ts +12 -0
- package/dist/src/ListItem/ListItemFile/index.d.ts +37 -0
- package/dist/src/ListItem/hoc/withListItemLocales.d.ts +12 -0
- package/dist/src/Paywall/MaxAccountsByKonnectorPaywall.d.ts +2 -0
- package/dist/src/Paywall/MaxAccountsPaywall.d.ts +2 -0
- package/dist/src/Paywall/MaxDaysToCapturePaywall.d.ts +2 -0
- package/dist/src/Paywall/MaxPapersPaywall.d.ts +2 -0
- package/dist/src/Paywall/OnlyOfficePaywall.d.ts +16 -0
- package/dist/src/Paywall/PasswordSharingPaywall.d.ts +10 -0
- package/dist/src/Paywall/Paywall.d.ts +2 -0
- package/dist/src/Paywall/Paywall.spec.d.ts +1 -0
- package/dist/src/Paywall/QuotaPaywall.d.ts +13 -0
- package/dist/src/Paywall/helpers.d.ts +1 -0
- package/dist/src/Paywall/index.d.ts +7 -0
- package/dist/src/Paywall/locales/withPaywallLocales.d.ts +2 -0
- package/dist/src/Qualification/QualificationGrid/helpers.d.ts +1 -0
- package/dist/src/Qualification/QualificationGrid/index.d.ts +2 -0
- package/dist/src/Qualification/QualificationGrid/locales/withLocales.d.ts +12 -0
- package/dist/src/Qualification/QualificationIcon/index.d.ts +13 -0
- package/dist/src/Qualification/QualificationItem/index.d.ts +17 -0
- package/dist/src/Qualification/QualificationModal/helpers.d.ts +14 -0
- package/dist/src/Qualification/QualificationModal/helpers.spec.d.ts +1 -0
- package/dist/src/Qualification/QualificationModal/index.d.ts +16 -0
- package/dist/src/Qualification/QualificationModal/locales/index.d.ts +10 -0
- package/dist/src/ShortcutTile/index.d.ts +13 -0
- package/dist/src/SquareAppIcon/SquareAppIcon.spec.d.ts +1 -0
- package/dist/src/SquareAppIcon/index.d.ts +26 -0
- package/dist/src/Storage/StorageButton.d.ts +4 -0
- package/dist/src/Storage/StorageProgress.d.ts +5 -0
- package/dist/src/Storage/index.d.ts +14 -0
- package/dist/src/Storage/locales/index.d.ts +10 -0
- package/dist/src/UploadQueue/FileUploadProgress.d.ts +4 -0
- package/dist/src/UploadQueue/Item.d.ts +3 -0
- package/dist/src/UploadQueue/Pending.d.ts +3 -0
- package/dist/src/UploadQueue/RemainingTime.d.ts +4 -0
- package/dist/src/UploadQueue/helpers.d.ts +1 -0
- package/dist/src/UploadQueue/index.d.ts +42 -0
- package/dist/src/UploadQueue/index.spec.d.ts +1 -0
- package/dist/src/UploadQueue/useStatusIcon.d.ts +1 -0
- package/dist/src/hooks/useClientErrors.d.ts +29 -0
- package/dist/src/hooks/useClientErrors.spec.d.ts +1 -0
- package/dist/src/proptypes.d.ts +18 -0
- package/dist/src/providers/CozyTheme/CozyThemeWithQuery.d.ts +2 -0
- package/dist/src/providers/CozyTheme/index.d.ts +24 -0
- package/dist/src/providers/CozyTheme/queries.d.ts +8 -0
- package/dist/src/providers/DemoProvider.d.ts +6 -0
- package/dist/src/providers/Intent/index.d.ts +9 -0
- package/dist/stylesheet.css +898 -0
- package/dist/test/I18n.d.ts +6 -0
- package/dist/types.d.js +1 -0
- package/jest.config.js +20 -0
- package/package.json +76 -0
- package/preprocess.js +16 -0
- package/src/AppIcon/Readme.md +96 -0
- package/src/AppIcon/index.jsx +168 -0
- package/src/AppIcon/index.spec.js +145 -0
- package/src/AppIcon/styles.styl +37 -0
- package/src/AppLinker/Readme.md +32 -0
- package/src/AppLinker/__snapshots__/index.spec.jsx.snap +13 -0
- package/src/AppLinker/index.jsx +107 -0
- package/src/AppLinker/index.spec.jsx +60 -0
- package/src/AppLinker/native.config.js +1 -0
- package/src/AppLinker/native.js +57 -0
- package/src/AppLinker/native.spec.js +120 -0
- package/src/AppSections/Readme.md +35 -0
- package/src/AppSections/Sections.jsx +285 -0
- package/src/AppSections/Sections.styl +4 -0
- package/src/AppSections/__snapshots__/search.spec.js.snap +972 -0
- package/src/AppSections/_mockApps.js +197 -0
- package/src/AppSections/_testApps.js +151 -0
- package/src/AppSections/categories.js +138 -0
- package/src/AppSections/categories.spec.js +289 -0
- package/src/AppSections/components/AppsSection.jsx +82 -0
- package/src/AppSections/components/AppsSection.spec.jsx +50 -0
- package/src/AppSections/components/AppsSection.styl +7 -0
- package/src/AppSections/components/DropdownFilter.jsx +50 -0
- package/src/AppSections/components/DropdownFilter.styl +14 -0
- package/src/AppSections/constants.js +9 -0
- package/src/AppSections/generateI18nConfig.ts +23 -0
- package/src/AppSections/helpers.js +16 -0
- package/src/AppSections/helpers.spec.js +40 -0
- package/src/AppSections/index.jsx +3 -0
- package/src/AppSections/index.spec.jsx +137 -0
- package/src/AppSections/locales/en.json +37 -0
- package/src/AppSections/locales/fr.json +37 -0
- package/src/AppSections/locales/ru.json +37 -0
- package/src/AppSections/locales/vi.json +37 -0
- package/src/AppSections/search.js +104 -0
- package/src/AppSections/search.spec.js +158 -0
- package/src/AppTile/AppTile.spec.jsx +117 -0
- package/src/AppTile/Readme.md +24 -0
- package/src/AppTile/helpers.js +25 -0
- package/src/AppTile/index.jsx +139 -0
- package/src/AppTile/locales/en.json +9 -0
- package/src/AppTile/locales/fr.json +9 -0
- package/src/AppTile/locales/ru.json +9 -0
- package/src/AppTile/locales/vi.json +9 -0
- package/src/AppTile/styles.styl +27 -0
- package/src/CipherIcon/Readme.md +14 -0
- package/src/CipherIcon/index.jsx +46 -0
- package/src/CipherIcon/index.spec.jsx +53 -0
- package/src/CollectionField/Readme.md +41 -0
- package/src/CollectionField/index.jsx +141 -0
- package/src/CollectionField/styles.styl +15 -0
- package/src/ContactPicker/Readme.md +26 -0
- package/src/ContactPicker/index.jsx +86 -0
- package/src/ContactPicker/styles.styl +5 -0
- package/src/Contacts/AddModal/ContactAddressDialog/helpers.js +22 -0
- package/src/Contacts/AddModal/ContactAddressDialog/helpers.spec.js +64 -0
- package/src/Contacts/AddModal/ContactAddressDialog/index.jsx +85 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/en.json +25 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/fr.json +25 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/ru.json +25 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/vi.json +25 -0
- package/src/Contacts/AddModal/ContactForm/FieldInput.jsx +124 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputAccordion.jsx +58 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputArray.jsx +81 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputLayout.jsx +77 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputWrapper.jsx +44 -0
- package/src/Contacts/AddModal/ContactForm/HasValueCondition.jsx +31 -0
- package/src/Contacts/AddModal/ContactForm/HasValueCondition.spec.jsx +79 -0
- package/src/Contacts/AddModal/ContactForm/RelatedContactList.jsx +37 -0
- package/src/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.jsx +79 -0
- package/src/Contacts/AddModal/ContactForm/TextFieldSelect.jsx +40 -0
- package/src/Contacts/AddModal/ContactForm/__snapshots__/HasValueCondition.spec.jsx.snap +33 -0
- package/src/Contacts/AddModal/ContactForm/contactToFormValues.js +109 -0
- package/src/Contacts/AddModal/ContactForm/contactToFormValues.spec.js +133 -0
- package/src/Contacts/AddModal/ContactForm/fieldsConfig.jsx +357 -0
- package/src/Contacts/AddModal/ContactForm/formValuesToContact.js +111 -0
- package/src/Contacts/AddModal/ContactForm/formValuesToContact.spec.js +557 -0
- package/src/Contacts/AddModal/ContactForm/helpers.js +393 -0
- package/src/Contacts/AddModal/ContactForm/helpers.spec.js +391 -0
- package/src/Contacts/AddModal/ContactForm/index.jsx +138 -0
- package/src/Contacts/AddModal/ContactForm/index.spec.jsx +301 -0
- package/src/Contacts/AddModal/ContactForm/locales/en.json +75 -0
- package/src/Contacts/AddModal/ContactForm/locales/fr.json +75 -0
- package/src/Contacts/AddModal/ContactForm/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/ContactForm/locales/ru.json +75 -0
- package/src/Contacts/AddModal/ContactForm/locales/vi.json +75 -0
- package/src/Contacts/AddModal/ContactForm/styles.styl +2 -0
- package/src/Contacts/AddModal/CustomLabelDialog/index.jsx +109 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/en.json +15 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/fr.json +15 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/ru.json +15 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/vi.json +15 -0
- package/src/Contacts/AddModal/Readme.md +55 -0
- package/src/Contacts/AddModal/index.jsx +86 -0
- package/src/Contacts/AddModal/locales/en.json +13 -0
- package/src/Contacts/AddModal/locales/fr.json +13 -0
- package/src/Contacts/AddModal/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/locales/ru.json +13 -0
- package/src/Contacts/AddModal/locales/vi.json +13 -0
- package/src/Contacts/AddModal/mocks.js +299 -0
- package/src/Contacts/AddModal/types.js +102 -0
- package/src/Contacts/GroupsSelect/GroupCreation.jsx +96 -0
- package/src/Contacts/GroupsSelect/GroupsSelect.jsx +159 -0
- package/src/Contacts/GroupsSelect/GroupsSelect.spec.jsx +249 -0
- package/src/Contacts/GroupsSelect/GroupsSelectProvider.jsx +40 -0
- package/src/Contacts/GroupsSelect/Readme.md +1 -0
- package/src/Contacts/GroupsSelect/SelectBox/Control.jsx +37 -0
- package/src/Contacts/GroupsSelect/SelectBox/EditGroupName.jsx +52 -0
- package/src/Contacts/GroupsSelect/SelectBox/Menu.jsx +27 -0
- package/src/Contacts/GroupsSelect/SelectBox/Option.jsx +71 -0
- package/src/Contacts/GroupsSelect/SelectBox/SelectContainer.jsx +15 -0
- package/src/Contacts/GroupsSelect/SelectBox/styles.styl +2 -0
- package/src/Contacts/GroupsSelect/helpers.js +25 -0
- package/src/Contacts/GroupsSelect/locales/en.json +21 -0
- package/src/Contacts/GroupsSelect/locales/fr.json +21 -0
- package/src/Contacts/GroupsSelect/locales/index.jsx +11 -0
- package/src/Contacts/GroupsSelect/locales/ru.json +21 -0
- package/src/Contacts/GroupsSelect/locales/vi.json +21 -0
- package/src/Contacts/GroupsSelect/styles.styl +48 -0
- package/src/Contacts/GroupsSelect/useGroupSelect.jsx +89 -0
- package/src/Contacts/Header/GroupsSelection.jsx +75 -0
- package/src/Contacts/Header/ImportDropdown.jsx +80 -0
- package/src/Contacts/Header/Readme.md +38 -0
- package/src/Contacts/Header/SearchInput.jsx +19 -0
- package/src/Contacts/Header/index.jsx +80 -0
- package/src/Contacts/Header/locales/en.json +15 -0
- package/src/Contacts/Header/locales/fr.json +15 -0
- package/src/Contacts/Header/locales/index.jsx +11 -0
- package/src/Contacts/Header/locales/ru.json +15 -0
- package/src/Contacts/Header/locales/vi.json +15 -0
- package/src/Contacts/Readme.md +1 -0
- package/src/ContactsList/ContactCell.jsx +23 -0
- package/src/ContactsList/ContactRow.jsx +46 -0
- package/src/ContactsList/ContactRow.spec.js +75 -0
- package/src/ContactsList/Contacts/ContactCozy.jsx +23 -0
- package/src/ContactsList/Contacts/ContactEmail.jsx +23 -0
- package/src/ContactsList/Contacts/ContactIdentity.jsx +57 -0
- package/src/ContactsList/Contacts/ContactName.jsx +43 -0
- package/src/ContactsList/Contacts/ContactPhone.jsx +24 -0
- package/src/ContactsList/ContactsList.jsx +52 -0
- package/src/ContactsList/Readme.md +47 -0
- package/src/ContactsList/_mockContacts.json +2494 -0
- package/src/ContactsList/helpers.js +132 -0
- package/src/ContactsList/helpers.spec.js +150 -0
- package/src/ContactsList/index.js +3 -0
- package/src/ContactsList/locales/en.json +5 -0
- package/src/ContactsList/locales/fr.json +5 -0
- package/src/ContactsList/locales/ru.json +5 -0
- package/src/ContactsList/locales/vi.json +5 -0
- package/src/ContactsList/locales/withContactsListLocales.jsx +15 -0
- package/src/ContactsList/styles.styl +35 -0
- package/src/ContactsListModal/AddContact/AddContactActions.jsx +16 -0
- package/src/ContactsListModal/AddContact/AddContactContent.jsx +60 -0
- package/src/ContactsListModal/AddContact/AddContactDialog.jsx +38 -0
- package/src/ContactsListModal/AddContact/AddContactTitle.jsx +9 -0
- package/src/ContactsListModal/AddContact/helpers.js +18 -0
- package/src/ContactsListModal/AddContact/helpers.spec.js +74 -0
- package/src/ContactsListModal/AddContact/styles.styl +2 -0
- package/src/ContactsListModal/ContactsListContent.jsx +74 -0
- package/src/ContactsListModal/ContactsListModal.jsx +143 -0
- package/src/ContactsListModal/ContactsListModalWithQuery.jsx +27 -0
- package/src/ContactsListModal/EmptyMessage.jsx +18 -0
- package/src/ContactsListModal/MobileHeader.jsx +50 -0
- package/src/ContactsListModal/Readme.md +45 -0
- package/src/ContactsListModal/index.jsx +28 -0
- package/src/ContactsListModal/locales/en.json +11 -0
- package/src/ContactsListModal/locales/fr.json +11 -0
- package/src/ContactsListModal/locales/ru.json +11 -0
- package/src/ContactsListModal/locales/vi.json +11 -0
- package/src/ContactsListModal/mockClient.jsx +47 -0
- package/src/ContactsListModal/queries.js +12 -0
- package/src/ContactsListModal/styles.styl +12 -0
- package/src/ContactsListModal/withContactsListLocales.jsx +11 -0
- package/src/Dialogs/AuthenticationDialogs/index.jsx +115 -0
- package/src/Field/Readme.md +357 -0
- package/src/Field/index.jsx +317 -0
- package/src/Field/index.spec.js +59 -0
- package/src/Field/styles.styl +41 -0
- package/src/FileImageLoader/Readme.md +112 -0
- package/src/FileImageLoader/checkImageSource.js +29 -0
- package/src/FileImageLoader/index.jsx +186 -0
- package/src/FileImageLoader/index.spec.jsx +176 -0
- package/src/FilePicker/FilePickerBody.jsx +111 -0
- package/src/FilePicker/FilePickerBodyItem.jsx +126 -0
- package/src/FilePicker/FilePickerBodyItem.spec.jsx +164 -0
- package/src/FilePicker/FilePickerBreadcrumb.jsx +55 -0
- package/src/FilePicker/FilePickerFooter.jsx +42 -0
- package/src/FilePicker/FilePickerFooter.spec.jsx +41 -0
- package/src/FilePicker/FilePickerHeader.jsx +89 -0
- package/src/FilePicker/Readme.md +50 -0
- package/src/FilePicker/docs/DemoProvider.jsx +273 -0
- package/src/FilePicker/helpers.js +46 -0
- package/src/FilePicker/helpers.spec.js +84 -0
- package/src/FilePicker/index.jsx +94 -0
- package/src/FilePicker/locales/en.json +8 -0
- package/src/FilePicker/locales/fr.json +8 -0
- package/src/FilePicker/locales/ru.json +8 -0
- package/src/FilePicker/locales/vi.json +8 -0
- package/src/FilePicker/queries.js +37 -0
- package/src/FilePicker/styles.styl +18 -0
- package/src/Intent/IntentDialogOpener/Readme.md +25 -0
- package/src/Intent/IntentDialogOpener/index.jsx +110 -0
- package/src/Intent/IntentIframe/Readme.md +80 -0
- package/src/Intent/IntentIframe/index.jsx +112 -0
- package/src/Intent/IntentIframe/styles.styl +21 -0
- package/src/ListItem/ExpandedAttributes/ExpandedAttribute.jsx +40 -0
- package/src/ListItem/ExpandedAttributes/helpers.js +214 -0
- package/src/ListItem/ExpandedAttributes/helpers.spec.js +175 -0
- package/src/ListItem/ExpandedAttributes/index.jsx +62 -0
- package/src/ListItem/ListItemBase/Renaming/RenameDialog.jsx +38 -0
- package/src/ListItem/ListItemBase/Renaming/RenameInput.jsx +134 -0
- package/src/ListItem/ListItemBase/Renaming/helpers.js +35 -0
- package/src/ListItem/ListItemBase/index.jsx +116 -0
- package/src/ListItem/ListItemByDoc/index.jsx +103 -0
- package/src/ListItem/ListItemContact/helpers.js +28 -0
- package/src/ListItem/ListItemContact/helpers.spec.js +41 -0
- package/src/ListItem/ListItemContact/index.jsx +68 -0
- package/src/ListItem/ListItemContact/useActions.jsx +22 -0
- package/src/ListItem/ListItemFile/ExpirationAnnotation.jsx +39 -0
- package/src/ListItem/ListItemFile/ItemIcon.jsx +49 -0
- package/src/ListItem/ListItemFile/PrimaryText.jsx +38 -0
- package/src/ListItem/ListItemFile/SecondaryText.jsx +36 -0
- package/src/ListItem/ListItemFile/index.jsx +75 -0
- package/src/ListItem/Readme.md +211 -0
- package/src/ListItem/hoc/withListItemLocales.jsx +15 -0
- package/src/ListItem/locales/en.json +75 -0
- package/src/ListItem/locales/fr.json +75 -0
- package/src/ListItem/locales/ru.json +75 -0
- package/src/ListItem/locales/vi.json +75 -0
- package/src/Paywall/MaxAccountsByKonnectorPaywall.jsx +32 -0
- package/src/Paywall/MaxAccountsPaywall.jsx +27 -0
- package/src/Paywall/MaxDaysToCapturePaywall.jsx +27 -0
- package/src/Paywall/MaxPapersPaywall.jsx +29 -0
- package/src/Paywall/OnlyOfficePaywall.jsx +24 -0
- package/src/Paywall/PasswordSharingPaywall.jsx +20 -0
- package/src/Paywall/Paywall.jsx +130 -0
- package/src/Paywall/Paywall.spec.jsx +228 -0
- package/src/Paywall/QuotaPaywall.jsx +18 -0
- package/src/Paywall/Readme.md +139 -0
- package/src/Paywall/helpers.js +22 -0
- package/src/Paywall/howto.md +28 -0
- package/src/Paywall/index.jsx +7 -0
- package/src/Paywall/locales/en.json +95 -0
- package/src/Paywall/locales/fr.json +95 -0
- package/src/Paywall/locales/ru.json +95 -0
- package/src/Paywall/locales/vi.json +95 -0
- package/src/Paywall/locales/withPaywallLocales.jsx +15 -0
- package/src/Qualification/QualificationGrid/Readme.md +26 -0
- package/src/Qualification/QualificationGrid/helpers.js +4 -0
- package/src/Qualification/QualificationGrid/index.jsx +91 -0
- package/src/Qualification/QualificationGrid/locales/en.json +15 -0
- package/src/Qualification/QualificationGrid/locales/fr.json +15 -0
- package/src/Qualification/QualificationGrid/locales/ru.json +15 -0
- package/src/Qualification/QualificationGrid/locales/vi.json +15 -0
- package/src/Qualification/QualificationGrid/locales/withLocales.jsx +15 -0
- package/src/Qualification/QualificationIcon/Readme.md +14 -0
- package/src/Qualification/QualificationIcon/index.jsx +104 -0
- package/src/Qualification/QualificationItem/Readme.md +8 -0
- package/src/Qualification/QualificationItem/index.jsx +64 -0
- package/src/Qualification/QualificationModal/Readme.md +28 -0
- package/src/Qualification/QualificationModal/helpers.js +63 -0
- package/src/Qualification/QualificationModal/helpers.spec.js +61 -0
- package/src/Qualification/QualificationModal/index.jsx +71 -0
- package/src/Qualification/QualificationModal/locales/en.json +6 -0
- package/src/Qualification/QualificationModal/locales/fr.json +6 -0
- package/src/Qualification/QualificationModal/locales/index.jsx +11 -0
- package/src/Qualification/QualificationModal/locales/ru.json +6 -0
- package/src/Qualification/QualificationModal/locales/vi.json +6 -0
- package/src/ShortcutTile/index.tsx +60 -0
- package/src/SquareAppIcon/Readme.md +185 -0
- package/src/SquareAppIcon/SquareAppIcon.spec.js +86 -0
- package/src/SquareAppIcon/__snapshots__/SquareAppIcon.spec.js.snap +474 -0
- package/src/SquareAppIcon/constants.json +6 -0
- package/src/SquareAppIcon/index.jsx +289 -0
- package/src/SquareAppIcon/styles.styl +141 -0
- package/src/Storage/Readme.md +45 -0
- package/src/Storage/StorageButton.jsx +34 -0
- package/src/Storage/StorageProgress.jsx +52 -0
- package/src/Storage/index.jsx +41 -0
- package/src/Storage/locales/en.json +7 -0
- package/src/Storage/locales/fr.json +7 -0
- package/src/Storage/locales/index.jsx +11 -0
- package/src/Storage/locales/ru.json +7 -0
- package/src/Storage/locales/vi.json +7 -0
- package/src/UploadQueue/FileUploadProgress.jsx +50 -0
- package/src/UploadQueue/Item.jsx +99 -0
- package/src/UploadQueue/Pending.jsx +12 -0
- package/src/UploadQueue/Readme.md +95 -0
- package/src/UploadQueue/RemainingTime.jsx +27 -0
- package/src/UploadQueue/helpers.js +3 -0
- package/src/UploadQueue/index.jsx +161 -0
- package/src/UploadQueue/index.spec.jsx +163 -0
- package/src/UploadQueue/locales/en.json +10 -0
- package/src/UploadQueue/locales/es.json +10 -0
- package/src/UploadQueue/locales/fr.json +10 -0
- package/src/UploadQueue/locales/ru.json +10 -0
- package/src/UploadQueue/locales/vi.json +10 -0
- package/src/UploadQueue/styles.styl +155 -0
- package/src/UploadQueue/useStatusIcon.js +32 -0
- package/src/hooks/useClientErrors.jsx +140 -0
- package/src/hooks/useClientErrors.spec.jsx +94 -0
- package/src/proptypes.js +20 -0
- package/src/providers/CozyTheme/CozyThemeWithQuery.jsx +25 -0
- package/src/providers/CozyTheme/Readme.md +88 -0
- package/src/providers/CozyTheme/index.jsx +35 -0
- package/src/providers/CozyTheme/queries.js +14 -0
- package/src/providers/DemoProvider.jsx +30 -0
- package/src/providers/Intent/index.jsx +83 -0
- package/src/types.d.ts +4 -0
- package/test/I18n.js +13 -0
- package/test/fileMock.js +3 -0
- package/test/jestsetup.js +1 -0
- package/tsconfig-build.json +16 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = useClientErrors;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _filter = _interopRequireDefault(require("lodash/filter"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _cozyClient = require("cozy-client");
|
|
17
|
+
|
|
18
|
+
var _cozyStackClient = require("cozy-stack-client");
|
|
19
|
+
|
|
20
|
+
var _Paywall = _interopRequireDefault(require("../Paywall"));
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Rendering functions for client fetch errors by status code
|
|
28
|
+
*
|
|
29
|
+
* @private
|
|
30
|
+
* @type {object}
|
|
31
|
+
*/
|
|
32
|
+
var byHttpStatus = {
|
|
33
|
+
413: QuotaError // <QuotaError />
|
|
34
|
+
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Display for a quota error from the client
|
|
38
|
+
*
|
|
39
|
+
* @see QuotaPaywall
|
|
40
|
+
* @private
|
|
41
|
+
* @param {object} props - Props
|
|
42
|
+
* @param {Function} props.dismiss - remove the error from the stack to display
|
|
43
|
+
* @returns {React.ReactElement}
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
function QuotaError(_ref) {
|
|
47
|
+
var dismiss = _ref.dismiss;
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_Paywall.default, {
|
|
49
|
+
onClose: dismiss
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Returns the handler for an error
|
|
54
|
+
*
|
|
55
|
+
* @param {import("../types").ClientError} error - The error
|
|
56
|
+
* @returns {Function|null} React Component
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
function getErrorComponent(error) {
|
|
61
|
+
if (error instanceof Response || error instanceof _cozyStackClient.FetchError) {
|
|
62
|
+
var status = error.status || '';
|
|
63
|
+
return byHttpStatus[status] || null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Renders a stack of errors
|
|
70
|
+
*
|
|
71
|
+
* @private
|
|
72
|
+
* @see ClientErrors
|
|
73
|
+
* @param {import("../types").ClientError[]} errorStack - array of errors/exceptions
|
|
74
|
+
* @param {Function} setErrorStack - mutates the array of errors
|
|
75
|
+
* @returns {Array<React.ReactElement>} React rendering
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
function renderErrors(errorStack, setErrorStack) {
|
|
80
|
+
var errors = errorStack.map(function (error, key) {
|
|
81
|
+
var Component = getErrorComponent(error);
|
|
82
|
+
|
|
83
|
+
if (Component) {
|
|
84
|
+
var dismiss = function dismiss() {
|
|
85
|
+
return setErrorStack(function (stack) {
|
|
86
|
+
return (0, _filter.default)(stack, function (e) {
|
|
87
|
+
return e !== error;
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return /*#__PURE__*/_react.default.createElement(Component, {
|
|
93
|
+
key: key,
|
|
94
|
+
error: error,
|
|
95
|
+
dismiss: dismiss
|
|
96
|
+
});
|
|
97
|
+
} else {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return errors;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Manages the client errors and allows to display them
|
|
105
|
+
*
|
|
106
|
+
* Returns a `ClientErrors` React component that takes care
|
|
107
|
+
* of how to display cozy-client errors (probably displaying a modal)
|
|
108
|
+
*
|
|
109
|
+
* Only Quota Errors are managed for now.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```
|
|
113
|
+
* const App = () => {
|
|
114
|
+
* const { ClientErrors } = useClientErrors()
|
|
115
|
+
*
|
|
116
|
+
* return <Layout>
|
|
117
|
+
* <h1>My app</h1>
|
|
118
|
+
* <ClientErrors />
|
|
119
|
+
* </Layout>
|
|
120
|
+
* }
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @param {object} [props] - Props
|
|
124
|
+
* @param {boolean} [props.handleExceptions] - should cozy-client directly handle errors before forwarding them to the caller?
|
|
125
|
+
* @returns {{ClientErrors: Function}} React component
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
function useClientErrors() {
|
|
130
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
131
|
+
_ref2$handleException = _ref2.handleExceptions,
|
|
132
|
+
handleExceptions = _ref2$handleException === void 0 ? true : _ref2$handleException;
|
|
133
|
+
|
|
134
|
+
var client = (0, _cozyClient.useClient)();
|
|
135
|
+
|
|
136
|
+
var _useState = (0, _react.useState)([]),
|
|
137
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
138
|
+
errorStack = _useState2[0],
|
|
139
|
+
setErrorStack = _useState2[1];
|
|
140
|
+
/**
|
|
141
|
+
* Handle client errors, add them to the error stack
|
|
142
|
+
*
|
|
143
|
+
* @param {import("../types").ClientError} error -
|
|
144
|
+
* @returns {boolean} true if the error was manager, false otherwise
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
var handleError = (0, _react.useCallback)(function (error) {
|
|
149
|
+
// `isErrorManaged` is there to avoid the same error to be added twice
|
|
150
|
+
// once the error has been added once, the `isErrorManaged`is set to true
|
|
151
|
+
// and any future push is ignored
|
|
152
|
+
if (error.isErrorManaged) return false;
|
|
153
|
+
var isManageable = !!getErrorComponent(error);
|
|
154
|
+
|
|
155
|
+
if (isManageable) {
|
|
156
|
+
error.isErrorManaged = true;
|
|
157
|
+
setErrorStack(function (stack) {
|
|
158
|
+
return stack.concat(error);
|
|
159
|
+
});
|
|
160
|
+
return true;
|
|
161
|
+
} else {
|
|
162
|
+
error.isErrorManaged = false;
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
}, [setErrorStack]);
|
|
166
|
+
(0, _react.useEffect)(function () {
|
|
167
|
+
if (handleExceptions) {
|
|
168
|
+
client.on('error', handleError);
|
|
169
|
+
return function () {
|
|
170
|
+
return client.removeListener('error', handleError);
|
|
171
|
+
};
|
|
172
|
+
} else {
|
|
173
|
+
return undefined;
|
|
174
|
+
}
|
|
175
|
+
}, [client, handleError, handleExceptions]); // @ts-ignore
|
|
176
|
+
|
|
177
|
+
var ClientErrors = (0, _react.useCallback)(function () {
|
|
178
|
+
return renderErrors(errorStack, setErrorStack);
|
|
179
|
+
}, [errorStack, setErrorStack]); // @ts-ignore
|
|
180
|
+
|
|
181
|
+
ClientErrors.displayName = 'ClientErrors';
|
|
182
|
+
return {
|
|
183
|
+
ClientErrors: ClientErrors
|
|
184
|
+
};
|
|
185
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.FileDoctype = exports.AppDoctype = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var AppDoctype = _propTypes.default.shape({
|
|
13
|
+
name: _propTypes.default.string,
|
|
14
|
+
slug: _propTypes.default.string,
|
|
15
|
+
developer: _propTypes.default.object,
|
|
16
|
+
links: _propTypes.default.shape({
|
|
17
|
+
icon: _propTypes.default.string
|
|
18
|
+
}),
|
|
19
|
+
latest_version: _propTypes.default.shape({
|
|
20
|
+
version: _propTypes.default.string
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
exports.AppDoctype = AppDoctype;
|
|
25
|
+
|
|
26
|
+
var FileDoctype = _propTypes.default.shape({
|
|
27
|
+
_id: _propTypes.default.string,
|
|
28
|
+
class: _propTypes.default.string,
|
|
29
|
+
mime: _propTypes.default.string,
|
|
30
|
+
name: _propTypes.default.string
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
exports.FileDoctype = FileDoctype;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _cozyClient = require("cozy-client");
|
|
17
|
+
|
|
18
|
+
var _CozyTheme = _interopRequireDefault(require("cozy-ui/transpiled/react/providers/CozyTheme"));
|
|
19
|
+
|
|
20
|
+
var _queries = require("./queries");
|
|
21
|
+
|
|
22
|
+
var _excluded = ["data"];
|
|
23
|
+
|
|
24
|
+
var CozyThemeWithQuery = function CozyThemeWithQuery(props) {
|
|
25
|
+
var instanceQuery = (0, _queries.buildSettingsInstanceQuery)();
|
|
26
|
+
|
|
27
|
+
var _useQuery = (0, _cozyClient.useQuery)(instanceQuery.definition, instanceQuery.options),
|
|
28
|
+
instance = _useQuery.data,
|
|
29
|
+
instanceQueryLeft = (0, _objectWithoutProperties2.default)(_useQuery, _excluded);
|
|
30
|
+
|
|
31
|
+
if ((0, _cozyClient.isQueryLoading)(instanceQueryLeft) && !(0, _cozyClient.hasQueryBeenLoaded)(instanceQueryLeft)) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_CozyTheme.default, (0, _extends2.default)({}, props, {
|
|
36
|
+
settingsThemeType: instance === null || instance === void 0 ? void 0 : instance.colorScheme
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var _default = CozyThemeWithQuery;
|
|
41
|
+
exports.default = _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
Object.defineProperty(exports, "useCozyTheme", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function get() {
|
|
12
|
+
return _CozyTheme.useCozyTheme;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
+
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
|
+
|
|
22
|
+
var _helpers = require("cozy-ui/transpiled/react/hooks/useSetFlagshipUi/helpers");
|
|
23
|
+
|
|
24
|
+
var _CozyTheme = _interopRequireWildcard(require("cozy-ui/transpiled/react/providers/CozyTheme"));
|
|
25
|
+
|
|
26
|
+
var _CozyThemeWithQuery = _interopRequireDefault(require("./CozyThemeWithQuery"));
|
|
27
|
+
|
|
28
|
+
var _excluded = ["ignoreCozySettings"];
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
var CozyTheme = function CozyTheme(_ref) {
|
|
35
|
+
var ignoreCozySettings = _ref.ignoreCozySettings,
|
|
36
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
37
|
+
var Comp = ignoreCozySettings || process.env.NODE_ENV === 'test' || _helpers.isRsg ? _CozyTheme.default : _CozyThemeWithQuery.default;
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(Comp, props);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
CozyTheme.propTypes = {
|
|
42
|
+
variant: _propTypes.default.oneOf(['normal', 'inverted']),
|
|
43
|
+
|
|
44
|
+
/** Causes this element's children to appear as if they were direct children of the element's parent, ignoring the element itself. */
|
|
45
|
+
ignoreItself: _propTypes.default.bool,
|
|
46
|
+
|
|
47
|
+
/** Bypasses the request that retrieves the app's settings in order to define the theme type */
|
|
48
|
+
ignoreCozySettings: _propTypes.default.bool,
|
|
49
|
+
className: _propTypes.default.string,
|
|
50
|
+
children: _propTypes.default.node
|
|
51
|
+
};
|
|
52
|
+
CozyTheme.defaultProps = {
|
|
53
|
+
variant: 'normal',
|
|
54
|
+
ignoreCozySettings: false,
|
|
55
|
+
ignoreItself: true
|
|
56
|
+
};
|
|
57
|
+
var _default = CozyTheme;
|
|
58
|
+
exports.default = _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildSettingsInstanceQuery = void 0;
|
|
7
|
+
|
|
8
|
+
var _cozyClient = require("cozy-client");
|
|
9
|
+
|
|
10
|
+
var SETTINGS_DOCTYPE = 'io.cozy.settings';
|
|
11
|
+
|
|
12
|
+
var defaultFetchPolicy = _cozyClient.fetchPolicies.olderThan(5 * 60 * 1000);
|
|
13
|
+
|
|
14
|
+
var buildSettingsInstanceQuery = function buildSettingsInstanceQuery() {
|
|
15
|
+
return {
|
|
16
|
+
definition: (0, _cozyClient.Q)(SETTINGS_DOCTYPE).getById('io.cozy.settings.instance'),
|
|
17
|
+
options: {
|
|
18
|
+
as: "".concat(SETTINGS_DOCTYPE, "/io.cozy.settings.instance"),
|
|
19
|
+
fetchPolicy: defaultFetchPolicy,
|
|
20
|
+
singleDocData: true
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.buildSettingsInstanceQuery = buildSettingsInstanceQuery;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _cozyClient = require("cozy-client");
|
|
15
|
+
|
|
16
|
+
var _DemoProvider = _interopRequireDefault(require("cozy-ui/transpiled/react/providers/DemoProvider"));
|
|
17
|
+
|
|
18
|
+
var _excluded = ["client", "children"];
|
|
19
|
+
var defaultClient = {
|
|
20
|
+
plugins: {
|
|
21
|
+
realtime: {
|
|
22
|
+
subscribe: function subscribe() {},
|
|
23
|
+
unsubscribe: function unsubscribe() {},
|
|
24
|
+
unsubscribeAll: function unsubscribeAll() {}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
getStackClient: function getStackClient() {
|
|
28
|
+
return {
|
|
29
|
+
uri: 'https://cozy.io/'
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
getInstanceOptions: function getInstanceOptions() {
|
|
33
|
+
return {
|
|
34
|
+
subdomain: ''
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var DemoProvider = function DemoProvider(_ref) {
|
|
40
|
+
var client = _ref.client,
|
|
41
|
+
children = _ref.children,
|
|
42
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_cozyClient.CozyProvider, {
|
|
44
|
+
client: client || defaultClient
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement(_DemoProvider.default, props, children));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var _default = DemoProvider;
|
|
49
|
+
exports.default = _default;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useIntent = exports.default = exports.IntentContext = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
+
|
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _cozyClient = require("cozy-client");
|
|
21
|
+
|
|
22
|
+
var _Backdrop = _interopRequireDefault(require("cozy-ui/transpiled/react/Backdrop"));
|
|
23
|
+
|
|
24
|
+
var _Spinner = _interopRequireDefault(require("cozy-ui/transpiled/react/Spinner"));
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
var IntentContext = /*#__PURE__*/(0, _react.createContext)();
|
|
31
|
+
exports.IntentContext = IntentContext;
|
|
32
|
+
|
|
33
|
+
var useIntent = function useIntent() {
|
|
34
|
+
var context = (0, _react.useContext)(IntentContext);
|
|
35
|
+
|
|
36
|
+
if (!context) {
|
|
37
|
+
throw new Error('useIntent must be used within a IntentProvider');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return context;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports.useIntent = useIntent;
|
|
44
|
+
|
|
45
|
+
var IntentProvider = function IntentProvider(_ref) {
|
|
46
|
+
var intentId = _ref.intentId,
|
|
47
|
+
componentsProps = _ref.componentsProps,
|
|
48
|
+
children = _ref.children;
|
|
49
|
+
var client = (0, _cozyClient.useClient)();
|
|
50
|
+
|
|
51
|
+
var _useState = (0, _react.useState)({
|
|
52
|
+
service: null,
|
|
53
|
+
intent: null,
|
|
54
|
+
data: null
|
|
55
|
+
}),
|
|
56
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
57
|
+
state = _useState2[0],
|
|
58
|
+
setState = _useState2[1];
|
|
59
|
+
|
|
60
|
+
var value = (0, _react.useMemo)(function () {
|
|
61
|
+
return {
|
|
62
|
+
service: state.service,
|
|
63
|
+
intent: state.intent,
|
|
64
|
+
data: state.data
|
|
65
|
+
};
|
|
66
|
+
}, [state]);
|
|
67
|
+
(0, _react.useEffect)(function () {
|
|
68
|
+
var startService = /*#__PURE__*/function () {
|
|
69
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
70
|
+
var service, intent, data;
|
|
71
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
72
|
+
while (1) {
|
|
73
|
+
switch (_context.prev = _context.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
_context.prev = 0;
|
|
76
|
+
_context.next = 3;
|
|
77
|
+
return client.intents.createService(intentId, window);
|
|
78
|
+
|
|
79
|
+
case 3:
|
|
80
|
+
service = _context.sent;
|
|
81
|
+
intent = service.getIntent();
|
|
82
|
+
data = service.getData();
|
|
83
|
+
setState({
|
|
84
|
+
service: service,
|
|
85
|
+
intent: intent,
|
|
86
|
+
data: data
|
|
87
|
+
});
|
|
88
|
+
_context.next = 12;
|
|
89
|
+
break;
|
|
90
|
+
|
|
91
|
+
case 9:
|
|
92
|
+
_context.prev = 9;
|
|
93
|
+
_context.t0 = _context["catch"](0);
|
|
94
|
+
service.throw(_context.t0);
|
|
95
|
+
|
|
96
|
+
case 12:
|
|
97
|
+
case "end":
|
|
98
|
+
return _context.stop();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}, _callee, null, [[0, 9]]);
|
|
102
|
+
}));
|
|
103
|
+
|
|
104
|
+
return function startService() {
|
|
105
|
+
return _ref2.apply(this, arguments);
|
|
106
|
+
};
|
|
107
|
+
}();
|
|
108
|
+
|
|
109
|
+
if (!state.service) {
|
|
110
|
+
startService();
|
|
111
|
+
}
|
|
112
|
+
}, [client, intentId, state.service]);
|
|
113
|
+
|
|
114
|
+
if (!state.service) {
|
|
115
|
+
return /*#__PURE__*/_react.default.createElement(_Backdrop.default, (0, _extends2.default)({
|
|
116
|
+
open: true
|
|
117
|
+
}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.backdrop), /*#__PURE__*/_react.default.createElement(_Spinner.default, (0, _extends2.default)({
|
|
118
|
+
className: "u-m-0",
|
|
119
|
+
size: "xxlarge",
|
|
120
|
+
middle: true
|
|
121
|
+
}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.spinner)));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return /*#__PURE__*/_react.default.createElement(IntentContext.Provider, {
|
|
125
|
+
value: value
|
|
126
|
+
}, children);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
var _default = IntentProvider;
|
|
130
|
+
exports.default = _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export class AppIcon extends React.Component<any, any, any> {
|
|
2
|
+
constructor(props: any, context: any);
|
|
3
|
+
isUnmounting: boolean;
|
|
4
|
+
handleError(): void;
|
|
5
|
+
fetchIcon(): any;
|
|
6
|
+
state: {
|
|
7
|
+
error: any;
|
|
8
|
+
icon: any;
|
|
9
|
+
status: string;
|
|
10
|
+
};
|
|
11
|
+
componentWillUnmount(): void;
|
|
12
|
+
componentDidMount(): void;
|
|
13
|
+
componentDidUpdate(prevProps: any): void;
|
|
14
|
+
load(): Promise<void>;
|
|
15
|
+
render(): JSX.Element;
|
|
16
|
+
}
|
|
17
|
+
export namespace AppIcon {
|
|
18
|
+
namespace propTypes {
|
|
19
|
+
export let alt: PropTypes.Requireable<string>;
|
|
20
|
+
export let app: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
21
|
+
name: PropTypes.Requireable<string>;
|
|
22
|
+
slug: PropTypes.Requireable<string>;
|
|
23
|
+
developer: PropTypes.Requireable<object>;
|
|
24
|
+
links: PropTypes.Requireable<PropTypes.InferProps<{
|
|
25
|
+
icon: PropTypes.Requireable<string>;
|
|
26
|
+
}>>;
|
|
27
|
+
latest_version: PropTypes.Requireable<PropTypes.InferProps<{
|
|
28
|
+
version: PropTypes.Requireable<string>;
|
|
29
|
+
}>>;
|
|
30
|
+
}>>>;
|
|
31
|
+
export { iconPropType as fallbackIcon };
|
|
32
|
+
export let fetchIcon: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
|
+
export let client: PropTypes.Validator<object>;
|
|
34
|
+
export let className: PropTypes.Requireable<string>;
|
|
35
|
+
export let onReady: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
|
+
export let type: PropTypes.Requireable<string>;
|
|
37
|
+
export let priority: PropTypes.Requireable<string>;
|
|
38
|
+
}
|
|
39
|
+
namespace defaultProps {
|
|
40
|
+
let type_1: string;
|
|
41
|
+
export { type_1 as type };
|
|
42
|
+
let priority_1: string;
|
|
43
|
+
export { priority_1 as priority };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
declare const _default: Function;
|
|
47
|
+
export default _default;
|
|
48
|
+
import React from 'react';
|
|
49
|
+
import PropTypes from 'prop-types';
|
|
50
|
+
import { iconPropType } from 'cozy-ui/transpiled/react/Icon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class AppLinker extends React.Component<any, any, any> {
|
|
2
|
+
static contextType: React.Context<import("cozy-intent").WebviewService>;
|
|
3
|
+
static getSlug(props: any): any;
|
|
4
|
+
static getOnClickHref(props: any, context: any, imgRef: any): {
|
|
5
|
+
onClick: (event: any) => void;
|
|
6
|
+
href: string;
|
|
7
|
+
} | {
|
|
8
|
+
href: any;
|
|
9
|
+
onClick: any;
|
|
10
|
+
};
|
|
11
|
+
constructor(props: any);
|
|
12
|
+
state: {
|
|
13
|
+
imgRef: any;
|
|
14
|
+
};
|
|
15
|
+
setImgRef: (img: any) => void;
|
|
16
|
+
imgRef: any;
|
|
17
|
+
render(): any;
|
|
18
|
+
}
|
|
19
|
+
export namespace AppLinker {
|
|
20
|
+
namespace propTypes {
|
|
21
|
+
let href: PropTypes.Requireable<string>;
|
|
22
|
+
let onAppSwitch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
|
+
let app: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
24
|
+
slug: PropTypes.Validator<string>;
|
|
25
|
+
}>>>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
declare const _default: Function;
|
|
29
|
+
export default _default;
|
|
30
|
+
import React from 'react';
|
|
31
|
+
import PropTypes from 'prop-types';
|
|
32
|
+
import { getUniversalLinkDomain } from './native';
|
|
33
|
+
import { generateWebLink } from './native';
|
|
34
|
+
import { generateUniversalLink } from './native';
|
|
35
|
+
export { getUniversalLinkDomain, generateWebLink, generateUniversalLink };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const UNIVERSAL_LINK_URL: "https://links.mycozy.cloud";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shows a list of apps grouped by categories.
|
|
3
|
+
*
|
|
4
|
+
* Can be
|
|
5
|
+
*
|
|
6
|
+
* - uncontrolled: it controls an internal search object to filter the list.
|
|
7
|
+
* - controlled: it is controlled by the `search` prop
|
|
8
|
+
*/
|
|
9
|
+
export class Sections extends React.Component<any, any, any> {
|
|
10
|
+
constructor(props: any, context: any);
|
|
11
|
+
state: {
|
|
12
|
+
search: any;
|
|
13
|
+
};
|
|
14
|
+
handleCategoryChange(categoryOption: any): void;
|
|
15
|
+
render(): JSX.Element;
|
|
16
|
+
}
|
|
17
|
+
export namespace Sections {
|
|
18
|
+
namespace propTypes {
|
|
19
|
+
let t: PropTypes.Validator<(...args: any[]) => any>;
|
|
20
|
+
let apps: PropTypes.Validator<any[]>;
|
|
21
|
+
let error: PropTypes.Requireable<object>;
|
|
22
|
+
let config: PropTypes.Requireable<object>;
|
|
23
|
+
let onAppClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
24
|
+
let hasNav: PropTypes.Requireable<boolean>;
|
|
25
|
+
let initialSearch: PropTypes.Requireable<object>;
|
|
26
|
+
let displaySpecificMaintenanceStyle: PropTypes.Requireable<boolean>;
|
|
27
|
+
}
|
|
28
|
+
namespace defaultProps {
|
|
29
|
+
let hasNav_1: boolean;
|
|
30
|
+
export { hasNav_1 as hasNav };
|
|
31
|
+
let displaySpecificMaintenanceStyle_1: boolean;
|
|
32
|
+
export { displaySpecificMaintenanceStyle_1 as displaySpecificMaintenanceStyle };
|
|
33
|
+
export let showFilterDropdown: boolean;
|
|
34
|
+
export let showTitles: boolean;
|
|
35
|
+
export let showSubTitles: boolean;
|
|
36
|
+
export let showSubSubTitles: boolean;
|
|
37
|
+
export let componentsProps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
38
|
+
/** Props spread to AppsSection component */
|
|
39
|
+
appsSection: PropTypes.Requireable<PropTypes.InferProps<{
|
|
40
|
+
/** Props spread to onClick method of AppTile component */
|
|
41
|
+
disableClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
42
|
+
}>>;
|
|
43
|
+
}>>;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
declare const _default: any;
|
|
47
|
+
export default _default;
|
|
48
|
+
import React from 'react';
|
|
49
|
+
import PropTypes from 'prop-types';
|