@schedule-x/react
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -47,11 +47,11 @@ 'use strict'; | ||
function useCalendarApp(config) { | ||
const [calendarApp] = react.useState(() => calendar.createCalendar(config)); | ||
function useCalendarApp(config, plugins) { | ||
const [calendarApp] = react.useState(() => calendar.createCalendar(config, plugins || [])); | ||
return calendarApp; | ||
} | ||
function useNextCalendarApp(config) { | ||
function useNextCalendarApp(config, plugins) { | ||
const [calendarApp, setCalendarApp] = react.useState(); | ||
react.useEffect(() => { | ||
if (typeof window !== 'undefined') { | ||
setCalendarApp(calendar.createCalendar(config)); | ||
setCalendarApp(calendar.createCalendar(config, plugins || [])); | ||
} | ||
@@ -58,0 +58,0 @@ }, []); |
@@ -45,11 +45,11 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime'; | ||
function useCalendarApp(config) { | ||
const [calendarApp] = useState(() => createCalendar(config)); | ||
function useCalendarApp(config, plugins) { | ||
const [calendarApp] = useState(() => createCalendar(config, plugins || [])); | ||
return calendarApp; | ||
} | ||
function useNextCalendarApp(config) { | ||
function useNextCalendarApp(config, plugins) { | ||
const [calendarApp, setCalendarApp] = useState(); | ||
useEffect(() => { | ||
if (typeof window !== 'undefined') { | ||
setCalendarApp(createCalendar(config)); | ||
setCalendarApp(createCalendar(config, plugins || [])); | ||
} | ||
@@ -56,0 +56,0 @@ }, []); |
import { CalendarApp, CalendarConfig } from '@schedule-x/calendar'; | ||
export declare function useCalendarApp(config: CalendarConfig): CalendarApp; | ||
export declare function useNextCalendarApp(config: CalendarConfig): CalendarApp | undefined; | ||
import { PluginBase } from '@schedule-x/shared'; | ||
export declare function useCalendarApp<Plugins extends PluginBase<string>[]>(config: CalendarConfig, plugins?: Plugins): CalendarApp & { [Name in Plugins[number]["name"]]: Extract<Plugins[number], { | ||
name: Name; | ||
}>; }; | ||
export declare function useNextCalendarApp<Plugins extends PluginBase<string>[]>(config: CalendarConfig, plugins?: Plugins): CalendarApp | undefined; |
@@ -18,3 +18,3 @@ { | ||
"types": "dist/types/index.d.ts", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"type": "module", | ||
@@ -35,3 +35,3 @@ "files": [ | ||
"peerDependencies": { | ||
"@schedule-x/calendar": "^2.0.0", | ||
"@schedule-x/calendar": "^2.2.1", | ||
"react": "^16.7.0 || ^17 || ^18", | ||
@@ -45,7 +45,10 @@ "react-dom": "^16.7.0 || ^17 || ^18" | ||
"@rollup/plugin-typescript": "^11.1.5", | ||
"@schedule-x/drag-and-drop": "^2.0.0", | ||
"@schedule-x/e2e-testing": "^2.0.0", | ||
"@schedule-x/eslint-config": "^2.0.0", | ||
"@schedule-x/event-modal": "^2.0.0", | ||
"@schedule-x/prettier-config": "^2.0.0", | ||
"@schedule-x/calendar-controls": "^2.2.1", | ||
"@schedule-x/drag-and-drop": "^2.2.1", | ||
"@schedule-x/e2e-testing": "^2.2.1", | ||
"@schedule-x/eslint-config": "^2.2.1", | ||
"@schedule-x/event-modal": "^2.2.1", | ||
"@schedule-x/events-service": "^2.2.1", | ||
"@schedule-x/prettier-config": "^2.2.1", | ||
"@schedule-x/shared": "^2.2.1", | ||
"@schedule-x/theme-default": "^2.0.0", | ||
@@ -69,3 +72,3 @@ "@semantic-release/changelog": "^6.0.3", | ||
"semantic-release": "^24.0.0", | ||
"typescript": "^5.2.2", | ||
"typescript": "^5.6.2", | ||
"vite": "^5.0.8" | ||
@@ -72,0 +75,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13414
208
32