Skip to content

Commit

Permalink
πŸ› Fix pathing for module loading (#2643)
Browse files Browse the repository at this point in the history
* πŸ› Fix pathing for module loading

* πŸ› Fix initial tour buttons
  • Loading branch information
chuckcarpenter authored Mar 18, 2024
1 parent 0c90c85 commit f8cc647
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
4 changes: 1 addition & 3 deletions landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "pnpm run copy && astro dev",
"dev": "astro dev",
"start": "astro dev",
"copy": "cp -r ../shepherd.js/dist ./public",
"prebuild": "pnpm run copy",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
Expand Down
32 changes: 12 additions & 20 deletions landing/src/layouts/MainPage.astro
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ const shepherdIncludeCode = `
</Base>

<!-- Welcome page -->
<script type='module' is:inline>
<script>
'use strict';
import Shepherd from './dist/shepherd.js';
import Shepherd from 'shepherd.js';
import type { StepOptionsButton } from 'shepherd.js/step';

(function () {
function init() {
Expand All @@ -187,9 +188,8 @@ const shepherdIncludeCode = `
}

function setupShepherd() {
Shepherd.init(
'shp_97943967a5cb84a5ccd46febff8972cd4667e142e5996030130498eebc3f8236'
);
Shepherd.init(import.meta.env.PUBLIC_SHEPHERD_PUBLIC_KEY);
// @ts-ignore
var shepherd = new Shepherd.Tour({
defaultStepOptions: {
cancelIcon: {
Expand Down Expand Up @@ -223,7 +223,7 @@ const shepherdIncludeCode = `
},
text: 'Next'
}
],
] as StepOptionsButton[],
id: 'welcome'
}
],
Expand Down Expand Up @@ -257,7 +257,7 @@ const shepherdIncludeCode = `
},
text: 'Next'
}
],
] as StepOptionsButton[],
id: 'including'
},
{
Expand All @@ -283,7 +283,7 @@ const shepherdIncludeCode = `
},
text: 'Next'
}
],
] as StepOptionsButton[],
id: 'creating'
},
{
Expand All @@ -307,7 +307,7 @@ const shepherdIncludeCode = `
},
text: 'Next'
}
],
] as StepOptionsButton[],
id: 'attaching'
}
];
Expand All @@ -332,7 +332,7 @@ const shepherdIncludeCode = `
},
text: 'Next'
}
],
] as StepOptionsButton[],
id: 'centered-example'
});

Expand All @@ -357,23 +357,15 @@ const shepherdIncludeCode = `
},
text: 'Done'
}
],
] as StepOptionsButton[],
id: 'followup',
modalOverlayOpeningPadding: '10'
});
return shepherd;
}

function ready() {
if (
document.attachEvent
? document.readyState === 'complete'
: document.readyState !== 'loading'
) {
init();
} else {
document.addEventListener('DOMContentLoaded', init);
}
document.addEventListener('DOMContentLoaded', init);
}

ready();
Expand Down

0 comments on commit f8cc647

Please sign in to comment.