devex 0.3.7 → 0.3.8

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: 706b385515967e798d258c20f07925a64d65fc023dcf11a9bbb95cbe7daaa896
4
- data.tar.gz: '06242720010835019af12d6a732778600d4ac82dc04957a9fbaa7b4e6e051fb7'
3
+ metadata.gz: 91dabc0fdfce840ecaa864cbc1399b52d8cfe9ff1dea3038a80ffa87a2c1da8a
4
+ data.tar.gz: 9389c09c2dfc38eb852785b05e9672a36e055f22f35f0f1ee4050da95db27a27
5
5
  SHA512:
6
- metadata.gz: 266a7d54b5005b3276fcfe7c259ae8799a721550ec3b79e949fbdbfef0a326fb2ec0ffe49d6a86399c9aa45ebb66a752cfde065985997ce4e3fb33e4ead02ad6
7
- data.tar.gz: 9e004411ef987e6eb20b14d6e7436b518598923e44dc9c74427223cd70d947b6a5919b37d3dd8e7f80647191ecd85c371342ba1704a7c66ffd62decfd5aac500
6
+ metadata.gz: f605ee08b0bc4a716699e55c1c92e8049ebfe17d7685657640b35d3ed1ccf85e56778de9aefdb35e164c9759b2d8896f367a6708e61bbfc10fa86bfa9984fbd1
7
+ data.tar.gz: '0641979e5dac9019bf8ea4cca642732e78e5da1efcaf0c4db1479703f1909f586c511a6f2966894f3fbcf2a2dcefc418bcbd795547f4990a53e46e2b08eed952'
data/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  All notable changes to devex will be documented in this file.
4
4
 
5
+ ## [0.3.8] - 2026-11-20
6
+
7
+ ### Fixed
8
+ - **`dx version bump` / `dx version set` now write a bare `VERSION` file.**
9
+ Previously only a Ruby `VERSION = "…"` constant was rewritten; for a bare
10
+ file the command printed `old → new`, exited 0, and left the file
11
+ unchanged.
12
+ - **A version command can no longer report a change it did not make.** The
13
+ new file content is checked before anything is written; if it would not
14
+ read back as the new version, nothing is written and the command exits 1.
15
+ - **`dx version bump` refuses versions that are not plain
16
+ `MAJOR.MINOR.PATCH`** (exit 1, file untouched) instead of mangling them.
17
+ `2.0.0.pre` used to "bump" to `2.0.1.0`, and `1.2` to `0.0.1`. What a
18
+ bump should mean for a prerelease is a convention devex does not assume;
19
+ use `dx version set`.
20
+ - **`dx version set` validates the whole string.** It accepts
21
+ `MAJOR.MINOR.PATCH` with an optional prerelease tail in RubyGems style
22
+ (`2.0.0.pre`) or SemVer style (`2.0.0-rc.1`, `+build`); `1.0.0garbage`
23
+ used to pass.
24
+ - `test_stable_compact` no longer depends on `Hash#inspect`'s format, which
25
+ changed in Ruby 3.4 (the test had been failing since).
26
+ - Rewriting a Ruby constant keeps the file's own quote style and spacing.
27
+
28
+ ### Added
29
+ - **`dx version bump pre`** increments the counter of a prerelease version,
30
+ in either spelling: `2.0.0-alpha.0` → `2.0.0-alpha.1`, `2.0.0.pre.1` →
31
+ `2.0.0.pre.2`. Refused when the version has no trailing prerelease
32
+ counter. Moving between stages, or releasing, is `dx version set`.
33
+
34
+ ### Added (2026-05-19)
35
+ - **Actionable LoadError hint in `CLI#run`.** When a project tool's
36
+ `require` fails AND the project has a Gemfile but no `.dx-use-local`
37
+ marker (and we aren't already inside a delegated re-exec), the bare
38
+ LoadError is surfaced AND a one-line actionable hint is appended
39
+ pointing at the existing `.dx-use-local` delegation affordance
40
+ (ADR-003). Purely additive: never swallows the underlying error,
41
+ never changes exit codes for the non-matching case. Resolves the
42
+ recurring confusion where a project tool that requires a bundle-only
43
+ path-gem (e.g. relata's `tools/docs.rb` → `chiridion`) raised a raw
44
+ 12-line backtrace with no signal that the affordance exists.
45
+
5
46
  ## [0.3.5] - 2025-12-29
6
47
 
7
48
  ### Fixed
data/README.md CHANGED
@@ -33,8 +33,9 @@ dx help
33
33
 
34
34
  # Show/manage version
35
35
  dx version
36
- dx version bump patch
37
- dx version set 2.0.0
36
+ dx version bump patch # 1.2.3 → 1.2.4
37
+ dx version bump pre # 2.0.0-alpha.0 → 2.0.0-alpha.1
38
+ dx version set 2.0.0-beta.0
38
39
 
39
40
  # With JSON output (auto-detected in agent mode)
40
41
  dx version --format=json
@@ -256,8 +257,11 @@ dx --dx-terminal version # Force terminal detection
256
257
 
257
258
  **Version Management**
258
259
  - `dx version` - Show project version
259
- - `dx version bump <major|minor|patch>` - Bump semantic version
260
- - `dx version set <version>` - Set explicit version
260
+ - `dx version bump <major|minor|patch>` - Bump a plain `MAJOR.MINOR.PATCH` version
261
+ - `dx version bump pre` - Increment a prerelease counter (`2.0.0-alpha.0` → `2.0.0-alpha.1`, or RubyGems-style `2.0.0.alpha.0`)
262
+ - `dx version set <version>` - Set explicit version, including prereleases; the way to change stage or release
263
+
264
+ The version lives in `lib/*/version.rb` (a `VERSION = "…"` constant), a bare `VERSION` file, or `version.rb`, looked for in that order. A bump that doesn't apply to the current version is refused with exit 1 and the file is left alone.
261
265
 
262
266
  **Gem Packaging**
263
267
  - `dx gem build` - Build the gem
data/devex-0.3.7.gem ADDED
Binary file
@@ -9,7 +9,17 @@ VERSION_FILE_PATTERNS = [
9
9
  "version.rb"
10
10
  ].freeze
11
11
 
12
- VERSION_REGEX = /VERSION\s*=\s*["']([^"']+)["']/
12
+ VERSION_REGEX = /VERSION\s*=\s*(["'])([^"']+)\1/
13
+
14
+ # What `dx version set` accepts: MAJOR.MINOR.PATCH, optionally followed by a
15
+ # prerelease tail in either RubyGems style (2.0.0.pre, 2.0.0.rc.1) or SemVer
16
+ # style (2.0.0-rc.1), and optionally SemVer build metadata (+build.5).
17
+ # Deliberately neutral between the two conventions: which one a project uses
18
+ # is the project's choice, not ours.
19
+ SETTABLE_VERSION = /\A\d+\.\d+\.\d+(?:[.-][0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?(?:\+[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?\z/
20
+
21
+ # What `dx version bump` can act on: exactly MAJOR.MINOR.PATCH.
22
+ BUMPABLE_VERSION = /\A(\d+)\.(\d+)\.(\d+)\z/
13
23
 
14
24
  def find_version_file(root)
15
25
  VERSION_FILE_PATTERNS.each do |pattern|
@@ -19,40 +29,78 @@ def find_version_file(root)
19
29
  nil
20
30
  end
21
31
 
22
- def read_version(file)
23
- content = File.read(file)
32
+ # Extract the version from a version file's content. Two shapes are
33
+ # understood: a Ruby source file with a `VERSION = "x"` constant, and a bare
34
+ # file whose whole content is the version (e.g. a top-level VERSION file).
35
+ def parse_version(content)
24
36
  if content =~ VERSION_REGEX
25
- Regexp.last_match(1)
37
+ Regexp.last_match(2)
26
38
  else
27
39
  content.strip
28
40
  end
29
41
  end
30
42
 
43
+ def read_version(file) = parse_version(File.read(file))
44
+
45
+ # Content of the version file with old_version replaced by new_version, or nil
46
+ # if this content isn't in a shape we know how to rewrite.
47
+ def replace_version(content, old_version, new_version)
48
+ if content =~ VERSION_REGEX
49
+ # Ruby constant: keep the file's own spacing and quote style.
50
+ content.sub(/(VERSION\s*=\s*)(["'])#{Regexp.escape(old_version)}\2/) do
51
+ "#{Regexp.last_match(1)}#{Regexp.last_match(2)}#{new_version}#{Regexp.last_match(2)}"
52
+ end
53
+ elsif content.strip == old_version && !old_version.empty? && old_version !~ /\s/
54
+ # Bare file: swap the version, keep surrounding whitespace (trailing newline).
55
+ content.sub(old_version) { new_version }
56
+ end
57
+ end
58
+
59
+ # Write new_version into file. The new content is checked *before* it is
60
+ # written: if it would not read back as new_version, nothing is written and the
61
+ # command fails. A version command must never report a change it did not make.
31
62
  def write_version(file, old_version, new_version)
32
- content = File.read(file)
33
- new_content = content.gsub(
34
- /VERSION\s*=\s*["']#{Regexp.escape(old_version)}["']/,
35
- %(VERSION = "#{new_version}")
36
- )
63
+ content = File.read(file)
64
+ new_content = replace_version(content, old_version, new_version)
65
+
66
+ unless new_content && parse_version(new_content) == new_version
67
+ version_error("Don't know how to write a version into #{file}. " \
68
+ "Expected a `VERSION = \"x.y.z\"` constant, or a file containing only the version. " \
69
+ "Nothing was changed.")
70
+ end
71
+
37
72
  File.write(file, new_content)
38
73
  end
39
74
 
75
+ # A prerelease version whose tail ends in a numeric counter, in either
76
+ # spelling: 2.0.0-alpha.0 (SemVer) or 2.0.0.alpha.0 (RubyGems). The stage
77
+ # label must contain a letter, so 1.2.3.4 is not mistaken for one.
78
+ PRERELEASE_COUNTER = /\A(\d+\.\d+\.\d+[.-](?:[0-9A-Za-z]+[.-])*?[0-9A-Za-z]*[A-Za-z][0-9A-Za-z]*[.-])(\d+)\z/
79
+
80
+ # Returns the bumped version string, or nil if this kind of bump doesn't
81
+ # apply to this version.
82
+ #
83
+ # major/minor/patch apply only to plain MAJOR.MINOR.PATCH: what they should do
84
+ # to a prerelease (release it? skip past it?) depends on a convention we don't
85
+ # assume. "pre" applies only to a prerelease ending in a numeric counter, and
86
+ # increments that counter; this means the same thing in both spellings.
87
+ # Moving between stages (alpha → beta → release) is `dx version set`.
40
88
  def bump_version(version, type)
41
- parts = version.split(".").map(&:to_i)
42
- parts = [0, 0, 0] if parts.length < 3
89
+ if type == "pre"
90
+ match = PRERELEASE_COUNTER.match(version)
91
+ return match && "#{match[1]}#{match[2].to_i + 1}"
92
+ end
93
+
94
+ match = BUMPABLE_VERSION.match(version)
95
+ return nil unless match
96
+
97
+ major, minor, patch = match.captures.map(&:to_i)
43
98
 
44
99
  case type
45
- when "major"
46
- parts[0] += 1
47
- parts[1] = 0
48
- parts[2] = 0
49
- when "minor"
50
- parts[1] += 1
51
- parts[2] = 0
52
- when "patch" then parts[2] += 1
100
+ when "major" then "#{major + 1}.0.0"
101
+ when "minor" then "#{major}.#{minor + 1}.0"
102
+ when "patch" then "#{major}.#{minor}.#{patch + 1}"
53
103
  end
54
-
55
- parts.join(".")
56
104
  end
57
105
 
58
106
  def version_error(message)
@@ -104,19 +152,26 @@ end
104
152
  # --- Subtools ---
105
153
 
106
154
  tool "bump" do
107
- desc "Bump version (major, minor, or patch)"
155
+ desc "Bump version (major, minor, patch, or pre)"
108
156
  long_desc <<~DESC
109
157
  Bump the project version following semantic versioning.
110
158
 
111
159
  MAJOR version for incompatible API changes
112
160
  MINOR version for backwards-compatible new functionality
113
161
  PATCH version for backwards-compatible bug fixes
162
+ PRE the counter of a prerelease: 2.0.0-alpha.0 -> 2.0.0-alpha.1
163
+ (RubyGems spelling works too: 2.0.0.alpha.0 -> 2.0.0.alpha.1)
164
+
165
+ major, minor and patch apply only to a plain MAJOR.MINOR.PATCH version;
166
+ pre applies only to a prerelease that ends in a numeric counter. Anything
167
+ else is refused rather than guessed at. To move between stages or to
168
+ release (2.0.0-alpha.3 -> 2.0.0-beta.0 -> 2.0.0), use `dx version set`.
114
169
  DESC
115
170
 
116
- required_arg :type, desc: "Version component: major, minor, or patch"
171
+ required_arg :type, desc: "Version component: major, minor, patch, or pre"
117
172
 
118
173
  def run
119
- version_error("Invalid version type '#{type}'. Use: major, minor, or patch") unless %w[major minor patch].include?(type)
174
+ version_error("Invalid version type '#{type}'. Use: major, minor, patch, or pre") unless %w[major minor patch pre].include?(type)
120
175
 
121
176
  version_error("Not in a project directory") unless cli.project_root
122
177
 
@@ -125,6 +180,16 @@ tool "bump" do
125
180
 
126
181
  old_version = read_version(version_file)
127
182
  new_version = bump_version(old_version, type)
183
+ unless new_version
184
+ reason = if type == "pre"
185
+ "'pre' needs a prerelease version ending in a numeric counter (e.g. 2.0.0-alpha.0)"
186
+ else
187
+ "'#{type}' only applies to a plain MAJOR.MINOR.PATCH version"
188
+ end
189
+ version_error("Can't bump '#{old_version}': #{reason}. " \
190
+ "Use `dx version set <version>` to choose the next version explicitly. Nothing was changed.")
191
+ end
192
+
128
193
  write_version(version_file, old_version, new_version)
129
194
 
130
195
  version_output(
@@ -136,10 +201,13 @@ end
136
201
  tool "set" do
137
202
  desc "Set version to a specific value"
138
203
 
139
- required_arg :version, desc: "Version string (e.g., 1.0.0)"
204
+ required_arg :version, desc: "Version string (e.g., 1.0.0, 2.0.0.pre, 2.0.0-rc.1)"
140
205
 
141
206
  def run
142
- version_error("Invalid version format '#{version}'. Use semantic versioning: MAJOR.MINOR.PATCH") unless version.match?(/^\d+\.\d+\.\d+/)
207
+ unless version.match?(SETTABLE_VERSION)
208
+ version_error("Invalid version format '#{version}'. " \
209
+ "Use MAJOR.MINOR.PATCH, optionally with a prerelease tail (e.g. 2.0.0.pre or 2.0.0-rc.1)")
210
+ end
143
211
 
144
212
  version_error("Not in a project directory") unless cli.project_root
145
213
 
data/lib/devex/cli.rb CHANGED
@@ -92,6 +92,20 @@ module Devex
92
92
  rescue OptionParser::ParseError => e
93
93
  Output.error(e.message)
94
94
  1
95
+ rescue LoadError => e
96
+ # Additive: surface the underlying LoadError cleanly, AND, only when
97
+ # the situation matches (in a project with a Gemfile but no
98
+ # delegation marker, and not already delegated), append an
99
+ # actionable hint pointing at the existing `.dx-use-local`
100
+ # affordance (ADR-003). Never swallows the real error — the hint
101
+ # is additional context. Without this, a project tool that
102
+ # requires a bundle-only path-gem (e.g. relata's tools/docs.rb →
103
+ # chiridion) raises a raw 12-line uncaught backtrace with no
104
+ # indication the dx-use-local mechanism exists.
105
+ Output.error(e.message)
106
+ hint = bundle_setup_hint(e)
107
+ warn hint if hint
108
+ 1
95
109
  end
96
110
  end
97
111
 
@@ -336,5 +350,42 @@ module Devex
336
350
  puts "#{@executable_name} #{VERSION}"
337
351
  end
338
352
  end
353
+
354
+ # Diagnostic hint for the LoadError rescue (#run). Returns a string
355
+ # actionable for the user when a project tool's `require` failed
356
+ # *and* this project has a Gemfile but no delegation marker (and we
357
+ # aren't already inside a delegated re-exec). Returns nil when the
358
+ # situation doesn't match — the underlying error stands on its own.
359
+ #
360
+ # The matched situation is the exact one ADR-003's `.dx-use-local`
361
+ # solves: a global `dx` runs project `tools/*.rb` in-process, so a
362
+ # `require` of a bundle-only path-gem fails until the project opts
363
+ # into bundle delegation. Without this hint the failure mode is a
364
+ # raw 12-line LoadError backtrace with no signal that the
365
+ # affordance exists.
366
+ def bundle_setup_hint(error)
367
+ return nil unless @config.respond_to?(:delegation_file)
368
+
369
+ delegation_file = @config.delegation_file
370
+ return nil if delegation_file.nil? || delegation_file.empty?
371
+ return nil if ENV[@config.env_var(:delegated)] # already delegated; another problem
372
+
373
+ dirs = Dirs.new(config: @config)
374
+ return nil unless dirs.in_project?
375
+
376
+ project_dir = dirs.project_dir
377
+ return nil unless (project_dir / "Gemfile").exist?
378
+ return nil if (project_dir / delegation_file).exist?
379
+
380
+ gem_name = error.message[/cannot load such file -- (\S+)/, 1] || "the missing file"
381
+ <<~HINT.chomp
382
+ hint: '#{gem_name}' may be a project dev-dependency in this project's Gemfile.
383
+ The global `#{@executable_name}` runs project tools/*.rb in-process, OUTSIDE
384
+ the project's bundle, so a path-gem or bundle-only gem isn't on $LOAD_PATH.
385
+ To make `#{@executable_name}` re-exec under `bundle exec` for this project:
386
+ touch #{delegation_file}
387
+ See devex ADR-003 for the delegation contract.
388
+ HINT
389
+ end
339
390
  end
340
391
  end
data/lib/devex/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Devex
4
- VERSION = "0.3.7"
4
+ VERSION = "0.3.8"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph A Wecker
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-01-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: |
14
13
  Devex provides a unified `dx` command for common development tasks. Features include:
@@ -24,31 +23,13 @@ executables:
24
23
  extensions: []
25
24
  extra_rdoc_files: []
26
25
  files:
27
- - ".obsidian/app.json"
28
- - ".obsidian/appearance.json"
29
- - ".obsidian/community-plugins.json"
30
- - ".obsidian/core-plugins.json"
31
- - ".obsidian/plugins/obsidian-minimal-settings/data.json"
32
- - ".obsidian/plugins/obsidian-minimal-settings/main.js"
33
- - ".obsidian/plugins/obsidian-minimal-settings/manifest.json"
34
- - ".obsidian/plugins/obsidian-style-settings/data.json"
35
- - ".obsidian/plugins/obsidian-style-settings/main.js"
36
- - ".obsidian/plugins/obsidian-style-settings/manifest.json"
37
- - ".obsidian/plugins/obsidian-style-settings/styles.css"
38
- - ".obsidian/plugins/table-editor-obsidian/data.json"
39
- - ".obsidian/plugins/table-editor-obsidian/main.js"
40
- - ".obsidian/plugins/table-editor-obsidian/manifest.json"
41
- - ".obsidian/plugins/table-editor-obsidian/styles.css"
42
- - ".obsidian/themes/AnuPpuccin/manifest.json"
43
- - ".obsidian/themes/AnuPpuccin/theme.css"
44
- - ".obsidian/themes/Minimal/manifest.json"
45
- - ".obsidian/themes/Minimal/theme.css"
46
26
  - ".rubocop.yml"
47
27
  - CHANGELOG.md
48
28
  - LICENSE
49
29
  - README.md
50
30
  - Rakefile
51
31
  - config/rubocop-dx.yml
32
+ - devex-0.3.7.gem
52
33
  - devex-logo.jpg
53
34
  - docs/developing-tools.md
54
35
  - docs/ref/agent-mode.md
@@ -101,7 +82,6 @@ licenses:
101
82
  metadata:
102
83
  changelog_uri: https://github.com/v2-io/devex/blob/main/CHANGELOG.md
103
84
  rubygems_mfa_required: 'true'
104
- post_install_message:
105
85
  rdoc_options: []
106
86
  require_paths:
107
87
  - lib
@@ -116,8 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
96
  - !ruby/object:Gem::Version
117
97
  version: '0'
118
98
  requirements: []
119
- rubygems_version: 3.5.22
120
- signing_key:
99
+ rubygems_version: 4.0.3
121
100
  specification_version: 4
122
101
  summary: Lightweight Ruby CLI framework with unified dx command for development tasks
123
102
  test_files: []
data/.obsidian/app.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "vimMode": true,
3
- "showInlineTitle": false,
4
- "readableLineLength": false,
5
- "showLineNumber": true
6
- }
@@ -1,4 +0,0 @@
1
- {
2
- "showRibbon": true,
3
- "cssTheme": "AnuPpuccin"
4
- }
@@ -1,5 +0,0 @@
1
- [
2
- "table-editor-obsidian",
3
- "obsidian-style-settings",
4
- "obsidian-minimal-settings"
5
- ]
@@ -1,33 +0,0 @@
1
- {
2
- "file-explorer": true,
3
- "global-search": true,
4
- "switcher": true,
5
- "graph": true,
6
- "backlink": true,
7
- "canvas": true,
8
- "outgoing-link": true,
9
- "tag-pane": true,
10
- "footnotes": false,
11
- "properties": true,
12
- "page-preview": true,
13
- "daily-notes": true,
14
- "templates": true,
15
- "note-composer": true,
16
- "command-palette": true,
17
- "slash-command": false,
18
- "editor-status": true,
19
- "bookmarks": true,
20
- "markdown-importer": false,
21
- "zk-prefixer": false,
22
- "random-note": false,
23
- "outline": true,
24
- "word-count": true,
25
- "slides": false,
26
- "audio-recorder": false,
27
- "workspaces": false,
28
- "file-recovery": true,
29
- "publish": false,
30
- "sync": true,
31
- "bases": true,
32
- "webviewer": false
33
- }
@@ -1,34 +0,0 @@
1
- {
2
- "lightStyle": "minimal-light",
3
- "darkStyle": "minimal-dark",
4
- "lightScheme": "minimal-default-light",
5
- "darkScheme": "minimal-default-dark",
6
- "editorFont": "",
7
- "lineHeight": 1.5,
8
- "lineWidth": 40,
9
- "lineWidthWide": 50,
10
- "maxWidth": 88,
11
- "textNormal": 16,
12
- "textSmall": 13,
13
- "imgGrid": false,
14
- "imgWidth": "img-default-width",
15
- "tableWidth": "table-default-width",
16
- "iframeWidth": "iframe-default-width",
17
- "mapWidth": "map-default-width",
18
- "chartWidth": "chart-default-width",
19
- "colorfulHeadings": false,
20
- "colorfulFrame": false,
21
- "colorfulActiveStates": false,
22
- "trimNames": true,
23
- "labeledNav": false,
24
- "fullWidthMedia": true,
25
- "bordersToggle": true,
26
- "minimalStatus": true,
27
- "focusMode": false,
28
- "underlineInternal": true,
29
- "underlineExternal": true,
30
- "folding": true,
31
- "lineNumbers": true,
32
- "readableLineLength": false,
33
- "devBlockWidth": false
34
- }
@@ -1,8 +0,0 @@
1
- /*
2
- THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
3
- if you want to view the source, please visit the github repository of this plugin
4
- */
5
-
6
- var x=Object.create;var u=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var v=n=>u(n,"__esModule",{value:!0});var O=(n,t)=>{v(n);for(var s in t)u(n,s,{get:t[s],enumerable:!0})},E=(n,t,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of W(t))!N.call(n,l)&&l!=="default"&&u(n,l,{get:()=>t[l],enumerable:!(s=L(t,l))||s.enumerable});return n},y=n=>E(v(u(n!=null?x(T(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var p=(n,t,s)=>new Promise((l,d)=>{var f=h=>{try{m(s.next(h))}catch(o){d(o)}},g=h=>{try{m(s.throw(h))}catch(o){d(o)}},m=h=>h.done?l(h.value):Promise.resolve(h.value).then(f,g);m((s=s.apply(n,t)).next())});O(exports,{default:()=>S});var C=y(require("obsidian"));var a=y(require("obsidian")),D={lightStyle:"minimal-light",darkStyle:"minimal-dark",lightScheme:"minimal-default-light",darkScheme:"minimal-default-dark",editorFont:"",lineHeight:1.5,lineWidth:40,lineWidthWide:50,maxWidth:88,textNormal:16,textSmall:13,imgGrid:!1,imgWidth:"img-default-width",tableWidth:"table-default-width",iframeWidth:"iframe-default-width",mapWidth:"map-default-width",chartWidth:"chart-default-width",colorfulHeadings:!1,colorfulFrame:!1,colorfulActiveStates:!1,trimNames:!0,labeledNav:!1,fullWidthMedia:!0,bordersToggle:!0,minimalStatus:!0,focusMode:!1,underlineInternal:!0,underlineExternal:!0,folding:!0,lineNumbers:!1,readableLineLength:!1,devBlockWidth:!1},b=class extends a.PluginSettingTab{constructor(t,s){super(t,s);this.plugin=s}display(){let{containerEl:t}=this;t.empty();let l=t.createEl("div",{cls:"setting-item setting-item-heading"}).createEl("div",{cls:"setting-item-info"});l.createEl("div",{text:"Color scheme",cls:"setting-item-name"});let d=l.createEl("div",{cls:"setting-item-description"});d.appendChild(createEl("span",{text:"To create a custom color scheme use the "})),d.appendChild(createEl("a",{text:"Style Settings",href:"obsidian://show-plugin?id=obsidian-style-settings"})),d.appendText(" plugin. See "),d.appendChild(createEl("a",{text:"documentation",href:"https://minimal.guide/features/color-schemes"})),d.appendText(" for details."),new a.Setting(t).setName("Light mode color scheme").setDesc("Preset color options for light mode.").addDropdown(i=>i.addOption("minimal-default-light","Default").addOption("minimal-atom-light","Atom").addOption("minimal-ayu-light","Ayu").addOption("minimal-catppuccin-light","Catppuccin").addOption("minimal-eink-light","E-ink (beta)").addOption("minimal-everforest-light","Everforest").addOption("minimal-flexoki-light","Flexoki").addOption("minimal-gruvbox-light","Gruvbox").addOption("minimal-macos-light","macOS").addOption("minimal-nord-light","Nord").addOption("minimal-rose-pine-light","Ros\xE9 Pine").addOption("minimal-notion-light","Sky").addOption("minimal-solarized-light","Solarized").addOption("minimal-things-light","Things").setValue(this.plugin.settings.lightScheme).onChange(e=>{this.plugin.settings.lightScheme=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateLightScheme()})),new a.Setting(t).setName("Light mode background contrast").setDesc("Level of contrast between sidebar and main content.").addDropdown(i=>i.addOption("minimal-light","Default").addOption("minimal-light-white","All white").addOption("minimal-light-tonal","Low contrast").addOption("minimal-light-contrast","High contrast").setValue(this.plugin.settings.lightStyle).onChange(e=>{this.plugin.settings.lightStyle=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateLightStyle()})),new a.Setting(t).setName("Dark mode color scheme").setDesc("Preset colors options for dark mode.").addDropdown(i=>i.addOption("minimal-default-dark","Default").addOption("minimal-atom-dark","Atom").addOption("minimal-ayu-dark","Ayu").addOption("minimal-catppuccin-dark","Catppuccin").addOption("minimal-dracula-dark","Dracula").addOption("minimal-eink-dark","E-ink (beta)").addOption("minimal-everforest-dark","Everforest").addOption("minimal-flexoki-dark","Flexoki").addOption("minimal-gruvbox-dark","Gruvbox").addOption("minimal-macos-dark","macOS").addOption("minimal-nord-dark","Nord").addOption("minimal-rose-pine-dark","Ros\xE9 Pine").addOption("minimal-notion-dark","Sky").addOption("minimal-solarized-dark","Solarized").addOption("minimal-things-dark","Things").setValue(this.plugin.settings.darkScheme).onChange(e=>{this.plugin.settings.darkScheme=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateDarkScheme()})),new a.Setting(t).setName("Dark mode background contrast").setDesc("Level of contrast between sidebar and main content.").addDropdown(i=>i.addOption("minimal-dark","Default").addOption("minimal-dark-tonal","Low contrast").addOption("minimal-dark-black","True black").setValue(this.plugin.settings.darkStyle).onChange(e=>{this.plugin.settings.darkStyle=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateDarkStyle()})),t.createEl("br");let g=t.createEl("div",{cls:"setting-item setting-item-heading"}).createEl("div",{cls:"setting-item-info"});g.createEl("div",{text:"Features",cls:"setting-item-name"});let m=g.createEl("div",{cls:"setting-item-description"});m.appendChild(createEl("span",{text:"See "})),m.appendChild(createEl("a",{text:"documentation",href:"https://minimal.guide"})),m.appendText(" for details."),new a.Setting(t).setName("Text labels for primary navigation").setDesc("Navigation items in the left sidebar uses text labels.").addToggle(i=>i.setValue(this.plugin.settings.labeledNav).onChange(e=>{this.plugin.settings.labeledNav=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Colorful window frame").setDesc("The top area of the app uses your accent color.").addToggle(i=>i.setValue(this.plugin.settings.colorfulFrame).onChange(e=>{this.plugin.settings.colorfulFrame=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Colorful active states").setDesc("Active file and menu items use your accent color.").addToggle(i=>i.setValue(this.plugin.settings.colorfulActiveStates).onChange(e=>{this.plugin.settings.colorfulActiveStates=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Colorful headings").setDesc("Headings use a different color for each size.").addToggle(i=>i.setValue(this.plugin.settings.colorfulHeadings).onChange(e=>{this.plugin.settings.colorfulHeadings=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Minimal status bar").setDesc("Turn off to use full-width status bar.").addToggle(i=>i.setValue(this.plugin.settings.minimalStatus).onChange(e=>{this.plugin.settings.minimalStatus=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Trim file names in sidebars").setDesc("Use ellipses to fit file names on a single line.").addToggle(i=>i.setValue(this.plugin.settings.trimNames).onChange(e=>{this.plugin.settings.trimNames=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Workspace borders").setDesc("Display divider lines between workspace elements.").addToggle(i=>i.setValue(this.plugin.settings.bordersToggle).onChange(e=>{this.plugin.settings.bordersToggle=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Focus mode").setDesc("Hide tab bar and status bar, hover to display. Can be toggled via hotkey.").addToggle(i=>i.setValue(this.plugin.settings.focusMode).onChange(e=>{this.plugin.settings.focusMode=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Underline internal links").setDesc("Show underlines on internal links.").addToggle(i=>i.setValue(this.plugin.settings.underlineInternal).onChange(e=>{this.plugin.settings.underlineInternal=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Underline external links").setDesc("Show underlines on external links.").addToggle(i=>i.setValue(this.plugin.settings.underlineExternal).onChange(e=>{this.plugin.settings.underlineExternal=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Maximize media").setDesc("Images and videos fill the width of the line.").addToggle(i=>i.setValue(this.plugin.settings.fullWidthMedia).onChange(e=>{this.plugin.settings.fullWidthMedia=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),t.createEl("br");let o=t.createEl("div",{cls:"setting-item setting-item-heading"}).createEl("div",{cls:"setting-item-info"});o.createEl("div",{text:"Layout",cls:"setting-item-name"});let r=o.createEl("div",{cls:"setting-item-description"});r.appendChild(createEl("span",{text:"These options can also be defined on a per-file basis, see "})),r.appendChild(createEl("a",{text:"documentation",href:"https://minimal.guide/features/block-width"})),r.appendText(" for details."),new a.Setting(t).setName("Image grids").setDesc("Turn consecutive images into columns \u2014 to make a new row, add an extra line break between images.").addToggle(i=>i.setValue(this.plugin.settings.imgGrid).onChange(e=>{this.plugin.settings.imgGrid=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Chart width").setDesc("Default width for chart blocks.").addDropdown(i=>i.addOption("chart-default-width","Default").addOption("chart-wide","Wide line width").addOption("chart-max","Maximum line width").addOption("chart-100","100% pane width").setValue(this.plugin.settings.chartWidth).onChange(e=>{this.plugin.settings.chartWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Iframe width").setDesc("Default width for iframe blocks.").addDropdown(i=>i.addOption("iframe-default-width","Default").addOption("iframe-wide","Wide line width").addOption("iframe-max","Maximum line width").addOption("iframe-100","100% pane width").setValue(this.plugin.settings.iframeWidth).onChange(e=>{this.plugin.settings.iframeWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Image width").setDesc("Default width for image blocks.").addDropdown(i=>i.addOption("img-default-width","Default").addOption("img-wide","Wide line width").addOption("img-max","Maximum line width").addOption("img-100","100% pane width").setValue(this.plugin.settings.imgWidth).onChange(e=>{this.plugin.settings.imgWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Map width").setDesc("Default width for map blocks.").addDropdown(i=>i.addOption("map-default-width","Default").addOption("map-wide","Wide line width").addOption("map-max","Maximum line width").addOption("map-100","100% pane width").setValue(this.plugin.settings.mapWidth).onChange(e=>{this.plugin.settings.mapWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Table width").setDesc("Default width for table and Dataview blocks.").addDropdown(i=>i.addOption("table-default-width","Default").addOption("table-wide","Wide line width").addOption("table-max","Maximum line width").addOption("table-100","100% pane width").setValue(this.plugin.settings.tableWidth).onChange(e=>{this.plugin.settings.tableWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),t.createEl("br"),t.createEl("div",{text:"Typography",cls:"setting-item setting-item-heading"}),new a.Setting(t).setName("Text font size").setDesc("Used for the main text (default 16).").addText(i=>i.setPlaceholder("16").setValue((this.plugin.settings.textNormal||"")+"").onChange(e=>{this.plugin.settings.textNormal=parseFloat(e),this.plugin.saveData(this.plugin.settings),this.plugin.setFontSize()})),new a.Setting(t).setName("Small font size").setDesc("Used for text in the sidebars and tabs (default 13).").addText(i=>i.setPlaceholder("13").setValue((this.plugin.settings.textSmall||"")+"").onChange(e=>{this.plugin.settings.textSmall=parseFloat(e),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Line height").setDesc("Line height of text (default 1.5).").addText(i=>i.setPlaceholder("1.5").setValue((this.plugin.settings.lineHeight||"")+"").onChange(e=>{this.plugin.settings.lineHeight=parseFloat(e),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Normal line width").setDesc("Number of characters per line (default 40).").addText(i=>i.setPlaceholder("40").setValue((this.plugin.settings.lineWidth||"")+"").onChange(e=>{this.plugin.settings.lineWidth=parseInt(e.trim()),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Wide line width").setDesc("Number of characters per line for wide elements (default 50).").addText(i=>i.setPlaceholder("50").setValue((this.plugin.settings.lineWidthWide||"")+"").onChange(e=>{this.plugin.settings.lineWidthWide=parseInt(e.trim()),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Maximum line width %").setDesc("Percentage of space inside a pane that a line can fill (default 88).").addText(i=>i.setPlaceholder("88").setValue((this.plugin.settings.maxWidth||"")+"").onChange(e=>{this.plugin.settings.maxWidth=parseInt(e.trim()),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Editor font").setDesc("Overrides the text font defined in Obsidian Appearance settings when in edit mode.").addText(i=>i.setPlaceholder("").setValue((this.plugin.settings.editorFont||"")+"").onChange(e=>{this.plugin.settings.editorFont=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()}))}};var S=class extends C.Plugin{onload(){return p(this,null,function*(){yield this.loadSettings(),this.addSettingTab(new b(this.app,this)),this.loadRules();let t=()=>{let i=this.app.vault.getConfig("baseFontSize");this.settings.textNormal=i;let e=!1,w=!1,k=!1;this.app.vault.getConfig("foldHeading")?(this.settings.folding=!0,console.log("Folding is on"),e=!0):(this.settings.folding=!1,console.log("Folding is off")),this.app.vault.getConfig("showLineNumber")?(this.settings.lineNumbers=!0,console.log("Line numbers are on"),w=!0):(this.settings.lineNumbers=!1,console.log("Line numbers are off")),this.app.vault.getConfig("readableLineLength")?(this.settings.readableLineLength=!0,console.log("Readable line length is on"),k=!0):(this.settings.readableLineLength=!1,console.log("Readable line length is off"));let c=document.body.classList;c.toggle("minimal-folding",e),c.toggle("minimal-line-nums",w),c.toggle("minimal-readable",k),c.toggle("minimal-readable-off",!k),this.saveData(this.settings)},s=()=>{let i=document.getElementsByClassName("mod-left-split")[0],e=document.getElementsByClassName("side-dock-ribbon")[0];i&&e&&document.body.classList.contains("theme-light")&&this.settings.lightStyle=="minimal-light-contrast"?(i.addClass("theme-dark"),e.addClass("theme-dark")):i&&e&&(i.removeClass("theme-dark"),e.removeClass("theme-dark"))};this.registerEvent(app.vault.on("config-changed",t)),this.registerEvent(app.workspace.on("css-change",s)),t(),app.workspace.onLayoutReady(()=>{s()});let l=["minimal-light","minimal-light-tonal","minimal-light-contrast","minimal-light-white"],d=["minimal-dark","minimal-dark-tonal","minimal-dark-black"],f=["img-grid","img-grid-ratio","img-nogrid"],g=["table-100","table-default-width","table-wide","table-max"],m=["iframe-100","iframe-default-width","iframe-wide","iframe-max"],h=["img-100","img-default-width","img-wide","img-max"],o=["map-100","map-default-width","map-wide","map-max"],r=["chart-100","chart-default-width","chart-wide","chart-max"];this.addCommand({id:"increase-body-font-size",name:"Increase body font size",callback:()=>{this.settings.textNormal=this.settings.textNormal+.5,this.saveData(this.settings),this.setFontSize()}}),this.addCommand({id:"decrease-body-font-size",name:"Decrease body font size",callback:()=>{this.settings.textNormal=this.settings.textNormal-.5,this.saveData(this.settings),this.setFontSize()}}),this.addCommand({id:"toggle-minimal-dark-cycle",name:"Cycle between dark mode styles",callback:()=>{this.settings.darkStyle=d[(d.indexOf(this.settings.darkStyle)+1)%d.length],this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-light-cycle",name:"Cycle between light mode styles",callback:()=>{this.settings.lightStyle=l[(l.indexOf(this.settings.lightStyle)+1)%l.length],this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-hidden-borders",name:"Toggle sidebar borders",callback:()=>{this.settings.bordersToggle=!this.settings.bordersToggle,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-colorful-headings",name:"Toggle colorful headings",callback:()=>{this.settings.colorfulHeadings=!this.settings.colorfulHeadings,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-focus-mode",name:"Toggle focus mode",callback:()=>{this.settings.focusMode=!this.settings.focusMode,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-colorful-frame",name:"Toggle colorful window frame",callback:()=>{this.settings.colorfulFrame=!this.settings.colorfulFrame,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-table-width",name:"Cycle between table width options",callback:()=>{this.settings.tableWidth=g[(g.indexOf(this.settings.tableWidth)+1)%g.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-image-width",name:"Cycle between image width options",callback:()=>{this.settings.imgWidth=h[(h.indexOf(this.settings.imgWidth)+1)%h.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-iframe-width",name:"Cycle between iframe width options",callback:()=>{this.settings.iframeWidth=m[(m.indexOf(this.settings.iframeWidth)+1)%m.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-chart-width",name:"Cycle between chart width options",callback:()=>{this.settings.chartWidth=r[(r.indexOf(this.settings.chartWidth)+1)%r.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-map-width",name:"Cycle between map width options",callback:()=>{this.settings.mapWidth=o[(o.indexOf(this.settings.mapWidth)+1)%o.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-img-grid",name:"Toggle image grids",callback:()=>{this.settings.imgGrid=!this.settings.imgGrid,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-switch",name:"Switch between light and dark mode",callback:()=>{this.updateTheme()}}),this.addCommand({id:"toggle-minimal-light-default",name:"Use light mode (default)",callback:()=>{this.settings.lightStyle="minimal-light",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-light-white",name:"Use light mode (all white)",callback:()=>{this.settings.lightStyle="minimal-light-white",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-light-tonal",name:"Use light mode (low contrast)",callback:()=>{this.settings.lightStyle="minimal-light-tonal",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-light-contrast",name:"Use light mode (high contrast)",callback:()=>{this.settings.lightStyle="minimal-light-contrast",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-dark-default",name:"Use dark mode (default)",callback:()=>{this.settings.darkStyle="minimal-dark",this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dark-tonal",name:"Use dark mode (low contrast)",callback:()=>{this.settings.darkStyle="minimal-dark-tonal",this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dark-black",name:"Use dark mode (true black)",callback:()=>{this.settings.darkStyle="minimal-dark-black",this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-atom-light",name:"Switch light color scheme to Atom (light)",callback:()=>{this.settings.lightScheme="minimal-atom-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-ayu-light",name:"Switch light color scheme to Ayu (light)",callback:()=>{this.settings.lightScheme="minimal-ayu-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-catppuccin-light",name:"Switch light color scheme to Catppuccin (light)",callback:()=>{this.settings.lightScheme="minimal-catppuccin-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-default-light",name:"Switch light color scheme to default (light)",callback:()=>{this.settings.lightScheme="minimal-default-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-gruvbox-light",name:"Switch light color scheme to Gruvbox (light)",callback:()=>{this.settings.lightScheme="minimal-gruvbox-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-eink-light",name:"Switch light color scheme to E-ink (light)",callback:()=>{this.settings.lightScheme="minimal-eink-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-everforest-light",name:"Switch light color scheme to Everforest (light)",callback:()=>{this.settings.lightScheme="minimal-everforest-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-flexoki-light",name:"Switch light color scheme to Flexoki (light)",callback:()=>{this.settings.lightScheme="minimal-flexoki-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-macos-light",name:"Switch light color scheme to macOS (light)",callback:()=>{this.settings.lightScheme="minimal-macos-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-notion-light",name:"Switch light color scheme to Sky (light)",callback:()=>{this.settings.lightScheme="minimal-notion-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-nord-light",name:"Switch light color scheme to Nord (light)",callback:()=>{this.settings.lightScheme="minimal-nord-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-rose-pine-light",name:"Switch light color scheme to Ros\xE9 Pine (light)",callback:()=>{this.settings.lightScheme="minimal-rose-pine-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-solarized-light",name:"Switch light color scheme to Solarized (light)",callback:()=>{this.settings.lightScheme="minimal-solarized-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-things-light",name:"Switch light color scheme to Things (light)",callback:()=>{this.settings.lightScheme="minimal-things-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-atom-dark",name:"Switch dark color scheme to Atom (dark)",callback:()=>{this.settings.darkScheme="minimal-atom-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-ayu-dark",name:"Switch dark color scheme to Ayu (dark)",callback:()=>{this.settings.darkScheme="minimal-ayu-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-catppuccin-dark",name:"Switch dark color scheme to Catppuccin (dark)",callback:()=>{this.settings.darkScheme="minimal-catppuccin-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dracula-dark",name:"Switch dark color scheme to Dracula (dark)",callback:()=>{this.settings.darkScheme="minimal-dracula-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-default-dark",name:"Switch dark color scheme to default (dark)",callback:()=>{this.settings.darkScheme="minimal-default-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-eink-dark",name:"Switch dark color scheme to E-ink (dark)",callback:()=>{this.settings.darkScheme="minimal-eink-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-everforest-dark",name:"Switch dark color scheme to Everforest (dark)",callback:()=>{this.settings.darkScheme="minimal-everforest-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-flexoki-dark",name:"Switch dark color scheme to Flexoki (dark)",callback:()=>{this.settings.darkScheme="minimal-flexoki-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-gruvbox-dark",name:"Switch dark color scheme to Gruvbox (dark)",callback:()=>{this.settings.darkScheme="minimal-gruvbox-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-macos-dark",name:"Switch dark color scheme to macOS (dark)",callback:()=>{this.settings.darkScheme="minimal-macos-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-nord-dark",name:"Switch dark color scheme to Nord (dark)",callback:()=>{this.settings.darkScheme="minimal-nord-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-notion-dark",name:"Switch dark color scheme to Sky (dark)",callback:()=>{this.settings.darkScheme="minimal-notion-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-rose-pine-dark",name:"Switch dark color scheme to Ros\xE9 Pine (dark)",callback:()=>{this.settings.darkScheme="minimal-rose-pine-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-solarized-dark",name:"Switch dark color scheme to Solarized (dark)",callback:()=>{this.settings.darkScheme="minimal-solarized-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-things-dark",name:"Switch dark color scheme to Things (dark)",callback:()=>{this.settings.darkScheme="minimal-things-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dev-block-width",name:"Dev \u2014 Show block widths",callback:()=>{this.settings.devBlockWidth=!this.settings.devBlockWidth,this.saveData(this.settings),this.refresh()}}),this.refresh()})}onunload(){console.log("Unloading Minimal Theme Settings plugin");let t=document.getElementsByClassName("mod-left-split")[0];t&&t.removeClass("theme-dark");let s=document.getElementsByClassName("side-dock-ribbon")[0];s&&s.removeClass("theme-dark"),this.unloadRules(),this.removeStyle(),this.removeSettings(),this.removeLightScheme(),this.removeDarkScheme()}loadSettings(){return p(this,null,function*(){this.settings=Object.assign(D,yield this.loadData())})}saveSettings(){return p(this,null,function*(){yield this.saveData(this.settings)})}refresh(){this.updateStyle()}loadRules(){let t=document.createElement("style");t.id="minimal-theme",document.getElementsByTagName("head")[0].appendChild(t),document.body.classList.add("minimal-theme"),this.updateStyle()}unloadRules(){let t=document.getElementById("minimal-theme");t&&t.parentNode.removeChild(t),document.body.classList.remove("minimal-theme")}setFontSize(){this.app.vault.setConfig("baseFontSize",this.settings.textNormal),this.app.updateFontSize()}updateStyle(){this.removeStyle(),this.removeSettings(),document.body.addClass(this.settings.lightStyle,this.settings.lightScheme,this.settings.darkStyle,this.settings.darkScheme),document.body.classList.toggle("borders-none",!this.settings.bordersToggle),document.body.classList.toggle("colorful-headings",this.settings.colorfulHeadings),document.body.classList.toggle("colorful-frame",this.settings.colorfulFrame),document.body.classList.toggle("colorful-active",this.settings.colorfulActiveStates),document.body.classList.toggle("minimal-focus-mode",this.settings.focusMode),document.body.classList.toggle("links-int-on",this.settings.underlineInternal),document.body.classList.toggle("links-ext-on",this.settings.underlineExternal),document.body.classList.toggle("full-width-media",this.settings.fullWidthMedia),document.body.classList.toggle("img-grid",this.settings.imgGrid),document.body.classList.toggle("minimal-dev-block-width",this.settings.devBlockWidth),document.body.classList.toggle("minimal-status-off",!this.settings.minimalStatus),document.body.classList.toggle("full-file-names",!this.settings.trimNames),document.body.classList.toggle("labeled-nav",this.settings.labeledNav),document.body.classList.toggle("minimal-folding",this.settings.folding),document.body.addClass(this.settings.chartWidth,this.settings.tableWidth,this.settings.imgWidth,this.settings.iframeWidth,this.settings.mapWidth);let t=document.getElementById("minimal-theme");if(t)t.innerText="body.minimal-theme{--font-ui-small:"+this.settings.textSmall+"px;--line-height:"+this.settings.lineHeight+";--line-width:"+this.settings.lineWidth+"rem;--line-width-wide:"+this.settings.lineWidthWide+"rem;--max-width:"+this.settings.maxWidth+"%;--font-editor-override:"+this.settings.editorFont+";";else throw"minimal-theme element not found!"}updateDarkStyle(){document.body.removeClass("theme-light","minimal-dark","minimal-dark-tonal","minimal-dark-black"),document.body.addClass("theme-dark",this.settings.darkStyle),this.app.vault.getConfig("theme")!=="system"&&(this.app.setTheme("obsidian"),this.app.vault.setConfig("theme","obsidian")),this.app.workspace.trigger("css-change")}updateLightStyle(){document.body.removeClass("theme-dark","minimal-light","minimal-light-tonal","minimal-light-contrast","minimal-light-white"),document.body.addClass("theme-light",this.settings.lightStyle),this.app.vault.getConfig("theme")!=="system"&&(this.app.setTheme("moonstone"),this.app.vault.setConfig("theme","moonstone")),this.app.workspace.trigger("css-change")}updateDarkScheme(){this.removeDarkScheme(),document.body.addClass(this.settings.darkScheme)}updateLightScheme(){this.removeLightScheme(),document.body.addClass(this.settings.lightScheme)}updateTheme(){if(this.app.vault.getConfig("theme")==="system")document.body.classList.contains("theme-light")?(document.body.removeClass("theme-light"),document.body.addClass("theme-dark")):(document.body.removeClass("theme-dark"),document.body.addClass("theme-light"));else{document.body.classList.contains("theme-light")?(document.body.removeClass("theme-light"),document.body.addClass("theme-dark")):(document.body.removeClass("theme-dark"),document.body.addClass("theme-light"));let s=this.app.vault.getConfig("theme")==="moonstone"?"obsidian":"moonstone";this.app.setTheme(s),this.app.vault.setConfig("theme",s)}this.app.workspace.trigger("css-change")}removeSettings(){document.body.removeClass("borders-none","colorful-headings","colorful-frame","colorful-active","minimal-focus-mode","links-int-on","links-ext-on","full-width-media","img-grid","minimal-dev-block-width","minimal-status-off","full-file-names","labeled-nav","minimal-folding"),document.body.removeClass("table-wide","table-max","table-100","table-default-width","iframe-wide","iframe-max","iframe-100","iframe-default-width","img-wide","img-max","img-100","img-default-width","chart-wide","chart-max","chart-100","chart-default-width","map-wide","map-max","map-100","map-default-width")}removeStyle(){document.body.removeClass("minimal-light","minimal-light-tonal","minimal-light-contrast","minimal-light-white","minimal-dark","minimal-dark-tonal","minimal-dark-black")}removeDarkScheme(){document.body.removeClass("minimal-atom-dark","minimal-ayu-dark","minimal-catppuccin-dark","minimal-default-dark","minimal-dracula-dark","minimal-eink-dark","minimal-everforest-dark","minimal-flexoki-dark","minimal-gruvbox-dark","minimal-macos-dark","minimal-nord-dark","minimal-notion-dark","minimal-rose-pine-dark","minimal-solarized-dark","minimal-things-dark")}removeLightScheme(){document.body.removeClass("minimal-atom-light","minimal-ayu-light","minimal-catppuccin-light","minimal-default-light","minimal-eink-light","minimal-everforest-light","minimal-flexoki-light","minimal-gruvbox-light","minimal-macos-light","minimal-nord-light","minimal-notion-light","minimal-rose-pine-light","minimal-solarized-light","minimal-things-light")}};
7
-
8
- /* nosourcemap */
@@ -1,11 +0,0 @@
1
- {
2
- "id": "obsidian-minimal-settings",
3
- "name": "Minimal Theme Settings",
4
- "version": "8.1.1",
5
- "minAppVersion": "1.1.9",
6
- "description": "Change the colors, fonts and features of Minimal Theme.",
7
- "author": "@kepano",
8
- "authorUrl": "https://www.twitter.com/kepano",
9
- "fundingUrl": "https://www.buymeacoffee.com/kepano",
10
- "isDesktopOnly": false
11
- }
@@ -1,15 +0,0 @@
1
- {
2
- "anuppuccin-theme-settings@@anuppuccin-theme-dark": "ctp-macchiato",
3
- "anuppuccin-theme-settings@@anuppuccin-light-theme-accents": "ctp-accent-light-rosewater",
4
- "anuppuccin-theme-settings@@anuppuccin-theme-accents": "ctp-accent-teal",
5
- "anuppuccin-theme-settings@@anp-button-metadata-toggle": true,
6
- "anuppuccin-theme-settings@@anp-print": true,
7
- "anuppuccin-theme-settings@@anp-autohide-titlebar": true,
8
- "anuppuccin-theme-settings@@anp-toggle-metadata": false,
9
- "anuppuccin-theme-settings@@anp-alt-rainbow-style": "anp-full-rainbow-color-toggle",
10
- "anuppuccin-theme-settings@@anp-header-color-toggle": true,
11
- "anuppuccin-theme-settings@@anp-header-margin-toggle": true,
12
- "anuppuccin-theme-settings@@anp-header-divider-color-toggle": true,
13
- "anuppuccin-theme-settings@@anp-decoration-toggle": true,
14
- "anuppuccin-theme-settings@@anp-header-margin-value": 8
15
- }