@primershop/strapi-plugin-product-actions 0.0.10 → 0.0.11

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 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../admin/src/pluginId.ts","../../admin/src/components/Initializer/index.tsx","../../admin/src/translations/en.ts","../../admin/src/components/SeriesProductActions/index.tsx","../../admin/src/index.ts"],"sourcesContent":["export const PLUGIN_ID = \"primershop-product-actions\";\r\n","import { useEffect, useRef } from \"react\";\r\n\r\nimport { PLUGIN_ID } from \"../../pluginId\";\r\n\r\n/**\r\n * @type {import('react').FC<{ setPlugin: (id: string) => void }>}\r\n */\r\nconst Initializer = ({ setPlugin }: { setPlugin: (id: string) => void }) => {\r\n const ref = useRef(setPlugin);\r\n\r\n useEffect(() => {\r\n ref.current(PLUGIN_ID);\r\n }, []);\r\n\r\n return null;\r\n};\r\n\r\nexport { Initializer };\r\n","const en: Record<string, string> = {\r\n \"plugin.name\": \"Product Series\",\r\n \"plugin.description\": \"Manage product series and their products\",\r\n \"product-series.actions.label\": \"Product Actions\",\r\n \"product-series.actions.createProducts\": \"Create Products\",\r\n \"product-series.actions.updateProducts\": \"Update Products\",\r\n \"product-series.actions.createDialogTitle\": \"Create Products from Series\",\r\n \"product-series.actions.updateDialogTitle\": \"Update All Products in Series\",\r\n \"product-series.actions.updateDialogDescription\":\r\n \"This will update all products in the series with the selected fields. Make sure to save the series first before updating the products.\",\r\n \"product-series.actions.productCount\": \"Number of Products\",\r\n \"product-series.actions.create\": \"Create\",\r\n \"product-series.actions.update\": \"Update\",\r\n \"product-series.actions.cancel\": \"Cancel\",\r\n \"product-series.actions.createSuccess\": \"Products created successfully\",\r\n \"product-series.actions.createError\": \"Failed to create products\",\r\n \"product-series.actions.updateSuccess\": \"Products updated successfully\",\r\n \"product-series.actions.updateError\": \"Failed to update products\",\r\n \"product-series.actions.selectFields\": \"Select fields to update\",\r\n \"product-series.actions.noDocumentId\":\r\n \"Save the series first before creating products\",\r\n};\r\n\r\nexport { en };\r\n","import React, { useState } from \"react\";\r\n\r\nimport {\r\n Box,\r\n Button,\r\n Typography,\r\n Dialog,\r\n NumberInput,\r\n Flex,\r\n MultiSelect,\r\n MultiSelectOption,\r\n} from \"@strapi/design-system\";\r\nimport {\r\n useFetchClient,\r\n unstable_useContentManagerContext as useContentManagerContext,\r\n} from \"@strapi/strapi/admin\";\r\n\r\nimport { en } from \"../../translations\";\r\n\r\nconst formatMessage = (arg: { id: string }): string => {\r\n return en[arg.id];\r\n};\r\n\r\nconst valuesToUpdate = [\r\n \"description\",\r\n \"shortDescription\",\r\n \"media\",\r\n \"coverImage\",\r\n \"seo\",\r\n \"totalCost\",\r\n \"wholesalePrice\",\r\n \"retailPrice\",\r\n \"category\",\r\n \"creator\",\r\n];\r\n\r\ninterface Document {\r\n documentId?: string;\r\n}\r\n\r\nconst SeriesProductActions = ({ document }: { document: Document }) => {\r\n const { model } = useContentManagerContext();\r\n const documentId = document?.documentId;\r\n const [productCount, setProductCount] = useState(1);\r\n const [isLoading, setIsLoading] = useState(false);\r\n const [fieldsToUpdate, setFieldsToUpdate] = useState<string[]>([]);\r\n const { post, put } = useFetchClient();\r\n\r\n if (model !== \"api::product-series.product-series\") return null;\r\n\r\n const handleCreateProducts = async () => {\r\n try {\r\n setIsLoading(true);\r\n const response = await post(\r\n `primershop-product-actions/create-products`,\r\n {\r\n count: productCount,\r\n id: documentId,\r\n }\r\n );\r\n\r\n if (!response.data) {\r\n throw new Error(\"Failed to create products\");\r\n }\r\n\r\n setProductCount(1);\r\n } catch (error) {\r\n console.error(\"Error creating products:\", error);\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n };\r\n\r\n const handleUpdateProducts = async () => {\r\n try {\r\n setIsLoading(true);\r\n const response = await put(\r\n `/primershop-product-actions/update-products`,\r\n {\r\n seriesId: documentId,\r\n fieldsToUpdate,\r\n }\r\n );\r\n\r\n if (!response.data) {\r\n throw new Error(\"Failed to update products\");\r\n }\r\n } catch (error) {\r\n console.error(\"Error updating products:\", error);\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n };\r\n return {\r\n title: \"Series Product Actions\",\r\n content: (\r\n <Box>\r\n <Box>\r\n <Typography variant=\"delta\" fontWeight=\"bold\">\r\n {formatMessage({ id: \"product-series.actions.label\" })}\r\n </Typography>\r\n <Flex wrap={\"wrap\"}>\r\n {!documentId && (\r\n <Typography\r\n display={\"block\"}\r\n marginTop={2}\r\n marginBottom={2}\r\n width=\"100%\"\r\n color=\"red\"\r\n >\r\n {formatMessage({ id: \"product-series.actions.noDocumentId\" })}\r\n </Typography>\r\n )}\r\n\r\n <Dialog.Root>\r\n <Dialog.Trigger>\r\n <Button variant=\"secondary\" disabled={isLoading || !documentId}>\r\n {formatMessage({\r\n id: \"product-series.actions.createProducts\",\r\n })}\r\n </Button>\r\n </Dialog.Trigger>\r\n <Dialog.Content>\r\n <Dialog.Body>\r\n <Box>\r\n <Typography>\r\n {formatMessage({\r\n id: \"product-series.actions.createDialogTitle\",\r\n })}\r\n </Typography>\r\n <NumberInput\r\n value={productCount}\r\n onValueChange={(value) => setProductCount(value || 1)}\r\n min={1}\r\n max={100}\r\n ></NumberInput>\r\n </Box>\r\n </Dialog.Body>\r\n <Dialog.Footer>\r\n <Dialog.Cancel>\r\n <Button fullWidth variant=\"tertiary\">\r\n Cancel\r\n </Button>\r\n </Dialog.Cancel>\r\n <Dialog.Action>\r\n <Button\r\n onClick={handleCreateProducts}\r\n variant=\"default\"\r\n loading={isLoading}\r\n >\r\n {formatMessage({ id: \"product-series.actions.create\" })}\r\n </Button>\r\n </Dialog.Action>\r\n </Dialog.Footer>\r\n </Dialog.Content>\r\n </Dialog.Root>\r\n\r\n {/* Update Products Dialog */}\r\n <Dialog.Root>\r\n <Dialog.Trigger>\r\n <Button\r\n marginLeft={2}\r\n variant=\"secondary\"\r\n disabled={isLoading || !documentId}\r\n >\r\n {formatMessage({\r\n id: \"product-series.actions.updateProducts\",\r\n })}\r\n </Button>\r\n </Dialog.Trigger>\r\n <Dialog.Content>\r\n <Dialog.Body\r\n display={\"flex\"}\r\n direction={\"column\"}\r\n gap={2}\r\n justifyContent={\"center\"}\r\n alignItems={\"center\"}\r\n width={\"100%\"}\r\n >\r\n <Typography variant=\"delta\" fontWeight=\"bold\">\r\n {formatMessage({\r\n id: \"product-series.actions.updateDialogTitle\",\r\n })}\r\n </Typography>\r\n <Typography>\r\n {formatMessage({\r\n id: \"product-series.actions.updateDialogDescription\",\r\n })}\r\n </Typography>\r\n <MultiSelect\r\n withTags={true}\r\n value={fieldsToUpdate}\r\n onClear={() => setFieldsToUpdate([])}\r\n onChange={(value: string[]) => setFieldsToUpdate(value)}\r\n required={true}\r\n placeholder={formatMessage({\r\n id: \"product-series.actions.selectFields\",\r\n })}\r\n >\r\n {valuesToUpdate.map((field) => (\r\n <MultiSelectOption key={field} value={field}>\r\n {field}\r\n </MultiSelectOption>\r\n ))}\r\n </MultiSelect>\r\n </Dialog.Body>\r\n <Dialog.Footer>\r\n <Dialog.Cancel>\r\n <Button fullWidth variant=\"tertiary\">\r\n Cancel\r\n </Button>\r\n </Dialog.Cancel>\r\n <Dialog.Action>\r\n <Button\r\n onClick={handleUpdateProducts}\r\n variant=\"default\"\r\n loading={isLoading}\r\n >\r\n {formatMessage({ id: \"product-series.actions.update\" })}\r\n </Button>\r\n </Dialog.Action>\r\n </Dialog.Footer>\r\n </Dialog.Content>\r\n </Dialog.Root>\r\n </Flex>\r\n </Box>\r\n </Box>\r\n ),\r\n };\r\n};\r\n\r\nexport { SeriesProductActions };\r\n","import { Initializer } from \"./components/Initializer\";\r\nimport { SeriesProductActions } from \"./components/SeriesProductActions\";\r\nimport { PLUGIN_ID } from \"./pluginId\";\r\n\r\nimport type { PanelComponent } from \"@strapi/content-manager/strapi-admin\";\r\n\r\nconst plugin = {\r\n register(app: any) {\r\n app.registerPlugin({\r\n id: PLUGIN_ID,\r\n initializer: Initializer,\r\n isReady: false,\r\n name: PLUGIN_ID,\r\n });\r\n },\r\n\r\n bootstrap(app: any) {\r\n app\r\n .getPlugin(\"content-manager\")\r\n .apis.addEditViewSidePanel((panels: any): PanelComponent[] => {\r\n return [...panels, SeriesProductActions];\r\n });\r\n },\r\n};\r\n\r\nexport default plugin;\r\n"],"names":["PLUGIN_ID","Initializer","setPlugin","ref","useRef","useEffect","current","en","formatMessage","arg","id","valuesToUpdate","SeriesProductActions","document","model","useContentManagerContext","documentId","productCount","setProductCount","useState","isLoading","setIsLoading","fieldsToUpdate","setFieldsToUpdate","post","put","useFetchClient","handleCreateProducts","response","count","data","Error","error","console","handleUpdateProducts","seriesId","title","content","_jsx","Box","_jsxs","Typography","variant","fontWeight","Flex","wrap","display","marginTop","marginBottom","width","color","Dialog","Root","Trigger","Button","disabled","Content","Body","NumberInput","value","onValueChange","min","max","Footer","Cancel","fullWidth","Action","onClick","loading","marginLeft","direction","gap","justifyContent","alignItems","MultiSelect","withTags","onClear","onChange","required","placeholder","map","field","MultiSelectOption","plugin","register","app","registerPlugin","initializer","isReady","name","bootstrap","getPlugin","apis","addEditViewSidePanel","panels"],"mappings":";;;;;AAAO,MAAMA,YAAY,4BAAA;;ACIzB;;AAEC,IACD,MAAMC,WAAAA,GAAc,CAAC,EAAEC,SAAS,EAAuC,GAAA;AACrE,IAAA,MAAMC,MAAMC,MAAAA,CAAOF,SAAAA,CAAAA;IAEnBG,SAAAA,CAAU,IAAA;AACRF,QAAAA,GAAAA,CAAIG,OAAO,CAACN,SAAAA,CAAAA;AACd,IAAA,CAAA,EAAG,EAAE,CAAA;IAEL,OAAO,IAAA;AACT,CAAA;;ACfA,MAAMO,EAAAA,GAA6B;IACjC,aAAA,EAAe,gBAAA;IACf,oBAAA,EAAsB,0CAAA;IACtB,8BAAA,EAAgC,iBAAA;IAChC,uCAAA,EAAyC,iBAAA;IACzC,uCAAA,EAAyC,iBAAA;IACzC,0CAAA,EAA4C,6BAAA;IAC5C,0CAAA,EAA4C,+BAAA;IAC5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F;AACR,SAAA,CAAA;AACF,IAAA,CAAA;AAEA0F,IAAAA,SAAAA,CAAAA,CAAUL,GAAQ,EAAA;AAChBA,QAAAA,GAAAA,CACGM,SAAS,CAAC,iBAAA,CAAA,CACVC,IAAI,CAACC,oBAAoB,CAAC,CAACC,MAAAA,GAAAA;YAC1B,OAAO;AAAIA,gBAAAA,GAAAA,MAAAA;AAAQlF,gBAAAA;AAAqB,aAAA;AAC1C,QAAA,CAAA,CAAA;AACJ,IAAA;AACF;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../admin/src/index.ts"],"sourcesContent":["import { Initializer } from \"./components/Initializer\";\r\nimport { SeriesProductActions } from \"./components/SeriesProductActions\";\r\nimport { PLUGIN_ID } from \"./pluginId\";\r\n\r\nimport type { PanelComponent } from \"@strapi/content-manager/strapi-admin\";\r\n\r\nconst plugin = {\r\n register(app: any) {\r\n app.registerPlugin({\r\n id: PLUGIN_ID,\r\n initializer: Initializer,\r\n isReady: false,\r\n name: PLUGIN_ID,\r\n });\r\n },\r\n\r\n bootstrap(app: any) {\r\n app\r\n .getPlugin(\"content-manager\")\r\n .apis.addEditViewSidePanel((panels: any): PanelComponent[] => {\r\n return [...panels, SeriesProductActions];\r\n });\r\n },\r\n};\r\n\r\nexport default plugin;\r\n"],"names":["plugin","register","app","registerPlugin","id","PLUGIN_ID","initializer","Initializer","isReady","name","bootstrap","getPlugin","apis","addEditViewSidePanel","panels","SeriesProductActions"],"mappings":";;;;AAMA,MAAMA,MAAAA,GAAS;AACbC,IAAAA,QAAAA,CAAAA,CAASC,GAAQ,EAAA;AACfA,QAAAA,GAAAA,CAAIC,cAAc,CAAC;YACjBC,EAAAA,EAAIC,SAAAA;YACJC,WAAAA,EAAaC,WAAAA;YACbC,OAAAA,EAAS,KAAA;YACTC,IAAAA,EAAMJ;AACR,SAAA,CAAA;AACF,IAAA,CAAA;AAEAK,IAAAA,SAAAA,CAAAA,CAAUR,GAAQ,EAAA;AAChBA,QAAAA,GAAAA,CACGS,SAAS,CAAC,iBAAA,CAAA,CACVC,IAAI,CAACC,oBAAoB,CAAC,CAACC,MAAAA,GAAAA;YAC1B,OAAO;AAAIA,gBAAAA,GAAAA,MAAAA;AAAQC,gBAAAA;AAAqB,aAAA;AAC1C,QAAA,CAAA,CAAA;AACJ,IAAA;AACF;;;;"}
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ const PLUGIN_ID = "primershop-product-actions";
4
+
5
+ exports.PLUGIN_ID = PLUGIN_ID;
6
+ //# sourceMappingURL=pluginId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginId.js","sources":["../../admin/src/pluginId.ts"],"sourcesContent":["export const PLUGIN_ID = \"primershop-product-actions\";\r\n"],"names":["PLUGIN_ID"],"mappings":";;AAAO,MAAMA,YAAY;;;;"}
@@ -0,0 +1,4 @@
1
+ const PLUGIN_ID = "primershop-product-actions";
2
+
3
+ export { PLUGIN_ID };
4
+ //# sourceMappingURL=pluginId.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginId.mjs","sources":["../../admin/src/pluginId.ts"],"sourcesContent":["export const PLUGIN_ID = \"primershop-product-actions\";\r\n"],"names":["PLUGIN_ID"],"mappings":"AAAO,MAAMA,YAAY;;;;"}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ const en = {
4
+ "plugin.name": "Product Series",
5
+ "plugin.description": "Manage product series and their products",
6
+ "product-series.actions.label": "Product Actions",
7
+ "product-series.actions.createProducts": "Create Products",
8
+ "product-series.actions.updateProducts": "Update Products",
9
+ "product-series.actions.createDialogTitle": "Create Products from Series",
10
+ "product-series.actions.updateDialogTitle": "Update All Products in Series",
11
+ "product-series.actions.updateDialogDescription": "This will update all products in the series with the selected fields. Make sure to save the series first before updating the products.",
12
+ "product-series.actions.productCount": "Number of Products",
13
+ "product-series.actions.create": "Create",
14
+ "product-series.actions.update": "Update",
15
+ "product-series.actions.cancel": "Cancel",
16
+ "product-series.actions.createSuccess": "Products created successfully",
17
+ "product-series.actions.createError": "Failed to create products",
18
+ "product-series.actions.updateSuccess": "Products updated successfully",
19
+ "product-series.actions.updateError": "Failed to update products",
20
+ "product-series.actions.selectFields": "Select fields to update",
21
+ "product-series.actions.noDocumentId": "Save the series first before creating products"
22
+ };
23
+
24
+ exports.en = en;
25
+ //# sourceMappingURL=en.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.js","sources":["../../../admin/src/translations/en.ts"],"sourcesContent":["const en: Record<string, string> = {\r\n \"plugin.name\": \"Product Series\",\r\n \"plugin.description\": \"Manage product series and their products\",\r\n \"product-series.actions.label\": \"Product Actions\",\r\n \"product-series.actions.createProducts\": \"Create Products\",\r\n \"product-series.actions.updateProducts\": \"Update Products\",\r\n \"product-series.actions.createDialogTitle\": \"Create Products from Series\",\r\n \"product-series.actions.updateDialogTitle\": \"Update All Products in Series\",\r\n \"product-series.actions.updateDialogDescription\":\r\n \"This will update all products in the series with the selected fields. Make sure to save the series first before updating the products.\",\r\n \"product-series.actions.productCount\": \"Number of Products\",\r\n \"product-series.actions.create\": \"Create\",\r\n \"product-series.actions.update\": \"Update\",\r\n \"product-series.actions.cancel\": \"Cancel\",\r\n \"product-series.actions.createSuccess\": \"Products created successfully\",\r\n \"product-series.actions.createError\": \"Failed to create products\",\r\n \"product-series.actions.updateSuccess\": \"Products updated successfully\",\r\n \"product-series.actions.updateError\": \"Failed to update products\",\r\n \"product-series.actions.selectFields\": \"Select fields to update\",\r\n \"product-series.actions.noDocumentId\":\r\n \"Save the series first before creating products\",\r\n};\r\n\r\nexport { en };\r\n"],"names":["en"],"mappings":";;AAAA,MAAMA,EAAAA,GAA6B;IACjC,aAAA,EAAe,gBAAA;IACf,oBAAA,EAAsB,0CAAA;IACtB,8BAAA,EAAgC,iBAAA;IAChC,uCAAA,EAAyC,iBAAA;IACzC,uCAAA,EAAyC,iBAAA;IACzC,0CAAA,EAA4C,6BAAA;IAC5C,0CAAA,EAA4C,+BAAA;IAC5C,gDAAA,EACE,wIAAA;IACF,qCAAA,EAAuC,oBAAA;IACvC,+BAAA,EAAiC,QAAA;IACjC,+BAAA,EAAiC,QAAA;IACjC,+BAAA,EAAiC,QAAA;IACjC,sCAAA,EAAwC,+BAAA;IACxC,oCAAA,EAAsC,2BAAA;IACtC,sCAAA,EAAwC,+BAAA;IACxC,oCAAA,EAAsC,2BAAA;IACtC,qCAAA,EAAuC,yBAAA;IACvC,qCAAA,EACE;AACJ;;;;"}
@@ -0,0 +1,23 @@
1
+ const en = {
2
+ "plugin.name": "Product Series",
3
+ "plugin.description": "Manage product series and their products",
4
+ "product-series.actions.label": "Product Actions",
5
+ "product-series.actions.createProducts": "Create Products",
6
+ "product-series.actions.updateProducts": "Update Products",
7
+ "product-series.actions.createDialogTitle": "Create Products from Series",
8
+ "product-series.actions.updateDialogTitle": "Update All Products in Series",
9
+ "product-series.actions.updateDialogDescription": "This will update all products in the series with the selected fields. Make sure to save the series first before updating the products.",
10
+ "product-series.actions.productCount": "Number of Products",
11
+ "product-series.actions.create": "Create",
12
+ "product-series.actions.update": "Update",
13
+ "product-series.actions.cancel": "Cancel",
14
+ "product-series.actions.createSuccess": "Products created successfully",
15
+ "product-series.actions.createError": "Failed to create products",
16
+ "product-series.actions.updateSuccess": "Products updated successfully",
17
+ "product-series.actions.updateError": "Failed to update products",
18
+ "product-series.actions.selectFields": "Select fields to update",
19
+ "product-series.actions.noDocumentId": "Save the series first before creating products"
20
+ };
21
+
22
+ export { en };
23
+ //# sourceMappingURL=en.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.mjs","sources":["../../../admin/src/translations/en.ts"],"sourcesContent":["const en: Record<string, string> = {\r\n \"plugin.name\": \"Product Series\",\r\n \"plugin.description\": \"Manage product series and their products\",\r\n \"product-series.actions.label\": \"Product Actions\",\r\n \"product-series.actions.createProducts\": \"Create Products\",\r\n \"product-series.actions.updateProducts\": \"Update Products\",\r\n \"product-series.actions.createDialogTitle\": \"Create Products from Series\",\r\n \"product-series.actions.updateDialogTitle\": \"Update All Products in Series\",\r\n \"product-series.actions.updateDialogDescription\":\r\n \"This will update all products in the series with the selected fields. Make sure to save the series first before updating the products.\",\r\n \"product-series.actions.productCount\": \"Number of Products\",\r\n \"product-series.actions.create\": \"Create\",\r\n \"product-series.actions.update\": \"Update\",\r\n \"product-series.actions.cancel\": \"Cancel\",\r\n \"product-series.actions.createSuccess\": \"Products created successfully\",\r\n \"product-series.actions.createError\": \"Failed to create products\",\r\n \"product-series.actions.updateSuccess\": \"Products updated successfully\",\r\n \"product-series.actions.updateError\": \"Failed to update products\",\r\n \"product-series.actions.selectFields\": \"Select fields to update\",\r\n \"product-series.actions.noDocumentId\":\r\n \"Save the series first before creating products\",\r\n};\r\n\r\nexport { en };\r\n"],"names":["en"],"mappings":"AAAA,MAAMA,EAAAA,GAA6B;IACjC,aAAA,EAAe,gBAAA;IACf,oBAAA,EAAsB,0CAAA;IACtB,8BAAA,EAAgC,iBAAA;IAChC,uCAAA,EAAyC,iBAAA;IACzC,uCAAA,EAAyC,iBAAA;IACzC,0CAAA,EAA4C,6BAAA;IAC5C,0CAAA,EAA4C,+BAAA;IAC5C,gDAAA,EACE,wIAAA;IACF,qCAAA,EAAuC,oBAAA;IACvC,+BAAA,EAAiC,QAAA;IACjC,+BAAA,EAAiC,QAAA;IACjC,+BAAA,EAAiC,QAAA;IACjC,sCAAA,EAAwC,+BAAA;IACxC,oCAAA,EAAsC,2BAAA;IACtC,sCAAA,EAAwC,+BAAA;IACxC,oCAAA,EAAsC,2BAAA;IACtC,qCAAA,EAAuC,yBAAA;IACvC,qCAAA,EACE;AACJ;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primershop/strapi-plugin-product-actions",
3
- "version": "0.0.10",
4
- "description": "Enables product actions for Strapi (v0.0.10)",
3
+ "version": "0.0.11",
4
+ "description": "Enables product actions for Strapi (v0.0.11)",
5
5
  "exports": {
6
6
  "./strapi-admin": {
7
7
  "import": "./dist/admin/index.mjs",
@@ -89,7 +89,7 @@
89
89
  "kind": "plugin",
90
90
  "name": "primershop-product-actions",
91
91
  "displayName": "Product Actions",
92
- "description": "Enables product actions (v0.0.10)"
92
+ "description": "Enables product actions (v0.0.11)"
93
93
  },
94
94
  "dependencies": {
95
95
  "@strapi/design-system": "^2.0.0-rc.27",