shopify_app 7.2.0 → 17.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.babelrc +5 -0
- data/.github/CODEOWNERS +1 -0
- data/.github/ISSUE_TEMPLATE/bug-report.md +63 -0
- data/.github/ISSUE_TEMPLATE/config.yml +1 -0
- data/.github/ISSUE_TEMPLATE/feature-request.md +33 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +22 -0
- data/.github/probots.yml +2 -0
- data/.github/workflows/build.yml +38 -0
- data/.github/workflows/release.yml +24 -0
- data/.github/workflows/rubocop.yml +22 -0
- data/.gitignore +4 -1
- data/.nvmrc +1 -0
- data/.rubocop.yml +18 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +465 -0
- data/CONTRIBUTING.md +76 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +256 -0
- data/README.md +73 -288
- data/Rakefile +1 -0
- data/SECURITY.md +59 -0
- data/app/assets/images/storage_access.svg +1 -0
- data/app/assets/javascripts/shopify_app/enable_cookies.js +3 -0
- data/app/assets/javascripts/shopify_app/itp_helper.js +40 -0
- data/app/assets/javascripts/shopify_app/partition_cookies.js +8 -0
- data/app/assets/javascripts/shopify_app/redirect.js +33 -0
- data/app/assets/javascripts/shopify_app/request_storage_access.js +3 -0
- data/app/assets/javascripts/shopify_app/storage_access.js +154 -0
- data/app/assets/javascripts/shopify_app/storage_access_redirect.js +17 -0
- data/app/assets/javascripts/shopify_app/top_level.js +2 -0
- data/app/assets/javascripts/shopify_app/top_level_interaction.js +11 -0
- data/app/controllers/concerns/shopify_app/authenticated.rb +16 -0
- data/app/controllers/concerns/shopify_app/ensure_authenticated_links.rb +26 -0
- data/app/controllers/concerns/shopify_app/require_known_shop.rb +39 -0
- data/app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb +32 -0
- data/app/controllers/shopify_app/authenticated_controller.rb +5 -5
- data/app/controllers/shopify_app/callback_controller.rb +196 -0
- data/app/controllers/shopify_app/extension_verification_controller.rb +15 -0
- data/app/controllers/shopify_app/sessions_controller.rb +190 -2
- data/app/controllers/shopify_app/webhooks_controller.rb +16 -7
- data/app/views/shopify_app/partials/_button_styles.html.erb +109 -0
- data/app/views/shopify_app/partials/_card_styles.html.erb +33 -0
- data/app/views/shopify_app/partials/_empty_state_styles.html.erb +98 -0
- data/app/views/shopify_app/partials/_form_styles.html.erb +56 -0
- data/app/views/shopify_app/partials/_layout_styles.html.erb +182 -0
- data/app/views/shopify_app/partials/_typography_styles.html.erb +35 -0
- data/app/views/shopify_app/sessions/enable_cookies.html.erb +70 -0
- data/app/views/shopify_app/sessions/new.html.erb +39 -83
- data/app/views/shopify_app/sessions/request_storage_access.html.erb +68 -0
- data/app/views/shopify_app/sessions/top_level_interaction.html.erb +63 -0
- data/app/views/shopify_app/shared/redirect.html.erb +23 -0
- data/config/locales/cs.yml +23 -0
- data/config/locales/da.yml +20 -0
- data/config/locales/de.yml +22 -0
- data/config/locales/en.yml +12 -1
- data/config/locales/es.yml +21 -3
- data/config/locales/fi.yml +20 -0
- data/config/locales/fr.yml +23 -0
- data/config/locales/hi.yml +23 -0
- data/config/locales/it.yml +21 -0
- data/config/locales/ja.yml +17 -0
- data/config/locales/ko.yml +19 -0
- data/config/locales/ms.yml +22 -0
- data/config/locales/nb.yml +21 -0
- data/config/locales/nl.yml +21 -0
- data/config/locales/pl.yml +21 -0
- data/config/locales/pt-BR.yml +21 -0
- data/config/locales/pt-PT.yml +22 -0
- data/config/locales/sv.yml +21 -0
- data/config/locales/th.yml +20 -0
- data/config/locales/tr.yml +22 -0
- data/config/locales/vi.yml +22 -0
- data/config/locales/zh-CN.yml +16 -0
- data/config/locales/zh-TW.yml +16 -0
- data/config/routes.rb +12 -1
- data/docs/Quickstart.md +31 -0
- data/docs/Releasing.md +21 -0
- data/docs/Troubleshooting.md +16 -0
- data/docs/Upgrading.md +110 -0
- data/docs/shopify_app/authentication.md +124 -0
- data/docs/shopify_app/engine.md +82 -0
- data/docs/shopify_app/generators.md +127 -0
- data/docs/shopify_app/handling-access-scopes-changes.md +8 -0
- data/docs/shopify_app/script-tags.md +28 -0
- data/docs/shopify_app/session-repository.md +88 -0
- data/docs/shopify_app/testing.md +38 -0
- data/docs/shopify_app/webhooks.md +72 -0
- data/karma.conf.js +44 -0
- data/lib/generators/shopify_app/add_after_authenticate_job/add_after_authenticate_job_generator.rb +47 -0
- data/lib/generators/shopify_app/add_after_authenticate_job/templates/after_authenticate_job.rb +11 -0
- data/lib/generators/shopify_app/add_marketing_activity_extension/add_marketing_activity_extension_generator.rb +40 -0
- data/lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb +62 -0
- data/lib/generators/shopify_app/add_webhook/add_webhook_generator.rb +5 -4
- data/lib/generators/shopify_app/add_webhook/templates/{webhook_job.rb → webhook_job.rb.tt} +5 -0
- data/lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb +4 -3
- data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_controller.rb +3 -3
- data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_route.rb +10 -9
- data/lib/generators/shopify_app/app_proxy_controller/templates/index.html.erb +2 -2
- data/lib/generators/shopify_app/authenticated_controller/authenticated_controller_generator.rb +15 -0
- data/lib/generators/shopify_app/authenticated_controller/templates/authenticated_controller.rb +5 -0
- data/lib/generators/shopify_app/controllers/controllers_generator.rb +2 -1
- data/lib/generators/shopify_app/home_controller/home_controller_generator.rb +31 -9
- data/lib/generators/shopify_app/home_controller/templates/home_controller.rb +6 -1
- data/lib/generators/shopify_app/home_controller/templates/index.html.erb +70 -6
- data/lib/generators/shopify_app/home_controller/templates/unauthenticated_home_controller.rb +11 -0
- data/lib/generators/shopify_app/install/install_generator.rb +78 -27
- data/lib/generators/shopify_app/install/templates/_flash_messages.html.erb +1 -13
- data/lib/generators/shopify_app/install/templates/embedded_app.html.erb +12 -11
- data/lib/generators/shopify_app/install/templates/flash_messages.js +24 -0
- data/lib/generators/shopify_app/install/templates/omniauth.rb +3 -1
- data/lib/generators/shopify_app/install/templates/session_store.rb +4 -0
- data/lib/generators/shopify_app/install/templates/shopify_app.js +15 -0
- data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +25 -0
- data/lib/generators/shopify_app/install/templates/shopify_app_index.js +2 -0
- data/lib/generators/shopify_app/install/templates/shopify_provider.rb.tt +8 -0
- data/lib/generators/shopify_app/install/templates/user_agent.rb +6 -0
- data/lib/generators/shopify_app/products_controller/products_controller_generator.rb +19 -0
- data/lib/generators/shopify_app/products_controller/templates/products_controller.rb +8 -0
- data/lib/generators/shopify_app/rotate_shopify_token_job/rotate_shopify_token_job_generator.rb +16 -0
- data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token.rake +17 -0
- data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token_job.rb +42 -0
- data/lib/generators/shopify_app/routes/routes_generator.rb +1 -0
- data/lib/generators/shopify_app/routes/templates/routes.rb +10 -9
- data/lib/generators/shopify_app/shop_model/shop_model_generator.rb +42 -14
- data/lib/generators/shopify_app/shop_model/templates/db/migrate/add_shop_access_scopes_column.erb +5 -0
- data/lib/generators/shopify_app/shop_model/templates/db/migrate/{create_shops.rb → create_shops.erb} +1 -1
- data/lib/generators/shopify_app/shop_model/templates/shop.rb +6 -2
- data/lib/generators/shopify_app/shopify_app_generator.rb +5 -3
- data/lib/generators/shopify_app/user_model/templates/db/migrate/add_user_access_scopes_column.erb +5 -0
- data/lib/generators/shopify_app/user_model/templates/db/migrate/create_users.erb +16 -0
- data/lib/generators/shopify_app/user_model/templates/user.rb +8 -0
- data/lib/generators/shopify_app/user_model/templates/users.yml +4 -0
- data/lib/generators/shopify_app/user_model/user_model_generator.rb +70 -0
- data/lib/generators/shopify_app/views/views_generator.rb +2 -1
- data/lib/shopify_app/access_scopes/noop_strategy.rb +13 -0
- data/lib/shopify_app/access_scopes/shop_strategy.rb +24 -0
- data/lib/shopify_app/access_scopes/user_strategy.rb +41 -0
- data/lib/shopify_app/configuration.rb +69 -5
- data/lib/shopify_app/{app_proxy_verification.rb → controller_concerns/app_proxy_verification.rb} +4 -9
- data/lib/shopify_app/controller_concerns/csrf_protection.rb +15 -0
- data/lib/shopify_app/controller_concerns/embedded_app.rb +20 -0
- data/lib/shopify_app/controller_concerns/itp.rb +45 -0
- data/lib/shopify_app/controller_concerns/localization.rb +23 -0
- data/lib/shopify_app/controller_concerns/login_protection.rb +244 -0
- data/lib/shopify_app/controller_concerns/payload_verification.rb +24 -0
- data/lib/shopify_app/controller_concerns/webhook_verification.rb +23 -0
- data/lib/shopify_app/engine.rb +40 -0
- data/lib/shopify_app/jobs/scripttags_manager_job.rb +16 -0
- data/lib/shopify_app/{webhooks_manager_job.rb → jobs/webhooks_manager_job.rb} +3 -2
- data/lib/shopify_app/{scripttags_manager.rb → managers/scripttags_manager.rb} +25 -8
- data/lib/shopify_app/{webhooks_manager.rb → managers/webhooks_manager.rb} +6 -5
- data/lib/shopify_app/middleware/jwt_middleware.rb +42 -0
- data/lib/shopify_app/middleware/same_site_cookie_middleware.rb +34 -0
- data/lib/shopify_app/omniauth/omniauth_configuration.rb +64 -0
- data/lib/shopify_app/session/in_memory_session_store.rb +31 -0
- data/lib/shopify_app/session/in_memory_shop_session_store.rb +16 -0
- data/lib/shopify_app/session/in_memory_user_session_store.rb +16 -0
- data/lib/shopify_app/session/jwt.rb +63 -0
- data/lib/shopify_app/session/null_user_session_store.rb +22 -0
- data/lib/shopify_app/session/session_repository.rb +56 -0
- data/lib/shopify_app/session/session_storage.rb +20 -0
- data/lib/shopify_app/session/shop_session_storage.rb +42 -0
- data/lib/shopify_app/session/shop_session_storage_with_scopes.rb +58 -0
- data/lib/shopify_app/session/user_session_storage.rb +42 -0
- data/lib/shopify_app/session/user_session_storage_with_scopes.rb +58 -0
- data/lib/shopify_app/test_helpers/all.rb +2 -0
- data/lib/shopify_app/test_helpers/webhook_verification_helper.rb +17 -0
- data/lib/shopify_app/utils.rb +24 -4
- data/lib/shopify_app/version.rb +2 -1
- data/lib/shopify_app.rb +65 -24
- data/package.json +27 -0
- data/service.yml +7 -0
- data/shipit.rubygems.yml +3 -0
- data/shopify_app.gemspec +20 -9
- data/translation.yml +7 -0
- data/webpack.config.js +24 -0
- data/yarn.lock +5215 -0
- metadata +274 -43
- data/.travis.yml +0 -17
- data/Gemfile.rails50 +0 -5
- data/Gemfile.ruby22 +0 -6
- data/Gemfile.ruby22.rails50 +0 -9
- data/ISSUE_TEMPLATE.md +0 -14
- data/QUICKSTART.md +0 -72
- data/RELEASING +0 -13
- data/lib/generators/shopify_app/home_controller/templates/shopify_app_ready_script.html.erb +0 -11
- data/lib/generators/shopify_app/install/templates/shopify_app.rb +0 -9
- data/lib/generators/shopify_app/install/templates/shopify_provider.rb +0 -4
- data/lib/generators/shopify_app/install/templates/shopify_session_repository.rb +0 -23
- data/lib/generators/shopify_app/shop_model/templates/shopify_session_repository.rb +0 -7
- data/lib/shopify_app/in_memory_session_store.rb +0 -25
- data/lib/shopify_app/login_protection.rb +0 -103
- data/lib/shopify_app/scripttags_manager_job.rb +0 -15
- data/lib/shopify_app/session_storage.rb +0 -23
- data/lib/shopify_app/sessions_concern.rb +0 -101
- data/lib/shopify_app/shop.rb +0 -15
- data/lib/shopify_app/shopify_session_repository.rb +0 -34
- data/lib/shopify_app/webhook_verification.rb +0 -39
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ShopifyApp
|
4
|
+
class ExtensionVerificationController < ActionController::Base
|
5
|
+
include ShopifyApp::PayloadVerification
|
6
|
+
protect_from_forgery with: :null_session
|
7
|
+
before_action :verify_request
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def verify_request
|
12
|
+
head(:unauthorized) unless hmac_valid?(request.body.read)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,5 +1,193 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module ShopifyApp
|
2
|
-
class SessionsController <
|
3
|
-
include ShopifyApp::
|
3
|
+
class SessionsController < ActionController::Base
|
4
|
+
include ShopifyApp::LoginProtection
|
5
|
+
|
6
|
+
layout false, only: :new
|
7
|
+
|
8
|
+
after_action only: [:new, :create] do |controller|
|
9
|
+
controller.response.headers.except!('X-Frame-Options')
|
10
|
+
end
|
11
|
+
|
12
|
+
def new
|
13
|
+
authenticate if sanitized_shop_name.present?
|
14
|
+
end
|
15
|
+
|
16
|
+
def create
|
17
|
+
authenticate
|
18
|
+
end
|
19
|
+
|
20
|
+
def enable_cookies
|
21
|
+
return unless validate_shop_presence
|
22
|
+
|
23
|
+
render(:enable_cookies, layout: false, locals: {
|
24
|
+
does_not_have_storage_access_url: top_level_interaction_path(
|
25
|
+
shop: sanitized_shop_name,
|
26
|
+
return_to: params[:return_to]
|
27
|
+
),
|
28
|
+
has_storage_access_url: login_url_with_optional_shop(top_level: true),
|
29
|
+
app_target_url: granted_storage_access_path(
|
30
|
+
shop: sanitized_shop_name,
|
31
|
+
return_to: params[:return_to]
|
32
|
+
),
|
33
|
+
current_shopify_domain: current_shopify_domain,
|
34
|
+
})
|
35
|
+
end
|
36
|
+
|
37
|
+
def top_level_interaction
|
38
|
+
@url = login_url_with_optional_shop(top_level: true)
|
39
|
+
validate_shop_presence
|
40
|
+
end
|
41
|
+
|
42
|
+
def granted_storage_access
|
43
|
+
return unless validate_shop_presence
|
44
|
+
|
45
|
+
session['shopify.granted_storage_access'] = true
|
46
|
+
|
47
|
+
copy_return_to_param_to_session
|
48
|
+
|
49
|
+
redirect_to(return_address_with_params({ shop: @shop }))
|
50
|
+
end
|
51
|
+
|
52
|
+
def destroy
|
53
|
+
reset_session
|
54
|
+
flash[:notice] = I18n.t('.logged_out')
|
55
|
+
redirect_to(login_url_with_optional_shop)
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def authenticate
|
61
|
+
return render_invalid_shop_error unless sanitized_shop_name.present?
|
62
|
+
session['shopify.omniauth_params'] = { shop: sanitized_shop_name }
|
63
|
+
|
64
|
+
copy_return_to_param_to_session
|
65
|
+
|
66
|
+
set_user_tokens_option
|
67
|
+
|
68
|
+
if user_agent_can_partition_cookies
|
69
|
+
authenticate_with_partitioning
|
70
|
+
else
|
71
|
+
authenticate_normally
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def authenticate_normally
|
76
|
+
if request_storage_access?
|
77
|
+
redirect_to_request_storage_access
|
78
|
+
elsif authenticate_in_context?
|
79
|
+
authenticate_in_context
|
80
|
+
else
|
81
|
+
authenticate_at_top_level
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def authenticate_with_partitioning
|
86
|
+
if session['shopify.cookies_persist']
|
87
|
+
clear_top_level_oauth_cookie
|
88
|
+
authenticate_in_context
|
89
|
+
else
|
90
|
+
set_top_level_oauth_cookie
|
91
|
+
enable_cookie_access
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Override shop_session_by_cookie from LoginProtection to bypass allow_cookie_authentication
|
96
|
+
# setting check because session cookies are justified at top level
|
97
|
+
def shop_session_by_cookie
|
98
|
+
return unless session[:shop_id].present?
|
99
|
+
ShopifyApp::SessionRepository.retrieve_shop_session(session[:shop_id])
|
100
|
+
end
|
101
|
+
|
102
|
+
# rubocop:disable Lint/SuppressedException
|
103
|
+
def set_user_tokens_option
|
104
|
+
current_shop_session = shop_session
|
105
|
+
|
106
|
+
if current_shop_session.blank?
|
107
|
+
session[:user_tokens] = false
|
108
|
+
return
|
109
|
+
end
|
110
|
+
|
111
|
+
session[:user_tokens] = ShopifyApp::SessionRepository.user_storage.present?
|
112
|
+
|
113
|
+
ShopifyAPI::Session.temp(
|
114
|
+
domain: current_shop_session.domain,
|
115
|
+
token: current_shop_session.token,
|
116
|
+
api_version: current_shop_session.api_version
|
117
|
+
) do
|
118
|
+
ShopifyAPI::Metafield.find(:token_validity_bogus_check)
|
119
|
+
end
|
120
|
+
rescue ActiveResource::UnauthorizedAccess
|
121
|
+
session[:user_tokens] = false
|
122
|
+
rescue StandardError
|
123
|
+
end
|
124
|
+
# rubocop:enable Lint/SuppressedException
|
125
|
+
|
126
|
+
def validate_shop_presence
|
127
|
+
@shop = sanitized_shop_name
|
128
|
+
unless @shop
|
129
|
+
render_invalid_shop_error
|
130
|
+
return false
|
131
|
+
end
|
132
|
+
|
133
|
+
true
|
134
|
+
end
|
135
|
+
|
136
|
+
def copy_return_to_param_to_session
|
137
|
+
session[:return_to] = RedirectSafely.make_safe(params[:return_to], '/') if params[:return_to]
|
138
|
+
end
|
139
|
+
|
140
|
+
def render_invalid_shop_error
|
141
|
+
flash[:error] = I18n.t('invalid_shop_url')
|
142
|
+
redirect_to(return_address)
|
143
|
+
end
|
144
|
+
|
145
|
+
def enable_cookie_access
|
146
|
+
fullpage_redirect_to(enable_cookies_path(
|
147
|
+
shop: sanitized_shop_name,
|
148
|
+
return_to: session[:return_to]
|
149
|
+
))
|
150
|
+
end
|
151
|
+
|
152
|
+
def authenticate_in_context
|
153
|
+
redirect_to("#{main_app.root_path}auth/shopify")
|
154
|
+
end
|
155
|
+
|
156
|
+
def authenticate_at_top_level
|
157
|
+
fullpage_redirect_to(login_url_with_optional_shop(top_level: true))
|
158
|
+
end
|
159
|
+
|
160
|
+
def authenticate_in_context?
|
161
|
+
return true unless ShopifyApp.configuration.embedded_app?
|
162
|
+
params[:top_level]
|
163
|
+
end
|
164
|
+
|
165
|
+
def request_storage_access?
|
166
|
+
return false unless ShopifyApp.configuration.embedded_app?
|
167
|
+
return false if params[:top_level]
|
168
|
+
return false if user_agent_is_mobile
|
169
|
+
return false if user_agent_is_pos
|
170
|
+
|
171
|
+
!session['shopify.granted_storage_access']
|
172
|
+
end
|
173
|
+
|
174
|
+
def redirect_to_request_storage_access
|
175
|
+
render(
|
176
|
+
:request_storage_access,
|
177
|
+
layout: false,
|
178
|
+
locals: {
|
179
|
+
does_not_have_storage_access_url: top_level_interaction_path(
|
180
|
+
shop: sanitized_shop_name,
|
181
|
+
return_to: session[:return_to]
|
182
|
+
),
|
183
|
+
has_storage_access_url: login_url_with_optional_shop(top_level: true),
|
184
|
+
app_target_url: granted_storage_access_path(
|
185
|
+
shop: sanitized_shop_name,
|
186
|
+
return_to: session[:return_to]
|
187
|
+
),
|
188
|
+
current_shopify_domain: current_shopify_domain,
|
189
|
+
}
|
190
|
+
)
|
191
|
+
end
|
4
192
|
end
|
5
193
|
end
|
@@ -1,14 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module ShopifyApp
|
2
|
-
class
|
3
|
-
include ShopifyApp::WebhookVerification
|
3
|
+
class MissingWebhookJobError < StandardError; end
|
4
4
|
|
5
|
-
|
5
|
+
class WebhooksController < ActionController::Base
|
6
|
+
include ShopifyApp::WebhookVerification
|
6
7
|
|
7
8
|
def receive
|
8
|
-
params.
|
9
|
-
job_args = {shop_domain: shop_domain, webhook: webhook_params.to_h}
|
9
|
+
params.permit!
|
10
|
+
job_args = { shop_domain: shop_domain, webhook: webhook_params.to_h }
|
10
11
|
webhook_job_klass.perform_later(job_args)
|
11
|
-
head
|
12
|
+
head(:ok)
|
12
13
|
end
|
13
14
|
|
14
15
|
private
|
@@ -18,11 +19,19 @@ module ShopifyApp
|
|
18
19
|
end
|
19
20
|
|
20
21
|
def webhook_job_klass
|
21
|
-
|
22
|
+
webhook_job_klass_name.safe_constantize || raise(ShopifyApp::MissingWebhookJobError)
|
23
|
+
end
|
24
|
+
|
25
|
+
def webhook_job_klass_name(type = webhook_type)
|
26
|
+
[webhook_namespace, "#{type}_job"].compact.join('/').classify
|
22
27
|
end
|
23
28
|
|
24
29
|
def webhook_type
|
25
30
|
params[:type]
|
26
31
|
end
|
32
|
+
|
33
|
+
def webhook_namespace
|
34
|
+
ShopifyApp.configuration.webhook_jobs_namespace
|
35
|
+
end
|
27
36
|
end
|
28
37
|
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
<style>
|
2
|
+
.Polaris-Button {
|
3
|
+
position:relative;
|
4
|
+
display:-webkit-inline-box;
|
5
|
+
display:-ms-inline-flexbox;
|
6
|
+
display:inline-flex;
|
7
|
+
-webkit-box-align:center;
|
8
|
+
-ms-flex-align:center;
|
9
|
+
align-items:center;
|
10
|
+
-webkit-box-pack:center;
|
11
|
+
-ms-flex-pack:center;
|
12
|
+
justify-content:center;
|
13
|
+
min-height:3.6rem;
|
14
|
+
min-width:3.6rem;
|
15
|
+
margin:0;
|
16
|
+
padding:0.7rem 1.6rem;
|
17
|
+
background-color:#ffffff;
|
18
|
+
border:1px solid #babfc3;
|
19
|
+
border-top-color: #c9cccf;
|
20
|
+
border-bottom-color: #babfc4;
|
21
|
+
box-shadow:0 1px 0 0 rgba(0, 0, 0, 0.05);
|
22
|
+
border-radius:4px;
|
23
|
+
line-height:1;
|
24
|
+
color:#202223;
|
25
|
+
text-align:center;
|
26
|
+
cursor:pointer;
|
27
|
+
-webkit-user-select:none;
|
28
|
+
-moz-user-select:none;
|
29
|
+
-ms-user-select:none;
|
30
|
+
user-select:none;
|
31
|
+
text-decoration:none;
|
32
|
+
transition-property:background, border, box-shadow;
|
33
|
+
transition-duration:100ms;
|
34
|
+
transition-timing-function:cubic-bezier(0.64, 0, 0.35, 1);
|
35
|
+
}
|
36
|
+
|
37
|
+
.Polaris-Button:hover {
|
38
|
+
background-color:#f6f6f7;
|
39
|
+
}
|
40
|
+
|
41
|
+
.Polaris-Button:focus {
|
42
|
+
outline:0;
|
43
|
+
}
|
44
|
+
|
45
|
+
.Polaris-Button:focus:after {
|
46
|
+
box-shadow:0 0 0 .2rem #448fff;
|
47
|
+
}
|
48
|
+
|
49
|
+
.Polaris-Button:after {
|
50
|
+
content:'';
|
51
|
+
position:absolute;
|
52
|
+
z-index:1;
|
53
|
+
top:-.2rem;
|
54
|
+
right:-.2rem;
|
55
|
+
bottom:-.2rem;
|
56
|
+
left:-.2rem;
|
57
|
+
display:block;
|
58
|
+
pointer-events:none;
|
59
|
+
box-shadow:0 0 0 -.2rem #448fff;
|
60
|
+
transition:box-shadow 100ms cubic-bezier(0.64, 0, 0.35, 1);
|
61
|
+
border-radius:5px;
|
62
|
+
}
|
63
|
+
|
64
|
+
.Polaris-Button:active {
|
65
|
+
background-color:#f1f2f3);
|
66
|
+
}
|
67
|
+
|
68
|
+
.Polaris-Button__Content {
|
69
|
+
font-size:1.4rem;
|
70
|
+
font-weight:500;
|
71
|
+
line-height:1.6rem;
|
72
|
+
text-transform:initial;
|
73
|
+
letter-spacing:initial;
|
74
|
+
position:relative;
|
75
|
+
display:-webkit-box;
|
76
|
+
display:-ms-flexbox;
|
77
|
+
display:flex;
|
78
|
+
-webkit-box-pack:center;
|
79
|
+
-ms-flex-pack:center;
|
80
|
+
justify-content:center;
|
81
|
+
-webkit-box-align:center;
|
82
|
+
-ms-flex-align:center;
|
83
|
+
align-items:center;
|
84
|
+
min-width:1px;
|
85
|
+
min-height:1px;
|
86
|
+
}
|
87
|
+
|
88
|
+
.Polaris-Button--primary {
|
89
|
+
background-color:#008060;
|
90
|
+
border-color:transparent;
|
91
|
+
border-width:0;
|
92
|
+
color:white;
|
93
|
+
}
|
94
|
+
|
95
|
+
.Polaris-Button--primary:hover {
|
96
|
+
background-color:#006e52;
|
97
|
+
border-color:transparent;
|
98
|
+
color:white;
|
99
|
+
}
|
100
|
+
|
101
|
+
.Polaris-Button--primary:active {
|
102
|
+
background-color:#005e46;
|
103
|
+
border-color:transparent;
|
104
|
+
}
|
105
|
+
|
106
|
+
.Polaris-Button--sizeLarge {
|
107
|
+
padding:1.1rem 2.4rem;
|
108
|
+
}
|
109
|
+
</style>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<style>
|
2
|
+
.Polaris-Card {
|
3
|
+
overflow:hidden;
|
4
|
+
background-color:white;
|
5
|
+
box-shadow:0 0 0 1px rgba(63, 63, 68, 0.05), 0 1px 3px 0 rgba(63, 63, 68, 0.15);
|
6
|
+
}
|
7
|
+
|
8
|
+
.Polaris-Card + .Polaris-Card {
|
9
|
+
margin-top:2rem;
|
10
|
+
}
|
11
|
+
|
12
|
+
@media (min-width: 30.625em) {
|
13
|
+
.Polaris-Card {
|
14
|
+
border-radius:8px;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.Polaris-Card__Header {
|
19
|
+
padding:2rem 2rem 0;
|
20
|
+
}
|
21
|
+
|
22
|
+
.Polaris-Card__Section {
|
23
|
+
padding:2rem;
|
24
|
+
}
|
25
|
+
|
26
|
+
.Polaris-Card__Section + .Polaris-Card__Section {
|
27
|
+
border-top:.1rem solid #e4e5e7;
|
28
|
+
}
|
29
|
+
|
30
|
+
.Polaris-Card__Section--subdued {
|
31
|
+
background-color:#fafbfb;
|
32
|
+
}
|
33
|
+
</style>
|
@@ -0,0 +1,98 @@
|
|
1
|
+
<style>
|
2
|
+
.Polaris-EmptyState {
|
3
|
+
display:-webkit-box;
|
4
|
+
display:-ms-flexbox;
|
5
|
+
display:flex;
|
6
|
+
-webkit-box-orient:vertical;
|
7
|
+
-webkit-box-direction:normal;
|
8
|
+
-ms-flex-direction:column;
|
9
|
+
flex-direction:column;
|
10
|
+
-webkit-box-align:center;
|
11
|
+
-ms-flex-align:center;
|
12
|
+
align-items:center;
|
13
|
+
width:100%;
|
14
|
+
margin:0 auto;
|
15
|
+
padding:2rem 0 6rem;
|
16
|
+
max-width:99.8rem;
|
17
|
+
}
|
18
|
+
|
19
|
+
@media (min-width: 46.5em) {
|
20
|
+
.Polaris-EmptyState--imageContained .Polaris-EmptyState__Image {
|
21
|
+
position:initial;
|
22
|
+
width:100%;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
.Polaris-EmptyState__Section {
|
27
|
+
display:-webkit-box;
|
28
|
+
display:-ms-flexbox;
|
29
|
+
display:flex;
|
30
|
+
-webkit-box-orient:vertical;
|
31
|
+
-webkit-box-direction:reverse;
|
32
|
+
-ms-flex-direction:column-reverse;
|
33
|
+
flex-direction:column-reverse;
|
34
|
+
-webkit-box-flex:1;
|
35
|
+
-ms-flex:1 1 auto;
|
36
|
+
flex:1 1 auto;
|
37
|
+
-webkit-box-align:center;
|
38
|
+
-ms-flex-align:center;
|
39
|
+
align-items:center;
|
40
|
+
width:100%;
|
41
|
+
}
|
42
|
+
|
43
|
+
.Polaris-EmptyState__ImageContainer,
|
44
|
+
.Polaris-EmptyState__DetailsContainer {
|
45
|
+
-webkit-box-flex:1;
|
46
|
+
-ms-flex:1 1 auto;
|
47
|
+
flex:1 1 auto;
|
48
|
+
padding:0;
|
49
|
+
margin:0;
|
50
|
+
text-align:center;
|
51
|
+
}
|
52
|
+
|
53
|
+
@media (min-width: 46.5em) {
|
54
|
+
.Polaris-EmptyState__ImageContainer,
|
55
|
+
.Polaris-EmptyState__DetailsContainer {
|
56
|
+
-ms-flex-preferred-size:50%;
|
57
|
+
flex-basis:50%;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
.Polaris-EmptyState__Details {
|
62
|
+
max-width:40rem;
|
63
|
+
display:-webkit-box;
|
64
|
+
display:-ms-flexbox;
|
65
|
+
display: flex;
|
66
|
+
-webkit-box-orient:vertical;
|
67
|
+
-webkit-box-direction:normal;
|
68
|
+
-ms-flex-direction:column;
|
69
|
+
flex-direction: column;
|
70
|
+
-webkit-box-align:center;
|
71
|
+
-ms-flex-align:center;
|
72
|
+
align-items: center;
|
73
|
+
}
|
74
|
+
|
75
|
+
.Polaris-EmptyState__Content {
|
76
|
+
margin-top: 1.6rem;
|
77
|
+
font-size:1.5rem;
|
78
|
+
font-weight:400;
|
79
|
+
line-height:2rem;
|
80
|
+
color:#6d7175;
|
81
|
+
padding-bottom: .8rem;
|
82
|
+
}
|
83
|
+
|
84
|
+
@media (min-width: 40em) {
|
85
|
+
.Polaris-EmptyState__Content {
|
86
|
+
font-size:1.4rem;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
.Polaris-EmptyState__Actions {
|
91
|
+
margin-top:1.6rem;
|
92
|
+
}
|
93
|
+
|
94
|
+
.Polaris-EmptyState__Image {
|
95
|
+
margin: 0;
|
96
|
+
width: auto;
|
97
|
+
}
|
98
|
+
</style>
|
@@ -0,0 +1,56 @@
|
|
1
|
+
<style>
|
2
|
+
.Polaris-Label {
|
3
|
+
margin-bottom:.4rem;
|
4
|
+
}
|
5
|
+
|
6
|
+
.Polaris-Label__Text {
|
7
|
+
-webkit-tap-highlight-color:transparent;
|
8
|
+
}
|
9
|
+
|
10
|
+
.Polaris-TextField {
|
11
|
+
position:relative;
|
12
|
+
margin-bottom:1.6rem;
|
13
|
+
}
|
14
|
+
|
15
|
+
.Polaris-TextField--InlineError {
|
16
|
+
margin-bottom:.4rem;
|
17
|
+
}
|
18
|
+
|
19
|
+
.Polaris-TextField__Input {
|
20
|
+
width:100%;
|
21
|
+
padding:.5rem 1.2rem;
|
22
|
+
border:1px solid #c9cccf;
|
23
|
+
border-top-color:#aeb4b9;
|
24
|
+
border-radius:4px;
|
25
|
+
box-shadow:none;
|
26
|
+
line-height:2.4rem;
|
27
|
+
}
|
28
|
+
|
29
|
+
.Polaris-TextField__Input:focus {
|
30
|
+
outline:none;
|
31
|
+
}
|
32
|
+
|
33
|
+
.Polaris-TextField__Backdrop:after {
|
34
|
+
content:'';
|
35
|
+
position:absolute;
|
36
|
+
z-index:1;
|
37
|
+
top:-.2rem;
|
38
|
+
right:-.2rem;
|
39
|
+
bottom:-.2rem;
|
40
|
+
left:-.2rem;
|
41
|
+
display:block;
|
42
|
+
pointer-events:none;
|
43
|
+
box-shadow:0 0 0 -.2rem #448fff;
|
44
|
+
transition:box-shadow .1s cubic-bezier(0.64, 0, 0.35, 1);
|
45
|
+
border-radius:5px;
|
46
|
+
}
|
47
|
+
|
48
|
+
.Polaris-TextField__Input:focus~.Polaris-TextField__Backdrop:after {
|
49
|
+
box-shadow:0 0 0 .2rem #448fff;
|
50
|
+
}
|
51
|
+
|
52
|
+
.Polaris-InlineError {
|
53
|
+
color:#d72c0d;
|
54
|
+
margin-bottom:1.6rem;
|
55
|
+
}
|
56
|
+
</style>
|