spree_admin 5.0.0.rc1

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 (795) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +13 -0
  3. data/README.md +4 -0
  4. data/Rakefile +15 -0
  5. data/app/assets/config/spree_admin_manifest.js +10 -0
  6. data/app/assets/images/favicon_256x256.png +0 -0
  7. data/app/assets/stylesheets/spree/admin/actiontext.css +36 -0
  8. data/app/assets/stylesheets/spree/admin/application.scss +43 -0
  9. data/app/assets/stylesheets/spree/admin/components/_alerts.scss +48 -0
  10. data/app/assets/stylesheets/spree/admin/components/_badges.scss +117 -0
  11. data/app/assets/stylesheets/spree/admin/components/_bulk_panel.scss +31 -0
  12. data/app/assets/stylesheets/spree/admin/components/_buttons.scss +198 -0
  13. data/app/assets/stylesheets/spree/admin/components/_cards.scss +126 -0
  14. data/app/assets/stylesheets/spree/admin/components/_dropdowns.scss +148 -0
  15. data/app/assets/stylesheets/spree/admin/components/_filters.scss +41 -0
  16. data/app/assets/stylesheets/spree/admin/components/_line_items_form.scss +32 -0
  17. data/app/assets/stylesheets/spree/admin/components/_main.scss +148 -0
  18. data/app/assets/stylesheets/spree/admin/components/_media_form.scss +91 -0
  19. data/app/assets/stylesheets/spree/admin/components/_modals.scss +42 -0
  20. data/app/assets/stylesheets/spree/admin/components/_navbar.scss +10 -0
  21. data/app/assets/stylesheets/spree/admin/components/_navigation.scss +53 -0
  22. data/app/assets/stylesheets/spree/admin/components/_offcanvas.scss +26 -0
  23. data/app/assets/stylesheets/spree/admin/components/_search_picker.scss +55 -0
  24. data/app/assets/stylesheets/spree/admin/components/_seo_form.scss +16 -0
  25. data/app/assets/stylesheets/spree/admin/components/_sortable_tree.scss +58 -0
  26. data/app/assets/stylesheets/spree/admin/components/_tables.scss +187 -0
  27. data/app/assets/stylesheets/spree/admin/components/_variants_form.scss +203 -0
  28. data/app/assets/stylesheets/spree/admin/global/_variables.scss +190 -0
  29. data/app/assets/stylesheets/spree/admin/plugins/_dropdown.scss +102 -0
  30. data/app/assets/stylesheets/spree/admin/plugins/_items.scss +115 -0
  31. data/app/assets/stylesheets/spree/admin/plugins/_tinymce_custom.scss +74 -0
  32. data/app/assets/stylesheets/spree/admin/plugins/_trix_custom.scss +110 -0
  33. data/app/assets/stylesheets/spree/admin/plugins/flatfile.scss +4 -0
  34. data/app/assets/stylesheets/spree/admin/plugins/plugins/checkbox_options.scss +5 -0
  35. data/app/assets/stylesheets/spree/admin/plugins/plugins/clear_button.scss +30 -0
  36. data/app/assets/stylesheets/spree/admin/plugins/plugins/drag_drop.scss +16 -0
  37. data/app/assets/stylesheets/spree/admin/plugins/plugins/dropdown_header.scss +23 -0
  38. data/app/assets/stylesheets/spree/admin/plugins/plugins/dropdown_input.scss +47 -0
  39. data/app/assets/stylesheets/spree/admin/plugins/plugins/input_autogrow.scss +18 -0
  40. data/app/assets/stylesheets/spree/admin/plugins/plugins/optgroup_columns.scss +23 -0
  41. data/app/assets/stylesheets/spree/admin/plugins/plugins/remove_button.scss +44 -0
  42. data/app/assets/stylesheets/spree/admin/plugins/tom-select.bootstrap4.scss +219 -0
  43. data/app/assets/stylesheets/spree/admin/plugins/tom-select.bootstrap5.scss +274 -0
  44. data/app/assets/stylesheets/spree/admin/plugins/tom-select.default.scss +87 -0
  45. data/app/assets/stylesheets/spree/admin/plugins/tom-select.scss +175 -0
  46. data/app/assets/stylesheets/spree/admin/plugins/uppy_fixes.scss +25 -0
  47. data/app/assets/stylesheets/spree/admin/shared/_base.scss +674 -0
  48. data/app/assets/stylesheets/spree/admin/shared/_forms.scss +184 -0
  49. data/app/assets/stylesheets/spree/admin/views/_dashboard.scss +34 -0
  50. data/app/assets/stylesheets/spree/admin/views/_page_builder.scss +237 -0
  51. data/app/controllers/concerns/spree/admin/analytics_concern.rb +51 -0
  52. data/app/controllers/concerns/spree/admin/bulk_operations_concern.rb +38 -0
  53. data/app/controllers/concerns/spree/admin/order_concern.rb +24 -0
  54. data/app/controllers/concerns/spree/admin/page_builder_concern.rb +44 -0
  55. data/app/controllers/spree/admin/action_text/video_embeds_controller.rb +44 -0
  56. data/app/controllers/spree/admin/addresses_controller.rb +86 -0
  57. data/app/controllers/spree/admin/assets_controller.rb +70 -0
  58. data/app/controllers/spree/admin/base_controller.rb +131 -0
  59. data/app/controllers/spree/admin/checkouts_controller.rb +23 -0
  60. data/app/controllers/spree/admin/classifications_controller.rb +74 -0
  61. data/app/controllers/spree/admin/coupon_codes_controller.rb +21 -0
  62. data/app/controllers/spree/admin/custom_domains_controller.rb +19 -0
  63. data/app/controllers/spree/admin/customer_returns_controller.rb +20 -0
  64. data/app/controllers/spree/admin/dashboard_controller.rb +145 -0
  65. data/app/controllers/spree/admin/digital_assets_controller.rb +45 -0
  66. data/app/controllers/spree/admin/errors_controller.rb +11 -0
  67. data/app/controllers/spree/admin/exports_controller.rb +48 -0
  68. data/app/controllers/spree/admin/line_items_controller.rb +121 -0
  69. data/app/controllers/spree/admin/oauth_applications_controller.rb +27 -0
  70. data/app/controllers/spree/admin/option_types_controller.rb +23 -0
  71. data/app/controllers/spree/admin/option_values_controller.rb +21 -0
  72. data/app/controllers/spree/admin/orders/billing_address_controller.rb +103 -0
  73. data/app/controllers/spree/admin/orders/contact_information_controller.rb +45 -0
  74. data/app/controllers/spree/admin/orders/customer_returns_controller.rb +81 -0
  75. data/app/controllers/spree/admin/orders/payment_links_controller.rb +33 -0
  76. data/app/controllers/spree/admin/orders/return_authorizations_controller.rb +90 -0
  77. data/app/controllers/spree/admin/orders/shipping_address_controller.rb +85 -0
  78. data/app/controllers/spree/admin/orders/user_controller.rb +94 -0
  79. data/app/controllers/spree/admin/orders_controller.rb +87 -0
  80. data/app/controllers/spree/admin/page_blocks_controller.rb +40 -0
  81. data/app/controllers/spree/admin/page_links_controller.rb +43 -0
  82. data/app/controllers/spree/admin/page_sections_controller.rb +57 -0
  83. data/app/controllers/spree/admin/pages_controller.rb +40 -0
  84. data/app/controllers/spree/admin/payment_methods_controller.rb +45 -0
  85. data/app/controllers/spree/admin/payments_controller.rb +122 -0
  86. data/app/controllers/spree/admin/post_categories_controller.rb +6 -0
  87. data/app/controllers/spree/admin/posts_controller.rb +23 -0
  88. data/app/controllers/spree/admin/products_controller.rb +366 -0
  89. data/app/controllers/spree/admin/profile_controller.rb +31 -0
  90. data/app/controllers/spree/admin/promotion_actions_controller.rb +47 -0
  91. data/app/controllers/spree/admin/promotion_rules_controller.rb +39 -0
  92. data/app/controllers/spree/admin/promotions_controller.rb +61 -0
  93. data/app/controllers/spree/admin/properties_controller.rb +23 -0
  94. data/app/controllers/spree/admin/refund_reasons_controller.rb +6 -0
  95. data/app/controllers/spree/admin/refunds_controller.rb +43 -0
  96. data/app/controllers/spree/admin/reimbursement_types_controller.rb +6 -0
  97. data/app/controllers/spree/admin/reimbursements_controller.rb +47 -0
  98. data/app/controllers/spree/admin/reports_controller.rb +52 -0
  99. data/app/controllers/spree/admin/resource_controller.rb +325 -0
  100. data/app/controllers/spree/admin/return_authorization_reasons_controller.rb +6 -0
  101. data/app/controllers/spree/admin/return_authorizations_controller.rb +29 -0
  102. data/app/controllers/spree/admin/return_items_controller.rb +9 -0
  103. data/app/controllers/spree/admin/roles_controller.rb +6 -0
  104. data/app/controllers/spree/admin/shipments_controller.rb +102 -0
  105. data/app/controllers/spree/admin/shipping_categories_controller.rb +6 -0
  106. data/app/controllers/spree/admin/shipping_methods_controller.rb +29 -0
  107. data/app/controllers/spree/admin/stock_items_controller.rb +25 -0
  108. data/app/controllers/spree/admin/stock_locations_controller.rb +24 -0
  109. data/app/controllers/spree/admin/stock_transfers_controller.rb +48 -0
  110. data/app/controllers/spree/admin/store_credit_categories_controller.rb +6 -0
  111. data/app/controllers/spree/admin/store_credits_controller.rb +93 -0
  112. data/app/controllers/spree/admin/storefront_controller.rb +38 -0
  113. data/app/controllers/spree/admin/stores_controller.rb +87 -0
  114. data/app/controllers/spree/admin/tax_categories_controller.rb +6 -0
  115. data/app/controllers/spree/admin/tax_rates_controller.rb +20 -0
  116. data/app/controllers/spree/admin/taxonomies_controller.rb +21 -0
  117. data/app/controllers/spree/admin/taxons_controller.rb +98 -0
  118. data/app/controllers/spree/admin/themes_controller.rb +75 -0
  119. data/app/controllers/spree/admin/translations_controller.rb +74 -0
  120. data/app/controllers/spree/admin/users_controller.rb +91 -0
  121. data/app/controllers/spree/admin/variants_controller.rb +90 -0
  122. data/app/controllers/spree/admin/webhooks_subscribers_controller.rb +48 -0
  123. data/app/controllers/spree/admin/zones_controller.rb +37 -0
  124. data/app/helpers/spree/admin/base_helper.rb +246 -0
  125. data/app/helpers/spree/admin/custom_domains_helper.rb +9 -0
  126. data/app/helpers/spree/admin/customer_returns_helper.rb +18 -0
  127. data/app/helpers/spree/admin/flash_helper.rb +15 -0
  128. data/app/helpers/spree/admin/navigation_helper.rb +195 -0
  129. data/app/helpers/spree/admin/onboarding_helper.rb +18 -0
  130. data/app/helpers/spree/admin/orders_filters_helper.rb +68 -0
  131. data/app/helpers/spree/admin/orders_helper.rb +179 -0
  132. data/app/helpers/spree/admin/page_builder_helper.rb +130 -0
  133. data/app/helpers/spree/admin/payments_helper.rb +24 -0
  134. data/app/helpers/spree/admin/posts_helper.rb +9 -0
  135. data/app/helpers/spree/admin/products_helper.rb +127 -0
  136. data/app/helpers/spree/admin/promotion_actions_helper.rb +10 -0
  137. data/app/helpers/spree/admin/promotion_rules_helper.rb +17 -0
  138. data/app/helpers/spree/admin/promotions_helper.rb +25 -0
  139. data/app/helpers/spree/admin/reimbursement_type_helper.rb +9 -0
  140. data/app/helpers/spree/admin/session_assets_helper.rb +24 -0
  141. data/app/helpers/spree/admin/shipment_helper.rb +27 -0
  142. data/app/helpers/spree/admin/sortable_tree_helper.rb +31 -0
  143. data/app/helpers/spree/admin/stock_locations_helper.rb +22 -0
  144. data/app/helpers/spree/admin/store_helper.rb +46 -0
  145. data/app/helpers/spree/admin/stores_helper.rb +86 -0
  146. data/app/helpers/spree/admin/tags_helper.rb +35 -0
  147. data/app/helpers/spree/admin/taxons_helper.rb +27 -0
  148. data/app/helpers/spree/admin/themes_helper.rb +9 -0
  149. data/app/helpers/spree/admin/translations_helper.rb +14 -0
  150. data/app/helpers/spree/admin/turbo_helper.rb +41 -0
  151. data/app/helpers/spree/admin/users_helper.rb +37 -0
  152. data/app/helpers/spree/admin/webhooks_subscribers_helper.rb +31 -0
  153. data/app/helpers/tom_select_helper.rb +42 -0
  154. data/app/javascript/spree/admin/application.js +157 -0
  155. data/app/javascript/spree/admin/controllers/active_storage_upload_controller.js +168 -0
  156. data/app/javascript/spree/admin/controllers/address_form_controller.js +98 -0
  157. data/app/javascript/spree/admin/controllers/asset_uploader_controller.js +58 -0
  158. data/app/javascript/spree/admin/controllers/autocomplete_select_controller.js +36 -0
  159. data/app/javascript/spree/admin/controllers/better_slider_controller.js +23 -0
  160. data/app/javascript/spree/admin/controllers/block_form_controller.js +11 -0
  161. data/app/javascript/spree/admin/controllers/bootstrap_tabs_controller.js +9 -0
  162. data/app/javascript/spree/admin/controllers/bulk_operation_controller.js +78 -0
  163. data/app/javascript/spree/admin/controllers/calculator_fields_controller.js +24 -0
  164. data/app/javascript/spree/admin/controllers/calendar_range_controller.js +52 -0
  165. data/app/javascript/spree/admin/controllers/clipboard_controller.js +17 -0
  166. data/app/javascript/spree/admin/controllers/color_palette_controller.js +22 -0
  167. data/app/javascript/spree/admin/controllers/color_picker_controller.js +52 -0
  168. data/app/javascript/spree/admin/controllers/enable_button_controller.js +29 -0
  169. data/app/javascript/spree/admin/controllers/filters_controller.js +66 -0
  170. data/app/javascript/spree/admin/controllers/font_picker_controller.js +55 -0
  171. data/app/javascript/spree/admin/controllers/media_form_controller.js +38 -0
  172. data/app/javascript/spree/admin/controllers/multi_input_controller.js +75 -0
  173. data/app/javascript/spree/admin/controllers/multi_tom_select_controller.js +80 -0
  174. data/app/javascript/spree/admin/controllers/order_billing_address_controller.js +39 -0
  175. data/app/javascript/spree/admin/controllers/page_builder_controller.js +316 -0
  176. data/app/javascript/spree/admin/controllers/password_toggle_controller.js +14 -0
  177. data/app/javascript/spree/admin/controllers/product_form_controller.js +70 -0
  178. data/app/javascript/spree/admin/controllers/range_input_controller.js +9 -0
  179. data/app/javascript/spree/admin/controllers/replace_controller.js +15 -0
  180. data/app/javascript/spree/admin/controllers/return_items_controller.js +47 -0
  181. data/app/javascript/spree/admin/controllers/row_link_controller.js +18 -0
  182. data/app/javascript/spree/admin/controllers/rule_form_controller.js +17 -0
  183. data/app/javascript/spree/admin/controllers/search_picker_controller.js +38 -0
  184. data/app/javascript/spree/admin/controllers/section_form_controller.js +14 -0
  185. data/app/javascript/spree/admin/controllers/select_controller.js +117 -0
  186. data/app/javascript/spree/admin/controllers/seo_form_controller.js +116 -0
  187. data/app/javascript/spree/admin/controllers/slug_form_controller.js +17 -0
  188. data/app/javascript/spree/admin/controllers/sortable_tree_controller.js +55 -0
  189. data/app/javascript/spree/admin/controllers/stock_transfer_controller.js +87 -0
  190. data/app/javascript/spree/admin/controllers/store_form_controller.js +17 -0
  191. data/app/javascript/spree/admin/controllers/unit_system_controller.js +27 -0
  192. data/app/javascript/spree/admin/controllers/variants_form_controller.js +1048 -0
  193. data/app/javascript/spree/admin/controllers/webhook_subscriber_events_controller.js +19 -0
  194. data/app/javascript/spree/admin/helpers/bootstrap.js +49 -0
  195. data/app/javascript/spree/admin/helpers/canvas.js +29 -0
  196. data/app/javascript/spree/admin/helpers/index.js +0 -0
  197. data/app/javascript/spree/admin/helpers/tinymce.js +65 -0
  198. data/app/javascript/spree/admin/helpers/trix/video_embed.js +182 -0
  199. data/app/javascript/spree/admin/helpers/uppy_active_storage.js +210 -0
  200. data/app/models/spree/admin/resource.rb +36 -0
  201. data/app/models/spree/admin/updater.rb +42 -0
  202. data/app/views/active_storage/_upload_form.html.erb +65 -0
  203. data/app/views/kaminari/admin-twitter-bootstrap-4/_first_page.html.erb +13 -0
  204. data/app/views/kaminari/admin-twitter-bootstrap-4/_gap.html.erb +12 -0
  205. data/app/views/kaminari/admin-twitter-bootstrap-4/_last_page.html.erb +13 -0
  206. data/app/views/kaminari/admin-twitter-bootstrap-4/_next_page.html.erb +13 -0
  207. data/app/views/kaminari/admin-twitter-bootstrap-4/_page.html.erb +18 -0
  208. data/app/views/kaminari/admin-twitter-bootstrap-4/_paginator.html.erb +17 -0
  209. data/app/views/kaminari/admin-twitter-bootstrap-4/_prev_page.html.erb +13 -0
  210. data/app/views/layouts/spree/admin.html.erb +21 -0
  211. data/app/views/layouts/spree/page_builder.html.erb +45 -0
  212. data/app/views/spree/admin/addresses/edit.html.erb +12 -0
  213. data/app/views/spree/admin/addresses/new.html.erb +16 -0
  214. data/app/views/spree/admin/assets/bulk_destroy.turbo_stream.erb +3 -0
  215. data/app/views/spree/admin/assets/create.turbo_stream.erb +5 -0
  216. data/app/views/spree/admin/assets/destroy.turbo_stream.erb +4 -0
  217. data/app/views/spree/admin/assets/edit.html.erb +27 -0
  218. data/app/views/spree/admin/assets/update.turbo_stream.erb +7 -0
  219. data/app/views/spree/admin/classifications/_classification.html.erb +38 -0
  220. data/app/views/spree/admin/classifications/create.turbo_stream.erb +7 -0
  221. data/app/views/spree/admin/classifications/destroy.turbo_stream.erb +2 -0
  222. data/app/views/spree/admin/classifications/index.html.erb +20 -0
  223. data/app/views/spree/admin/classifications/new.html.erb +1 -0
  224. data/app/views/spree/admin/coupon_codes/_coupon_code.html.erb +12 -0
  225. data/app/views/spree/admin/coupon_codes/index.csv.erb +14 -0
  226. data/app/views/spree/admin/coupon_codes/index.html.erb +70 -0
  227. data/app/views/spree/admin/custom_domains/_custom_domain.html.erb +13 -0
  228. data/app/views/spree/admin/custom_domains/_custom_domains.html.erb +24 -0
  229. data/app/views/spree/admin/custom_domains/_form.html.erb +19 -0
  230. data/app/views/spree/admin/custom_domains/create.turbo_stream.erb +3 -0
  231. data/app/views/spree/admin/custom_domains/edit.html.erb +15 -0
  232. data/app/views/spree/admin/custom_domains/index.html.erb +50 -0
  233. data/app/views/spree/admin/custom_domains/new.html.erb +15 -0
  234. data/app/views/spree/admin/customer_returns/_customer_return.html.erb +31 -0
  235. data/app/views/spree/admin/customer_returns/index.html.erb +57 -0
  236. data/app/views/spree/admin/dashboard/_analytics.html.erb +3 -0
  237. data/app/views/spree/admin/dashboard/_setup_progress.html.erb +17 -0
  238. data/app/views/spree/admin/dashboard/_setup_tasks.html.erb +24 -0
  239. data/app/views/spree/admin/dashboard/_store_preview.html.erb +45 -0
  240. data/app/views/spree/admin/dashboard/_top_products.html.erb +71 -0
  241. data/app/views/spree/admin/dashboard/_updater.html.erb +9 -0
  242. data/app/views/spree/admin/dashboard/_visits.html.erb +112 -0
  243. data/app/views/spree/admin/dashboard/analytics.html.erb +118 -0
  244. data/app/views/spree/admin/dashboard/getting_started.html.erb +22 -0
  245. data/app/views/spree/admin/dashboard/setup_tasks/_add_products.html.erb +22 -0
  246. data/app/views/spree/admin/dashboard/setup_tasks/_set_customer_support_email.html.erb +23 -0
  247. data/app/views/spree/admin/dashboard/setup_tasks/_setup_payment_method.html.erb +6 -0
  248. data/app/views/spree/admin/dashboard/setup_tasks/_setup_taxes_collection.html.erb +6 -0
  249. data/app/views/spree/admin/dashboard/show.html.erb +33 -0
  250. data/app/views/spree/admin/digital_assets/_digital_asset.html.erb +30 -0
  251. data/app/views/spree/admin/digital_assets/_form.html.erb +18 -0
  252. data/app/views/spree/admin/digital_assets/_table.html.erb +40 -0
  253. data/app/views/spree/admin/digital_assets/create.turbo_stream.erb +2 -0
  254. data/app/views/spree/admin/digital_assets/edit.html.erb +22 -0
  255. data/app/views/spree/admin/digital_assets/index.html.erb +27 -0
  256. data/app/views/spree/admin/digital_assets/new.html.erb +22 -0
  257. data/app/views/spree/admin/digital_assets/update.turbo_stream.erb +2 -0
  258. data/app/views/spree/admin/exports/_export.html.erb +42 -0
  259. data/app/views/spree/admin/exports/create.turbo_stream.erb +2 -0
  260. data/app/views/spree/admin/exports/index.html.erb +30 -0
  261. data/app/views/spree/admin/exports/new.html.erb +42 -0
  262. data/app/views/spree/admin/line_items/edit.html.erb +20 -0
  263. data/app/views/spree/admin/line_items/new.html.erb +32 -0
  264. data/app/views/spree/admin/oauth_applications/_form.html.erb +11 -0
  265. data/app/views/spree/admin/oauth_applications/create.turbo_stream.erb +41 -0
  266. data/app/views/spree/admin/oauth_applications/edit.html.erb +19 -0
  267. data/app/views/spree/admin/oauth_applications/index.html.erb +75 -0
  268. data/app/views/spree/admin/oauth_applications/new.html.erb +25 -0
  269. data/app/views/spree/admin/option_types/_filter.html.erb +7 -0
  270. data/app/views/spree/admin/option_types/_form.html.erb +87 -0
  271. data/app/views/spree/admin/option_types/_option_type.html.erb +19 -0
  272. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +29 -0
  273. data/app/views/spree/admin/option_types/edit.html.erb +11 -0
  274. data/app/views/spree/admin/option_types/index.html.erb +63 -0
  275. data/app/views/spree/admin/option_types/new.html.erb +11 -0
  276. data/app/views/spree/admin/option_types/update.turbo_stream.erb +1 -0
  277. data/app/views/spree/admin/option_values/destroy.turbo_stream.erb +1 -0
  278. data/app/views/spree/admin/orders/_body_custom.html.erb +0 -0
  279. data/app/views/spree/admin/orders/_customer.html.erb +79 -0
  280. data/app/views/spree/admin/orders/_customer_returns.html.erb +26 -0
  281. data/app/views/spree/admin/orders/_customer_summary.html.erb +22 -0
  282. data/app/views/spree/admin/orders/_extra_filters.html.erb +0 -0
  283. data/app/views/spree/admin/orders/_filters.html.erb +106 -0
  284. data/app/views/spree/admin/orders/_header.html.erb +76 -0
  285. data/app/views/spree/admin/orders/_header_custom.html.erb +0 -0
  286. data/app/views/spree/admin/orders/_line_item.html.erb +61 -0
  287. data/app/views/spree/admin/orders/_line_items.html.erb +68 -0
  288. data/app/views/spree/admin/orders/_list.html.erb +30 -0
  289. data/app/views/spree/admin/orders/_order.html.erb +28 -0
  290. data/app/views/spree/admin/orders/_payments.html.erb +35 -0
  291. data/app/views/spree/admin/orders/_refunds.html.erb +49 -0
  292. data/app/views/spree/admin/orders/_return_authorizations.html.erb +26 -0
  293. data/app/views/spree/admin/orders/_risk_analysis.html.erb +26 -0
  294. data/app/views/spree/admin/orders/_shipment.html.erb +104 -0
  295. data/app/views/spree/admin/orders/_shipment_manifest_item.html.erb +17 -0
  296. data/app/views/spree/admin/orders/_shipments.html.erb +22 -0
  297. data/app/views/spree/admin/orders/_summary.html.erb +100 -0
  298. data/app/views/spree/admin/orders/_summary_custom.html.erb +0 -0
  299. data/app/views/spree/admin/orders/_table_filter_dropdown.html.erb +34 -0
  300. data/app/views/spree/admin/orders/_tax_lines.html.erb +11 -0
  301. data/app/views/spree/admin/orders/_user_overview.html.erb +13 -0
  302. data/app/views/spree/admin/orders/billing_address/_form.html.erb +14 -0
  303. data/app/views/spree/admin/orders/billing_address/create.turbo_stream.erb +35 -0
  304. data/app/views/spree/admin/orders/billing_address/edit.html.erb +42 -0
  305. data/app/views/spree/admin/orders/billing_address/new.html.erb +35 -0
  306. data/app/views/spree/admin/orders/billing_address/update.turbo_stream.erb +35 -0
  307. data/app/views/spree/admin/orders/contact_information/edit.html.erb +20 -0
  308. data/app/views/spree/admin/orders/customer_returns/_customer_return.html.erb +70 -0
  309. data/app/views/spree/admin/orders/customer_returns/_reimbursements_table.html.erb +40 -0
  310. data/app/views/spree/admin/orders/customer_returns/_return_item_decision.html.erb +54 -0
  311. data/app/views/spree/admin/orders/customer_returns/_return_item_selection.html.erb +72 -0
  312. data/app/views/spree/admin/orders/customer_returns/edit.html.erb +144 -0
  313. data/app/views/spree/admin/orders/customer_returns/new.html.erb +67 -0
  314. data/app/views/spree/admin/orders/edit.html.erb +23 -0
  315. data/app/views/spree/admin/orders/index.html.erb +23 -0
  316. data/app/views/spree/admin/orders/return_authorizations/_form.html.erb +176 -0
  317. data/app/views/spree/admin/orders/return_authorizations/_return_authorization.html.erb +36 -0
  318. data/app/views/spree/admin/orders/return_authorizations/edit.html.erb +44 -0
  319. data/app/views/spree/admin/orders/return_authorizations/new.html.erb +13 -0
  320. data/app/views/spree/admin/orders/return_authorizations/show.html.erb +128 -0
  321. data/app/views/spree/admin/orders/shipping_address/_form.html.erb +13 -0
  322. data/app/views/spree/admin/orders/shipping_address/create.turbo_stream.erb +17 -0
  323. data/app/views/spree/admin/orders/shipping_address/edit.html.erb +17 -0
  324. data/app/views/spree/admin/orders/shipping_address/new.html.erb +17 -0
  325. data/app/views/spree/admin/orders/shipping_address/update.turbo_stream.erb +17 -0
  326. data/app/views/spree/admin/orders/user/create.turbo_stream.erb +12 -0
  327. data/app/views/spree/admin/orders/user/edit.html.erb +3 -0
  328. data/app/views/spree/admin/orders/user/new.html.erb +30 -0
  329. data/app/views/spree/admin/orders/user/update.turbo_stream.erb +5 -0
  330. data/app/views/spree/admin/page_blocks/_form_tab_buttons.html.erb +7 -0
  331. data/app/views/spree/admin/page_blocks/create.turbo_stream.erb +4 -0
  332. data/app/views/spree/admin/page_blocks/destroy.turbo_stream.erb +9 -0
  333. data/app/views/spree/admin/page_blocks/edit.html.erb +48 -0
  334. data/app/views/spree/admin/page_blocks/forms/_brand.html.erb +15 -0
  335. data/app/views/spree/admin/page_blocks/forms/_brand_logo.html.erb +4 -0
  336. data/app/views/spree/admin/page_blocks/forms/_buttons.html.erb +13 -0
  337. data/app/views/spree/admin/page_blocks/forms/_buy_buttons.html.erb +10 -0
  338. data/app/views/spree/admin/page_blocks/forms/_heading.html.erb +28 -0
  339. data/app/views/spree/admin/page_blocks/forms/_image.html.erb +1 -0
  340. data/app/views/spree/admin/page_blocks/forms/_link.html.erb +19 -0
  341. data/app/views/spree/admin/page_blocks/forms/_mega_nav.html.erb +14 -0
  342. data/app/views/spree/admin/page_blocks/forms/_mega_nav_with_subcategories.html.erb +9 -0
  343. data/app/views/spree/admin/page_blocks/forms/_nav.html.erb +6 -0
  344. data/app/views/spree/admin/page_blocks/forms/_newsletter_form.html.erb +20 -0
  345. data/app/views/spree/admin/page_blocks/forms/_price.html.erb +15 -0
  346. data/app/views/spree/admin/page_blocks/forms/_quantity_selector.html.erb +10 -0
  347. data/app/views/spree/admin/page_blocks/forms/_share.html.erb +5 -0
  348. data/app/views/spree/admin/page_blocks/forms/_subheading.html.erb +26 -0
  349. data/app/views/spree/admin/page_blocks/forms/_text.html.erb +21 -0
  350. data/app/views/spree/admin/page_blocks/forms/_title.html.erb +20 -0
  351. data/app/views/spree/admin/page_blocks/forms/_variant_picker.html.erb +10 -0
  352. data/app/views/spree/admin/page_blocks/move_higher.turbo_stream.erb +4 -0
  353. data/app/views/spree/admin/page_blocks/move_lower.turbo_stream.erb +4 -0
  354. data/app/views/spree/admin/page_blocks/show.html.erb +1 -0
  355. data/app/views/spree/admin/page_blocks/update.turbo_stream.erb +6 -0
  356. data/app/views/spree/admin/page_builder/_add_block.html.erb +20 -0
  357. data/app/views/spree/admin/page_builder/_color_palette.html.erb +17 -0
  358. data/app/views/spree/admin/page_builder/_color_picker.html.erb +26 -0
  359. data/app/views/spree/admin/page_builder/_header.html.erb +99 -0
  360. data/app/views/spree/admin/page_builder/_labeled_range_input.html.erb +10 -0
  361. data/app/views/spree/admin/page_builder/_pages_dropdown.html.erb +23 -0
  362. data/app/views/spree/admin/page_builder/_range_input.html.erb +12 -0
  363. data/app/views/spree/admin/page_builder/_sidebar.html.erb +14 -0
  364. data/app/views/spree/admin/page_builder/_sidebar_block.html.erb +29 -0
  365. data/app/views/spree/admin/page_builder/_sidebar_colors.html.erb +84 -0
  366. data/app/views/spree/admin/page_builder/_sidebar_fonts.html.erb +85 -0
  367. data/app/views/spree/admin/page_builder/_sidebar_section.html.erb +46 -0
  368. data/app/views/spree/admin/page_builder/_sidebar_sections.html.erb +33 -0
  369. data/app/views/spree/admin/page_builder/_sidebar_sections_toolbar.html.erb +65 -0
  370. data/app/views/spree/admin/page_links/_form.html.erb +19 -0
  371. data/app/views/spree/admin/page_links/_linkable_type_dropdown.html.erb +15 -0
  372. data/app/views/spree/admin/page_links/_list.html.erb +36 -0
  373. data/app/views/spree/admin/page_links/_refresh_theme_preview.turbo_stream.erb +5 -0
  374. data/app/views/spree/admin/page_links/create.turbo_stream.erb +4 -0
  375. data/app/views/spree/admin/page_links/destroy.turbo_stream.erb +11 -0
  376. data/app/views/spree/admin/page_links/edit.html.erb +18 -0
  377. data/app/views/spree/admin/page_links/update.turbo_stream.erb +6 -0
  378. data/app/views/spree/admin/page_sections/_form_tab_buttons.html.erb +12 -0
  379. data/app/views/spree/admin/page_sections/create.turbo_stream.erb +11 -0
  380. data/app/views/spree/admin/page_sections/destroy.turbo_stream.erb +16 -0
  381. data/app/views/spree/admin/page_sections/edit.html.erb +42 -0
  382. data/app/views/spree/admin/page_sections/fields/_background_color.html.erb +6 -0
  383. data/app/views/spree/admin/page_sections/fields/_border_bottom_width.html.erb +5 -0
  384. data/app/views/spree/admin/page_sections/fields/_border_color.html.erb +7 -0
  385. data/app/views/spree/admin/page_sections/fields/_border_top_width.html.erb +6 -0
  386. data/app/views/spree/admin/page_sections/fields/_bottom_padding.html.erb +5 -0
  387. data/app/views/spree/admin/page_sections/fields/_button.html.erb +15 -0
  388. data/app/views/spree/admin/page_sections/fields/_header_layout.html.erb +26 -0
  389. data/app/views/spree/admin/page_sections/fields/_height.html.erb +6 -0
  390. data/app/views/spree/admin/page_sections/fields/_text_color.html.erb +7 -0
  391. data/app/views/spree/admin/page_sections/fields/_top_padding.html.erb +6 -0
  392. data/app/views/spree/admin/page_sections/forms/_announcement_bar.html.erb +5 -0
  393. data/app/views/spree/admin/page_sections/forms/_brand_story.html.erb +0 -0
  394. data/app/views/spree/admin/page_sections/forms/_collection_banner.html.erb +0 -0
  395. data/app/views/spree/admin/page_sections/forms/_custom_code.html.erb +4 -0
  396. data/app/views/spree/admin/page_sections/forms/_featured_posts.html.erb +38 -0
  397. data/app/views/spree/admin/page_sections/forms/_featured_product.html.erb +4 -0
  398. data/app/views/spree/admin/page_sections/forms/_featured_taxon.html.erb +59 -0
  399. data/app/views/spree/admin/page_sections/forms/_featured_taxons.html.erb +13 -0
  400. data/app/views/spree/admin/page_sections/forms/_footer.html.erb +20 -0
  401. data/app/views/spree/admin/page_sections/forms/_header.html.erb +14 -0
  402. data/app/views/spree/admin/page_sections/forms/_image_banner.html.erb +13 -0
  403. data/app/views/spree/admin/page_sections/forms/_image_with_text.html.erb +31 -0
  404. data/app/views/spree/admin/page_sections/forms/_main_password_footer.html.erb +9 -0
  405. data/app/views/spree/admin/page_sections/forms/_main_password_header.erb +13 -0
  406. data/app/views/spree/admin/page_sections/forms/_newsletter.html.erb +15 -0
  407. data/app/views/spree/admin/page_sections/forms/_page_title.html.erb +4 -0
  408. data/app/views/spree/admin/page_sections/forms/_post_details.html.erb +0 -0
  409. data/app/views/spree/admin/page_sections/forms/_post_grid.html.erb +0 -0
  410. data/app/views/spree/admin/page_sections/forms/_product_details.html.erb +1 -0
  411. data/app/views/spree/admin/page_sections/forms/_product_grid.html.erb +1 -0
  412. data/app/views/spree/admin/page_sections/forms/_related_products.html.erb +32 -0
  413. data/app/views/spree/admin/page_sections/forms/_rich_text.html.erb +0 -0
  414. data/app/views/spree/admin/page_sections/forms/_taxon_banner.html.erb +0 -0
  415. data/app/views/spree/admin/page_sections/forms/_taxon_grid.html.erb +5 -0
  416. data/app/views/spree/admin/page_sections/forms/_video.html.erb +15 -0
  417. data/app/views/spree/admin/page_sections/move_higher.turbo_stream.erb +7 -0
  418. data/app/views/spree/admin/page_sections/move_lower.turbo_stream.erb +7 -0
  419. data/app/views/spree/admin/page_sections/new.html.erb +28 -0
  420. data/app/views/spree/admin/page_sections/remove_attachment.turbo_stream.erb +4 -0
  421. data/app/views/spree/admin/page_sections/restore_design_settings_to_defaults.turbo_stream.erb +4 -0
  422. data/app/views/spree/admin/page_sections/show.html.erb +1 -0
  423. data/app/views/spree/admin/page_sections/update.turbo_stream.erb +10 -0
  424. data/app/views/spree/admin/pages/_filters.html.erb +7 -0
  425. data/app/views/spree/admin/pages/_form.html.erb +29 -0
  426. data/app/views/spree/admin/pages/_page.erb +8 -0
  427. data/app/views/spree/admin/pages/edit.html.erb +18 -0
  428. data/app/views/spree/admin/pages/index.html.erb +28 -0
  429. data/app/views/spree/admin/pages/new.html.erb +11 -0
  430. data/app/views/spree/admin/payment_methods/_available_payment_method.html.erb +21 -0
  431. data/app/views/spree/admin/payment_methods/_check.html.erb +0 -0
  432. data/app/views/spree/admin/payment_methods/_form.html.erb +71 -0
  433. data/app/views/spree/admin/payment_methods/_payment_method.html.erb +38 -0
  434. data/app/views/spree/admin/payment_methods/descriptions/_check.html.erb +0 -0
  435. data/app/views/spree/admin/payment_methods/descriptions/_gateway.html.erb +1 -0
  436. data/app/views/spree/admin/payment_methods/descriptions/_store_credit.html.erb +1 -0
  437. data/app/views/spree/admin/payment_methods/edit.html.erb +10 -0
  438. data/app/views/spree/admin/payment_methods/index.html.erb +38 -0
  439. data/app/views/spree/admin/payment_methods/new.html.erb +12 -0
  440. data/app/views/spree/admin/payment_methods/update.turbo_stream.erb +1 -0
  441. data/app/views/spree/admin/payments/_payment.html.erb +89 -0
  442. data/app/views/spree/admin/payments/new.html.erb +64 -0
  443. data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +54 -0
  444. data/app/views/spree/admin/payments/source_forms/_previous_cards.html.erb +21 -0
  445. data/app/views/spree/admin/payments/source_forms/_spree_stripe.html.erb +7 -0
  446. data/app/views/spree/admin/payments/source_forms/_store_credit.html.erb +22 -0
  447. data/app/views/spree/admin/payments/source_views/_check.html.erb +0 -0
  448. data/app/views/spree/admin/payments/source_views/_gateway.html.erb +22 -0
  449. data/app/views/spree/admin/payments/source_views/_storecredit.html.erb +31 -0
  450. data/app/views/spree/admin/post_categories/_form.html.erb +15 -0
  451. data/app/views/spree/admin/post_categories/_post_category.html.erb +6 -0
  452. data/app/views/spree/admin/post_categories/edit.html.erb +15 -0
  453. data/app/views/spree/admin/post_categories/index.html.erb +27 -0
  454. data/app/views/spree/admin/post_categories/new.html.erb +15 -0
  455. data/app/views/spree/admin/posts/_extra_actions.html.erb +0 -0
  456. data/app/views/spree/admin/posts/_filters.html.erb +40 -0
  457. data/app/views/spree/admin/posts/_form.html.erb +81 -0
  458. data/app/views/spree/admin/posts/_post.html.erb +32 -0
  459. data/app/views/spree/admin/posts/edit.html.erb +15 -0
  460. data/app/views/spree/admin/posts/index.html.erb +36 -0
  461. data/app/views/spree/admin/posts/new.html.erb +11 -0
  462. data/app/views/spree/admin/preferences/_password_field.html.erb +26 -0
  463. data/app/views/spree/admin/products/_bulk_operations.html.erb +122 -0
  464. data/app/views/spree/admin/products/_edit_page_title.html.erb +3 -0
  465. data/app/views/spree/admin/products/_empty_list.html.erb +1 -0
  466. data/app/views/spree/admin/products/_filters.html.erb +60 -0
  467. data/app/views/spree/admin/products/_form.html.erb +29 -0
  468. data/app/views/spree/admin/products/_import_button.html.erb +0 -0
  469. data/app/views/spree/admin/products/_index_header.html.erb +7 -0
  470. data/app/views/spree/admin/products/_list.html.erb +50 -0
  471. data/app/views/spree/admin/products/_product.html.erb +30 -0
  472. data/app/views/spree/admin/products/_product_status.html.erb +3 -0
  473. data/app/views/spree/admin/products/_search_result.html.erb +9 -0
  474. data/app/views/spree/admin/products/_search_results.html.erb +9 -0
  475. data/app/views/spree/admin/products/_table_filter_dropdown.html.erb +42 -0
  476. data/app/views/spree/admin/products/bulk_modal.html.erb +23 -0
  477. data/app/views/spree/admin/products/bulk_status_update.turbo_stream.erb +7 -0
  478. data/app/views/spree/admin/products/edit.html.erb +38 -0
  479. data/app/views/spree/admin/products/form/_base.html.erb +16 -0
  480. data/app/views/spree/admin/products/form/_categorization.html.erb +35 -0
  481. data/app/views/spree/admin/products/form/_extra_filters.html.erb +0 -0
  482. data/app/views/spree/admin/products/form/_extra_form.html.erb +0 -0
  483. data/app/views/spree/admin/products/form/_extra_form_sidebar.erb +0 -0
  484. data/app/views/spree/admin/products/form/_inventory.html.erb +63 -0
  485. data/app/views/spree/admin/products/form/_properties.html.erb +46 -0
  486. data/app/views/spree/admin/products/form/_shipping.html.erb +16 -0
  487. data/app/views/spree/admin/products/form/_status.html.erb +52 -0
  488. data/app/views/spree/admin/products/form/_stores.html.erb +27 -0
  489. data/app/views/spree/admin/products/form/_variants.html.erb +171 -0
  490. data/app/views/spree/admin/products/form/variants/_option_template.html.erb +59 -0
  491. data/app/views/spree/admin/products/form/variants/_variant_template.html.erb +44 -0
  492. data/app/views/spree/admin/products/index.html.erb +18 -0
  493. data/app/views/spree/admin/products/new.html.erb +9 -0
  494. data/app/views/spree/admin/profile/edit.html.erb +79 -0
  495. data/app/views/spree/admin/promotion_actions/_promotion_action.html.erb +45 -0
  496. data/app/views/spree/admin/promotion_actions/edit.html.erb +17 -0
  497. data/app/views/spree/admin/promotion_actions/forms/_create_adjustment.html.erb +1 -0
  498. data/app/views/spree/admin/promotion_actions/forms/_create_item_adjustments.html.erb +1 -0
  499. data/app/views/spree/admin/promotion_actions/forms/_create_line_items.html.erb +35 -0
  500. data/app/views/spree/admin/promotion_actions/forms/_create_line_items_row.html.erb +28 -0
  501. data/app/views/spree/admin/promotion_actions/forms/_free_shipping.html.erb +0 -0
  502. data/app/views/spree/admin/promotion_actions/new.html.erb +48 -0
  503. data/app/views/spree/admin/promotion_rules/_promotion_rule.html.erb +53 -0
  504. data/app/views/spree/admin/promotion_rules/edit.html.erb +17 -0
  505. data/app/views/spree/admin/promotion_rules/forms/_country.html.erb +7 -0
  506. data/app/views/spree/admin/promotion_rules/forms/_currency.html.erb +10 -0
  507. data/app/views/spree/admin/promotion_rules/forms/_first_order.html.erb +0 -0
  508. data/app/views/spree/admin/promotion_rules/forms/_item_total.html.erb +26 -0
  509. data/app/views/spree/admin/promotion_rules/forms/_one_use_per_user.html.erb +0 -0
  510. data/app/views/spree/admin/promotion_rules/forms/_option_value.html.erb +9 -0
  511. data/app/views/spree/admin/promotion_rules/forms/_product.html.erb +9 -0
  512. data/app/views/spree/admin/promotion_rules/forms/_taxon.html.erb +9 -0
  513. data/app/views/spree/admin/promotion_rules/forms/_user.html.erb +7 -0
  514. data/app/views/spree/admin/promotion_rules/forms/_user_logged_in.html.erb +0 -0
  515. data/app/views/spree/admin/promotion_rules/new.html.erb +48 -0
  516. data/app/views/spree/admin/promotions/_actions.html.erb +30 -0
  517. data/app/views/spree/admin/promotions/_form.html.erb +47 -0
  518. data/app/views/spree/admin/promotions/_header.html.erb +16 -0
  519. data/app/views/spree/admin/promotions/_promotion.html.erb +34 -0
  520. data/app/views/spree/admin/promotions/_rules.html.erb +44 -0
  521. data/app/views/spree/admin/promotions/_sidebar.html.erb +117 -0
  522. data/app/views/spree/admin/promotions/_status.html.erb +16 -0
  523. data/app/views/spree/admin/promotions/_table_filter_dropdown.html.erb +17 -0
  524. data/app/views/spree/admin/promotions/_usage_limit.html.erb +13 -0
  525. data/app/views/spree/admin/promotions/edit.html.erb +59 -0
  526. data/app/views/spree/admin/promotions/form/_kind.html.erb +57 -0
  527. data/app/views/spree/admin/promotions/form/_settings.html.erb +24 -0
  528. data/app/views/spree/admin/promotions/index.html.erb +62 -0
  529. data/app/views/spree/admin/promotions/new.html.erb +11 -0
  530. data/app/views/spree/admin/promotions/show.html.erb +12 -0
  531. data/app/views/spree/admin/properties/_form.html.erb +22 -0
  532. data/app/views/spree/admin/properties/_property.html.erb +25 -0
  533. data/app/views/spree/admin/properties/edit.html.erb +15 -0
  534. data/app/views/spree/admin/properties/index.html.erb +53 -0
  535. data/app/views/spree/admin/properties/new.html.erb +14 -0
  536. data/app/views/spree/admin/properties/update.turbo_stream.erb +1 -0
  537. data/app/views/spree/admin/refund_reasons/edit.html.erb +3 -0
  538. data/app/views/spree/admin/refund_reasons/index.html.erb +40 -0
  539. data/app/views/spree/admin/refund_reasons/new.html.erb +4 -0
  540. data/app/views/spree/admin/refunds/_form.html.erb +17 -0
  541. data/app/views/spree/admin/refunds/edit.html.erb +20 -0
  542. data/app/views/spree/admin/refunds/new.html.erb +29 -0
  543. data/app/views/spree/admin/reimbursement_types/_form.html.erb +30 -0
  544. data/app/views/spree/admin/reimbursement_types/edit.html.erb +15 -0
  545. data/app/views/spree/admin/reimbursement_types/index.html.erb +44 -0
  546. data/app/views/spree/admin/reimbursement_types/new.html.erb +16 -0
  547. data/app/views/spree/admin/reimbursements/edit.html.erb +130 -0
  548. data/app/views/spree/admin/reimbursements/show.html.erb +113 -0
  549. data/app/views/spree/admin/reports/_report.html.erb +22 -0
  550. data/app/views/spree/admin/reports/create.turbo_stream.erb +1 -0
  551. data/app/views/spree/admin/reports/index.html.erb +28 -0
  552. data/app/views/spree/admin/reports/new.html.erb +39 -0
  553. data/app/views/spree/admin/return_authorization_reasons/edit.html.erb +3 -0
  554. data/app/views/spree/admin/return_authorization_reasons/index.html.erb +45 -0
  555. data/app/views/spree/admin/return_authorization_reasons/new.html.erb +4 -0
  556. data/app/views/spree/admin/return_authorizations/_filters.html.erb +39 -0
  557. data/app/views/spree/admin/return_authorizations/_list.html.erb +30 -0
  558. data/app/views/spree/admin/return_authorizations/_return_authorization.html.erb +40 -0
  559. data/app/views/spree/admin/return_authorizations/index.html.erb +14 -0
  560. data/app/views/spree/admin/roles/_form.html.erb +6 -0
  561. data/app/views/spree/admin/roles/edit.html.erb +13 -0
  562. data/app/views/spree/admin/roles/index.html.erb +32 -0
  563. data/app/views/spree/admin/roles/new.html.erb +15 -0
  564. data/app/views/spree/admin/shared/_address.html.erb +42 -0
  565. data/app/views/spree/admin/shared/_alerts.html.erb +22 -0
  566. data/app/views/spree/admin/shared/_analytics_loader_skeleton.html.erb +76 -0
  567. data/app/views/spree/admin/shared/_audit_nav.html.erb +3 -0
  568. data/app/views/spree/admin/shared/_bulk_modal.html.erb +21 -0
  569. data/app/views/spree/admin/shared/_calculator_fields.html.erb +34 -0
  570. data/app/views/spree/admin/shared/_calendar_range_picker.html.erb +28 -0
  571. data/app/views/spree/admin/shared/_close_bulk_modal.turbo_stream.erb +2 -0
  572. data/app/views/spree/admin/shared/_content_header.html.erb +81 -0
  573. data/app/views/spree/admin/shared/_custom_head.html.erb +0 -0
  574. data/app/views/spree/admin/shared/_developers_nav.html.erb +7 -0
  575. data/app/views/spree/admin/shared/_edit_resource_links.html.erb +6 -0
  576. data/app/views/spree/admin/shared/_error_messages.html.erb +22 -0
  577. data/app/views/spree/admin/shared/_filter_badge_template.erb +3 -0
  578. data/app/views/spree/admin/shared/_filters_button.html.erb +8 -0
  579. data/app/views/spree/admin/shared/_filters_search_bar.html.erb +15 -0
  580. data/app/views/spree/admin/shared/_footer.html.erb +2 -0
  581. data/app/views/spree/admin/shared/_growth_rate_badge.html.erb +17 -0
  582. data/app/views/spree/admin/shared/_head.html.erb +52 -0
  583. data/app/views/spree/admin/shared/_header.html.erb +28 -0
  584. data/app/views/spree/admin/shared/_index_table_options.html.erb +22 -0
  585. data/app/views/spree/admin/shared/_map.html.erb +9 -0
  586. data/app/views/spree/admin/shared/_modal.html.erb +37 -0
  587. data/app/views/spree/admin/shared/_multi_product_picker.html.erb +26 -0
  588. data/app/views/spree/admin/shared/_new_resource_links.html.erb +3 -0
  589. data/app/views/spree/admin/shared/_no_image.html.erb +6 -0
  590. data/app/views/spree/admin/shared/_no_resource_found.html.erb +6 -0
  591. data/app/views/spree/admin/shared/_offcanvas_nav.html.erb +25 -0
  592. data/app/views/spree/admin/shared/_page_section_image.html.erb +1 -0
  593. data/app/views/spree/admin/shared/_page_section_logo.html.erb +1 -0
  594. data/app/views/spree/admin/shared/_posts_tabs.html.erb +8 -0
  595. data/app/views/spree/admin/shared/_preferences.html.erb +9 -0
  596. data/app/views/spree/admin/shared/_product_image.html.erb +21 -0
  597. data/app/views/spree/admin/shared/_refunds.html.erb +30 -0
  598. data/app/views/spree/admin/shared/_returns_and_refunds_nav.html.erb +9 -0
  599. data/app/views/spree/admin/shared/_seo.html.erb +39 -0
  600. data/app/views/spree/admin/shared/_shipping_nav.html.erb +4 -0
  601. data/app/views/spree/admin/shared/_sidebar.html.erb +15 -0
  602. data/app/views/spree/admin/shared/_spinner.html.erb +7 -0
  603. data/app/views/spree/admin/shared/_stock_nav.html.erb +4 -0
  604. data/app/views/spree/admin/shared/_tax_nav.html.erb +4 -0
  605. data/app/views/spree/admin/shared/_user.html.erb +24 -0
  606. data/app/views/spree/admin/shared/_user_dropdown.html.erb +41 -0
  607. data/app/views/spree/admin/shared/named_types/_edit.html.erb +15 -0
  608. data/app/views/spree/admin/shared/named_types/_form.html.erb +15 -0
  609. data/app/views/spree/admin/shared/named_types/_new.html.erb +15 -0
  610. data/app/views/spree/admin/shared/sidebar/_custom_nav.html.erb +0 -0
  611. data/app/views/spree/admin/shared/sidebar/_enterprise_edition_notice.html.erb +10 -0
  612. data/app/views/spree/admin/shared/sidebar/_integrations_nav.html.erb +7 -0
  613. data/app/views/spree/admin/shared/sidebar/_orders_nav.html.erb +35 -0
  614. data/app/views/spree/admin/shared/sidebar/_products_nav.html.erb +41 -0
  615. data/app/views/spree/admin/shared/sidebar/_returns_nav.html.erb +20 -0
  616. data/app/views/spree/admin/shared/sidebar/_store_dropdown.html.erb +67 -0
  617. data/app/views/spree/admin/shared/sidebar/_store_nav.html.erb +176 -0
  618. data/app/views/spree/admin/shared/sidebar/_storefront_nav.html.erb +29 -0
  619. data/app/views/spree/admin/shared/sidebar/_vendors_nav.html.erb +8 -0
  620. data/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb +66 -0
  621. data/app/views/spree/admin/shipments/edit.html.erb +28 -0
  622. data/app/views/spree/admin/shipments/split.html.erb +16 -0
  623. data/app/views/spree/admin/shipping_categories/_form.html.erb +9 -0
  624. data/app/views/spree/admin/shipping_categories/edit.html.erb +11 -0
  625. data/app/views/spree/admin/shipping_categories/index.html.erb +36 -0
  626. data/app/views/spree/admin/shipping_categories/new.html.erb +13 -0
  627. data/app/views/spree/admin/shipping_methods/_actions.html.erb +5 -0
  628. data/app/views/spree/admin/shipping_methods/_form.html.erb +141 -0
  629. data/app/views/spree/admin/shipping_methods/_shipping_method.html.erb +33 -0
  630. data/app/views/spree/admin/shipping_methods/edit.html.erb +12 -0
  631. data/app/views/spree/admin/shipping_methods/index.html.erb +34 -0
  632. data/app/views/spree/admin/shipping_methods/new.html.erb +13 -0
  633. data/app/views/spree/admin/shipping_methods/update.turbo_stream.erb +1 -0
  634. data/app/views/spree/admin/stock_items/_filters.html.erb +39 -0
  635. data/app/views/spree/admin/stock_items/_stock_item.html.erb +43 -0
  636. data/app/views/spree/admin/stock_items/index.html.erb +38 -0
  637. data/app/views/spree/admin/stock_items/update.turbo_stream.erb +1 -0
  638. data/app/views/spree/admin/stock_locations/_form.html.erb +56 -0
  639. data/app/views/spree/admin/stock_locations/_stock_location.html.erb +30 -0
  640. data/app/views/spree/admin/stock_locations/edit.html.erb +9 -0
  641. data/app/views/spree/admin/stock_locations/index.html.erb +26 -0
  642. data/app/views/spree/admin/stock_locations/new.html.erb +11 -0
  643. data/app/views/spree/admin/stock_transfers/_destination_movement_form.html.erb +36 -0
  644. data/app/views/spree/admin/stock_transfers/_filters.html.erb +46 -0
  645. data/app/views/spree/admin/stock_transfers/_new_variant_modal.html.erb +30 -0
  646. data/app/views/spree/admin/stock_transfers/_new_variant_template.html.erb +8 -0
  647. data/app/views/spree/admin/stock_transfers/_source_movement_form.html.erb +8 -0
  648. data/app/views/spree/admin/stock_transfers/_stock_movement.html.erb +5 -0
  649. data/app/views/spree/admin/stock_transfers/_stock_transfer.html.erb +11 -0
  650. data/app/views/spree/admin/stock_transfers/index.html.erb +38 -0
  651. data/app/views/spree/admin/stock_transfers/new.html.erb +85 -0
  652. data/app/views/spree/admin/stock_transfers/show.html.erb +58 -0
  653. data/app/views/spree/admin/store_credit_categories/_form.html.erb +5 -0
  654. data/app/views/spree/admin/store_credit_categories/edit.html.erb +13 -0
  655. data/app/views/spree/admin/store_credit_categories/index.html.erb +32 -0
  656. data/app/views/spree/admin/store_credit_categories/new.html.erb +15 -0
  657. data/app/views/spree/admin/store_credits/_form.html.erb +24 -0
  658. data/app/views/spree/admin/store_credits/_list.html.erb +41 -0
  659. data/app/views/spree/admin/store_credits/edit.html.erb +36 -0
  660. data/app/views/spree/admin/store_credits/index.html.erb +20 -0
  661. data/app/views/spree/admin/store_credits/new.html.erb +26 -0
  662. data/app/views/spree/admin/storefront/edit.html.erb +146 -0
  663. data/app/views/spree/admin/stores/create.turbo_stream.erb +5 -0
  664. data/app/views/spree/admin/stores/edit.html.erb +13 -0
  665. data/app/views/spree/admin/stores/edit_emails.html.erb +11 -0
  666. data/app/views/spree/admin/stores/form/_basic.html.erb +160 -0
  667. data/app/views/spree/admin/stores/form/_buttons.html.erb +3 -0
  668. data/app/views/spree/admin/stores/form/_checkout.html.erb +50 -0
  669. data/app/views/spree/admin/stores/form/_custom.html.erb +0 -0
  670. data/app/views/spree/admin/stores/form/_emails.html.erb +59 -0
  671. data/app/views/spree/admin/stores/form/_policies.html.erb +85 -0
  672. data/app/views/spree/admin/stores/new.html.erb +135 -0
  673. data/app/views/spree/admin/stores/new.turbo_stream.erb +1 -0
  674. data/app/views/spree/admin/stores/update.turbo_stream.erb +11 -0
  675. data/app/views/spree/admin/tax_categories/_form.html.erb +25 -0
  676. data/app/views/spree/admin/tax_categories/_tax_category.html.erb +13 -0
  677. data/app/views/spree/admin/tax_categories/edit.html.erb +11 -0
  678. data/app/views/spree/admin/tax_categories/index.html.erb +30 -0
  679. data/app/views/spree/admin/tax_categories/new.html.erb +11 -0
  680. data/app/views/spree/admin/tax_rates/_form.html.erb +48 -0
  681. data/app/views/spree/admin/tax_rates/_tax_rate.html.erb +15 -0
  682. data/app/views/spree/admin/tax_rates/edit.html.erb +11 -0
  683. data/app/views/spree/admin/tax_rates/index.html.erb +32 -0
  684. data/app/views/spree/admin/tax_rates/new.html.erb +14 -0
  685. data/app/views/spree/admin/taxonomies/_taxonomy.html.erb +16 -0
  686. data/app/views/spree/admin/taxonomies/edit.html.erb +28 -0
  687. data/app/views/spree/admin/taxonomies/index.html.erb +40 -0
  688. data/app/views/spree/admin/taxonomies/new.html.erb +23 -0
  689. data/app/views/spree/admin/taxonomies/show.html.erb +28 -0
  690. data/app/views/spree/admin/taxons/_form.html.erb +148 -0
  691. data/app/views/spree/admin/taxons/_rule_form.html.erb +24 -0
  692. data/app/views/spree/admin/taxons/_rules_form.html.erb +34 -0
  693. data/app/views/spree/admin/taxons/destroy.turbo_stream.erb +1 -0
  694. data/app/views/spree/admin/taxons/edit.html.erb +19 -0
  695. data/app/views/spree/admin/taxons/new.html.erb +12 -0
  696. data/app/views/spree/admin/taxons/rule_forms/_available_on.html.erb +4 -0
  697. data/app/views/spree/admin/taxons/rule_forms/_sale.html.erb +4 -0
  698. data/app/views/spree/admin/taxons/rule_forms/_tag.html.erb +1 -0
  699. data/app/views/spree/admin/themes/_theme.html.erb +53 -0
  700. data/app/views/spree/admin/themes/_theme_preview_image.html.erb +24 -0
  701. data/app/views/spree/admin/themes/edit.html.erb +14 -0
  702. data/app/views/spree/admin/themes/index.html.erb +79 -0
  703. data/app/views/spree/admin/themes/update.turbo_stream.erb +1 -0
  704. data/app/views/spree/admin/translations/_translations_unavailable.html.erb +10 -0
  705. data/app/views/spree/admin/translations/edit.html.erb +47 -0
  706. data/app/views/spree/admin/translations/products/_form.html.erb +23 -0
  707. data/app/views/spree/admin/translations/stores/_form.html.erb +23 -0
  708. data/app/views/spree/admin/translations/taxonomies/_form.html.erb +20 -0
  709. data/app/views/spree/admin/translations/taxons/_form.html.erb +37 -0
  710. data/app/views/spree/admin/users/_billing.html.erb +78 -0
  711. data/app/views/spree/admin/users/_details.html.erb +52 -0
  712. data/app/views/spree/admin/users/_extra_actions.html.erb +0 -0
  713. data/app/views/spree/admin/users/_filters.html.erb +85 -0
  714. data/app/views/spree/admin/users/_form.html.erb +36 -0
  715. data/app/views/spree/admin/users/_last_order.html.erb +33 -0
  716. data/app/views/spree/admin/users/_last_order_line_item.html.erb +19 -0
  717. data/app/views/spree/admin/users/_lifetime_stats.html.erb +65 -0
  718. data/app/views/spree/admin/users/_shipping.html.erb +33 -0
  719. data/app/views/spree/admin/users/_tabs.html.erb +74 -0
  720. data/app/views/spree/admin/users/_user.html.erb +20 -0
  721. data/app/views/spree/admin/users/bulk_modal.html.erb +21 -0
  722. data/app/views/spree/admin/users/edit.html.erb +17 -0
  723. data/app/views/spree/admin/users/index.csv.erb +43 -0
  724. data/app/views/spree/admin/users/index.html.erb +102 -0
  725. data/app/views/spree/admin/users/new.html.erb +14 -0
  726. data/app/views/spree/admin/users/show.html.erb +38 -0
  727. data/app/views/spree/admin/variants/_search_result.html.erb +28 -0
  728. data/app/views/spree/admin/variants/_search_results.html.erb +9 -0
  729. data/app/views/spree/admin/variants/_variant.html.erb +13 -0
  730. data/app/views/spree/admin/variants/edit.html.erb +20 -0
  731. data/app/views/spree/admin/variants/form/_basic.html.erb +31 -0
  732. data/app/views/spree/admin/variants/form/_dimensions.html.erb +33 -0
  733. data/app/views/spree/admin/variants/form/_inventory.html.erb +45 -0
  734. data/app/views/spree/admin/variants/form/_media.html.erb +32 -0
  735. data/app/views/spree/admin/variants/form/_media_asset.html.erb +21 -0
  736. data/app/views/spree/admin/variants/form/_pricing.html.erb +48 -0
  737. data/app/views/spree/admin/webhook_events/_webhook_event.html.erb +17 -0
  738. data/app/views/spree/admin/webhooks_subscribers/_form.html.erb +66 -0
  739. data/app/views/spree/admin/webhooks_subscribers/_webhooks_subscriber.html.erb +16 -0
  740. data/app/views/spree/admin/webhooks_subscribers/edit.html.erb +9 -0
  741. data/app/views/spree/admin/webhooks_subscribers/index.html.erb +26 -0
  742. data/app/views/spree/admin/webhooks_subscribers/new.html.erb +11 -0
  743. data/app/views/spree/admin/webhooks_subscribers/show.html.erb +54 -0
  744. data/app/views/spree/admin/zones/_country_members.html.erb +16 -0
  745. data/app/views/spree/admin/zones/_form.html.erb +52 -0
  746. data/app/views/spree/admin/zones/_state_members.html.erb +21 -0
  747. data/app/views/spree/admin/zones/edit.html.erb +12 -0
  748. data/app/views/spree/admin/zones/index.html.erb +45 -0
  749. data/app/views/spree/admin/zones/new.html.erb +11 -0
  750. data/config/i18n-tasks.yml +190 -0
  751. data/config/importmap.rb +149 -0
  752. data/config/initializers/action_text.rb +8 -0
  753. data/config/initializers/assets.rb +1 -0
  754. data/config/initializers/chartkick.rb +5 -0
  755. data/config/initializers/dartsass.rb +3 -0
  756. data/config/initializers/form_builder.rb +10 -0
  757. data/config/initializers/ransack.rb +19 -0
  758. data/config/locales/en.yml +304 -0
  759. data/config/routes.rb +240 -0
  760. data/lib/generators/spree/admin/install/install_generator.rb +42 -0
  761. data/lib/generators/spree/admin/install/templates/dev +16 -0
  762. data/lib/spree/admin/action_callbacks.rb +27 -0
  763. data/lib/spree/admin/callbacks.rb +51 -0
  764. data/lib/spree/admin/engine.rb +51 -0
  765. data/lib/spree/admin/runtime_configuration.rb +12 -0
  766. data/lib/spree/admin/testing_support/capybara_utils.rb +45 -0
  767. data/lib/spree/admin.rb +23 -0
  768. data/lib/spree_admin.rb +18 -0
  769. data/vendor/javascript/@easepick--base-plugin.js +4 -0
  770. data/vendor/javascript/@easepick--core.js +4 -0
  771. data/vendor/javascript/@easepick--datetime.js +4 -0
  772. data/vendor/javascript/@easepick--preset-plugin.js +4 -0
  773. data/vendor/javascript/@easepick--range-plugin.js +4 -0
  774. data/vendor/javascript/@orchidjs--sifter.js +17 -0
  775. data/vendor/javascript/@orchidjs--unicode-variants.js +11 -0
  776. data/vendor/javascript/@rails--actiontext@7.2.201.js +4 -0
  777. data/vendor/javascript/@simonwep--pickr.js +4 -0
  778. data/vendor/javascript/@stimulus-components--rails-nested-form.js +4 -0
  779. data/vendor/javascript/bootstrap--dist--js--bootstrap.bundle.min.js.js +8 -0
  780. data/vendor/javascript/dompurify.js +139 -0
  781. data/vendor/javascript/hotkeys-js.js +4 -0
  782. data/vendor/javascript/jquery.min.js +2 -0
  783. data/vendor/javascript/local-time.js +4 -0
  784. data/vendor/javascript/sortablejs.js +136 -0
  785. data/vendor/javascript/stimulus-checkbox-select-all.js +4 -0
  786. data/vendor/javascript/stimulus-clipboard.js +4 -0
  787. data/vendor/javascript/stimulus-notification.js +4 -0
  788. data/vendor/javascript/stimulus-password-visibility.js +4 -0
  789. data/vendor/javascript/stimulus-reveal-controller.js +4 -0
  790. data/vendor/javascript/stimulus-sortable.js +4 -0
  791. data/vendor/javascript/stimulus-textarea-autogrow.js +4 -0
  792. data/vendor/javascript/stimulus-use.js +4 -0
  793. data/vendor/javascript/tom-select--dist--esm--tom-select.complete.js.js +32 -0
  794. data/vendor/javascript/trix@2.1.12.js +5 -0
  795. metadata +1084 -0
@@ -0,0 +1,168 @@
1
+ import { Controller } from '@hotwired/stimulus'
2
+
3
+ import Uppy from '@uppy/core'
4
+ import Dashboard from '@uppy/dashboard'
5
+ import ImageEditor from '@uppy/image-editor'
6
+ import ActiveStorageUpload from 'spree/admin/helpers/uppy_active_storage'
7
+
8
+ export default class extends Controller {
9
+ static targets = ['thumb', 'toolbar', 'remove', 'placeholder']
10
+
11
+ static values = {
12
+ fieldName: String,
13
+ thumbWidth: Number,
14
+ thumbHeight: Number,
15
+ autoSubmit: Boolean,
16
+ multiple: { type: Boolean, default: false },
17
+ crop: { type: Boolean, default: false },
18
+ allowedFileTypes: { type: Array, default: [] }
19
+ }
20
+
21
+ connect() {
22
+ this.uppy = new Uppy({
23
+ autoProceed: true,
24
+ allowMultipleUploads: false,
25
+ restrictions: {
26
+ allowedFileTypes: this.allowedFileTypesValue.length ? this.allowedFileTypesValue : undefined
27
+ },
28
+ debug: true
29
+ })
30
+
31
+ this.uppy.use(ActiveStorageUpload, {
32
+ directUploadUrl: document.querySelector("meta[name='direct-upload-url']").getAttribute('content')
33
+ })
34
+
35
+ let dashboardOptions = {}
36
+ if (this.cropValue == true) {
37
+ dashboardOptions = {
38
+ autoOpen: 'imageEditor'
39
+ }
40
+ } else {
41
+ dashboardOptions = {
42
+ closeAfterFinish: true
43
+ }
44
+ }
45
+
46
+ this.uppy.use(Dashboard, dashboardOptions)
47
+
48
+ if (this.cropValue == true) {
49
+ this.uppy.use(ImageEditor, {
50
+ cropperOptions: {
51
+ aspectRatio: this.thumbWidthValue / this.thumbHeightValue
52
+ }
53
+ })
54
+ }
55
+
56
+ this.uppy.on('file-editor:complete', (updatedFile) => {
57
+ console.log('File editing complete:', updatedFile)
58
+ // Remove the old file from Uppy's file list
59
+ this.uppy.removeFile(updatedFile.id)
60
+ // Add the updated file to Uppy
61
+ this.uppy.addFile({
62
+ name: updatedFile.name,
63
+ type: updatedFile.type,
64
+ data: updatedFile.data,
65
+ source: 'local',
66
+ isRemote: false
67
+ })
68
+
69
+ this.handleUI(updatedFile)
70
+
71
+ this.uppy.getPlugin('Dashboard').closeModal()
72
+ })
73
+
74
+ this.uppy.on('upload-success', (file, response) => {
75
+ this.handleUI(file, response)
76
+ })
77
+
78
+ this.uppy.on('dashboard:modal-closed', () => {
79
+ this.uppy.clear()
80
+ })
81
+ }
82
+
83
+ open(event) {
84
+ event.preventDefault()
85
+ this.uppy.getPlugin('Dashboard').openModal()
86
+ }
87
+
88
+ remove(event) {
89
+ event.preventDefault()
90
+
91
+ if (window.confirm('Are you sure?')) {
92
+ if (this.hasThumbTarget) {
93
+ // handle thumb preview
94
+ this.thumbTarget.style = 'display: none !important'
95
+ this.thumbTarget.dataset.imageSignedId = null
96
+ this.thumbTarget.src = ''
97
+ }
98
+
99
+ // hide toolbar if attached
100
+ if (this.hasToolbarTarget) {
101
+ this.toolbarTarget.style = 'display: none !important'
102
+ }
103
+
104
+ // mark for removal (on the backend)
105
+ if (this.hasRemoveTarget) {
106
+ this.removeTarget.value = '1'
107
+ }
108
+
109
+ if (this.hasPlaceholderTarget) {
110
+ this.placeholderTarget.style.display = null
111
+ }
112
+
113
+ if (this.autoSubmitValue == true) {
114
+ this.element.closest('form').requestSubmit()
115
+ }
116
+
117
+ this.uppy.clear()
118
+ }
119
+ }
120
+
121
+ handleUI(file, response = null) {
122
+ this.placeholderTarget.style = 'display: none !important'
123
+
124
+ const signedId = response?.signed_id || file.response?.signed_id
125
+
126
+ if (signedId?.length) {
127
+ if (this.hasThumbTarget) {
128
+ this.thumbTarget.src = URL.createObjectURL(file.data)
129
+ this.thumbTarget.style.display = null
130
+ this.thumbTarget.dataset.imageSignedId = signedId
131
+ this.thumbTarget.width = this.thumbWidthValue
132
+ this.thumbTarget.height = this.thumbHeightValue
133
+ }
134
+
135
+ // Remove existing hidden field for this file, if any
136
+ const existingField = this.element.querySelector(`input[name="${this.fieldNameValue}"]`)
137
+ if (existingField) {
138
+ existingField.remove()
139
+ }
140
+
141
+ const hiddenField = document.createElement('input')
142
+
143
+ hiddenField.setAttribute('type', 'hidden')
144
+ hiddenField.setAttribute('value', signedId)
145
+
146
+ if (this.multipleValue) {
147
+ hiddenField.setAttribute('name', `${this.fieldNameValue}[]`)
148
+ } else {
149
+ hiddenField.setAttribute('name', this.fieldNameValue)
150
+ }
151
+
152
+ this.element.appendChild(hiddenField)
153
+ }
154
+
155
+ // show toolbar if attached
156
+ if (this.hasToolbarTarget) {
157
+ this.toolbarTarget.style.display = null
158
+ }
159
+
160
+ if (this.hasRemoveTarget) {
161
+ this.removeTarget.value = null
162
+ }
163
+
164
+ if (this.autoSubmitValue == true) {
165
+ this.element.closest('form').requestSubmit()
166
+ }
167
+ }
168
+ }
@@ -0,0 +1,98 @@
1
+ import { Controller } from '@hotwired/stimulus'
2
+
3
+ export default class extends Controller {
4
+ static targets = [
5
+ 'country',
6
+ 'state',
7
+ 'stateName',
8
+ 'stateLabel',
9
+ 'stateArrow',
10
+ 'zipcode'
11
+ ]
12
+
13
+ static values = {
14
+ countries: Array,
15
+ states: Array,
16
+ currentStateId: String
17
+ }
18
+
19
+ constructor(...args) {
20
+ super(...args)
21
+ this.changeCountry()
22
+ }
23
+
24
+ get country() {
25
+ return this.countriesValue.find(
26
+ (country) => country.id == this.countryTarget.value
27
+ )
28
+ }
29
+
30
+ get state() {
31
+ return this.statesValue.find((state) => state[1] == this.stateTarget.value)
32
+ }
33
+
34
+ get states() {
35
+ return this.statesValue.filter(
36
+ (state) => state[0] == this.countryTarget.value
37
+ )
38
+ }
39
+
40
+ changeCountry(_event) {
41
+ var form = document.querySelector('.address-form')
42
+ this.stateTarget.required = this.country.states_required
43
+ this.stateTarget.value = ''
44
+ this.stateTarget.innerHTML = ''
45
+
46
+ var allStates = this.stateTarget.parentNode.parentNode
47
+ var stateName = this.stateNameTarget
48
+ var stateSelector = this.stateTarget
49
+
50
+ if (this.country.states_required) {
51
+ this.stateLabelTarget.parentNode.parentNode.classList.remove('hidden')
52
+ form.classList.toggle('cols-2', false)
53
+
54
+ allStates.classList.remove('hidden')
55
+ allStates.classList.add('flex')
56
+ if (this.states.length > 0) {
57
+ stateSelector.classList.remove('hidden')
58
+ stateName.classList.add('hidden')
59
+
60
+ this.states.map((state) => {
61
+ const option = document.createElement('option')
62
+ option.value = state[1]
63
+ option.dataset.abbr = state[2]
64
+ option.text = state[3]
65
+
66
+ if (option.value == this.currentStateIdValue) {
67
+ option.selected = true
68
+ }
69
+
70
+ this.stateTarget.add(option)
71
+ })
72
+ } else {
73
+ stateName.classList.remove('hidden')
74
+ stateSelector.classList.add('hidden')
75
+ }
76
+ } else {
77
+ form.classList.toggle('cols-2', true)
78
+ allStates.classList.add('hidden')
79
+ allStates.classList.remove('flex')
80
+ }
81
+
82
+ this.zipcodeTarget.required = this.country.zipcode_required
83
+ if (this.country.zipcode_required) {
84
+ form.classList.toggle('col-1', false)
85
+ this.zipcodeTarget.parentNode.classList.remove('hidden')
86
+ } else {
87
+ if (!this.country.states_required) {
88
+ form.classList.toggle('col-1', true)
89
+ form.classList.toggle('cols-2', false)
90
+ } else {
91
+ form.classList.toggle('col-1', false)
92
+ form.classList.toggle('cols-2', true)
93
+ }
94
+ this.zipcodeTarget.parentNode.classList.add('hidden')
95
+ this.zipcodeTarget.value = null
96
+ }
97
+ }
98
+ }
@@ -0,0 +1,58 @@
1
+ import { Controller } from '@hotwired/stimulus'
2
+ import { post } from '@rails/request.js'
3
+ import Uppy from '@uppy/core'
4
+ import Dashboard from '@uppy/dashboard'
5
+ import ActiveStorageUpload from 'spree/admin/helpers/uppy_active_storage'
6
+
7
+ export default class extends Controller {
8
+ static values = {
9
+ assetClass: { type: String, default: 'Spree::Image' },
10
+ viewableId: String,
11
+ viewableType: String,
12
+ multiple: { type: Boolean, default: false },
13
+ type: { type: String, default: 'image' },
14
+ allowedFileTypes: { type: Array, default: [] }
15
+ }
16
+
17
+ connect() {
18
+ this.uppy = new Uppy({
19
+ autoProceed: true,
20
+ allowMultipleUploads: this.multipleValue,
21
+ debug: true,
22
+ restrictions: {
23
+ allowedFileTypes: this.allowedFileTypesValue.length ? this.allowedFileTypesValue : undefined
24
+ }
25
+ })
26
+
27
+ this.uppy.use(ActiveStorageUpload, {
28
+ directUploadUrl: document.querySelector("meta[name='direct-upload-url']").getAttribute('content')
29
+ })
30
+
31
+ this.uppy.use(Dashboard, {
32
+ closeAfterFinish: true
33
+ })
34
+
35
+ this.uppy.on('upload-success', (file, response) => {
36
+ this.handleSuccessResult(response)
37
+ })
38
+ }
39
+
40
+ open(event) {
41
+ event.preventDefault()
42
+ this.uppy.getPlugin('Dashboard').openModal()
43
+ }
44
+
45
+ handleSuccessResult(response) {
46
+ post('/admin/assets', {
47
+ body: JSON.stringify({
48
+ asset: {
49
+ type: this.assetClassValue,
50
+ viewable_type: this.viewableTypeValue,
51
+ viewable_id: this.viewableIdValue,
52
+ attachment: response.signed_id
53
+ }
54
+ }),
55
+ responseKind: 'turbo-stream'
56
+ })
57
+ }
58
+ }
@@ -0,0 +1,36 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+ import TomSelect from 'tom-select/dist/esm/tom-select.complete.js';
3
+
4
+ // this is a very simple autocomplete select controller that uses TomSelect
5
+ // by default it does not support remote data fetching or adding new options
6
+ // that scenarios are handled in the more robust select_controller.js
7
+ export default class extends Controller {
8
+ connect() {
9
+ let selectedValue = this.element.value
10
+
11
+ let plugins = []
12
+
13
+ if (this.element.multiple) {
14
+ plugins = ['remove_button']
15
+ }
16
+
17
+ this.select = new TomSelect(this.element ,{
18
+ create: false,
19
+ maxOptions: this.element.children.length,
20
+ selectOnTab: true,
21
+ allowEmptyOption: false,
22
+ plugins: plugins
23
+ })
24
+ if (!this.element.multiple) {
25
+ this.select.on('type', () => {
26
+ this.select.clear()
27
+ })
28
+ this.select.on('change', (value) => {
29
+ if (value) selectedValue = value
30
+ })
31
+ this.select.on('blur', () => {
32
+ this.select.setValue(selectedValue)
33
+ })
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,23 @@
1
+ import { Controller } from '@hotwired/stimulus'
2
+
3
+ export default class extends Controller {
4
+ static targets = ['currentValueLabel', 'rangeInput']
5
+ static values = { labelForMin: String, unit: String }
6
+
7
+ connect() {
8
+ this.rangeInputTarget.addEventListener('input', this.updateCurrentValueLabel.bind(this))
9
+ this.updateCurrentValueLabel()
10
+ }
11
+
12
+ updateCurrentValueLabel() {
13
+ if (this.rangeInputTarget.value === this.rangeInputTarget.min && this.labelForMinValue.length) {
14
+ this.currentValueLabelTarget.innerText = this.labelForMinValue
15
+ } else {
16
+ this.currentValueLabelTarget.innerText = this.rangeInputTarget.value + this.unitValue
17
+ }
18
+ }
19
+
20
+ disconnect() {
21
+ this.rangeInputTarget.removeEventListener('input', this.updateCurrentValueLabel.bind(this))
22
+ }
23
+ }
@@ -0,0 +1,11 @@
1
+ import { Controller } from '@hotwired/stimulus'
2
+
3
+ export default class extends Controller {
4
+ static targets = ['form', 'type']
5
+
6
+ addBlock(event) {
7
+ event.preventDefault()
8
+ this.typeTarget.value = event.params.type
9
+ this.formTarget.requestSubmit()
10
+ }
11
+ }
@@ -0,0 +1,9 @@
1
+ import { Controller } from '@hotwired/stimulus'
2
+
3
+ export default class extends Controller {
4
+ static targets = ['input']
5
+
6
+ change({ params: { tab } }) {
7
+ this.inputTarget.value = tab
8
+ }
9
+ }
@@ -0,0 +1,78 @@
1
+ import CheckboxSelectAll from 'stimulus-checkbox-select-all'
2
+
3
+ export default class extends CheckboxSelectAll {
4
+ static targets = ['panel', 'form', 'counter']
5
+
6
+ connect() {
7
+ super.connect()
8
+ this.togglePanel()
9
+ this.toggleRowBackground()
10
+ }
11
+
12
+ toggle(e) {
13
+ super.toggle(e)
14
+ this.togglePanel()
15
+ this.toggleRowBackground()
16
+ }
17
+
18
+ refresh() {
19
+ super.refresh()
20
+ this.togglePanel()
21
+ this.toggleRowBackground()
22
+ }
23
+
24
+ cancel(e) {
25
+ e.preventDefault()
26
+ this.checkboxTargets.forEach((checkbox) => {
27
+ checkbox.checked = false
28
+ })
29
+ this.checkboxAllTargets.forEach((checkbox) => {
30
+ checkbox.checked = false
31
+ })
32
+ this.hidePanel()
33
+ this.removeRowBackground()
34
+ }
35
+
36
+ hidePanel() {
37
+ this.panelTarget.classList.add('animate__fadeOutDown')
38
+ this.panelTarget.classList.add('d-none')
39
+ }
40
+
41
+ togglePanel() {
42
+ if (this.checked.length > 0) {
43
+ this.panelTarget.classList.remove('animate__fadeOutDown')
44
+ this.panelTarget.classList.remove('d-none')
45
+ if (this.counterTarget) {
46
+ this.counterTarget.textContent = this.checked.length
47
+ }
48
+ } else {
49
+ this.hidePanel()
50
+ }
51
+ }
52
+
53
+ removeRowBackground() {
54
+ this.element.querySelectorAll('tr').forEach((row) => {
55
+ row.classList.remove('active')
56
+ })
57
+ }
58
+
59
+ toggleRowBackground() {
60
+ this.element.querySelectorAll('tr').forEach((row) => {
61
+ row.classList.remove('active')
62
+ })
63
+ this.element.querySelectorAll('.row.active').forEach((row) => {
64
+ row.classList.remove('active')
65
+ })
66
+ this.checked.forEach((checkbox) => {
67
+ if (checkbox.closest('tr')) checkbox.closest('tr').classList.add('active')
68
+ else if (checkbox.closest('.row')) checkbox.closest('.row').classList.add('active')
69
+ })
70
+ }
71
+
72
+ setBulkAction(e) {
73
+ this.formTarget.action = e.target.dataset.url
74
+ if (e.target.dataset.method) {
75
+ this.formTarget.method = e.target.dataset.method
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,24 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ static targets = ["container"]
5
+
6
+ replaceFields(event) {
7
+ const selectedCalculator = event.target.value
8
+
9
+ const calculatorName = selectedCalculator
10
+ .split('::')
11
+ .pop()
12
+ .replace(/([A-Z])/g, '_$1')
13
+ .toLowerCase()
14
+ .replace(/^_/, '')
15
+
16
+ const template = document.getElementById(`${calculatorName}_fields`)
17
+
18
+ if (template) {
19
+ this.containerTarget.innerHTML = template.innerHTML
20
+ } else {
21
+ console.error(`Template not found for calculator: ${selectedCalculator}`)
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,52 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+ import { easepick } from '@easepick/core';
3
+ import { RangePlugin } from '@easepick/range-plugin';
4
+ import { PresetPlugin } from '@easepick/preset-plugin';
5
+
6
+ export default class extends Controller {
7
+ static targets = [ "picker", "dateFrom", "dateTo", "label" ]
8
+
9
+ connect() {
10
+ this.picker = new easepick.create({
11
+ element: this.pickerTarget,
12
+ inline: true,
13
+ css: [
14
+ 'https://cdn.jsdelivr.net/npm/@easepick/core@1.2.0/dist/index.css',
15
+ 'https://cdn.jsdelivr.net/npm/@easepick/range-plugin@1.2.0/dist/index.css',
16
+ 'https://cdn.jsdelivr.net/npm/@easepick/preset-plugin@1.2.0/dist/index.css',
17
+ ],
18
+ doc: document,
19
+ plugins: [RangePlugin, PresetPlugin],
20
+ RangePlugin: {
21
+ tooltip: true,
22
+ startDate: this.dateFromTarget.value,
23
+ endDate: this.dateToTarget.value,
24
+ },
25
+ PresetPlugin: {
26
+ customLabels: ['Today', 'Yesterday',
27
+ 'Last 7 Days', 'Last 30 Days',
28
+ 'This Month', 'Last Month'],
29
+ position: 'left'
30
+ },
31
+ })
32
+
33
+ this.picker.on('render', () => {
34
+ this.picker.ui.container.style.boxShadow = 'none';
35
+ });
36
+
37
+ this.picker.on('select', (event) => {
38
+ const data = event.detail;
39
+ this.dateFromTarget.value = data.start
40
+ this.dateToTarget.value = data.end
41
+
42
+ // https://stackoverflow.com/questions/68624668/how-can-i-submit-a-form-on-input-change-with-turbo-streams
43
+ this.pickerTarget.closest('form').requestSubmit()
44
+
45
+ this.labelTarget.innerHTML = this.pickerTarget.innerHTML
46
+ })
47
+ }
48
+
49
+ open() {
50
+ this.picker.show()
51
+ }
52
+ }
@@ -0,0 +1,17 @@
1
+ import Clipboard from 'stimulus-clipboard'
2
+
3
+ export default class extends Clipboard {
4
+ copy(event) {
5
+ event.preventDefault()
6
+
7
+ const text = this.sourceTarget.value || this.sourceTarget.innerHTML
8
+
9
+ // https://stackoverflow.com/questions/73148190/copy-html-content-to-clipboard
10
+ navigator.clipboard.write([new ClipboardItem({
11
+ 'text/plain': new Blob([text], {type: 'text/plain'}),
12
+ 'text/html': new Blob([text], {type: 'text/html'})
13
+ })])
14
+
15
+ this.copied()
16
+ }
17
+ }
@@ -0,0 +1,22 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ static targets = [
5
+ "primaryColor",
6
+ "textColor",
7
+ "borderColor",
8
+ "buttonTextColor",
9
+ "backgroundColor"
10
+ ]
11
+
12
+ selectPalette(event) {
13
+ this.primaryColorTarget.value = event.params.primaryColor
14
+ this.textColorTarget.value = event.params.textColor
15
+ this.borderColorTarget.value = event.params.borderColor
16
+ this.buttonTextColorTarget.value = event.params.buttonTextColor
17
+ this.backgroundColorTarget.value = event.params.backgroundColor
18
+
19
+ // we need only one event to trigger the change
20
+ this.primaryColorTarget.dispatchEvent(new InputEvent('change'))
21
+ }
22
+ }
@@ -0,0 +1,52 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+ import Pickr from '@simonwep/pickr'
3
+
4
+ export default class extends Controller {
5
+ static targets = ["picker", "input", "display", "value"]
6
+ static values = { clear: Boolean, defaultColor: String }
7
+
8
+ initialize() {
9
+ this.initPicker();
10
+ }
11
+
12
+ initPicker() {
13
+ this.picker = Pickr.create({
14
+ el: this.pickerTarget,
15
+ theme: 'classic',
16
+ default: this.inputTarget.value.length > 0 ? this.inputTarget.value : this.defaultColorValue,
17
+ useAsButton: true,
18
+
19
+ components: {
20
+ preview: true,
21
+ opacity: true,
22
+ hue: true,
23
+
24
+ interaction: {
25
+ hex: true,
26
+ rgba: true,
27
+ hsla: false,
28
+ hsva: false,
29
+ cmyk: false,
30
+ input: true,
31
+ clear: this.hasClearValue ? this.clearValue : false,
32
+ save: false,
33
+ comparison: false,
34
+ },
35
+ },
36
+ })
37
+
38
+ this.picker.on('change', (color, _instance) => {
39
+ this.pickerTarget.style.background = color.toRGBA().toString(0);
40
+ this.inputTarget.value = color.toHEXA().toString()
41
+ this.valueTarget.innerHTML = color.toHEXA().toString()
42
+ this.inputTarget.dispatchEvent(new InputEvent('change'))
43
+ })
44
+
45
+ this.picker.on('clear', () => {
46
+ this.pickerTarget.style.background = 'white';
47
+ this.inputTarget.value = '';
48
+ this.valueTarget.innerHTML = '';
49
+ this.inputTarget.dispatchEvent(new InputEvent('change'))
50
+ })
51
+ }
52
+ }
@@ -0,0 +1,29 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ static targets = ["input", "button"];
5
+ static values = {
6
+ allowBlank: { type: Boolean, default: false },
7
+ disableWhenNotChanged: { type: Boolean, default: false },
8
+ }
9
+
10
+ connect() {
11
+ this.buttonTarget.setAttribute("disabled", true);
12
+
13
+ if (this.inputTargets.every((input) => input.value || input.checked || this.allowBlankValue) && !this.disableWhenNotChangedValue) {
14
+ this.buttonTarget.removeAttribute("disabled");
15
+ }
16
+
17
+ this.inputTargets.forEach((input) => {
18
+ input.addEventListener("input", (event) => this.handleChange(event));
19
+ });
20
+ }
21
+
22
+ handleChange(event) {
23
+ if (this.inputTargets.every((input) => event.target.value || event.target.checked || this.allowBlankValue)) {
24
+ this.buttonTarget.removeAttribute("disabled");
25
+ } else {
26
+ this.buttonTarget.setAttribute("disabled", true);
27
+ }
28
+ }
29
+ }