markawesome 0.15.0 → 0.16.0
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/CHANGELOG.md +11 -0
- data/README.md +1 -1
- data/lib/markawesome/transformers/copy_button_transformer.rb +10 -0
- data/lib/markawesome/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eee224c1babae361baa15c8c0f0a65bebf839d9debc599bf8e4a43bb3752bdb4
|
|
4
|
+
data.tar.gz: 9d8d78ec8aaf682bf252c634a220fa7cb9283ec15dc70c280d69967ed9f2945b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: edb36c15048371cf37c3d860d214faacc61158b9a497f09293ade0fb152b02bcb0c7a37ed1db0725939f1bea4d5159aad9bf3452456120ed5c5250c55dd61f4b
|
|
7
|
+
data.tar.gz: 112fbcbb947dc90348bc2c187b0ee3a8379fba4bff06e8da0ee3f8b550e9307933333795e245a524b41478b41fc75875f33a62f1b63263a13c5dabd16a37475f
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.16.0] - 2026-06-25
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `CopyButtonTransformer` now accepts a `tooltip:full|copy|none` token controlling Web Awesome's `<wa-copy-button>` **`tooltip`** attribute (added in WA 3.6) — the *mode* of the built-in hover affordance, distinct from the existing `tooltip-placement`:
|
|
12
|
+
- **`full`** (WA default) — the tooltip shows on hover **and** focus, and is reused to display the brief copy-success/error feedback. Emitting `tooltip="full"` is explicit-but-redundant.
|
|
13
|
+
- **`copy`** — the tooltip stays **silent on hover/focus** and appears **only briefly to confirm a successful or failed copy** (feedback-only, no hover hint).
|
|
14
|
+
- **`none`** — no tooltip in any state.
|
|
15
|
+
- The token is a `key:value` form (like `distance:N`, `icon:name`), order-independent with the other copy-button tokens. The capture is **enum-anchored** (`full|copy|none`), so invalid values such as `tooltip:bogus` simply don't match and are dropped, falling back to WA's default — consistent with the "unknown tokens dropped" convention. Emit order stays deterministic: `tooltip` follows `tooltip-placement`.
|
|
16
|
+
- The plain-markdown degradation path (`render_as_markdown`) is unaffected — the wrapper and all params are discarded, leaving only the copied content.
|
|
17
|
+
|
|
7
18
|
## [0.15.0] - 2026-06-24
|
|
8
19
|
|
|
9
20
|
### Added
|
data/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Used as the transformation engine for the [jekyll-webawesome](https://github.com
|
|
|
20
20
|
| **Card** | `===` | `:::wa-card` | `<wa-card>content</wa-card>` |
|
|
21
21
|
| **Carousel** | `~~~~~~` | `:::wa-carousel` | `<wa-carousel>` with carousel items |
|
|
22
22
|
| **Comparison** | `\|\|\|` or `\|\|\|25` | `:::wa-comparison` or `:::wa-comparison 25` | `<wa-comparison>` with before/after slots |
|
|
23
|
-
| **Copy Button** |
|
|
23
|
+
| **Copy Button** | `<<<placement? tooltip:full\|copy\|none?` | `:::wa-copy-button placement? tooltip:full\|copy\|none?` | `<wa-copy-button value="content" tooltip-placement="top" tooltip="copy"></wa-copy-button>` |
|
|
24
24
|
| **Details** | `^^^appearance? icon-placement?` | `:::wa-details appearance? icon-placement?` | `<wa-details>content</wa-details>` |
|
|
25
25
|
| **Dialog** | `???params?` | `:::wa-dialog params?` | `<wa-dialog>` with trigger button and content |
|
|
26
26
|
| **Icon** | `$$$icon-name` | `:::wa-icon icon-name` | `<wa-icon name="icon-name"></wa-icon>` |
|
|
@@ -10,6 +10,7 @@ module Markawesome
|
|
|
10
10
|
#
|
|
11
11
|
# Params: space-separated tokens, any order (rightmost-wins for conflicts)
|
|
12
12
|
# Placement: top, right, bottom, left
|
|
13
|
+
# Tooltip mode: tooltip:full|copy|none (when the built-in tooltip appears)
|
|
13
14
|
# Duration: numeric value (feedback-duration in milliseconds)
|
|
14
15
|
# Flags: disabled
|
|
15
16
|
# Labels: copy-label="text", success-label="text", error-label="text"
|
|
@@ -37,6 +38,8 @@ module Markawesome
|
|
|
37
38
|
disabled: %w[disabled]
|
|
38
39
|
}.freeze
|
|
39
40
|
|
|
41
|
+
TOOLTIP_MODES = %w[full copy none].freeze
|
|
42
|
+
|
|
40
43
|
def self.transform(content)
|
|
41
44
|
# Define both regex patterns - capture params as a single string
|
|
42
45
|
primary_regex = /^<<<(.*?)\n(.*?)\n<<</m
|
|
@@ -58,6 +61,10 @@ module Markawesome
|
|
|
58
61
|
# Extract numeric feedback-duration
|
|
59
62
|
attributes[:feedback_duration] = ::Regexp.last_match(1) if params_string =~ /\b(\d+)\b/
|
|
60
63
|
|
|
64
|
+
# Extract tooltip mode (enum-anchored: invalid values simply don't match and are dropped)
|
|
65
|
+
tooltip_mode_regex = /\btooltip:(#{TOOLTIP_MODES.join('|')})\b/
|
|
66
|
+
attributes[:tooltip] = ::Regexp.last_match(1) if params_string =~ tooltip_mode_regex
|
|
67
|
+
|
|
61
68
|
build_copy_button_html(copy_content, attributes)
|
|
62
69
|
end
|
|
63
70
|
|
|
@@ -98,6 +105,9 @@ module Markawesome
|
|
|
98
105
|
# Add tooltip placement
|
|
99
106
|
attr_parts << "tooltip-placement=\"#{attributes[:placement]}\"" if attributes[:placement]
|
|
100
107
|
|
|
108
|
+
# Add tooltip mode
|
|
109
|
+
attr_parts << "tooltip=\"#{attributes[:tooltip]}\"" if attributes[:tooltip]
|
|
110
|
+
|
|
101
111
|
# Add custom labels
|
|
102
112
|
attr_parts << "copy-label=\"#{attributes[:copy_label]}\"" if attributes[:copy_label]
|
|
103
113
|
attr_parts << "success-label=\"#{attributes[:success_label]}\"" if attributes[:success_label]
|
data/lib/markawesome/version.rb
CHANGED