@marimo-team/islands 0.25.1-dev40 → 0.25.1-dev42
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/dist/{ErrorBoundary-CAJO-M56.js → ErrorBoundary-CWuZo_jl.js} +1 -1
- package/dist/{code-visibility-XU9RAJNV.js → code-visibility-zy0I69Uk.js} +1 -1
- package/dist/{common-C0fbrgB8.js → common-BpXhmKhg.js} +1 -1
- package/dist/{data-grid-overlay-editor-BnhbJgoq.js → data-grid-overlay-editor-DehDwcz3.js} +1 -1
- package/dist/{feedback-button-B0QSkbSp.js → feedback-button-D7RctDmF.js} +2 -2
- package/dist/{glide-data-editor-ymIQdwrb.js → glide-data-editor-dJrhOJ58.js} +3 -3
- package/dist/{globals-B0S3-e_D.js → globals-CN9pkgU1.js} +1 -1
- package/dist/main.js +6 -6
- package/dist/{number-overlay-editor-DB3HJDI1.js → number-overlay-editor-C0v6K7od.js} +1 -1
- package/dist/{reveal-component-CfTzIkA2.js → reveal-component-8RjqibNI.js} +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/markdown/markdown-renderer.css +1 -1
- package/src/components/static-html/__tests__/share-modal.test.tsx +154 -0
- package/src/components/static-html/__tests__/stage-for-publish.test.ts +111 -0
- package/src/components/static-html/share-modal.tsx +114 -145
- package/src/components/static-html/stage-for-publish.ts +56 -0
- package/src/core/network/__tests__/export-asset-url.test.ts +45 -0
- package/src/core/network/export-asset-url.ts +19 -0
- package/src/core/network/requests-network.ts +2 -7
- package/src/core/wasm/bridge.ts +2 -7
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import type { ExportAsHTMLRequest } from "./types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* In dev/test the CDN has no assets for the local build, so exports default
|
|
7
|
+
* to the dev server. Callers publishing to a remote origin pass their own
|
|
8
|
+
* assetUrl, which is left untouched.
|
|
9
|
+
*/
|
|
10
|
+
export function withDevAssetUrl(
|
|
11
|
+
request: ExportAsHTMLRequest,
|
|
12
|
+
): ExportAsHTMLRequest {
|
|
13
|
+
const isDevOrTest =
|
|
14
|
+
process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
|
|
15
|
+
if (request.assetUrl == null && isDevOrTest) {
|
|
16
|
+
return { ...request, assetUrl: window.location.origin };
|
|
17
|
+
}
|
|
18
|
+
return request;
|
|
19
|
+
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
waitForConnectionOpen,
|
|
12
12
|
waitForConnectionOpenIfNotebook,
|
|
13
13
|
} from "./connection";
|
|
14
|
+
import { withDevAssetUrl } from "./export-asset-url";
|
|
14
15
|
import type { EditRequests, RunRequests } from "./types";
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -430,15 +431,9 @@ export function createNetworkRequests(): EditRequests & RunRequests {
|
|
|
430
431
|
.then(handleResponse);
|
|
431
432
|
},
|
|
432
433
|
exportAsHTML: async (request) => {
|
|
433
|
-
if (
|
|
434
|
-
process.env.NODE_ENV === "development" ||
|
|
435
|
-
process.env.NODE_ENV === "test"
|
|
436
|
-
) {
|
|
437
|
-
request.assetUrl = window.location.origin;
|
|
438
|
-
}
|
|
439
434
|
return getClient()
|
|
440
435
|
.POST("/api/export/html", {
|
|
441
|
-
body: request,
|
|
436
|
+
body: withDevAssetUrl(request),
|
|
442
437
|
parseAs: "text",
|
|
443
438
|
params: getParams(),
|
|
444
439
|
})
|
package/src/core/wasm/bridge.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { notebookIsRunningAtom } from "../cells/cells";
|
|
|
14
14
|
import type { CommandMessage } from "../kernel/messages";
|
|
15
15
|
import { getInitialAppMode } from "../mode";
|
|
16
16
|
import { API } from "../network/api";
|
|
17
|
+
import { withDevAssetUrl } from "../network/export-asset-url";
|
|
17
18
|
import type {
|
|
18
19
|
EditRequests,
|
|
19
20
|
EnvironmentInfo,
|
|
@@ -535,15 +536,9 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
535
536
|
request: ExportAsHTMLRequest,
|
|
536
537
|
) => {
|
|
537
538
|
await this.pendingSessionSave;
|
|
538
|
-
if (
|
|
539
|
-
process.env.NODE_ENV === "development" ||
|
|
540
|
-
process.env.NODE_ENV === "test"
|
|
541
|
-
) {
|
|
542
|
-
request.assetUrl = window.location.origin;
|
|
543
|
-
}
|
|
544
539
|
const response = await this.rpc.proxy.request.bridge({
|
|
545
540
|
functionName: "export_html",
|
|
546
|
-
payload: request,
|
|
541
|
+
payload: withDevAssetUrl(request),
|
|
547
542
|
});
|
|
548
543
|
return response as ExportedFile<string>;
|
|
549
544
|
};
|