shoperb-theme-editor 0.8.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 (99) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.md +40 -0
  3. data/LICENSE.md +21 -0
  4. data/README.md +124 -0
  5. data/bin/shoperb +313 -0
  6. data/lib/shoperb_theme_editor/api/server.rb +10 -0
  7. data/lib/shoperb_theme_editor/api/views/callback.erb +53 -0
  8. data/lib/shoperb_theme_editor/api.rb +264 -0
  9. data/lib/shoperb_theme_editor/build/json.rb +167 -0
  10. data/lib/shoperb_theme_editor/build/liquid.rb +38 -0
  11. data/lib/shoperb_theme_editor/build/section.rb +51 -0
  12. data/lib/shoperb_theme_editor/build/settings.rb +224 -0
  13. data/lib/shoperb_theme_editor/build.rb +68 -0
  14. data/lib/shoperb_theme_editor/configuration.rb +98 -0
  15. data/lib/shoperb_theme_editor/error.rb +35 -0
  16. data/lib/shoperb_theme_editor/ext/array.rb +17 -0
  17. data/lib/shoperb_theme_editor/ext/nil_class.rb +7 -0
  18. data/lib/shoperb_theme_editor/ext/sequel.rb +82 -0
  19. data/lib/shoperb_theme_editor/ext.rb +2 -0
  20. data/lib/shoperb_theme_editor/init.rb +87 -0
  21. data/lib/shoperb_theme_editor/logger.rb +58 -0
  22. data/lib/shoperb_theme_editor/mounter/models/address.rb +65 -0
  23. data/lib/shoperb_theme_editor/mounter/models/attribute.rb +11 -0
  24. data/lib/shoperb_theme_editor/mounter/models/attribute_key.rb +17 -0
  25. data/lib/shoperb_theme_editor/mounter/models/base.rb +196 -0
  26. data/lib/shoperb_theme_editor/mounter/models/blog_category.rb +47 -0
  27. data/lib/shoperb_theme_editor/mounter/models/blog_post.rb +45 -0
  28. data/lib/shoperb_theme_editor/mounter/models/brand.rb +11 -0
  29. data/lib/shoperb_theme_editor/mounter/models/cart.rb +35 -0
  30. data/lib/shoperb_theme_editor/mounter/models/cart_item.rb +71 -0
  31. data/lib/shoperb_theme_editor/mounter/models/category.rb +99 -0
  32. data/lib/shoperb_theme_editor/mounter/models/collection.rb +40 -0
  33. data/lib/shoperb_theme_editor/mounter/models/country.rb +18 -0
  34. data/lib/shoperb_theme_editor/mounter/models/currency.rb +17 -0
  35. data/lib/shoperb_theme_editor/mounter/models/custom_field.rb +22 -0
  36. data/lib/shoperb_theme_editor/mounter/models/customer.rb +77 -0
  37. data/lib/shoperb_theme_editor/mounter/models/customer_customer_group.rb +12 -0
  38. data/lib/shoperb_theme_editor/mounter/models/customer_group.rb +13 -0
  39. data/lib/shoperb_theme_editor/mounter/models/customer_subscription.rb +40 -0
  40. data/lib/shoperb_theme_editor/mounter/models/customer_subscription_plan.rb +32 -0
  41. data/lib/shoperb_theme_editor/mounter/models/discount.rb +40 -0
  42. data/lib/shoperb_theme_editor/mounter/models/discount_variant.rb +15 -0
  43. data/lib/shoperb_theme_editor/mounter/models/image.rb +51 -0
  44. data/lib/shoperb_theme_editor/mounter/models/language.rb +17 -0
  45. data/lib/shoperb_theme_editor/mounter/models/link.rb +61 -0
  46. data/lib/shoperb_theme_editor/mounter/models/media_file.rb +19 -0
  47. data/lib/shoperb_theme_editor/mounter/models/menu.rb +21 -0
  48. data/lib/shoperb_theme_editor/mounter/models/meta.rb +10 -0
  49. data/lib/shoperb_theme_editor/mounter/models/news_item.rb +11 -0
  50. data/lib/shoperb_theme_editor/mounter/models/order.rb +133 -0
  51. data/lib/shoperb_theme_editor/mounter/models/order_item.rb +137 -0
  52. data/lib/shoperb_theme_editor/mounter/models/order_item_attribute.rb +17 -0
  53. data/lib/shoperb_theme_editor/mounter/models/order_return.rb +42 -0
  54. data/lib/shoperb_theme_editor/mounter/models/order_return_item.rb +29 -0
  55. data/lib/shoperb_theme_editor/mounter/models/order_return_item_entity.rb +25 -0
  56. data/lib/shoperb_theme_editor/mounter/models/order_return_parcel.rb +20 -0
  57. data/lib/shoperb_theme_editor/mounter/models/page.rb +26 -0
  58. data/lib/shoperb_theme_editor/mounter/models/payment_card.rb +21 -0
  59. data/lib/shoperb_theme_editor/mounter/models/payment_method.rb +67 -0
  60. data/lib/shoperb_theme_editor/mounter/models/payment_provider.rb +23 -0
  61. data/lib/shoperb_theme_editor/mounter/models/product.rb +144 -0
  62. data/lib/shoperb_theme_editor/mounter/models/product_attribute.rb +32 -0
  63. data/lib/shoperb_theme_editor/mounter/models/product_search.rb +53 -0
  64. data/lib/shoperb_theme_editor/mounter/models/product_type.rb +21 -0
  65. data/lib/shoperb_theme_editor/mounter/models/review.rb +38 -0
  66. data/lib/shoperb_theme_editor/mounter/models/search.rb +11 -0
  67. data/lib/shoperb_theme_editor/mounter/models/shipping_method.rb +39 -0
  68. data/lib/shoperb_theme_editor/mounter/models/shop.rb +58 -0
  69. data/lib/shoperb_theme_editor/mounter/models/state.rb +17 -0
  70. data/lib/shoperb_theme_editor/mounter/models/theme.rb +89 -0
  71. data/lib/shoperb_theme_editor/mounter/models/variant.rb +96 -0
  72. data/lib/shoperb_theme_editor/mounter/models/variant_attribute.rb +46 -0
  73. data/lib/shoperb_theme_editor/mounter/models/vendor.rb +38 -0
  74. data/lib/shoperb_theme_editor/mounter/server/assets.rb +35 -0
  75. data/lib/shoperb_theme_editor/mounter/server/defaults.rb +44 -0
  76. data/lib/shoperb_theme_editor/mounter/server/exception_handler.rb +22 -0
  77. data/lib/shoperb_theme_editor/mounter/server/partials/_shoperb_footer.liquid +0 -0
  78. data/lib/shoperb_theme_editor/mounter/server/partials/_shoperb_header.liquid +0 -0
  79. data/lib/shoperb_theme_editor/mounter/server/partials/_shoperb_stylesheets.liquid +3 -0
  80. data/lib/shoperb_theme_editor/mounter/server/renderer.rb +166 -0
  81. data/lib/shoperb_theme_editor/mounter/server/routes/cart.rb +127 -0
  82. data/lib/shoperb_theme_editor/mounter/server/routes/dummy.rb +34 -0
  83. data/lib/shoperb_theme_editor/mounter/server/routes/locale.rb +31 -0
  84. data/lib/shoperb_theme_editor/mounter/server/routes/pages.rb +33 -0
  85. data/lib/shoperb_theme_editor/mounter/server/routes/search.rb +18 -0
  86. data/lib/shoperb_theme_editor/mounter/server/routes.rb +366 -0
  87. data/lib/shoperb_theme_editor/mounter/server/routes_helper.rb +278 -0
  88. data/lib/shoperb_theme_editor/mounter/server.rb +66 -0
  89. data/lib/shoperb_theme_editor/mounter.rb +30 -0
  90. data/lib/shoperb_theme_editor/os.rb +13 -0
  91. data/lib/shoperb_theme_editor/package.rb +81 -0
  92. data/lib/shoperb_theme_editor/sync/images.rb +69 -0
  93. data/lib/shoperb_theme_editor/sync/pagination.rb +52 -0
  94. data/lib/shoperb_theme_editor/sync.rb +229 -0
  95. data/lib/shoperb_theme_editor/translations.rb +22 -0
  96. data/lib/shoperb_theme_editor/utils.rb +50 -0
  97. data/lib/shoperb_theme_editor.rb +159 -0
  98. data/shoperb_theme_editor.gemspec +60 -0
  99. metadata +510 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: eac7f2b4b1a0b804c17d6d9c2eb6f384c6340fb263fa4aad6d406c55f65138be
4
+ data.tar.gz: 36aae6b3f400e563a70aa361724dfaf77a8cd32f7bf307bec2dcc5f889a4048c
5
+ SHA512:
6
+ metadata.gz: 714891499aeec34c47dd07d81dc987a4a81b40b7296e5b735c511aa5cf085ff0ad479e40406b7b33e2b5f6c90209f806eba4b3772f41fb5cf703d012edba41e3
7
+ data.tar.gz: 50aaa267ec9d3417735d96289df9b7edcfc6c489a4a1e24a15d9a81e411b158bebb6aa3dd4f680c97aabfee174897fe11cda8d700ca1439c4d544bccc1d0de53
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,40 @@
1
+ # Contributing to Shoperb Theme Editor
2
+
3
+ Thanks for your interest — we’re glad you’re here!
4
+
5
+ Shoperb Theme Editor is a community-friendly CLI for building, editing, and managing storefront themes. We welcome ideas, questions and bug reports from developers, designers, and store owners alike.
6
+
7
+ ## How You Can Contribute
8
+
9
+ - Ask “Can I…?” questions
10
+ - Not sure if a layout, style, or interaction is possible? Open a GitHub Discussion or Issue — curiosity leads to great features.
11
+
12
+ - Suggest features
13
+ - Open an Issue with:
14
+ - A clear title
15
+ - The problem it solves (use case)
16
+ - Examples or prior art (if any)
17
+
18
+ - Report bugs
19
+ - Please include:
20
+ - Steps to reproduce
21
+ - Your environment (OS, Ruby version)
22
+ - Logs, stack traces, or screenshots
23
+
24
+ - Improve docs
25
+ - Add examples, clarify commands, or contribute translations.
26
+
27
+ ## Our Philosophy
28
+
29
+ - Every “what if” is worth exploring
30
+ - Good ideas can come from anyone
31
+ - Lowering barriers helps everyone build better stores
32
+ - Designers, developers, and merchants are all welcome
33
+
34
+ If your idea feels small or uncertain — that’s okay. Start the conversation.
35
+
36
+ ## Communication
37
+
38
+ - GitHub Issues for bug reports and feature requests
39
+ - Email us at [engineering@shoperb.com](mailto:engineering@shoperb.com) for technical deep-dives
40
+ - Official documentation is available at https://shoperb.dev
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2014-2025 Shoperb
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,124 @@
1
+ # Shoperb Theme Editor
2
+
3
+ Shoperb Theme Editor is a Ruby CLI that simplifies creating and updating Shoperb storefront themes.
4
+
5
+ ## Installation
6
+ ### Install Ruby
7
+ See installation guides at https://www.ruby-lang.org/en/documentation/installation/.
8
+
9
+
10
+ ### Requirements
11
+ - Ruby >= 3.2.0
12
+ - Bundler >= 2.x
13
+
14
+ ### Project setup
15
+ #### Option A: one-liner (GitHub source)
16
+ Copy and paste this into your terminal:
17
+ ```
18
+ echo -e "source \"https://rubygems.org\"\ngem \"shoperb-theme-editor\", git: \"https://github.com/shoperb/theme-editor.git\"\ngem \"shoperb_liquid\", git: \"https://github.com/shoperb/shoperb-liquid.git\"\ngem 'artisans', git: 'https://github.com/shoperb/artisans.git'\n" > Gemfile && bundle
19
+ ```
20
+
21
+ #### Option B: step by step (GitHub source)
22
+ Create a Gemfile:
23
+ ```ruby
24
+ source "https://rubygems.org"
25
+
26
+ gem "shoperb-theme-editor", git: 'git@github.com:shoperb/theme-editor'
27
+ gem 'shoperb_liquid', git: 'git@github.com:shoperb/shoperb-liquid'
28
+ gem "artisans", git: "git@github.com:shoperb/artisans"
29
+ ```
30
+ Then run:
31
+ ```bash
32
+ $ bundle
33
+ ```
34
+
35
+ Alternatively, if you prefer a released version from RubyGems:
36
+ ```ruby
37
+ source "https://rubygems.org"
38
+ gem "shoperb-theme-editor", "~> 0.8"
39
+ ```
40
+
41
+ ## Quickstart
42
+
43
+ ```bash
44
+ # Create a new theme from the blank template
45
+ shoperb init theme-blank my-theme
46
+ cd my-theme
47
+
48
+ # Run a local preview server (default: http://localhost:4000)
49
+ shoperb serve
50
+ ```
51
+
52
+ ## Usage
53
+ #### Execute `bundle exec shoperb pull`
54
+ Fetches updates from the remote theme into your local copy.
55
+ #### Execute `bundle exec shoperb sync`
56
+ Clones products, categories, images, collections, and vendors for local development.
57
+ #### Execute `bundle exec shoperb serve`
58
+ Runs a local preview server for the theme (default: http://localhost:4000).
59
+
60
+ ## Available commands
61
+
62
+ ### clone
63
+ Downloads your shop's Shoperb theme into a local directory.
64
+ ```bash
65
+ $ bundle exec shoperb clone <directory> [<handle>] [options]
66
+ ```
67
+
68
+ ### init
69
+ Creates a new theme from a template (e.g., `theme-blank`).
70
+ ```bash
71
+ $ bundle exec shoperb init <template> <handle>
72
+ ```
73
+
74
+ ### pull
75
+ Fetches updates from the remote theme into your local copy.
76
+ ```bash
77
+ $ bundle exec shoperb pull [options]
78
+ ```
79
+
80
+ ### push
81
+ Uploads local changes to the remote Shoperb theme.
82
+ ```bash
83
+ $ bundle exec shoperb push [options]
84
+ ```
85
+
86
+ ### serve
87
+ Runs a local server to preview the theme.
88
+ alias: mount
89
+ ```bash
90
+ $ bundle exec shoperb serve [options]
91
+ ```
92
+
93
+ ### sync
94
+ Clones products, categories, images, collections, and vendors from your shop.
95
+ ```bash
96
+ $ bundle exec shoperb sync
97
+ ```
98
+
99
+ ## Authentication and Configuration
100
+
101
+ - Commands that talk to your shop (e.g., `clone`, `pull`, `push`) will guide you through any required credentials and shop details.
102
+ - Prefer environment variables or a local secrets file for tokens; never commit secrets. See the docs for current options and examples: https://shoperb.dev
103
+
104
+ ## Troubleshooting
105
+
106
+ - Port already in use
107
+ - Port 4000 busy? Try: `shoperb serve --port 4001`.
108
+
109
+ - Ruby/OpenSSL or bundler errors
110
+ - Ensure Ruby ≥ 3.2.0 and Bundler ≥ 2.x. Try `gem install bundler` and `bundle update`.
111
+
112
+ - Failed to download or initialize template
113
+ - Check your connection and retry `shoperb init`. Verify the template name (e.g., `theme-blank`). See the docs for details.
114
+
115
+ - Authentication issues
116
+ - Re-run the command and follow the prompts. Double‑check your shop handle/domain and tokens. See https://shoperb.dev for supported auth methods.
117
+
118
+ ## Links
119
+
120
+ - Homepage: https://www.shoperb.com
121
+ - Documentation: https://shoperb.dev
122
+ - Issues: https://github.com/shoperb/theme-editor/issues
123
+ - Contributing: CONTRIBUTING.md
124
+ - License: MIT (LICENSE)
data/bin/shoperb ADDED
@@ -0,0 +1,313 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'tty-prompt'
4
+ require 'fileutils'
5
+ require 'json'
6
+ require_relative "../lib/shoperb_theme_editor"
7
+ require_relative '../lib/shoperb_theme_editor/build'
8
+
9
+ def apply_global_opts
10
+ Shoperb::Theme::Editor::Configuration::OPTIONS.each do |option, msg|
11
+ on option, msg
12
+ end
13
+ end
14
+
15
+ def with_description base
16
+ <<-eos
17
+ #{description}
18
+
19
+ #{base}
20
+ eos
21
+ end
22
+
23
+ def clear_screen
24
+ print "\e[2J\e[f"
25
+ end
26
+
27
+ def display_banner
28
+ banner = <<-BANNER
29
+
30
+ +-------------------------------------------------------------------------------------------------------+
31
+ | |
32
+ | ________ ___ ___ ________ ________ _______ ________ ________ |
33
+ | |\\ ____\\ |\\ \\|\\ \\ |\\ __ \\ |\\ __ \\ |\\ ___ \\ |\\ __ \\ |\\ __ \\ |
34
+ | \\ \\ \\___|_ \\ \\ \\\\\\ \\ \\ \\ \\|\\ \\ \\ \\ \\|\\ \\ \\ \\ __/| \\ \\ \\|\\ \\ \\ \\ \\|\\ /_ |
35
+ | \\ \\_____ \\ \\ \\ __ \\ \\ \\ \\\\\\ \\ \\ \\ ____\\ \\ \\ \\_|/__ \\ \\ _ _\\ \\ \\ __ \\ |
36
+ | \\|____|\\ \\ \\ \\ \\ \\ \\ \\ \\ \\\\\\ \\ \\ \\ \\___| \\ \\ \\_|\\ \\ \\ \\ \\\\ \\| \\ \\ \\|\\ \\ |
37
+ | ____\\_\\ \\ \\ \\__\\ \\__\\ \\ \\_______\\ \\ \\__\\ \\ \\_______\\ \\ \\__\\\\ _\\ \\ \\_______\\ |
38
+ | |\\_________\\ \\|__|\\|__| \\|_______| \\|__| \\|_______| \\|__|\\|__| \\|_______| |
39
+ | \\|_________| |
40
+ | |
41
+ +-------------------------------------------------------------------------------------------------------+
42
+
43
+ BANNER
44
+ puts banner
45
+ end
46
+
47
+ Slop.parse ignore_case: true, help: true, strict: true do
48
+
49
+ apply_global_opts
50
+
51
+ command "clone" do
52
+ apply_global_opts
53
+ on "skip-images", "Skip downloading images"
54
+ on :"only-products=", "Add comma separated product ids to sync", as: String
55
+ on :"only-customers=", "Add comma separated customer ids to sync", as: String
56
+ description "Downloads your shops shoperb theme"
57
+ banner with_description("Usage: shoperb clone <directory> [<handle>] [options]")
58
+ run do |options, args|
59
+ Shoperb::Theme::Editor.with_configuration(options, *args) do
60
+ Shoperb::Theme::Editor::Api.pull *args
61
+ Shoperb::Theme::Editor::Api.sync args[0]
62
+ end
63
+ end
64
+ end
65
+
66
+ command "pull" do
67
+ apply_global_opts
68
+ description "Updates your local shoperb theme"
69
+ banner with_description("Usage: shoperb pull [options]")
70
+ run do |options, args|
71
+ Shoperb::Theme::Editor.with_configuration(options) do
72
+ Shoperb::Theme::Editor::Api.pull *args
73
+ end
74
+ end
75
+ end
76
+
77
+ command "pull:emails" do
78
+ apply_global_opts
79
+ description "Updates your local shoperb emails"
80
+ banner with_description("Usage: shoperb pull:emails [options]")
81
+ run do |options, args|
82
+ Shoperb::Theme::Editor.with_configuration(options) do
83
+ Shoperb::Theme::Editor::Api.pull_emails *args
84
+ end
85
+ end
86
+ end
87
+
88
+ command "push" do
89
+ apply_global_opts
90
+ description "Updates your remote shoperb theme"
91
+ banner with_description("Usage: shoperb push [options]")
92
+ on :r, :reset, 'Reset all (with settings data)'
93
+
94
+ run do |options, args|
95
+ Shoperb::Theme::Editor.with_configuration(options) do
96
+ Shoperb::Theme::Editor::Api.push **options
97
+ end
98
+ end
99
+ end
100
+
101
+ command "push:emails" do
102
+ apply_global_opts
103
+ description "Updates your remote shoperb emails"
104
+ banner with_description("Usage: shoperb push:emails [options]")
105
+ on :r, :reset, 'Reset all (with settings data)'
106
+
107
+ run do |options, args|
108
+ Shoperb::Theme::Editor.with_configuration(options) do
109
+ Shoperb::Theme::Editor::Api.push_emails **options
110
+ end
111
+ end
112
+ end
113
+
114
+ command "zip" do
115
+ apply_global_opts
116
+ description "Zips up your local shoperb theme"
117
+ banner with_description("Usage: shoperb zip [options]")
118
+ run do |options, args|
119
+ Shoperb::Theme::Editor.with_configuration(options) do
120
+ Shoperb::Theme::Editor::Api.zip
121
+ end
122
+ end
123
+ end
124
+
125
+ command "console" do
126
+ apply_global_opts
127
+ description "Irb in the context of theme generator"
128
+ banner with_description("Usage: shoperb console [options]")
129
+ run do |options, args|
130
+ Shoperb::Theme::Editor.with_configuration(options) do
131
+ Shoperb::Theme::Editor::Mounter::Model.console
132
+ end
133
+ end
134
+ end
135
+
136
+ mount = ->(*vars) {
137
+ apply_global_opts
138
+ description "Serves local as a shoperb theme file"
139
+ banner with_description("Usage: shoperb mount [options]")
140
+ run do |options, args|
141
+ Shoperb::Theme::Editor.with_configuration(options) do
142
+ Shoperb::Theme::Editor::Mounter.start
143
+ end
144
+ end
145
+ }
146
+
147
+ command "mount", &mount
148
+ command "serve", &mount
149
+
150
+ command "sync" do
151
+ apply_global_opts
152
+ on "skip-images", "Skip downloading images"
153
+ on :"only-products=", "Add comma separated product ids to sync", as: String
154
+ on :"only-customers=", "Add comma separated customer ids to sync", as: String
155
+ description "Syncronizes your shoperb shops products/categories/etc to your local data"
156
+ banner with_description("Usage: shoperb sync [options]")
157
+ run do |options, args|
158
+ Shoperb::Theme::Editor.with_configuration(options) do
159
+ Shoperb::Theme::Editor::Api.sync args[0], options.to_hash
160
+ end
161
+ end
162
+ end
163
+
164
+ command "init" do
165
+ apply_global_opts
166
+ description "Initializes a new theme"
167
+ banner with_description("Usage: shoperb init <template> <handle> [options]")
168
+ run do |options, args|
169
+ Shoperb::Theme::Editor.with_configuration(options) do
170
+ Shoperb::Theme::Editor::Init.new(args[0], args[1] || "default")
171
+ end
172
+ end
173
+ end
174
+
175
+ command "build" do
176
+ apply_global_opts
177
+ description "Adds or modifies sections"
178
+ banner with_description("Usage: shoperb build")
179
+
180
+ run do |options, args|
181
+ prompt = TTY::Prompt.new
182
+
183
+ sections_dir = File.join(Dir.pwd, "config/sections")
184
+ FileUtils.mkdir_p(sections_dir)
185
+ section_files = Dir[File.join(sections_dir, "*.json")].map { |f| File.basename(f, ".json") }
186
+
187
+ section_handle = nil
188
+
189
+ begin
190
+ loop do
191
+ clear_screen
192
+ display_banner
193
+
194
+ choices = section_files.map do |f|
195
+ json = JSON.parse(File.read(File.join(sections_dir, "#{f}.json")))
196
+ { name: "# #{json['name']} (#{f})", value: f }
197
+ end
198
+ choices << { name: "", disabled: "" }
199
+ choices << { name: "+ Create new section", value: :create }
200
+ choices << { name: "- Remove section", value: :remove }
201
+ choices << { name: "← Exit", value: :exit }
202
+
203
+ section_choice = prompt.select('Select a section to modify or create a new one:', choices, per_page: 20, cycle: true)
204
+
205
+ case section_choice
206
+ when :create
207
+ section_handle = prompt.ask('Enter the new section handle (or type "back" to go back):', required: true)
208
+ next if section_handle == 'back'
209
+
210
+ if section_files.include?(section_handle)
211
+ modify = prompt.yes?("Section '#{section_handle}' already exists. Do you want to modify it?")
212
+ unless modify
213
+ prompt.say("Section handle already exists. Please enter a different handle.")
214
+ next
215
+ end
216
+ end
217
+
218
+ generated_name = section_handle.split('_').map(&:capitalize).join(' ')
219
+ section_name = prompt.ask('Enter the section name (or type "back" to go back):', default: generated_name, required: true)
220
+ next if section_name == 'back'
221
+
222
+ Shoperb::Theme::Editor.with_configuration(options) do
223
+ Shoperb::Theme::Editor.create_section(section_handle, section_name)
224
+ end
225
+
226
+ Shoperb::Theme::Editor.with_configuration(options) do
227
+ Shoperb::Theme::Editor.add_settings(section_handle)
228
+ end
229
+
230
+ # Refresh the section_files list
231
+ section_files = Dir[File.join(sections_dir, "*.json")].map { |f| File.basename(f, ".json") }
232
+
233
+ when :remove
234
+ loop do
235
+ clear_screen
236
+ display_banner
237
+
238
+ remove_choices = section_files.map do |f|
239
+ json = JSON.parse(File.read(File.join(sections_dir, "#{f}.json")))
240
+ { name: "# #{json['name']} (#{f})", value: f }
241
+ end
242
+ remove_choices << { name: "", disabled: "" }
243
+ remove_choices << { name: "← Sections", value: :back }
244
+
245
+ section_to_remove = prompt.select('Select a section to remove:', remove_choices, per_page: 20, cycle: true)
246
+
247
+ break if section_to_remove == :back
248
+
249
+ confirm = prompt.yes?("Are you sure you want to remove the section '#{section_to_remove}'?")
250
+
251
+ if confirm
252
+ Shoperb::Theme::Editor.with_configuration(options) do
253
+ Shoperb::Theme::Editor.remove_section(section_to_remove)
254
+ end
255
+ section_files.delete(section_to_remove)
256
+ prompt.say("Section '#{section_to_remove}' has been removed successfully.")
257
+ end
258
+ end
259
+
260
+ when :exit
261
+ break
262
+
263
+ else
264
+ section_handle = section_choice
265
+ json_file_path = File.join(sections_dir, "#{section_handle}.json")
266
+ json_content = JSON.parse(File.read(json_file_path))
267
+
268
+ loop do
269
+ clear_screen
270
+ display_banner
271
+
272
+ setting_choices = json_content["settings"].map { |s| { name: "# #{s['handle']} (#{s['type']})", value: s['handle'] } }
273
+ setting_choices << { name: "", disabled: "" }
274
+ setting_choices << { name: "+ Add setting", value: :add }
275
+ setting_choices << { name: "- Remove setting", value: :remove }
276
+ setting_choices << { name: "← Back to Sections", value: :back }
277
+
278
+ setting_choice = prompt.select('Select a setting to modify, add, delete, or go back:', setting_choices, per_page: 20, cycle: true)
279
+
280
+ if setting_choice == :add
281
+ Shoperb::Theme::Editor.with_configuration(options) do
282
+ Shoperb::Theme::Editor.add_settings(section_handle)
283
+ end
284
+ # Refresh the json_content
285
+ json_content = JSON.parse(File.read(json_file_path))
286
+ elsif setting_choice == :remove
287
+ Shoperb::Theme::Editor.with_configuration(options) do
288
+ Shoperb::Theme::Editor.delete_settings(section_handle)
289
+ end
290
+ # Refresh the json_content
291
+ json_content = JSON.parse(File.read(json_file_path))
292
+ elsif setting_choice == :back
293
+ break
294
+ else
295
+ handle_to_modify = setting_choice
296
+ prompt.say("Selected setting handle: #{handle_to_modify}")
297
+
298
+ Shoperb::Theme::Editor.with_configuration(options) do
299
+ Shoperb::Theme::Editor.modify_setting(section_handle, handle_to_modify)
300
+ end
301
+ # Refresh the json_content
302
+ json_content = JSON.parse(File.read(json_file_path))
303
+ end
304
+ end
305
+ end
306
+ end
307
+ rescue TTY::Reader::InputInterrupt
308
+ puts "\nAll done, exiting..."
309
+ exit(0)
310
+ end
311
+ end
312
+ end
313
+ end
@@ -0,0 +1,10 @@
1
+ module Shoperb module Theme module Editor
2
+ module Api
3
+ class Server < Sinatra::Base
4
+ get URI(Editor["oauth-redirect-uri"]).path do
5
+ Editor["oauth-cache"] = Api.get_authented_token(params[:code]).to_hash.with_indifferent_access
6
+ erb :callback
7
+ end
8
+ end
9
+ end
10
+ end end end
@@ -0,0 +1,53 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
6
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
+ <style>
8
+ body {
9
+ margin: 0;
10
+ font-family: "Lato", sans-serif;
11
+ background-color: #4182D7;
12
+ }
13
+ .wrapper {
14
+ margin: 0 auto;
15
+ text-align: center;
16
+ position: relative;
17
+ color: white;
18
+ width: 600px;
19
+ }
20
+ .wrapper h2 {
21
+ position: absolute;
22
+ top: 25%;
23
+ left: 0;
24
+ width: 100%;
25
+ }
26
+ .wrapper p {
27
+ position: absolute;
28
+ top: 60%;
29
+ left: 0;
30
+ width: 100%;
31
+ line-height: 1.5;
32
+ }
33
+ a {
34
+ color: white;
35
+ }
36
+ </style>
37
+ </head>
38
+ <body>
39
+ <div class="wrapper">
40
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 580 790"><style>.st0{fill:#4182d7}.st1{fill:#306abf}.st2{fill:#08264d}.st3{fill:#ebeff5}.st5{fill:#062042}.st6{fill:#fff}.st7{fill:#af8f69}.st8{fill:#b3d6ff}.st9{opacity:.3;clip-path:url(#XMLID_107_);fill:#fff}.st10,.st11,.st12{clip-path:url(#XMLID_112_);fill:#86b3e0}.st11,.st12{fill:#cae2ff}.st12{fill:#abcae9}.st13{fill:#ced4db}.st14{fill:#bfbfbf}.st16{fill:#90b2db}.st17{fill:#a3bcdb}.st18{fill:#1257b3}.st19{fill:#e5e5e5}.st20{fill:#80b7ff}</style><g id="Layer_2"><path id="XMLID_161_" class="st0" d="M0 0h580v790H0z"/></g><g id="Layer_3"><g id="XMLID_11_"><path id="XMLID_201_" class="st1" d="M406.7 449c-1.2-1.3-3-2.2-5.1-2.9-2.2-.7-4.8-1.1-7.6-1.1-3.7 0-7.1.7-9.6 1.8-1.3.6-2.3 1.3-3.1 2.1-.8.8-1.3 1.9-1.3 3 0 .4.1.7.2 1.1.3.9.9 1.7 1.6 2.1.7.5 1.6.8 2.5.8h19.5c.9 0 1.8-.3 2.5-.8s1.3-1.2 1.6-2.1c.1-.4.2-.7.2-1.1-.1-1-.6-2.1-1.4-2.9zm-.8 3.5c-.1.4-.4.8-.8 1.1-.4.3-.9.4-1.4.4h-19.5c-.5 0-1-.2-1.4-.4-.4-.3-.7-.6-.8-1.1-.1-.2-.1-.3-.1-.5 0-.5.2-1.1.8-1.7.8-.9 2.3-1.8 4.3-2.4 2-.6 4.4-1 7-1 3.5 0 6.6.7 8.8 1.7 1.1.5 1.9 1.1 2.5 1.7.5.6.8 1.1.8 1.7-.1.2-.1.3-.2.5z"/><g id="XMLID_8_"><path id="XMLID_203_" class="st1" d="M184.7 415.1h-.8c-.4 0-.8-.4-.8-.8s.4-.8.8-.8h.8c.4 0 .8.4.8.8s-.4.8-.8.8z"/><path id="XMLID_224_" class="st1" d="M184.7 427.1h-.8c-.4 0-.8-.4-.8-.8s.4-.8.8-.8h.8c.4 0 .8.4.8.8s-.4.8-.8.8z"/><path id="XMLID_293_" class="st1" d="M172.6 421.5h.8c.4 0 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1.2-.4-2.1-1.5-2.1-2.8 0-1.4.9-2.5 2.1-2.9zm32-7.2v15c0 3-1.2 5.8-3.2 7.8s-4.7 3.2-7.8 3.2h-8c-3 0-5.8-1.2-7.8-3.2s-3.2-4.7-3.2-7.8v-15h30z"/><g id="XMLID_10_"><path id="XMLID_23_" class="st1" d="M450.7 287.3c-.2-.2-.4-.3-.7-.3h-50c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7v56c0 .3.1.5.3.7s.4.3.7.3h50c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7v-56c0-.3-.1-.5-.3-.7zM401 289h48v54h-48v-54z"/><path id="XMLID_19_" class="st1" d="M446 340v-1h-41v-46h40v47h1v-1 1h1v-48c0-.3-.1-.5-.3-.7-.2-.2-.4-.3-.7-.3h-42c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7v48c0 .3.1.5.3.7.2.2.4.3.7.3h42c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7h-1z"/><path id="XMLID_13_" class="st1" d="M446.7 291.3c-.2-.2-.4-.3-.7-.3h-42c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7v48c0 .3.1.5.3.7s.4.3.7.3h42c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7v-48c0-.3-.1-.5-.3-.7zM445 339h-36.5l24.8-24.8c.2-.2.4-.3.7-.3.3 0 .5.1.7.3l10.3 10.3V339zm-40 0v-8.6l8.3-8.3c.2-.2.4-.3.7-.3.3 0 .5.1.7.3l4 4-13 13h-.7zm40-46v28.7l-8.9-8.9c-.6-.6-1.4-.9-2.1-.9-.8 0-1.5.3-2.1.9l-11.8 11.8-4-4c-.6-.6-1.4-.9-2.1-.9-.8 0-1.5.3-2.1.9l-6.9 6.9V293h40z"/><path id="XMLID_121_" class="st1" d="M417 302h-1c0 1.7-1.3 3-3 3s-3-1.3-3-3 1.3-3 3-3 3 1.3 3 3h2c0-2.8-2.2-5-5-5s-5 2.2-5 5 2.2 5 5 5 5-2.2 5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4-1.3 0-2.5-.5-3.4-1.4zM146 450c1.7 0 3 1.3 3 3v1h-46v-1c0-1.7 1.3-3 3-3h40zm-17.7-2h-3.4l-29-50.3c1-.2 2-.6 2.8-1.1l29.6 51.4zm-29.1-62.1c-.8-.7-1.7-1.1-2.7-1.4l37.5-43.2 2.1 2.1-36.9 42.5zm35.5-46.7c-.7-.7-1-1.6-1-2.5 0-.9.3-1.8 1-2.5l1.8-1.8c.7-.7 1.6-1 2.5-1 .9 0 1.8.3 2.5 1l4.3 4.3-6.8 6.8-4.3-4.3zm4.1 7.3l10-10c.4-.4 1-.6 1.6-.6.5 0 .9.1 1.3.4l-13.1 13.1c-.3-.4-.4-.8-.4-1.3 0-.6.2-1.1.6-1.6zm25.5 15.4c-1.3 1.3-3 2-4.8 2-.7 0-1.5-.1-2.2-.4l8.5-8.5c.2.7.4 1.5.4 2.2 0 1.7-.6 3.4-1.9 4.7zm-19.9 11.7c-3.8-4.2-5.9-9.4-5.9-14.7 0-2.7.5-5.4 1.4-8l13.4-13.4c2.6-.9 5.3-1.4 8-1.4 5.3 0 10.5 2 14.7 5.9l-31.6 31.6z"/></g></g><path id="XMLID_135_" class="st2" d="M508 458H72c-1.1 0-2-.9-2-2s.9-2 2-2h436c1.1 0 2 .9 2 2s-.9 2-2 2z"/><g id="XMLID_9_"><path id="XMLID_16_" class="st3" d="M309.2 437h-38.4l-6.4 17h51.2l-6.4-17"/><path id="XMLID_22_" class="st2" d="M317 455v-1 1l.9-.4-.9.4m-7.6-23h-1.1l1.9 5h-1.1l6.4 17h-51.1l6.4-17h-1.1l1.9-5h-1.1l-8.5 22.6c-.1.3-.1.7.1.9s.5.4.8.4h54c.3 0 .6-.2.8-.4.2-.3.2-.6.1-.9l-8.4-22.6"/><path id="XMLID_28_" fill="#bdc6d3" d="M307.3 432h-34.6l-1.9 5h38.4l-1.9-5"/><path id="XMLID_44_" class="st5" d="M272.7 432h-1.1l-1.9 5h1.1l1.9-5m35.7 0h-1.1l1.9 5h1.1l-1.9-5"/><path id="XMLID_46_" class="st2" d="M317 455v-1h-52.6l8.3-22h34.6l8.8 23.4.9-.4v-1 1l.9-.4-9-24c-.1-.4-.5-.6-.9-.6h-36c-.4 0-.8.3-.9.6l-9 24c-.1.3-.1.7.1.9s.5.4.8.4h54c.3 0 .6-.2.8-.4.2-.3.2-.6.1-.9l-.9.4z"/><path id="XMLID_49_" class="st3" d="M331 451h-82c-2.2 0-4 1.8-4 4h90c0-2.2-1.8-4-4-4z"/><path id="XMLID_30_" class="st2" d="M331 450h-82c-2.8 0-5 2.2-5 5 0 .3.1.5.3.7s.4.3.7.3h90c.3 0 .5-.1.7-.3s.3-.4.3-.7c0-2.8-2.2-5-5-5zm-82 2h82c1.3 0 2.4.8 2.8 2h-87.6c.4-1.2 1.5-2 2.8-2z"/><path id="XMLID_51_" class="st3" d="M375 416H205v7c0 1.9.8 3.7 2.1 4.9 1.3 1.3 3 2 4.9 2.1h156c1.9 0 3.7-.8 4.9-2.1 1.3-1.3 2-3 2.1-4.9h1-1v-7"/><path id="XMLID_54_" class="st2" d="M368 308H212c-5 0-9 4-9 9v106c0 5 4 9 9 9h156c5 0 9-4 9-9h-2c0 1.9-.8 3.7-2.1 4.9-1.3 1.3-3 2-4.9 2.1H212c-1.9 0-3.7-.8-4.9-2.1-1.3-1.3-2-3-2.1-4.9v-7h-1v-99.5c0-4.1 3.4-7.5 7.5-7.5H368c4.4 0 8 3.6 8 8v99h-1v7h2V317c0-5-4-9-9-9"/><path id="XMLID_64_" class="st6" d="M213 345c0 2.4-.7 4.5-2 6.3V408h15v-52.2c-.6.1-1.3.2-2 .2-6.1 0-11-4.9-11-11m22 0c0 .7-.1 1.4-.2 2h.4c-.1-.6-.2-1.3-.2-2m22 0c0 .7-.1 1.4-.2 2h.4c-.1-.6-.2-1.3-.2-2m44 0c0 .7-.1 1.4-.2 2h.4c-.1-.6-.2-1.3-.2-2m22 0c0 .7-.1 1.4-.2 2h.4c-.1-.6-.2-1.3-.2-2m22 0c0 .7-.1 1.4-.2 2h.4c-.1-.6-.2-1.3-.2-2m22 0c0 6.1-4.9 11-11 11-1 0-2-.1-3-.4V391c0 .3-.1.5-.3.7-.2.2-.4.3-.7.3h2c.6 0 1 .4 1 1v4c0 .6-.4 1-1 1h-74c-.6 0-1-.4-1-1v-4c0-.6.4-1 1-1h2c-.3 0-.5-.1-.7-.3-.2-.2-.3-.4-.3-.7v-39.7c-1.3-1.8-2-4-2-6.3 0 6.1-4.9 11-11 11-.7 0-1.4-.1-2-.2V408h103v-56.7c-1.3-1.8-2-3.9-2-6.3m2-29H211v6.1l3.3-1.1H365.7l3.3 1.1V316"/><g id="XMLID_12_"><path id="XMLID_27_" class="st2" d="M368 309H211.5c-4.1 0-7.5 3.4-7.5 7.5v8l5-1.7 2-.7V316h158v6.1l2 .7 5 1.7V317c0-4.4-3.6-8-8-8z"/><path id="XMLID_32_" class="st2" d="M369 351.3V408H266v1c0 .3-.1.5-.3.7-.2.2-.4.3-.7.3h-38c-.3 0-.5-.1-.7-.3-.2-.2-.3-.4-.3-.7v-1h-15v-56.7c-.6.8-1.2 1.5-2 2.2-1.4 1.2-3.1 2-5 2.3V416h172v-60.2c-1.9-.3-3.6-1.2-5-2.3-.8-.6-1.4-1.4-2-2.2z"/></g><circle id="XMLID_69_" class="st2" cx="290" cy="423" r="4"/><path id="XMLID_73_" class="st7" d="M262 354.2V390c0 .3-.1.5-.3.7-.2.2-.4.3-.7.3h-30c-.3 0-.5-.1-.7-.3-.2-.2-.3-.4-.3-.7v-35.8c-.6.4-1.3.8-2 1V408h36v-52.7c-.7-.3-1.4-.7-2-1.1m-26.3-5.2h-1.5c-.3.7-.6 1.4-1 2h3.6c-.4-.6-.8-1.3-1.1-2m22 0h-1.5c-.3.7-.6 1.4-1 2h3.6c-.4-.6-.8-1.3-1.1-2"/><path id="XMLID_79_" class="st2" d="M227 409h1-1m37-53.7V408h-36v-52.7c-.6.2-1.3.4-2 .6V409c0 .3.1.5.3.7.2.2.4.3.7.3h38c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7v-53.2c-.7-.1-1.4-.3-2-.5m-28.8-8.3h-.4c-.1.7-.3 1.4-.6 2h1.5c-.2-.6-.4-1.3-.5-2m22 0h-.4c-.1.7-.3 1.4-.6 2h1.5c-.2-.6-.4-1.3-.5-2"/><path id="XMLID_80_" class="st7" d="M231 394h30v11h-30z"/><path id="XMLID_81_" class="st2" d="M231 405v1h30c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7v-11c0-.3-.1-.5-.3-.7-.2-.2-.4-.3-.7-.3h-30c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7v11c0 .3.1.5.3.7.2.2.4.3.7.3v-1h1v-10h28v9h-29v1h1-1z"/><path id="XMLID_91_" class="st8" d="M239.3 353.7l20.4 35.3h.4v-8l-14.4-25c-2.5-.1-4.7-.9-6.4-2.3m-5.4-.7H232v17.6l10.6 18.4h12l-20.7-36m-1.9 17.6V389h10.6L232 370.6m6.5-17.6h-4.6l20.8 36h5l-20.4-35.3c-.3-.2-.6-.5-.8-.7m21.5 0h-6.5c-2 1.9-4.6 3-7.5 3h-.4l14.4 25v-28"/><path id="XMLID_94_" class="st2" d="M260 381v8-8m-30-26.8V390c0 .3.1.5.3.7.2.2.4.3.7.3h30c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7 0 .3-.1.5-.3.7-.2.2-.4.3-.7.3h-30c-.3 0-.5-.1-.7-.3-.2-.2-.3-.4-.3-.7v-35.8"/><g id="XMLID_101_"><defs><path id="XMLID_97_" d="M231 390h30v-38h-30v38"/></defs><clipPath id="XMLID_107_"><use xlink:href="#XMLID_97_" overflow="visible"/></clipPath><path id="XMLID_111_" class="st9" d="M233.9 353H232v17.6l10.6 18.4h12l-20.7-36"/><path id="XMLID_136_" class="st9" d="M260 381v8-8m-20.7-27.3l20.4 35.3h.4v-8l-14.4-25c-2.5-.1-4.7-.9-6.4-2.3"/></g><path id="XMLID_158_" class="st2" d="M231 390h1-1m27.8-39h-3.6c-.5.7-1 1.4-1.7 2h6.5v36h-28v-36h6.5c-.6-.6-1.2-1.3-1.7-2h-3.6c-.8 1.3-1.9 2.4-3.2 3.2V390c0 .3.1.5.3.7.2.2.4.3.7.3h30c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7v-35.8c-1.3-.8-2.4-1.9-3.2-3.2"/><path id="XMLID_168_" class="st8" d="M333 384.2v5.8h3v-.6l-3-5.2m-16.8-29c-1.3.5-2.7.8-4.2.8-.5 0-.9 0-1.3-.1L320 372h5.1v6h-1.6 6l-13.3-22.8m-33.2-1.7V390h22v-6h1.9l-16.2-28h-.7c-2.7 0-5.1-.9-7-2.5m62.7-4.5h-1.5c-1.6 4.1-5.6 7-10.3 7-4.7 0-8.6-2.9-10.3-7h-1.1l15.6 27h9.7v14h3v-35.2c-2.2-1.2-4.1-3.3-5.1-5.8"/><g id="XMLID_179_"><defs><path id="XMLID_170_" d="M282 391h70v-43h-70v43"/></defs><clipPath id="XMLID_112_"><use xlink:href="#XMLID_170_" overflow="visible"/></clipPath><path id="XMLID_180_" class="st10" d="M286 376h16v14h-16z"/><path id="XMLID_188_" class="st10" d="M336 389.4v.6h.3l-.3-.6m12-13.4h-9.7l8.1 14h1.7v-14"/><path id="XMLID_191_" class="st10" d="M306.9 384H305v6h5.3l-3.4-6m26 0h-6l3.5 6h2.7v-5.8l-.2-.2"/><path id="XMLID_204_" class="st10" d="M329.4 378h-6l3.5 6h6l-3.5-6"/><path id="XMLID_205_" class="st10" d="M325 372h-5.1l3.5 6h1.6v-6"/><path id="XMLID_206_" class="st11" d="M301.7 349h-1.5c-1.5 3.9-5.2 6.7-9.6 7l16.2 28h20H313v-6h10.4H313v-6h6.9l-9.3-16.1c-4-.5-7.4-3.2-8.9-6.9"/><path id="XMLID_6_" class="st12" d="M326.9 384l-3.5-6-3.5-6H313v12h-6.1l3.4 6h20z"/><path id="XMLID_212_" class="st11" d="M322.7 349h-.4c-1.1 2.8-3.3 5-6 6.2l13.2 22.8h3.6v6h-.1.1v.2l3 5.2V376h2.3l-15.7-27"/><path id="XMLID_213_" class="st12" d="M338.3 376H336v13.4l.3.6h10l-8-14"/><path id="XMLID_214_" class="st12" d="M333 384h-.1l.1.2v-.2"/><path id="XMLID_215_" class="st12" d="M333 378h-3.6l3.5 6h.1v-6"/></g><path id="XMLID_227_" class="st2" d="M282 391h1-1m-1-39.7V391c0 .3.1.5.3.7.2.2.4.3.7.3h70c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7v-35.4c-.7-.2-1.4-.5-2-.8V390h-68v-36.5c-.8-.6-1.4-1.4-2-2.2m20.2-4.3h-.4c-.1.7-.3 1.4-.6 2h1.5c-.2-.6-.4-1.3-.5-2m22 0h-.4c-.1.7-.3 1.4-.6 2h1.5c-.2-.6-.4-1.3-.5-2m22 0h-.4c-.1.7-.3 1.4-.6 2h1.5c-.2-.6-.4-1.3-.5-2"/><path id="XMLID_232_" class="st13" d="M354 392h-74c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h74c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1"/><path id="XMLID_233_" class="st7" d="M278 390h78v5h-78z"/><path id="XMLID_48_" class="st2" d="M356.7 389.3c-.2-.2-.4-.3-.7-.3h-78c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7v5c0 .3.1.5.3.7s.4.3.7.3h78c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7v-5c0-.3-.1-.5-.3-.7zM355 394h-76v-3h76v3z"/><path id="XMLID_235_" class="st14" d="M228 374h6v8h-6z"/><path id="XMLID_40_" class="st2" d="M234.7 373.3c-.2-.2-.4-.3-.7-.3h-6c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7v8c0 .3.1.5.3.7s.4.3.7.3h6c.3 0 .5-.1.7-.3s.3-.4.3-.7v-8c0-.3-.1-.5-.3-.7zM229 375h4v6h-4v-6z"/><path id="XMLID_239_" class="st5" d="M209 322.8l-5 1.7v31.3c1.9-.3 3.6-1.2 5-2.3v-30.7m162 0v30.7c1.4 1.2 3.1 2 5 2.3v-31.3l-5-1.7"/><path id="XMLID_240_" class="st13" d="M365.7 321H214.3l-3.3 1.1v29.2c1.3-1.8 2-4 2-6.3 0 6.1 4.9 11 11 11 .7 0 1.4-.1 2-.2V348c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h7.8c.1-.6.2-1.3.2-2 0 .7.1 1.4.2 2h21.6c.1-.6.2-1.3.2-2 0 .7.1 1.4.2 2h7.8c.3 0 .5.1.7.3.2.2.3.4.3.7v7.8c.6.1 1.3.2 2 .2 6.1 0 11-4.9 11-11 0 2.4.7 4.5 2 6.3V348c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h18.8c.1-.6.2-1.3.2-2 0 .7.1 1.4.2 2h21.6c.1-.6.2-1.3.2-2 0 .7.1 1.4.2 2h21.6c.1-.6.2-1.3.2-2 0 .7.1 1.4.2 2h6.8c.3 0 .5.1.7.3.2.2.3.4.3.7v7.6c1 .3 2 .4 3 .4 6.1 0 11-4.9 11-11 0 2.4.7 4.5 2 6.3v-29.2l-3.3-1.1"/><path id="XMLID_243_" class="st5" d="M369 322.1v29.2c.6.8 1.2 1.5 2 2.2v-30.7l-2-.7m-158 0l-2 .7v30.7c.8-.6 1.4-1.4 2-2.2v-29.2"/><path id="XMLID_247_" d="M234.3 349H228v6.3c.7-.3 1.4-.6 2-1V352c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2.2c.4-.6.8-1.3 1.1-2m22 0h-20.5c.3.7.6 1.4 1 2h18.4c.4-.6.8-1.3 1.1-2m7.7 0h-6.3c.3.7.6 1.4 1 2h2.2c.3 0 .5.1.7.3.2.2.3.4.3.7v2.2c.6.4 1.3.8 2 1V349" fill="#8d775a"/><path id="XMLID_252_" class="st5" d="M234.8 347H227c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7v7.8c.7-.1 1.4-.3 2-.6V349h6.3c.2-.6.4-1.3.5-2m22 0h-21.6c.1.7.3 1.4.6 2h20.5c.2-.6.4-1.3.5-2m8.2 0h-7.8c.1.7.3 1.4.6 2h6.3v6.3c.6.2 1.3.4 2 .6V348c0-.3-.1-.5-.3-.7-.3-.2-.5-.3-.8-.3"/><path id="XMLID_255_" class="st16" d="M238.9 353h-.4c.3.2.5.5.8.7l-.4-.7m14.6 0h-9.7l1.7 3h.4c3 0 5.7-1.1 7.6-3"/><path id="XMLID_256_" class="st17" d="M243.9 353h-5l.4.7c1.8 1.4 3.9 2.2 6.3 2.3l-1.7-3"/><path id="XMLID_260_" class="st5" d="M233.2 351H231c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7v2.2c1.3-.8 2.4-1.9 3.2-3.2m22 0h-18.4c.5.7 1 1.4 1.7 2h15.1c.6-.6 1.1-1.3 1.6-2m5.8 0h-2.2c.8 1.3 1.9 2.4 3.2 3.2V352c0-.3-.1-.5-.3-.7-.2-.2-.4-.3-.7-.3"/><path id="XMLID_261_" class="st16" d="M351 349h-5.3c1 2.5 2.9 4.6 5.3 5.8V349"/><path id="XMLID_262_" class="st16" d="M344.3 349h-20.5c1.6 4.1 5.6 7 10.3 7 4.6 0 8.5-2.9 10.2-7"/><path id="XMLID_263_" class="st16" d="M312.7 349h-6l4 6.9c.4.1.9.1 1.3.1 1.5 0 2.9-.3 4.2-.8l-3.5-6.2"/><path id="XMLID_264_" class="st17" d="M306.7 349h-4.9c1.4 3.7 4.8 6.4 8.9 6.9l-4-6.9"/><path id="XMLID_265_" class="st17" d="M322.3 349h-9.6l3.6 6.2c2.7-1.2 4.9-3.4 6-6.2"/><path id="XMLID_266_" class="st16" d="M286.7 349H283v4.5c1.9 1.6 4.3 2.5 7 2.5h.7l-4-7"/><path id="XMLID_267_" class="st17" d="M300.3 349h-13.6l4 7c4.4-.3 8-3.1 9.6-7"/><path id="XMLID_273_" class="st5" d="M300.8 347H282c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7v3.3c.6.8 1.2 1.5 2 2.2V349h17.3c.2-.6.4-1.3.5-2m22 0h-21.6c.1.7.3 1.4.6 2h20.5c.2-.6.4-1.3.5-2m22 0h-21.6c.1.7.3 1.4.6 2h20.5c.2-.6.4-1.3.5-2m7.2 0h-6.8c.1.7.3 1.4.6 2h5.3v5.8c.6.3 1.3.6 2 .8V348c0-.3-.1-.5-.3-.7-.3-.2-.5-.3-.8-.3"/><g id="XMLID_2_"><circle id="XMLID_274_" class="st18" cx="202" cy="339" r="11"/><path id="XMLID_276_" class="st0" d="M191 323h22v16h-22z"/><circle id="XMLID_278_" class="st14" cx="224" cy="339" r="11"/><path id="XMLID_282_" class="st19" d="M213 323h22v16h-22z"/><circle id="XMLID_285_" class="st18" cx="246" cy="339" r="11"/><path id="XMLID_289_" class="st0" d="M235 323h22v16h-22z"/><circle id="XMLID_292_" class="st14" cx="268" cy="339" r="11"/><path id="XMLID_294_" class="st19" d="M257 323h22v16h-22z"/><circle id="XMLID_296_" class="st18" cx="290" cy="339" r="11"/><path id="XMLID_298_" class="st0" d="M279 323h22v16h-22z"/><path id="XMLID_301_" class="st20" d="M231 315h-16.7l-23.3 8h22z"/><path id="XMLID_303_" class="st6" d="M247.9 315H231l-18 8h22z"/><path id="XMLID_305_" class="st20" d="M264.8 315h-16.9l-12.9 8h22z"/><path id="XMLID_307_" class="st6" d="M282 315h-17.2l-7.8 8h22z"/><circle id="XMLID_309_" class="st18" cx="378" cy="339" r="11"/><path id="XMLID_311_" class="st0" d="M367 323h22v16h-22z"/><circle id="XMLID_313_" class="st14" cx="356" cy="339" r="11"/><path id="XMLID_315_" class="st19" d="M345 323h22v16h-22z"/><circle id="XMLID_317_" class="st18" cx="334" cy="339" r="11"/><path id="XMLID_319_" class="st0" d="M323 323h22v16h-22z"/><circle id="XMLID_321_" class="st14" cx="312" cy="339" r="11"/><path id="XMLID_323_" class="st19" d="M301 323h22v16h-22z"/><path id="XMLID_325_" class="st20" d="M349 315h16.7l23.3 8h-22z"/><path id="XMLID_330_" class="st6" d="M332.1 315H349l18 8h-22z"/><path id="XMLID_333_" class="st20" d="M315.2 315h16.9l12.9 8h-22z"/><path id="XMLID_335_" class="st6" d="M298 315h17.2l7.8 8h-22z"/><path id="XMLID_337_" class="st20" d="M298.2 315H282l-3 8h22z"/><path id="XMLID_65_" class="st2" d="M390 322.9v-.2s0-.1-.1-.1c0-.1-.1-.1-.1-.2 0 0 0-.1-.1-.1-.1-.1-.1-.1-.2-.1 0 0-.1 0-.1-.1l-23.3-8c-.1 0-.2-.1-.3-.1H214.3c-.1 0-.2 0-.3.1l-23.3 8s-.1 0-.1.1c-.1 0-.1.1-.2.1 0 0 0 .1-.1.1 0 .1-.1.1-.1.2 0 0 0 .1-.1.1V339c0 6.6 5.4 12 12 12 4.9 0 9.2-3 11-7.2 1.8 4.2 6.1 7.2 11 7.2s9.2-3 11-7.2c1.8 4.2 6.1 7.2 11 7.2s9.2-3 11-7.2c1.8 4.2 6.1 7.2 11 7.2s9.2-3 11-7.2c1.8 4.2 6.1 7.2 11 7.2s9.2-3 11-7.2c1.8 4.2 6.1 7.2 11 7.2s9.2-3 11-7.2c1.8 4.2 6.1 7.2 11 7.2s9.2-3 11-7.2c1.8 4.2 6.1 7.2 11 7.2s9.2-3 11-7.2c1.8 4.2 6.1 7.2 11 7.2 6.6 0 12-5.4 12-12l-.1-16.1c0 .1 0 0 0 0zM214 338v-14h20v14h-20zm22 0v-14h20v14h-20zm22 0v-14h20v14h-20zm22 0v-14h20v14h-20zm22 0v-14h20v14h-20zm22 0v-14h20v14h-20zm22 0v-14h20v14h-20zm19.5-22l17.5 6h-15.8l-13.5-6h11.8zm22.5 8v14h-20v-14h20zm-39.2-8l13.5 6h-17l-9.7-6h13.2zm-17 0l9.7 6h-18.1l-5.8-6h14.2zm-17 0l5.8 6h-18.9l-2.1-6h15.2zm-32.1 0h14.6l2.2 6h-19.1l2.3-6zm-17.5 0h15.4l-2.2 6h-18.9l5.7-6zm-17 0h14.2l-5.8 6h-18.1l9.7-6zm-17 0h13.2l-9.7 6h-17l13.5-6zm-16.7 0h11.8l-13.5 6H197l17.5-6zm-22.5 8h20v14h-20v-14zm17.1 22.1c-1.8 1.8-4.3 2.9-7.1 2.9s-5.3-1.1-7.1-2.9c-1.6-1.6-2.6-3.7-2.9-6.1h19.9c-.2 2.4-1.2 4.5-2.8 6.1zm22 0c-1.8 1.8-4.3 2.9-7.1 2.9s-5.3-1.1-7.1-2.9c-1.6-1.6-2.6-3.7-2.9-6.1h19.9c-.2 2.4-1.2 4.5-2.8 6.1zm22 0c-1.8 1.8-4.3 2.9-7.1 2.9s-5.3-1.1-7.1-2.9c-1.6-1.6-2.6-3.7-2.9-6.1h19.9c-.2 2.4-1.2 4.5-2.8 6.1zm22 0c-1.8 1.8-4.3 2.9-7.1 2.9s-5.3-1.1-7.1-2.9c-1.6-1.6-2.6-3.7-2.9-6.1h19.9c-.2 2.4-1.2 4.5-2.8 6.1zm22 0c-1.8 1.8-4.3 2.9-7.1 2.9s-5.3-1.1-7.1-2.9c-1.6-1.6-2.6-3.7-2.9-6.1h19.9c-.2 2.4-1.2 4.5-2.8 6.1zm22 0c-1.8 1.8-4.3 2.9-7.1 2.9s-5.3-1.1-7.1-2.9c-1.6-1.6-2.6-3.7-2.9-6.1h19.9c-.2 2.4-1.2 4.5-2.8 6.1zm22 0c-1.8 1.8-4.3 2.9-7.1 2.9s-5.3-1.1-7.1-2.9c-1.6-1.6-2.6-3.7-2.9-6.1h19.9c-.2 2.4-1.2 4.5-2.8 6.1zm22 0c-1.8 1.8-4.3 2.9-7.1 2.9s-5.3-1.1-7.1-2.9c-1.6-1.6-2.6-3.7-2.9-6.1h19.9c-.2 2.4-1.2 4.5-2.8 6.1zm22 0c-1.8 1.8-4.3 2.9-7.1 2.9s-5.3-1.1-7.1-2.9c-1.6-1.6-2.6-3.7-2.9-6.1h19.9c-.2 2.4-1.2 4.5-2.8 6.1z"/></g></g></g></svg>
41
+ <h2>You have successfully authenticated for theme</h2>
42
+ <p>
43
+ You will be redirected to <a href="https://shoperb.dev">shoperb.dev</a> in <span id="timeLeft">30</span> seconds.
44
+ </p>
45
+ </div>
46
+ <script type="text/javascript" charset="utf-8">
47
+ let time = 30
48
+ const timeLeft = document.getElementById('timeLeft')
49
+ setTimeout(function(){window.location.href="https://shoperb.dev"}, 30000)
50
+ setInterval(function(){time -=1; timeLeft.innerText=time.toString()}, 1000)
51
+ </script>
52
+ </body>
53
+ </html>