@sp-days-framework/docusaurus-plugin-interactive-tasks 1.1.0-beta1 → 1.1.0-beta2

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  toc_max_heading_level: 2
3
- sidebar_position: 4
3
+ sidebar_position: 4.1
4
4
  sidebar_label: "Change Logs"
5
5
  sidebar_custom_props:
6
6
  section: "Releases"
@@ -19,6 +19,25 @@ All packages within `@sp-days-framework` use the same version number. In some ca
19
19
 
20
20
  ---
21
21
 
22
+ ## Version 1.1.0-beta2 ![beta](https://img.shields.io/badge/release-beta-yellow)
23
+
24
+ Enhanced documentation with practical examples
25
+
26
+ <details>
27
+ <summary><strong>Beta Details</strong> (2025 December 09)</summary>
28
+
29
+ ### Improvements
30
+
31
+ - **Better Documentation**: Added new task examples with detailed output explanations
32
+ - Clearer demonstrations of plugin capabilities
33
+ - More practical usage examples for common scenarios
34
+ - **Improved Structure**: Updated sidebar positions and added known issues documentation
35
+ - **Visual Refinements**: Enhanced sidebar and navbar logo handling
36
+
37
+ </details>
38
+
39
+ ---
40
+
22
41
  ## Version 1.1.0-beta1 ![beta](https://img.shields.io/badge/release-beta-yellow)
23
42
 
24
43
  Show expected outputs and enjoy smoother interactions
package/docs/index.mdx CHANGED
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  title: Interactive Tasks
3
3
  hide_title: true
4
+ sidebar_class_name: title-logo-sidebar-docusaurus
5
+ sidebar_label: "Interactive Tasks"
4
6
  sidebar_position: 0
5
- sidebar_label: "📦 Interactive Tasks"
6
7
  ---
7
8
 
8
9
  import LogoDocusaurus from './logo-docusaurus.svg';
@@ -26,6 +27,64 @@ import LogoDocusaurus from './logo-docusaurus.svg';
26
27
  </div>
27
28
  </div>
28
29
 
30
+ <div style={{ position: 'relative', marginTop: '2rem', display: 'flex', justifyContent: 'center' }}>
31
+ <div style={{ position: 'absolute', left: '50%', marginTop: '4px', transform: 'translateX(-50%)', fontWeight: 500, color: 'var(--ifm-color-emphasis-600)' }}>
32
+ Preview
33
+ </div>
34
+ <div id="preview-task-example" style={{ borderRadius: '12px', padding: '2rem 1.7rem 0rem', background: 'var(--ifm-color-emphasis-200)' }}>
35
+ <style>{`
36
+ #preview-task-example h3 {
37
+ display: none !important;
38
+ }
39
+ `}</style>
40
+ ::::task-example[Calibrate the Flux Capacitor ⚡]
41
+
42
+ Great Scott, Marty! We need to recalibrate the **temporal documentation flux capacitor** to 1.21 gigawatts!
43
+
44
+ 1. Check the chronosync matrix for para-dimensional efficiency
45
+ 2. Initiate the **quantum state persistence protocol**
46
+ 3. Engage the localStorage temporal buffer
47
+ 4. Restart the cross-timeline synchronization array by running the following command:
48
+ ```bash
49
+ sudo systemctl restart ntpd
50
+ ```
51
+
52
+ :::hint
53
+ The "Mark as Done" actuator button is located in the down-right quadrant of the task containment field. A simple click should energize the completion state capacitor!
54
+ :::
55
+
56
+ :::output
57
+ If done correctly, you should observe the following temporal anomalies:
58
+
59
+ ```
60
+ ⚡ Flux capacitor status: ENGAGED
61
+ 📊 Temporal progress vector: SYNCHRONIZED
62
+ 💾 localStorage quantum buffer: PERSISTED
63
+ ✅ Task completion waveform: COLLAPSED TO TRUE STATE
64
+ ```
65
+
66
+ Heavy! Your progress just traveled through time! 🚗💨
67
+ :::
68
+
69
+ :::solution
70
+ When you check that box, the plugin harnesses the power of localStorage to preserve your completion state across multiple timeline iterations (browser sessions).
71
+
72
+ The temporal data persists even if you reload the page or jump to a different tab - it's like the DeLorean maintaining 88 mph across different roads!
73
+
74
+ Key features of the completion tracking system:
75
+ - **Persistent storage** across browser sessions
76
+ - **Real-time synchronization** between tabs
77
+ - **Automatic state management** for your learning progress
78
+ - **Cross-dimensional compatibility** (works in any timeline!)
79
+
80
+ *This is heavy... but in a good way!* 🎸
81
+ :::
82
+
83
+ ::::
84
+ </div>
85
+ </div>
86
+ <br/>
87
+
29
88
  ---
30
89
 
31
90
  ## Features
@@ -51,6 +110,16 @@ Install the Interactive Tasks plugin using npm or yarn.
51
110
  Use npm install or yarn add to install the package.
52
111
  :::
53
112
 
113
+ :::output
114
+ You should see output similar to:
115
+
116
+ ```
117
+ added 1 package, and audited 2 packages in 3s
118
+
119
+ found 0 vulnerabilities
120
+ ```
121
+ :::
122
+
54
123
  :::solution
55
124
  ```bash
56
125
  npm install @sp-days-framework/docusaurus-plugin-interactive-tasks
@@ -60,33 +129,31 @@ npm install @sp-days-framework/docusaurus-plugin-interactive-tasks
60
129
  ::::
61
130
  ````
62
131
 
63
- <div style={{ position: 'relative', marginTop: '2rem', display: 'flex', justifyContent: 'center' }}>
64
- <div style={{ position: 'absolute', left: '50%', marginTop: '4px', transform: 'translateX(-50%)', fontWeight: 500, color: 'var(--ifm-color-emphasis-600)' }}>
65
- Preview
66
- </div>
67
- <div id="preview-task-example" style={{ borderRadius: '12px', padding: '2rem 2rem 0rem 2rem', background: 'var(--ifm-color-emphasis-200)' }}>
68
- <style>{`
69
- #preview-task-example h3 {
70
- display: none !important;
71
- }
72
- `}</style>
73
- ::::task-example[Install the Plugin]
132
+ ::::task-example[Install the Plugin]
74
133
 
75
- Install the Interactive Tasks plugin using npm or yarn.
134
+ Install the Interactive Tasks plugin using npm or yarn.
76
135
 
77
- :::hint
78
- Use npm install or yarn add to install the package.
79
- :::
136
+ :::hint
137
+ Use npm install or yarn add to install the package.
138
+ :::
80
139
 
81
- :::solution
82
- ```bash
83
- npm install @sp-days-framework/docusaurus-plugin-interactive-tasks
84
- ```
85
- :::
140
+ :::output
141
+ You should see output similar to:
142
+
143
+ ```
144
+ added 1 package, and audited 2 packages in 3s
145
+
146
+ found 0 vulnerabilities
147
+ ```
148
+ :::
149
+
150
+ :::solution
151
+ ```bash
152
+ npm install @sp-days-framework/docusaurus-plugin-interactive-tasks
153
+ ```
154
+ :::
155
+
156
+ ::::
86
157
 
87
- ::::
88
- </div>
89
- </div>
90
- <br/>
91
158
 
92
159
  Tasks are automatically numbered, track completion in localStorage, and sync across browser tabs. See [Install](install.mdx) for installation and configuration.
@@ -0,0 +1,164 @@
1
+ ---
2
+ toc_max_heading_level: 2
3
+ sidebar_position: 4.2
4
+ sidebar_custom_props:
5
+ section: "Releases"
6
+ section_position: 4
7
+ ---
8
+
9
+ # Known Issues
10
+
11
+ ## Theme Resolution Chain Breaking
12
+
13
+ ### Overview
14
+
15
+ The Interactive Tasks plugin does not follow Docusaurus best practices for theme swizzling. The current implementation swizzles `DocRoot` using direct imports from `@docusaurus/theme-classic`, which bypasses Docusaurus's theme resolution system. This causes compatibility issues when used alongside other plugins that also swizzle MDX components.
16
+
17
+ ### Technical Explanation
18
+
19
+ #### How Docusaurus Theme Resolution Works
20
+
21
+ Docusaurus uses webpack aliases (`@theme/*` and `@theme-original/*`) to create a resolution chain when multiple plugins swizzle the same component:
22
+
23
+ ```
24
+ User Site
25
+ ↓ @theme/MDXComponents
26
+ Plugin A's MDXComponents
27
+ ↓ @theme-original/MDXComponents
28
+ Plugin B's MDXComponents
29
+ ↓ @theme-original/MDXComponents
30
+ Theme-Classic Base Components
31
+ ```
32
+
33
+ Each plugin receives the previous plugin's components and can add or modify them, creating a merged component set.
34
+
35
+ #### Why This Plugin Breaks the Chain
36
+
37
+ The Interactive Tasks plugin swizzles `DocRoot` to provide the `TaskProvider` context that wraps the entire docs layout:
38
+
39
+ ```tsx
40
+ // This direct import bypasses theme resolution
41
+ import OriginalDocRoot from '@docusaurus/theme-classic/lib/theme/DocRoot';
42
+ ```
43
+
44
+ **Why we use direct imports:**
45
+ - Importing via `@theme-original/DocRoot` would create infinite recursion if we're the only plugin swizzling DocRoot
46
+ - DocRoot needs to wrap both sidebar and content for task progress tracking
47
+ - Alternative components like `Root` don't provide access to docs-specific context
48
+
49
+ **Side effects:**
50
+ - Direct imports bypass webpack's theme alias system
51
+ - This creates inconsistencies in the module resolution graph
52
+ - Subsequent `@theme-original/*` imports in other plugins may fail to resolve correctly
53
+ - Standard MDX components may not propagate through the theme chain
54
+
55
+ #### Current Workaround
56
+
57
+ To compensate for breaking the theme chain, this plugin's `MDXComponents.tsx` explicitly imports and re-exports all standard components:
58
+
59
+ ```tsx
60
+ // Defensive imports to maintain component availability
61
+ import MDXCode from '@docusaurus/theme-classic/lib/theme/MDXComponents/Code';
62
+ import MDXDetails from '@docusaurus/theme-classic/lib/theme/MDXComponents/Details';
63
+ // ... etc
64
+ ```
65
+
66
+ This ensures that standard components (`Details`, `Code`, `Pre`, etc.) plus task components (`Task`, `Hint`, `Solution`, etc.) are available in MDX files.
67
+
68
+ ### Impact on Other Plugins
69
+
70
+ When another plugin loads after Interactive Tasks and tries to swizzle `MDXComponents`:
71
+
72
+ 1. The other plugin imports `@theme-original/MDXComponents`
73
+ 2. Due to the broken chain, it may not receive all expected components
74
+ 3. Standard components like `Details` might be missing
75
+ 4. Task components might not be available
76
+
77
+ **Workaround for compatible plugins:** Other plugins must adopt the same defensive pattern of explicitly importing standard components from theme-classic.
78
+
79
+ ### Affected Scenarios
80
+
81
+ This issue manifests when:
82
+
83
+ - Multiple plugins swizzle `MDXComponents`
84
+ - Pages use standard MDX components (`<details>`, code blocks, etc.)
85
+ - Pages use Interactive Tasks components (`<Task>`, `<Hint>`, etc.)
86
+
87
+ **Symptoms:**
88
+ - Build failures with "Expected component to be defined" errors
89
+ - Components missing at runtime
90
+ - Inconsistent component availability across different pages
91
+
92
+ ### Future Plans
93
+
94
+ #### Short-term
95
+ We're maintaining the current implementation because:
96
+ - It works reliably when plugins follow the defensive pattern
97
+ - The functionality (task progress tracking across sidebar and content) requires this scope
98
+ - Migration would be a breaking change for existing users
99
+
100
+ #### Long-term (Docusaurus 4.0+)
101
+ We plan to refactor the plugin to follow best practices:
102
+
103
+ **Option 1: Site-level Root Component**
104
+ Remove `DocRoot` swizzle and require users to add `TaskProvider` in their site's `src/theme/Root.tsx`:
105
+
106
+ ```tsx
107
+ import React from 'react';
108
+ import { TaskProvider } from '@sp-days-framework/docusaurus-plugin-interactive-tasks';
109
+
110
+ export default function Root({ children }) {
111
+ return <TaskProvider>{children}</TaskProvider>;
112
+ }
113
+ ```
114
+
115
+ **Pros:**
116
+ - Restores proper theme resolution
117
+ - Eliminates direct imports
118
+ - More maintainable
119
+
120
+ **Cons:**
121
+ - Breaking change
122
+ - Additional setup for users
123
+ - May not have docs-specific context
124
+
125
+ **Option 2: Docusaurus 4.0 APIs**
126
+ Wait for Docusaurus 4.0 which may provide:
127
+ - Better support for context providers
128
+ - Dedicated hooks for global context
129
+ - Clearer theme composition boundaries
130
+
131
+ ### Compatibility Guidelines
132
+
133
+ If you're developing plugins that work alongside Interactive Tasks:
134
+
135
+ 1. **Import standard components explicitly** in your `MDXComponents.tsx`:
136
+ ```tsx
137
+ import MDXDetails from '@docusaurus/theme-classic/lib/theme/MDXComponents/Details';
138
+ import MDXCode from '@docusaurus/theme-classic/lib/theme/MDXComponents/Code';
139
+ // ... other standard components
140
+ ```
141
+
142
+ 2. **Re-export all components** including those from `@theme-original`:
143
+ ```tsx
144
+ export default {
145
+ ...MDXComponents,
146
+ details: MDXDetails,
147
+ code: MDXCode,
148
+ // Your custom components
149
+ };
150
+ ```
151
+
152
+ 3. **Test with Interactive Tasks** enabled to ensure compatibility
153
+
154
+ ### Related Documentation
155
+
156
+ - [Docusaurus Swizzling Guide](https://docusaurus.io/docs/swizzling)
157
+ - [Wrapping your site with Root](https://docusaurus.io/docs/swizzling#wrapper-your-site-with-root)
158
+ - See `/PLUGIN-ISSUES.md` in the repository root for detailed technical analysis
159
+
160
+ ---
161
+
162
+ **Last Updated:** December 9, 2025
163
+ **Status:** No immediate fix planned, monitoring Docusaurus 4.0 development
164
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sp-days-framework/docusaurus-plugin-interactive-tasks",
3
- "version": "1.1.0-beta1",
3
+ "version": "1.1.0-beta2",
4
4
  "description": "A Docusaurus plugin for interactive task components with progress tracking",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,9 +12,9 @@ module.exports = {
12
12
  beforeDefaultRemarkPlugins: [
13
13
  [
14
14
  require("./lib/index.js").remarkTaskDirective,
15
- {
15
+ {
16
16
  tocHeadingLevel: 3,
17
- }
17
+ },
18
18
  ],
19
19
  ],
20
20
  };