@patch-adams/core 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patch-adams/core",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Core patching engine for Rise course packages - inject CSS/JS into SCORM, cmi5, and xAPI courses",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,7 +16,8 @@
16
16
  }
17
17
  },
18
18
  "files": [
19
- "dist"
19
+ "dist",
20
+ "test-overrides"
20
21
  ],
21
22
  "scripts": {
22
23
  "build": "tsup",
@@ -0,0 +1,18 @@
1
+ /* Patch-Adams: CSS After (async)
2
+ * Style overrides for Rise courses
3
+ */
4
+
5
+ /* Example: Custom font */
6
+ html.pa-patched .blocks-text {
7
+ /* font-family: 'Your Font', sans-serif !important; */
8
+ }
9
+
10
+ /* Example: Hide Rise logo */
11
+ html.pa-patched .nav__logo {
12
+ /* display: none !important; */
13
+ }
14
+
15
+ /* Example: Custom accent color */
16
+ html.pa-patched .blocks-button {
17
+ /* background-color: #007bff !important; */
18
+ }
@@ -0,0 +1,7 @@
1
+ /* Patch-Adams: CSS Before (blocking)
2
+ * Hides content until everything is ready to prevent FOUC
3
+ */
4
+
5
+ html.pa-patched.pa-loading body {
6
+ visibility: hidden !important;
7
+ }
@@ -0,0 +1,16 @@
1
+ // Patch-Adams: JS After (async)
2
+ // Runs after Rise initializes - removes loading class to reveal content
3
+
4
+ (function() {
5
+ 'use strict';
6
+
7
+ // Remove loading class to reveal content
8
+ document.documentElement.classList.remove('pa-loading');
9
+ console.log('[Patch-Adams] After script loaded, content revealed');
10
+
11
+ // Add your post-initialization code here
12
+ // Example: Modify Rise elements after they're rendered
13
+ // document.querySelectorAll('.blocks-text').forEach(function(el) {
14
+ // // your modifications
15
+ // });
16
+ })();
@@ -0,0 +1,12 @@
1
+ // Patch-Adams: JS Before (blocking)
2
+ // Setup code that runs before Rise initializes
3
+
4
+ window.PatchAdams = {
5
+ version: '1.0.0',
6
+ loadedAt: new Date().toISOString(),
7
+ config: {
8
+ // Add your custom configuration here
9
+ }
10
+ };
11
+
12
+ console.log('[Patch-Adams] Before script loaded');
@@ -0,0 +1,24 @@
1
+ #!/bin/bash
2
+ # Simple HTTP server for testing Patch-Adams overrides locally
3
+ # Serves files on http://localhost:8080
4
+
5
+ PORT=${1:-8080}
6
+ DIR="$(cd "$(dirname "$0")" && pwd)"
7
+
8
+ echo "Serving Patch-Adams overrides from: $DIR"
9
+ echo "URL: http://localhost:$PORT"
10
+ echo ""
11
+ echo "Files available:"
12
+ echo " - http://localhost:$PORT/css/before.css"
13
+ echo " - http://localhost:$PORT/css/after.css"
14
+ echo " - http://localhost:$PORT/js/before.js"
15
+ echo " - http://localhost:$PORT/js/after.js"
16
+ echo ""
17
+ echo "Set your env: PATCH_ADAMS_DOMAIN=http://localhost:$PORT"
18
+ echo ""
19
+ echo "Press Ctrl+C to stop"
20
+ echo ""
21
+
22
+ # Use Python's built-in HTTP server (available on macOS)
23
+ cd "$DIR"
24
+ python3 -m http.server $PORT --bind 127.0.0.1