@inventreedb/ui 0.0.5 → 0.0.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.
@@ -35,6 +35,8 @@ export type InvenTreeFormsContext = {
35
35
  * @param model - The model type associated with the rendered component (if applicable)
36
36
  * @param id - The ID (primary key) of the model instance for the plugin (if applicable)
37
37
  * @param instance - The model instance data (if available)
38
+ * @param reloadContent - A function which can be called to reload the plugin content
39
+ * @param reloadInstance - A function which can be called to reload the model instance
38
40
  * @param context - Any additional context data which may be passed to the plugin
39
41
  */
40
42
  export type InvenTreePluginContext = {
@@ -53,6 +55,8 @@ export type InvenTreePluginContext = {
53
55
  model?: ModelType | string;
54
56
  id?: string | number | null;
55
57
  instance?: any;
58
+ reloadContent?: () => void;
59
+ reloadInstance?: () => void;
56
60
  context?: any;
57
61
  };
58
62
  export declare const INVENTREE_PLUGIN_VERSION: string;
@@ -1,4 +1,4 @@
1
- const INVENTREE_PLUGIN_VERSION = "0.0.5";
1
+ const INVENTREE_PLUGIN_VERSION = "0.0.6";
2
2
  export {
3
3
  INVENTREE_PLUGIN_VERSION
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Plugins.js","sources":["../../lib/types/Plugins.tsx"],"sourcesContent":["import type { MantineColorScheme, MantineTheme } from '@mantine/core';\nimport type { QueryClient } from '@tanstack/react-query';\nimport type { AxiosInstance } from 'axios';\nimport type { NavigateFunction } from 'react-router-dom';\nimport type { ModelType } from '../enums/ModelType';\nimport type { ApiFormModalProps, BulkEditApiFormModalProps } from './Forms';\nimport type { UseModalReturn } from './Modals';\nimport type { SettingsStateProps } from './Settings';\nimport type { UserStateProps } from './User';\n\nexport interface PluginProps {\n name: string;\n slug: string;\n version: null | string;\n}\n\nexport type InvenTreeFormsContext = {\n bulkEdit: (props: BulkEditApiFormModalProps) => UseModalReturn;\n create: (props: ApiFormModalProps) => UseModalReturn;\n delete: (props: ApiFormModalProps) => UseModalReturn;\n edit: (props: ApiFormModalProps) => UseModalReturn;\n};\n\n/**\n * A set of properties which are passed to a plugin,\n * for rendering an element in the user interface.\n *\n * @param version - The version of the running InvenTree software stack\n * @param api - The Axios API instance (see ../states/ApiState.tsx)\n * @param user - The current user instance (see ../states/UserState.tsx)\n * @param userSettings - The current user settings (see ../states/SettingsState.tsx)\n * @param globalSettings - The global settings (see ../states/SettingsState.tsx)\n * @param navigate - The navigation function (see react-router-dom)\n * @param theme - The current Mantine theme\n * @param colorScheme - The current Mantine color scheme (e.g. 'light' / 'dark')\n * @param host - The current host URL\n * @param locale - The current locale string (e.g. 'en' / 'de')\n * @param model - The model type associated with the rendered component (if applicable)\n * @param id - The ID (primary key) of the model instance for the plugin (if applicable)\n * @param instance - The model instance data (if available)\n * @param context - Any additional context data which may be passed to the plugin\n */\nexport type InvenTreePluginContext = {\n version: string;\n api: AxiosInstance;\n queryClient: QueryClient;\n user: UserStateProps;\n userSettings: SettingsStateProps;\n globalSettings: SettingsStateProps;\n host: string;\n locale: string;\n navigate: NavigateFunction;\n theme: MantineTheme;\n forms: InvenTreeFormsContext;\n colorScheme: MantineColorScheme;\n model?: ModelType | string;\n id?: string | number | null;\n instance?: any;\n context?: any;\n};\n\n/*\n * The version of the InvenTree plugin context interface.\n * This number should be incremented if the interface changes.\n */\n\n// @ts-ignore\nexport const INVENTREE_PLUGIN_VERSION: string = __INVENTREE_LIB_VERSION__;\n"],"names":["INVENTREE_PLUGIN_VERSION","__INVENTREE_LIB_VERSION__"],"mappings":"AAmEO,MAAMA,2BAAmCC;"}
1
+ {"version":3,"file":"Plugins.js","sources":["../../lib/types/Plugins.tsx"],"sourcesContent":["import type { MantineColorScheme, MantineTheme } from '@mantine/core';\nimport type { QueryClient } from '@tanstack/react-query';\nimport type { AxiosInstance } from 'axios';\nimport type { NavigateFunction } from 'react-router-dom';\nimport type { ModelType } from '../enums/ModelType';\nimport type { ApiFormModalProps, BulkEditApiFormModalProps } from './Forms';\nimport type { UseModalReturn } from './Modals';\nimport type { SettingsStateProps } from './Settings';\nimport type { UserStateProps } from './User';\n\nexport interface PluginProps {\n name: string;\n slug: string;\n version: null | string;\n}\n\nexport type InvenTreeFormsContext = {\n bulkEdit: (props: BulkEditApiFormModalProps) => UseModalReturn;\n create: (props: ApiFormModalProps) => UseModalReturn;\n delete: (props: ApiFormModalProps) => UseModalReturn;\n edit: (props: ApiFormModalProps) => UseModalReturn;\n};\n\n/**\n * A set of properties which are passed to a plugin,\n * for rendering an element in the user interface.\n *\n * @param version - The version of the running InvenTree software stack\n * @param api - The Axios API instance (see ../states/ApiState.tsx)\n * @param user - The current user instance (see ../states/UserState.tsx)\n * @param userSettings - The current user settings (see ../states/SettingsState.tsx)\n * @param globalSettings - The global settings (see ../states/SettingsState.tsx)\n * @param navigate - The navigation function (see react-router-dom)\n * @param theme - The current Mantine theme\n * @param colorScheme - The current Mantine color scheme (e.g. 'light' / 'dark')\n * @param host - The current host URL\n * @param locale - The current locale string (e.g. 'en' / 'de')\n * @param model - The model type associated with the rendered component (if applicable)\n * @param id - The ID (primary key) of the model instance for the plugin (if applicable)\n * @param instance - The model instance data (if available)\n * @param reloadContent - A function which can be called to reload the plugin content\n * @param reloadInstance - A function which can be called to reload the model instance\n * @param context - Any additional context data which may be passed to the plugin\n */\nexport type InvenTreePluginContext = {\n version: string;\n api: AxiosInstance;\n queryClient: QueryClient;\n user: UserStateProps;\n userSettings: SettingsStateProps;\n globalSettings: SettingsStateProps;\n host: string;\n locale: string;\n navigate: NavigateFunction;\n theme: MantineTheme;\n forms: InvenTreeFormsContext;\n colorScheme: MantineColorScheme;\n model?: ModelType | string;\n id?: string | number | null;\n instance?: any;\n reloadContent?: () => void;\n reloadInstance?: () => void;\n context?: any;\n};\n\n/*\n * The version of the InvenTree plugin context interface.\n * This number should be incremented if the interface changes.\n */\n\n// @ts-ignore\nexport const INVENTREE_PLUGIN_VERSION: string = __INVENTREE_LIB_VERSION__;\n"],"names":["INVENTREE_PLUGIN_VERSION","__INVENTREE_LIB_VERSION__"],"mappings":"AAuEO,MAAMA,2BAAmCC;"}
@@ -38,6 +38,8 @@ export type InvenTreeFormsContext = {
38
38
  * @param model - The model type associated with the rendered component (if applicable)
39
39
  * @param id - The ID (primary key) of the model instance for the plugin (if applicable)
40
40
  * @param instance - The model instance data (if available)
41
+ * @param reloadContent - A function which can be called to reload the plugin content
42
+ * @param reloadInstance - A function which can be called to reload the model instance
41
43
  * @param context - Any additional context data which may be passed to the plugin
42
44
  */
43
45
  export type InvenTreePluginContext = {
@@ -56,6 +58,8 @@ export type InvenTreePluginContext = {
56
58
  model?: ModelType | string;
57
59
  id?: string | number | null;
58
60
  instance?: any;
61
+ reloadContent?: () => void;
62
+ reloadInstance?: () => void;
59
63
  context?: any;
60
64
  };
61
65
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inventreedb/ui",
3
3
  "description": "UI components for the InvenTree project",
4
- "version": "0.0.5",
4
+ "version": "0.0.6",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -128,7 +128,7 @@
128
128
  "rollup": "^4.0.0",
129
129
  "rollup-plugin-license": "^3.5.3",
130
130
  "typescript": "^5.8.2",
131
- "vite": "^6.2.4",
131
+ "vite": "^6.2.5",
132
132
  "vite-plugin-babel-macros": "^1.0.6",
133
133
  "vite-plugin-dts": "^4.5.3",
134
134
  "vite-plugin-istanbul": "^6.0.2"