File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
apps/playground/src/instruments/examples/interactive/Interactive-With-Legacy-Script
packages/react-core/src/components/InteractiveContent Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 33import { defineInstrument } from '/runtime/v1/@opendatacapture/runtime-core' ;
44import { z } from '/runtime/v1/[email protected] ' ; 55
6- import './legacy.js' ;
6+ import './legacy.js?legacy ' ;
77
88export default defineInstrument ( {
99 kind : 'INTERACTIVE' ,
Original file line number Diff line number Diff line change @@ -52,6 +52,16 @@ if (!bundle) {
5252}
5353
5454const instrument = await evaluateInstrument ( bundle ) ;
55+
56+ /** @type {string[] | undefined } */
57+ const scripts = instrument . content . __injectHead ?. scripts ;
58+ scripts ?. forEach ( ( encodedScript ) => {
59+ const script = document . createElement ( 'script' ) ;
60+ script . type = 'text/javascript' ;
61+ script . textContent = atob ( encodedScript ) ;
62+ document . head . appendChild ( script ) ;
63+ } ) ;
64+
5565const encodedStyle = instrument . content . __injectHead ?. style ;
5666if ( encodedStyle ) {
5767 const style = atob ( encodedStyle ) ;
You can’t perform that action at this time.
0 commit comments