@@ -101,6 +101,68 @@ await z;
101101}
102102` ;
103103
104+ exports [` transpiles Observable JavaScript imports 1` ] = `
105+ {
106+ " autodisplay" : false ,
107+ " body" : " async (__ojs_runtime,__ojs_observer) => {
108+ const {figure , rotation , viewof$rotation } = await (import (" https://api.observablehq.com/@rreusser/drawing-3d-objects-with-svg.js?v=4" ).then ((_ ) => {
109+ const observers = {};
110+ const module = __ojs_runtime .module (_ .default );
111+ const main = __ojs_runtime .module ();
112+ if (! module .defines (" figure" )) throw new SyntaxError (\` export 'figure' not found\` );
113+ main.variable(observers.figure = __ojs_observer()).import("figure", module);
114+ if (!module.defines("rotation")) throw new SyntaxError(\` export 'rotation' not found\` );
115+ main.variable(observers.rotation = __ojs_observer()).import("rotation", module);
116+ if (!module.defines("viewof rotation")) throw new SyntaxError(\` export 'viewof rotation' not found\` );
117+ main.variable(observers.viewof$rotation = __ojs_observer()).import("viewof rotation", module);
118+ return observers;
119+ }));
120+
121+ return { figure ,rotation ,viewof$rotation } ;
122+ }",
123+ "inputs": [
124+ "__ojs_runtime",
125+ "__ojs_observer",
126+ ],
127+ "outputs": [
128+ "figure",
129+ "rotation",
130+ "viewof$rotation",
131+ ],
132+ }
133+ ` ;
134+
135+ exports [` transpiles Observable JavaScript imports 2` ] = `
136+ {
137+ " autodisplay" : false ,
138+ " body" : " async (__ojs_runtime,__ojs_observer) => {
139+ const {figure , rotation: rot , viewof$rotation: viewof$rot } = await (import (" https://api.observablehq.com/@rreusser/drawing-3d-objects-with-svg.js?v=4" ).then ((_ ) => {
140+ const observers = {};
141+ const module = __ojs_runtime .module (_ .default );
142+ const main = __ojs_runtime .module ();
143+ if (! module .defines (" figure" )) throw new SyntaxError (\` export 'figure' not found\` );
144+ main.variable(observers.figure = __ojs_observer()).import("figure", module);
145+ if (!module.defines("rotation")) throw new SyntaxError(\` export 'rotation' not found\` );
146+ main.variable(observers.rotation = __ojs_observer()).import("rotation", module);
147+ if (!module.defines("viewof rotation")) throw new SyntaxError(\` export 'viewof rotation' not found\` );
148+ main.variable(observers.viewof$rotation = __ojs_observer()).import("viewof rotation", module);
149+ return observers;
150+ }));
151+
152+ return { figure ,rot ,viewof$rot } ;
153+ }",
154+ "inputs": [
155+ "__ojs_runtime",
156+ "__ojs_observer",
157+ ],
158+ "outputs": [
159+ "figure",
160+ "rot",
161+ "viewof$rot",
162+ ],
163+ }
164+ ` ;
165+
104166exports [` transpiles dynamic npm: imports 1` ] = `
105167{
106168 " autodisplay" : false ,
@@ -154,6 +216,56 @@ return (
154216}
155217` ;
156218
219+ exports [` transpiles static imports with { type : ' observable' } 1` ] = `
220+ {
221+ " autodisplay" : false ,
222+ " body" : " async (__ojs_runtime,__ojs_observer) => {
223+ const {Scrubber } = await (import (" https://api.observablehq.com/@mbostock/scrubber.js?v=4" ).then ((_ ) => {
224+ const observers = {};
225+ const module = __ojs_runtime .module (_ .default );
226+ const main = __ojs_runtime .module ();
227+ if (! module .defines (" Scrubber" )) throw new SyntaxError (\` export 'Scrubber' not found\` );
228+ main.variable(observers.Scrubber = __ojs_observer()).import("Scrubber", module);
229+ return observers;
230+ }));
231+
232+ return { Scrubber } ;
233+ }",
234+ "inputs": [
235+ "__ojs_runtime",
236+ "__ojs_observer",
237+ ],
238+ "outputs": [
239+ "Scrubber",
240+ ],
241+ }
242+ ` ;
243+
244+ exports [` transpiles static imports with { type : ' observable' } 2` ] = `
245+ {
246+ " autodisplay" : false ,
247+ " body" : " async (__ojs_runtime,__ojs_observer) => {
248+ const {viewof$rotation } = await (import (" https://api.observablehq.com/@rreusser/drawing-3d-objects-with-svg.js?v=4" ).then ((_ ) => {
249+ const observers = {};
250+ const module = __ojs_runtime .module (_ .default );
251+ const main = __ojs_runtime .module ();
252+ if (! module .defines (" viewof rotation" )) throw new SyntaxError (\` export 'viewof rotation' not found\` );
253+ main.variable(observers.viewof$rotation = __ojs_observer()).import("viewof rotation", module);
254+ return observers;
255+ }));
256+
257+ return { viewof$rotation } ;
258+ }",
259+ "inputs": [
260+ "__ojs_runtime",
261+ "__ojs_observer",
262+ ],
263+ "outputs": [
264+ "viewof$rotation",
265+ ],
266+ }
267+ ` ;
268+
157269exports [` transpiles static npm: imports 1` ] = `
158270{
159271 " autodisplay" : false ,
@@ -223,3 +335,28 @@ return {Scrubber};
223335 ],
224336}
225337` ;
338+
339+ exports [` transpiles static observable: imports 2` ] = `
340+ {
341+ " autodisplay" : false ,
342+ " body" : " async (__ojs_runtime,__ojs_observer) => {
343+ const {viewof$rotation } = await (import (" https://api.observablehq.com/@rreusser/drawing-3d-objects-with-svg.js?v=4" ).then ((_ ) => {
344+ const observers = {};
345+ const module = __ojs_runtime .module (_ .default );
346+ const main = __ojs_runtime .module ();
347+ if (! module .defines (" viewof rotation" )) throw new SyntaxError (\` export 'viewof rotation' not found\` );
348+ main.variable(observers.viewof$rotation = __ojs_observer()).import("viewof rotation", module);
349+ return observers;
350+ }));
351+
352+ return { viewof$rotation } ;
353+ }",
354+ "inputs": [
355+ "__ojs_runtime",
356+ "__ojs_observer",
357+ ],
358+ "outputs": [
359+ "viewof$rotation",
360+ ],
361+ }
362+ ` ;
0 commit comments