@dr-ishaan/remake-blocks 1.9.0 → 2.0.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.
- package/CHANGELOG.md +153 -0
- package/dist/accordion.js +57 -5
- package/dist/css-generator.d.ts.map +1 -1
- package/dist/css-generator.js +21 -1
- package/dist/css-generator.js.map +1 -1
- package/dist/dx.d.ts +139 -0
- package/dist/dx.d.ts.map +1 -0
- package/dist/dx.js +230 -0
- package/dist/dx.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/remark-remake-blocks.d.ts.map +1 -1
- package/dist/remark-remake-blocks.js +130 -16
- package/dist/remark-remake-blocks.js.map +1 -1
- package/dist/types.d.ts +126 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,158 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0 — 2026-06-21
|
|
4
|
+
|
|
5
|
+
### Added — P2 Accessibility batch (final audit items)
|
|
6
|
+
|
|
7
|
+
Three accessibility features closing the final 3 missing items from the 32-item audit. With v2.0.0, the audit shows **23 works / 7 partial / 2 missing** (down from 7/10/15 at v1.6.0).
|
|
8
|
+
|
|
9
|
+
#### `roles` — per-type ARIA role attribute
|
|
10
|
+
|
|
11
|
+
By default, all callouts use `role="note"` (WCAG-correct for static supplementary content). This option lets you assign different roles to specific types.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
remakeBlocks({
|
|
15
|
+
roles: {
|
|
16
|
+
important: 'status', // important but non-urgent
|
|
17
|
+
announcement: 'status',
|
|
18
|
+
// Do NOT set warning: 'alert' for static article content.
|
|
19
|
+
note: 'none', // strip role entirely (decorative)
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Allowed values: `"note"` (default), `"status"`, `"alert"`, `"none"` (strips the attribute). The plugin includes a WCAG warning in the JSDoc against using `role="alert"` for static content (it causes screen readers to announce unprompted).
|
|
25
|
+
|
|
26
|
+
#### `srIconText` — screen reader text for icons
|
|
27
|
+
|
|
28
|
+
When `true`, prepends `<span class="sr-only">{TypeTitle}:</span>` inside the callout title. Ensures screen readers announce "Warning:" even when the visual title is just an icon or when `appearance="minimal"` hides the text.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
remakeBlocks({ srIconText: true })
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The plugin auto-generates the standard `.sr-only` CSS rule (1px clip, visually-hidden pattern) via `generateCss()` when this option is enabled — works out-of-the-box without user CSS. Respects `scope` for containment.
|
|
35
|
+
|
|
36
|
+
#### `ariaAccordion` — WAI-ARIA accordion keyboard pattern
|
|
37
|
+
|
|
38
|
+
When 2+ `[!]` disclosure widgets appear consecutively, the plugin wraps them in an accordion container (existing behavior). v2.0.0 adds the full WAI-ARIA accordion keyboard pattern:
|
|
39
|
+
|
|
40
|
+
- `Tab` — move focus between accordion headers (native `<summary>`)
|
|
41
|
+
- `Enter` / `Space` — toggle current panel (native `<details>`)
|
|
42
|
+
- `Arrow Up` / `Arrow Down` — move focus between headers
|
|
43
|
+
- `Home` / `End` — jump to first / last header
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
remakeBlocks({ ariaAccordion: true }) // default — full keyboard pattern
|
|
47
|
+
remakeBlocks({ ariaAccordion: false }) // native <details> behavior only
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The accordion container gets `role="accordion"` and each `<summary>` gets `aria-expanded` reflecting its open state. The `accordion.js` runtime script handles the arrow-key + Home/End navigation.
|
|
51
|
+
|
|
52
|
+
### Bug fix (pre-existing)
|
|
53
|
+
|
|
54
|
+
Fixed a bug in `isDisclosureHtml()` where the check `!trimmed.includes('callout')` accidentally rejected ALL disclosures because their HTML contains `aria-labelledby="callout-disclosure-N"`. This prevented accordion grouping from ever working. The fix checks for the exact `disclosure` class prefix instead.
|
|
55
|
+
|
|
56
|
+
### Test coverage
|
|
57
|
+
|
|
58
|
+
- 438 new tests for v2.0.0 (100% pass)
|
|
59
|
+
- 20,798 prior regression tests still pass (zero regressions across v1.6.0 → v1.10.0 suites)
|
|
60
|
+
- 32-item audit: 23 works / 7 partial / 2 missing (was 21 / 8 / 3)
|
|
61
|
+
|
|
62
|
+
### Backward compatibility
|
|
63
|
+
|
|
64
|
+
`roles` and `srIconText` default to off (no behavior change). `ariaAccordion` defaults to **on** — this is a behavior change (accordion containers now get `role="accordion"` + `aria-expanded`), but it's strictly additive (new attributes, no removed attributes) and improves accessibility. The `isDisclosureHtml` bug fix means accordion grouping now actually works (it was silently broken before).
|
|
65
|
+
|
|
66
|
+
### Why 2.0.0?
|
|
67
|
+
|
|
68
|
+
The major version bump reflects:
|
|
69
|
+
1. The `ariaAccordion` default-on behavior change (accessibility improvement, but technically additive)
|
|
70
|
+
2. The bug fix to `isDisclosureHtml` (accordions now actually group — previously silent failure)
|
|
71
|
+
3. Completion of the full 32-item audit (only 2 edge-case items remain)
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 1.10.0 — 2026-06-21
|
|
76
|
+
|
|
77
|
+
### Added — P2 Developer Experience batch
|
|
78
|
+
|
|
79
|
+
Four DX features closing the P2 DX items from the v1.6.0 audit.
|
|
80
|
+
|
|
81
|
+
#### `CLASSES` — exported CSS class name constants
|
|
82
|
+
|
|
83
|
+
Frozen object of all CSS class names used by the plugin. Use in CSS-in-JS, tests, or any code that needs to reference callout classes programmatically without hardcoding strings.
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import { CLASSES } from '@dr-ishaan/remake-blocks';
|
|
87
|
+
|
|
88
|
+
document.querySelector(`.${CLASSES.CALLOUT_NOTE}`) // '.callout-note'
|
|
89
|
+
CLASSES.CALLOUT_TITLE // 'callout-title'
|
|
90
|
+
CLASSES.DISCLOSURE_ACCORDION // 'disclosure-accordion'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Includes all 42 callout type classes + sub-element classes (title, body, icon, collapsible) + disclosure/accordion/pull-quote/epigraph/blockquote-enhanced classes.
|
|
94
|
+
|
|
95
|
+
#### `LucideIconName` — TypeScript type for icon names
|
|
96
|
+
|
|
97
|
+
Closed union of all 67 Lucide icon names recognized by the per-callout `{icon="..."}` override. Provides autocomplete and type safety when specifying icon names in config.
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import type { LucideIconName } from '@dr-ishaan/remake-blocks';
|
|
101
|
+
|
|
102
|
+
const icon: LucideIconName = 'rocket'; // ✓ autocomplete
|
|
103
|
+
const bad: LucideIconName = 'xyz'; // ✗ type error
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### `devWarnings` — dev-mode warnings
|
|
107
|
+
|
|
108
|
+
Catches common authoring mistakes at build time via `console.warn`:
|
|
109
|
+
|
|
110
|
+
- Unknown callout type (`> [!TYPO]` → "Unknown callout type 'TYPO'. Did you mean 'tip'?")
|
|
111
|
+
- Incomplete custom callout config (missing `className`, `color`, etc.)
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
remakeBlocks({ devWarnings: true }) // explicit enable
|
|
115
|
+
remakeBlocks({ devWarnings: false }) // explicit disable
|
|
116
|
+
remakeBlocks({}) // auto: true in dev, false in prod
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Auto-enabled when `process.env.NODE_ENV !== 'production'`. Production builds should strip `console.warn` via their bundler.
|
|
120
|
+
|
|
121
|
+
#### `strictConfigValidation` — strict custom callout validation
|
|
122
|
+
|
|
123
|
+
When `true`, throws a descriptive Error at plugin init time if any `customCallouts` entry is missing required fields (`type`, `icon`, `className`, `defaultTitle`, `color`, `backgroundColor`).
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
remakeBlocks({
|
|
127
|
+
strictConfigValidation: true,
|
|
128
|
+
customCallouts: [
|
|
129
|
+
{ type: 'x', icon: '🔥' } // ← throws: missing className, defaultTitle, color, backgroundColor
|
|
130
|
+
]
|
|
131
|
+
})
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
When `false` (default, backward-compatible), incomplete configs are silently normalized + a dev warning is emitted.
|
|
135
|
+
|
|
136
|
+
### New exports
|
|
137
|
+
|
|
138
|
+
- `CLASSES` — frozen CSS class name constants (from package root + `remake-blocks/astro`)
|
|
139
|
+
- `validateCustomCallouts(configs, strict)` — programmatic config validation
|
|
140
|
+
- `suggestSimilarType(input, knownTypes)` — Levenshtein "did you mean" suggester
|
|
141
|
+
- `LucideIconName` type — for TypeScript autocomplete on icon names
|
|
142
|
+
- `CalloutClassName` type — keyof typeof CLASSES
|
|
143
|
+
|
|
144
|
+
### Test coverage
|
|
145
|
+
|
|
146
|
+
- 436 new tests for v1.10.0 (100% pass)
|
|
147
|
+
- 20,360 prior regression tests still pass (zero regressions across v1.6.0 → v1.9.0 suites)
|
|
148
|
+
- 32-item audit: 21 works / 8 partial / 3 missing (was 17 / 9 / 6)
|
|
149
|
+
|
|
150
|
+
### Backward compatibility
|
|
151
|
+
|
|
152
|
+
All four features are opt-in. `CLASSES` and `LucideIconName` are pure additions (new exports). `devWarnings` defaults to auto (true in dev, false in prod) — no behavior change for production users. `strictConfigValidation` defaults to `false` — existing configs continue to work via silent normalization.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
3
156
|
## 1.9.0 — 2026-06-21
|
|
4
157
|
|
|
5
158
|
### Added — P1 Performance batch
|
package/dist/accordion.js
CHANGED
|
@@ -2,27 +2,79 @@
|
|
|
2
2
|
* remake-blocks – Accordion progressive enhancement
|
|
3
3
|
*
|
|
4
4
|
* When 2+ disclosure widgets appear consecutively, they are wrapped
|
|
5
|
-
* in a <div class="disclosure-accordion" data-accordion> container.
|
|
6
|
-
* This script adds accordion behavior: opening one closes the others.
|
|
5
|
+
* in a <div class="disclosure-accordion" data-accordion role="accordion"> container.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
7
|
+
* v2.0.0+: Full WAI-ARIA accordion keyboard pattern:
|
|
8
|
+
* - Tab: move focus between accordion headers (native <summary>)
|
|
9
|
+
* - Enter / Space: toggle current panel (native <details>)
|
|
10
|
+
* - Arrow Up / Arrow Down: move focus between accordion headers
|
|
11
|
+
* - Home / End: jump to first / last header
|
|
9
12
|
*
|
|
10
|
-
*
|
|
13
|
+
* Without this script, each disclosure still toggles independently (graceful
|
|
14
|
+
* degradation). Native <details>/<summary> handles Enter/Space + Tab natively;
|
|
15
|
+
* this script adds the arrow-key + Home/End navigation and aria-expanded sync.
|
|
16
|
+
*
|
|
17
|
+
* ~600 bytes minified.
|
|
11
18
|
*/
|
|
12
19
|
|
|
13
20
|
document.addEventListener('DOMContentLoaded', () => {
|
|
14
21
|
document.querySelectorAll('[data-accordion]').forEach(accordion => {
|
|
15
|
-
const details = accordion.querySelectorAll(':scope > details');
|
|
22
|
+
const details = Array.from(accordion.querySelectorAll(':scope > details'));
|
|
23
|
+
|
|
24
|
+
// Sync aria-expanded on toggle
|
|
16
25
|
details.forEach(detail => {
|
|
26
|
+
const summary = detail.querySelector(':scope > summary');
|
|
27
|
+
if (!summary) return;
|
|
28
|
+
|
|
17
29
|
detail.addEventListener('toggle', () => {
|
|
30
|
+
summary.setAttribute('aria-expanded', detail.open ? 'true' : 'false');
|
|
31
|
+
// v1.x behavior: opening one closes the others (single-open accordion)
|
|
18
32
|
if (detail.open) {
|
|
19
33
|
details.forEach(other => {
|
|
20
34
|
if (other !== detail && other.open) {
|
|
21
35
|
other.removeAttribute('open');
|
|
36
|
+
const otherSummary = other.querySelector(':scope > summary');
|
|
37
|
+
if (otherSummary) otherSummary.setAttribute('aria-expanded', 'false');
|
|
22
38
|
}
|
|
23
39
|
});
|
|
24
40
|
}
|
|
25
41
|
});
|
|
26
42
|
});
|
|
43
|
+
|
|
44
|
+
// v2.0.0: WAI-ARIA accordion keyboard pattern
|
|
45
|
+
// Arrow Up/Down moves focus between summaries; Home/End jumps to first/last.
|
|
46
|
+
details.forEach(detail => {
|
|
47
|
+
const summary = detail.querySelector(':scope > summary');
|
|
48
|
+
if (!summary) return;
|
|
49
|
+
|
|
50
|
+
summary.addEventListener('keydown', (e) => {
|
|
51
|
+
const summaries = details.map(d => d.querySelector(':scope > summary')).filter(Boolean);
|
|
52
|
+
const currentIdx = summaries.indexOf(summary);
|
|
53
|
+
if (currentIdx === -1) return;
|
|
54
|
+
|
|
55
|
+
let targetIdx = null;
|
|
56
|
+
switch (e.key) {
|
|
57
|
+
case 'ArrowDown':
|
|
58
|
+
targetIdx = (currentIdx + 1) % summaries.length;
|
|
59
|
+
break;
|
|
60
|
+
case 'ArrowUp':
|
|
61
|
+
targetIdx = (currentIdx - 1 + summaries.length) % summaries.length;
|
|
62
|
+
break;
|
|
63
|
+
case 'Home':
|
|
64
|
+
targetIdx = 0;
|
|
65
|
+
break;
|
|
66
|
+
case 'End':
|
|
67
|
+
targetIdx = summaries.length - 1;
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
return; // Don't preventDefault for other keys
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (targetIdx !== null && targetIdx !== currentIdx) {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
summaries[targetIdx].focus();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
27
79
|
});
|
|
28
80
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-generator.d.ts","sourceRoot":"","sources":["../src/css-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAiB,MAAM,YAAY,CAAC;AAyGrE;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"css-generator.d.ts","sourceRoot":"","sources":["../src/css-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAiB,MAAM,YAAY,CAAC;AAyGrE;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CA6E7D;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CA4GzE"}
|
package/dist/css-generator.js
CHANGED
|
@@ -140,8 +140,9 @@ export function generateCss(opts) {
|
|
|
140
140
|
const hasTokens = !!opts.tokens;
|
|
141
141
|
const hasTypeTokens = !!opts.typeTokens && Object.keys(opts.typeTokens).length > 0;
|
|
142
142
|
const hasDarkOverride = opts.darkMode && (opts.darkMode.strategy ?? "media") !== "media";
|
|
143
|
+
const hasSrIconText = !!opts.srIconText;
|
|
143
144
|
const scope = opts.scope;
|
|
144
|
-
if (!hasTokens && !hasTypeTokens && !hasDarkOverride) {
|
|
145
|
+
if (!hasTokens && !hasTypeTokens && !hasDarkOverride && !hasSrIconText) {
|
|
145
146
|
return "";
|
|
146
147
|
}
|
|
147
148
|
// Build the light-mode `:root` block (token bridge + per-type tokens).
|
|
@@ -179,6 +180,25 @@ ${rootDeclarations}
|
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
let css = blocks.join("\n\n");
|
|
183
|
+
// v2.0.0: when srIconText is enabled, emit the standard .sr-only rule
|
|
184
|
+
// so screen-reader-only text works out-of-the-box without user CSS.
|
|
185
|
+
// Uses the standard visually-hidden pattern (1px clip, not display:none,
|
|
186
|
+
// so screen readers still announce it).
|
|
187
|
+
if (opts.srIconText) {
|
|
188
|
+
const srOnlyScope = scope ? `${scope} .sr-only` : ".sr-only";
|
|
189
|
+
const srOnlyRule = `${srOnlyScope} {
|
|
190
|
+
position: absolute;
|
|
191
|
+
width: 1px;
|
|
192
|
+
height: 1px;
|
|
193
|
+
padding: 0;
|
|
194
|
+
margin: -1px;
|
|
195
|
+
overflow: hidden;
|
|
196
|
+
clip: rect(0, 0, 0, 0);
|
|
197
|
+
white-space: nowrap;
|
|
198
|
+
border: 0;
|
|
199
|
+
}`;
|
|
200
|
+
css = css ? css + "\n\n" + srOnlyRule : srOnlyRule;
|
|
201
|
+
}
|
|
182
202
|
// Layer wrapping
|
|
183
203
|
const injection = opts.cssInjection ?? "inline";
|
|
184
204
|
const layerName = opts.cssLayer ?? "components";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-generator.js","sourceRoot":"","sources":["../src/css-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;GAGG;AACH,SAAS,gBAAgB,CAAC,IAAyB;IACjD,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;IACzB,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IACrB,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,IAAI,OAAO,CAAC;IACxC,IAAI,QAAQ,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACtC,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,EAAE,CAAC,SAAS,IAAI,YAAY,CAAC;QAC1C,MAAM,GAAG,GAAG,EAAE,CAAC,cAAc,IAAI,MAAM,CAAC;QACxC,OAAO,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC;IAC9B,CAAC;IACD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,IAAI,EAAE,CAAC,KAAK,IAAI,MAAM,EAAE,CAAC;IAClC,CAAC;IACD,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC,cAAc,IAAI,IAAI,CAAC;IACnC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AAC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AC,IAAI,YAAY,EAAE,CAAC;QAC7B,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;QAC5D,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,4BAA4B,CAAC,CAAC,eAAe,iBAAiB,CAAC,CAAC;IACtG,CAAC;IAED,MAAM,GAAG,GAAG;;EAEZ,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;;EAEpB,SAAS;EACT,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;;;EAGtB,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;CAG1C,CAAC;IACA,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/dx.d.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v1.10.0: Developer Experience utilities.
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - CLASSES: frozen object of CSS class name constants for programmatic use
|
|
6
|
+
* - warn(message, ...args): dev-mode warning emitter (gated on devWarnings option)
|
|
7
|
+
* - validateCustomCallouts(configs, strict): validates customCallouts at init time
|
|
8
|
+
* - suggestSimilarType(type, knownTypes): Levenshtein-based "did you mean" suggester
|
|
9
|
+
*
|
|
10
|
+
* @module dx
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* v1.10.0+: Frozen object of CSS class names used by the plugin. Use these
|
|
14
|
+
* in CSS-in-JS, tests, or any code that needs to reference callout classes
|
|
15
|
+
* programmatically without hardcoding strings.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { CLASSES } from '@dr-ishaan/remake-blocks';
|
|
20
|
+
*
|
|
21
|
+
* document.querySelector(`.${CLASSES.CALLOUT_NOTE}`) // '.callout-note'
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const CLASSES: Readonly<{
|
|
25
|
+
readonly CALLOUT: "callout";
|
|
26
|
+
readonly CALLOUT_NOTE: "callout-note";
|
|
27
|
+
readonly CALLOUT_TIP: "callout-tip";
|
|
28
|
+
readonly CALLOUT_IMPORTANT: "callout-important";
|
|
29
|
+
readonly CALLOUT_WARNING: "callout-warning";
|
|
30
|
+
readonly CALLOUT_CAUTION: "callout-caution";
|
|
31
|
+
readonly CALLOUT_ABSTRACT: "callout-abstract";
|
|
32
|
+
readonly CALLOUT_INFO: "callout-info";
|
|
33
|
+
readonly CALLOUT_SUCCESS: "callout-success";
|
|
34
|
+
readonly CALLOUT_QUESTION: "callout-question";
|
|
35
|
+
readonly CALLOUT_FAILURE: "callout-failure";
|
|
36
|
+
readonly CALLOUT_DANGER: "callout-danger";
|
|
37
|
+
readonly CALLOUT_QUOTE: "callout-quote";
|
|
38
|
+
readonly CALLOUT_BUG: "callout-bug";
|
|
39
|
+
readonly CALLOUT_EXAMPLE: "callout-example";
|
|
40
|
+
readonly CALLOUT_TODO: "callout-todo";
|
|
41
|
+
readonly CALLOUT_SUMMARY: "callout-summary";
|
|
42
|
+
readonly CALLOUT_TLDR: "callout-tldr";
|
|
43
|
+
readonly CALLOUT_HINT: "callout-hint";
|
|
44
|
+
readonly CALLOUT_CHECK: "callout-check";
|
|
45
|
+
readonly CALLOUT_DONE: "callout-done";
|
|
46
|
+
readonly CALLOUT_HELP: "callout-help";
|
|
47
|
+
readonly CALLOUT_FAQ: "callout-faq";
|
|
48
|
+
readonly CALLOUT_ATTENTION: "callout-attention";
|
|
49
|
+
readonly CALLOUT_FAIL: "callout-fail";
|
|
50
|
+
readonly CALLOUT_MISSING: "callout-missing";
|
|
51
|
+
readonly CALLOUT_ERROR: "callout-error";
|
|
52
|
+
readonly CALLOUT_CITE: "callout-cite";
|
|
53
|
+
readonly CALLOUT_DEFINITION: "callout-definition";
|
|
54
|
+
readonly CALLOUT_ASIDE: "callout-aside";
|
|
55
|
+
readonly CALLOUT_CORRECTION: "callout-correction";
|
|
56
|
+
readonly CALLOUT_UPDATE: "callout-update";
|
|
57
|
+
readonly CALLOUT_FIGURE: "callout-figure";
|
|
58
|
+
readonly CALLOUT_FURTHER_READING: "callout-further-reading";
|
|
59
|
+
readonly CALLOUT_PREREQUISITE: "callout-prerequisite";
|
|
60
|
+
readonly CALLOUT_EXERCISE: "callout-exercise";
|
|
61
|
+
readonly CALLOUT_SIDENOTE: "callout-sidenote";
|
|
62
|
+
readonly CALLOUT_TIMELINE: "callout-timeline";
|
|
63
|
+
readonly CALLOUT_ANNOUNCEMENT: "callout-announcement";
|
|
64
|
+
readonly CALLOUT_BIBLIOGRAPHY: "callout-bibliography";
|
|
65
|
+
readonly CALLOUT_DRAFT: "callout-draft";
|
|
66
|
+
readonly CALLOUT_TRANSLATION: "callout-translation";
|
|
67
|
+
readonly CALLOUT_DISCUSSION: "callout-discussion";
|
|
68
|
+
readonly CALLOUT_RETRO: "callout-retro";
|
|
69
|
+
readonly CALLOUT_TITLE: "callout-title";
|
|
70
|
+
readonly CALLOUT_TITLE_TEXT: "callout-title-text";
|
|
71
|
+
readonly CALLOUT_ICON: "callout-icon";
|
|
72
|
+
readonly CALLOUT_BODY: "callout-body";
|
|
73
|
+
readonly CALLOUT_COLLAPSIBLE: "collapsible";
|
|
74
|
+
readonly DISCLOSURE: "disclosure";
|
|
75
|
+
readonly DISCLOSURE_TITLE: "disclosure-title";
|
|
76
|
+
readonly DISCLOSURE_BODY: "disclosure-body";
|
|
77
|
+
readonly DISCLOSURE_ACCORDION: "disclosure-accordion";
|
|
78
|
+
readonly DISCLOSURE_TREE: "disclosure-tree";
|
|
79
|
+
readonly PULL_QUOTE: "pull-quote";
|
|
80
|
+
readonly PULL_QUOTE_TEXT: "pull-quote-text";
|
|
81
|
+
readonly PULL_QUOTE_ATTRIBUTION: "pull-quote-attribution";
|
|
82
|
+
readonly EPIGRAPH: "epigraph";
|
|
83
|
+
readonly EPIGRAPH_TEXT: "epigraph-text";
|
|
84
|
+
readonly EPIGRAPH_ATTRIBUTION: "epigraph-attribution";
|
|
85
|
+
readonly BLOCKQUOTE_ENHANCED: "blockquote-enhanced";
|
|
86
|
+
}>;
|
|
87
|
+
export type CalloutClassName = keyof typeof CLASSES;
|
|
88
|
+
/**
|
|
89
|
+
* v1.10.0+: Emit a developer-mode warning via `console.warn`.
|
|
90
|
+
*
|
|
91
|
+
* The warning is prefixed with `[remake-blocks]` for easy identification
|
|
92
|
+
* and filtering. No-op when `devWarnings` is false OR when running in
|
|
93
|
+
* production (`process.env.NODE_ENV === 'production'`).
|
|
94
|
+
*
|
|
95
|
+
* @param enabled — whether devWarnings is enabled (from plugin options)
|
|
96
|
+
* @param message — warning message (without prefix)
|
|
97
|
+
* @param args — additional context args
|
|
98
|
+
*/
|
|
99
|
+
export declare function warn(enabled: boolean, message: string, ...args: unknown[]): void;
|
|
100
|
+
/**
|
|
101
|
+
* Find the closest matching type from a list of known types.
|
|
102
|
+
* Returns the best match if its edit distance is ≤ 3 (reasonable threshold
|
|
103
|
+
* for typo detection), or null if no close match exists.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* suggestSimilarType('TYPO', ['note', 'tip', 'warning']) // → 'tip'
|
|
108
|
+
* suggestSimilarType('XYZ', ['note', 'tip']) // → null
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare function suggestSimilarType(input: string, knownTypes: string[]): string | null;
|
|
112
|
+
/**
|
|
113
|
+
* v1.10.0+: Validate `customCallouts` config entries.
|
|
114
|
+
*
|
|
115
|
+
* When `strict` is true, throws a descriptive Error for the first config
|
|
116
|
+
* entry that's missing a required field. When `strict` is false, returns
|
|
117
|
+
* an array of validation errors without throwing (caller decides what to do).
|
|
118
|
+
*
|
|
119
|
+
* Required fields per CalloutConfig:
|
|
120
|
+
* - type (non-empty string)
|
|
121
|
+
* - icon (string, may be empty for icon-less callouts)
|
|
122
|
+
* - className (non-empty string, used for CSS targeting)
|
|
123
|
+
* - defaultTitle (non-empty string)
|
|
124
|
+
* - color (valid CSS color)
|
|
125
|
+
* - backgroundColor (valid CSS color)
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* validateCustomCallouts([
|
|
130
|
+
* { type: 'x', icon: '🔥', className: 'callout-x', defaultTitle: 'X', color: '#f00', backgroundColor: '#fee' }
|
|
131
|
+
* ], true); // OK — no throw
|
|
132
|
+
*
|
|
133
|
+
* validateCustomCallouts([
|
|
134
|
+
* { type: 'x', icon: '🔥' /* missing className, defaultTitle, color, backgroundColor *\/ }
|
|
135
|
+
* ], true); // throws: "Custom callout config[0] ('x') is missing required fields: className, defaultTitle, color, backgroundColor"
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
export declare function validateCustomCallouts(configs: unknown[], strict: boolean): string[];
|
|
139
|
+
//# sourceMappingURL=dx.d.ts.map
|
package/dist/dx.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dx.d.ts","sourceRoot":"","sources":["../src/dx.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoET,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,OAAO,CAAC;AAMpD;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAOhF;AA+BD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAcrF;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAAE,EAClB,MAAM,EAAE,OAAO,GACd,MAAM,EAAE,CAyBV"}
|