lightview 2.0.6 → 2.0.7
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.
|
@@ -159,6 +159,11 @@ function examplify(target, options = {}) {
|
|
|
159
159
|
function getIframeContent(codeContent) {
|
|
160
160
|
const currentTheme = document.documentElement.getAttribute('data-theme');
|
|
161
161
|
const themeAttr = currentTheme ? ` data-theme="${currentTheme}"` : '';
|
|
162
|
+
|
|
163
|
+
const path = window.location.pathname;
|
|
164
|
+
const baseDir = path.substring(0, path.lastIndexOf('/') + 1);
|
|
165
|
+
const baseTag = useOrigin ? `<base href="${useOrigin}${baseDir}">` : '';
|
|
166
|
+
|
|
162
167
|
const autoResizeScript = autoResize ? `
|
|
163
168
|
<script>
|
|
164
169
|
const frameId = '${iframeId}';
|
|
@@ -193,6 +198,7 @@ function examplify(target, options = {}) {
|
|
|
193
198
|
return `<!DOCTYPE html>
|
|
194
199
|
<html${themeAttr}>
|
|
195
200
|
<head>
|
|
201
|
+
${baseTag}
|
|
196
202
|
<style>
|
|
197
203
|
/* Hide body until stylesheets are loaded to prevent FOUC */
|
|
198
204
|
body {
|
|
@@ -145,7 +145,7 @@ const { div, h1, p, style } = tags;
|
|
|
145
145
|
// These functions return Lightview elements (access raw DOM via .domEl)
|
|
146
146
|
const App = div({ class: 'hero' },
|
|
147
147
|
h1('Welcome to Lightview'),
|
|
148
|
-
p('Lightview is a
|
|
148
|
+
p('Lightview is a library for building modern web interfaces.')
|
|
149
149
|
);
|
|
150
150
|
|
|
151
151
|
// 2. The $ Function for Selections & Content
|