wgsl-play 0.0.40 → 0.1.1

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.
@@ -446,7 +446,7 @@ async function createPipeline(state, shaderSource, resolveTexture, options) {
446
446
  modulePath: `${pkg}::${root}`,
447
447
  debugFilePath: `./${root}.wesl`,
448
448
  src: shaderSource
449
- });
449
+ }, { weslExtensions: options?.weslExtensions });
450
450
  const resources = findAnnotatedResources(ast);
451
451
  const entryPoints = classifyEntryPoints(ast);
452
452
  const mode = detectMode(entryPoints);
@@ -817,7 +817,7 @@ var WgslPlay = class extends HTMLElement {
817
817
  _weslSrc = {};
818
818
  _rootModuleName = "package::main";
819
819
  _libs;
820
- _linkOptions = {};
820
+ _linkOptions = { weslExtensions: { doBlocks: true } };
821
821
  _fetchSources = true;
822
822
  _initPromise;
823
823
  _sourceEl = null;
@@ -963,10 +963,11 @@ var WgslPlay = class extends HTMLElement {
963
963
  /** Set project configuration (mirrors wesl link() API). */
964
964
  set project(value) {
965
965
  const { weslSrc, rootModuleName, libs } = value;
966
- const { packageName, conditions, constants } = value;
966
+ const { packageName, conditions, constants, weslExtensions } = value;
967
967
  if (packageName !== void 0) this._linkOptions.packageName = packageName;
968
968
  if (conditions !== void 0) this._linkOptions.conditions = conditions;
969
969
  if (constants !== void 0) this._linkOptions.constants = constants;
970
+ if (weslExtensions !== void 0) this._linkOptions.weslExtensions = weslExtensions;
970
971
  if (libs) this._libs = libs;
971
972
  if (weslSrc) {
972
973
  const pkg = this._linkOptions.packageName || "package";
@@ -1314,6 +1315,7 @@ var WgslPlay = class extends HTMLElement {
1314
1315
  if (this._fetchSources || this._fetchLibs) {
1315
1316
  const { weslSrc, libs } = await fetchDependencies(mainSource, {
1316
1317
  shaderRoot: this.getConfigOverrides()?.shaderRoot,
1318
+ rootModuleName: this._rootModuleName,
1317
1319
  existingSources: this._weslSrc,
1318
1320
  fetchLibs: this._fetchLibs,
1319
1321
  fetchSources: this._fetchSources
package/dist/WgslPlay.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as resetConfig, i as getConfig, n as WgslPlay, r as defaults, t as ResourceLoadError } from "./WgslPlay-zK9mE5rV.js";
1
+ import { a as resetConfig, i as getConfig, n as WgslPlay, r as defaults, t as ResourceLoadError } from "./WgslPlay-Bmm8iBvO.js";
2
2
  export { ResourceLoadError, WgslPlay, defaults, getConfig, resetConfig };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as resetConfig, i as getConfig, n as WgslPlay, r as defaults, t as ResourceLoadError } from "./WgslPlay-zK9mE5rV.js";
1
+ import { a as resetConfig, i as getConfig, n as WgslPlay, r as defaults, t as ResourceLoadError } from "./WgslPlay-Bmm8iBvO.js";
2
2
  export * from "wesl-fetch";
3
3
  //#region src/index.ts
4
4
  if (typeof customElements !== "undefined" && !customElements.get("wgsl-play")) customElements.define("wgsl-play", WgslPlay);