sage-rails 0.1.2 → 0.1.3
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 +4 -4
- data/README.md +7 -0
- data/app/javascript/sage/application.js +16 -0
- data/app/javascript/sage.js +1 -1
- data/app/views/layouts/sage/application.html.erb +1 -1
- data/config/importmap.rb +3 -0
- data/lib/sage/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c226da9e35872f807813789601f70a61e0642fe895491226748730abf0ca5ae6
|
4
|
+
data.tar.gz: 383fa6d133de1e90321769974377b71333d3c90bd67858796835fc70be0694ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edff5d0c62223b69d985ba897aa619c9e924eff365a6b3c94f8f617bb06b3b28f5929fbea0ce555db046ef78f57986d78c71c8d20965062093374075b214cdf2
|
7
|
+
data.tar.gz: cddfd4cbeb87ba36fbd196fa1c992493a2fca258bc817be25faff43d3f1023c2e1ccd1fa08c915cfd769ee84845df97431dd6a947ed9dea9ec12ecf700fc8682
|
data/README.md
CHANGED
@@ -34,6 +34,13 @@ Run bundle install:
|
|
34
34
|
$ bundle install
|
35
35
|
```
|
36
36
|
|
37
|
+
## Sprockets
|
38
|
+
|
39
|
+
If using sprockets, add this line to your app/javascript/application.js file:
|
40
|
+
```js
|
41
|
+
import "sage/applicaiton";
|
42
|
+
```
|
43
|
+
|
37
44
|
## Getting Started
|
38
45
|
|
39
46
|
Run the install generator to set up Sage in your Rails application:
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// Sage Stimulus controllers initialization
|
2
|
+
// This file is loaded via importmap and registers all Sage controllers with the host app's Stimulus instance
|
3
|
+
|
4
|
+
import { registerControllers } from "sage"
|
5
|
+
|
6
|
+
// Wait for the host app's Stimulus to be available
|
7
|
+
if (window.Stimulus) {
|
8
|
+
registerControllers(window.Stimulus)
|
9
|
+
} else {
|
10
|
+
// If Stimulus isn't ready yet, wait for it
|
11
|
+
document.addEventListener('DOMContentLoaded', () => {
|
12
|
+
if (window.Stimulus) {
|
13
|
+
registerControllers(window.Stimulus)
|
14
|
+
}
|
15
|
+
})
|
16
|
+
}
|
data/app/javascript/sage.js
CHANGED
@@ -5,7 +5,7 @@ import SelectController from "sage/controllers/select_controller"
|
|
5
5
|
import DashboardController from "sage/controllers/dashboard_controller"
|
6
6
|
import ReverseInfiniteScrollController from "sage/controllers/reverse_infinite_scroll_controller"
|
7
7
|
import VariablesController from "sage/controllers/variables_controller"
|
8
|
-
import QueryToggleController from "sage/controllers/query_toggle_controller
|
8
|
+
import QueryToggleController from "sage/controllers/query_toggle_controller"
|
9
9
|
|
10
10
|
// Export all Sage controllers for manual registration
|
11
11
|
export { SearchController, ClipboardController, SelectController, DashboardController, ReverseInfiniteScrollController, VariablesController, QueryToggleController }
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<%= javascript_include_tag "blazer/jquery", "blazer/rails-ujs", "blazer/stupidtable", "blazer/stupidtable-custom-settings", "blazer/jquery.stickytableheaders", "blazer/selectize", "blazer/highlight.min", "blazer/moment", "blazer/moment-timezone-with-data", "blazer/daterangepicker", "blazer/chart.umd", "blazer/chartjs-adapter-date-fns.bundle", "blazer/chartkick", "blazer/mapkick.bundle", "blazer/ace/ace", "blazer/ace/ext-language_tools", "blazer/ace/theme-twilight", "blazer/ace/mode-sql", "blazer/ace/snippets/text", "blazer/ace/snippets/sql", "blazer/Sortable", "blazer/vue.global.prod", "blazer/routes", "blazer/queries", "blazer/fuzzysearch", nonce: true %>
|
14
14
|
<% elsif defined?(Sprockets) %>
|
15
15
|
<%= stylesheet_link_tag "sage/application", "blazer/selectize", "blazer/daterangepicker" %>
|
16
|
-
<%= javascript_include_tag "blazer/jquery", "blazer/rails-ujs", "blazer/stupidtable", "blazer/stupidtable-custom-settings", "blazer/jquery.stickytableheaders", "blazer/selectize", "blazer/highlight.min", "blazer/moment", "blazer/moment-timezone-with-data", "blazer/daterangepicker", "blazer/chart.umd", "blazer/chartjs-adapter-date-fns.bundle", "blazer/chartkick", "blazer/mapkick.bundle", "blazer/ace/ace", "blazer/ace/ext-language_tools", "blazer/ace/theme-twilight", "blazer/ace/mode-sql", "blazer/ace/snippets/text", "blazer/ace/snippets/sql", "blazer/Sortable", "blazer/vue.global.prod", "blazer/routes", "blazer/queries", "blazer/fuzzysearch",
|
16
|
+
<%= javascript_include_tag "blazer/jquery", "blazer/rails-ujs", "blazer/stupidtable", "blazer/stupidtable-custom-settings", "blazer/jquery.stickytableheaders", "blazer/selectize", "blazer/highlight.min", "blazer/moment", "blazer/moment-timezone-with-data", "blazer/daterangepicker", "blazer/chart.umd", "blazer/chartjs-adapter-date-fns.bundle", "blazer/chartkick", "blazer/mapkick.bundle", "blazer/ace/ace", "blazer/ace/ext-language_tools", "blazer/ace/theme-twilight", "blazer/ace/mode-sql", "blazer/ace/snippets/text", "blazer/ace/snippets/sql", "blazer/Sortable", "blazer/vue.global.prod", "blazer/routes", "blazer/queries", "blazer/fuzzysearch", nonce: true %>
|
17
17
|
<% else %>
|
18
18
|
<%= stylesheet_link_tag "sage/application" %>
|
19
19
|
<%= javascript_importmap_tags %>
|
data/config/importmap.rb
CHANGED
@@ -8,6 +8,9 @@ pin "sage/controllers/reverse_infinite_scroll_controller", to: "sage/controllers
|
|
8
8
|
pin "sage/controllers/variables_controller", to: "sage/controllers/variables_controller.js"
|
9
9
|
pin "sage/controllers/query_toggle_controller", to: "sage/controllers/query_toggle_controller.js"
|
10
10
|
|
11
|
+
# External dependencies
|
12
|
+
pin "debounce", to: "https://ga.jspm.io/npm:debounce@2.0.0/index.js"
|
13
|
+
|
11
14
|
# Don't pin common libraries - let the host app handle them
|
12
15
|
# pin "@hotwired/stimulus", to: "stimulus.min.js"
|
13
16
|
# pin "@hotwired/turbo-rails", to: "turbo.min.js"
|
data/lib/sage/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sage-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Jones
|
@@ -169,6 +169,7 @@ files:
|
|
169
169
|
- app/helpers/sage/queries_helper.rb
|
170
170
|
- app/javascript/controllers/element_removal_controller.js
|
171
171
|
- app/javascript/sage.js
|
172
|
+
- app/javascript/sage/application.js
|
172
173
|
- app/javascript/sage/controllers/clipboard_controller.js
|
173
174
|
- app/javascript/sage/controllers/dashboard_controller.js
|
174
175
|
- app/javascript/sage/controllers/query_toggle_controller.js
|