Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/dist/v1/chartifact.editor.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2952,8 +2952,8 @@ document.addEventListener('DOMContentLoaded', () => {
(_a = this.iframe.contentWindow) == null ? void 0 : _a.postMessage(message, "*");
}
getDependencies() {
const { hostname, origin } = window.location;
const url = hostname === "localhost" ? origin : "https://microsoft.github.io";
const { hostname, origin, port } = window.location;
const url = hostname === "localhost" && port === "4000" ? origin : "https://microsoft.github.io";
return `
<link href="https://unpkg.com/tabulator-tables@6.3.0/dist/css/tabulator.min.css" rel="stylesheet" />
<link href="${url}/chartifact/dist/v1/chartifact-reset.css" rel="stylesheet" />
Expand Down
4 changes: 2 additions & 2 deletions docs/dist/v1/chartifact.host.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2952,8 +2952,8 @@ document.addEventListener('DOMContentLoaded', () => {
(_a = this.iframe.contentWindow) == null ? void 0 : _a.postMessage(message, "*");
}
getDependencies() {
const { hostname, origin } = window.location;
const url = hostname === "localhost" ? origin : "https://microsoft.github.io";
const { hostname, origin, port } = window.location;
const url = hostname === "localhost" && port === "4000" ? origin : "https://microsoft.github.io";
return `
<link href="https://unpkg.com/tabulator-tables@6.3.0/dist/css/tabulator.min.css" rel="stylesheet" />
<link href="${url}/chartifact/dist/v1/chartifact-reset.css" rel="stylesheet" />
Expand Down
4 changes: 2 additions & 2 deletions docs/dist/v1/chartifact.sandbox.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ document.addEventListener('DOMContentLoaded', () => {
(_a = this.iframe.contentWindow) == null ? void 0 : _a.postMessage(message, "*");
}
getDependencies() {
const { hostname, origin } = window.location;
const url = hostname === "localhost" ? origin : "https://microsoft.github.io";
const { hostname, origin, port } = window.location;
const url = hostname === "localhost" && port === "4000" ? origin : "https://microsoft.github.io";
return `
<link href="https://unpkg.com/tabulator-tables@6.3.0/dist/css/tabulator.min.css" rel="stylesheet" />
<link href="${url}/chartifact/dist/v1/chartifact-reset.css" rel="stylesheet" />
Expand Down
10 changes: 5 additions & 5 deletions packages/html-wrapper/test/test-umd.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h2>Test 3: JSON Viewer</h2>
<script src="https://microsoft.github.io/chartifact/dist/v1/chartifact.compiler.umd.js"></script>

<!-- Load html-wrapper UMD bundle -->
<script src="../../docs/dist/v1/chartifact.html-wrapper.umd.js"></script>
<script src="../../../docs/dist/v1/chartifact.html-wrapper.umd.js"></script>

<script>
// Test 1: Check if the module loaded
Expand All @@ -108,8 +108,8 @@ <h2>Test 3: JSON Viewer</h2>
function initializeViewers() {
const mdTestDiv = document.getElementById('md-test');
try {
const result = Chartifact.htmlWrapper.initMarkdownViewer('#source-md', '#preview-md', '.chartifact-toolbar-md');
if (result && result.sandbox && result.toolbar) {
const result = Chartifact.htmlWrapper.htmlMarkdownWrapper('#source-md', '#preview-md', '.chartifact-toolbar-md');
if (result) {
mdTestDiv.innerHTML = '<span class="success">✓ Markdown viewer initialized successfully!</span>';
} else {
mdTestDiv.innerHTML = '<span class="error">✗ Markdown viewer initialization returned unexpected result</span>';
Expand All @@ -120,8 +120,8 @@ <h2>Test 3: JSON Viewer</h2>

const jsonTestDiv = document.getElementById('json-test');
try {
const result = Chartifact.htmlWrapper.initJsonViewer('#source-json', '#preview-json', '.chartifact-toolbar-json');
if (result && result.sandbox && result.toolbar) {
const result = Chartifact.htmlWrapper.htmlJsonWrapper('#source-json', '#preview-json', '.chartifact-toolbar-json');
if (result) {
jsonTestDiv.innerHTML = '<span class="success">✓ JSON viewer initialized successfully!</span>';
} else {
jsonTestDiv.innerHTML = '<span class="error">✗ JSON viewer initialization returned unexpected result</span>';
Expand Down
4 changes: 2 additions & 2 deletions packages/sandbox/src/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export class Sandbox {
}

getDependencies() {
const { hostname, origin } = window.location;
const url = (hostname === 'localhost')
const { hostname, origin, port } = window.location;
const url = (hostname === 'localhost' && port === '4000')
? origin
: 'https://microsoft.github.io';
return `
Expand Down
Loading