@edifice.io/react 2.6.13-develop-b2school.20261110180234 → 2.6.13-develop-b2school.20261110182412
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/dist/modules/homepage/components/BriefMe/BriefMe.js +1 -1
- package/dist/modules/homepage/components/Cantine/CantineContainer.js +1 -1
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +4 -1
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +1 -1
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +3 -3
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +1 -1
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +8 -3
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +1 -1
- package/dist/modules/homepage/components/Edumalin/Edumalin.js +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import SvgIconExternalLink from"../../../icons/components/IconExternalLink.js";import IconButton from"../../../../components/Button/IconButton.js";import Image from"../../../../components/Image/Image.js";import SegmentedControl from"../../../../components/SegmentedControl/SegmentedControl.js";import TextSkeleton from"../../../../components/Skeleton/TextSkeleton.js";import HomeCard from"../HomeCard/HomeCard.js";import clsx$1 from"clsx";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import
|
|
1
|
+
import SvgIconExternalLink from"../../../icons/components/IconExternalLink.js";import IconButton from"../../../../components/Button/IconButton.js";import Image from"../../../../components/Image/Image.js";import SegmentedControl from"../../../../components/SegmentedControl/SegmentedControl.js";import TextSkeleton from"../../../../components/Skeleton/TextSkeleton.js";import HomeCard from"../HomeCard/HomeCard.js";import clsx$1 from"clsx";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import illuEdumalinError from"@edifice.io/bootstrap/dist/images/homepage/illu-briefme-error.svg";function BriefMe({handleActionClick,status,category,onCategoryChange,articles}){let{t}=useTranslation(),categoryOptions=[{label:t(`homepage.briefme.category.briefme`),value:`briefme`},{label:t(`homepage.briefme.category.brief-eco`),value:`brief-eco`},{label:t(`homepage.briefme.category.brief-science`),value:`brief-science`}];return jsxs(HomeCard,{variant:`primary`,className:`briefme`,children:[jsxs(`div`,{className:`briefme__header`,children:[jsx(`h3`,{className:`briefme__title`,children:t(`homepage.briefme.title`)}),jsx(IconButton,{"aria-label":t(`homepage.briefme.open`),onClick:handleActionClick,icon:jsx(SvgIconExternalLink,{}),variant:`ghost`,color:`tertiary`})]}),jsxs(HomeCard.Content,{className:clsx$1(`briefme__body`,`briefme__body--${status}`),children:[status!==`error`&&jsx(SegmentedControl,{"aria-label":t(`homepage.briefme.categories`),options:categoryOptions,value:category,onChange:onCategoryChange,className:`briefme__categories`}),status===`loading`&&jsxs(`div`,{className:`briefme__loading`,"data-testid":`briefme-loading`,children:[jsx(TextSkeleton,{size:`lg`,className:`briefme__loading-item`}),jsx(TextSkeleton,{size:`lg`,className:`briefme__loading-item`}),jsx(TextSkeleton,{size:`lg`,className:`briefme__loading-item`})]}),status===`error`&&jsxs(`div`,{className:`briefme__error`,children:[jsx(Image,{src:illuEdumalinError,alt:``,className:`briefme__error-illu`}),jsxs(`p`,{className:`briefme__error-message`,children:[jsx(`span`,{className:`briefme__error-line`,children:t(`homepage.briefme.error.connection`)}),jsx(`span`,{className:`briefme__error-line`,children:t(`homepage.briefme.error.help`)})]})]}),status===`empty`&&jsx(`p`,{className:`briefme__empty`,children:t(`homepage.briefme.empty`)}),status===`default`&&jsx(`ul`,{className:`briefme__list`,children:articles.map(article=>jsxs(`li`,{className:`briefme__article`,children:[jsx(`span`,{className:`briefme__article-date`,children:article.date}),jsx(`a`,{className:`briefme__article-title`,href:article.url,target:`_blank`,rel:`noopener noreferrer`,children:article.title})]},article.id))})]})]})}export{BriefMe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Cantine from"./Cantine.js";import{CantineModalContainer}from"./CantineModalContainer.js";import{useCantine}from"./hooks/useCantine.js";import{useState}from"react";import{Fragment as Fragment$1,jsx,jsxs}from"react/jsx-runtime";function CantineContainer(){let{sections,status}=useCantine(),[isModalOpen,setIsModalOpen]=useState(!1);return jsxs(Fragment$1,{children:[jsx(Cantine,{status,sections,handleFullScreenClick:()=>setIsModalOpen(!0)}),isModalOpen&&jsx(CantineModalContainer,{onClose:()=>setIsModalOpen(!1)})]})}export{CantineContainer};
|
|
1
|
+
import{useUserSchools}from"../../hooks/useUserSchools.js";import Cantine from"./Cantine.js";import{CantineModalContainer}from"./CantineModalContainer.js";import{useCantine}from"./hooks/useCantine.js";import{useState}from"react";import{Fragment as Fragment$1,jsx,jsxs}from"react/jsx-runtime";function CantineContainer(){let{schools,selectedSchool}=useUserSchools(),{sections,status}=useCantine(selectedSchool),[isModalOpen,setIsModalOpen]=useState(!1);return jsxs(Fragment$1,{children:[jsx(Cantine,{status,sections,handleFullScreenClick:()=>setIsModalOpen(!0)}),isModalOpen&&jsx(CantineModalContainer,{schools,defaultSchool:selectedSchool,onClose:()=>setIsModalOpen(!1)})]})}export{CantineContainer};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { School } from '@edifice.io/client';
|
|
1
2
|
export interface CantineModalContainerProps {
|
|
3
|
+
schools: School[];
|
|
4
|
+
defaultSchool?: School;
|
|
2
5
|
onClose: () => void;
|
|
3
6
|
}
|
|
4
|
-
export declare function CantineModalContainer({ onClose }: CantineModalContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function CantineModalContainer({ schools, defaultSchool, onClose, }: CantineModalContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
5
8
|
export declare namespace CantineModalContainer {
|
|
6
9
|
var displayName: string;
|
|
7
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import CantineModal from"./CantineModal.js";import{useCantineModal}from"./hooks/useCantineModal.js";import{jsx}from"react/jsx-runtime";function CantineModalContainer({onClose}){return jsx(CantineModal,{isOpen:!0,onClose,...useCantineModal()})}export{CantineModalContainer};
|
|
1
|
+
import CantineModal from"./CantineModal.js";import{useCantineModal}from"./hooks/useCantineModal.js";import{jsx}from"react/jsx-runtime";function CantineModalContainer({schools,defaultSchool,onClose}){return jsx(CantineModal,{isOpen:!0,onClose,...useCantineModal(schools,defaultSchool)})}export{CantineModalContainer};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { School } from '@edifice.io/client';
|
|
1
2
|
/**
|
|
2
|
-
* Today's lunch menu for the school
|
|
3
|
-
* `useUserSchools`).
|
|
3
|
+
* Today's lunch menu for the given school (see `useUserSchools`).
|
|
4
4
|
*
|
|
5
5
|
* Only lunch is exposed: the widget design has no lunch/dinner toggle, unlike
|
|
6
6
|
* the modal and the legacy AngularJS widget.
|
|
7
7
|
*/
|
|
8
|
-
export declare function useCantine(): {
|
|
8
|
+
export declare function useCantine(school?: School): {
|
|
9
9
|
sections: import('..').CantineSection[];
|
|
10
10
|
status: import('..').CantineStatus;
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import useDate from"../../../../../hooks/useDate/useDate.js";import{
|
|
1
|
+
import useDate from"../../../../../hooks/useDate/useDate.js";import{useCantineMenu}from"./useCantineMenu.js";function useCantine(school){let{formatDate}=useDate(),{sections,status}=useCantineMenu(school?.UAI??``,formatDate(new Date,`YYYY-MM-DD`));return{sections,status}}export{useCantine};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { School } from '@edifice.io/client';
|
|
1
2
|
import { CantineMenuType } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Browsing state of the full-screen canteen modal: day, school and service.
|
|
@@ -5,10 +6,14 @@ import { CantineMenuType } from '../types';
|
|
|
5
6
|
* The school picked here stays local to the modal on purpose: it must not
|
|
6
7
|
* change the school shared with the other homepage widgets (see
|
|
7
8
|
* `useUserSchools`), only the menu being read.
|
|
9
|
+
*
|
|
10
|
+
* `defaultSchool` must come from the widget card, already settled: a fresh
|
|
11
|
+
* `useUserSchools` here would still be switching schools when `Select` echoes
|
|
12
|
+
* its value back, making the two bounce forever.
|
|
8
13
|
*/
|
|
9
|
-
export declare function useCantineModal(): {
|
|
10
|
-
schools:
|
|
11
|
-
selectedSchool:
|
|
14
|
+
export declare function useCantineModal(schools: School[], defaultSchool?: School): {
|
|
15
|
+
schools: School[];
|
|
16
|
+
selectedSchool: School | undefined;
|
|
12
17
|
onSchoolChange: import('react').Dispatch<import('react').SetStateAction<string | undefined>>;
|
|
13
18
|
hasDinner: boolean;
|
|
14
19
|
menuType: CantineMenuType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import useDate from"../../../../../hooks/useDate/useDate.js";import{
|
|
1
|
+
import useDate from"../../../../../hooks/useDate/useDate.js";import{useCantineMenu}from"./useCantineMenu.js";import{useMemo,useState}from"react";var DATE_RANGE_IN_DAYS=40,DATE_FORMAT=`YYYY-MM-DD`,addDays=(date,days)=>{let shifted=new Date(date);return shifted.setDate(shifted.getDate()+days),shifted};function useCantineModal(schools,defaultSchool){let{formatDate}=useDate(),[schoolId,setSchoolId]=useState(),[menuType,setMenuType]=useState(`lunch`),[date,setDate]=useState(()=>formatDate(new Date,DATE_FORMAT)),{minDate,maxDate}=useMemo(()=>{let today=new Date;return{minDate:formatDate(addDays(today,-40),DATE_FORMAT),maxDate:formatDate(addDays(today,DATE_RANGE_IN_DAYS),DATE_FORMAT)}},[formatDate]),selectedSchool=schools.find(school=>school.id===schoolId)??defaultSchool,menu=useCantineMenu(selectedSchool?.UAI??``,date,menuType),shiftDate=days=>setDate(current=>formatDate(addDays(new Date(`${current}T00:00:00`),days),DATE_FORMAT));return{schools,selectedSchool,onSchoolChange:setSchoolId,hasDinner:menu.dinnerAvailable,menuType:menu.menuType,onMenuTypeChange:setMenuType,date,canGoPrevious:date>minDate,canGoNext:date<maxDate,onPreviousDay:()=>shiftDate(-1),onNextDay:()=>shiftDate(1),sections:menu.sections,status:menu.status}}export{useCantineModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import SvgIconExternalLink from"../../../icons/components/IconExternalLink.js";import IconButton from"../../../../components/Button/IconButton.js";import Image from"../../../../components/Image/Image.js";import TextSkeleton from"../../../../components/Skeleton/TextSkeleton.js";import HomeCard from"../HomeCard/HomeCard.js";import EdumalinBadge from"./components/EdumalinBadge.js";import EdumalinPicture from"./components/EdumalinPicture.js";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import
|
|
1
|
+
import SvgIconExternalLink from"../../../icons/components/IconExternalLink.js";import IconButton from"../../../../components/Button/IconButton.js";import Image from"../../../../components/Image/Image.js";import TextSkeleton from"../../../../components/Skeleton/TextSkeleton.js";import HomeCard from"../HomeCard/HomeCard.js";import EdumalinBadge from"./components/EdumalinBadge.js";import EdumalinPicture from"./components/EdumalinPicture.js";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import illuEdumalinError from"@edifice.io/bootstrap/dist/images/homepage/illu-briefme-error.svg";function Edumalin({status,items,error,onItemClick,onEdumalinClick}){let{t}=useTranslation(),isError=status===`connectionError`||status===`loadError`;return jsxs(HomeCard,{variant:`primary`,className:`edumalin`,children:[jsxs(`div`,{className:`edumalin__header`,children:[jsx(`h3`,{className:`edumalin__title`,children:t(`homepage.widget.edumalin.title`)}),jsx(IconButton,{"aria-label":t(`homepage.widget.edumalin.open`),onClick:onEdumalinClick,icon:jsx(SvgIconExternalLink,{}),variant:`ghost`,color:`tertiary`})]}),jsxs(HomeCard.Content,{className:`edumalin__body`,children:[status===`loading`&&jsxs(`div`,{className:`edumalin__loading`,"data-testid":`edumalin-loading`,children:[jsx(TextSkeleton,{size:`lg`,className:`edumalin__loading-item`}),jsx(TextSkeleton,{size:`lg`,className:`edumalin__loading-item`}),jsx(TextSkeleton,{size:`lg`,className:`edumalin__loading-item`})]}),isError&&jsxs(`div`,{className:`edumalin__error`,children:[jsx(Image,{src:illuEdumalinError,alt:``,className:`edumalin__illu`}),jsxs(`p`,{className:`edumalin__message`,children:[jsx(`span`,{className:`edumalin__message-line`,children:t(status===`connectionError`?`homepage.widget.edumalin.error.connection`:`homepage.widget.edumalin.error.load`)}),jsx(`span`,{className:`edumalin__message-line`,children:t(`homepage.widget.edumalin.error.help`)})]})]}),isError&&error&&jsx(`p`,{className:`edumalin__error-code`,children:t(`homepage.widget.edumalin.error.code`,{code:error.code,message:error.message})}),status===`empty`&&jsxs(`div`,{className:`edumalin__empty`,children:[jsx(Image,{src:illuEdumalinError,alt:``,className:`edumalin__illu`}),jsx(`p`,{className:`edumalin__message`,children:t(`homepage.widget.edumalin.empty`)})]}),status===`default`&&jsx(`ul`,{className:`edumalin__list`,children:items.map((item,index)=>jsx(`li`,{children:jsxs(`button`,{type:`button`,className:`edumalin__item`,onClick:()=>onItemClick(item),children:[jsxs(`span`,{className:`edumalin__item-top`,children:[jsx(EdumalinBadge,{typeName:item.type?.name}),jsxs(`span`,{className:`edumalin__item-heading`,children:[jsx(EdumalinPicture,{picture:item.picture}),jsx(`span`,{className:`edumalin__item-title`,children:item.title})]})]}),item.description&&jsx(`span`,{className:`edumalin__item-description`,children:item.description})]})},`${item.title}-${index}`))})]})]})}export{Edumalin as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.13-develop-b2school.
|
|
3
|
+
"version": "2.6.13-develop-b2school.20261110182412",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -134,9 +134,9 @@
|
|
|
134
134
|
"swiper": "10.1.0",
|
|
135
135
|
"ua-parser-js": "1.0.36",
|
|
136
136
|
"zustand": "4.5.7",
|
|
137
|
-
"@edifice.io/bootstrap": "2.6.13-develop-b2school.
|
|
138
|
-
"@edifice.io/
|
|
139
|
-
"@edifice.io/
|
|
137
|
+
"@edifice.io/bootstrap": "2.6.13-develop-b2school.20261110182412",
|
|
138
|
+
"@edifice.io/tiptap-extensions": "2.6.13-develop-b2school.20261110182412",
|
|
139
|
+
"@edifice.io/utilities": "2.6.13-develop-b2school.20261110182412"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
142
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -166,8 +166,8 @@
|
|
|
166
166
|
"typescript-eslint": "8.54.0",
|
|
167
167
|
"vite": "8.0.14",
|
|
168
168
|
"vite-plugin-dts": "4.5.4",
|
|
169
|
-
"@edifice.io/
|
|
170
|
-
"@edifice.io/
|
|
169
|
+
"@edifice.io/config": "2.6.13-develop-b2school.20261110182412",
|
|
170
|
+
"@edifice.io/client": "2.6.13-develop-b2school.20261110182412"
|
|
171
171
|
},
|
|
172
172
|
"peerDependencies": {
|
|
173
173
|
"@react-spring/web": "9.7.5",
|