arengibook 2.5.4 → 2.5.6

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.
Files changed (2) hide show
  1. package/dist/index.js +47 -131
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -42653,6 +42653,7 @@ Toast$1.displayName = 'Toast';
42653
42653
  var css_248z = ".p-toast-message {\n height:auto;\n}\n.p-toast-message.heightoastlarge {\n min-height:50px;\n}\n.p-toast-message.heightoastmedium {\n max-height:100px;\n overflow: hidden;\n}\n\n.p-toast-message.toast_s--compact {\n width: 116px;\n min-width: 56px;\n padding-right: 0;\n position: relative;\n}\n\n.p-toast-message.toast_s--compact .p-toast-message-content {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0.5rem;\n}\n\n.p-toast-message.toast_s--compact .maximize-button {\n margin-right: 20px;\n}\n\n.p-toast-message.toast_s--compact .p-toast-icon-close {\n position: absolute;\n top: 4px;\n right: 4px;\n}\n\n\n.p-toast-message.toast_s--large {\n width: auto;\n min-width: auto;\n padding-right: inherit;\n}\n\n.p-toast-message.toast_s--large .p-toast-message-content {\n display: flex;\n align-items: center;\n padding: 1rem;\n gap: 0.75rem;\n}\n\n.p-toast-message .maximize-button-container {\n margin-left: auto;\n display: flex;\n align-items: center;\n}\n\n.p-toast-message.toast_s--large .p-toast-icon-close {\n position: static;\n margin-left: 0.5rem;\n}\n\n/* Title */\n\n.toast-title {\n font-weight: 600;\n font-size: 0.95rem;\n line-height: 1.3;\n color: #111827; /* gris très foncé / quasi noir */\n margin-bottom: 0.25rem;\n}\n\n\n.toast-root {\n display: flex;\n align-items: flex-start;\n width: 100%;\n gap: 0.75rem;\n}\n.toast-left {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-shrink: 0;\n}\n.toast-body {\n line-height: 1.4;\n}\n.toast-action-btn {\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0;\n}\n.p-toast-message-content {\n position: relative;\n}\n.p-toast-icon-close {\n position: static;\n}\n.toast-left .p-toast-icon-close {\n order: 3;\n}\n/* Toast - Percentage */\n.toast-percentage {\n margin-top: 0.5rem;\n width: 100%;\n}\n\n.toast-percentage-label {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 0.25rem;\n text-align: right;\n width: 100%;\n}\n\n.toast-percentage-bar {\n height: 6px;\n background-color: #e5e7eb;\n border-radius: 999px;\n overflow: hidden;\n width: 100%;\n}\n\n.toast-percentage-bar-fill {\n height: 100%;\n background-color: #3b82f6;\n transition: width 0.3s ease;\n}\n\n/* Link */\n\n.toast-link {\n margin-top: 0.5rem;\n}\n\n.toast-link a {\n font-size: 0.85rem;\n font-weight: 500;\n color: #2563eb;\n text-decoration: underline;\n}\n\n.toast-link a:hover {\n text-decoration: none;\n}\n\n/* Links */\n\n.toast-links {\n margin-top: 0.5rem;\n padding-left: 1rem;\n}\n\n.toast-links li {\n margin-bottom: 0.25rem;\n}\n\n.toast-links a {\n font-size: 0.85rem;\n color: #2563eb;\n text-decoration: underline;\n}\n\n.toast-links a:hover {\n text-decoration: none;\n}\n\n.toast-message {\n padding-right: 20px;\n}\n.p-toast-message {\n position: relative;\n}\n.p-toast-message .p-toast-icon-close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n}\n.p-toast-message .toast-action-btn {\n position: absolute;\n top: 0.5rem;\n right: 2.5rem;\n}\n\n/* AttachedFiles */\n\n.toast-attached-files {\n margin-top: 0.75rem;\n}\n\n.toast-attached-files-title {\n font-size: 0.75rem;\n font-weight: 600;\n color: #6b7280;\n margin-bottom: 0.25rem;\n}\n\n.toast-attached-files-list {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n\n.toast-attached-files-list li {\n margin-bottom: 0.25rem;\n}\n\n.toast-attached-files-list a {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n font-size: 0.85rem;\n color: #2563eb;\n text-decoration: underline;\n}\n\n.toast-attached-files-list a:hover {\n text-decoration: none;\n}\n\n";
42654
42654
  styleInject(css_248z);
42655
42655
 
42656
+ // Toast.jsx
42656
42657
  var Toast = function Toast(_ref) {
42657
42658
  var icon = _ref.icon,
42658
42659
  message = _ref.message,
@@ -42670,26 +42671,11 @@ var Toast = function Toast(_ref) {
42670
42671
  autoShow = _ref$autoShow === void 0 ? true : _ref$autoShow,
42671
42672
  _ref$reShowOnPropsCha = _ref.reShowOnPropsChange,
42672
42673
  reShowOnPropsChange = _ref$reShowOnPropsCha === void 0 ? false : _ref$reShowOnPropsCha,
42673
- onSizeChange = _ref.onSizeChange,
42674
42674
  title = _ref.title,
42675
42675
  sticky = _ref.sticky,
42676
- _ref$enablePercentage = _ref.enablePercentage,
42677
- enablePercentage = _ref$enablePercentage === void 0 ? false : _ref$enablePercentage,
42678
- percentage = _ref.percentage,
42679
- link = _ref.link,
42680
- links = _ref.links,
42681
- datetimecreation = _ref.datetimecreation,
42682
- sizeSModulable = _ref.sizeSModulable,
42683
- isExpanded = _ref.isExpanded,
42684
- attachedFiles = _ref.attachedFiles;
42676
+ datetimecreation = _ref.datetimecreation;
42685
42677
  var toastRef = useRef(null);
42686
42678
  var hasShownRef = useRef(false);
42687
- var progressBarRef = useRef(null);
42688
- var percentageTextRef = useRef(null);
42689
- var _useState = useState(percentage),
42690
- _useState2 = _slicedToArray$a(_useState, 2),
42691
- currentPercentage = _useState2[0],
42692
- setCurrentPercentage = _useState2[1];
42693
42679
  var getIconByType = function getIconByType() {
42694
42680
  switch (type) {
42695
42681
  case "success":
@@ -42707,128 +42693,39 @@ var Toast = function Toast(_ref) {
42707
42693
  return "pi pi-info-circle";
42708
42694
  }
42709
42695
  };
42710
- var handleToggleSize = function handleToggleSize() {
42711
- if (!onSizeChange) return;
42712
- if (size === "S") {
42713
- onSizeChange("L");
42714
- toastRef.current.clear();
42715
- } else if (size === "L") {
42716
- onSizeChange("S");
42717
- toastRef.current.clear();
42718
- }
42719
- };
42720
- var classNameSizeS = function classNameSizeS() {
42721
- switch (size) {
42722
- case 'S':
42723
- return "toast_s--compact";
42724
- case 'L':
42725
- if (sizeSModulable === true) {
42726
- return "toast_s--large";
42727
- } else {
42728
- return "";
42729
- }
42730
- default:
42731
- return '';
42732
- }
42733
- };
42734
42696
  useEffect(function () {
42735
42697
  if (!toastRef.current || !autoShow) return;
42736
42698
  if (hasShownRef.current && !reShowOnPropsChange) return;
42699
+ var _content = /*#__PURE__*/React__default.createElement("div", {
42700
+ className: "toast-root"
42701
+ }, /*#__PURE__*/React__default.createElement("div", {
42702
+ className: "toast-left"
42703
+ }, /*#__PURE__*/React__default.createElement("i", {
42704
+ className: icon !== null && icon !== void 0 ? icon : getIconByType(),
42705
+ "aria-hidden": "true"
42706
+ })), /*#__PURE__*/React__default.createElement("div", {
42707
+ className: "toast-body"
42708
+ }, title && /*#__PURE__*/React__default.createElement("div", {
42709
+ className: "toast-title"
42710
+ }, title), /*#__PURE__*/React__default.createElement("div", {
42711
+ className: "toast-message"
42712
+ }, /*#__PURE__*/React__default.createElement("div", {
42713
+ className: "toast-html-content",
42714
+ dangerouslySetInnerHTML: {
42715
+ __html: message
42716
+ }
42717
+ }))));
42737
42718
  toastRef.current.show({
42738
42719
  severity: type,
42739
42720
  closable: closable,
42740
42721
  life: duration,
42741
42722
  sticky: sticky,
42742
- className: "".concat(classNameSizeS(), " ").concat(type === "processing" ? "toast--processing" : ""),
42743
- // toast--processing est le css à
42744
- // personnaliser pour obtenir le loader souhaité par Camille
42745
-
42746
42723
  content: function content() {
42747
- return /*#__PURE__*/React__default.createElement("div", {
42748
- className: "toast-root"
42749
- }, /*#__PURE__*/React__default.createElement("div", {
42750
- className: "toast-left"
42751
- }, /*#__PURE__*/React__default.createElement("i", {
42752
- className: icon !== null && icon !== void 0 ? icon : getIconByType(),
42753
- "aria-hidden": "true"
42754
- }), (size === "S" || size === "L" && sizeSModulable === true) && /*#__PURE__*/React__default.createElement("button", {
42755
- type: "button",
42756
- onClick: handleToggleSize,
42757
- "aria-label": isExpanded ? "Réduire" : "Agrandir",
42758
- className: "toast-action-btn"
42759
- }, /*#__PURE__*/React__default.createElement("i", {
42760
- className: isExpanded ? "pi pi-window-minimize" : "pi pi-window-maximize"
42761
- }))), size !== "S" && /*#__PURE__*/React__default.createElement("div", {
42762
- className: "toast-body"
42763
- }, title && (size === "M" || size === "L") && /*#__PURE__*/React__default.createElement("div", {
42764
- className: "toast-title"
42765
- }, title), /*#__PURE__*/React__default.createElement("div", {
42766
- className: "toast-message"
42767
- }, datetimecreation ? /*#__PURE__*/React__default.createElement("div", {
42768
- dangerouslySetInnerHTML: {
42769
- __html: message
42770
- }
42771
- }) : message), link && size === "L" && /*#__PURE__*/React__default.createElement("div", {
42772
- className: "toast-link"
42773
- }, /*#__PURE__*/React__default.createElement("a", {
42774
- href: link.url,
42775
- target: "_blank",
42776
- rel: "noopener noreferrer"
42777
- }, link.label)), Array.isArray(links) && links.length > 0 && size === "L" && /*#__PURE__*/React__default.createElement("ul", {
42778
- className: "toast-links"
42779
- }, links.map(function (link, index) {
42780
- return /*#__PURE__*/React__default.createElement("li", {
42781
- key: index
42782
- }, /*#__PURE__*/React__default.createElement("a", {
42783
- href: link.url,
42784
- target: "_blank",
42785
- rel: "noopener noreferrer"
42786
- }, link.label));
42787
- })), Array.isArray(attachedFiles) && attachedFiles.length > 0 && size === "L" && /*#__PURE__*/React__default.createElement("div", {
42788
- className: "toast-attached-files"
42789
- }, /*#__PURE__*/React__default.createElement("div", {
42790
- className: "toast-attached-files-title"
42791
- }, "Pi\xE8ces jointes"), /*#__PURE__*/React__default.createElement("ul", {
42792
- className: "toast-attached-files-list"
42793
- }, attachedFiles.map(function (file, index) {
42794
- return /*#__PURE__*/React__default.createElement("li", {
42795
- key: index
42796
- }, /*#__PURE__*/React__default.createElement("a", {
42797
- href: file.url,
42798
- target: "_blank",
42799
- rel: "noopener noreferrer"
42800
- }, /*#__PURE__*/React__default.createElement("i", {
42801
- className: "pi pi-paperclip",
42802
- "aria-hidden": "true"
42803
- }), /*#__PURE__*/React__default.createElement("span", null, file.name)));
42804
- }))), size === "L" && enablePercentage && /*#__PURE__*/React__default.createElement("div", {
42805
- className: "toast-percentage"
42806
- }, /*#__PURE__*/React__default.createElement("div", {
42807
- className: "toast-percentage-label"
42808
- }, /*#__PURE__*/React__default.createElement("span", {
42809
- ref: percentageTextRef
42810
- }, currentPercentage, "%")), /*#__PURE__*/React__default.createElement("div", {
42811
- className: "toast-percentage-bar"
42812
- }, /*#__PURE__*/React__default.createElement("div", {
42813
- ref: progressBarRef,
42814
- className: "toast-percentage-bar-fill",
42815
- style: {
42816
- width: "".concat(currentPercentage, "%")
42817
- }
42818
- })))));
42724
+ return _content;
42819
42725
  }
42820
42726
  });
42821
42727
  hasShownRef.current = true;
42822
- }, [icon, message, type, size, closable, duration, autoShow, reShowOnPropsChange, title, sticky, enablePercentage, link, datetimecreation, sizeSModulable, isExpanded]);
42823
- useEffect(function () {
42824
- setCurrentPercentage(percentage);
42825
- if (progressBarRef.current) {
42826
- progressBarRef.current.style.width = "".concat(percentage, "%");
42827
- }
42828
- if (percentageTextRef.current) {
42829
- percentageTextRef.current.textContent = "".concat(percentage, "%");
42830
- }
42831
- }, [percentage]);
42728
+ }, [icon, message, type, size, closable, duration, autoShow, reShowOnPropsChange, title, sticky, datetimecreation]);
42832
42729
  return /*#__PURE__*/React__default.createElement(Toast$1, {
42833
42730
  ref: toastRef,
42834
42731
  position: position
@@ -42848,8 +42745,6 @@ var ToastContainer = function ToastContainer() {
42848
42745
  position: "top-right"
42849
42746
  });
42850
42747
  };
42851
-
42852
- // Fonction globale simple
42853
42748
  var showToast = function showToast(props) {
42854
42749
  if (!container) {
42855
42750
  container = document.createElement('div');
@@ -42860,11 +42755,20 @@ var showToast = function showToast(props) {
42860
42755
  if (toastRef) {
42861
42756
  toastRef.show({
42862
42757
  severity: props.type || 'info',
42863
- summary: props.title || '',
42864
- detail: props.message,
42865
42758
  life: props.duration || 3000,
42866
42759
  sticky: props.sticky,
42867
- closable: props.closable !== false
42760
+ closable: props.closable !== false,
42761
+ summary: props.title || '',
42762
+ content: /*#__PURE__*/React__default.createElement("div", {
42763
+ className: "p-toast-message-content"
42764
+ }, props.title && /*#__PURE__*/React__default.createElement("span", {
42765
+ className: "p-toast-summary"
42766
+ }, props.title), /*#__PURE__*/React__default.createElement("div", {
42767
+ className: "p-toast-detail",
42768
+ dangerouslySetInnerHTML: {
42769
+ __html: props.message
42770
+ }
42771
+ }))
42868
42772
  });
42869
42773
  }
42870
42774
  }, 0);
@@ -43008,6 +42912,7 @@ var ToastPresets = {
43008
42912
  type: "processing",
43009
42913
  size: "L",
43010
42914
  title: "Tâche en cours",
42915
+ enableHtmlContent: true,
43011
42916
  datetimecreation: "12.01.2026 à 11h18",
43012
42917
  message: "Le programme a commencé le <strong>{{datetimecreation}}</strong>.\n\n" + "Vous serez averti par mail de la fin de son exécution.\n\n" + "Vous pouvez également suivre son exécution en cliquant sur ce lien.",
43013
42918
  closable: true,
@@ -43054,6 +42959,17 @@ var ToastPresets = {
43054
42959
  reShowOnPropsChange: true,
43055
42960
  sizeSModulable: true,
43056
42961
  enablePercentage: true
42962
+ },
42963
+ BackendHtmlContent: {
42964
+ type: "success",
42965
+ size: "L",
42966
+ title: "Résultat du traitement",
42967
+ enableHtmlContent: true,
42968
+ message: "\n <div style=\"display:flex; flex-direction:column; gap:0.75rem;\">\n <strong style=\"color:#16a34a;\">\n \u2714 Traitement termin\xE9 avec succ\xE8s\n </strong>\n\n <p>\n Le fichier a \xE9t\xE9 g\xE9n\xE9r\xE9 par le backend Symfony.\n </p>\n\n <a\n href=\"https://example.com/result\"\n target=\"_blank\"\n style=\"color:#2563eb; text-decoration:underline;\"\n >\n Voir le r\xE9sultat\n </a>\n\n <button\n style=\"\n margin-top:0.5rem;\n padding:0.4rem 0.75rem;\n background:#2563eb;\n color:white;\n border:none;\n border-radius:4px;\n cursor:pointer;\n \"\n onclick=\"alert('T\xE9l\xE9chargement d\xE9clench\xE9')\"\n >\n T\xE9l\xE9charger\n </button>\n </div>\n ",
42969
+ sticky: true,
42970
+ closable: true,
42971
+ autoShow: true,
42972
+ reShowOnPropsChange: true
43057
42973
  }
43058
42974
  };
43059
42975
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "2.5.04",
4
+ "version": "2.5.6",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "dev": "vite",
16
- "build": "rollup -cCh",
16
+ "build": "rollup -c",
17
17
  "lint": "eslint .",
18
18
  "preview": "vite preview",
19
19
  "storybook": "storybook dev -p 6006",