coveragebook_components 0.8.6 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2355b0d5f6f2de3e816d804188e4b799a35f96b4a68f071b7049bf1766d6ddd
4
- data.tar.gz: c0386b7d1915074c91ac5bc4d1c4527277fb6313fa11d00a973e27783ad11cd0
3
+ metadata.gz: f723811d6a3609dae70976bda4a0f1c8577e1a89dd85ff190149112dcae54dbc
4
+ data.tar.gz: 6a54e4799a4fa6cb047c2bfc89b469c6182cb958b9ed2227d0df12f095b4166e
5
5
  SHA512:
6
- metadata.gz: 598fd2d0f022230a26d9159c06a630f80a1be1ac8ba33a19fe2e0e2bdc2356046954b7940d2a98c23acd865b38945d4a3f3bccb86c33f4032dcd23b3e5d1cee8
7
- data.tar.gz: b8a33f8a2779d06e8b6befa1e82590daa2570246e0fee02bec50b63936248dc77ea5a0b46ce53eb61413413e65b582ebdbac55744b9a878a4228509f0d087bae
6
+ metadata.gz: ffdf1f637359a39c048698f58c81092d2dded4d488ef0e73ba12fadcb35b1d4c4ef95682f4b926dc0f99fd253680abaaa9846d2613e7e742640a038259ce0a01
7
+ data.tar.gz: bfa4ae0355bdf96b8f981d2ac0c47aa59a73768ee1c92464d5975a6b114da41bba5e2e8807b718b6b333abc7288d4494cd33256cf3671ca472d1a79db26831c2
@@ -4645,7 +4645,7 @@ select{
4645
4645
  left: var(--sidebar-nav-width, 0)}
4646
4646
  [data-coco][data-component="page-layout"] .page-controls .page-control-next{
4647
4647
  margin-left: auto}
4648
- [data-coco][data-component="page-layout"][data-width="constrained"] .page-body{
4648
+ [data-coco][data-component="page-layout"][data-width="constrained"] .page-body-content{
4649
4649
  margin-left: auto;
4650
4650
  margin-right: auto;
4651
4651
  max-width: 1400px}
@@ -5049,6 +5049,8 @@ select{
5049
5049
  border-radius: 0.375rem;
5050
5050
  -o-object-fit: contain;
5051
5051
  object-fit: contain}
5052
+ .visible{
5053
+ visibility: visible}
5052
5054
  .static{
5053
5055
  position: static}
5054
5056
  .fixed{
@@ -14044,7 +14044,7 @@
14044
14044
  var package_default = {
14045
14045
  name: "coveragebook-components",
14046
14046
  type: "module",
14047
- version: "0.8.6",
14047
+ version: "0.8.8",
14048
14048
  main: "index.js",
14049
14049
  repository: "git@github.com:coveragebook/coco.git",
14050
14050
  author: "Mark Perkins <mark@coveragebook.com>",
@@ -14080,23 +14080,23 @@
14080
14080
  "fast-glob": "^3.3.1",
14081
14081
  "fast-sort": "^3.2.1",
14082
14082
  husky: "^8.0.3",
14083
- jest: "^29.4.3",
14084
- "jest-environment-jsdom": "^29.4.3",
14085
14083
  "lint-staged": "^15.0.2",
14086
14084
  postcss: "^8.4.31",
14087
14085
  "postcss-cli": "^10.1.0",
14088
14086
  "postcss-value-parser": "^4.2.0",
14089
- prettier: "^2.8.4",
14087
+ prettier: "^3.1.0",
14090
14088
  "release-it": "^15.10.3",
14091
14089
  svgo: "^3.0.2"
14092
14090
  },
14093
14091
  scripts: {
14094
14092
  "js:build": "node esbuild.config.js",
14095
- "js:dev": "node esbuild.config.js --watch",
14096
- "js:test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
14093
+ "js:dev": "node esbuild.config.js --dev",
14094
+ "js:watch": "node esbuild.config.js --watch",
14097
14095
  "css:build": "postcss ./app/assets/css/{app,book}.css -d ./app/assets/build/coco",
14098
- "css:dev": "postcss ./app/assets/css/{app,book}.css -d ./app/assets/build/coco --watch --ext .dev.css",
14096
+ "css:dev": "postcss ./app/assets/css/{app,book}.css -d ./app/assets/build/coco --ext .dev.css",
14097
+ "css:watch": "postcss ./app/assets/css/{app,book}.css -d ./app/assets/build/coco --watch --ext .dev.css",
14099
14098
  build: "npm run js:build && npm run css:build",
14099
+ "build:dev": "npm run js:dev && npm run css:dev",
14100
14100
  "lint:fix": "bundle exec standardrb --fix && prettier --write .",
14101
14101
  prepare: "husky install",
14102
14102
  release: "release-it"
@@ -14112,7 +14112,8 @@
14112
14112
  prettier: {
14113
14113
  tabWidth: 2,
14114
14114
  semi: true,
14115
- singleQuote: false
14115
+ singleQuote: false,
14116
+ trailingComma: "es5"
14116
14117
  },
14117
14118
  "release-it": {
14118
14119
  github: {
@@ -14125,14 +14126,14 @@
14125
14126
  "before:init": [
14126
14127
  "npm install",
14127
14128
  "bundle install",
14128
- "bundle exec rake test"
14129
+ "bundle exec rake coco:test"
14129
14130
  ],
14130
14131
  "after:bump": [
14131
14132
  "npm run lint:fix",
14132
14133
  "npm run build"
14133
14134
  ],
14134
- "after:version:bump": "./bin/bump-version ${version} && bundle && cd lookbook && bundle",
14135
- "after:release": "./bin/build-gem ${version}"
14135
+ "after:version:bump": "bundle exec rake coco:gem:bump_version[${version}] && bundle && cd lookbook && bundle",
14136
+ "after:release": "rake coco:gem:release[${version}]"
14136
14137
  }
14137
14138
  }
14138
14139
  };
@@ -25057,7 +25058,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
25057
25058
  }
25058
25059
  },
25059
25060
  root: {
25060
- "x-options": '["dismissable", "singleLine"]',
25061
+ "x-options": '["dismissable", "singleLine", "dismissAfterAction"]',
25061
25062
  ":class": "{'force-multi-line': forceMultiLine}"
25062
25063
  }
25063
25064
  };
@@ -1869,6 +1869,9 @@ select {
1869
1869
  -o-object-fit: contain;
1870
1870
  object-fit: contain;
1871
1871
  }
1872
+ .visible {
1873
+ visibility: visible;
1874
+ }
1872
1875
  .static {
1873
1876
  position: static;
1874
1877
  }
@@ -40,7 +40,7 @@
40
40
  <% if action? %>
41
41
  <div class="alert-action"
42
42
  x-ref="action"
43
- @click="dismiss"
43
+ @click="if ($options.dismissAfterAction) dismiss()"
44
44
  data-role="action">
45
45
  <%= coco_button(
46
46
  *@action_data[:args],
@@ -54,7 +54,7 @@
54
54
  <% if secondary_action? %>
55
55
  <div class="alert-action"
56
56
  x-ref="secondaryAction"
57
- @click="dismiss"
57
+ @click="if ($options.dismissAfterAction) dismiss()"
58
58
  data-role="secondary-action">
59
59
  <%= coco_button(
60
60
  *@secondary_action_data[:args],
@@ -42,7 +42,7 @@ export default CocoComponent("appAlert", () => {
42
42
  },
43
43
 
44
44
  root: {
45
- "x-options": '["dismissable", "singleLine"]',
45
+ "x-options": '["dismissable", "singleLine", "dismissAfterAction"]',
46
46
  ":class": "{'force-multi-line': forceMultiLine}",
47
47
  },
48
48
  };
@@ -19,6 +19,7 @@ module Coco
19
19
  }.freeze
20
20
 
21
21
  accepts_option :dismissable, from: [true, false], default: false
22
+ accepts_option :dismiss_after_action, from: [true, false], default: true
22
23
  accepts_option :banner, from: [true, false], default: false
23
24
  accepts_option :theme, from: THEMES, default: "info"
24
25
  accepts_option :single_line, from: [true, false]
@@ -16,6 +16,7 @@ module Coco
16
16
  cloak: false,
17
17
  single_line: true,
18
18
  dismissable: dismissable?,
19
+ dismiss_after_action: false,
19
20
  condensed: true
20
21
  )
21
22
  end
@@ -15,7 +15,7 @@
15
15
  }
16
16
 
17
17
  &[data-width="constrained"] {
18
- .page-body {
18
+ .page-body-content {
19
19
  @apply max-w-screen-2xl mx-auto;
20
20
  }
21
21
  }
@@ -5,7 +5,9 @@
5
5
  </header>
6
6
  <% end %>
7
7
  <div class="page-body" data-role="page-body">
8
- <%= content %>
8
+ <div class="page-body-content">
9
+ <%= content %>
10
+ </div>
9
11
  </div>
10
12
 
11
13
  <% if previous_link? || next_link? %>
data/lib/coco.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.8.6"
2
+ VERSION = "0.8.8"
3
3
  end
@@ -45,7 +45,7 @@ export default function (sourcePath, destPath, configPath) {
45
45
  const iconsDataFilePath = `${configPath}/icons.json`;
46
46
 
47
47
  prettier.resolveConfig(iconsDataFilePath).then(async (options) => {
48
- const formattedJSON = prettier.format(
48
+ const formattedJSON = await prettier.format(
49
49
  JSON.stringify(iconNames.sort()),
50
50
  {
51
51
  ...options,
@@ -1,13 +1,23 @@
1
+ require "json"
2
+
1
3
  namespace :coco do
2
- desc "Run Ruby and JS tests"
3
- task :test do
4
+ desc "Run tests"
5
+ task :test, [:files] do |task, args|
4
6
  puts "🥥 Running Ruby tests..."
5
- Rake::Task["test"].execute
7
+ system "npm run build:dev"
8
+ system "bundle exec rake test TEST=#{args.files || "test/**/*_test.rb"}"
6
9
  puts "✅ Ruby tests complete"
10
+ end
7
11
 
8
- puts "🥥 Running JS tests..."
9
- system "npm run js:test"
10
- puts "✅JS tests complete"
12
+ namespace :test do
13
+ desc "Run tests in CI"
14
+ task :ci do
15
+ puts "🥥 Building assets..."
16
+ Rake::Task["coco:assets:build"].execute
17
+ puts "🥥 Running Ruby tests..."
18
+ Rake::Task["test"].execute
19
+ puts "✅ Ruby tests complete"
20
+ end
11
21
  end
12
22
 
13
23
  task :lint do
@@ -41,4 +51,43 @@ namespace :coco do
41
51
  puts "✅ Asset build complete"
42
52
  end
43
53
  end
54
+
55
+ namespace :gem do
56
+ desc "Build and push to RubyGems"
57
+ task :release, [:version] do |task, args|
58
+ Rake::Task["coco:gem:build"].execute
59
+ Rake::Task["coco:gem:push"].invoke(args.version)
60
+ end
61
+
62
+ desc "Bump gem version"
63
+ task :bump_version, [:version] => :environment do |task, args|
64
+ puts "🥥 Bumping version number to #{args.version}"
65
+
66
+ new_version = args.version.sub("v", "").tr("-", ".")
67
+ version_file = File.expand_path("#{File.dirname(__FILE__)}/../coco.rb")
68
+ current_version = Coco::VERSION.to_s
69
+ file = File.open(version_file)
70
+ contents = file.read
71
+ File.write(version_file, contents.gsub(current_version, new_version))
72
+
73
+ puts "✅ Version bump complete"
74
+ end
75
+
76
+ desc "Build gem"
77
+ task :build do
78
+ puts "🥥 Building Gem..."
79
+ Rake::Task["build"].execute
80
+ puts "✅ Gem build complete"
81
+ end
82
+
83
+ desc "Push gem to Rubygems"
84
+ task :push, [:version] do |task, args|
85
+ puts "🥥 Pushing to RubyGems..."
86
+
87
+ version = args.version.sub("v", "").tr("-", ".")
88
+ system "gem push pkg/coveragebook_components-#{version}.gem"
89
+
90
+ puts "✅ Gem pushed to RubyGems"
91
+ end
92
+ end
44
93
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveragebook_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Perkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-10 00:00:00.000000000 Z
11
+ date: 2023-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails