@coderline/alphatab 1.3.0-alpha.997 → 1.3.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.
@@ -1,2 +1,2 @@
1
- import*as r from"./alphaTab.core.min.mjs";export*from"./alphaTab.core.min.mjs";r.Environment.isRunningInWorker?r.Environment.initializeWorker():r.Environment.isRunningInAudioWorklet?r.Environment.initializeAudioWorklet():r.Environment.initializeMain((e=>{if(r.Environment.webPlatform==r.WebPlatform.NodeJs)throw new r.AlphaTabError(r.AlphaTabErrorType.General,"Workers not yet supported in Node.js");if(r.Environment.webPlatform==r.WebPlatform.BrowserModule||r.Environment.isWebPackBundled)return r.Logger.debug("AlphaTab","Creating webworker"),new r.Environment.alphaTabWorker(new URL("./alphaTab.worker.min.mjs",import.meta.url),{type:"module"});if(!e.core.scriptFile)throw new r.AlphaTabError(r.AlphaTabErrorType.General,"Could not detect alphaTab script file, cannot initialize renderer");try{r.Logger.debug("AlphaTab","Creating Blob worker");const o=`importScripts('${e.core.scriptFile}')`,n=new Blob([o]);return new Worker(URL.createObjectURL(n))}catch(o){return r.Logger.warning("Rendering","Could not create inline worker, fallback to normal worker"),new Worker(e.core.scriptFile)}}),((e,o)=>{if(r.Environment.webPlatform==r.WebPlatform.NodeJs)throw new r.AlphaTabError(r.AlphaTabErrorType.General,"Audio Worklets not yet supported in Node.js");if(r.Environment.webPlatform==r.WebPlatform.BrowserModule||r.Environment.isWebPackBundled){r.Logger.debug("AlphaTab","Creating Module worklet");return e.audioWorklet.addModule(new URL("./alphaTab.worklet.min.mjs",import.meta.url))}return r.Logger.debug("AlphaTab","Creating Script worklet"),e.audioWorklet.addModule(o.core.scriptFile)}));
1
+ import*as e from"./alphaTab.core.min.mjs";export*from"./alphaTab.core.min.mjs";e.Environment.isRunningInWorker?e.Environment.initializeWorker():e.Environment.isRunningInAudioWorklet?e.Environment.initializeAudioWorklet():e.Environment.initializeMain((r=>{if(e.Environment.webPlatform==e.WebPlatform.NodeJs)throw new e.AlphaTabError(e.AlphaTabErrorType.General,"Workers not yet supported in Node.js");if(e.Environment.webPlatform==e.WebPlatform.BrowserModule||e.Environment.isWebPackBundled||e.Environment.isViteBundled)return e.Logger.debug("AlphaTab","Creating webworker"),new e.Environment.alphaTabWorker(new URL("./alphaTab.worker.min.mjs",import.meta.url),{type:"module"});if(!r.core.scriptFile)throw new e.AlphaTabError(e.AlphaTabErrorType.General,"Could not detect alphaTab script file, cannot initialize renderer");try{e.Logger.debug("AlphaTab","Creating Blob worker");const n=`importScripts('${r.core.scriptFile}')`,o=new Blob([n]);return new Worker(URL.createObjectURL(o))}catch(n){return e.Logger.warning("Rendering","Could not create inline worker, fallback to normal worker"),new Worker(r.core.scriptFile)}}),((r,n)=>{if(e.Environment.webPlatform==e.WebPlatform.NodeJs)throw new e.AlphaTabError(e.AlphaTabErrorType.General,"Audio Worklets not yet supported in Node.js");if(e.Environment.webPlatform==e.WebPlatform.BrowserModule||e.Environment.isWebPackBundled||e.Environment.isViteBundled){e.Logger.debug("AlphaTab","Creating Module worklet");return r.audioWorklet.addModule(new URL("./alphaTab.worklet.min.mjs",import.meta.url))}return e.Logger.debug("AlphaTab","Creating Script worklet"),r.audioWorklet.addModule(n.core.scriptFile)}));
2
2
  //# sourceMappingURL=alphaTab.min.mjs.map
package/dist/alphaTab.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * alphaTab v1.3.0-alpha.997 (develop, build 997)
2
+ * alphaTab v1.3.1 (, build 11)
3
3
  *
4
4
  * Copyright © 2024, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -29,7 +29,7 @@ else {
29
29
  if (alphaTab.Environment.webPlatform == alphaTab.WebPlatform.NodeJs) {
30
30
  throw new alphaTab.AlphaTabError(alphaTab.AlphaTabErrorType.General, 'Workers not yet supported in Node.js');
31
31
  }
32
- if (alphaTab.Environment.webPlatform == alphaTab.WebPlatform.BrowserModule || alphaTab.Environment.isWebPackBundled) {
32
+ if (alphaTab.Environment.webPlatform == alphaTab.WebPlatform.BrowserModule || alphaTab.Environment.isWebPackBundled || alphaTab.Environment.isViteBundled) {
33
33
  alphaTab.Logger.debug("AlphaTab", "Creating webworker");
34
34
  return new alphaTab.Environment.alphaTabWorker(new URL('./alphaTab.worker.mjs', import.meta.url), { type: 'module' });
35
35
  }
@@ -51,7 +51,7 @@ else {
51
51
  if (alphaTab.Environment.webPlatform == alphaTab.WebPlatform.NodeJs) {
52
52
  throw new alphaTab.AlphaTabError(alphaTab.AlphaTabErrorType.General, 'Audio Worklets not yet supported in Node.js');
53
53
  }
54
- if (alphaTab.Environment.webPlatform == alphaTab.WebPlatform.BrowserModule || alphaTab.Environment.isWebPackBundled) {
54
+ if (alphaTab.Environment.webPlatform == alphaTab.WebPlatform.BrowserModule || alphaTab.Environment.isWebPackBundled || alphaTab.Environment.isViteBundled) {
55
55
  alphaTab.Logger.debug("AlphaTab", "Creating Module worklet");
56
56
  const alphaTabWorklet = context.audioWorklet; // this name triggers the WebPack Plugin
57
57
  return alphaTabWorklet.addModule(new URL('./alphaTab.worklet.mjs', import.meta.url));
@@ -0,0 +1,36 @@
1
+ import { Plugin } from 'vite';
2
+
3
+ /**@target web */
4
+ interface AlphaTabVitePluginOptions {
5
+ /**
6
+ * The location where alphaTab can be found.
7
+ * (default: node_modules/@coderline/alphatab/dist)
8
+ */
9
+ alphaTabSourceDir?: string;
10
+ /**
11
+ * The location where assets of alphaTab should be placed.
12
+ * Set it to false to disable the copying of assets like fonts.
13
+ * (default: compiler.options.output.path)
14
+ */
15
+ assetOutputDir?: string | false;
16
+ /**
17
+ * Whether alphaTab should configure the audio worklet support in Vite.
18
+ * This might break support for audio playback unless audio worklet support is added
19
+ * through other means to Vite.
20
+ * (default: true)
21
+ */
22
+ audioWorklets?: boolean;
23
+ /**
24
+ * Whether alphaTab should configure the web worklet support in Vite.
25
+ * This might break support for audio playback and background unless audio worklet support is added
26
+ * through other means to Vite.
27
+ * (default: true)
28
+ */
29
+ webWorkers?: boolean;
30
+ }
31
+
32
+ /**@target web */
33
+
34
+ declare function alphaTab(options?: AlphaTabVitePluginOptions): Plugin<any>[];
35
+
36
+ export { alphaTab };