@evergis/react 4.0.133 → 4.0.135

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Everpoint
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Everpoint
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # @evergis/react
2
-
3
- В данном репозитории находятся специфичные (в отличии от `@evergis/uilib-gl`) для `Evergis Online`,
4
- но в целом переиспользуемые на других проектах, построенных на Evergis API, React-компоненты.
5
-
6
- ***ВАЖНО!!!***: Разрабатываемые компоненты не должны иметь зависимостей
7
- от системы поддержки мультиязычности `Evergis Online`!
1
+ # @evergis/react
2
+
3
+ В данном репозитории находятся специфичные (в отличии от `@evergis/uilib-gl`) для `Evergis Online`,
4
+ но в целом переиспользуемые на других проектах, построенных на Evergis API, React-компоненты.
5
+
6
+ ***ВАЖНО!!!***: Разрабатываемые компоненты не должны иметь зависимостей
7
+ от системы поддержки мультиязычности `Evergis Online`!
@@ -1 +1,10 @@
1
+ /**
2
+ * `src` для картинки: свой файл тянется fetch'ем с токеном и отдаётся blob-адресом, чужой
3
+ * возвращается как есть.
4
+ *
5
+ * Внешний адрес намеренно не фетчится: тег `img` грузит кросс-доменную картинку без всякого
6
+ * CORS, а `fetch` — только если чужой сервер отдал `Access-Control-Allow-Origin`. Заодно
7
+ * картинка остаётся в HTTP-кеше браузера, которого blob-адрес лишён. Ровно так же поступают
8
+ * вложения: `useAttachmentPreviewImages` отдаёт внешней ссылке `src: item.link`.
9
+ */
1
10
  export declare const useFetchImageWithAuth: (url: string | null) => string | null;
@@ -1 +1,11 @@
1
+ /**
2
+ * Приводит значение конфига к адресу картинки, иконки или ссылки.
3
+ *
4
+ * Развилка одна: готовый адрес отдаётся как есть, всё остальное считается идентификатором
5
+ * ресурса и разворачивается в путь к файлу каталога.
6
+ *
7
+ * Проверка идёт по схеме, а не по префиксу `http`: иначе `data:`-URI, `blob:`, `mailto:` и
8
+ * `//cdn…` превращались бы в `/sp/resources/file/data:…` — путь к несуществующему файлу,
9
+ * который дальше по течению неотличим от обычного внутреннего адреса и молча даёт 404.
10
+ */
1
11
  export declare const getResourceUrl: (url?: string) => string;
@@ -60,6 +60,7 @@ export * from './getTotalFromAttributes';
60
60
  export * from './getTotalFromRelatedFeatures';
61
61
  export * from './getRootElementId';
62
62
  export * from './hasContainerBgImage';
63
+ export * from './isCrossOriginUrl';
63
64
  export * from './isEmptyElementValue';
64
65
  export * from './isEmptyValue';
65
66
  export * from './isHiddenEmptyValue';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Ведёт ли адрес на ЧУЖОЙ origin — сервер, который ничего не знает ни про наш токен, ни про
3
+ * наши заголовки.
4
+ *
5
+ * Относительный адрес (`/sp/resources/file/<id>`) всегда свой. Абсолютный сравнивается с
6
+ * `location.origin`, поэтому `https://<наш хост>/sp/...` тоже считается своим: его файлы
7
+ * закрыты авторизацией ровно так же, как у относительного пути.
8
+ *
9
+ * Проверка НЕ сводится к `^https?://`, как `isExternal` у вложений: там достаточно отличить
10
+ * ссылку от файла каталога, а здесь решается, отправлять ли на адрес `Authorization`.
11
+ *
12
+ * Разобрать адрес не удалось — считаем его своим: пусть с ним разбирается обычный путь
13
+ * загрузки, а не эта проверка.
14
+ */
15
+ export declare const isCrossOriginUrl: (url?: string | null) => boolean;