@lumiastream/ui 0.2.8-alpha.14 → 0.2.8-alpha.16

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 CHANGED
@@ -3362,12 +3362,13 @@ var LUMIA_DEFAULT_SIZES = {
3362
3362
  // fine at this aspect — rocket internally uses a vertical gauge but
3363
3363
  // still works at this footprint. Users can resize per their overlay.
3364
3364
  hypetrain: { width: 740, height: 140 },
3365
- // Stream Boss: sized to fit the Card theme (avatar + name + bar) out of
3366
- // the box. SE's native bit-boss layer is shorter (~86px) but ours has the
3367
- // avatar + crown stack using SE's compact bounds would clip them. The
3368
- // importer overrides any narrower SE css.height when Card is selected;
3369
- // users who want SE's strip look can switch to Bar-Only and shrink.
3370
- streamboss: { width: 720, height: 180 },
3365
+ // Stream Boss: matches the native DefaultHeightWidthModules.streamboss
3366
+ // (720x110) so SE imports and fresh-add modules look identical. SE's
3367
+ // native bit-boss layer is ~86px tall, so the SE mapper's Card-min-height
3368
+ // override grows it up to 110px to ensure the avatar+name+bar all fit.
3369
+ // Users who want a taller layout can drag the corner; users who want the
3370
+ // SE strip look should switch to Bar-Only.
3371
+ streamboss: { width: 720, height: 110 },
3371
3372
  // Song Request: SE's media-share default is 480×292. Lumia's now-playing
3372
3373
  // card + 5-item queue list needs a bit more vertical room, so we add ~80px
3373
3374
  // for the queue list. Users can hide the queue list and shrink back to
@@ -5058,7 +5059,7 @@ function mapStreamBoss(widget) {
5058
5059
  });
5059
5060
  if (theme === "card") {
5060
5061
  const MIN_CARD_WIDTH = 480;
5061
- const MIN_CARD_HEIGHT = 180;
5062
+ const MIN_CARD_HEIGHT = 110;
5062
5063
  if (unit.layer.bounds.width < MIN_CARD_WIDTH) unit.layer.bounds.width = MIN_CARD_WIDTH;
5063
5064
  if (unit.layer.bounds.height < MIN_CARD_HEIGHT) unit.layer.bounds.height = MIN_CARD_HEIGHT;
5064
5065
  }
@@ -7227,6 +7228,13 @@ function SEImportWizard({
7227
7228
  });
7228
7229
  return;
7229
7230
  }
7231
+ if (!parts.apikey) {
7232
+ setLoadError({
7233
+ message: "That looks like an editor URL, which doesn't include an access token.",
7234
+ hint: `Use the public preview URL (Overlay menu \u2192 Get URL \u2192 Public link). Overlay id: ${parts.overlayId}`
7235
+ });
7236
+ return;
7237
+ }
7230
7238
  setLoading(true);
7231
7239
  try {
7232
7240
  const bootstrap = await fetchSEBootstrap(parts);
@@ -7896,14 +7904,20 @@ function extractSEOverlayId(input) {
7896
7904
  }
7897
7905
  function extractSEPreviewParts(input) {
7898
7906
  const trimmed = input.trim();
7899
- const m = trimmed.match(/streamelements\.com\/overlay\/([0-9a-f]{24})\/([A-Za-z0-9_-]+)/i);
7907
+ const m = trimmed.match(/streamelements\.com\/overlay\/([0-9a-f]{24})(?:\/([A-Za-z0-9_-]+))?/i);
7900
7908
  if (!m) return null;
7901
- return { overlayId: m[1], apikey: m[2] };
7909
+ const overlayId = m[1];
7910
+ const second = m[2];
7911
+ const apikey = second && second.toLowerCase() !== "editor" ? second : null;
7912
+ return { overlayId, apikey };
7902
7913
  }
7903
7914
  function buildBootstrapUrl(overlayId) {
7904
7915
  return `https://api.streamelements.com/kappa/v2/overlays/${overlayId}/bootstrap?isEditor=false&isMobile=false&isObs=false&isObsLive=false&isXsplit=false`;
7905
7916
  }
7906
7917
  async function fetchSEBootstrap({ overlayId, apikey }) {
7918
+ if (!apikey) {
7919
+ throw new Error("Missing access token. Use the public preview URL (Overlay menu \u2192 Get URL \u2192 Public link) \u2014 editor URLs do not include a token.");
7920
+ }
7907
7921
  const res = await fetch(buildBootstrapUrl(overlayId), {
7908
7922
  method: "GET",
7909
7923
  headers: { Accept: "application/json", Authorization: `apikey ${apikey}` }
@@ -369,12 +369,12 @@ interface ImportResult {
369
369
  declare function extractSEOverlayId(input: string): string | null;
370
370
  declare function extractSEPreviewParts(input: string): {
371
371
  overlayId: string;
372
- apikey: string;
372
+ apikey: string | null;
373
373
  } | null;
374
374
  declare function buildBootstrapUrl(overlayId: string): string;
375
375
  declare function fetchSEBootstrap({ overlayId, apikey }: {
376
376
  overlayId: string;
377
- apikey: string;
377
+ apikey: string | null;
378
378
  }): Promise<SEBootstrapResponse>;
379
379
  declare function isSEBootstrap(value: unknown): value is SEBootstrapResponse;
380
380
  declare function importSEBootstrap(bootstrap: SEBootstrapResponse): ImportResult;
package/dist/se-import.js CHANGED
@@ -247,12 +247,13 @@ var LUMIA_DEFAULT_SIZES = {
247
247
  // fine at this aspect — rocket internally uses a vertical gauge but
248
248
  // still works at this footprint. Users can resize per their overlay.
249
249
  hypetrain: { width: 740, height: 140 },
250
- // Stream Boss: sized to fit the Card theme (avatar + name + bar) out of
251
- // the box. SE's native bit-boss layer is shorter (~86px) but ours has the
252
- // avatar + crown stack using SE's compact bounds would clip them. The
253
- // importer overrides any narrower SE css.height when Card is selected;
254
- // users who want SE's strip look can switch to Bar-Only and shrink.
255
- streamboss: { width: 720, height: 180 },
250
+ // Stream Boss: matches the native DefaultHeightWidthModules.streamboss
251
+ // (720x110) so SE imports and fresh-add modules look identical. SE's
252
+ // native bit-boss layer is ~86px tall, so the SE mapper's Card-min-height
253
+ // override grows it up to 110px to ensure the avatar+name+bar all fit.
254
+ // Users who want a taller layout can drag the corner; users who want the
255
+ // SE strip look should switch to Bar-Only.
256
+ streamboss: { width: 720, height: 110 },
256
257
  // Song Request: SE's media-share default is 480×292. Lumia's now-playing
257
258
  // card + 5-item queue list needs a bit more vertical room, so we add ~80px
258
259
  // for the queue list. Users can hide the queue list and shrink back to
@@ -1943,7 +1944,7 @@ function mapStreamBoss(widget) {
1943
1944
  });
1944
1945
  if (theme === "card") {
1945
1946
  const MIN_CARD_WIDTH = 480;
1946
- const MIN_CARD_HEIGHT = 180;
1947
+ const MIN_CARD_HEIGHT = 110;
1947
1948
  if (unit.layer.bounds.width < MIN_CARD_WIDTH) unit.layer.bounds.width = MIN_CARD_WIDTH;
1948
1949
  if (unit.layer.bounds.height < MIN_CARD_HEIGHT) unit.layer.bounds.height = MIN_CARD_HEIGHT;
1949
1950
  }
@@ -6097,6 +6098,13 @@ function SEImportWizard({
6097
6098
  });
6098
6099
  return;
6099
6100
  }
6101
+ if (!parts.apikey) {
6102
+ setLoadError({
6103
+ message: "That looks like an editor URL, which doesn't include an access token.",
6104
+ hint: `Use the public preview URL (Overlay menu \u2192 Get URL \u2192 Public link). Overlay id: ${parts.overlayId}`
6105
+ });
6106
+ return;
6107
+ }
6100
6108
  setLoading(true);
6101
6109
  try {
6102
6110
  const bootstrap = await fetchSEBootstrap(parts);
@@ -6766,14 +6774,20 @@ function extractSEOverlayId(input) {
6766
6774
  }
6767
6775
  function extractSEPreviewParts(input) {
6768
6776
  const trimmed = input.trim();
6769
- const m = trimmed.match(/streamelements\.com\/overlay\/([0-9a-f]{24})\/([A-Za-z0-9_-]+)/i);
6777
+ const m = trimmed.match(/streamelements\.com\/overlay\/([0-9a-f]{24})(?:\/([A-Za-z0-9_-]+))?/i);
6770
6778
  if (!m) return null;
6771
- return { overlayId: m[1], apikey: m[2] };
6779
+ const overlayId = m[1];
6780
+ const second = m[2];
6781
+ const apikey = second && second.toLowerCase() !== "editor" ? second : null;
6782
+ return { overlayId, apikey };
6772
6783
  }
6773
6784
  function buildBootstrapUrl(overlayId) {
6774
6785
  return `https://api.streamelements.com/kappa/v2/overlays/${overlayId}/bootstrap?isEditor=false&isMobile=false&isObs=false&isObsLive=false&isXsplit=false`;
6775
6786
  }
6776
6787
  async function fetchSEBootstrap({ overlayId, apikey }) {
6788
+ if (!apikey) {
6789
+ throw new Error("Missing access token. Use the public preview URL (Overlay menu \u2192 Get URL \u2192 Public link) \u2014 editor URLs do not include a token.");
6790
+ }
6777
6791
  const res = await fetch(buildBootstrapUrl(overlayId), {
6778
6792
  method: "GET",
6779
6793
  headers: { Accept: "application/json", Authorization: `apikey ${apikey}` }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.2.8-alpha.14",
3
+ "version": "0.2.8-alpha.16",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",