@ourlu/assistant-sdk 0.2.2 → 0.2.4
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/esm/index.js +1 -1
- package/dist/iife/audio.v1.95146620.js +179 -0
- package/dist/iife/audio.v1.js +1 -1
- package/dist/iife/engine.v1.2b5bb43b.js +735 -0
- package/dist/iife/engine.v1.3b09dc20.js +721 -0
- package/dist/iife/engine.v1.773fc15d.js +645 -0
- package/dist/iife/engine.v1.80d2230f.js +770 -0
- package/dist/iife/engine.v1.9ca6b7ec.js +756 -0
- package/dist/iife/engine.v1.c0c00bd0.js +721 -0
- package/dist/iife/engine.v1.c54c9a1a.js +770 -0
- package/dist/iife/engine.v1.d1052e81.js +770 -0
- package/dist/iife/engine.v1.js +770 -645
- package/dist/iife/loader.v1.js +22 -21
- package/dist/iife/ui.v1.41a99419.js +919 -0
- package/dist/iife/ui.v1.5d2d4504.js +942 -0
- package/dist/iife/ui.v1.6afac75f.js +944 -0
- package/dist/iife/ui.v1.7417819d.js +919 -0
- package/dist/iife/ui.v1.7fb4db0b.js +935 -0
- package/dist/iife/ui.v1.923a4e6d.js +937 -0
- package/dist/iife/ui.v1.9bfe2815.js +942 -0
- package/dist/iife/ui.v1.c58e1d58.js +959 -0
- package/dist/iife/ui.v1.cdfe9a45.js +919 -0
- package/dist/iife/ui.v1.js +121 -81
- package/dist/iife/widget-manifest.json +5 -0
- package/package.json +1 -1
package/dist/iife/loader.v1.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
(function() {
|
|
2
|
-
"use strict";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __WIDGET_MANIFEST__ = {"ui.v1.js":"ui.v1.c58e1d58.js","audio.v1.js":"audio.v1.95146620.js","engine.v1.js":"engine.v1.d1052e81.js"};
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
var
|
|
5
|
+
|
|
6
|
+
var RUNTIME_NS = "__OurluWidgetRuntimeV1";
|
|
7
|
+
var RUNTIME_FLAG = "__OurluWidgetRuntimeLoadPromiseV1";
|
|
8
|
+
|
|
9
|
+
function resolveManifestFileName(logicalName) {
|
|
10
|
+
if (typeof __WIDGET_MANIFEST__ !== "undefined" && __WIDGET_MANIFEST__[logicalName]) {
|
|
11
|
+
return __WIDGET_MANIFEST__[logicalName];
|
|
12
|
+
}
|
|
13
|
+
return logicalName;
|
|
14
|
+
}
|
|
6
15
|
|
|
7
16
|
function resolveCurrentScript() {
|
|
8
17
|
if (document.currentScript) return document.currentScript;
|
|
@@ -10,19 +19,6 @@
|
|
|
10
19
|
return scripts[scripts.length - 1];
|
|
11
20
|
}
|
|
12
21
|
|
|
13
|
-
function buildRuntimeAssetUrl(scriptTag, assetName) {
|
|
14
|
-
var src = scriptTag.getAttribute("src") || "";
|
|
15
|
-
var fallbackBase = window.location.origin;
|
|
16
|
-
try {
|
|
17
|
-
var url = new URL(src, window.location.href);
|
|
18
|
-
var lastSlash = url.pathname.lastIndexOf("/");
|
|
19
|
-
var basePath = lastSlash >= 0 ? url.pathname.slice(0, lastSlash + 1) : "/";
|
|
20
|
-
return url.origin + basePath + assetName;
|
|
21
|
-
} catch (_) {
|
|
22
|
-
return fallbackBase + "/" + assetName;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
22
|
function buildApiRuntimeAssetUrl(scriptTag, assetName) {
|
|
27
23
|
var apiBaseUrl = (scriptTag.getAttribute("data-api-base-url") || "").replace(/\/$/, "");
|
|
28
24
|
if (!apiBaseUrl) return "";
|
|
@@ -42,14 +38,19 @@
|
|
|
42
38
|
|
|
43
39
|
var scriptTag = resolveCurrentScript();
|
|
44
40
|
if (!scriptTag) {
|
|
45
|
-
console.error("[
|
|
41
|
+
console.error("[OurluMairie] Loader: no script tag found.");
|
|
46
42
|
return;
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
if (!window[RUNTIME_FLAG]) {
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
46
|
+
var uiFileName = resolveManifestFileName("ui.v1.js");
|
|
47
|
+
var audioFileName = resolveManifestFileName("audio.v1.js");
|
|
48
|
+
var engineFileName = resolveManifestFileName("engine.v1.js");
|
|
49
|
+
|
|
50
|
+
var uiRuntimeUrl = scriptTag.getAttribute("data-runtime-ui-url") || buildApiRuntimeAssetUrl(scriptTag, uiFileName);
|
|
51
|
+
var audioRuntimeUrl = scriptTag.getAttribute("data-runtime-audio-url") || buildApiRuntimeAssetUrl(scriptTag, audioFileName);
|
|
52
|
+
var engineRuntimeUrl = scriptTag.getAttribute("data-runtime-engine-url") || buildApiRuntimeAssetUrl(scriptTag, engineFileName);
|
|
53
|
+
|
|
53
54
|
window[RUNTIME_FLAG] = loadScript(uiRuntimeUrl).then(function() {
|
|
54
55
|
return loadScript(audioRuntimeUrl);
|
|
55
56
|
}).then(function() {
|
|
@@ -66,6 +67,6 @@
|
|
|
66
67
|
runtime.mountFromScript(scriptTag);
|
|
67
68
|
})
|
|
68
69
|
.catch(function(error) {
|
|
69
|
-
console.error("[
|
|
70
|
+
console.error("[OurluMairie] Loader runtime error:", error);
|
|
70
71
|
});
|
|
71
72
|
})();
|