@edifice.io/react 2.6.14-develop-b2school.20261116134947 → 2.6.14-develop-enabling.20261117173453
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/components/SearchBar/SearchBar.js +1 -1
- package/dist/homepage.js +1 -1
- package/dist/hooks/useBackground/useBackground.d.ts +2 -6
- package/dist/hooks/useBackground/useBackground.js +1 -1
- package/dist/hooks/useUpload/useUpload.js +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/homepage/components/BriefMe/BriefMe.js +1 -1
- package/dist/modules/homepage/components/Cantine/CantineModal.js +1 -1
- package/dist/modules/homepage/components/Edumalin/Edumalin.js +1 -1
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +1 -1
- package/dist/modules/homepage/components/Header/Header.js +1 -1
- package/dist/modules/homepage/components/LastInfos/LastInfosList.js +1 -1
- package/dist/modules/homepage/components/Notifications/NotificationList.js +1 -1
- package/dist/modules/homepage/components/Qwant/Qwant.d.ts +1 -2
- package/dist/modules/homepage/components/Qwant/Qwant.js +1 -1
- package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +0 -1
- package/dist/modules/homepage/components/Qwant/QwantContainer.js +1 -1
- package/dist/modules/homepage/components/Rss/RssFeedForm.js +1 -1
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.js +1 -1
- package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.js +1 -1
- package/dist/modules/homepage/components/Universalis/Universalis.d.ts +1 -2
- package/dist/modules/homepage/components/Universalis/Universalis.js +1 -1
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +1 -1
- package/dist/modules/homepage/components/UsefulLinks/LinkForm.js +1 -1
- package/dist/modules/homepage/components/index.d.ts +0 -3
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.d.ts +0 -2
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js +1 -1
- package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js +1 -1
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.d.ts +0 -1
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js +1 -1
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.d.ts +0 -6
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js +1 -1
- package/dist/modules/multimedia/VideoRecorder/VideoRecorderToolbar.js +1 -1
- package/dist/modules/multimedia/VideoRecorder/useCameras.d.ts +0 -2
- package/dist/modules/multimedia/VideoRecorder/useCameras.js +1 -1
- package/dist/modules/multimedia/Workspace/Workspace.js +1 -1
- package/dist/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js +1 -1
- package/package.json +6 -6
- package/dist/modules/homepage/components/Captation/CaptationAudio/CaptationAudio.d.ts +0 -7
- package/dist/modules/homepage/components/Captation/CaptationAudio/CaptationAudio.js +0 -1
- package/dist/modules/homepage/components/Captation/CaptationVideo/CaptationVideo.d.ts +0 -9
- package/dist/modules/homepage/components/Captation/CaptationVideo/CaptationVideo.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/CarnetDeBord.d.ts +0 -9
- package/dist/modules/homepage/components/CarnetDeBord/CarnetDeBord.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/CarnetDeBordCategoryRow.d.ts +0 -17
- package/dist/modules/homepage/components/CarnetDeBord/CarnetDeBordCategoryRow.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/CarnetDeBordContainer.d.ts +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/CarnetDeBordContainer.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/CarnetDeBordError.d.ts +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/CarnetDeBordError.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/CarnetDeBordModal.d.ts +0 -13
- package/dist/modules/homepage/components/CarnetDeBord/CarnetDeBordModal.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/categoryConfig.d.ts +0 -13
- package/dist/modules/homepage/components/CarnetDeBord/categoryConfig.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/hooks/useCarnetDeBordContainer.d.ts +0 -14
- package/dist/modules/homepage/components/CarnetDeBord/hooks/useCarnetDeBordContainer.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/index.d.ts +0 -6
- package/dist/modules/homepage/components/CarnetDeBord/services/api/carnetDeBordService.d.ts +0 -16
- package/dist/modules/homepage/components/CarnetDeBord/services/api/carnetDeBordService.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/services/api/index.d.ts +0 -3
- package/dist/modules/homepage/components/CarnetDeBord/services/api/index.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/services/queries/carnetDeBord.d.ts +0 -11
- package/dist/modules/homepage/components/CarnetDeBord/services/queries/carnetDeBord.js +0 -1
- package/dist/modules/homepage/components/CarnetDeBord/types.d.ts +0 -37
- package/dist/modules/homepage/components/CarnetDeBord/utils.d.ts +0 -14
- package/dist/modules/homepage/components/CarnetDeBord/utils.js +0 -1
- package/dist/modules/homepage/components/Mediacentre/Mediacentre.d.ts +0 -13
- package/dist/modules/homepage/components/Mediacentre/Mediacentre.js +0 -1
- package/dist/modules/homepage/components/Mediacentre/MediacentreContainer.d.ts +0 -4
- package/dist/modules/homepage/components/Mediacentre/MediacentreContainer.js +0 -1
- package/dist/modules/homepage/components/Mediacentre/components/MediacentreUniversalisSearch.d.ts +0 -6
- package/dist/modules/homepage/components/Mediacentre/components/MediacentreUniversalisSearch.js +0 -1
- package/dist/modules/homepage/components/Mediacentre/hooks/useMediacentre.d.ts +0 -17
- package/dist/modules/homepage/components/Mediacentre/hooks/useMediacentre.js +0 -1
- package/dist/modules/homepage/components/Mediacentre/index.d.ts +0 -5
- package/dist/modules/homepage/components/Mediacentre/services/mediacentreService.d.ts +0 -24
- package/dist/modules/homepage/components/Mediacentre/services/mediacentreService.js +0 -1
- package/dist/modules/homepage/components/Mediacentre/types.d.ts +0 -8
- package/dist/modules/homepage/components/Tools/CreateDocumentModal.d.ts +0 -12
- package/dist/modules/homepage/components/Tools/CreateDocumentModal.js +0 -1
- package/dist/modules/homepage/components/Tools/Tools.d.ts +0 -17
- package/dist/modules/homepage/components/Tools/Tools.js +0 -1
- package/dist/modules/homepage/components/Tools/ToolsContainer.d.ts +0 -18
- package/dist/modules/homepage/components/Tools/ToolsContainer.js +0 -1
- package/dist/modules/homepage/components/Tools/index.d.ts +0 -4
- package/dist/modules/homepage/components/Tools/utils.d.ts +0 -8
- package/dist/modules/homepage/components/Tools/utils.js +0 -1
- /package/dist/node_modules/.pnpm/{prosemirror-transform@1.12.5 → prosemirror-transform@1.12.6}/node_modules/prosemirror-transform/dist/index.js +0 -0
package/dist/modules/homepage/components/Mediacentre/components/MediacentreUniversalisSearch.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const UNIVERSALIS_HOME_URL = "http://www.universalis-edu.com";
|
|
2
|
-
export declare const UNIVERSALIS_SEARCH_URL = "https://www.universalis-edu.com/nomade/precherche/";
|
|
3
|
-
export interface MediacentreUniversalisSearchProps {
|
|
4
|
-
uai?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function MediacentreUniversalisSearch({ uai, }: MediacentreUniversalisSearchProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/modules/homepage/components/Mediacentre/components/MediacentreUniversalisSearch.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import SearchBar from"../../../../../components/SearchBar/SearchBar.js";import{useState}from"react";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import illuUniversalis from"@edifice.io/bootstrap/dist/images/homepage/illu-universalis-logo.svg";var UNIVERSALIS_HOME_URL=`http://www.universalis-edu.com`,UNIVERSALIS_SEARCH_URL=`https://www.universalis-edu.com/nomade/precherche/`,UNIVERSALIS_ENGINE_PARAM=`www`;function MediacentreUniversalisSearch({uai}){let{t}=useTranslation(),[query,setQuery]=useState(``),disabled=!uai,placeholder=t(disabled?`homepage.widget.mediacentre.universalis.noUai`:`homepage.widget.mediacentre.universalis.search`);return jsxs(`div`,{className:`mediacentre__universalis`,children:[jsx(`a`,{href:UNIVERSALIS_HOME_URL,target:`_blank`,rel:`noopener noreferrer`,className:`mediacentre__universalis-logo`,"data-testid":`mediacentre-universalis-link`,children:jsx(`img`,{src:illuUniversalis,alt:`Universalis Éducation`})}),jsx(SearchBar,{isVariant:!1,id:`mediacentre-universalis-search-input`,className:`mediacentre__universalis-search`,placeholder,"aria-label":placeholder,value:query,onChange:event=>setQuery(event.target.value),onClick:()=>{if(!uai||!query.trim())return;let params=new URLSearchParams({r:UNIVERSALIS_ENGINE_PARAM,uai,q:query.trim()});window.open(`${UNIVERSALIS_SEARCH_URL}?${params.toString()}`,`_blank`,`noopener,noreferrer`)},disabled,maxLength:255,"data-testid":`mediacentre-universalis-search-input`})]})}export{MediacentreUniversalisSearch};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const mediacentreQueryKeys: {
|
|
2
|
-
all: () => readonly ["mediacentre"];
|
|
3
|
-
favorites: () => readonly ["mediacentre", "favorites"];
|
|
4
|
-
};
|
|
5
|
-
export declare const mediacentreQueryOptions: {
|
|
6
|
-
getFavorites(): import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<import('..').MediacentreResource[], Error, import('..').MediacentreResource[], import('@tanstack/react-query').QueryKey>, "queryFn"> & {
|
|
7
|
-
queryFn?: import('@tanstack/react-query').QueryFunction<import('..').MediacentreResource[], import('@tanstack/react-query').QueryKey, never> | undefined;
|
|
8
|
-
} & {
|
|
9
|
-
queryKey: import('@tanstack/react-query').DataTag<import('@tanstack/react-query').QueryKey, import('..').MediacentreResource[]>;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare function useMediacentre(): {
|
|
13
|
-
resources: import('..').MediacentreResource[];
|
|
14
|
-
isLoading: boolean;
|
|
15
|
-
isError: boolean;
|
|
16
|
-
uai: string | undefined;
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import useSession from"../../../../../hooks/useSession/useSession.js";import{mediacentreService}from"../services/mediacentreService.js";import{queryOptions,useQuery}from"@tanstack/react-query";var STALE_TIME=300*1e3,mediacentreQueryKeys={all:()=>[`mediacentre`],favorites:()=>[...mediacentreQueryKeys.all(),`favorites`]},mediacentreQueryOptions={getFavorites(){return queryOptions({queryKey:mediacentreQueryKeys.favorites(),queryFn:()=>mediacentreService.getFavorites(),staleTime:STALE_TIME})}};function useMediacentre(){let{data:session}=useSession(),favoritesQuery=useQuery(mediacentreQueryOptions.getFavorites());return{resources:favoritesQuery.data??[],isLoading:favoritesQuery.isLoading,isError:favoritesQuery.isError,uai:session?.userDescription?.schools?.[0]?.UAI}}export{mediacentreQueryKeys,mediacentreQueryOptions,useMediacentre};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MediacentreResource } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a service for the homepage "Médiacentre" widget, on top of the
|
|
4
|
-
* `mediacentre` backend module.
|
|
5
|
-
*
|
|
6
|
-
* Backend contract:
|
|
7
|
-
* - `GET /mediacentre/favorites` returns `{ status, data }`. A user who never
|
|
8
|
-
* selected a favorite gets `data: {}` (state "initialization"), which is an
|
|
9
|
-
* empty list and not an error.
|
|
10
|
-
*
|
|
11
|
-
* @param baseURL The base URL for the mediacentre service API.
|
|
12
|
-
*/
|
|
13
|
-
export declare const createMediacentreService: (baseURL: string) => {
|
|
14
|
-
/**
|
|
15
|
-
* Get the current user's favorite resources.
|
|
16
|
-
*/
|
|
17
|
-
getFavorites(): Promise<MediacentreResource[]>;
|
|
18
|
-
};
|
|
19
|
-
export declare const mediacentreService: {
|
|
20
|
-
/**
|
|
21
|
-
* Get the current user's favorite resources.
|
|
22
|
-
*/
|
|
23
|
-
getFavorites(): Promise<MediacentreResource[]>;
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{odeServices}from"@edifice.io/client";function toResource(signet){return{id:signet._id,title:signet.title,subtitle:signet.plain_text||void 0,href:signet.link||signet.url||``,imageUrl:signet.image||void 0}}var mediacentreService=(baseURL=>({async getFavorites(){let http=odeServices.http(),body=await http.get(`${baseURL}/mediacentre/favorites`);if(http.isResponseError()||body?.status!==`ok`)throw Error(`mediacentre.favorites.fetch.error`);return Array.isArray(body.data)?body.data.map(toResource):[]}}))(``);export{mediacentreService};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { OfficeToolType } from './Tools';
|
|
2
|
-
export interface CreateDocumentModalProps {
|
|
3
|
-
/** Document type selected when the modal opens. */
|
|
4
|
-
defaultType: OfficeToolType;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
/**
|
|
7
|
-
* Called on submit with the chosen type and trimmed name.
|
|
8
|
-
* Called synchronously from the click, so it can safely open a new tab.
|
|
9
|
-
*/
|
|
10
|
-
onCreate: (type: OfficeToolType, name: string) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function CreateDocumentModal({ defaultType, onClose, onCreate, }: CreateDocumentModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import ButtonBeta from"../../../../components/ButtonBeta/ButtonBeta.js";import Input from"../../../../components/Input/Input.js";import Label from"../../../../components/Label/Label.js";import FormControl from"../../../../components/Form/FormControl.js";import ModalBeta from"../../../../components/ModalBeta/ModalBeta.js";import RadioCard from"../../../../components/RadioCard/RadioCard.js";import{useState}from"react";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";var OFFICE_TOOLS=[`word`,`powerpoint`,`excel`];function CreateDocumentModal({defaultType,onClose,onCreate}){let{t}=useTranslation(),[type,setType]=useState(defaultType),[name,setName]=useState(``),trimmedName=name.trim();return jsxs(ModalBeta,{id:`create-document-modal`,size:`xl`,isOpen:!0,onModalClose:onClose,children:[jsx(ModalBeta.Header,{onModalClose:onClose,children:t(`homepage.tools.modal.title`)}),jsx(ModalBeta.Body,{children:jsxs(`form`,{id:`create-document-form`,className:`tools-modal-form`,onSubmit:event=>{event.preventDefault(),trimmedName&&onCreate(type,trimmedName)},children:[jsx(`div`,{className:`tools-modal-types`,children:OFFICE_TOOLS.map(tool=>jsx(RadioCard,{groupName:`create-document-type`,value:tool,label:t(`homepage.tools.modal.type.${tool}`),description:t(`homepage.tools.modal.description.${tool}`),selectedValue:type,onChange:()=>setType(tool)},tool))}),jsxs(FormControl,{id:`create-document-name`,isRequired:!0,children:[jsx(Label,{children:t(`homepage.tools.modal.name`)}),jsx(Input,{type:`text`,size:`md`,value:name,onChange:event=>setName(event.target.value),placeholder:t(`homepage.tools.modal.name.placeholder`),"data-testid":`homepage-tools-create-document-name-input`})]})]})}),jsx(ModalBeta.Footer,{children:jsxs(`div`,{children:[jsx(ButtonBeta,{type:`button`,variant:`ghost`,color:`tertiary`,onClick:onClose,"data-testid":`homepage-tools-create-document-cancel-button`,children:t(`homepage.tools.modal.cancel`)}),jsx(ButtonBeta,{type:`submit`,form:`create-document-form`,disabled:!trimmedName,"data-testid":`homepage-tools-create-document-create-button`,children:t(`homepage.tools.modal.create`)})]})})]})}export{CreateDocumentModal};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { WorkspaceElement } from '@edifice.io/client';
|
|
2
|
-
export type OfficeToolType = 'word' | 'powerpoint' | 'excel';
|
|
3
|
-
export type CaptationToolType = 'video' | 'audio';
|
|
4
|
-
export type ToolType = OfficeToolType | CaptationToolType;
|
|
5
|
-
export declare const DEFAULT_TOOLS: ToolType[];
|
|
6
|
-
export interface ToolsProps {
|
|
7
|
-
/** Tools to display, in order. Defaults to every available tool. */
|
|
8
|
-
tools?: ToolType[];
|
|
9
|
-
/**
|
|
10
|
-
* Callback invoked when an office tool (word, powerpoint, excel) is clicked.
|
|
11
|
-
* Captation tools (video, audio) open their own recording modal instead.
|
|
12
|
-
*/
|
|
13
|
-
onOfficeToolClick?: (tool: OfficeToolType) => void;
|
|
14
|
-
/** Callback invoked once a video or audio record has been saved. */
|
|
15
|
-
onCaptationSaveSuccess?: (tool: CaptationToolType, resource: WorkspaceElement) => void;
|
|
16
|
-
}
|
|
17
|
-
export declare function Tools({ tools, onOfficeToolClick, onCaptationSaveSuccess, }: ToolsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import Flex from"../../../../components/Flex/Flex.js";import Tooltip from"../../../../components/Tooltip/Tooltip.js";import HomeCard from"../HomeCard/HomeCard.js";import{CaptationAudio}from"../Captation/CaptationAudio/CaptationAudio.js";import{CaptationVideo}from"../Captation/CaptationVideo/CaptationVideo.js";import{useState}from"react";import{Fragment as Fragment$1,jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import iconExcel from"@edifice.io/bootstrap/dist/images/homepage/tools/excel.svg";import iconPowerpoint from"@edifice.io/bootstrap/dist/images/homepage/tools/powerpoint.svg";import iconStudioAudio from"@edifice.io/bootstrap/dist/images/homepage/tools/studio-audio.svg";import iconStudioVideo from"@edifice.io/bootstrap/dist/images/homepage/tools/studio-video.svg";import iconWord from"@edifice.io/bootstrap/dist/images/homepage/tools/word.svg";var TOOL_ICONS={word:iconWord,powerpoint:iconPowerpoint,excel:iconExcel,video:iconStudioVideo,audio:iconStudioAudio},DEFAULT_TOOLS=[`word`,`powerpoint`,`excel`,`video`,`audio`],isCaptationTool=tool=>tool===`video`||tool===`audio`;function Tools({tools=DEFAULT_TOOLS,onOfficeToolClick,onCaptationSaveSuccess}){let{t}=useTranslation(),[openedCaptation,setOpenedCaptation]=useState(null),handleToolClick=tool=>{isCaptationTool(tool)?setOpenedCaptation(tool):onOfficeToolClick?.(tool)},handleCaptationClose=()=>setOpenedCaptation(null);return tools.length===0?null:jsxs(Fragment$1,{children:[jsxs(HomeCard,{variant:`secondary`,children:[jsx(HomeCard.Header,{title:t(`homepage.tools.title`)}),jsx(HomeCard.Content,{children:jsx(`div`,{className:`tools-content`,children:jsx(Flex,{wrap:`wrap`,gap:`12`,children:tools.map(tool=>{let label=t(`homepage.tools.${tool}`);return jsx(Tooltip,{message:t(`homepage.tools.tooltip.${tool}`),placement:`top`,children:jsx(`button`,{type:`button`,className:`tools-item`,"aria-label":label,onClick:()=>handleToolClick(tool),"data-testid":`homepage-tools-${tool}-button`,children:jsx(`img`,{src:TOOL_ICONS[tool],alt:``,width:40,height:40})})},tool)})})})})]}),openedCaptation===`video`&&jsx(CaptationVideo,{isOpen:!0,onClose:handleCaptationClose,onSaveSuccess:resource=>onCaptationSaveSuccess?.(`video`,resource)}),openedCaptation===`audio`&&jsx(CaptationAudio,{isOpen:!0,onClose:handleCaptationClose,onSaveSuccess:resource=>onCaptationSaveSuccess?.(`audio`,resource)})]})}export{DEFAULT_TOOLS,Tools};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ToolsProps, ToolType } from './Tools';
|
|
2
|
-
export declare const LOOL_CREATE_DOCUMENT_WORKFLOW = "fr.openent.lool.controller.LoolController|createDocumentFromTemplate";
|
|
3
|
-
export declare const VIDEO_CAPTURE_WORKFLOW = "com.opendigitaleducation.video.controllers.VideoController|capture";
|
|
4
|
-
export declare const WORKSPACE_ADD_DOCUMENT_WORKFLOW = "org.entcore.workspace.controllers.WorkspaceController|addDocument";
|
|
5
|
-
export interface ToolsContainerProps {
|
|
6
|
-
/**
|
|
7
|
-
* Tools to display, in order. Each tool is hidden without its right:
|
|
8
|
-
* LOOL document creation for office tools, video capture for video,
|
|
9
|
-
* workspace add document for audio.
|
|
10
|
-
*/
|
|
11
|
-
tools?: ToolType[];
|
|
12
|
-
/** Callback invoked once a video or audio record has been saved. */
|
|
13
|
-
onCaptationSaveSuccess?: ToolsProps['onCaptationSaveSuccess'];
|
|
14
|
-
}
|
|
15
|
-
export declare function ToolsContainer({ tools, onCaptationSaveSuccess, }: ToolsContainerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
-
export declare namespace ToolsContainer {
|
|
17
|
-
var displayName: string;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import useHasWorkflow from"../../../../hooks/useHasWorkflow/useHasWorkflow.js";import{CreateDocumentModal}from"./CreateDocumentModal.js";import{DEFAULT_TOOLS,Tools}from"./Tools.js";import{buildLoolCreateUrl}from"./utils.js";import{useState}from"react";import{Fragment as Fragment$1,jsx,jsxs}from"react/jsx-runtime";var LOOL_CREATE_DOCUMENT_WORKFLOW=`fr.openent.lool.controller.LoolController|createDocumentFromTemplate`,VIDEO_CAPTURE_WORKFLOW=`com.opendigitaleducation.video.controllers.VideoController|capture`,WORKSPACE_ADD_DOCUMENT_WORKFLOW=`org.entcore.workspace.controllers.WorkspaceController|addDocument`,TOOL_WORKFLOWS=[LOOL_CREATE_DOCUMENT_WORKFLOW,VIDEO_CAPTURE_WORKFLOW,WORKSPACE_ADD_DOCUMENT_WORKFLOW],CAPTATION_TOOL_WORKFLOWS={video:VIDEO_CAPTURE_WORKFLOW,audio:WORKSPACE_ADD_DOCUMENT_WORKFLOW},isOfficeTool=tool=>tool===`word`||tool===`powerpoint`||tool===`excel`;function ToolsContainer({tools=DEFAULT_TOOLS,onCaptationSaveSuccess}){let rights=useHasWorkflow(TOOL_WORKFLOWS),[modalType,setModalType]=useState(null),visibleTools=tools.filter(tool=>!!rights?.[isOfficeTool(tool)?LOOL_CREATE_DOCUMENT_WORKFLOW:CAPTATION_TOOL_WORKFLOWS[tool]]);return visibleTools.length===0?null:jsxs(Fragment$1,{children:[jsx(Tools,{tools:visibleTools,onOfficeToolClick:setModalType,onCaptationSaveSuccess}),modalType&&jsx(CreateDocumentModal,{defaultType:modalType,onClose:()=>setModalType(null),onCreate:(type,name)=>{window.open(buildLoolCreateUrl(type,name),`_blank`),setModalType(null)}})]})}export{LOOL_CREATE_DOCUMENT_WORKFLOW,ToolsContainer,VIDEO_CAPTURE_WORKFLOW,WORKSPACE_ADD_DOCUMENT_WORKFLOW};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { OfficeToolType } from './Tools';
|
|
2
|
-
/**
|
|
3
|
-
* Build the URL creating an office document with the LOOL connector.
|
|
4
|
-
*
|
|
5
|
-
* The connector creates the document in the user's workspace, then redirects
|
|
6
|
-
* to its edition page: open it in a new tab.
|
|
7
|
-
*/
|
|
8
|
-
export declare const buildLoolCreateUrl: (type: OfficeToolType, name: string) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var LOOL_CREATE_DOCUMENT_PATH=`/lool/document`,OFFICE_TOOL_EXTENSIONS={word:`docx`,powerpoint:`pptx`,excel:`xlsx`},FORBIDDEN_NAME_CHARS=/[/\\<>|]/g,buildLoolCreateUrl=(type,name)=>`${LOOL_CREATE_DOCUMENT_PATH}?${new URLSearchParams({type:OFFICE_TOOL_EXTENSIONS[type],name:name.trim().replace(FORBIDDEN_NAME_CHARS,``),protected:`false`}).toString()}`;export{buildLoolCreateUrl};
|