@lumiastream/ui 0.2.8-alpha.23 → 0.2.8-alpha.24
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/index.js +21 -7
- package/dist/se-import.js +21 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3114,7 +3114,7 @@ var resolveChatterProfileUrlWithResolvers = async ({
|
|
|
3114
3114
|
};
|
|
3115
3115
|
|
|
3116
3116
|
// src/se-import/index.ts
|
|
3117
|
-
import { nanoid as
|
|
3117
|
+
import { nanoid as nanoid4 } from "nanoid";
|
|
3118
3118
|
|
|
3119
3119
|
// src/se-import/translate.ts
|
|
3120
3120
|
var SE_TO_LUMIA_PLACEHOLDER = {
|
|
@@ -4062,6 +4062,7 @@ function mapGoal(widget, ctx) {
|
|
|
4062
4062
|
}
|
|
4063
4063
|
|
|
4064
4064
|
// src/se-import/mappers/custom.ts
|
|
4065
|
+
import { nanoid as nanoid2 } from "nanoid";
|
|
4065
4066
|
var SOURCE_TO_LUMIA_FIELD_TYPE = {
|
|
4066
4067
|
text: "input",
|
|
4067
4068
|
number: "number",
|
|
@@ -4121,15 +4122,28 @@ function mapCustom(widget, ctx) {
|
|
|
4121
4122
|
};
|
|
4122
4123
|
const fields = parse(v.fields) ?? v.fields;
|
|
4123
4124
|
const fieldData = parse(v.fieldData) ?? v.fieldData;
|
|
4125
|
+
const widgetProvider = widget.provider;
|
|
4126
|
+
const provider = widgetProvider === "kick" || widgetProvider === "youtube" || widgetProvider === "twitch" ? widgetProvider : ctx?.provider ?? "twitch";
|
|
4124
4127
|
return buildUnit(widget, "custom", {
|
|
4125
4128
|
content: {
|
|
4126
|
-
|
|
4129
|
+
// SE widget ids are integers unique only within a single SE overlay
|
|
4130
|
+
// (1, 2, 3…). Using them as Lumia codeIds would collide across
|
|
4131
|
+
// imports — codeId is the scoping key for variables, storage, and
|
|
4132
|
+
// event listeners. Mint a fresh nanoid so every imported widget
|
|
4133
|
+
// has its own scope.
|
|
4134
|
+
codeId: nanoid2(),
|
|
4127
4135
|
html: v.html ?? "",
|
|
4128
4136
|
css: v.css ?? "",
|
|
4129
4137
|
js: v.js ?? "",
|
|
4130
4138
|
configs: translateConfigs(fields),
|
|
4131
4139
|
data: fieldData ?? {},
|
|
4132
|
-
flavor: "streamelements"
|
|
4140
|
+
flavor: "streamelements",
|
|
4141
|
+
// Native field on the Custom module content. The compatibility
|
|
4142
|
+
// shim in Embed.tsx reads this to pick the right listener-name
|
|
4143
|
+
// mapping table when forwarding Lumia events into the iframe as
|
|
4144
|
+
// `onEventReceived` payloads. Default 'twitch' matches the shim's
|
|
4145
|
+
// historical default so legacy imports keep working.
|
|
4146
|
+
sourceProvider: provider
|
|
4133
4147
|
}
|
|
4134
4148
|
}, ctx);
|
|
4135
4149
|
}
|
|
@@ -5494,7 +5508,7 @@ function guessMime(name) {
|
|
|
5494
5508
|
}
|
|
5495
5509
|
|
|
5496
5510
|
// src/se-import/transplant.ts
|
|
5497
|
-
import { nanoid as
|
|
5511
|
+
import { nanoid as nanoid3 } from "nanoid";
|
|
5498
5512
|
function cloneModuleForTransplant(srcModule, newId) {
|
|
5499
5513
|
const clonedContent = srcModule.content ? structuredClone(srcModule.content) : srcModule.content;
|
|
5500
5514
|
if (srcModule.settings?.type === "custom" && clonedContent) {
|
|
@@ -5512,7 +5526,7 @@ function transplantLayer(source, sourceLayerId) {
|
|
|
5512
5526
|
const srcLayer = layers.find((l) => l.id === sourceLayerId);
|
|
5513
5527
|
const srcModule = modules[sourceLayerId];
|
|
5514
5528
|
if (!srcLayer || !srcModule) return null;
|
|
5515
|
-
const rootNewId =
|
|
5529
|
+
const rootNewId = nanoid3();
|
|
5516
5530
|
if (srcLayer.type !== "group") {
|
|
5517
5531
|
const layer = { ...srcLayer, id: rootNewId };
|
|
5518
5532
|
const module = cloneModuleForTransplant(srcModule, rootNewId);
|
|
@@ -5530,7 +5544,7 @@ function transplantLayer(source, sourceLayerId) {
|
|
|
5530
5544
|
if (seen.has(child.id)) continue;
|
|
5531
5545
|
seen.add(child.id);
|
|
5532
5546
|
descendants.push(child);
|
|
5533
|
-
idRemap.set(child.id,
|
|
5547
|
+
idRemap.set(child.id, nanoid3());
|
|
5534
5548
|
if (child.type === "group") queue.push(child.id);
|
|
5535
5549
|
}
|
|
5536
5550
|
}
|
|
@@ -8294,7 +8308,7 @@ function importSEBootstrap(bootstrap) {
|
|
|
8294
8308
|
if (w.type !== "se-widget-group") continue;
|
|
8295
8309
|
const uid = w.variables?.uid;
|
|
8296
8310
|
if (typeof uid !== "string") continue;
|
|
8297
|
-
const lumiaGroupId =
|
|
8311
|
+
const lumiaGroupId = nanoid4();
|
|
8298
8312
|
seUidToLumiaGroupId[uid] = lumiaGroupId;
|
|
8299
8313
|
groupWidgetByUid[uid] = w;
|
|
8300
8314
|
}
|
package/dist/se-import.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/se-import/index.ts
|
|
2
|
-
import { nanoid as
|
|
2
|
+
import { nanoid as nanoid4 } from "nanoid";
|
|
3
3
|
|
|
4
4
|
// src/se-import/translate.ts
|
|
5
5
|
var SE_TO_LUMIA_PLACEHOLDER = {
|
|
@@ -947,6 +947,7 @@ function mapGoal(widget, ctx) {
|
|
|
947
947
|
}
|
|
948
948
|
|
|
949
949
|
// src/se-import/mappers/custom.ts
|
|
950
|
+
import { nanoid as nanoid2 } from "nanoid";
|
|
950
951
|
var SOURCE_TO_LUMIA_FIELD_TYPE = {
|
|
951
952
|
text: "input",
|
|
952
953
|
number: "number",
|
|
@@ -1006,15 +1007,28 @@ function mapCustom(widget, ctx) {
|
|
|
1006
1007
|
};
|
|
1007
1008
|
const fields = parse(v.fields) ?? v.fields;
|
|
1008
1009
|
const fieldData = parse(v.fieldData) ?? v.fieldData;
|
|
1010
|
+
const widgetProvider = widget.provider;
|
|
1011
|
+
const provider = widgetProvider === "kick" || widgetProvider === "youtube" || widgetProvider === "twitch" ? widgetProvider : ctx?.provider ?? "twitch";
|
|
1009
1012
|
return buildUnit(widget, "custom", {
|
|
1010
1013
|
content: {
|
|
1011
|
-
|
|
1014
|
+
// SE widget ids are integers unique only within a single SE overlay
|
|
1015
|
+
// (1, 2, 3…). Using them as Lumia codeIds would collide across
|
|
1016
|
+
// imports — codeId is the scoping key for variables, storage, and
|
|
1017
|
+
// event listeners. Mint a fresh nanoid so every imported widget
|
|
1018
|
+
// has its own scope.
|
|
1019
|
+
codeId: nanoid2(),
|
|
1012
1020
|
html: v.html ?? "",
|
|
1013
1021
|
css: v.css ?? "",
|
|
1014
1022
|
js: v.js ?? "",
|
|
1015
1023
|
configs: translateConfigs(fields),
|
|
1016
1024
|
data: fieldData ?? {},
|
|
1017
|
-
flavor: "streamelements"
|
|
1025
|
+
flavor: "streamelements",
|
|
1026
|
+
// Native field on the Custom module content. The compatibility
|
|
1027
|
+
// shim in Embed.tsx reads this to pick the right listener-name
|
|
1028
|
+
// mapping table when forwarding Lumia events into the iframe as
|
|
1029
|
+
// `onEventReceived` payloads. Default 'twitch' matches the shim's
|
|
1030
|
+
// historical default so legacy imports keep working.
|
|
1031
|
+
sourceProvider: provider
|
|
1018
1032
|
}
|
|
1019
1033
|
}, ctx);
|
|
1020
1034
|
}
|
|
@@ -2379,7 +2393,7 @@ function guessMime(name) {
|
|
|
2379
2393
|
}
|
|
2380
2394
|
|
|
2381
2395
|
// src/se-import/transplant.ts
|
|
2382
|
-
import { nanoid as
|
|
2396
|
+
import { nanoid as nanoid3 } from "nanoid";
|
|
2383
2397
|
function cloneModuleForTransplant(srcModule, newId) {
|
|
2384
2398
|
const clonedContent = srcModule.content ? structuredClone(srcModule.content) : srcModule.content;
|
|
2385
2399
|
if (srcModule.settings?.type === "custom" && clonedContent) {
|
|
@@ -2397,7 +2411,7 @@ function transplantLayer(source, sourceLayerId) {
|
|
|
2397
2411
|
const srcLayer = layers.find((l) => l.id === sourceLayerId);
|
|
2398
2412
|
const srcModule = modules[sourceLayerId];
|
|
2399
2413
|
if (!srcLayer || !srcModule) return null;
|
|
2400
|
-
const rootNewId =
|
|
2414
|
+
const rootNewId = nanoid3();
|
|
2401
2415
|
if (srcLayer.type !== "group") {
|
|
2402
2416
|
const layer = { ...srcLayer, id: rootNewId };
|
|
2403
2417
|
const module = cloneModuleForTransplant(srcModule, rootNewId);
|
|
@@ -2415,7 +2429,7 @@ function transplantLayer(source, sourceLayerId) {
|
|
|
2415
2429
|
if (seen.has(child.id)) continue;
|
|
2416
2430
|
seen.add(child.id);
|
|
2417
2431
|
descendants.push(child);
|
|
2418
|
-
idRemap.set(child.id,
|
|
2432
|
+
idRemap.set(child.id, nanoid3());
|
|
2419
2433
|
if (child.type === "group") queue.push(child.id);
|
|
2420
2434
|
}
|
|
2421
2435
|
}
|
|
@@ -7164,7 +7178,7 @@ function importSEBootstrap(bootstrap) {
|
|
|
7164
7178
|
if (w.type !== "se-widget-group") continue;
|
|
7165
7179
|
const uid = w.variables?.uid;
|
|
7166
7180
|
if (typeof uid !== "string") continue;
|
|
7167
|
-
const lumiaGroupId =
|
|
7181
|
+
const lumiaGroupId = nanoid4();
|
|
7168
7182
|
seUidToLumiaGroupId[uid] = lumiaGroupId;
|
|
7169
7183
|
groupWidgetByUid[uid] = w;
|
|
7170
7184
|
}
|