ublo-lib 1.47.37 → 1.47.38

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.
@@ -1,3 +1,8 @@
1
+ declare global {
2
+ interface Window {
3
+ Cms: any;
4
+ }
5
+ }
1
6
  type Link = {
2
7
  name: string;
3
8
  onClick: string | (() => void);
@@ -1 +1 @@
1
- {"version":3,"file":"admin-links.d.ts","sourceRoot":"","sources":["../../../../src/common/components/admin-links/admin-links.tsx"],"names":[],"mappings":"AAMA,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CACpC,CAAC;AAeF,QAAA,MAAM,UAAU,oBAAqB,KAAK,4CA2GzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"admin-links.d.ts","sourceRoot":"","sources":["../../../../src/common/components/admin-links/admin-links.tsx"],"names":[],"mappings":"AAKA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,GAAG,EAAE,GAAG,CAAC;KACV;CACF;AAED,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CACpC,CAAC;AAeF,QAAA,MAAM,UAAU,oBAAqB,KAAK,4CA2GzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { useUbloContext } from "ublo/with-ublo";
4
- import { loadFileManager } from "../../utils/file-manager";
5
4
  import styles from "./admin-links.module.css";
6
5
  const ToggleIcon = () => {
7
6
  return (_jsx("svg", { viewBox: "0 0 24 24", width: "24", height: "24", className: styles.toggleIcon, children: _jsx("path", { d: "M19.44 12.99l-.01.02c.04-.33.08-.67.08-1.01 0-.34-.03-.66-.07-.99l.01.02 2.44-1.92-2.43-4.22-2.87 1.16.01.01c-.52-.4-1.09-.74-1.71-1h.01L14.44 2H9.57l-.44 3.07h.01c-.62.26-1.19.6-1.71 1l.01-.01-2.88-1.17-2.44 4.22 2.44 1.92.01-.02c-.04.33-.07.65-.07.99 0 .34.03.68.08 1.01l-.01-.02-2.1 1.65-.33.26 2.43 4.2 2.88-1.15-.02-.04c.53.41 1.1.75 1.73 1.01h-.03L9.58 22h4.85s.03-.18.06-.42l.38-2.65h-.01c.62-.26 1.2-.6 1.73-1.01l-.02.04 2.88 1.15 2.43-4.2s-.14-.12-.33-.26l-2.11-1.66zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z" }) }));
@@ -29,7 +28,7 @@ const AdminLinks = ({ customLinks }) => {
29
28
  },
30
29
  fileManager: {
31
30
  name: "Photothèque",
32
- onClick: loadFileManager,
31
+ onClick: window.Cms?.fileManagerUploadOnly,
33
32
  },
34
33
  plausible: {
35
34
  name: "Statistiques",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.47.37",
3
+ "version": "1.47.38",
4
4
  "peerDependencies": {
5
5
  "classnames": "^2.5.1",
6
6
  "dt-design-system": "^3.12.0",
@@ -1,8 +0,0 @@
1
- declare global {
2
- interface Window {
3
- CmsConfig: any;
4
- openFileManager: any;
5
- }
6
- }
7
- export declare const loadFileManager: (uploadOnly?: boolean) => Promise<void>;
8
- //# sourceMappingURL=file-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-manager.d.ts","sourceRoot":"","sources":["../../../src/common/utils/file-manager.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,EAAE,GAAG,CAAC;QACf,eAAe,EAAE,GAAG,CAAC;KACtB;CACF;AAED,eAAO,MAAM,eAAe,gBAAsB,OAAO,kBASxD,CAAC"}
@@ -1,12 +0,0 @@
1
- import { loadJS } from "./load-js";
2
- export const loadFileManager = async (uploadOnly = true) => {
3
- const { url, token } = window.CmsConfig.filemanager;
4
- if (!url || !token)
5
- return;
6
- await loadJS(`${url}/static/js/file-manager.js`, "file-picker");
7
- window.openFileManager({
8
- fileManagerAPIURL: url,
9
- token: token,
10
- uploadOnly,
11
- });
12
- };