@deenruv/admin-dashboard 1.0.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 (292) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +30 -0
  3. package/dist/@types/resources.js +51 -0
  4. package/dist/DeenruvAdminPanel.js +118 -0
  5. package/dist/DeenruvDeveloperIndicator.js +57 -0
  6. package/dist/components/Aexol.js +4 -0
  7. package/dist/components/BrandLogo.js +22 -0
  8. package/dist/components/CanLeaveRouteDialog.js +8 -0
  9. package/dist/components/DataTable.js +13 -0
  10. package/dist/components/DeleteDialog.js +6 -0
  11. package/dist/components/DuplicateEntry.js +46 -0
  12. package/dist/components/GlobalSearch.js +134 -0
  13. package/dist/components/History/AddEntryForm.js +29 -0
  14. package/dist/components/History/DeleteEntryDialog.js +25 -0
  15. package/dist/components/History/EditEntryDialog.js +32 -0
  16. package/dist/components/History/History.js +13 -0
  17. package/dist/components/History/ModifyHistoryInfo.js +6 -0
  18. package/dist/components/History/Timeline.js +53 -0
  19. package/dist/components/History/index.js +5 -0
  20. package/dist/components/Menu/ActiveAdmins.js +24 -0
  21. package/dist/components/Menu/ChannelSwitcher.js +20 -0
  22. package/dist/components/Menu/LanguagesDropdown.js +26 -0
  23. package/dist/components/Menu/Navigation.js +270 -0
  24. package/dist/components/Menu/NavigationFooter.js +12 -0
  25. package/dist/components/Menu/Notifications.js +90 -0
  26. package/dist/components/Menu/index.js +67 -0
  27. package/dist/components/index.js +6 -0
  28. package/dist/graphql/base.js +95 -0
  29. package/dist/graphql/collections.js +94 -0
  30. package/dist/graphql/draft_order.js +307 -0
  31. package/dist/graphql/orders.js +157 -0
  32. package/dist/graphql/products.js +230 -0
  33. package/dist/graphql/scalars.js +22 -0
  34. package/dist/i18.js +13 -0
  35. package/dist/index.css +161 -0
  36. package/dist/index.d.ts +11 -0
  37. package/dist/index.js +1 -0
  38. package/dist/locales/en/admins.json +57 -0
  39. package/dist/locales/en/assets.json +69 -0
  40. package/dist/locales/en/channels.json +66 -0
  41. package/dist/locales/en/collections.json +145 -0
  42. package/dist/locales/en/common.json +1127 -0
  43. package/dist/locales/en/countries.json +50 -0
  44. package/dist/locales/en/customerGroups.json +6 -0
  45. package/dist/locales/en/customers.json +109 -0
  46. package/dist/locales/en/dashboard.json +34 -0
  47. package/dist/locales/en/facets.json +78 -0
  48. package/dist/locales/en/globalSettings.json +15 -0
  49. package/dist/locales/en/index.js +52 -0
  50. package/dist/locales/en/orders.json +932 -0
  51. package/dist/locales/en/paymentMethods.json +59 -0
  52. package/dist/locales/en/permissions.json +94 -0
  53. package/dist/locales/en/products.json +194 -0
  54. package/dist/locales/en/promotions.json +65 -0
  55. package/dist/locales/en/roles.json +59 -0
  56. package/dist/locales/en/sellers.json +41 -0
  57. package/dist/locales/en/shippingMethods.json +84 -0
  58. package/dist/locales/en/stockLocations.json +40 -0
  59. package/dist/locales/en/system.json +41 -0
  60. package/dist/locales/en/table.json +201 -0
  61. package/dist/locales/en/taxCategories.json +47 -0
  62. package/dist/locales/en/taxRates.json +56 -0
  63. package/dist/locales/en/zones.json +47 -0
  64. package/dist/locales/index.js +2 -0
  65. package/dist/locales/pl/admins.json +57 -0
  66. package/dist/locales/pl/assets.json +69 -0
  67. package/dist/locales/pl/channels.json +66 -0
  68. package/dist/locales/pl/collections.json +145 -0
  69. package/dist/locales/pl/common.json +1128 -0
  70. package/dist/locales/pl/countries.json +50 -0
  71. package/dist/locales/pl/customerGroups.json +6 -0
  72. package/dist/locales/pl/customers.json +109 -0
  73. package/dist/locales/pl/dashboard.json +34 -0
  74. package/dist/locales/pl/facets.json +78 -0
  75. package/dist/locales/pl/globalSettings.json +15 -0
  76. package/dist/locales/pl/index.js +52 -0
  77. package/dist/locales/pl/orders.json +932 -0
  78. package/dist/locales/pl/paymentMethods.json +59 -0
  79. package/dist/locales/pl/permissions.json +94 -0
  80. package/dist/locales/pl/products.json +194 -0
  81. package/dist/locales/pl/promotions.json +65 -0
  82. package/dist/locales/pl/roles.json +59 -0
  83. package/dist/locales/pl/sellers.json +41 -0
  84. package/dist/locales/pl/shippingMethods.json +84 -0
  85. package/dist/locales/pl/stockLocations.json +40 -0
  86. package/dist/locales/pl/system.json +41 -0
  87. package/dist/locales/pl/table.json +201 -0
  88. package/dist/locales/pl/taxCategories.json +47 -0
  89. package/dist/locales/pl/taxRates.json +56 -0
  90. package/dist/locales/pl/zones.json +47 -0
  91. package/dist/notifications/OrderStatusNotification.js +47 -0
  92. package/dist/notifications/SystemStatusNotification.js +19 -0
  93. package/dist/pages/Custom404.js +5 -0
  94. package/dist/pages/LoginScreen.js +37 -0
  95. package/dist/pages/Root.js +252 -0
  96. package/dist/pages/admins/Detail.js +72 -0
  97. package/dist/pages/admins/List.js +56 -0
  98. package/dist/pages/admins/_components/AdminDetailView.js +34 -0
  99. package/dist/pages/admins/_components/RolesCard.js +31 -0
  100. package/dist/pages/admins/index.js +2 -0
  101. package/dist/pages/assets/List.js +82 -0
  102. package/dist/pages/assets/_components/Asset.js +114 -0
  103. package/dist/pages/assets/_components/AssetListView.js +29 -0
  104. package/dist/pages/assets/_components/EditAssetDialog.js +85 -0
  105. package/dist/pages/assets/_components/UploadAssetDialog.js +133 -0
  106. package/dist/pages/assets/_components/UploadProgress.js +20 -0
  107. package/dist/pages/assets/index.js +1 -0
  108. package/dist/pages/channels/Detail.js +149 -0
  109. package/dist/pages/channels/List.js +46 -0
  110. package/dist/pages/channels/_components/ChannelDetailView.js +51 -0
  111. package/dist/pages/channels/_components/DefaultsCard.js +25 -0
  112. package/dist/pages/channels/index.js +2 -0
  113. package/dist/pages/collections/Detail.js +61 -0
  114. package/dist/pages/collections/List.js +135 -0
  115. package/dist/pages/collections/_components/CollectionDetailView.js +52 -0
  116. package/dist/pages/collections/_components/CollectionProductVariantsDrawer.js +28 -0
  117. package/dist/pages/collections/_components/CombinationMode.js +6 -0
  118. package/dist/pages/collections/_components/ContentsCard.js +43 -0
  119. package/dist/pages/collections/_components/ContentsTable.js +102 -0
  120. package/dist/pages/collections/_components/DeleteCollectionsFromChannel.js +36 -0
  121. package/dist/pages/collections/_components/FacetsSelector.js +30 -0
  122. package/dist/pages/collections/_components/FiltersCard.js +101 -0
  123. package/dist/pages/collections/_components/MoveCollectionsToCollections.js +107 -0
  124. package/dist/pages/collections/_components/MoveEntityToChannels.js +115 -0
  125. package/dist/pages/collections/_components/PageHeader.js +11 -0
  126. package/dist/pages/collections/_components/SelectedCollectionsModal.js +22 -0
  127. package/dist/pages/collections/_components/VariantsSelector.js +43 -0
  128. package/dist/pages/collections/consts.js +7 -0
  129. package/dist/pages/collections/index.js +2 -0
  130. package/dist/pages/countries/Detail.js +57 -0
  131. package/dist/pages/countries/List.js +47 -0
  132. package/dist/pages/countries/_components/CountryDetailView.js +28 -0
  133. package/dist/pages/countries/index.js +2 -0
  134. package/dist/pages/customer-groups/Detail.js +76 -0
  135. package/dist/pages/customer-groups/List.js +41 -0
  136. package/dist/pages/customer-groups/_components/CustomerGroupsDetailView.js +21 -0
  137. package/dist/pages/customer-groups/index.js +2 -0
  138. package/dist/pages/customers/Detail.js +75 -0
  139. package/dist/pages/customers/List.js +60 -0
  140. package/dist/pages/customers/_components/Address.js +59 -0
  141. package/dist/pages/customers/_components/AddressDialog.js +56 -0
  142. package/dist/pages/customers/_components/AddressForm.js +77 -0
  143. package/dist/pages/customers/_components/AddressesCard.js +9 -0
  144. package/dist/pages/customers/_components/CustomerDetailSidebar.js +9 -0
  145. package/dist/pages/customers/_components/CustomerDetailView.js +41 -0
  146. package/dist/pages/customers/_components/CustomerGroupsCard.js +46 -0
  147. package/dist/pages/customers/_components/HistoryTab.js +65 -0
  148. package/dist/pages/customers/_components/OrdersTab.js +46 -0
  149. package/dist/pages/customers/_components/PersonalDataCard.js +6 -0
  150. package/dist/pages/customers/_components/VerifiedCard.js +6 -0
  151. package/dist/pages/customers/index.js +2 -0
  152. package/dist/pages/dashboard/Dashboard.js +10 -0
  153. package/dist/pages/dashboard/index.js +1 -0
  154. package/dist/pages/extensions/Extensions.js +74 -0
  155. package/dist/pages/extensions/index.js +1 -0
  156. package/dist/pages/facets/Detail.js +56 -0
  157. package/dist/pages/facets/List.js +48 -0
  158. package/dist/pages/facets/_components/AddFacetValueDialog.js +105 -0
  159. package/dist/pages/facets/_components/ColorSample.js +18 -0
  160. package/dist/pages/facets/_components/FacetDetailView.js +98 -0
  161. package/dist/pages/facets/index.js +2 -0
  162. package/dist/pages/global-settings/GlobalSettingsComponent.js +30 -0
  163. package/dist/pages/global-settings/index.js +71 -0
  164. package/dist/pages/index.js +25 -0
  165. package/dist/pages/orders/Detail.js +21 -0
  166. package/dist/pages/orders/List.js +132 -0
  167. package/dist/pages/orders/_components/AddPaymentDialog.js +50 -0
  168. package/dist/pages/orders/_components/AddressCard.js +260 -0
  169. package/dist/pages/orders/_components/CancelAndRefundDialog.js +29 -0
  170. package/dist/pages/orders/_components/ChangesRegister.js +68 -0
  171. package/dist/pages/orders/_components/ChangesRegisterTable.js +18 -0
  172. package/dist/pages/orders/_components/CouponCodesCard.js +85 -0
  173. package/dist/pages/orders/_components/CustomComponent.js +21 -0
  174. package/dist/pages/orders/_components/CustomerSelectCard.js +117 -0
  175. package/dist/pages/orders/_components/EditNoteButton.js +10 -0
  176. package/dist/pages/orders/_components/FulfillmentModal.js +85 -0
  177. package/dist/pages/orders/_components/LineItem.js +7 -0
  178. package/dist/pages/orders/_components/ManualOrderChangeModal.js +47 -0
  179. package/dist/pages/orders/_components/ModifyAcceptModal.js +22 -0
  180. package/dist/pages/orders/_components/ModifyingCard.js +77 -0
  181. package/dist/pages/orders/_components/OrderHistory.js +59 -0
  182. package/dist/pages/orders/_components/OrderLineActionModal/ActionQuantityPrice.js +58 -0
  183. package/dist/pages/orders/_components/OrderLineActionModal/index.js +7 -0
  184. package/dist/pages/orders/_components/OrderLineActionModal/types.js +1 -0
  185. package/dist/pages/orders/_components/OrderLineCustomFields.js +26 -0
  186. package/dist/pages/orders/_components/OrderSummary.js +10 -0
  187. package/dist/pages/orders/_components/PaymentMetadata.js +6 -0
  188. package/dist/pages/orders/_components/Payments.js +113 -0
  189. package/dist/pages/orders/_components/PossibleOrderStates.js +54 -0
  190. package/dist/pages/orders/_components/PriceChangedInfo.js +16 -0
  191. package/dist/pages/orders/_components/ProductsCard.js +308 -0
  192. package/dist/pages/orders/_components/ProductsTable.js +29 -0
  193. package/dist/pages/orders/_components/PromotionsList.js +73 -0
  194. package/dist/pages/orders/_components/RealizationCard.js +98 -0
  195. package/dist/pages/orders/_components/RefundCard.js +11 -0
  196. package/dist/pages/orders/_components/RefundPaymentCard.js +13 -0
  197. package/dist/pages/orders/_components/ShippingMethod.js +112 -0
  198. package/dist/pages/orders/_components/SpecialLineItem.js +7 -0
  199. package/dist/pages/orders/_components/SurchargeCard.js +99 -0
  200. package/dist/pages/orders/_components/SurchargeTable.js +8 -0
  201. package/dist/pages/orders/_components/TaxSummary.js +11 -0
  202. package/dist/pages/orders/_components/ToRealizationForm.js +64 -0
  203. package/dist/pages/orders/_components/TopActions.js +219 -0
  204. package/dist/pages/orders/_components/index.js +25 -0
  205. package/dist/pages/orders/index.js +2 -0
  206. package/dist/pages/payment-methods/Detail.js +67 -0
  207. package/dist/pages/payment-methods/List.js +41 -0
  208. package/dist/pages/payment-methods/_components/OptionsCard.js +60 -0
  209. package/dist/pages/payment-methods/_components/PaymentMethodDetailView.js +53 -0
  210. package/dist/pages/payment-methods/index.js +2 -0
  211. package/dist/pages/product-variants/Detail.js +4 -0
  212. package/dist/pages/product-variants/List.js +76 -0
  213. package/dist/pages/product-variants/index.js +2 -0
  214. package/dist/pages/products/Detail.js +75 -0
  215. package/dist/pages/products/List.js +79 -0
  216. package/dist/pages/products/_components/AddOptionGroupDialog.js +65 -0
  217. package/dist/pages/products/_components/AssetsCard.js +35 -0
  218. package/dist/pages/products/_components/BasicFieldsCard.js +6 -0
  219. package/dist/pages/products/_components/ChannelsCard.js +6 -0
  220. package/dist/pages/products/_components/CollectionsCard.js +6 -0
  221. package/dist/pages/products/_components/Container.js +4 -0
  222. package/dist/pages/products/_components/DiscountRatingCard.js +6 -0
  223. package/dist/pages/products/_components/FacetValuesCard.js +6 -0
  224. package/dist/pages/products/_components/ImagesCard.js +6 -0
  225. package/dist/pages/products/_components/OptionGroup.js +93 -0
  226. package/dist/pages/products/_components/OptionValueCard.js +59 -0
  227. package/dist/pages/products/_components/OptionsCard.js +38 -0
  228. package/dist/pages/products/_components/OptionsTab.js +40 -0
  229. package/dist/pages/products/_components/PriceCard.js +27 -0
  230. package/dist/pages/products/_components/ProductDetailSidebar.js +30 -0
  231. package/dist/pages/products/_components/ProductDetailView.js +54 -0
  232. package/dist/pages/products/_components/SettingsCard.js +6 -0
  233. package/dist/pages/products/_components/StockCard.js +40 -0
  234. package/dist/pages/products/_components/Variant.js +149 -0
  235. package/dist/pages/products/_components/VariantsTab.js +46 -0
  236. package/dist/pages/products/index.js +2 -0
  237. package/dist/pages/promotions/Detail.js +80 -0
  238. package/dist/pages/promotions/List.js +38 -0
  239. package/dist/pages/promotions/_components/ActionsCard.js +67 -0
  240. package/dist/pages/promotions/_components/BasicFieldsCard.js +6 -0
  241. package/dist/pages/promotions/_components/ConditionsCard.js +70 -0
  242. package/dist/pages/promotions/_components/CustomerGroupsSelector.js +25 -0
  243. package/dist/pages/promotions/_components/EnabledCard.js +6 -0
  244. package/dist/pages/promotions/_components/OptionsCard.js +6 -0
  245. package/dist/pages/promotions/_components/PromotionDetailSidebar.js +15 -0
  246. package/dist/pages/promotions/_components/PromotionDetailView.js +66 -0
  247. package/dist/pages/promotions/_components/PromotionFieldRender.js +4 -0
  248. package/dist/pages/promotions/index.js +2 -0
  249. package/dist/pages/roles/Detail.js +72 -0
  250. package/dist/pages/roles/List.js +70 -0
  251. package/dist/pages/roles/_components/PermissionsCard.js +7 -0
  252. package/dist/pages/roles/_components/PermissionsTable.js +42 -0
  253. package/dist/pages/roles/_components/RoleDetailView.js +49 -0
  254. package/dist/pages/roles/index.js +2 -0
  255. package/dist/pages/sellers/Detail.js +48 -0
  256. package/dist/pages/sellers/List.js +37 -0
  257. package/dist/pages/sellers/_components/SellerDetailView.js +20 -0
  258. package/dist/pages/sellers/index.js +2 -0
  259. package/dist/pages/shipping-methods/Detail.js +105 -0
  260. package/dist/pages/shipping-methods/List.js +40 -0
  261. package/dist/pages/shipping-methods/_components/CalculatorCard.js +79 -0
  262. package/dist/pages/shipping-methods/_components/CheckerCard.js +76 -0
  263. package/dist/pages/shipping-methods/_components/Lines.js +20 -0
  264. package/dist/pages/shipping-methods/_components/ShippingMethodDetailView.js +67 -0
  265. package/dist/pages/shipping-methods/_components/TestCard.js +62 -0
  266. package/dist/pages/shipping-methods/index.js +2 -0
  267. package/dist/pages/status/Status.js +6 -0
  268. package/dist/pages/status/_components/FilterToolbar.js +29 -0
  269. package/dist/pages/status/_components/Health.js +21 -0
  270. package/dist/pages/status/_components/JobResultPopover.js +8 -0
  271. package/dist/pages/status/_components/Jobs.js +199 -0
  272. package/dist/pages/status/_components/JsonExplorer.js +44 -0
  273. package/dist/pages/status/_components/JsonPopup.js +8 -0
  274. package/dist/pages/status/index.js +1 -0
  275. package/dist/pages/stock-locations/Detail.js +77 -0
  276. package/dist/pages/stock-locations/List.js +38 -0
  277. package/dist/pages/stock-locations/_components/StockLocationDetailView.js +22 -0
  278. package/dist/pages/stock-locations/index.js +2 -0
  279. package/dist/pages/tax-categories/Detail.js +85 -0
  280. package/dist/pages/tax-categories/List.js +46 -0
  281. package/dist/pages/tax-categories/_components/TaxCategoryDetailView.js +24 -0
  282. package/dist/pages/tax-categories/index.js +2 -0
  283. package/dist/pages/tax-rates/Detail.js +62 -0
  284. package/dist/pages/tax-rates/List.js +64 -0
  285. package/dist/pages/tax-rates/_components/TaxRateDetailView.js +64 -0
  286. package/dist/pages/tax-rates/index.js +2 -0
  287. package/dist/pages/zones/Detail.js +86 -0
  288. package/dist/pages/zones/List.js +52 -0
  289. package/dist/pages/zones/_components/ZoneDetailView.js +49 -0
  290. package/dist/pages/zones/index.js +2 -0
  291. package/dist/version.js +1 -0
  292. package/package.json +122 -0
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ # License 1
2
+
3
+ The MIT License
4
+
5
+ Copyright (c) 2025-present Aexol
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
+
13
+ # License 2
14
+
15
+ The MIT License
16
+
17
+ Copyright (c) 2018-2025 Michael Bromley
18
+
19
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## Expanding the ESLint configuration
11
+
12
+ If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
+
14
+ - Configure the top-level `parserOptions` property like this:
15
+
16
+ ```js
17
+ export default {
18
+ // other rules...
19
+ parserOptions: {
20
+ ecmaVersion: 'latest',
21
+ sourceType: 'module',
22
+ project: ['./tsconfig.json', './tsconfig.node.json'],
23
+ tsconfigRootDir: __dirname,
24
+ },
25
+ }
26
+ ```
27
+
28
+ - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
29
+ - Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
30
+ - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
@@ -0,0 +1,51 @@
1
+ import customers from '../locales/en/customers.json';
2
+ import customerGroups from '../locales/en/customerGroups.json';
3
+ import collections from '../locales/en/collections.json';
4
+ import common from '../locales/en/common.json';
5
+ import countries from '../locales/en/countries.json';
6
+ import orders from '../locales/en/orders.json';
7
+ import dashboard from '../locales/en/dashboard.json';
8
+ import products from '../locales/en/products.json';
9
+ import assets from '../locales/en/assets.json';
10
+ import facets from '../locales/en/facets.json';
11
+ import admins from '../locales/en/admins.json';
12
+ import roles from '../locales/en/roles.json';
13
+ import permissions from '../locales/en/permissions.json';
14
+ import channels from '../locales/en/channels.json';
15
+ import zones from '../locales/en/zones.json';
16
+ import taxCategories from '../locales/en/taxCategories.json';
17
+ import taxRates from '../locales/en/taxRates.json';
18
+ import stockLocations from '../locales/en/stockLocations.json';
19
+ import sellers from '../locales/en/sellers.json';
20
+ import paymentMethods from '../locales/en/paymentMethods.json';
21
+ import shippingMethods from '../locales/en/shippingMethods.json';
22
+ import promotions from '../locales/en/shippingMethods.json';
23
+ import table from '../locales/en/table.json';
24
+ import system from '../locales/en/system.json';
25
+ const resources = {
26
+ collections,
27
+ common,
28
+ countries,
29
+ customers,
30
+ customerGroups,
31
+ orders,
32
+ products,
33
+ dashboard,
34
+ assets,
35
+ facets,
36
+ admins,
37
+ roles,
38
+ permissions,
39
+ channels,
40
+ zones,
41
+ taxCategories,
42
+ taxRates,
43
+ stockLocations,
44
+ sellers,
45
+ paymentMethods,
46
+ shippingMethods,
47
+ table,
48
+ promotions,
49
+ system,
50
+ };
51
+ export default resources;
@@ -0,0 +1,118 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // eslint-disable-next-line no-restricted-imports
3
+ import { I18nextProvider } from 'react-i18next';
4
+ import { useEffect } from 'react';
5
+ import { RouterProvider, createBrowserRouter } from 'react-router-dom';
6
+ import { AnimatePresence } from 'framer-motion';
7
+ import { Toaster } from 'sonner';
8
+ import i18n from './i18.js';
9
+ import { Routes, PluginProvider, PluginStore, useSettings, GlobalStoreProvider, DEFAULT_CHANNEL_CODE, NotificationProvider, } from '@deenruv/react-ui-devkit';
10
+ import { LanguageCode } from '@deenruv/admin-types';
11
+ import { Root } from "./pages/Root.js";
12
+ import { LoginScreen } from "./pages/LoginScreen.js";
13
+ import { Custom404 } from "./pages/Custom404.js";
14
+ import * as Pages from "./pages/index.js";
15
+ import * as resources from "./locales/index.js";
16
+ import { ADMIN_DASHBOARD_VERSION } from "./version.js";
17
+ import { ORDER_STATUS_NOTIFICATION } from "./notifications/OrderStatusNotification.js";
18
+ import { SYSTEM_STATUS_NOTIFICATION } from "./notifications/SystemStatusNotification.js";
19
+ const firstLetterToLowerCase = (str) => str.charAt(0).toLowerCase() + str.slice(1);
20
+ const getRoute = (name, key) => {
21
+ const route = Routes[name];
22
+ if (typeof route !== 'object')
23
+ return route;
24
+ if (key.includes('DetailPage') && 'route' in route)
25
+ return route.route;
26
+ if (key.includes('ListPage') && 'list' in route)
27
+ return route.list;
28
+ return null;
29
+ };
30
+ const getName = (key) => {
31
+ if (key.includes('DetailPage'))
32
+ return firstLetterToLowerCase(key.replace('DetailPage', ''));
33
+ if (key.includes('ListPage'))
34
+ return firstLetterToLowerCase(key.replace('ListPage', ''));
35
+ return firstLetterToLowerCase(key);
36
+ };
37
+ const DeenruvPaths = Object.entries(Pages).flatMap(([key, Component]) => {
38
+ const name = getName(key);
39
+ const path = getRoute(name, key);
40
+ const paths = [];
41
+ if (path)
42
+ paths.push({ path, element: _jsx(Component, {}) });
43
+ const route = Routes[name];
44
+ if (key.includes('DetailPage') && typeof route === 'object' && 'new' in route) {
45
+ paths.push({ path: route.new, element: _jsx(Component, {}) });
46
+ }
47
+ return paths;
48
+ });
49
+ const loadTranslations = () => {
50
+ Object.entries(resources).forEach(([lang, value]) => {
51
+ Object.entries(value).forEach(([, translations]) => {
52
+ Object.entries(translations).forEach(([key, value]) => {
53
+ i18n.addResourceBundle(lang, key, value);
54
+ });
55
+ });
56
+ });
57
+ };
58
+ const pluginsStore = new PluginStore();
59
+ export const DeenruvAdminPanel = ({ plugins, settings }) => {
60
+ window.__DEENRUV_SETTINGS__ = {
61
+ ...settings,
62
+ ui: {
63
+ ...settings.ui,
64
+ defaultChannelCode: settings?.ui?.defaultChannelCode || DEFAULT_CHANNEL_CODE,
65
+ defaultLanguageCode: settings?.ui?.defaultLanguageCode || LanguageCode.en,
66
+ defaultTranslationLanguageCode: settings?.ui?.defaultTranslationLanguageCode || LanguageCode.en,
67
+ },
68
+ api: {
69
+ ...settings.api,
70
+ authTokenName: settings.api.authTokenName || 'deenruv-auth-token',
71
+ channelTokenName: settings.api.channelTokenName || 'deenruv-token',
72
+ },
73
+ appVersion: ADMIN_DASHBOARD_VERSION,
74
+ i18n,
75
+ };
76
+ pluginsStore.install(plugins, i18n);
77
+ loadTranslations();
78
+ const router = createBrowserRouter([
79
+ {
80
+ element: _jsx(Root, { allPaths: [...DeenruvPaths].map((path) => path.path).filter(Boolean) }),
81
+ errorElement: _jsx(Custom404, {}),
82
+ children: [...DeenruvPaths, ...pluginsStore.routes],
83
+ },
84
+ ]);
85
+ const { theme, isLoggedIn, ...context } = useSettings((p) => ({
86
+ theme: p.theme,
87
+ isLoggedIn: p.isLoggedIn,
88
+ channel: p.selectedChannel,
89
+ language: p.language,
90
+ translationsLanguage: p.translationsLanguage,
91
+ }));
92
+ useEffect(() => {
93
+ const root = window.document.documentElement;
94
+ root.classList.remove('light', 'dark');
95
+ if (theme === 'system') {
96
+ const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
97
+ root.classList.add(systemTheme);
98
+ }
99
+ else {
100
+ root.classList.add(theme);
101
+ }
102
+ }, [theme]);
103
+ return (_jsx(GlobalStoreProvider, { ...settings, children: _jsxs(I18nextProvider, { i18n: i18n, defaultNS: 'common', children: [_jsx(AnimatePresence, { children: isLoggedIn ? (_jsx(PluginProvider, { plugins: pluginsStore, context: context, children: _jsx(NotificationProvider, { notifications: [ORDER_STATUS_NOTIFICATION, SYSTEM_STATUS_NOTIFICATION].concat(pluginsStore.notifications), children: _jsx(RouterProvider, { router: router }) }) })) : (_jsx(LoginScreen, {})) }), _jsx(Toaster, { theme: theme, className: "toaster group", richColors: true, expand: true, position: "bottom-right", toastOptions: {
104
+ classNames: {
105
+ toast: 'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg group-[.toaster]:rounded-lg group-[.toaster]:p-4',
106
+ title: 'group-[.toast]:font-semibold group-[.toast]:text-foreground',
107
+ description: 'group-[.toast]:text-muted-foreground group-[.toast]:text-sm',
108
+ actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground group-[.toast]:rounded-md group-[.toast]:px-3 group-[.toast]:text-xs group-[.toast]:h-8 group-[.toast]:font-medium',
109
+ cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground group-[.toast]:rounded-md group-[.toast]:px-3 group-[.toast]:text-xs group-[.toast]:h-8 group-[.toast]:font-medium',
110
+ closeButton: 'group-[.toast]:text-foreground/50 group-[.toast]:hover:text-foreground group-[.toast]:rounded-md',
111
+ success: 'group-[.toast]:border-l-4 group-[.toast]:border-l-green-500',
112
+ error: 'group-[.toast]:border-l-4 group-[.toast]:border-l-red-500',
113
+ warning: 'group-[.toast]:border-l-4 group-[.toast]:border-l-yellow-500',
114
+ info: 'group-[.toast]:border-l-4 group-[.toast]:border-l-blue-500',
115
+ loading: 'group-[.toast]:border-l-4 group-[.toast]:border-l-purple-500',
116
+ },
117
+ } })] }) }));
118
+ };
@@ -0,0 +1,57 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Button, Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerFooter, DrawerClose, usePluginStore, Switch, ScrollArea, useServer, } from '@deenruv/react-ui-devkit';
4
+ import { useState } from 'react';
5
+ // const SchemaField = ({ field, depth = 0 }: { field: GraphQLSchemaField; depth?: number }) => {
6
+ // const [expanded, setExpanded] = useState(depth < 2);
7
+ // const hasFields = field.fields && field.fields.length > 0;
8
+ // const indent = Array(depth).fill(' ').join('');
9
+ // return (
10
+ // <div className="font-mono">
11
+ // <div className="flex items-start">
12
+ // <button
13
+ // onClick={() => hasFields && setExpanded(!expanded)}
14
+ // className={`mr-1 ${hasFields ? 'cursor-pointer' : 'cursor-default'} text-xs`}
15
+ // >
16
+ // {hasFields ? (expanded ? '▼' : '►') : '•'}
17
+ // </button>
18
+ // <div>
19
+ // <span className="text-blue-600 dark:text-blue-400">{field.name}</span>
20
+ // <span className="text-gray-600 dark:text-gray-400">: </span>
21
+ // <span className="text-green-600 dark:text-green-400">{field.type}</span>
22
+ // {field.description && (
23
+ // <span className="ml-2 text-xs italic text-gray-500 dark:text-gray-400">// {field.description}</span>
24
+ // )}
25
+ // </div>
26
+ // </div>
27
+ // {expanded && hasFields && (
28
+ // <div className="ml-4">
29
+ // {field.fields.map((subField, index) => (
30
+ // <SchemaField key={`${subField.name}-${index}`} field={subField} depth={depth + 1} />
31
+ // ))}
32
+ // </div>
33
+ // )}
34
+ // </div>
35
+ // );
36
+ // };
37
+ // const SchemaViewer = ({ schema }: { schema: GraphQLSchema | undefined }) => {
38
+ // if (!schema || schema.size === 0) {
39
+ // return <div className="text-gray-500">No schema available</div>;
40
+ // }
41
+ // return (
42
+ // <div className="space-y-2">
43
+ // {Array.from(schema.entries()).map(([key, field]) => (
44
+ // <div key={key} className="border-b pb-2 last:border-b-0">
45
+ // <div className="mb-1 text-sm font-semibold">{key}</div>
46
+ // <SchemaField field={field} />
47
+ // </div>
48
+ // ))}
49
+ // </div>
50
+ // );
51
+ // };
52
+ export const DeenruvDeveloperIndicator = () => {
53
+ const { graphQLSchema } = useServer(({ graphQLSchema }) => ({ graphQLSchema }));
54
+ const { plugins, viewMarkers, setViewMarkers } = usePluginStore();
55
+ const [showSchema, setShowSchema] = useState(false);
56
+ return (_jsx("div", { className: "fixed bottom-4 right-4", children: _jsxs(Drawer, { children: [_jsx(DrawerTrigger, { asChild: true, children: _jsx(Button, { variant: "outline", className: "border-primary flex size-10 items-center justify-center rounded-full border-dashed text-xs", children: "DDP" }) }), _jsx(DrawerContent, { className: "w-full max-w-5xl place-self-end", children: _jsxs("div", { className: "w-full", children: [_jsx(DrawerHeader, { children: _jsx(DrawerTitle, { children: "DDP - Deenruv Developer Panel" }) }), _jsx("div", { className: "p-4 pb-0", children: _jsxs("div", { className: "flex flex-col space-y-4 md:flex-row md:space-x-4 md:space-y-0", children: [_jsxs("div", { className: "space-y-4 md:w-1/4", children: [_jsxs("div", { className: "rounded-md border p-3", children: [_jsx("h3", { className: "mb-2 text-sm font-medium", children: "Controls" }), _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(Switch, { id: "markers", checked: viewMarkers, onCheckedChange: setViewMarkers }), _jsx("label", { htmlFor: "markers", className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Show markers (ctrl + x)" })] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(Switch, { id: "schema", checked: showSchema, onCheckedChange: setShowSchema }), _jsx("label", { htmlFor: "schema", className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Show GraphQL Schema" })] })] })] }), _jsxs("div", { className: "rounded-md border p-3", children: [_jsxs("div", { className: "mb-1 flex items-center gap-2", children: [_jsx("div", { className: "size-3 rounded-full bg-green-500" }), _jsx("h3", { className: "text-sm font-medium", children: "Plugins" })] }), _jsx(ScrollArea, { className: "mt-2 h-[250px]", children: _jsxs("div", { className: "grid gap-2 pr-2", children: [plugins.map((plugin) => (_jsxs("div", { className: "dark:hover:bg-gray-750 flex items-center rounded-md border border-gray-200 bg-gray-50 p-2 transition-colors hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800", children: [_jsxs("div", { className: "flex-1", children: [_jsx("div", { className: "text-sm font-medium", children: plugin.name }), _jsxs("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: ["v", plugin.version] })] }), _jsx("div", { className: "mr-1 size-2 rounded-full bg-green-500", title: "Active" })] }, plugin.name))), plugins.length === 0 && (_jsx("div", { className: "py-4 text-center text-sm italic text-gray-500 dark:text-gray-400", children: "No plugins installed" }))] }) })] })] }), _jsx("div", { className: "md:w-3/4" })] }) }), _jsx(DrawerFooter, { children: _jsx(DrawerClose, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Close" }) }) })] }) })] }) }));
57
+ };
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const Aexol = ({ text }) => {
3
+ return (_jsx("div", { className: "flex items-center gap-2", children: _jsxs("a", { href: "https://aexol.com", target: "_blank", rel: "noreferrer", children: [_jsx("p", { className: "text-end text-xs text-white", children: text }), _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 71 70", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsxs("g", { clipPath: "url(#clip0_1401_144)", children: [_jsx("path", { d: "M0.906403 40.7746H3.25881C3.68652 40.7746 3.92176 40.5154 4.02869 40.2562L4.79856 38.5282H10.6154L11.3853 40.2346C11.5778 40.645 11.7488 40.7746 12.1338 40.7746H14.5076C14.8284 40.7746 14.9994 40.4938 14.8711 40.213L8.17747 25.6761C8.11331 25.5465 7.96362 25.4385 7.81392 25.4385H7.60006C7.45036 25.4385 7.30067 25.5465 7.23651 25.6761L0.542849 40.213C0.414536 40.4938 0.58562 40.7746 0.906403 40.7746ZM6.08169 35.5906L7.6856 32.0265H7.70699L9.33229 35.5906H6.08169Z", fill: "white" }), _jsx("path", { d: "M17.2405 40.3642C17.2405 40.5802 17.4116 40.7746 17.6469 40.7746H26.5004C26.7357 40.7746 26.9068 40.5802 26.9068 40.3642V38.0098C26.9068 37.7938 26.7357 37.5994 26.5004 37.5994H20.5767L20.5767 34.6834H25.4526C25.6664 34.6834 25.8589 34.5106 25.8589 34.273V31.9185C25.8589 31.7025 25.6664 31.5081 25.4526 31.5081H20.5767V28.8297H26.5004C26.7357 28.8297 26.9068 28.6353 26.9068 28.4193V26.0649C26.9068 25.8489 26.7357 25.6545 26.5004 25.6545H17.6469C17.4116 25.6545 17.2405 25.8489 17.2405 26.0649L17.2405 40.3642Z", fill: "white" }), _jsx("path", { d: "M29.6415 40.1698C29.449 40.4506 29.6415 40.7746 30.0051 40.7746H32.9776C33.1487 40.7746 33.277 40.6666 33.3412 40.5802L36.0785 36.217H36.1213L38.9228 40.5802C38.987 40.6882 39.1581 40.7746 39.2864 40.7746H42.259C42.6011 40.7746 42.7936 40.4722 42.6011 40.1698L38.1102 33.0202L42.4514 26.2593C42.6439 25.9785 42.4514 25.6545 42.0879 25.6545H38.9656C38.8159 25.6545 38.6662 25.7625 38.6234 25.8489L36.1213 29.8665H36.0999L33.6406 25.8489C33.5764 25.7625 33.4481 25.6545 33.2984 25.6545H30.1761C29.8126 25.6545 29.6415 25.9785 29.8126 26.2593L34.1325 33.0202L29.6415 40.1698Z", fill: "white" }), _jsx("path", { d: "M43.6813 33.2362C43.6813 37.5562 47.0815 40.9906 51.3586 40.9906C55.6357 40.9906 59.0574 37.5562 59.0574 33.2362C59.0574 28.9161 55.6357 25.4385 51.3586 25.4385C47.0815 25.4385 43.6813 28.9161 43.6813 33.2362ZM47.1029 33.2362C47.1029 30.8601 49.0276 28.8945 51.3586 28.8945C53.7111 28.8945 55.6357 30.8601 55.6357 33.2362C55.6357 35.5906 53.7111 37.5346 51.3586 37.5346C49.0276 37.5346 47.1029 35.5906 47.1029 33.2362Z", fill: "white" }), _jsx("path", { d: "M61.6464 40.3642C61.6464 40.5802 61.8175 40.7746 62.0527 40.7746H70.0937C70.3289 40.7746 70.5 40.5802 70.5 40.3642V38.0098C70.5 37.7938 70.3289 37.5994 70.0937 37.5994H65.0039V26.0649C65.0039 25.8489 64.8115 25.6545 64.5976 25.6545H62.0527C61.8175 25.6545 61.6464 25.8489 61.6464 26.0649V40.3642Z", fill: "white" }), _jsx("path", { d: "M34.0244 57.9309V69.9999H45.8919V57.9309H34.0244ZM43.5184 67.5861H36.3979V60.3447H43.5184V67.5861Z", fill: "white" }), _jsx("path", { d: "M69.6294 43.4482H67.2559V55.5172H69.6294V43.4482Z", fill: "white" }), _jsx("path", { d: "M30.4468 0H17.3926V13.2759H30.4468V0Z", fill: "white" })] }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_1401_144", children: _jsx("rect", { width: "70", height: "70", fill: "white", transform: "translate(0.361328)" }) }) })] })] }) }));
4
+ };
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ export const BrandLogo = ({ isCollapsed = false }) => {
4
+ const { logo, name } = window?.__DEENRUV_SETTINGS__?.branding || {};
5
+ const { full, collapsed } = logo || {};
6
+ let Logo = null;
7
+ if (isCollapsed) {
8
+ if (typeof collapsed === 'string')
9
+ Logo = _jsx("img", { src: collapsed, alt: "Logo", className: "size-full object-fill" });
10
+ if (typeof collapsed === 'object')
11
+ Logo = React.cloneElement(collapsed, { className: 'object-contain' });
12
+ }
13
+ if (!isCollapsed) {
14
+ if (typeof full === 'string')
15
+ Logo = _jsx("img", { src: full, alt: "Logo", className: "size-full object-fill" });
16
+ if (typeof full === 'object')
17
+ Logo = React.cloneElement(full, { className: 'object-contain' });
18
+ }
19
+ if (!Logo)
20
+ return (_jsxs("svg", { width: "260px", height: "100%", viewBox: "0 0 200 60", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("defs", { children: _jsxs("filter", { id: "shadow", x: "-50%", y: "-50%", width: "200%", height: "200%", children: [_jsx("feOffset", { result: "offOut", in: "SourceAlpha", dx: "2", dy: "2" }), _jsx("feGaussianBlur", { result: "blurOut", in: "offOut", stdDeviation: "2" }), _jsx("feBlend", { in: "SourceGraphic", in2: "blurOut", mode: "normal" })] }) }), _jsx("text", { x: "50%", y: "50%", textAnchor: "middle", fill: "black", fontSize: "24", fontWeight: "bold", dy: ".3em", children: isCollapsed ? name?.charAt?.(0) : name }), _jsx("text", { x: "50%", y: "50%", textAnchor: "middle", fill: "#ffffff", fontSize: "24", fontWeight: "bold", dy: ".3em", filter: "url(#shadow)", opacity: "0.9", children: isCollapsed ? name?.charAt?.(0) : name })] }));
21
+ return _jsx(_Fragment, { children: Logo });
22
+ };
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, useRouteGuardStore, } from '@deenruv/react-ui-devkit';
3
+ import { useNavigate } from 'react-router-dom';
4
+ export const CanLeaveRouteDialog = () => {
5
+ const { isModalOpen, confirmNavigation, cancelNavigation } = useRouteGuardStore();
6
+ const navigate = useNavigate();
7
+ return (_jsx(AlertDialog, { open: isModalOpen, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Are you absolutely sure?" }), _jsx(AlertDialogDescription, { children: "You have unsaved changes. Are you sure you want to leave without saving?" })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { onClick: cancelNavigation, children: "Stay" }), _jsx(AlertDialogAction, { onClick: () => confirmNavigation(navigate), children: "Leave" })] })] }) }));
8
+ };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
3
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@deenruv/react-ui-devkit';
4
+ export function DataTable({ columns, data }) {
5
+ const table = useReactTable({
6
+ data,
7
+ columns,
8
+ getCoreRowModel: getCoreRowModel(),
9
+ });
10
+ return (_jsx("div", { className: "rounded-md border", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => {
11
+ return (_jsx(TableHead, { children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id));
12
+ }) }, headerGroup.id))) }), _jsx(TableBody, { children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (_jsx(TableRow, { "data-state": row.getIsSelected() && 'selected', children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) })) })] }) }));
13
+ }
@@ -0,0 +1,6 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button, DialogTitle, Dialog, DialogContent, DialogFooter, DialogClose, DialogDescription, useTranslation, } from '@deenruv/react-ui-devkit';
3
+ export const DeleteDialog = ({ onConfirm, title, description, onOpenChange, open, deletedNames, }) => {
4
+ const { t } = useTranslation('common');
5
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { children: [_jsxs(DialogTitle, { children: [" ", title] }), _jsxs("div", { className: "flex max-h-[50vh] flex-col gap-2", children: [_jsx(DialogDescription, { className: "text-primary text-lg", children: description }), _jsx(DialogDescription, { children: deletedNames.map((n) => (_jsx("div", { children: n }, n))) })] }), _jsxs(DialogFooter, { children: [_jsx(DialogClose, { asChild: true, children: _jsx(Button, { variant: "ghost", children: t('confirmationDialog.cancelBtn') }) }), _jsx(Button, { variant: "destructive", onClick: onConfirm, children: t('confirmationDialog.confirmBtn') })] })] }) }));
6
+ };
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTranslation, Button, DialogClose, DialogContent, DialogFooter, apiClient, useSettings, } from '@deenruv/react-ui-devkit';
3
+ import { toast } from 'sonner';
4
+ export const DuplicateEntity = ({ inputs, onClose, onSuccess, processNewEntities, children, }) => {
5
+ const { t } = useTranslation('collections');
6
+ const { selectedChannel } = useSettings();
7
+ const removeCollectionsFromChannel = async () => {
8
+ try {
9
+ if (selectedChannel?.id) {
10
+ const res = await Promise.all(inputs.map(async (input) => {
11
+ const singleRes = await apiClient('mutation')({
12
+ duplicateEntity: [
13
+ { input },
14
+ {
15
+ __typename: true,
16
+ '...on DuplicateEntityError': { message: true, __typename: true },
17
+ '...on DuplicateEntitySuccess': { newEntityId: true, __typename: true },
18
+ },
19
+ ],
20
+ });
21
+ return singleRes.duplicateEntity;
22
+ }));
23
+ const withError = res.filter((singleRes) => singleRes.__typename === 'DuplicateEntityError');
24
+ const withSuccess = res.filter((singleRes) => singleRes.__typename === 'DuplicateEntitySuccess');
25
+ if (withError.length) {
26
+ withError.forEach((error) => toast.error(error.message));
27
+ return;
28
+ }
29
+ if (withSuccess.length) {
30
+ processNewEntities && processNewEntities(withSuccess.map((entity) => entity.newEntityId));
31
+ toast.success('Duplikacja zakończona sukcesem');
32
+ onSuccess && onSuccess();
33
+ return;
34
+ }
35
+ }
36
+ }
37
+ catch (e) {
38
+ console.log(e);
39
+ toast.error('Nie udało się dokonać duplikacji');
40
+ }
41
+ finally {
42
+ onClose();
43
+ }
44
+ };
45
+ return (_jsxs(DialogContent, { children: [children, _jsxs(DialogFooter, { children: [_jsx(DialogClose, { asChild: true, children: _jsx(Button, { onClick: onClose, variant: "ghost", children: t('deleteCollectionDialog.cancel') }) }), _jsx(Button, { onClick: removeCollectionsFromChannel, children: "Duplikuj" })] })] }));
46
+ };
@@ -0,0 +1,134 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, usePluginStore, Routes, useGlobalSearch, capitalizeFirstLetter, useTranslation, } from '@deenruv/react-ui-devkit';
3
+ import { useEffect, useMemo } from 'react';
4
+ import { useNavigate } from 'react-router-dom';
5
+ import { LayoutDashboard, ListPlus, FileText, Puzzle, ArrowRight } from 'lucide-react';
6
+ export const GlobalSearch = () => {
7
+ const { t, tEntity } = useTranslation('common');
8
+ const { plugins } = usePluginStore();
9
+ const isOpen = useGlobalSearch((s) => s.isOpen);
10
+ const toggle = useGlobalSearch((s) => s.toggle);
11
+ const close = useGlobalSearch((s) => s.close);
12
+ const navigate = useNavigate();
13
+ useEffect(() => {
14
+ const handleKeyDown = (e) => {
15
+ if ((e.metaKey || e.ctrlKey) && e.key === ' ') {
16
+ e.preventDefault();
17
+ toggle();
18
+ }
19
+ };
20
+ document.addEventListener('keydown', handleKeyDown);
21
+ return () => document.removeEventListener('keydown', handleKeyDown);
22
+ }, [toggle]);
23
+ const allRoutes = useMemo(() => {
24
+ const routes = [];
25
+ Object.entries(Routes).forEach(([key, value]) => {
26
+ if (typeof value === 'object' && value !== null) {
27
+ const children = [];
28
+ if ('new' in value && typeof value.new === 'string') {
29
+ children.push({
30
+ name: capitalizeFirstLetter(t(`menu.${key}`)),
31
+ path: value.new,
32
+ type: 'new',
33
+ description: tEntity('Utwórz', key),
34
+ });
35
+ }
36
+ if ('list' in value && typeof value.list === 'string') {
37
+ children.push({
38
+ name: capitalizeFirstLetter(t(`menu.${key}`)),
39
+ path: value.list,
40
+ type: 'list',
41
+ description: tEntity('Zobacz wszystkie', key, 'many'),
42
+ });
43
+ }
44
+ routes.push({ name: key, children });
45
+ }
46
+ else if (typeof value === 'string') {
47
+ routes.push({
48
+ name: capitalizeFirstLetter(t(`menu.${key}`)),
49
+ path: value,
50
+ type: 'default',
51
+ description: `${t('globalSearch.navigateTo')} ${t(`menu.${key}`)}`,
52
+ });
53
+ }
54
+ });
55
+ plugins.forEach((plugin) => {
56
+ plugin.pages?.forEach((page, pageIndex) => {
57
+ if (page.path) {
58
+ routes.push({
59
+ name: `${plugin.name} - ${page.path || 'Page'}`,
60
+ path: page.path,
61
+ type: 'plugin',
62
+ description: t('globalSearch.accessPlugin', { pluginName: plugin.name }),
63
+ });
64
+ }
65
+ });
66
+ });
67
+ return routes.flatMap((route, routeIndex) => route.children?.length
68
+ ? route.children.map((child, childIndex) => ({
69
+ ...child,
70
+ id: `${routeIndex}-${childIndex}-${child.type}-${route.name}`,
71
+ }))
72
+ : [
73
+ {
74
+ ...route,
75
+ id: `${routeIndex}-main-${route.name}`,
76
+ },
77
+ ]);
78
+ }, [plugins]);
79
+ // Group routes by type for better organization
80
+ const groupedRoutes = useMemo(() => {
81
+ const core = [];
82
+ const newItems = [];
83
+ const lists = [];
84
+ const pluginRoutes = [];
85
+ allRoutes.forEach((route) => {
86
+ if (route.type === 'new') {
87
+ newItems.push(route);
88
+ }
89
+ else if (route.type === 'list') {
90
+ lists.push(route);
91
+ }
92
+ else if (route.type === 'plugin') {
93
+ pluginRoutes.push(route);
94
+ }
95
+ else {
96
+ core.push(route);
97
+ }
98
+ });
99
+ return { core, newItems, lists, pluginRoutes };
100
+ }, [allRoutes]);
101
+ const getRouteIcon = (type) => {
102
+ switch (type) {
103
+ case 'new':
104
+ return _jsx(ListPlus, { className: "mr-2 h-4 w-4 text-emerald-500" });
105
+ case 'list':
106
+ return _jsx(FileText, { className: "mr-2 h-4 w-4 text-blue-500" });
107
+ case 'plugin':
108
+ return _jsx(Puzzle, { className: "mr-2 h-4 w-4 text-purple-500" });
109
+ default:
110
+ return _jsx(LayoutDashboard, { className: "mr-2 h-4 w-4 text-gray-500" });
111
+ }
112
+ };
113
+ return (_jsxs(CommandDialog, { open: isOpen, onOpenChange: toggle, modal: true, children: [_jsx(CommandInput, { placeholder: t('globalSearch.placeholder'), className: "placeholder:text-muted-foreground flex-1 bg-transparent text-base outline-none" }), _jsxs(CommandList, { className: "max-h-[300px] overflow-y-auto py-2", children: [_jsx(CommandEmpty, { className: "py-6 text-center text-sm", children: t('globalSearch.emptyState') }), groupedRoutes.core.length > 0 && (_jsx(CommandGroup, { heading: t('globalSearch.navigation'), className: "px-2", children: groupedRoutes.core.map((route) => (_jsxs(CommandItem, { onSelect: () => {
114
+ if (route.path) {
115
+ navigate(route.path);
116
+ }
117
+ close();
118
+ }, className: "hover:bg-accent group flex cursor-pointer items-center rounded-md px-2 py-2 transition-colors", children: [getRouteIcon(route.type), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "font-medium", children: route.name }), route.description && _jsx("span", { className: "text-muted-foreground text-xs", children: route.description })] }), _jsx(ArrowRight, { className: "ml-auto h-4 w-4 opacity-0 transition-opacity group-hover:opacity-70" })] }, route.id || `core-${route.name}-${route.path}`))) })), groupedRoutes.newItems.length > 0 && (_jsx(CommandGroup, { heading: t('globalSearch.createNew'), className: "px-2", children: groupedRoutes.newItems.map((route) => (_jsxs(CommandItem, { onSelect: () => {
119
+ if (route.path) {
120
+ navigate(route.path);
121
+ }
122
+ close();
123
+ }, className: "hover:bg-accent group flex cursor-pointer items-center rounded-md px-2 py-2 transition-colors", children: [getRouteIcon(route.type), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "font-medium", children: route.name }), route.description && _jsx("span", { className: "text-muted-foreground text-xs", children: route.description })] }), _jsx(ArrowRight, { className: "ml-auto h-4 w-4 opacity-0 transition-opacity group-hover:opacity-70" })] }, route.id || `new-${route.name}-${route.path}`))) })), groupedRoutes.lists.length > 0 && (_jsx(CommandGroup, { heading: t('globalSearch.viewLists'), className: "px-2", children: groupedRoutes.lists.map((route) => (_jsxs(CommandItem, { onSelect: () => {
124
+ if (route.path) {
125
+ navigate(route.path);
126
+ }
127
+ close();
128
+ }, className: "hover:bg-accent group flex cursor-pointer items-center rounded-md px-2 py-2 transition-colors", children: [getRouteIcon(route.type), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "font-medium", children: route.name }), route.description && _jsx("span", { className: "text-muted-foreground text-xs", children: route.description })] }), _jsx(ArrowRight, { className: "ml-auto h-4 w-4 opacity-0 transition-opacity group-hover:opacity-70" })] }, route.id || `list-${route.name}-${route.path}`))) })), groupedRoutes.pluginRoutes.length > 0 && (_jsx(CommandGroup, { heading: t('globalSearch.plugins'), className: "px-2", children: groupedRoutes.pluginRoutes.map((route) => (_jsxs(CommandItem, { onSelect: () => {
129
+ if (route.path) {
130
+ navigate(route.path);
131
+ }
132
+ close();
133
+ }, className: "hover:bg-accent group flex cursor-pointer items-center rounded-md px-2 py-2 transition-colors", children: [getRouteIcon(route.type), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "font-medium", children: route.name }), route.description && _jsx("span", { className: "text-muted-foreground text-xs", children: route.description })] }), _jsx(ArrowRight, { className: "ml-auto h-4 w-4 opacity-0 transition-opacity group-hover:opacity-70" })] }, route.id || `plugin-${route.name}-${route.path}`))) }))] }), _jsx("div", { className: "bg-muted/50 border-t p-2", children: _jsxs("div", { className: "text-muted-foreground flex items-center justify-between text-xs", children: [_jsxs("div", { className: "flex gap-2", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("kbd", { className: "bg-muted rounded border px-1.5 py-0.5 text-[10px]", children: "\u2191" }), _jsx("kbd", { className: "bg-muted rounded border px-1.5 py-0.5 text-[10px]", children: "\u2193" }), _jsx("span", { children: t('globalSearch.navigate') })] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("kbd", { className: "bg-muted rounded border px-1.5 py-0.5 text-[10px]", children: "Enter" }), _jsx("span", { children: t('globalSearch.select') })] })] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("kbd", { className: "bg-muted rounded border px-1.5 py-0.5 text-[10px]", children: "Esc" }), _jsx("span", { children: t('globalSearch.close') })] })] }) })] }));
134
+ };
@@ -0,0 +1,29 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useTranslation, Badge, Button, Checkbox, Label, Textarea, cn } from '@deenruv/react-ui-devkit';
4
+ import { useState } from 'react';
5
+ import { useParams } from 'react-router-dom';
6
+ import { MessageCircle, ShieldCheck, Send } from 'lucide-react';
7
+ export const AddEntryForm = ({ newNote, isPrivate, setIsPrivate, setNewNote, onConfirm, }) => {
8
+ const { t } = useTranslation('common');
9
+ const { id } = useParams();
10
+ const [isSubmitting, setIsSubmitting] = useState(false);
11
+ const handleSubmit = async () => {
12
+ if (newNote === '')
13
+ return;
14
+ setIsSubmitting(true);
15
+ try {
16
+ await onConfirm({ isPublic: !isPrivate, note: newNote, id: id });
17
+ setNewNote('');
18
+ }
19
+ finally {
20
+ setIsSubmitting(false);
21
+ }
22
+ };
23
+ return (_jsxs("div", { className: "bg-card rounded-md border p-4", children: [_jsx(Label, { htmlFor: "comment", className: "mb-2 block font-medium", children: t('history.addCommentButton', 'Add a note') }), _jsx("div", { className: "mb-3", children: _jsx(Textarea, { id: "comment", placeholder: t('history.commentPlaceholder', 'Type your note here...'), onKeyUp: (e) => {
24
+ e.currentTarget.style.height = '1px';
25
+ e.currentTarget.style.height = 12 + e.currentTarget.scrollHeight + 'px';
26
+ }, value: newNote, onChange: (e) => setNewNote(e.currentTarget.value), className: "h-min max-h-[300px] min-h-[80px] w-full resize-none overflow-auto rounded-md p-3" }) }), _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Checkbox, { id: "isPublic", name: "isPublic", checked: isPrivate, onClick: () => setIsPrivate((p) => !p) }), _jsxs(Label, { htmlFor: "isPublic", className: "flex cursor-pointer items-center gap-1 text-sm", children: [_jsx(ShieldCheck, { className: cn('h-4 w-4', isPrivate ? 'text-emerald-500' : 'text-muted-foreground') }), t('history.isPrivate', 'Private note'), _jsx("span", { className: "text-muted-foreground ml-1 text-xs", children: t('history.isPrivateDescription', '(visible only to admins)') })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Badge, { variant: isPrivate ? 'outline' : 'secondary', className: cn('gap-1', !isPrivate
27
+ ? 'bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-300'
28
+ : 'border-emerald-200 text-emerald-800 dark:border-emerald-800 dark:text-emerald-300'), children: !isPrivate ? (_jsxs(_Fragment, { children: [_jsx(MessageCircle, { className: "size-3" }), t('history.toAdminsAndCustomer', 'Visible to customer')] })) : (_jsxs(_Fragment, { children: [_jsx(ShieldCheck, { className: "size-3" }), t('history.toAdmins', 'Admin only')] })) }), _jsx(Button, { disabled: newNote === '' || isSubmitting, onClick: handleSubmit, className: "gap-2", children: isSubmitting ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "size-4 animate-spin rounded-full border-2 border-current border-r-transparent" }), t('history.adding', 'Adding...')] })) : (_jsxs(_Fragment, { children: [_jsx(Send, { className: "size-4" }), t('history.addComment', 'Add Note')] })) })] })] })] }));
29
+ };
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, useTranslation, } from '@deenruv/react-ui-devkit';
4
+ import { useState } from 'react';
5
+ import { Trash } from 'lucide-react';
6
+ export const DeleteEntryDialog = ({ isOpen, setIsOpen, selectedNote, onConfirm }) => {
7
+ const { t } = useTranslation('common');
8
+ const [isDeleting, setIsDeleting] = useState(false);
9
+ const handleDelete = async () => {
10
+ if (!selectedNote)
11
+ return;
12
+ setIsDeleting(true);
13
+ try {
14
+ onConfirm(selectedNote.id);
15
+ setIsOpen(false);
16
+ }
17
+ finally {
18
+ setIsDeleting(false);
19
+ }
20
+ };
21
+ return (_jsx(AlertDialog, { open: isOpen, onOpenChange: setIsOpen, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsxs(AlertDialogTitle, { className: "flex items-center gap-2 text-red-600", children: [_jsx(Trash, { className: "size-5" }), t('history.deleteNoteHeader', 'Delete Note')] }), _jsx(AlertDialogDescription, { children: t('history.deleteConfirmation', 'Are you sure you want to delete this note? This action cannot be undone.') })] }), selectedNote?.data?.note && (_jsx("div", { className: "bg-muted/30 my-4 max-h-[200px] overflow-y-auto rounded-md border p-3 text-sm", children: _jsx("div", { className: "whitespace-pre-wrap", children: selectedNote.data.note }) })), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: isDeleting, children: t('history.cancel', 'Cancel') }), _jsx(AlertDialogAction, { onClick: (e) => {
22
+ e.preventDefault();
23
+ handleDelete();
24
+ }, disabled: isDeleting, className: "bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-800", children: isDeleting ? (_jsxs("span", { className: "flex items-center gap-2", children: [_jsx("span", { className: "size-4 animate-spin rounded-full border-2 border-current border-r-transparent" }), t('history.deleting', 'Deleting...')] })) : (_jsxs("span", { className: "flex items-center gap-2", children: [_jsx(Trash, { className: "size-4" }), t('history.delete', 'Delete')] })) })] })] }) }));
25
+ };