@strapi/admin 5.16.1 → 5.17.0-beta.0

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.
Files changed (33) hide show
  1. package/dist/admin/admin/src/components/Providers.js +5 -10
  2. package/dist/admin/admin/src/components/Providers.js.map +1 -1
  3. package/dist/admin/admin/src/components/Providers.mjs +5 -10
  4. package/dist/admin/admin/src/components/Providers.mjs.map +1 -1
  5. package/dist/admin/admin/src/translations/en.json.js +1 -6
  6. package/dist/admin/admin/src/translations/en.json.js.map +1 -1
  7. package/dist/admin/admin/src/translations/en.json.mjs +1 -6
  8. package/dist/admin/admin/src/translations/en.json.mjs.map +1 -1
  9. package/dist/admin/admin/src/utils/rulesEngine.js +75 -0
  10. package/dist/admin/admin/src/utils/rulesEngine.js.map +1 -0
  11. package/dist/admin/admin/src/utils/rulesEngine.mjs +72 -0
  12. package/dist/admin/admin/src/utils/rulesEngine.mjs.map +1 -0
  13. package/dist/admin/index.js +3 -2
  14. package/dist/admin/index.js.map +1 -1
  15. package/dist/admin/index.mjs +1 -1
  16. package/dist/admin/src/index.d.ts +1 -1
  17. package/dist/admin/src/utils/rulesEngine.d.ts +23 -0
  18. package/package.json +11 -9
  19. package/dist/admin/admin/src/components/UnstableGuidedTour/Context.js +0 -66
  20. package/dist/admin/admin/src/components/UnstableGuidedTour/Context.js.map +0 -1
  21. package/dist/admin/admin/src/components/UnstableGuidedTour/Context.mjs +0 -43
  22. package/dist/admin/admin/src/components/UnstableGuidedTour/Context.mjs.map +0 -1
  23. package/dist/admin/admin/src/components/UnstableGuidedTour/Step.js +0 -137
  24. package/dist/admin/admin/src/components/UnstableGuidedTour/Step.js.map +0 -1
  25. package/dist/admin/admin/src/components/UnstableGuidedTour/Step.mjs +0 -116
  26. package/dist/admin/admin/src/components/UnstableGuidedTour/Step.mjs.map +0 -1
  27. package/dist/admin/admin/src/components/UnstableGuidedTour/Tours.js +0 -116
  28. package/dist/admin/admin/src/components/UnstableGuidedTour/Tours.js.map +0 -1
  29. package/dist/admin/admin/src/components/UnstableGuidedTour/Tours.mjs +0 -94
  30. package/dist/admin/admin/src/components/UnstableGuidedTour/Tours.mjs.map +0 -1
  31. package/dist/admin/src/components/UnstableGuidedTour/Context.d.ts +0 -28
  32. package/dist/admin/src/components/UnstableGuidedTour/Step.d.ts +0 -35
  33. package/dist/admin/src/components/UnstableGuidedTour/Tours.d.ts +0 -24
@@ -13,8 +13,6 @@ var Tracking = require('../features/Tracking.js');
13
13
  var Provider = require('./GuidedTour/Provider.js');
14
14
  var LanguageProvider = require('./LanguageProvider.js');
15
15
  var Theme = require('./Theme.js');
16
- var Context = require('./UnstableGuidedTour/Context.js');
17
- var Tours = require('./UnstableGuidedTour/Tours.js');
18
16
 
19
17
  const queryClient = new reactQuery.QueryClient({
20
18
  defaultOptions: {
@@ -51,14 +49,11 @@ const Providers = ({ children, strapi, store })=>{
51
49
  children: /*#__PURE__*/ jsxRuntime.jsx(Notifications.NotificationsProvider, {
52
50
  children: /*#__PURE__*/ jsxRuntime.jsx(Tracking.TrackingProvider, {
53
51
  children: /*#__PURE__*/ jsxRuntime.jsx(Provider.GuidedTourProvider, {
54
- children: /*#__PURE__*/ jsxRuntime.jsx(Context.UnstableGuidedTourContext, {
55
- tours: Tours.tours,
56
- children: /*#__PURE__*/ jsxRuntime.jsx(Configuration.ConfigurationProvider, {
57
- defaultAuthLogo: strapi.configurations.authLogo,
58
- defaultMenuLogo: strapi.configurations.menuLogo,
59
- showReleaseNotification: strapi.configurations.notifications.releases,
60
- children: children
61
- })
52
+ children: /*#__PURE__*/ jsxRuntime.jsx(Configuration.ConfigurationProvider, {
53
+ defaultAuthLogo: strapi.configurations.authLogo,
54
+ defaultMenuLogo: strapi.configurations.menuLogo,
55
+ showReleaseNotification: strapi.configurations.notifications.releases,
56
+ children: children
62
57
  })
63
58
  })
64
59
  })
@@ -1 +1 @@
1
- {"version":3,"file":"Providers.js","sources":["../../../../../admin/src/components/Providers.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { QueryClient, QueryClientProvider } from 'react-query';\nimport { Provider } from 'react-redux';\n\nimport { AuthProvider } from '../features/Auth';\nimport { HistoryProvider } from '../features/BackButton';\nimport { ConfigurationProvider } from '../features/Configuration';\nimport { NotificationsProvider } from '../features/Notifications';\nimport { StrapiAppProvider } from '../features/StrapiApp';\nimport { TrackingProvider } from '../features/Tracking';\n\nimport { GuidedTourProvider } from './GuidedTour/Provider';\nimport { LanguageProvider } from './LanguageProvider';\nimport { Theme } from './Theme';\nimport { UnstableGuidedTourContext } from './UnstableGuidedTour/Context';\nimport { tours } from './UnstableGuidedTour/Tours';\n\nimport type { Store } from '../core/store/configure';\nimport type { StrapiApp } from '../StrapiApp';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n },\n },\n});\n\ninterface ProvidersProps {\n children: React.ReactNode;\n strapi: StrapiApp;\n store: Store;\n}\n\nconst Providers = ({ children, strapi, store }: ProvidersProps) => {\n return (\n <StrapiAppProvider\n components={strapi.library.components}\n customFields={strapi.customFields}\n widgets={strapi.widgets}\n fields={strapi.library.fields}\n menu={strapi.router.menu}\n getAdminInjectedComponents={strapi.getAdminInjectedComponents}\n getPlugin={strapi.getPlugin}\n plugins={strapi.plugins}\n rbac={strapi.rbac}\n runHookParallel={strapi.runHookParallel}\n runHookWaterfall={(name, initialValue) => strapi.runHookWaterfall(name, initialValue, store)}\n runHookSeries={strapi.runHookSeries}\n settings={strapi.router.settings}\n >\n <Provider store={store}>\n <QueryClientProvider client={queryClient}>\n <AuthProvider>\n <HistoryProvider>\n <LanguageProvider messages={strapi.configurations.translations}>\n <Theme themes={strapi.configurations.themes}>\n <NotificationsProvider>\n <TrackingProvider>\n <GuidedTourProvider>\n <UnstableGuidedTourContext tours={tours}>\n <ConfigurationProvider\n defaultAuthLogo={strapi.configurations.authLogo}\n defaultMenuLogo={strapi.configurations.menuLogo}\n showReleaseNotification={strapi.configurations.notifications.releases}\n >\n {children}\n </ConfigurationProvider>\n </UnstableGuidedTourContext>\n </GuidedTourProvider>\n </TrackingProvider>\n </NotificationsProvider>\n </Theme>\n </LanguageProvider>\n </HistoryProvider>\n </AuthProvider>\n </QueryClientProvider>\n </Provider>\n </StrapiAppProvider>\n );\n};\n\nexport { Providers };\n"],"names":["queryClient","QueryClient","defaultOptions","queries","refetchOnWindowFocus","Providers","children","strapi","store","_jsx","StrapiAppProvider","components","library","customFields","widgets","fields","menu","router","getAdminInjectedComponents","getPlugin","plugins","rbac","runHookParallel","runHookWaterfall","name","initialValue","runHookSeries","settings","Provider","QueryClientProvider","client","AuthProvider","HistoryProvider","LanguageProvider","messages","configurations","translations","Theme","themes","NotificationsProvider","TrackingProvider","GuidedTourProvider","UnstableGuidedTourContext","tours","ConfigurationProvider","defaultAuthLogo","authLogo","defaultMenuLogo","menuLogo","showReleaseNotification","notifications","releases"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAMA,WAAAA,GAAc,IAAIC,sBAAY,CAAA;IAClCC,cAAgB,EAAA;QACdC,OAAS,EAAA;YACPC,oBAAsB,EAAA;AACxB;AACF;AACF,CAAA,CAAA;AAQMC,MAAAA,SAAAA,GAAY,CAAC,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAkB,GAAA;AAC5D,IAAA,qBACEC,cAACC,CAAAA,2BAAAA,EAAAA;QACCC,UAAYJ,EAAAA,MAAAA,CAAOK,OAAO,CAACD,UAAU;AACrCE,QAAAA,YAAAA,EAAcN,OAAOM,YAAY;AACjCC,QAAAA,OAAAA,EAASP,OAAOO,OAAO;QACvBC,MAAQR,EAAAA,MAAAA,CAAOK,OAAO,CAACG,MAAM;QAC7BC,IAAMT,EAAAA,MAAAA,CAAOU,MAAM,CAACD,IAAI;AACxBE,QAAAA,0BAAAA,EAA4BX,OAAOW,0BAA0B;AAC7DC,QAAAA,SAAAA,EAAWZ,OAAOY,SAAS;AAC3BC,QAAAA,OAAAA,EAASb,OAA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AQ;oDAC/CC,eAAiBxC,EAAAA,MAAAA,CAAO4B,cAAc,CAACa,QAAQ;AAC/CC,oDAAAA,uBAAAA,EAAyB1C,MAAO4B,CAAAA,cAAc,CAACe,aAAa,CAACC,QAAQ;AAEpE7C,oDAAAA,QAAAA,EAAAA;;;;;;;;;;;;;AAc7B;;;;"}
1
+ {"version":3,"file":"Providers.js","sources":["../../../../../admin/src/components/Providers.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { QueryClient, QueryClientProvider } from 'react-query';\nimport { Provider } from 'react-redux';\n\nimport { AuthProvider } from '../features/Auth';\nimport { HistoryProvider } from '../features/BackButton';\nimport { ConfigurationProvider } from '../features/Configuration';\nimport { NotificationsProvider } from '../features/Notifications';\nimport { StrapiAppProvider } from '../features/StrapiApp';\nimport { TrackingProvider } from '../features/Tracking';\n\nimport { GuidedTourProvider } from './GuidedTour/Provider';\nimport { LanguageProvider } from './LanguageProvider';\nimport { Theme } from './Theme';\n\nimport type { Store } from '../core/store/configure';\nimport type { StrapiApp } from '../StrapiApp';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n },\n },\n});\n\ninterface ProvidersProps {\n children: React.ReactNode;\n strapi: StrapiApp;\n store: Store;\n}\n\nconst Providers = ({ children, strapi, store }: ProvidersProps) => {\n return (\n <StrapiAppProvider\n components={strapi.library.components}\n customFields={strapi.customFields}\n widgets={strapi.widgets}\n fields={strapi.library.fields}\n menu={strapi.router.menu}\n getAdminInjectedComponents={strapi.getAdminInjectedComponents}\n getPlugin={strapi.getPlugin}\n plugins={strapi.plugins}\n rbac={strapi.rbac}\n runHookParallel={strapi.runHookParallel}\n runHookWaterfall={(name, initialValue) => strapi.runHookWaterfall(name, initialValue, store)}\n runHookSeries={strapi.runHookSeries}\n settings={strapi.router.settings}\n >\n <Provider store={store}>\n <QueryClientProvider client={queryClient}>\n <AuthProvider>\n <HistoryProvider>\n <LanguageProvider messages={strapi.configurations.translations}>\n <Theme themes={strapi.configurations.themes}>\n <NotificationsProvider>\n <TrackingProvider>\n <GuidedTourProvider>\n <ConfigurationProvider\n defaultAuthLogo={strapi.configurations.authLogo}\n defaultMenuLogo={strapi.configurations.menuLogo}\n showReleaseNotification={strapi.configurations.notifications.releases}\n >\n {children}\n </ConfigurationProvider>\n </GuidedTourProvider>\n </TrackingProvider>\n </NotificationsProvider>\n </Theme>\n </LanguageProvider>\n </HistoryProvider>\n </AuthProvider>\n </QueryClientProvider>\n </Provider>\n </StrapiAppProvider>\n );\n};\n\nexport { Providers };\n"],"names":["queryClient","QueryClient","defaultOptions","queries","refetchOnWindowFocus","Providers","children","strapi","store","_jsx","StrapiAppProvider","components","library","customFields","widgets","fields","menu","router","getAdminInjectedComponents","getPlugin","plugins","rbac","runHookParallel","runHookWaterfall","name","initialValue","runHookSeries","settings","Provider","QueryClientProvider","client","AuthProvider","HistoryProvider","LanguageProvider","messages","configurations","translations","Theme","themes","NotificationsProvider","TrackingProvider","GuidedTourProvider","ConfigurationProvider","defaultAuthLogo","authLogo","defaultMenuLogo","menuLogo","showReleaseNotification","notifications","releases"],"mappings":";;;;;;;;;;;;;;;;AAmBA,MAAMA,WAAAA,GAAc,IAAIC,sBAAY,CAAA;IAClCC,cAAgB,EAAA;QACdC,OAAS,EAAA;YACPC,oBAAsB,EAAA;AACxB;AACF;AACF,CAAA,CAAA;AAQMC,MAAAA,SAAAA,GAAY,CAAC,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAkB,GAAA;AAC5D,IAAA,qBACEC,cAACC,CAAAA,2BAAAA,EAAAA;QACCC,UAAYJ,EAAAA,MAAAA,CAAOK,OAAO,CAACD,UAAU;AACrCE,QAAAA,YAAAA,EAAcN,OAAOM,YAAY;AACjCC,QAAAA,OAAAA,EAASP,OAAOO,OAAO;QACvBC,MAAQR,EAAAA,MAAAA,CAAOK,OAAO,CAACG,MAAM;QAC7BC,IAAMT,EAAAA,MAAAA,CAAOU,MAAM,CAACD,IAAI;A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A,MAAAA,CAAO4B,cAAc,CAACS,QAAQ;gDAC/CC,eAAiBtC,EAAAA,MAAAA,CAAO4B,cAAc,CAACW,QAAQ;AAC/CC,gDAAAA,uBAAAA,EAAyBxC,MAAO4B,CAAAA,cAAc,CAACa,aAAa,CAACC,QAAQ;AAEpE3C,gDAAAA,QAAAA,EAAAA;;;;;;;;;;;;AAa3B;;;;"}
@@ -11,8 +11,6 @@ import { TrackingProvider } from '../features/Tracking.mjs';
11
11
  import { GuidedTourProvider } from './GuidedTour/Provider.mjs';
12
12
  import { LanguageProvider } from './LanguageProvider.mjs';
13
13
  import { Theme } from './Theme.mjs';
14
- import { UnstableGuidedTourContext } from './UnstableGuidedTour/Context.mjs';
15
- import { tours } from './UnstableGuidedTour/Tours.mjs';
16
14
 
17
15
  const queryClient = new QueryClient({
18
16
  defaultOptions: {
@@ -49,14 +47,11 @@ const Providers = ({ children, strapi, store })=>{
49
47
  children: /*#__PURE__*/ jsx(NotificationsProvider, {
50
48
  children: /*#__PURE__*/ jsx(TrackingProvider, {
51
49
  children: /*#__PURE__*/ jsx(GuidedTourProvider, {
52
- children: /*#__PURE__*/ jsx(UnstableGuidedTourContext, {
53
- tours: tours,
54
- children: /*#__PURE__*/ jsx(ConfigurationProvider, {
55
- defaultAuthLogo: strapi.configurations.authLogo,
56
- defaultMenuLogo: strapi.configurations.menuLogo,
57
- showReleaseNotification: strapi.configurations.notifications.releases,
58
- children: children
59
- })
50
+ children: /*#__PURE__*/ jsx(ConfigurationProvider, {
51
+ defaultAuthLogo: strapi.configurations.authLogo,
52
+ defaultMenuLogo: strapi.configurations.menuLogo,
53
+ showReleaseNotification: strapi.configurations.notifications.releases,
54
+ children: children
60
55
  })
61
56
  })
62
57
  })
@@ -1 +1 @@
1
- {"version":3,"file":"Providers.mjs","sources":["../../../../../admin/src/components/Providers.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { QueryClient, QueryClientProvider } from 'react-query';\nimport { Provider } from 'react-redux';\n\nimport { AuthProvider } from '../features/Auth';\nimport { HistoryProvider } from '../features/BackButton';\nimport { ConfigurationProvider } from '../features/Configuration';\nimport { NotificationsProvider } from '../features/Notifications';\nimport { StrapiAppProvider } from '../features/StrapiApp';\nimport { TrackingProvider } from '../features/Tracking';\n\nimport { GuidedTourProvider } from './GuidedTour/Provider';\nimport { LanguageProvider } from './LanguageProvider';\nimport { Theme } from './Theme';\nimport { UnstableGuidedTourContext } from './UnstableGuidedTour/Context';\nimport { tours } from './UnstableGuidedTour/Tours';\n\nimport type { Store } from '../core/store/configure';\nimport type { StrapiApp } from '../StrapiApp';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n },\n },\n});\n\ninterface ProvidersProps {\n children: React.ReactNode;\n strapi: StrapiApp;\n store: Store;\n}\n\nconst Providers = ({ children, strapi, store }: ProvidersProps) => {\n return (\n <StrapiAppProvider\n components={strapi.library.components}\n customFields={strapi.customFields}\n widgets={strapi.widgets}\n fields={strapi.library.fields}\n menu={strapi.router.menu}\n getAdminInjectedComponents={strapi.getAdminInjectedComponents}\n getPlugin={strapi.getPlugin}\n plugins={strapi.plugins}\n rbac={strapi.rbac}\n runHookParallel={strapi.runHookParallel}\n runHookWaterfall={(name, initialValue) => strapi.runHookWaterfall(name, initialValue, store)}\n runHookSeries={strapi.runHookSeries}\n settings={strapi.router.settings}\n >\n <Provider store={store}>\n <QueryClientProvider client={queryClient}>\n <AuthProvider>\n <HistoryProvider>\n <LanguageProvider messages={strapi.configurations.translations}>\n <Theme themes={strapi.configurations.themes}>\n <NotificationsProvider>\n <TrackingProvider>\n <GuidedTourProvider>\n <UnstableGuidedTourContext tours={tours}>\n <ConfigurationProvider\n defaultAuthLogo={strapi.configurations.authLogo}\n defaultMenuLogo={strapi.configurations.menuLogo}\n showReleaseNotification={strapi.configurations.notifications.releases}\n >\n {children}\n </ConfigurationProvider>\n </UnstableGuidedTourContext>\n </GuidedTourProvider>\n </TrackingProvider>\n </NotificationsProvider>\n </Theme>\n </LanguageProvider>\n </HistoryProvider>\n </AuthProvider>\n </QueryClientProvider>\n </Provider>\n </StrapiAppProvider>\n );\n};\n\nexport { Providers };\n"],"names":["queryClient","QueryClient","defaultOptions","queries","refetchOnWindowFocus","Providers","children","strapi","store","_jsx","StrapiAppProvider","components","library","customFields","widgets","fields","menu","router","getAdminInjectedComponents","getPlugin","plugins","rbac","runHookParallel","runHookWaterfall","name","initialValue","runHookSeries","settings","Provider","QueryClientProvider","client","AuthProvider","HistoryProvider","LanguageProvider","messages","configurations","translations","Theme","themes","NotificationsProvider","TrackingProvider","GuidedTourProvider","UnstableGuidedTourContext","tours","ConfigurationProvider","defaultAuthLogo","authLogo","defaultMenuLogo","menuLogo","showReleaseNotification","notifications","releases"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAMA,WAAAA,GAAc,IAAIC,WAAY,CAAA;IAClCC,cAAgB,EAAA;QACdC,OAAS,EAAA;YACPC,oBAAsB,EAAA;AACxB;AACF;AACF,CAAA,CAAA;AAQMC,MAAAA,SAAAA,GAAY,CAAC,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAkB,GAAA;AAC5D,IAAA,qBACEC,GAACC,CAAAA,iBAAAA,EAAAA;QACCC,UAAYJ,EAAAA,MAAAA,CAAOK,OAAO,CAACD,UAAU;AACrCE,QAAAA,YAAAA,EAAcN,OAAOM,YAAY;AACjCC,QAAAA,OAAAA,EAASP,OAAOO,OAAO;QACvBC,MAAQR,EAAAA,MAAAA,CAAOK,OAAO,CAACG,MAAM;QAC7BC,IAAMT,EAAAA,MAAAA,CAAOU,MAAM,CAACD,IAAI;AACxBE,QAAAA,0BAAAA,EAA4BX,OAAOW,0BAA0B;AAC7DC,QAAAA,SAAAA,EAAWZ,OAAOY,SAAS;AAC3BC,QAAAA,OAAAA,EAASb,OAAOa,OAAO;AACvBC,QAAAA,IAAAA,EAAMd,OAAOc,IAAI;AACjBC,QAAAA,eAAAA,EAAiBf,OAAOe,eAAe;A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,MAAO4B,CAAAA,cAAc,CAACe,aAAa,CAACC,QAAQ;AAEpE7C,oDAAAA,QAAAA,EAAAA;;;;;;;;;;;;;AAc7B;;;;"}
1
+ {"version":3,"file":"Providers.mjs","sources":["../../../../../admin/src/components/Providers.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { QueryClient, QueryClientProvider } from 'react-query';\nimport { Provider } from 'react-redux';\n\nimport { AuthProvider } from '../features/Auth';\nimport { HistoryProvider } from '../features/BackButton';\nimport { ConfigurationProvider } from '../features/Configuration';\nimport { NotificationsProvider } from '../features/Notifications';\nimport { StrapiAppProvider } from '../features/StrapiApp';\nimport { TrackingProvider } from '../features/Tracking';\n\nimport { GuidedTourProvider } from './GuidedTour/Provider';\nimport { LanguageProvider } from './LanguageProvider';\nimport { Theme } from './Theme';\n\nimport type { Store } from '../core/store/configure';\nimport type { StrapiApp } from '../StrapiApp';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n },\n },\n});\n\ninterface ProvidersProps {\n children: React.ReactNode;\n strapi: StrapiApp;\n store: Store;\n}\n\nconst Providers = ({ children, strapi, store }: ProvidersProps) => {\n return (\n <StrapiAppProvider\n components={strapi.library.components}\n customFields={strapi.customFields}\n widgets={strapi.widgets}\n fields={strapi.library.fields}\n menu={strapi.router.menu}\n getAdminInjectedComponents={strapi.getAdminInjectedComponents}\n getPlugin={strapi.getPlugin}\n plugins={strapi.plugins}\n rbac={strapi.rbac}\n runHookParallel={strapi.runHookParallel}\n runHookWaterfall={(name, initialValue) => strapi.runHookWaterfall(name, initialValue, store)}\n runHookSeries={strapi.runHookSeries}\n settings={strapi.router.settings}\n >\n <Provider store={store}>\n <QueryClientProvider client={queryClient}>\n <AuthProvider>\n <HistoryProvider>\n <LanguageProvider messages={strapi.configurations.translations}>\n <Theme themes={strapi.configurations.themes}>\n <NotificationsProvider>\n <TrackingProvider>\n <GuidedTourProvider>\n <ConfigurationProvider\n defaultAuthLogo={strapi.configurations.authLogo}\n defaultMenuLogo={strapi.configurations.menuLogo}\n showReleaseNotification={strapi.configurations.notifications.releases}\n >\n {children}\n </ConfigurationProvider>\n </GuidedTourProvider>\n </TrackingProvider>\n </NotificationsProvider>\n </Theme>\n </LanguageProvider>\n </HistoryProvider>\n </AuthProvider>\n </QueryClientProvider>\n </Provider>\n </StrapiAppProvider>\n );\n};\n\nexport { Providers };\n"],"names":["queryClient","QueryClient","defaultOptions","queries","refetchOnWindowFocus","Providers","children","strapi","store","_jsx","StrapiAppProvider","components","library","customFields","widgets","fields","menu","router","getAdminInjectedComponents","getPlugin","plugins","rbac","runHookParallel","runHookWaterfall","name","initialValue","runHookSeries","settings","Provider","QueryClientProvider","client","AuthProvider","HistoryProvider","LanguageProvider","messages","configurations","translations","Theme","themes","NotificationsProvider","TrackingProvider","GuidedTourProvider","ConfigurationProvider","defaultAuthLogo","authLogo","defaultMenuLogo","menuLogo","showReleaseNotification","notifications","releases"],"mappings":";;;;;;;;;;;;;;AAmBA,MAAMA,WAAAA,GAAc,IAAIC,WAAY,CAAA;IAClCC,cAAgB,EAAA;QACdC,OAAS,EAAA;YACPC,oBAAsB,EAAA;AACxB;AACF;AACF,CAAA,CAAA;AAQMC,MAAAA,SAAAA,GAAY,CAAC,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAkB,GAAA;AAC5D,IAAA,qBACEC,GAACC,CAAAA,iBAAAA,EAAAA;QACCC,UAAYJ,EAAAA,MAAAA,CAAOK,OAAO,CAACD,UAAU;AACrCE,QAAAA,YAAAA,EAAcN,OAAOM,YAAY;AACjCC,QAAAA,OAAAA,EAASP,OAAOO,OAAO;QACvBC,MAAQR,EAAAA,MAAAA,CAAOK,OAAO,CAACG,MAAM;QAC7BC,IAAMT,EAAAA,MAAAA,CAAOU,MAAM,CAACD,IAAI;AACxBE,QAAAA,0BAAAA,EAA4BX,OAAOW,0BAA0B;AAC7DC,QAAAA,SAAAA,EAAWZ,OAAOY,SAAS;AAC3BC,QA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C,gDAAAA,uBAAAA,EAAyBxC,MAAO4B,CAAAA,cAAc,CAACa,aAAa,CAACC,QAAQ;AAEpE3C,gDAAAA,QAAAA,EAAAA;;;;;;;;;;;;AAa3B;;;;"}
@@ -821,12 +821,7 @@ var en = {
821
821
  "request.error.model.unknown": "This model doesn't exist",
822
822
  selectButtonTitle: selectButtonTitle,
823
823
  skipToContent: skipToContent,
824
- submit: submit,
825
- "tours.contentManager.Introduction.title": "Content manager",
826
- "tours.contentManager.Introduction.content": "Create and manage content from your collection types and single types.",
827
- "tours.stepCount": "Step {currentStep} of {tourLength}",
828
- "tours.skip": "Skip",
829
- "tours.next": "Next"
824
+ submit: submit
830
825
  };
831
826
 
832
827
  exports.Analytics = Analytics;
@@ -1 +1 @@
1
- {"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -817,12 +817,7 @@ var en = {
817
817
  "request.error.model.unknown": "This model doesn't exist",
818
818
  selectButtonTitle: selectButtonTitle,
819
819
  skipToContent: skipToContent,
820
- submit: submit,
821
- "tours.contentManager.Introduction.title": "Content manager",
822
- "tours.contentManager.Introduction.content": "Create and manage content from your collection types and single types.",
823
- "tours.stepCount": "Step {currentStep} of {tourLength}",
824
- "tours.skip": "Skip",
825
- "tours.next": "Next"
820
+ submit: submit
826
821
  };
827
822
 
828
823
  export { Analytics, Documentation, Email, Password, Provider, ResetPasswordToken, Role, Username, Users, anErrorOccurred, clearLabel, dark, en as default, light, noPreview, or, selectButtonTitle, skipToContent, submit };
@@ -1 +1 @@
1
- {"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,75 @@
1
+ 'use strict';
2
+
3
+ var jsonLogic = require('json-logic-js');
4
+ var zod = require('zod');
5
+
6
+ const ConditionSchema = zod.z.object({
7
+ dependsOn: zod.z.string().min(1),
8
+ operator: zod.z.enum([
9
+ 'is',
10
+ 'isNot'
11
+ ]),
12
+ value: zod.z.union([
13
+ zod.z.string(),
14
+ zod.z.number(),
15
+ zod.z.boolean()
16
+ ])
17
+ });
18
+ function createRulesEngine() {
19
+ /**
20
+ * Transforms a high-level `Condition` object into a JSON Logic-compatible condition.
21
+ *
22
+ * Converts operators like 'is' and 'isNot' into their JSON Logic equivalents ('==' and '!=').
23
+ * Throws an error if the operator is not supported.
24
+ *
25
+ * @param condition - The condition object to convert.
26
+ * @returns A JSON Logic AST representing the condition.
27
+ * @throws {Error} If the operator is not recognized.
28
+ */ const generate = (condition)=>{
29
+ const { dependsOn, operator, value } = condition;
30
+ const operatorsMap = {
31
+ is: '==',
32
+ isNot: '!='
33
+ };
34
+ if (!operatorsMap[operator]) {
35
+ throw new Error(`Invalid operator: ${operator}`);
36
+ }
37
+ return {
38
+ [operatorsMap[operator]]: [
39
+ {
40
+ var: dependsOn
41
+ },
42
+ value
43
+ ]
44
+ };
45
+ };
46
+ /**
47
+ * Validates a condition object against the `ConditionSchema`.
48
+ *
49
+ * Ensures that the condition adheres to the expected structure and types.
50
+ *
51
+ * @param condition - The condition object to validate.
52
+ * @throws {ZodError} If the condition is invalid.
53
+ */ const validate = (condition)=>{
54
+ ConditionSchema.parse(condition);
55
+ };
56
+ /**
57
+ * Evaluates a JSON Logic condition against provided data.
58
+ * @throws {Error} If the condition is invalid.
59
+ */ const evaluate = (condition, data)=>{
60
+ try {
61
+ return jsonLogic.apply(condition, data);
62
+ } catch (err) {
63
+ throw new Error(`Invalid condition: ${err.message}`);
64
+ }
65
+ };
66
+ return {
67
+ generate,
68
+ validate,
69
+ evaluate
70
+ };
71
+ }
72
+
73
+ exports.ConditionSchema = ConditionSchema;
74
+ exports.createRulesEngine = createRulesEngine;
75
+ //# sourceMappingURL=rulesEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rulesEngine.js","sources":["../../../../../admin/src/utils/rulesEngine.ts"],"sourcesContent":["import jsonLogic from 'json-logic-js';\nimport { z } from 'zod';\n\nexport const ConditionSchema = z.object({\n dependsOn: z.string().min(1),\n operator: z.enum(['is', 'isNot']),\n value: z.union([z.string(), z.number(), z.boolean()]),\n});\n\nexport type Condition = z.infer<typeof ConditionSchema>;\nexport type JsonLogicCondition = jsonLogic.RulesLogic<jsonLogic.AdditionalOperation>;\nexport type RulesEngine = {\n generate: (condition: Condition) => JsonLogicCondition;\n validate: (condition: Condition) => void;\n evaluate: (condition: JsonLogicCondition, data: unknown) => boolean;\n};\n\nexport function createRulesEngine(): RulesEngine {\n /**\n * Transforms a high-level `Condition` object into a JSON Logic-compatible condition.\n *\n * Converts operators like 'is' and 'isNot' into their JSON Logic equivalents ('==' and '!=').\n * Throws an error if the operator is not supported.\n *\n * @param condition - The condition object to convert.\n * @returns A JSON Logic AST representing the condition.\n * @throws {Error} If the operator is not recognized.\n */\n const generate = (condition: Condition): JsonLogicCondition => {\n const { dependsOn, operator, value } = condition;\n const operatorsMap = {\n is: '==',\n isNot: '!=',\n };\n if (!operatorsMap[operator]) {\n throw new Error(`Invalid operator: ${operator}`);\n }\n return { [operatorsMap[operator]]: [{ var: dependsOn }, value] };\n };\n\n /**\n * Validates a condition object against the `ConditionSchema`.\n *\n * Ensures that the condition adheres to the expected structure and types.\n *\n * @param condition - The condition object to validate.\n * @throws {ZodError} If the condition is invalid.\n */\n const validate = (condition: Condition) => {\n ConditionSchema.parse(condition);\n };\n\n /**\n * Evaluates a JSON Logic condition against provided data.\n * @throws {Error} If the condition is invalid.\n */\n const evaluate = (\n condition: jsonLogic.RulesLogic<jsonLogic.AdditionalOperation>,\n data: unknown\n ): boolean => {\n try {\n return jsonLogic.apply(condition, data);\n } catch (err: any) {\n throw new Error(`Invalid condition: ${err.message}`);\n }\n };\n\n return {\n generate,\n validate,\n evaluate,\n };\n}\n"],"names":["ConditionSchema","z","object","dependsOn","string","min","operator","enum","value","union","number","boolean","createRulesEngine","generate","condition","operatorsMap","is","isNot","Error","var","validate","parse","evaluate","data","jsonLogic","apply","err","message"],"mappings":";;;;;AAGaA,MAAAA,eAAAA,GAAkBC,KAAEC,CAAAA,MAAM,CAAC;AACtCC,IAAAA,SAAAA,EAAWF,KAAEG,CAAAA,MAAM,EAAGC,CAAAA,GAAG,CAAC,CAAA,CAAA;IAC1BC,QAAUL,EAAAA,KAAAA,CAAEM,IAAI,CAAC;AAAC,QAAA,IAAA;AAAM,QAAA;AAAQ,KAAA,CAAA;IAChCC,KAAOP,EAAAA,KAAAA,CAAEQ,KAAK,CAAC;AAACR,QAAAA,KAAAA,CAAEG,MAAM,EAAA;AAAIH,QAAAA,KAAAA,CAAES,MAAM,EAAA;AAAIT,QAAAA,KAAAA,CAAEU,OAAO;AAAG,KAAA;AACtD,CAAG;AAUI,SAASC,iBAAAA,GAAAA;AACd;;;;;;;;;MAUA,MAAMC,WAAW,CAACC,SAAAA,GAAAA;AAChB,QAAA,MAAM,EAAEX,SAAS,EAAEG,QAAQ,EAAEE,KAAK,EAAE,GAAGM,SAAAA;AACvC,QAAA,MAAMC,YAAe,GAAA;YACnBC,EAAI,EAAA,IAAA;YACJC,KAAO,EAAA;AACT,SAAA;AACA,QAAA,IAAI,CAACF,YAAY,CAACT,QAAAA,CAAS,EAAE;AAC3B,YAAA,MAAM,IAAIY,KAAM,CAAA,CAAC,kBAAkB,EAAEZ,SAAS,CAAC,CAAA;AACjD;QACA,OAAO;AAAE,YAAA,CAACS,YAAY,CAACT,QAAS,CAAA,GAAG;AAAC,gBAAA;oBAAEa,GAAKhB,EAAAA;AAAU,iBAAA;AAAGK,gBAAAA;AAAM;AAAC,SAAA;AACjE,KAAA;AAEA;;;;;;;MAQA,MAAMY,WAAW,CAACN,SAAAA,GAAAA;AAChBd,QAAAA,eAAAA,CAAgBqB,KAAK,CAACP,SAAAA,CAAAA;AACxB,KAAA;AAEA;;;MAIA,MAAMQ,QAAW,GAAA,CACfR,SACAS,EAAAA,IAAAA,GAAAA;QAEA,IAAI;YACF,OAAOC,SAAAA,CAAUC,KAAK,CAACX,SAAWS,EAAAA,IAAAA,CAAAA;AACpC,SAAA,CAAE,OAAOG,GAAU,EAAA;YACjB,MAAM,IAAIR,MAAM,CAAC,mBAAmB,EAAEQ,GAAIC,CAAAA,OAAO,CAAC,CAAC,CAAA;AACrD;AACF,KAAA;IAEA,OAAO;AACLd,QAAAA,QAAAA;AACAO,QAAAA,QAAAA;AACAE,QAAAA;AACF,KAAA;AACF;;;;;"}
@@ -0,0 +1,72 @@
1
+ import jsonLogic from 'json-logic-js';
2
+ import { z } from 'zod';
3
+
4
+ const ConditionSchema = z.object({
5
+ dependsOn: z.string().min(1),
6
+ operator: z.enum([
7
+ 'is',
8
+ 'isNot'
9
+ ]),
10
+ value: z.union([
11
+ z.string(),
12
+ z.number(),
13
+ z.boolean()
14
+ ])
15
+ });
16
+ function createRulesEngine() {
17
+ /**
18
+ * Transforms a high-level `Condition` object into a JSON Logic-compatible condition.
19
+ *
20
+ * Converts operators like 'is' and 'isNot' into their JSON Logic equivalents ('==' and '!=').
21
+ * Throws an error if the operator is not supported.
22
+ *
23
+ * @param condition - The condition object to convert.
24
+ * @returns A JSON Logic AST representing the condition.
25
+ * @throws {Error} If the operator is not recognized.
26
+ */ const generate = (condition)=>{
27
+ const { dependsOn, operator, value } = condition;
28
+ const operatorsMap = {
29
+ is: '==',
30
+ isNot: '!='
31
+ };
32
+ if (!operatorsMap[operator]) {
33
+ throw new Error(`Invalid operator: ${operator}`);
34
+ }
35
+ return {
36
+ [operatorsMap[operator]]: [
37
+ {
38
+ var: dependsOn
39
+ },
40
+ value
41
+ ]
42
+ };
43
+ };
44
+ /**
45
+ * Validates a condition object against the `ConditionSchema`.
46
+ *
47
+ * Ensures that the condition adheres to the expected structure and types.
48
+ *
49
+ * @param condition - The condition object to validate.
50
+ * @throws {ZodError} If the condition is invalid.
51
+ */ const validate = (condition)=>{
52
+ ConditionSchema.parse(condition);
53
+ };
54
+ /**
55
+ * Evaluates a JSON Logic condition against provided data.
56
+ * @throws {Error} If the condition is invalid.
57
+ */ const evaluate = (condition, data)=>{
58
+ try {
59
+ return jsonLogic.apply(condition, data);
60
+ } catch (err) {
61
+ throw new Error(`Invalid condition: ${err.message}`);
62
+ }
63
+ };
64
+ return {
65
+ generate,
66
+ validate,
67
+ evaluate
68
+ };
69
+ }
70
+
71
+ export { ConditionSchema, createRulesEngine };
72
+ //# sourceMappingURL=rulesEngine.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rulesEngine.mjs","sources":["../../../../../admin/src/utils/rulesEngine.ts"],"sourcesContent":["import jsonLogic from 'json-logic-js';\nimport { z } from 'zod';\n\nexport const ConditionSchema = z.object({\n dependsOn: z.string().min(1),\n operator: z.enum(['is', 'isNot']),\n value: z.union([z.string(), z.number(), z.boolean()]),\n});\n\nexport type Condition = z.infer<typeof ConditionSchema>;\nexport type JsonLogicCondition = jsonLogic.RulesLogic<jsonLogic.AdditionalOperation>;\nexport type RulesEngine = {\n generate: (condition: Condition) => JsonLogicCondition;\n validate: (condition: Condition) => void;\n evaluate: (condition: JsonLogicCondition, data: unknown) => boolean;\n};\n\nexport function createRulesEngine(): RulesEngine {\n /**\n * Transforms a high-level `Condition` object into a JSON Logic-compatible condition.\n *\n * Converts operators like 'is' and 'isNot' into their JSON Logic equivalents ('==' and '!=').\n * Throws an error if the operator is not supported.\n *\n * @param condition - The condition object to convert.\n * @returns A JSON Logic AST representing the condition.\n * @throws {Error} If the operator is not recognized.\n */\n const generate = (condition: Condition): JsonLogicCondition => {\n const { dependsOn, operator, value } = condition;\n const operatorsMap = {\n is: '==',\n isNot: '!=',\n };\n if (!operatorsMap[operator]) {\n throw new Error(`Invalid operator: ${operator}`);\n }\n return { [operatorsMap[operator]]: [{ var: dependsOn }, value] };\n };\n\n /**\n * Validates a condition object against the `ConditionSchema`.\n *\n * Ensures that the condition adheres to the expected structure and types.\n *\n * @param condition - The condition object to validate.\n * @throws {ZodError} If the condition is invalid.\n */\n const validate = (condition: Condition) => {\n ConditionSchema.parse(condition);\n };\n\n /**\n * Evaluates a JSON Logic condition against provided data.\n * @throws {Error} If the condition is invalid.\n */\n const evaluate = (\n condition: jsonLogic.RulesLogic<jsonLogic.AdditionalOperation>,\n data: unknown\n ): boolean => {\n try {\n return jsonLogic.apply(condition, data);\n } catch (err: any) {\n throw new Error(`Invalid condition: ${err.message}`);\n }\n };\n\n return {\n generate,\n validate,\n evaluate,\n };\n}\n"],"names":["ConditionSchema","z","object","dependsOn","string","min","operator","enum","value","union","number","boolean","createRulesEngine","generate","condition","operatorsMap","is","isNot","Error","var","validate","parse","evaluate","data","jsonLogic","apply","err","message"],"mappings":";;;AAGaA,MAAAA,eAAAA,GAAkBC,CAAEC,CAAAA,MAAM,CAAC;AACtCC,IAAAA,SAAAA,EAAWF,CAAEG,CAAAA,MAAM,EAAGC,CAAAA,GAAG,CAAC,CAAA,CAAA;IAC1BC,QAAUL,EAAAA,CAAAA,CAAEM,IAAI,CAAC;AAAC,QAAA,IAAA;AAAM,QAAA;AAAQ,KAAA,CAAA;IAChCC,KAAOP,EAAAA,CAAAA,CAAEQ,KAAK,CAAC;AAACR,QAAAA,CAAAA,CAAEG,MAAM,EAAA;AAAIH,QAAAA,CAAAA,CAAES,MAAM,EAAA;AAAIT,QAAAA,CAAAA,CAAEU,OAAO;AAAG,KAAA;AACtD,CAAG;AAUI,SAASC,iBAAAA,GAAAA;AACd;;;;;;;;;MAUA,MAAMC,WAAW,CAACC,SAAAA,GAAAA;AAChB,QAAA,MAAM,EAAEX,SAAS,EAAEG,QAAQ,EAAEE,KAAK,EAAE,GAAGM,SAAAA;AACvC,QAAA,MAAMC,YAAe,GAAA;YACnBC,EAAI,EAAA,IAAA;YACJC,KAAO,EAAA;AACT,SAAA;AACA,QAAA,IAAI,CAACF,YAAY,CAACT,QAAAA,CAAS,EAAE;AAC3B,YAAA,MAAM,IAAIY,KAAM,CAAA,CAAC,kBAAkB,EAAEZ,SAAS,CAAC,CAAA;AACjD;QACA,OAAO;AAAE,YAAA,CAACS,YAAY,CAACT,QAAS,CAAA,GAAG;AAAC,gBAAA;oBAAEa,GAAKhB,EAAAA;AAAU,iBAAA;AAAGK,gBAAAA;AAAM;AAAC,SAAA;AACjE,KAAA;AAEA;;;;;;;MAQA,MAAMY,WAAW,CAACN,SAAAA,GAAAA;AAChBd,QAAAA,eAAAA,CAAgBqB,KAAK,CAACP,SAAAA,CAAAA;AACxB,KAAA;AAEA;;;MAIA,MAAMQ,QAAW,GAAA,CACfR,SACAS,EAAAA,IAAAA,GAAAA;QAEA,IAAI;YACF,OAAOC,SAAAA,CAAUC,KAAK,CAACX,SAAWS,EAAAA,IAAAA,CAAAA;AACpC,SAAA,CAAE,OAAOG,GAAU,EAAA;YACjB,MAAM,IAAIR,MAAM,CAAC,mBAAmB,EAAEQ,GAAIC,CAAAA,OAAO,CAAC,CAAC,CAAA;AACrD;AACF,KAAA;IAEA,OAAO;AACLd,QAAAA,QAAAA;AACAO,QAAAA,QAAAA;AACAE,QAAAA;AACF,KAAA;AACF;;;;"}
@@ -17,7 +17,6 @@ var ContentBox = require('./admin/src/components/ContentBox.js');
17
17
  var SubNav = require('./admin/src/components/SubNav.js');
18
18
  var GradientBadge = require('./admin/src/components/GradientBadge.js');
19
19
  var Provider = require('./admin/src/components/GuidedTour/Provider.js');
20
- var Tours = require('./admin/src/components/UnstableGuidedTour/Tours.js');
21
20
  var Tracking = require('./admin/src/features/Tracking.js');
22
21
  var StrapiApp = require('./admin/src/features/StrapiApp.js');
23
22
  var Notifications = require('./admin/src/features/Notifications.js');
@@ -35,6 +34,7 @@ var users = require('./admin/src/services/users.js');
35
34
  var translatedErrors = require('./admin/src/utils/translatedErrors.js');
36
35
  var getFetchClient = require('./admin/src/utils/getFetchClient.js');
37
36
  var baseQuery = require('./admin/src/utils/baseQuery.js');
37
+ var rulesEngine = require('./admin/src/utils/rulesEngine.js');
38
38
  var api = require('./admin/src/services/api.js');
39
39
  var Layout = require('./admin/src/components/Layouts/Layout.js');
40
40
 
@@ -63,7 +63,6 @@ exports.ContentBox = ContentBox.ContentBox;
63
63
  exports.SubNav = SubNav.SubNav;
64
64
  exports.GradientBadge = GradientBadge.GradientBadge;
65
65
  exports.useGuidedTour = Provider.useGuidedTour;
66
- exports.unstable_tours = Tours.tours;
67
66
  exports.useTracking = Tracking.useTracking;
68
67
  exports.useStrapiApp = StrapiApp.useStrapiApp;
69
68
  exports.NotificationsProvider = Notifications.NotificationsProvider;
@@ -85,6 +84,8 @@ exports.getFetchClient = getFetchClient.getFetchClient;
85
84
  exports.isFetchError = getFetchClient.isFetchError;
86
85
  exports.fetchBaseQuery = baseQuery.fetchBaseQuery;
87
86
  exports.isBaseQueryError = baseQuery.isBaseQueryError;
87
+ exports.ConditionSchema = rulesEngine.ConditionSchema;
88
+ exports.createRulesEngine = rulesEngine.createRulesEngine;
88
89
  exports.adminApi = api.adminApi;
89
90
  exports.Layouts = Layout.Layouts;
90
91
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -15,7 +15,6 @@ export { ContentBox } from './admin/src/components/ContentBox.mjs';
15
15
  export { SubNav } from './admin/src/components/SubNav.mjs';
16
16
  export { GradientBadge } from './admin/src/components/GradientBadge.mjs';
17
17
  export { useGuidedTour } from './admin/src/components/GuidedTour/Provider.mjs';
18
- export { tours as unstable_tours } from './admin/src/components/UnstableGuidedTour/Tours.mjs';
19
18
  export { useTracking } from './admin/src/features/Tracking.mjs';
20
19
  export { useStrapiApp } from './admin/src/features/StrapiApp.mjs';
21
20
  export { NotificationsProvider, useNotification } from './admin/src/features/Notifications.mjs';
@@ -33,6 +32,7 @@ export { useAdminUsers } from './admin/src/services/users.mjs';
33
32
  export { translatedErrors } from './admin/src/utils/translatedErrors.mjs';
34
33
  export { FetchError, getFetchClient, isFetchError } from './admin/src/utils/getFetchClient.mjs';
35
34
  export { fetchBaseQuery, isBaseQueryError } from './admin/src/utils/baseQuery.mjs';
35
+ export { ConditionSchema, createRulesEngine } from './admin/src/utils/rulesEngine.mjs';
36
36
  export { adminApi } from './admin/src/services/api.mjs';
37
37
  export { Layouts } from './admin/src/components/Layouts/Layout.mjs';
38
38
  //# sourceMappingURL=index.mjs.map
@@ -23,7 +23,6 @@ export * from './components/ContentBox';
23
23
  export * from './components/SubNav';
24
24
  export * from './components/GradientBadge';
25
25
  export { useGuidedTour } from './components/GuidedTour/Provider';
26
- export { tours as unstable_tours } from './components/UnstableGuidedTour/Tours';
27
26
  /**
28
27
  * Features
29
28
  */
@@ -61,6 +60,7 @@ export type { Widget as WidgetType } from './core/apis/Widgets';
61
60
  export { translatedErrors } from './utils/translatedErrors';
62
61
  export * from './utils/getFetchClient';
63
62
  export * from './utils/baseQuery';
63
+ export * from './utils/rulesEngine';
64
64
  export * from './services/api';
65
65
  export type { CMAdminConfiguration } from './types/adminConfiguration';
66
66
  /**
@@ -0,0 +1,23 @@
1
+ import jsonLogic from 'json-logic-js';
2
+ import { z } from 'zod';
3
+ export declare const ConditionSchema: z.ZodObject<{
4
+ dependsOn: z.ZodString;
5
+ operator: z.ZodEnum<["is", "isNot"]>;
6
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ value: string | number | boolean;
9
+ operator: "is" | "isNot";
10
+ dependsOn: string;
11
+ }, {
12
+ value: string | number | boolean;
13
+ operator: "is" | "isNot";
14
+ dependsOn: string;
15
+ }>;
16
+ export type Condition = z.infer<typeof ConditionSchema>;
17
+ export type JsonLogicCondition = jsonLogic.RulesLogic<jsonLogic.AdditionalOperation>;
18
+ export type RulesEngine = {
19
+ generate: (condition: Condition) => JsonLogicCondition;
20
+ validate: (condition: Condition) => void;
21
+ evaluate: (condition: JsonLogicCondition, data: unknown) => boolean;
22
+ };
23
+ export declare function createRulesEngine(): RulesEngine;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/admin",
3
- "version": "5.16.1",
3
+ "version": "5.17.0-beta.0",
4
4
  "description": "Strapi Admin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -84,12 +84,12 @@
84
84
  "@radix-ui/react-context": "1.0.1",
85
85
  "@radix-ui/react-toolbar": "1.0.4",
86
86
  "@reduxjs/toolkit": "1.9.7",
87
- "@strapi/design-system": "2.0.0-rc.27",
88
- "@strapi/icons": "2.0.0-rc.27",
89
- "@strapi/permissions": "5.16.1",
90
- "@strapi/types": "5.16.1",
91
- "@strapi/typescript-utils": "5.16.1",
92
- "@strapi/utils": "5.16.1",
87
+ "@strapi/design-system": "2.0.0-rc.26",
88
+ "@strapi/icons": "2.0.0-rc.26",
89
+ "@strapi/permissions": "5.17.0-beta.0",
90
+ "@strapi/types": "5.17.0-beta.0",
91
+ "@strapi/typescript-utils": "5.17.0-beta.0",
92
+ "@strapi/utils": "5.17.0-beta.0",
93
93
  "@testing-library/dom": "10.1.0",
94
94
  "@testing-library/react": "15.0.7",
95
95
  "@testing-library/user-event": "14.5.2",
@@ -110,6 +110,7 @@
110
110
  "inquirer": "8.2.5",
111
111
  "invariant": "^2.2.4",
112
112
  "is-localhost-ip": "2.0.0",
113
+ "json-logic-js": "2.0.5",
113
114
  "jsonwebtoken": "9.0.0",
114
115
  "koa": "2.16.1",
115
116
  "koa-compose": "4.1.0",
@@ -143,11 +144,12 @@
143
144
  "zod": "3.24.2"
144
145
  },
145
146
  "devDependencies": {
146
- "@strapi/admin-test-utils": "5.16.1",
147
- "@strapi/data-transfer": "5.16.1",
147
+ "@strapi/admin-test-utils": "5.17.0-beta.0",
148
+ "@strapi/data-transfer": "5.17.0-beta.0",
148
149
  "@types/codemirror5": "npm:@types/codemirror@^5.60.15",
149
150
  "@types/fs-extra": "11.0.4",
150
151
  "@types/invariant": "2.2.36",
152
+ "@types/json-logic-js": "2.0.8",
151
153
  "@types/jsonwebtoken": "9.0.3",
152
154
  "@types/koa-passport": "6.0.1",
153
155
  "@types/lodash": "^4.14.191",
@@ -1,66 +0,0 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var React = require('react');
5
- var immer = require('immer');
6
- var Context = require('../Context.js');
7
-
8
- function _interopNamespaceDefault(e) {
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n.default = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
26
-
27
- const [GuidedTourProviderImpl, unstableUseGuidedTour] = Context.createContext('UnstableGuidedTour');
28
- function reducer(state, action) {
29
- return immer.produce(state, (draft)=>{
30
- if (action.type === 'next_step') {
31
- const nextStep = draft.tours[action.payload].currentStep + 1;
32
- draft.tours[action.payload].currentStep = nextStep;
33
- draft.tours[action.payload].isCompleted = nextStep === draft.tours[action.payload].length;
34
- // TODO: Update local storage
35
- }
36
- if (action.type === 'skip_tour') {
37
- draft.tours[action.payload].isCompleted = true;
38
- // TODO: Update local storage
39
- }
40
- });
41
- }
42
- const UnstableGuidedTourContext = ({ children, tours: registeredTours })=>{
43
- // Derive the tour state from the tours object
44
- const tours = Object.keys(registeredTours).reduce((acc, tourName)=>{
45
- const tourLength = Object.keys(registeredTours[tourName]).length;
46
- acc[tourName] = {
47
- currentStep: 0,
48
- length: tourLength,
49
- isCompleted: false
50
- };
51
- return acc;
52
- }, {});
53
- const [state, dispatch] = React__namespace.useReducer(reducer, {
54
- tours
55
- });
56
- return /*#__PURE__*/ jsxRuntime.jsx(GuidedTourProviderImpl, {
57
- state: state,
58
- dispatch: dispatch,
59
- children: children
60
- });
61
- };
62
-
63
- exports.UnstableGuidedTourContext = UnstableGuidedTourContext;
64
- exports.reducer = reducer;
65
- exports.unstableUseGuidedTour = unstableUseGuidedTour;
66
- //# sourceMappingURL=Context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Context.js","sources":["../../../../../../admin/src/components/UnstableGuidedTour/Context.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { produce } from 'immer';\n\nimport { createContext } from '../Context';\n\nimport type { Tours } from './Tours';\n\n/* -------------------------------------------------------------------------------------------------\n * GuidedTourProvider\n * -----------------------------------------------------------------------------------------------*/\n\ntype ValidTourName = keyof Tours;\n\ntype Action =\n | {\n type: 'next_step';\n payload: ValidTourName;\n }\n | {\n type: 'skip_tour';\n payload: ValidTourName;\n };\n\ntype State = {\n tours: Record<ValidTourName, { currentStep: number; length: number; isCompleted: boolean }>;\n};\n\nconst [GuidedTourProviderImpl, unstableUseGuidedTour] = createContext<{\n state: State;\n dispatch: React.Dispatch<Action>;\n}>('UnstableGuidedTour');\n\nfunction reducer(state: State, action: Action): State {\n return produce(state, (draft) => {\n if (action.type === 'next_step') {\n const nextStep = draft.tours[action.payload].currentStep + 1;\n draft.tours[action.payload].currentStep = nextStep;\n draft.tours[action.payload].isCompleted = nextStep === draft.tours[action.payload].length;\n // TODO: Update local storage\n }\n\n if (action.type === 'skip_tour') {\n draft.tours[action.payload].isCompleted = true;\n // TODO: Update local storage\n }\n });\n}\n\nconst UnstableGuidedTourContext = ({\n children,\n tours: registeredTours,\n}: {\n children: React.ReactNode;\n // NOTE: Maybe we just import this directly instead of a prop?\n tours: Tours;\n}) => {\n // Derive the tour state from the tours object\n const tours = Object.keys(registeredTours).reduce(\n (acc, tourName) => {\n const tourLength = Object.keys(registeredTours[tourName as ValidTourName]).length;\n acc[tourName as ValidTourName] = {\n currentStep: 0,\n length: tourLength,\n isCompleted: false,\n };\n return acc;\n },\n {} as Record<ValidTourName, { currentStep: number; length: number; isCompleted: boolean }>\n );\n const [state, dispatch] = React.useReducer(reducer, {\n tours,\n });\n\n return (\n <GuidedTourProviderImpl state={state} dispatch={dispatch}>\n {children}\n </GuidedTourProviderImpl>\n );\n};\n\nexport type { Action, State, ValidTourName };\nexport { UnstableGuidedTourContext, unstableUseGuidedTour, reducer };\n"],"names":["GuidedTourProviderImpl","unstableUseGuidedTour","createContext","reducer","state","action","produce","draft","type","nextStep","tours","payload","currentStep","isCompleted","length","UnstableGuidedTourContext","children","registeredTours","Object","keys","reduce","acc","tourName","tourLength","dispatch","React","useReducer","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,CAACA,sBAAAA,EAAwBC,qBAAsB,CAAA,GAAGC,qBAGrD,CAAA,oBAAA;AAEH,SAASC,OAAAA,CAAQC,KAAY,EAAEC,MAAc,EAAA;IAC3C,OAAOC,aAAAA,CAAQF,OAAO,CAACG,KAAAA,GAAAA;QACrB,IAAIF,MAAAA,CAAOG,IAAI,KAAK,WAAa,EAAA;YAC/B,MAAMC,QAAAA,GAAWF,MAAMG,KAAK,CAACL,OAAOM,OAAO,CAAC,CAACC,WAAW,GAAG,CA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as React from 'react';
3
- import { produce } from 'immer';
4
- import { createContext } from '../Context.mjs';
5
-
6
- const [GuidedTourProviderImpl, unstableUseGuidedTour] = createContext('UnstableGuidedTour');
7
- function reducer(state, action) {
8
- return produce(state, (draft)=>{
9
- if (action.type === 'next_step') {
10
- const nextStep = draft.tours[action.payload].currentStep + 1;
11
- draft.tours[action.payload].currentStep = nextStep;
12
- draft.tours[action.payload].isCompleted = nextStep === draft.tours[action.payload].length;
13
- // TODO: Update local storage
14
- }
15
- if (action.type === 'skip_tour') {
16
- draft.tours[action.payload].isCompleted = true;
17
- // TODO: Update local storage
18
- }
19
- });
20
- }
21
- const UnstableGuidedTourContext = ({ children, tours: registeredTours })=>{
22
- // Derive the tour state from the tours object
23
- const tours = Object.keys(registeredTours).reduce((acc, tourName)=>{
24
- const tourLength = Object.keys(registeredTours[tourName]).length;
25
- acc[tourName] = {
26
- currentStep: 0,
27
- length: tourLength,
28
- isCompleted: false
29
- };
30
- return acc;
31
- }, {});
32
- const [state, dispatch] = React.useReducer(reducer, {
33
- tours
34
- });
35
- return /*#__PURE__*/ jsx(GuidedTourProviderImpl, {
36
- state: state,
37
- dispatch: dispatch,
38
- children: children
39
- });
40
- };
41
-
42
- export { UnstableGuidedTourContext, reducer, unstableUseGuidedTour };
43
- //# sourceMappingURL=Context.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Context.mjs","sources":["../../../../../../admin/src/components/UnstableGuidedTour/Context.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { produce } from 'immer';\n\nimport { createContext } from '../Context';\n\nimport type { Tours } from './Tours';\n\n/* -------------------------------------------------------------------------------------------------\n * GuidedTourProvider\n * -----------------------------------------------------------------------------------------------*/\n\ntype ValidTourName = keyof Tours;\n\ntype Action =\n | {\n type: 'next_step';\n payload: ValidTourName;\n }\n | {\n type: 'skip_tour';\n payload: ValidTourName;\n };\n\ntype State = {\n tours: Record<ValidTourName, { currentStep: number; length: number; isCompleted: boolean }>;\n};\n\nconst [GuidedTourProviderImpl, unstableUseGuidedTour] = createContext<{\n state: State;\n dispatch: React.Dispatch<Action>;\n}>('UnstableGuidedTour');\n\nfunction reducer(state: State, action: Action): State {\n return produce(state, (draft) => {\n if (action.type === 'next_step') {\n const nextStep = draft.tours[action.payload].currentStep + 1;\n draft.tours[action.payload].currentStep = nextStep;\n draft.tours[action.payload].isCompleted = nextStep === draft.tours[action.payload].length;\n // TODO: Update local storage\n }\n\n if (action.type === 'skip_tour') {\n draft.tours[action.payload].isCompleted = true;\n // TODO: Update local storage\n }\n });\n}\n\nconst UnstableGuidedTourContext = ({\n children,\n tours: registeredTours,\n}: {\n children: React.ReactNode;\n // NOTE: Maybe we just import this directly instead of a prop?\n tours: Tours;\n}) => {\n // Derive the tour state from the tours object\n const tours = Object.keys(registeredTours).reduce(\n (acc, tourName) => {\n const tourLength = Object.keys(registeredTours[tourName as ValidTourName]).length;\n acc[tourName as ValidTourName] = {\n currentStep: 0,\n length: tourLength,\n isCompleted: false,\n };\n return acc;\n },\n {} as Record<ValidTourName, { currentStep: number; length: number; isCompleted: boolean }>\n );\n const [state, dispatch] = React.useReducer(reducer, {\n tours,\n });\n\n return (\n <GuidedTourProviderImpl state={state} dispatch={dispatch}>\n {children}\n </GuidedTourProviderImpl>\n );\n};\n\nexport type { Action, State, ValidTourName };\nexport { UnstableGuidedTourContext, unstableUseGuidedTour, reducer };\n"],"names":["GuidedTourProviderImpl","unstableUseGuidedTour","createContext","reducer","state","action","produce","draft","type","nextStep","tours","payload","currentStep","isCompleted","length","UnstableGuidedTourContext","children","registeredTours","Object","keys","reduce","acc","tourName","tourLength","dispatch","React","useReducer","_jsx"],"mappings":";;;;;AA4BA,MAAM,CAACA,sBAAAA,EAAwBC,qBAAsB,CAAA,GAAGC,aAGrD,CAAA,oBAAA;AAEH,SAASC,OAAAA,CAAQC,KAAY,EAAEC,MAAc,EAAA;IAC3C,OAAOC,OAAAA,CAAQF,OAAO,CAACG,KAAAA,GAAAA;QACrB,IAAIF,M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