{"version":3,"file":"index.mjs","sources":["../../../admin/src/history/index.ts"],"sourcesContent":["/* eslint-disable check-file/no-index */\n\nimport { type ContentManagerPlugin } from '../content-manager';\n\nimport { HistoryAction } from './components/HistoryAction';\n\nimport type { StrapiApp } from '@strapi/admin/strapi-admin';\nimport type { Plugin } from '@strapi/types';\n\nconst historyAdmin: Partial<Plugin.Config.AdminInput> = {\n  bootstrap(app: StrapiApp) {\n    const { addDocumentAction } = app.getPlugin('content-manager').apis as {\n      addDocumentAction: ContentManagerPlugin['addDocumentAction'];\n    };\n\n    /**\n     * Register the document action here using the public API, and not by setting the action in the\n     * Content Manager directly, because this API lets us control the order of the actions array.\n     * We want history to be the last non-delete action in the array.\n     */\n    addDocumentAction((actions) => {\n      const indexOfDeleteAction = actions.findIndex((action) => action.type === 'delete');\n      actions.splice(indexOfDeleteAction, 0, HistoryAction);\n      return actions;\n    });\n  },\n};\n\nexport { historyAdmin };\n"],"names":["historyAdmin","bootstrap","app","addDocumentAction","getPlugin","apis","actions","indexOfDeleteAction","findIndex","action","type","splice","HistoryAction"],"mappings":";;AASA,MAAMA,YAAAA,GAAkD;AACtDC,IAAAA,SAAAA,CAAAA,CAAUC,GAAc,EAAA;QACtB,MAAM,EAAEC,iBAAiB,EAAE,GAAGD,IAAIE,SAAS,CAAC,mBAAmBC,IAAI;AAInE;;;;AAIC,QACDF,kBAAkB,CAACG,OAAAA,GAAAA;YACjB,MAAMC,mBAAAA,GAAsBD,QAAQE,SAAS,CAAC,CAACC,MAAAA,GAAWA,MAAAA,CAAOC,IAAI,KAAK,QAAA,CAAA;YAC1EJ,OAAAA,CAAQK,MAAM,CAACJ,mBAAAA,EAAqB,CAAA,EAAGK,aAAAA,CAAAA;YACvC,OAAON,OAAAA;AACT,QAAA,CAAA,CAAA;AACF,IAAA;AACF;;;;"}