@lumiastream/ui 0.2.8-alpha.6 → 0.2.8-alpha.8
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.d.ts +2 -1
- package/dist/index.js +50 -12
- package/package.json +20 -13
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2292,7 +2292,7 @@ function variableCompletionOptions(context, variables) {
|
|
|
2292
2292
|
}
|
|
2293
2293
|
|
|
2294
2294
|
// src/utils/codeMirrorlinterOptions.ts
|
|
2295
|
-
import
|
|
2295
|
+
import globals from "globals";
|
|
2296
2296
|
var browserGlobals = Object.fromEntries(
|
|
2297
2297
|
Object.entries(globals.browser).map(([key, value]) => [
|
|
2298
2298
|
key,
|
|
@@ -3265,7 +3265,8 @@ function seCssToBounds(css, defaults = { width: 600, height: 200 }, canvas) {
|
|
|
3265
3265
|
};
|
|
3266
3266
|
const width = toPx(css.width, defaults.width, "width");
|
|
3267
3267
|
const height = toPx(css.height, defaults.height, "height");
|
|
3268
|
-
const
|
|
3268
|
+
const autoWidth = widthIsAuto;
|
|
3269
|
+
const autoHeight = heightIsAuto;
|
|
3269
3270
|
let x = toPx(css.left, 0, "width");
|
|
3270
3271
|
let y = toPx(css.top, 0, "height");
|
|
3271
3272
|
if (typeof css.transform === "string" && css.transform.includes("translate")) {
|
|
@@ -3292,7 +3293,8 @@ function seCssToBounds(css, defaults = { width: 600, height: 200 }, canvas) {
|
|
|
3292
3293
|
height,
|
|
3293
3294
|
opacity: css.opacity ?? 1,
|
|
3294
3295
|
zIndex: css["z-index"] ?? 0,
|
|
3295
|
-
|
|
3296
|
+
autoWidth,
|
|
3297
|
+
autoHeight
|
|
3296
3298
|
};
|
|
3297
3299
|
}
|
|
3298
3300
|
var LUMIA_DEFAULT_SIZES = {
|
|
@@ -3302,7 +3304,11 @@ var LUMIA_DEFAULT_SIZES = {
|
|
|
3302
3304
|
audio: { width: 200, height: 200 },
|
|
3303
3305
|
slideshow: { width: 400, height: 220 },
|
|
3304
3306
|
alert: { width: 700, height: 600 },
|
|
3305
|
-
goal
|
|
3307
|
+
// 80 was too short for the SE-style slim goal layout (label + bar + "Ends
|
|
3308
|
+
// in" sublabel needs ~125 px of vertical space). Bumped so editor-canvas
|
|
3309
|
+
// rendering (which doesn't honor autoHeight) doesn't clip the sublabel
|
|
3310
|
+
// after import.
|
|
3311
|
+
goal: { width: 740, height: 130 },
|
|
3306
3312
|
timer: { width: 740, height: 80 },
|
|
3307
3313
|
chatbox: { width: 375, height: 470 },
|
|
3308
3314
|
eventlist: { width: 375, height: 470 },
|
|
@@ -3365,10 +3371,12 @@ function buildUnit(widget, lumiaType, moduleExtras) {
|
|
|
3365
3371
|
scale: [1, 1],
|
|
3366
3372
|
opacity: bounds.opacity,
|
|
3367
3373
|
zIndex: bounds.zIndex,
|
|
3368
|
-
//
|
|
3369
|
-
//
|
|
3370
|
-
//
|
|
3371
|
-
|
|
3374
|
+
// Per-axis flags — only the SE axis that was actually `auto`
|
|
3375
|
+
// collapses in render. The SE cheer goal is the canonical case:
|
|
3376
|
+
// width: "700px" + height: "auto" → numeric width stays at 700,
|
|
3377
|
+
// height collapses to content.
|
|
3378
|
+
...bounds.autoWidth ? { autoWidth: true } : {},
|
|
3379
|
+
...bounds.autoHeight ? { autoHeight: true } : {}
|
|
3372
3380
|
}
|
|
3373
3381
|
};
|
|
3374
3382
|
const module = {
|
|
@@ -3399,7 +3407,7 @@ function seExtraTextCss(seCss, scrolling) {
|
|
|
3399
3407
|
if (scrolling?.enabled) {
|
|
3400
3408
|
extra.scroll = true;
|
|
3401
3409
|
const speed = Number(scrolling.speed);
|
|
3402
|
-
if (Number.isFinite(speed) && speed > 0) extra.scrollSpeed = speed *
|
|
3410
|
+
if (Number.isFinite(speed) && speed > 0) extra.scrollSpeed = speed * 600;
|
|
3403
3411
|
}
|
|
3404
3412
|
return extra;
|
|
3405
3413
|
}
|
|
@@ -3984,13 +3992,38 @@ function mapCredits(widget) {
|
|
|
3984
3992
|
}
|
|
3985
3993
|
});
|
|
3986
3994
|
}
|
|
3995
|
+
function inferSlideshowMediaType(mime, url) {
|
|
3996
|
+
if (typeof mime === "string") {
|
|
3997
|
+
if (mime.startsWith("video/")) return "video";
|
|
3998
|
+
if (mime.startsWith("image/")) return "image";
|
|
3999
|
+
}
|
|
4000
|
+
const ext = url.split("?")[0].split("#")[0].split(".").pop()?.toLowerCase() ?? "";
|
|
4001
|
+
if (["mp4", "webm", "mov", "m4v", "ogv"].includes(ext)) return "video";
|
|
4002
|
+
return "image";
|
|
4003
|
+
}
|
|
4004
|
+
function nameFromUrl(url) {
|
|
4005
|
+
try {
|
|
4006
|
+
const path = url.split("?")[0].split("#")[0];
|
|
4007
|
+
return decodeURIComponent(path.split("/").pop() ?? url);
|
|
4008
|
+
} catch {
|
|
4009
|
+
return url;
|
|
4010
|
+
}
|
|
4011
|
+
}
|
|
3987
4012
|
function mapSlideshow(widget) {
|
|
3988
4013
|
const v = widget.variables ?? {};
|
|
3989
|
-
const
|
|
4014
|
+
const items = (v.images ?? []).map((raw) => {
|
|
4015
|
+
const url = typeof raw === "string" ? raw : raw.url ?? raw.src ?? "";
|
|
4016
|
+
if (!url) return null;
|
|
4017
|
+
return {
|
|
4018
|
+
type: inferSlideshowMediaType(typeof raw === "object" ? raw?.type : void 0, url),
|
|
4019
|
+
src: url,
|
|
4020
|
+
name: nameFromUrl(url)
|
|
4021
|
+
};
|
|
4022
|
+
}).filter((item) => item !== null);
|
|
3990
4023
|
const seAnim = typeof v.animation === "object" && v.animation !== null ? v.animation : {};
|
|
3991
4024
|
return buildUnit(widget, "slideshow", {
|
|
3992
4025
|
content: {
|
|
3993
|
-
|
|
4026
|
+
src: items,
|
|
3994
4027
|
// `interval` of 0 = "rapid cycle" in SE (no delay between images); Lumia's
|
|
3995
4028
|
// `imageDuration` is the total ms per image. Distinguish three cases:
|
|
3996
4029
|
// - undefined → use 5000ms default
|
|
@@ -4001,7 +4034,10 @@ function mapSlideshow(widget) {
|
|
|
4001
4034
|
loopDelay: 0,
|
|
4002
4035
|
delay: 0,
|
|
4003
4036
|
playAudio: !!v.playAudio,
|
|
4004
|
-
|
|
4037
|
+
// Lumia's renderer reads `content.shuffle` (Slideshow/index.tsx:21);
|
|
4038
|
+
// mirroring SE's `random` to that name keeps "play in random order"
|
|
4039
|
+
// working out of the box.
|
|
4040
|
+
shuffle: !!v.random,
|
|
4005
4041
|
animation: {
|
|
4006
4042
|
enterAnimation: typeof v.animation === "string" ? v.animation : seAnim.in ?? "fadeIn",
|
|
4007
4043
|
exitAnimation: typeof v.animation === "string" ? v.animation : seAnim.out ?? "fadeOut",
|
|
@@ -5004,6 +5040,7 @@ var SEAuthError = class extends Error {
|
|
|
5004
5040
|
this.code = code;
|
|
5005
5041
|
this.name = "SEAuthError";
|
|
5006
5042
|
}
|
|
5043
|
+
code;
|
|
5007
5044
|
};
|
|
5008
5045
|
function decodeBase64Url(s) {
|
|
5009
5046
|
const b64 = s.replace(/-/g, "+").replace(/_/g, "/");
|
|
@@ -5045,6 +5082,7 @@ var SEClient = class _SEClient {
|
|
|
5045
5082
|
constructor(claims) {
|
|
5046
5083
|
this.claims = claims;
|
|
5047
5084
|
}
|
|
5085
|
+
claims;
|
|
5048
5086
|
static fromJwt(jwt) {
|
|
5049
5087
|
return new _SEClient(decodeJwtPayload(jwt));
|
|
5050
5088
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumiastream/ui",
|
|
3
|
-
"version": "0.2.8-alpha.
|
|
3
|
+
"version": "0.2.8-alpha.8",
|
|
4
4
|
"author": "Lumia Stream",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "Lumia UI Kit",
|
|
7
|
-
"packageManager": "
|
|
7
|
+
"packageManager": "npm@11.9.0",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"module": "dist/index.js",
|
|
@@ -23,23 +23,35 @@
|
|
|
23
23
|
"build": "tsup src/index.ts",
|
|
24
24
|
"build-storybook": "storybook build",
|
|
25
25
|
"watch": "tsup src/index.ts --watch",
|
|
26
|
-
"release": "changeset && changeset tag &&
|
|
27
|
-
"prepublishOnly": "
|
|
28
|
-
"postpublish": "
|
|
26
|
+
"release": "changeset && changeset tag && npm run build && npm publish",
|
|
27
|
+
"prepublishOnly": "npm run build",
|
|
28
|
+
"postpublish": "npm cache clean --force && node ./scripts/postpublish-install.mjs"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@codemirror/autocomplete": "^6.0.0",
|
|
32
|
+
"@emotion/react": "^11.14.0",
|
|
33
|
+
"@emotion/styled": "^11.14.1",
|
|
34
|
+
"@mui/icons-material": "^9.0.0",
|
|
35
|
+
"@mui/material": "^9.0.0",
|
|
32
36
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
33
|
-
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
37
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
38
|
+
"react-hook-form": "^7.62.0"
|
|
34
39
|
},
|
|
35
40
|
"devDependencies": {
|
|
36
41
|
"@codemirror/autocomplete": "^6.20.1",
|
|
42
|
+
"@emotion/react": "^11.14.0",
|
|
43
|
+
"@emotion/styled": "^11.14.1",
|
|
44
|
+
"@mui/icons-material": "^9.0.0",
|
|
45
|
+
"@mui/material": "^9.0.0",
|
|
37
46
|
"@storybook/builder-vite": "^10.2.17",
|
|
38
47
|
"@storybook/react-vite": "^10.2.17",
|
|
39
48
|
"@types/node": "^25.5.0",
|
|
40
49
|
"@types/react": "^19.2.14",
|
|
41
50
|
"@types/react-dom": "19.2.3",
|
|
42
51
|
"postcss": "^8.5.8",
|
|
52
|
+
"react": "^19.2.0",
|
|
53
|
+
"react-dom": "^19.2.0",
|
|
54
|
+
"react-hook-form": "^7.73.1",
|
|
43
55
|
"sass-embedded": "^1.99.0",
|
|
44
56
|
"storybook": "^10.2.17",
|
|
45
57
|
"tsup": "^8.5.1",
|
|
@@ -47,16 +59,11 @@
|
|
|
47
59
|
"vite": "^8.0.8"
|
|
48
60
|
},
|
|
49
61
|
"dependencies": {
|
|
50
|
-
"@emotion/react": "^11.14.0",
|
|
51
|
-
"@emotion/styled": "^11.14.1",
|
|
52
62
|
"@lumiastream/lumia-translations": "1.15.4",
|
|
53
|
-
"@lumiastream/lumia-types": "^3.
|
|
54
|
-
"@mui/icons-material": "^9.0.0",
|
|
55
|
-
"@mui/material": "^9.0.0",
|
|
63
|
+
"@lumiastream/lumia-types": "^3.3.7-alpha.2",
|
|
56
64
|
"classnames": "^2.5.1",
|
|
57
65
|
"globals": "^17.4.0",
|
|
58
66
|
"nanoid": "^5.1.11",
|
|
59
|
-
"react-best-gradient-color-picker": "^3.0.14"
|
|
60
|
-
"react-hook-form": "^7.73.1"
|
|
67
|
+
"react-best-gradient-color-picker": "^3.0.14"
|
|
61
68
|
}
|
|
62
69
|
}
|