@smartico/public-api 0.0.433 → 0.0.434
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/Inbox/InboxMessage.d.ts +1 -1
- package/dist/MiniGames/SAWTemplateUI.d.ts +26 -0
- package/dist/SmarticoGlobal.d.ts +18 -0
- package/dist/WSAPI/WSAPIInbox.d.ts +16 -0
- package/dist/WSAPI/WSAPITypes.d.ts +6 -0
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +19 -1
- package/dist/index.modern.mjs.map +1 -1
- package/docs/ui/inbox/UIGuide_getInboxMessageBody.md +24 -2
- package/package.json +1 -1
- package/src/Inbox/InboxMessage.ts +3 -1
- package/src/MiniGames/SAWTemplateUI.ts +29 -0
- package/src/SmarticoGlobal.ts +18 -0
- package/src/WSAPI/WSAPIInbox.ts +16 -0
- package/src/WSAPI/WSAPITypes.ts +6 -0
|
@@ -390,6 +390,32 @@ export interface SAWTemplateUI {
|
|
|
390
390
|
* Back-Office label: _"Use Custom Game"_.
|
|
391
391
|
*/
|
|
392
392
|
use_custom?: boolean;
|
|
393
|
+
/**
|
|
394
|
+
* Whether a custom mini-game fills the whole mini-game window instead of
|
|
395
|
+
* the default fixed-size frame (800×516 on desktop, 400×745 on mobile).
|
|
396
|
+
*
|
|
397
|
+
* Applies wherever the game is opened — a spin attempt shown to the user,
|
|
398
|
+
* a deep link, or `_smartico.miniGame()` in standalone or inline mode.
|
|
399
|
+
* The `fullscreen` option of `_smartico.miniGame()` overrides it per call.
|
|
400
|
+
*
|
|
401
|
+
* When `false` or omitted, the default frame size is used.
|
|
402
|
+
* Back-Office label: _"Standalone full screen"_.
|
|
403
|
+
*/
|
|
404
|
+
standalone_fullscreen?: boolean;
|
|
405
|
+
/**
|
|
406
|
+
* Width of the custom mini-game frame on desktop when opened standalone or inline,
|
|
407
|
+
* as a CSS size (`800px`, `100%`, `90vw`; a bare number is treated as pixels).
|
|
408
|
+
* Empty or invalid values fall back to the default 800px. Ignored on mobile.
|
|
409
|
+
* Back-Office label: _"Standalone width"_.
|
|
410
|
+
*/
|
|
411
|
+
standalone_width?: string;
|
|
412
|
+
/**
|
|
413
|
+
* Height of the custom mini-game frame on desktop when opened standalone or inline,
|
|
414
|
+
* as a CSS size (`516px`, `100%`, `90vh`; a bare number is treated as pixels).
|
|
415
|
+
* Empty or invalid values fall back to the default 516px. Ignored on mobile.
|
|
416
|
+
* Back-Office label: _"Standalone height"_.
|
|
417
|
+
*/
|
|
418
|
+
standalone_height?: string;
|
|
393
419
|
/**
|
|
394
420
|
* Minutes for the Voyager seed window.
|
|
395
421
|
* The seed window is the range of seeds that can be used to generate the map.
|
package/dist/SmarticoGlobal.d.ts
CHANGED
|
@@ -34,6 +34,24 @@ export interface SmarticoWidgetParams {
|
|
|
34
34
|
zoom?: number;
|
|
35
35
|
/** Force the mobile layout regardless of viewport. */
|
|
36
36
|
force_mobile?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Custom mini-games only ({@link SmarticoGlobal.miniGame}): `true` fills the whole mini-game window,
|
|
39
|
+
* `false` keeps the default fixed-size frame. Overrides the template's "Standalone full screen" setting;
|
|
40
|
+
* when omitted, the template setting is used.
|
|
41
|
+
*/
|
|
42
|
+
fullscreen?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Custom mini-games only ({@link SmarticoGlobal.miniGame}): desktop width of the game frame as a CSS size
|
|
45
|
+
* (`1000px`, `100%`, `90vw`; a number is treated as pixels). Overrides the template's "Standalone width"
|
|
46
|
+
* and "Standalone full screen" settings. Ignored on mobile.
|
|
47
|
+
*/
|
|
48
|
+
frame_width?: string | number;
|
|
49
|
+
/**
|
|
50
|
+
* Custom mini-games only ({@link SmarticoGlobal.miniGame}): desktop height of the game frame as a CSS size
|
|
51
|
+
* (`600px`, `100%`, `90vh`; a number is treated as pixels). Overrides the template's "Standalone height"
|
|
52
|
+
* and "Standalone full screen" settings. Ignored on mobile.
|
|
53
|
+
*/
|
|
54
|
+
frame_height?: string | number;
|
|
37
55
|
}
|
|
38
56
|
/**
|
|
39
57
|
* Options passed to {@link SmarticoGlobal.init} / {@link SmarticoGlobal.initVisitorMode}.
|
|
@@ -318,6 +318,16 @@ export declare class WSAPIInbox extends WSAPILeaderBoard {
|
|
|
318
318
|
* for safe execution — that helper handles URL vs deep-link
|
|
319
319
|
* routing.
|
|
320
320
|
*
|
|
321
|
+
* **Preview vs silent delivery**
|
|
322
|
+
* Every message belongs in your inbox list. `show_preview` decides
|
|
323
|
+
* whether it should also pop up briefly when it arrives:
|
|
324
|
+
* - `show_preview !== false` → show a preview popup for
|
|
325
|
+
* `show_duration_sec ?? 7` seconds.
|
|
326
|
+
* - `show_preview === false` → store it silently, with no popup.
|
|
327
|
+
* These fields are returned exactly as the operator configured them;
|
|
328
|
+
* a missing value means the default above, the same as the default
|
|
329
|
+
* Smartico UI.
|
|
330
|
+
*
|
|
321
331
|
* **Idempotency / Side effects**: safe. Read-only HTTP fetch.
|
|
322
332
|
*
|
|
323
333
|
* **UI guidance**: see [UI Guide — `getInboxMessageBody`](../../docs/ui/inbox/UIGuide_getInboxMessageBody.md).
|
|
@@ -343,6 +353,12 @@ export declare class WSAPIInbox extends WSAPILeaderBoard {
|
|
|
343
353
|
* console.log('[smartico] simple message — show preview_body + single CTA wired to:', body.action,
|
|
344
354
|
* '— execute via _smartico.dp(body.action)');
|
|
345
355
|
* }
|
|
356
|
+
*
|
|
357
|
+
* if (body.show_preview !== false) {
|
|
358
|
+
* console.log('[smartico] new message — show a preview popup for', body.show_duration_sec ?? 7, 'seconds');
|
|
359
|
+
* } else {
|
|
360
|
+
* console.log('[smartico] new message — store it in the inbox silently, no popup');
|
|
361
|
+
* }
|
|
346
362
|
* ```
|
|
347
363
|
*/
|
|
348
364
|
getInboxMessageBody(messageGuid: string): Promise<TInboxMessageBody>;
|
|
@@ -1083,6 +1083,12 @@ export interface TInboxMessageBody {
|
|
|
1083
1083
|
/** Operator-defined custom data. The SDK auto-parses JSON-looking
|
|
1084
1084
|
* strings, so at runtime this is `any` despite the `string` type. */
|
|
1085
1085
|
custom_data?: string;
|
|
1086
|
+
/** Whether to show a short preview popup when the message arrives.
|
|
1087
|
+
* `false` means store it in the inbox silently; missing means `true`. */
|
|
1088
|
+
show_preview?: boolean;
|
|
1089
|
+
/** How long the preview popup stays visible, in seconds.
|
|
1090
|
+
* `null` or missing means 7 seconds. */
|
|
1091
|
+
show_duration_sec?: number | null;
|
|
1086
1092
|
}
|
|
1087
1093
|
/**
|
|
1088
1094
|
* InboxMarkMessageAction is the response of the five inbox mutation
|
package/dist/index.js
CHANGED
|
@@ -961,7 +961,9 @@ var InboxMessageBodyTransform = function InboxMessageBodyTransform(item) {
|
|
|
961
961
|
icon: item.image,
|
|
962
962
|
title: item.title,
|
|
963
963
|
preview_body: item.body,
|
|
964
|
-
custom_data: IntUtils.JsonOrText(item == null ? void 0 : item.custom_data)
|
|
964
|
+
custom_data: IntUtils.JsonOrText(item == null ? void 0 : item.custom_data),
|
|
965
|
+
show_preview: item.show_preview,
|
|
966
|
+
show_duration_sec: item.show_duration_sec
|
|
965
967
|
};
|
|
966
968
|
if (item.action === 'dp:inbox') {
|
|
967
969
|
if (item.additional_buttons && item.additional_buttons.length) {
|
|
@@ -9877,6 +9879,16 @@ var WSAPIInbox = /*#__PURE__*/function (_WSAPILeaderBoard) {
|
|
|
9877
9879
|
* for safe execution — that helper handles URL vs deep-link
|
|
9878
9880
|
* routing.
|
|
9879
9881
|
*
|
|
9882
|
+
* **Preview vs silent delivery**
|
|
9883
|
+
* Every message belongs in your inbox list. `show_preview` decides
|
|
9884
|
+
* whether it should also pop up briefly when it arrives:
|
|
9885
|
+
* - `show_preview !== false` → show a preview popup for
|
|
9886
|
+
* `show_duration_sec ?? 7` seconds.
|
|
9887
|
+
* - `show_preview === false` → store it silently, with no popup.
|
|
9888
|
+
* These fields are returned exactly as the operator configured them;
|
|
9889
|
+
* a missing value means the default above, the same as the default
|
|
9890
|
+
* Smartico UI.
|
|
9891
|
+
*
|
|
9880
9892
|
* **Idempotency / Side effects**: safe. Read-only HTTP fetch.
|
|
9881
9893
|
*
|
|
9882
9894
|
* **UI guidance**: see [UI Guide — `getInboxMessageBody`](../../docs/ui/inbox/UIGuide_getInboxMessageBody.md).
|
|
@@ -9902,6 +9914,12 @@ var WSAPIInbox = /*#__PURE__*/function (_WSAPILeaderBoard) {
|
|
|
9902
9914
|
* console.log('[smartico] simple message — show preview_body + single CTA wired to:', body.action,
|
|
9903
9915
|
* '— execute via _smartico.dp(body.action)');
|
|
9904
9916
|
* }
|
|
9917
|
+
*
|
|
9918
|
+
* if (body.show_preview !== false) {
|
|
9919
|
+
* console.log('[smartico] new message — show a preview popup for', body.show_duration_sec ?? 7, 'seconds');
|
|
9920
|
+
* } else {
|
|
9921
|
+
* console.log('[smartico] new message — store it in the inbox silently, no popup');
|
|
9922
|
+
* }
|
|
9905
9923
|
* ```
|
|
9906
9924
|
*/
|
|
9907
9925
|
;
|