wilday_ui 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,16 +19,66 @@ module WildayUi
19
19
  end
20
20
  end
21
21
 
22
+ # # Configure asset paths and automatic precompilation
23
+ # initializer "wilday_ui.assets" do |app|
24
+ # app.config.assets.paths << root.join("app/assets/stylesheets")
25
+ # app.config.assets.paths << root.join("app/javascript")
26
+ # app.config.assets.paths << root.join("app/assets/builds")
27
+
28
+ # Rails.logger.info "[Wilday UI] Asset paths added: #{app.config.assets.paths}"
29
+
30
+ # # Automatically precompile all CSS files in wilday_ui directory
31
+ # css_files = Dir[root.join("app/assets/stylesheets/wilday_ui/**/*.css")].map do |file|
32
+ # file.split("app/assets/stylesheets/").last
33
+ # end
34
+
35
+ # # Precompile only the bundled JavaScript file
36
+ # app.config.assets.precompile += css_files
37
+ # app.config.assets.precompile += %w[wilday_ui/index.js]
38
+
39
+ # Rails.logger.info "[Wilday UI] CSS files precompiled: #{css_files}"
40
+ # Rails.logger.info "[Wilday UI] JS files precompiled: wilday_ui/index.js"
41
+ # end
42
+
22
43
  # Configure asset paths and automatic precompilation
23
44
  initializer "wilday_ui.assets" do |app|
24
- app.config.assets.paths << root.join("app/assets/stylesheets")
45
+ # Add engine asset paths
46
+ engine_asset_paths = [
47
+ root.join("app/assets/stylesheets"),
48
+ root.join("app/javascript"),
49
+ root.join("app/assets/builds")
50
+ ]
51
+
52
+ # Add dummy app assets path in development
53
+ if Rails.env.development?
54
+ engine_asset_paths << root.join("test/dummy/app/assets/builds")
55
+
56
+ # Create symlink for dummy app assets if it doesn't exist
57
+ dummy_builds_path = root.join("test/dummy/app/assets/builds/wilday_ui")
58
+ engine_builds_path = root.join("app/assets/builds/wilday_ui")
59
+
60
+ unless File.exist?(dummy_builds_path)
61
+ FileUtils.mkdir_p(dummy_builds_path.parent)
62
+ FileUtils.ln_sf(engine_builds_path, dummy_builds_path)
63
+ Rails.logger.info "[Wilday UI] Created symlink for dummy app assets"
64
+ end
65
+ end
66
+
67
+ # Add all asset paths to Rails
68
+ engine_asset_paths.each { |path| app.config.assets.paths << path }
69
+ Rails.logger.info "[Wilday UI] Asset paths added: #{app.config.assets.paths}"
25
70
 
26
71
  # Automatically precompile all CSS files in wilday_ui directory
27
72
  css_files = Dir[root.join("app/assets/stylesheets/wilday_ui/**/*.css")].map do |file|
28
73
  file.split("app/assets/stylesheets/").last
29
74
  end
30
75
 
76
+ # Precompile only the bundled JavaScript file
31
77
  app.config.assets.precompile += css_files
78
+ app.config.assets.precompile += %w[wilday_ui/index.js]
79
+
80
+ Rails.logger.info "[Wilday UI] CSS files precompiled: #{css_files}"
81
+ Rails.logger.info "[Wilday UI] JS files precompiled: wilday_ui/index.js"
32
82
  end
33
83
  end
34
84
  end
@@ -1,3 +1,3 @@
1
1
  module WildayUi
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wilday_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - davidwinalda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-10 00:00:00.000000000 Z
11
+ date: 2024-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -39,9 +39,8 @@ extra_rdoc_files: []
39
39
  files:
40
40
  - README.md
41
41
  - Rakefile
42
- - app/assets/builds/index.css
43
- - app/assets/builds/index.js
44
- - app/assets/builds/index.js.map
42
+ - app/assets/builds/wilday_ui/index.js
43
+ - app/assets/builds/wilday_ui/index.js.map
45
44
  - app/assets/config/wilday_ui_manifest.js
46
45
  - app/assets/stylesheets/wilday_ui/application.css
47
46
  - app/assets/stylesheets/wilday_ui/button.css
@@ -49,6 +48,8 @@ files:
49
48
  - app/helpers/wilday_ui/application_helper.rb
50
49
  - app/helpers/wilday_ui/components/button_helper.rb
51
50
  - app/javascript/wilday_ui/components/button.js
51
+ - app/javascript/wilday_ui/controllers/button_controller.js
52
+ - app/javascript/wilday_ui/controllers/index.js
52
53
  - app/javascript/wilday_ui/index.js
53
54
  - app/jobs/wilday_ui/application_job.rb
54
55
  - app/mailers/wilday_ui/application_mailer.rb
@@ -1 +0,0 @@
1
- .wilday-button{display:inline-flex;align-items:center;justify-content:center;padding:.5rem 1rem;border-radius:.375rem;font-size:1rem;cursor:pointer;transition:all .2s ease-in-out}.wilday-button-primary{background-color:#007bff;color:#fff;border:none}.wilday-button-primary:hover{background-color:#0056b3}.wilday-button-secondary{background-color:#6c757d;color:#fff;border:none}.wilday-button-secondary:hover{background-color:#5a6268}.wilday-button-outline{background-color:transparent;color:#007bff;border:1px solid #007bff}.wilday-button-outline:hover{background-color:#e7f1ff}.wilday-button-small{font-size:.875rem;padding:.25rem .5rem}.wilday-button-medium{font-size:1rem;padding:.5rem 1rem}.wilday-button-large{font-size:1.25rem;padding:.75rem 1.5rem}.wilday-button:disabled{background-color:#e0e0e0;color:#6c757d;cursor:not-allowed}
@@ -1,13 +0,0 @@
1
- (() => {
2
- // app/javascript/wilday_ui/components/button.js
3
- document.addEventListener("DOMContentLoaded", () => {
4
- document.querySelectorAll(".w-button").forEach((button) => {
5
- button.addEventListener("click", (event) => {
6
- if (button.disabled) {
7
- event.preventDefault();
8
- }
9
- });
10
- });
11
- });
12
- })();
13
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../javascript/wilday_ui/components/button.js"],
4
- "sourcesContent": ["document.addEventListener(\"DOMContentLoaded\", () => {\n document.querySelectorAll(\".w-button\").forEach((button) => {\n button.addEventListener(\"click\", (event) => {\n if (button.disabled) {\n event.preventDefault();\n }\n });\n });\n});\n"],
5
- "mappings": ";;AAAA,WAAS,iBAAiB,oBAAoB,MAAM;AAClD,aAAS,iBAAiB,WAAW,EAAE,QAAQ,CAAC,WAAW;AACzD,aAAO,iBAAiB,SAAS,CAAC,UAAU;AAC1C,YAAI,OAAO,UAAU;AACnB,gBAAM,eAAe;AAAA,QACvB;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;",
6
- "names": []
7
- }