jamespot-react-core 1.3.42 → 1.3.44

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,4 +1,6 @@
1
+ import jApi from 'jamespot-user-api';
1
2
  import { UseFormReturn } from 'react-hook-form';
3
+ import { QueuedFunction } from '../../hooks/useAsyncQueue';
2
4
  export type CreateCalendarEventModalProps = {
3
5
  open: boolean;
4
6
  closeHandler: () => void;
@@ -13,5 +15,7 @@ export type CreateCalendarEventModalProps = {
13
15
  isValid: boolean;
14
16
  offsetTop?: number | string;
15
17
  fixed?: boolean;
18
+ onDraftSaved: (idDraft: string) => void;
19
+ addToDraftQueue: (fn: QueuedFunction<Awaited<ReturnType<typeof jApi.article.saveAsDraft>>>) => ReturnType<typeof jApi.article.saveAsDraft>;
16
20
  };
17
- export declare const CreateCalendarEventModal: ({ open, closeHandler, onSubmit, onSchedule, children, form, uploadLoading, type, scheduleLoading, publishLoading, isValid, offsetTop, fixed, }: CreateCalendarEventModalProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const CreateCalendarEventModal: ({ open, closeHandler, onSubmit, onSchedule, children, form, uploadLoading, type, scheduleLoading, publishLoading, isValid, offsetTop, fixed, onDraftSaved, addToDraftQueue, }: CreateCalendarEventModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
- import { EventMode, jObjectLittle } from 'jamespot-user-api';
1
+ import jApi, { EventMode, jObjectLittle } from 'jamespot-user-api';
2
2
  import { useForm } from 'react-hook-form';
3
3
  import { SocialEventOrRecurringEventFormValues } from './types';
4
+ import { QueuedFunction } from '../../../hooks/useAsyncQueue';
4
5
  type HookParams = {
5
6
  onCreate: (event: jObjectLittle) => void;
6
7
  defaultDateSelection?: {
@@ -15,6 +16,7 @@ type HookParams = {
15
16
  eventMode: EventMode;
16
17
  idSpot?: number;
17
18
  idDraft?: number;
19
+ addToDraftQueue: (fn: QueuedFunction<Awaited<ReturnType<typeof jApi.article.saveAsDraft>>>) => ReturnType<typeof jApi.article.saveAsDraft>;
18
20
  };
19
21
  type HookReturn = {
20
22
  form: ReturnType<typeof useForm<SocialEventOrRecurringEventFormValues>>;
@@ -27,5 +29,5 @@ type HookReturn = {
27
29
  schedule: (scheduleDate: string, permalinkId: string) => void;
28
30
  loading: boolean;
29
31
  };
30
- export declare const useSocialEventOrRecurringEventCreationHook: ({ onCreate, defaultDateSelection, open, onSchedule: doOnSchedule, defaultValues, visioMode, eventMode, idSpot, idDraft, }: HookParams) => HookReturn;
32
+ export declare const useSocialEventOrRecurringEventCreationHook: ({ onCreate, defaultDateSelection, open, onSchedule: doOnSchedule, defaultValues, visioMode, eventMode, idSpot, idDraft, addToDraftQueue, }: HookParams) => HookReturn;
31
33
  export {};
@@ -4,6 +4,7 @@ import { useSocialEventUpdateHook } from '../components/calendar/socialEvent/use
4
4
  import { useAbortController } from './useAbortController';
5
5
  import { useActivities } from './useActivities';
6
6
  import { useApplication } from './useApplication';
7
+ import { useAsyncQueue } from './useAsyncQueue';
7
8
  import { useCommentRT } from './useCommentRT';
8
9
  import { useHref } from './useHref';
9
10
  import { useIsEllipsed } from './useIsEllipsed';
@@ -12,4 +13,4 @@ import { useMessengerUnread } from './useMessengerUnread';
12
13
  import { useNGEvent } from './useNGEvent';
13
14
  import { useToggleFullScreen } from './useToggleFullScreen';
14
15
  import { useWindowDimension } from './useWindowDimension';
15
- export { useAbortController, useActivities, useApplication, useCommentRT, useHref, useIsEllipsed, useLayout, useMessengerUnread, useNGEvent, useRecurringEventUpdateHook, useSocialEventOrRecurringEventCreationHook, useSocialEventUpdateHook, useToggleFullScreen, useWindowDimension, };
16
+ export { useAbortController, useActivities, useApplication, useAsyncQueue, useCommentRT, useHref, useIsEllipsed, useLayout, useMessengerUnread, useNGEvent, useRecurringEventUpdateHook, useSocialEventOrRecurringEventCreationHook, useSocialEventUpdateHook, useToggleFullScreen, useWindowDimension, };
@@ -0,0 +1,6 @@
1
+ export type QueuedFunction<T> = (args: {
2
+ prevResult?: T;
3
+ }) => Promise<T>;
4
+ export declare const useAsyncQueue: <T>() => {
5
+ addToQueue: (fn: QueuedFunction<T>) => Promise<T>;
6
+ };
@@ -85,6 +85,7 @@ declare const mapping: {
85
85
  InputSelectHierarchicalTree: "JRCInputSelectHierarchicalTree";
86
86
  InputSelectList: "JRCInputSelectList";
87
87
  InputSelectRaw: "JRCInputSelectRaw";
88
+ InputSimpleFile: "JRCInputSimpleFile";
88
89
  InputText: "JRCInputText";
89
90
  InputTextarea: "JRCInputTextarea";
90
91
  InputTextareaRaw: "JRCInputTextareaRaw";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-core",
3
- "version": "1.3.42",
3
+ "version": "1.3.44",
4
4
  "description": "Jamespot React Core",
5
5
  "main": "./build/app.bundle.js",
6
6
  "types": "./build/src/App.d.ts",
@@ -38,9 +38,9 @@
38
38
  "fork-ts-checker-webpack-plugin": "^9.1.0",
39
39
  "history": "^5.3.0",
40
40
  "husky": "^9.1.7",
41
- "jamespot-front-business": "^1.3.42",
42
- "jamespot-react-components": "^1.3.42",
43
- "jamespot-user-api": "^1.3.42",
41
+ "jamespot-front-business": "^1.3.44",
42
+ "jamespot-react-components": "^1.3.44",
43
+ "jamespot-user-api": "^1.3.44",
44
44
  "jest": "^30.2.0",
45
45
  "jest-environment-jsdom": "^30.2.0",
46
46
  "knip": "^5.70.0",