product_tours 1.2.0 → 1.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9645f38a9a88cddf4cb0d47618fdda9501208b758c057c74a857ccba51eefd21
4
- data.tar.gz: 3279fad69985b9fe6c3716bbe1f052854f63f6dbd4e6758b9da6a5838c9a6aba
3
+ metadata.gz: 959aea9a7666f5df3928deae610e3a6e68c69c05962b223ebbf63fbb1802f78b
4
+ data.tar.gz: 2b01492e67044318a817799c7fd0e382281ed888f9897fc41fb1a35c84ac5048
5
5
  SHA512:
6
- metadata.gz: 752b2ca7338b6387836d595641bb004ccfe50eb2dcbfdfea132547b0e3f929ae13b3d69d262e52c94f39d5600b4a986795ef200effc92bd4c0fa57c24fee27c3
7
- data.tar.gz: 5bfec7949de1cea9beebb1d95ec9b28867d999827587303cd2c486b0c1aefc08feda7146d7c4ddd05528324d558ffa854f43f12c9d62f05c4b756cc450303bd8
6
+ metadata.gz: 37f95ab0eb49e5f0acf12302fa3e4c831e6e0c481f2e9ce06c4a0f47bb9dc434ad3cce608cdc6347c6e034f6e501a4258cd21e30a5a3841c5ce86d36028d5764
7
+ data.tar.gz: 014dadc671b7baeaa05400cef406bec3b1c512f62dd29434c28c4f1fb5d0e86c7c934cf01973ef542790d3b88832db6d1f425de61a4b04f087ee891d58bcc693
data/AGENTS.md CHANGED
@@ -128,7 +128,7 @@ There are seven options. That is the whole surface.
128
128
  | `mount_path` | `"/product_tours"` | Keep in sync with `mount_product_tours at:` |
129
129
  | `storage_service` | app default | Active Storage service for uploaded video (a `storage.yml` key) |
130
130
 
131
- 26 locales ship with the gem, RTL included.
131
+ 27 locales ship with the gem, RTL included.
132
132
 
133
133
  ### Common failure modes
134
134
 
@@ -164,7 +164,7 @@ bundle exec rubocop # must be clean
164
164
  BUNDLE_GEMFILE=gemfiles/rails_7.1.gemfile bundle exec rake test # 7.1, 7.2, 8.0, 8.1 in gemfiles/
165
165
  ```
166
166
 
167
- Layout: `app/` controllers, `Tour`, dashboard views · `lib/product_tours/` config, widget JS, seeds, engine, CSP patch · `lib/generators/product_tours/` the install generator and the idempotent upgrade generator · `config/locales/` 26 locales · `test/` minitest with `test/dummy` as the host app.
167
+ Layout: `app/` controllers, `Tour`, dashboard views · `lib/product_tours/` config, widget JS, seeds, engine, CSP patch · `lib/generators/product_tours/` the install generator and the idempotent upgrade generator · `config/locales/` 27 locales · `test/` minitest with `test/dummy` as the host app.
168
168
 
169
169
  Conventions this codebase holds to — follow them rather than the first thing that works:
170
170
 
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ - Add Slovenian labels for tour navigation, the player, and its captions menu.
6
+ Hosts still provide their own tutorial content.
7
+
8
+ ## [1.3.0] - 2026-11-09
9
+
10
+ - **A direct video can be a path on the host app**, such as
11
+ `/tutorials/billing.en.mp4`, like the poster and captions already could. The
12
+ tour then plays from whichever environment holds the record, rather than
13
+ pointing a copied staging or development database at production media.
14
+ Protocol-relative (`//host/…`) and bare relative paths are still rejected.
15
+ - The dashboard's video field is now a text field, since the browser's URL
16
+ field refuses a path. It costs the browser's own URL check; the model's
17
+ validation still decides.
18
+
5
19
  ## [1.2.0] - 2026-11-03
6
20
 
7
21
  - **Direct and uploaded videos can carry a poster and captions.** A tutorial
@@ -242,7 +256,8 @@
242
256
  - Removed generic tutorial duplication now that translations provide the only
243
257
  intentional content-copying workflow.
244
258
 
245
- [Unreleased]: https://github.com/yshmarov/product_tours/compare/v1.2.0...HEAD
259
+ [Unreleased]: https://github.com/yshmarov/product_tours/compare/v1.3.0...HEAD
260
+ [1.3.0]: https://github.com/yshmarov/product_tours/compare/v1.2.0...v1.3.0
246
261
  [1.2.0]: https://github.com/yshmarov/product_tours/compare/v1.1.0...v1.2.0
247
262
  [1.1.0]: https://github.com/yshmarov/product_tours/compare/v1.0.0...v1.1.0
248
263
  [1.0.0]: https://github.com/yshmarov/product_tours/compare/v0.3.3...v1.0.0
data/README.md CHANGED
@@ -72,7 +72,7 @@ the things it should not do. It ships inside the gem, so
72
72
  | **Events** | `viewed`, `dismissed`, `completed` through `ActiveSupport::Notifications` |
73
73
  | **Deps** | Rails only. Plain JS — no Tailwind, Stimulus, importmap, npm, CDN, or build step |
74
74
  | **Auth** | Lambdas over the raw request — Devise, Rails 8 auth, anything |
75
- | **i18n** | 26 bundled languages, including RTL |
75
+ | **i18n** | 27 bundled languages, including RTL |
76
76
  | **Turbo/CSP** | Turbo Drive, nonce-based CSP, and supported iframe origins out of the box |
77
77
 
78
78
  ## The whole flow
@@ -144,7 +144,7 @@ Paste any supported HTTPS URL:
144
144
  | Loom | Share and embed links |
145
145
  | Tella | Video links |
146
146
  | Voomly | Share, video, and embed links |
147
- | Direct | URLs ending in `.mp4` or `.webm` |
147
+ | Direct | HTTPS URLs or paths on your app (`/videos/intro.mp4`) ending in `.mp4` or `.webm` |
148
148
 
149
149
  YouTube, Vimeo, and Loom metadata comes from their oEmbed endpoints. Metadata is
150
150
  best-effort: a timeout never prevents you from saving a valid URL. YouTube uses
@@ -110,7 +110,8 @@ module ProductTours
110
110
  def video_url_is_supported
111
111
  return if video_url.blank? || VideoResolver.resolve(video_url)
112
112
 
113
- errors.add(:video_url, 'must be an HTTPS YouTube, Vimeo, Loom, Tella, Voomly, MP4, or WebM URL')
113
+ errors.add(:video_url,
114
+ 'must be an HTTPS YouTube, Vimeo, Loom, Tella, Voomly, MP4, or WebM URL, or an MP4 or WebM path')
114
115
  end
115
116
 
116
117
  def action_url_is_safe
@@ -89,9 +89,9 @@
89
89
  <div data-video-source-fields="url" <%= "hidden" unless video_source == "url" %>>
90
90
  <div class="field">
91
91
  <%= form.label :video_url, t("product_tours.dashboard.video_url", default: "Video URL") %>
92
- <%= form.url_field :video_url, placeholder: "https://www.loom.com/share/...",
93
- disabled: video_source != "url", data: { video_preview_input: true } %>
94
- <small><%= t("product_tours.dashboard.video_hint", default: "YouTube, Vimeo, Loom, Tella, Voomly, or a direct MP4/WebM URL.") %></small>
92
+ <%= form.text_field :video_url, placeholder: "https://www.loom.com/share/...",
93
+ disabled: video_source != "url", data: { video_preview_input: true } %>
94
+ <small><%= t("product_tours.dashboard.video_hint", default: "YouTube, Vimeo, Loom, Tella, Voomly, or a direct MP4/WebM URL or path.") %></small>
95
95
  </div>
96
96
  <div class="form-video-preview" data-video-preview
97
97
  data-endpoint="<%= video_preview_tours_path %>"
@@ -0,0 +1,12 @@
1
+ sl:
2
+ product_tours:
3
+ close: "Zapri"
4
+ back: "Nazaj"
5
+ next: "Naprej"
6
+ done: "Končaj"
7
+ dialog: "Predstavitev funkcij"
8
+ video: "Video z navodili"
9
+ captions_label: "Slovenščina"
10
+ unavailable: "Ta predstavitev ni na voljo."
11
+ dashboard:
12
+ title: "Predstavitve funkcij"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProductTours
4
- VERSION = '1.2.0'
4
+ VERSION = '1.3.1'
5
5
  end
@@ -33,6 +33,8 @@ module ProductTours
33
33
  end
34
34
 
35
35
  def resolve
36
+ return relative if @url.start_with?('/') && !@url.start_with?('//')
37
+
36
38
  uri = URI.parse(@url)
37
39
  return unless uri.is_a?(URI::HTTPS) && uri.host.present? && uri.userinfo.nil?
38
40
 
@@ -110,6 +112,14 @@ module ProductTours
110
112
  Result.new(kind: 'iframe', provider: 'voomly', provider_id: id, url: embed)
111
113
  end
112
114
 
115
+ # A path on the host app's own origin, so a tour plays from whichever environment holds the record.
116
+ def relative
117
+ uri = URI.parse(@url)
118
+ direct(uri) if uri.host.nil? && uri.scheme.nil?
119
+ rescue URI::InvalidURIError
120
+ nil
121
+ end
122
+
113
123
  def direct(uri)
114
124
  return unless uri.path.match?(/\.(?:mp4|webm)\z/i)
115
125
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: product_tours
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov
@@ -85,6 +85,7 @@ files:
85
85
  - config/locales/product_tours.pt.yml
86
86
  - config/locales/product_tours.ro.yml
87
87
  - config/locales/product_tours.ru.yml
88
+ - config/locales/product_tours.sl.yml
88
89
  - config/locales/product_tours.th.yml
89
90
  - config/locales/product_tours.tr.yml
90
91
  - config/locales/product_tours.uk.yml