handler-playable-sdk 0.2.7 → 0.3.2
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/ConfigOverride-6YH2ILBJ.mjs +1 -0
- package/dist/chunk-BDZGKN5O.mjs +1 -0
- package/dist/chunk-GYW3GFXA.mjs +830 -0
- package/dist/chunk-HN7I4BLB.mjs +1 -0
- package/dist/config-QLS2MDB6.mjs +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.mts +388 -2
- package/dist/index.d.ts +388 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/loader-object-centric-C1QteFfG.d.mts +81 -0
- package/dist/loader-object-centric-C1QteFfG.d.ts +81 -0
- package/dist/pixi/index.css +1 -0
- package/dist/pixi/index.d.mts +407 -93
- package/dist/pixi/index.d.ts +407 -93
- package/dist/pixi/index.js +9 -9
- package/dist/pixi/index.mjs +1 -11
- package/dist/three/index.css +1 -0
- package/dist/three/index.js +55 -55
- package/dist/three/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-UVBNGLP3.mjs +0 -17
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object-Centric Config Loader
|
|
3
|
+
*
|
|
4
|
+
* Loads component schemas, object configs, engine configs, and scene configs.
|
|
5
|
+
* Validates against schemas and applies defaults.
|
|
6
|
+
*/
|
|
7
|
+
declare global {
|
|
8
|
+
interface Window {
|
|
9
|
+
INLINE_ASSETS?: Record<string, string>;
|
|
10
|
+
__BUILD_SETTINGS__?: {
|
|
11
|
+
buildMode?: 'dev' | 'brand' | 'publish';
|
|
12
|
+
assetsInlined?: boolean;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Load all component schemas
|
|
18
|
+
*/
|
|
19
|
+
declare function loadComponentSchemas(): Promise<Map<string, any>>;
|
|
20
|
+
/**
|
|
21
|
+
* Load specific object config
|
|
22
|
+
*/
|
|
23
|
+
declare function loadObjectConfig(objectId: string): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Load all object configs from scene
|
|
26
|
+
*/
|
|
27
|
+
declare function loadAllObjectConfigs(sceneConfig: any): Promise<Map<string, any>>;
|
|
28
|
+
/**
|
|
29
|
+
* Load engine configs
|
|
30
|
+
*/
|
|
31
|
+
declare function loadEngineConfig(): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* Load game prompt config
|
|
34
|
+
*/
|
|
35
|
+
declare function loadGamePromptConfig(): Promise<any>;
|
|
36
|
+
/**
|
|
37
|
+
* Load scene config
|
|
38
|
+
*/
|
|
39
|
+
declare function loadSceneConfig(sceneId?: string): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* Validate object config against schemas
|
|
42
|
+
*/
|
|
43
|
+
declare function validateObjectConfig(object: any, schemas: Map<string, any>): {
|
|
44
|
+
valid: boolean;
|
|
45
|
+
errors: string[];
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Apply schema defaults to object config
|
|
49
|
+
*/
|
|
50
|
+
declare function applyDefaults(object: any, schemas: Map<string, any>): any;
|
|
51
|
+
/**
|
|
52
|
+
* Main config loader - object-centric version
|
|
53
|
+
*/
|
|
54
|
+
interface ObjectCentricConfig {
|
|
55
|
+
objects: Map<string, any>;
|
|
56
|
+
engine: {
|
|
57
|
+
runtime: any;
|
|
58
|
+
assets: any;
|
|
59
|
+
splash?: any;
|
|
60
|
+
};
|
|
61
|
+
scene: any;
|
|
62
|
+
schemas: Map<string, any>;
|
|
63
|
+
theme: {
|
|
64
|
+
background_color?: string;
|
|
65
|
+
text_color?: string;
|
|
66
|
+
square_color?: string;
|
|
67
|
+
cta_background?: string;
|
|
68
|
+
cta_text?: string;
|
|
69
|
+
brush_color?: string;
|
|
70
|
+
};
|
|
71
|
+
gameplay: {
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
declare function loadObjectCentricConfig(sceneId?: string, overrides?: Partial<ObjectCentricConfig>): Promise<ObjectCentricConfig>;
|
|
76
|
+
/**
|
|
77
|
+
* Convert object-centric config to legacy format for backward compatibility
|
|
78
|
+
*/
|
|
79
|
+
declare function toLegacyFormat(config: ObjectCentricConfig): any;
|
|
80
|
+
|
|
81
|
+
export { type ObjectCentricConfig as O, loadComponentSchemas as a, loadObjectConfig as b, loadAllObjectConfigs as c, loadEngineConfig as d, loadGamePromptConfig as e, loadSceneConfig as f, applyDefaults as g, loadObjectCentricConfig as l, toLegacyFormat as t, validateObjectConfig as v };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--ui-bg: #0f1218;--ui-bg-2: #101520;--ui-surface: #171c25;--ui-surface-2: #1f2530;--ui-border: #2b3544;--ui-text: #e8edf3;--ui-muted: #9aa7b4;--ui-accent: #3dd6c6;--ui-accent-2: #ff9f43;--ui-accent-3: #6f8cff;--ui-danger: #ff5c70;--ui-shadow: 0 18px 40px rgba(5, 10, 18, .45)}.preview-shell{height:100vh;width:100vw;background:radial-gradient(circle at top left,#182033 0%,var(--ui-bg) 45%,#0c1018 100%);color:var(--ui-text);font-family:Avenir Next,Avenir,Futura,Gill Sans,Trebuchet MS,sans-serif;display:flex;flex-direction:column;box-sizing:border-box}.preview-stage{height:100%;display:flex;flex-direction:column}.preview-toolbar{height:54px;background:linear-gradient(135deg,var(--ui-bg-2),#121926 50%,#141b28 100%);border-bottom:1px solid var(--ui-border);display:flex;align-items:center;justify-content:flex-start;padding:0 12px;z-index:10;gap:10px;width:100%;box-sizing:border-box;overflow:hidden;flex-shrink:0}.zoom-controls{display:flex;align-items:center;gap:2px;margin-left:auto;flex-shrink:0}.device-dropdown{flex-shrink:1;min-width:0;max-width:100%}.preview-btn{flex-shrink:0;white-space:nowrap}@media(max-width:768px){.preview-toolbar{padding:0 4px;height:50px;gap:4px}.device-dropdown{font-size:11px;padding:2px 4px;min-width:100px}.preview-btn{padding:3px 6px;font-size:11px}.zoom-label{font-size:11px;min-width:30px}@media(max-width:480px){#refresh-btn,#debug-toggle,#console-toggle{display:none}}}.device-frame{box-shadow:0 0 0 1px #ffffff14,0 18px 40px #0000008c;border-radius:14px;background-color:#000;transition:width .3s ease,height .3s ease;overflow:hidden;position:relative}.console-panel{position:absolute;bottom:0;left:0;right:0;height:200px;background:#10141cf5;border-top:1px solid var(--ui-border);display:flex;flex-direction:column;transition:opacity .3s ease,visibility .3s ease;z-index:100}.console-panel.closed{opacity:0;visibility:hidden;pointer-events:none}.console-msg{font-family:Consolas,Monaco,monospace;font-size:12px;padding:4px 8px;border-bottom:1px solid #333}.console-msg.type-warn{color:#feca57}.preview-toolbar-left{display:flex;align-items:center}.preview-logo{font-weight:700;font-size:13px;color:var(--ui-text);letter-spacing:1.2px;text-transform:uppercase}.preview-toolbar-center,.preview-toolbar-right{display:flex;align-items:center;gap:8px}.view-toggle{display:flex;align-items:center;gap:6px;padding:2px;background:#121826;border:1px solid var(--ui-border);border-radius:999px}.view-toggle-btn{border:none;background:transparent;color:var(--ui-muted);font-size:11px;padding:6px 12px;border-radius:999px;cursor:pointer;transition:all .2s ease}.view-toggle-btn.active{color:var(--ui-text);background:#263146;box-shadow:inset 0 0 0 1px #6f8cff66}.device-selector-wrapper{position:relative}.device-dropdown{background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:8px;padding:6px 10px;font-size:12px;min-width:150px;max-width:100%;cursor:pointer;overflow:hidden;text-overflow:ellipsis}.device-dropdown:focus{outline:none;border-color:var(--ui-accent-3)}.preview-btn{background-color:#202836;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:8px;padding:6px 10px;font-size:12px;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:6px}.preview-btn:hover{background-color:#2a3446;border-color:#3b475c}.preview-btn:active{background-color:#343f55}.preview-btn:disabled,.device-dropdown:disabled{opacity:.5;cursor:not-allowed}.icon-btn{padding:6px;width:30px;height:30px;justify-content:center}@media(max-width:768px){.icon-btn{padding:3px;width:24px;height:24px}.icon-btn svg{width:12px;height:12px}}.icon-btn svg{width:16px;height:16px}.toolbar-divider{width:1px;height:20px;background-color:#555;margin:0 4px}.zoom-label{font-size:12px;color:var(--ui-muted);min-width:35px;text-align:center}.console-toggle{position:relative}.console-badge{background-color:#ff6b6b;color:#fff;font-size:10px;padding:2px 4px;border-radius:8px;margin-left:4px;display:none}.console-badge.has-errors{display:inline-block}.preview-main{flex:1;position:relative;overflow:hidden;background:radial-gradient(circle at 30% 20%,rgba(61,214,198,.1),transparent 45%),radial-gradient(circle at 70% 80%,rgba(111,140,255,.14),transparent 50%),#0e1118}.preview-container{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}.frame-wrapper{display:flex;justify-content:center;align-items:center;transform-origin:center center;transition:transform .2s cubic-bezier(.25,.46,.45,.94);filter:drop-shadow(0 12px 24px rgba(0,0,0,.45))}.game-container{width:100%;height:100%;position:relative}.console-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid var(--ui-border);background-color:#141a24}.console-title{font-weight:600;font-size:14px;color:var(--ui-text)}.console-actions{display:flex;gap:8px}.console-action-btn{background-color:transparent;color:var(--ui-muted);border:1px solid var(--ui-border);border-radius:3px;padding:4px 8px;font-size:11px;cursor:pointer;transition:all .2s ease}.console-action-btn:hover{background-color:#243041;color:var(--ui-text)}.console-messages{flex:1;overflow-y:auto;padding:4px 0}.console-msg{font-family:Consolas,Monaco,monospace;font-size:12px;padding:4px 12px;border-bottom:1px solid #333;word-wrap:break-word}.console-msg .time{color:#888;margin-right:8px;font-size:11px}.console-msg.type-log{color:#fff}.console-msg.type-info{color:#74c0fc}.console-msg.type-error{color:#ff6b6b;background:#ff00001a}.console-msg.type-warn{color:#feca57;background:#ffc1071a}.debug-overlay{position:absolute;inset:0;z-index:200;pointer-events:none}.debug-overlay.hidden{display:none}.scene-panel{position:absolute;width:320px;max-height:78vh;background:#12161ef5;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);pointer-events:auto;overflow:hidden;box-sizing:border-box}.scene-panel.scene-objects{width:300px}.scene-panel.scene-tools{max-height:46vh}.scene-panel.scene-tools .scene-panel-body{max-height:calc(46vh - 44px)}.customize-panel{width:320px}.customize-list{display:flex;flex-direction:column;gap:8px}.customize-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.customize-row{display:flex;align-items:center;gap:8px;background:#141a24b3;border:1px solid rgba(255,255,255,.05);border-radius:8px;padding:6px 8px}.customize-key{flex:0 0 120px;font-size:11px;color:var(--ui-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.customize-input{flex:1;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:6px;padding:4px 6px;font-size:11px;font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace}.customize-actions{display:flex;align-items:center;gap:6px}.customize-icon-btn{width:28px;height:28px;border-radius:8px;border:1px solid rgba(111,140,255,.4);background:#19202ccc;color:var(--ui-text);display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.customize-icon-btn svg{width:14px;height:14px;fill:currentColor}.customize-icon-btn.ai{font-size:10px;font-weight:700;letter-spacing:.05em;padding:4px 6px}.customize-file{display:none}.customize-color-field{display:flex;flex-direction:column;gap:6px;padding:8px;border-radius:8px;background:#141a24b3;border:1px solid rgba(255,255,255,.05);font-size:11px;color:var(--ui-muted)}.customize-color-field input[type=color]{width:100%;height:28px;padding:0;border:none;background:transparent}.customize-color-text{background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:6px;padding:4px 6px;font-size:11px;font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace}.customize-help{margin-top:6px;font-size:10px;color:var(--ui-muted)}.customize-empty{font-size:11px;color:var(--ui-muted);padding:6px 0}.batch-ai-label{font-size:11px;color:var(--ui-muted)}.batch-ai-input,.batch-ai-textarea,.batch-ai-select{width:100%;padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#0a0e14d9;color:var(--ui-text);font-size:12px}.batch-ai-textarea{min-height:70px;resize:vertical}.batch-ai-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.batch-ai-actions{margin-top:6px}.batch-ai-btn{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.batch-ai-btn.primary{border-color:#bf7eff99;background:#bf7eff33}.batch-ai-file{display:none}.batch-ai-file-name,.batch-ai-status{font-size:11px;color:var(--ui-muted)}.batch-ai-dna{margin-top:8px;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#10141c99}.batch-ai-palette{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.batch-ai-swatch{width:22px;height:22px;border-radius:6px;border:1px solid rgba(255,255,255,.2)}.batch-ai-muted{font-size:11px;color:var(--ui-muted)}.batch-ai-asset-list{margin-top:10px;display:flex;flex-direction:column;gap:10px}.batch-ai-item{border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016b3;padding:8px;display:flex;flex-direction:column;gap:8px}.batch-ai-item-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.batch-ai-toggle{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--ui-text)}.batch-ai-item-body{display:flex;flex-direction:column;gap:8px}.batch-ai-thumb{width:100%;max-height:140px;object-fit:contain;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#080a0e99}.batch-ai-thumb.hidden{display:none}.batch-ai-item-status{font-size:11px;color:var(--ui-muted)}.batch-ai-item-actions{display:flex;gap:8px;flex-wrap:wrap}.batch-ai-empty{font-size:11px;color:var(--ui-muted);padding:6px 0}.brand-dna-label{font-size:11px;color:var(--ui-muted)}.brand-dna-input,.brand-dna-textarea,.brand-dna-select{width:100%;padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#0a0e14d9;color:var(--ui-text);font-size:12px}.brand-dna-textarea{min-height:70px;resize:vertical}.brand-dna-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.brand-dna-btn{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.brand-dna-btn.primary{border-color:#6f8cff99;background:#6f8cff33}.brand-dna-file{display:none}.brand-dna-file-name,.brand-dna-status{font-size:11px;color:var(--ui-muted)}.brand-dna-meta{margin-top:8px}.brand-dna-prompt{margin:6px 0 0;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016b3;color:var(--ui-text);font-size:11px;white-space:pre-wrap}.brand-dna-output{margin-top:8px;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#10141c99}.brand-dna-palette{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.brand-dna-swatch{width:22px;height:22px;border-radius:6px;border:1px solid rgba(255,255,255,.2)}.brand-dna-muted{font-size:11px;color:var(--ui-muted)}.brand-dna-object-list{margin-top:10px;display:flex;flex-direction:column;gap:10px}.brand-dna-object{border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016b3;padding:8px;display:flex;flex-direction:column;gap:8px}.brand-dna-object-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.brand-dna-object-title{font-size:11px;color:var(--ui-text);word-break:break-all}.brand-dna-object-status{font-size:11px;color:var(--ui-muted)}.brand-dna-empty{font-size:11px;color:var(--ui-muted);padding:6px 0}.ai-panel{display:flex;flex-direction:column;gap:10px;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#10141c99}.ai-modal{position:fixed;inset:0;background:#060a10d1;display:flex;align-items:center;justify-content:center;z-index:10080}.ai-modal-card{width:min(760px,92vw);max-height:90vh;overflow:auto;background:#10141cfa;border:1px solid var(--ui-border);border-radius:16px;box-shadow:0 20px 50px #00000073}.ai-modal-header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid rgba(255,255,255,.06)}.ai-modal-actions{display:inline-flex;align-items:center;gap:8px}.ai-modal-title{font-size:14px;font-weight:700;color:var(--ui-text)}.ai-modal-subtitle{font-size:11px;color:var(--ui-muted);margin-top:3px}.ai-modal-close,.ai-modal-gallery{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 12px;font-size:11px;cursor:pointer}.ai-loading{display:none;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;background:linear-gradient(120deg,#58a3ff1a,#ff639424);border:1px solid rgba(88,163,255,.25)}.ai-loading.active{display:flex}.ai-loading-ring{width:26px;height:26px;border-radius:50%;border:3px solid rgba(255,255,255,.15);border-top-color:#58a3ffe6;animation:ai-spin .9s linear infinite}.ai-loading-bar{flex:1;height:8px;border-radius:999px;background:linear-gradient(90deg,#58a3ff33,#ff6394b3,#58a3ff33);background-size:200% 100%;animation:ai-bar 1.4s ease infinite}.ai-loading-text{font-size:11px;color:var(--ui-text)}@keyframes ai-spin{to{transform:rotate(360deg)}}@keyframes ai-bar{0%{background-position:0% 50%}to{background-position:100% 50%}}.ai-label{font-size:11px;color:var(--ui-muted)}.ai-input,.ai-select,.ai-textarea{width:100%;padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#0a0e14d9;color:var(--ui-text);font-size:12px}.ai-textarea{min-height:70px;resize:vertical}.ai-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ai-strength{gap:10px}.ai-strength input[type=range]{flex:1;min-width:160px}.ai-strength-value{font-size:11px;color:var(--ui-text);min-width:20px;text-align:right}.ai-gallery{border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016a6;padding:8px}.ai-gallery.hidden{display:none}.ai-gallery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px}.ai-gallery-item{border:1px solid rgba(255,255,255,.08);background:#080a0eb3;border-radius:10px;padding:6px;display:flex;flex-direction:column;gap:6px;cursor:pointer;text-align:left}.ai-gallery-item.active{border-color:#6f8cff99;box-shadow:0 0 0 1px #6f8cff40}.ai-gallery-thumb{width:100%;height:70px;object-fit:contain;border-radius:6px;background:#06080cb3;border:1px solid rgba(255,255,255,.08)}.ai-gallery-label{font-size:10px;color:var(--ui-text);word-break:break-all}.ai-gallery-empty{font-size:11px;color:var(--ui-muted)}.ai-btn{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.ai-file{display:none}.ai-file-name{font-size:11px;color:var(--ui-muted)}.ai-toggles label{font-size:11px;color:var(--ui-text);display:inline-flex;align-items:center;gap:6px}.ai-actions .debug-btn{flex:1}.ai-status{font-size:11px;color:var(--ui-muted)}.ai-preview{width:100%;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:#080a0e99;padding:8px;display:flex;justify-content:center;align-items:center;min-height:140px}.ai-preview img{max-width:100%;max-height:220px;object-fit:contain}.asset-preview-modal{position:fixed;inset:0;background:#080a0eb8;display:flex;align-items:center;justify-content:center;z-index:10050}.asset-preview-card{width:min(720px,92vw);max-height:82vh;background:#10141cfa;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);display:flex;flex-direction:column}.asset-preview-header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid rgba(255,255,255,.06);color:var(--ui-text)}.asset-preview-title{font-size:12px;font-weight:600;word-break:break-all}.asset-preview-close{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-preview-meta{padding:0 14px 10px;color:var(--ui-muted);font-size:11px;word-break:break-all;border-bottom:1px solid rgba(255,255,255,.06)}.asset-preview-actions{display:flex;align-items:center;gap:8px}.asset-preview-change,.asset-preview-ai{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-preview-body{padding:12px;overflow:auto;display:flex;align-items:center;justify-content:center}.asset-preview-ai-output{border-top:1px solid rgba(255,255,255,.06);padding:10px 12px 14px}.asset-preview-ai-output.hidden{display:none}.asset-preview-ai-label{font-size:11px;color:var(--ui-muted);margin-bottom:6px}.asset-preview-ai-image{width:100%;max-height:200px;object-fit:contain;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:#080a0e99}.asset-preview-body img{max-width:100%;max-height:60vh;object-fit:contain}.asset-preview-body audio{width:100%}.asset-preview-body pre{width:100%;white-space:pre-wrap;color:var(--ui-text);font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace;font-size:12px}.asset-crop-modal{position:fixed;inset:0;background:#080a0ec7;display:flex;align-items:center;justify-content:center;z-index:10060}.asset-crop-card{width:min(860px,96vw);background:#10141cfa;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);display:flex;flex-direction:column}.asset-crop-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.06);color:var(--ui-text)}.asset-crop-title{font-size:13px;font-weight:600}.asset-crop-subtitle{font-size:11px;color:var(--ui-muted);margin-top:2px}.asset-crop-close{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-crop-body{padding:16px;display:flex;justify-content:center;gap:16px;flex-wrap:nowrap;align-items:flex-start}.asset-crop-column{display:flex;flex-direction:column;gap:8px;align-items:center;min-width:0}.asset-crop-label{font-size:11px;color:var(--ui-muted);text-transform:uppercase;letter-spacing:.08em}.asset-crop-canvas{border-radius:12px;border:1px solid rgba(255,255,255,.08);background:#080a0e8c;cursor:grab}.asset-crop-preview{border-radius:12px;border:1px solid rgba(255,255,255,.08);background:#080a0e8c}.asset-crop-canvas:active{cursor:grabbing}.asset-crop-controls{display:flex;align-items:center;gap:12px;padding:0 16px 12px;color:var(--ui-text);font-size:12px}.asset-crop-controls label{min-width:42px}.asset-crop-zoom{flex:1}.asset-crop-zoom-value{min-width:50px;text-align:right;color:var(--ui-muted)}.asset-crop-reset{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-crop-actions{display:flex;justify-content:flex-end;gap:10px;padding:0 16px 16px}.asset-crop-actions button{border-radius:10px;padding:6px 14px;font-size:12px;border:1px solid var(--ui-border);background:#1c2432d9;color:var(--ui-text);cursor:pointer}.asset-crop-apply{background:var(--ui-accent);border-color:transparent;color:#10151f;font-weight:600}@media(max-width:720px){.customize-grid{grid-template-columns:1fr}}.scene-panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;background-color:#181c26f2;color:var(--ui-text);font-size:12px;user-select:none;cursor:move;border-bottom:1px solid rgba(255,255,255,.05)}.scene-panel-actions{display:flex;align-items:center;gap:8px}.scene-panel-action{border:1px solid var(--ui-border);border-radius:6px;background:#1f2633;color:var(--ui-muted);font-size:11px;padding:4px 8px;cursor:pointer}.scene-panel-action:hover{border-color:#ff9f4399;color:var(--ui-text)}.scene-panel-toggle{border:none;background:transparent;color:var(--ui-muted);font-size:14px;cursor:pointer;transition:transform .2s ease}.panel-title{display:flex;align-items:center;gap:8px}.panel-pill{padding:2px 8px;border-radius:999px;background:#3dd6c61f;color:var(--ui-accent);font-size:10px;text-transform:uppercase;letter-spacing:.6px}.panel-accent-blue .panel-pill{background:#6f8cff24;color:var(--ui-accent-3)}.panel-accent-amber .panel-pill{background:#ff9f4329;color:var(--ui-accent-2)}.panel-accent-violet .panel-pill{background:#bf7eff2e;color:#d6b7ff}.panel-title-text{font-weight:700;font-size:12px;letter-spacing:.4px}.panel-accent-teal{border-color:#3dd6c659}.panel-accent-blue{border-color:#6f8cff59}.panel-accent-amber{border-color:#ff9f4366}.panel-accent-violet{border-color:#bf7eff59}.scene-panel-body{padding:12px 14px 16px;overflow-y:auto;max-height:calc(78vh - 44px)}.scene-panel.collapsed .scene-panel-body{display:none}.scene-panel.collapsed .scene-panel-toggle{transform:rotate(-90deg)}.scene-panel-search input{width:100%;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:6px;padding:6px 8px;font-size:12px}.scene-panel-search input:focus{outline:none;border-color:var(--ui-accent);box-shadow:0 0 0 2px #3dd6c633}.scene-panel-filters{display:flex;gap:6px;margin-top:10px}.filter-chip{border:1px solid rgba(111,140,255,.3);background:#131822b3;color:var(--ui-muted);font-size:11px;border-radius:999px;padding:4px 10px;cursor:pointer;transition:all .2s ease}.filter-chip.active{color:var(--ui-text);border-color:#3dd6c680;background:#3dd6c626}.scene-object-list{margin-top:12px;display:flex;flex-direction:column;gap:12px}.scene-object-group-title{font-size:11px;color:var(--ui-muted);text-transform:uppercase;letter-spacing:.6px;margin-bottom:6px}.scene-object-count{margin-left:6px;padding:2px 6px;border-radius:999px;background:#ffffff14;color:var(--ui-text);font-size:10px}.scene-object-group-items{display:flex;flex-direction:column;gap:6px}.scene-object-item{width:100%;text-align:left;border:1px solid rgba(255,255,255,.06);border-radius:6px;background-color:#191e28e6;color:var(--ui-text);font-size:12px;padding:6px 8px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px}.scene-object-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scene-object-badge{font-size:10px;padding:2px 6px;border-radius:999px;text-transform:uppercase;letter-spacing:.4px;border:1px solid rgba(255,255,255,.1)}.scene-object-badge.ui{background:#3dd6c61f;color:var(--ui-accent)}.scene-object-badge.scene{background:#6f8cff1f;color:var(--ui-accent-3)}.scene-object-item:hover{border-color:#3dd6c680;color:var(--ui-text)}.scene-object-item.selected{border-color:#3dd6c6b3;color:var(--ui-text);box-shadow:inset 0 0 0 1px #3dd6c666}.scene-edit-selected{font-size:12px;color:var(--ui-muted);margin-bottom:10px}.debug-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #444;background-color:#252525;border-radius:8px 8px 0 0;cursor:move;user-select:none}.debug-tabs{display:flex;gap:6px;padding:8px 12px;border-bottom:1px solid #333;background-color:#1f1f1f}.debug-tab{flex:1;border:1px solid #444;border-radius:6px;background-color:#262626;color:#bfc3c7;font-size:12px;padding:6px 10px;cursor:pointer;transition:all .2s ease}.debug-tab.active{background-color:#323232;color:#fff;border-color:#ffb43b;box-shadow:inset 0 0 0 1px #ffb43b59}.debug-hint{font-size:11px;color:#9aa0a6;margin-bottom:10px}.debug-tab-panel{display:none}.debug-tab-panel.active{display:block}.debug-collapsible{border:1px solid rgba(255,255,255,.08);border-radius:10px;background-color:#151a24d9;overflow:hidden;margin-bottom:12px}.debug-collapsible-header{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background-color:#181e2ae6;border:none;color:var(--ui-text);font-size:12px;cursor:pointer}.debug-collapsible-body{padding:10px 12px}.debug-collapsible-icon{transition:transform .2s ease}.debug-collapsible.collapsed .debug-collapsible-body{display:none}.debug-collapsible.collapsed .debug-collapsible-icon{transform:rotate(-90deg)}.debug-nudge.hidden{display:none}.debug-arrow-pad{display:grid;grid-template-columns:repeat(3,36px);grid-auto-rows:32px;gap:6px;justify-content:center;margin-top:8px}.debug-arrow-btn{border:1px solid #444;border-radius:6px;background-color:#2b2b2b;color:#e7e7e7;font-size:14px;cursor:pointer;transition:all .15s ease}.debug-arrow-btn:hover{border-color:#ffb43b;color:#fff}.debug-arrow-btn:active{transform:translateY(1px)}.debug-arrow-btn[data-nudge=up]{grid-column:2}.debug-arrow-btn[data-nudge=left]{grid-column:1}.debug-arrow-btn[data-nudge=down]{grid-column:2}.debug-arrow-btn[data-nudge=right]{grid-column:3}.debug-info-grid{display:flex;flex-direction:column;gap:8px;padding:8px;border-radius:6px;background-color:#191e28cc;border:1px solid rgba(255,255,255,.08)}.debug-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px}.debug-info-label{color:#9aa0a6}.debug-info-value{color:#f1f3f5;font-weight:600}.debug-title{font-weight:600;font-size:14px;color:#fff}.debug-actions{display:flex;gap:8px}.debug-action-btn{background-color:transparent;color:#ccc;border:1px solid #555;border-radius:3px;padding:4px 8px;font-size:11px;cursor:pointer;transition:all .2s ease}.debug-action-btn:hover{background-color:#444;color:#fff}.debug-content{flex:1;overflow-y:auto;padding:12px 16px}.debug-section{margin-bottom:20px}.panel-section{margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.06)}.panel-section:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.panel-section-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--ui-muted);margin-bottom:8px}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}@media(max-width:520px){.field-grid{grid-template-columns:1fr}}.debug-section-title{font-size:12px;font-weight:600;color:var(--ui-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px;border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:4px}.debug-field{margin-bottom:12px}.debug-field label{display:block;font-size:11px;color:#aaa;margin-bottom:4px;font-weight:500}.debug-field input,.debug-field select{width:100%;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:4px;padding:6px 8px;font-size:12px;font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace;transition:border-color .2s ease}.debug-field input:focus,.debug-field select:focus{outline:none;border-color:var(--ui-accent-3);box-shadow:0 0 0 2px #6f8cff33}.debug-field input[type=range]{-webkit-appearance:none;appearance:none;height:6px;background:#555;border-radius:3px;outline:none}.debug-field input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;background:var(--ui-accent-3);cursor:pointer}.debug-field input[type=range]::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:var(--ui-accent-3);cursor:pointer;border:none}.debug-field input[type=checkbox]{width:auto;margin-right:8px}.debug-field.checkbox-field{display:flex;align-items:center;gap:8px}.debug-field.checkbox-field label{margin-bottom:0;flex:1}.debug-value-display{display:inline-block;margin-left:8px;font-size:11px;color:var(--ui-muted);font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace}.debug-btn-group{display:flex;gap:6px;margin-top:8px}.debug-btn{flex:1;background-color:#444;color:#fff;border:1px solid #666;border-radius:4px;padding:6px 8px;font-size:11px;cursor:pointer;transition:all .2s ease}.debug-btn:hover{background-color:#555;border-color:#888}.debug-btn.primary{background-color:#2a5bd7;border-color:#2a5bd7}.debug-btn.primary:hover{background-color:#2147a7;border-color:#2147a7}.debug-btn.danger{background-color:#dc3545;border-color:#dc3545}.debug-btn.danger:hover{background-color:#c82333;border-color:#c82333}.debug-btn.secondary{background-color:#3dd6c61a;border-color:#3dd6c64d;color:#3dd6c6}.debug-btn.secondary:hover{background-color:#3dd6c633;border-color:#3dd6c666}.config-editor{border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:12px;margin-top:8px;background-color:#191e28d9}.debug-select{width:100%;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:4px;padding:6px 8px;font-size:11px}.debug-select:focus{outline:none;border-color:var(--ui-accent-3);box-shadow:0 0 0 2px #6f8cff33}.debug-select option{background-color:#333;color:#fff}.json-modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000c;z-index:10000;display:flex;align-items:center;justify-content:center}.json-modal-content{background-color:#1e1e1e;border:1px solid #555;border-radius:8px;width:80%;max-width:800px;max-height:80%;display:flex;flex-direction:column}.json-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #444}.json-modal-header h3{margin:0;color:#fff;font-size:16px;font-weight:600}.json-modal-body{flex:1;padding:16px 20px;overflow-y:auto}.json-modal-body pre{margin:0;color:#fff;font-family:Consolas,Monaco,monospace;font-size:12px;line-height:1.4;white-space:pre-wrap;word-wrap:break-word}.debug-toggle{position:relative}.debug-toggle-badge{background-color:#28a745;color:#fff;font-size:10px;padding:2px 4px;border-radius:8px;margin-left:4px;display:none}.debug-toggle-badge.active{display:inline-block}.preview-stage{width:100%;height:100%;display:flex;align-items:center;justify-content:center;position:relative}.preview-stage.hidden{display:none}.compare-grid{width:100%;height:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;padding:8px;box-sizing:border-box}.compare-viewport{display:flex;flex-direction:column;background:#141820e6;border:1px solid rgba(111,140,255,.2);border-radius:14px;box-shadow:var(--ui-shadow);overflow:hidden;position:relative}.compare-viewport.is-active{border-color:#3dd6c699;box-shadow:0 0 0 1px #3dd6c666,var(--ui-shadow)}.compare-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:#121720e6;border-bottom:1px solid rgba(255,255,255,.06);color:var(--ui-text)}.compare-title{display:flex;flex-direction:column;gap:2px}.compare-title-text{font-size:12px;font-weight:700;letter-spacing:.6px;text-transform:uppercase}.compare-meta{font-size:11px;color:var(--ui-muted)}.compare-focus{border:1px solid rgba(111,140,255,.5);background:#1e2638b3;color:var(--ui-text);border-radius:999px;padding:4px 10px;font-size:11px;cursor:pointer}.compare-viewport.is-active .compare-focus{border-color:#3dd6c699;background:#3dd6c62e;color:#e9fff9}.compare-body{position:relative;flex:1;display:flex;align-items:center;justify-content:center;padding:10px;box-sizing:border-box}.compare-slot,.compare-ghost{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.compare-ghost.hidden{display:none}.compare-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--ui-muted);background:#0a0d1259;opacity:0;transition:opacity .2s ease;pointer-events:none}.compare-viewport:not(.is-active) .compare-overlay{opacity:1}.snapshot-canvas{width:100%;height:100%;display:block;background:#000}@media(max-width:1100px){.compare-grid{grid-template-columns:1fr;grid-auto-rows:minmax(0,1fr)}}@media(max-width:720px){.scene-panel.scene-tools{width:calc(100% - 32px);left:16px!important;right:auto}}.panel-resize-handle{position:absolute;top:0;right:0;width:10px;height:100%;cursor:ew-resize}.panel-resize-handle:after{content:"";position:absolute;top:30%;right:3px;width:2px;height:40%;border-radius:2px;background:#ffffff1f}.debug-workbench{position:absolute;width:350px;height:600px;min-width:250px;min-height:200px;background:#12161ef5;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);pointer-events:auto;display:flex;flex-direction:column;overflow:hidden;z-index:1000}.workbench-header{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;background-color:#181c26f2;border-bottom:1px solid rgba(255,255,255,.05);cursor:move;flex-shrink:0}.workbench-tabs{display:flex;background:#0c1018e6;padding:4px;gap:4px;border-bottom:1px solid var(--ui-border);flex-shrink:0;overflow-x:auto}.workbench-tab{flex:1;padding:6px 10px;font-size:11px;font-weight:600;color:var(--ui-muted);background:transparent;border:1px solid transparent;border-radius:6px;cursor:pointer;white-space:nowrap;transition:all .2s ease;text-align:center}.workbench-tab:hover{background:#ffffff0d;color:var(--ui-text)}.workbench-tab.active{background:#3dd6c61f;color:var(--ui-accent);border-color:#3dd6c64d}.workbench-content{flex:1;overflow-y:auto;padding:0}.workbench-tab-panel{display:none}.workbench-tab-panel.active{display:block}.workbench-resize-handle{position:absolute;bottom:0;right:0;width:16px;height:16px;cursor:nwse-resize;background:linear-gradient(135deg,transparent 50%,var(--ui-border) 50%,var(--ui-border) 75%,transparent 75%,transparent 85%,var(--ui-border) 85%);z-index:10}.workbench-content .scene-panel{position:static;width:100%!important;max-height:none!important;border:none;background:transparent;box-shadow:none;border-radius:0}.workbench-content .scene-panel-header{display:none}.workbench-content .scene-panel-body{max-height:none;padding:12px}.library-panel{border-color:#3dd6c659}.library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:8px;margin-top:12px}.library-item{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px;border:2px solid transparent;border-radius:8px;cursor:pointer;transition:all .2s ease;background:#191e28cc}.library-item:hover{border-color:#3dd6c680;background:#3dd6c61a}.library-item.selected{border-color:#3dd6c6cc;background:#3dd6c626;box-shadow:0 0 0 1px #3dd6c666}.library-thumbnail{width:60px;height:40px;object-fit:cover;border-radius:4px;border:1px solid rgba(255,255,255,.1)}.library-label{font-size:11px;color:var(--ui-muted);text-align:center;word-break:break-all}.library-selected{font-size:12px;color:var(--ui-text);margin:12px 0;padding:8px;background:#191e28cc;border-radius:6px;border:1px solid rgba(255,255,255,.08)}.library-empty{font-size:11px;color:var(--ui-muted);padding:20px;text-align:center;grid-column:1 / -1}.library-category-tabs{display:flex;background:#0c1018e6;padding:4px;gap:2px;border-bottom:1px solid var(--ui-border);margin-bottom:12px}.library-category-tab{flex:1;padding:6px 8px;font-size:11px;font-weight:600;color:var(--ui-muted);background:transparent;border:1px solid transparent;border-radius:6px;cursor:pointer;white-space:nowrap;text-align:center;transition:all .2s ease}.library-category-tab:hover{background:#ffffff0d;color:var(--ui-text)}.library-category-tab.active{background:#3dd6c61f;color:var(--ui-accent);border-color:#3dd6c64d}
|
package/dist/pixi/index.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import * as PixiJS from 'pixi.js';
|
|
1
2
|
import { Application, Container, Texture, Sprite, Text, Graphics, Point } from 'pixi.js';
|
|
3
|
+
import { O as ObjectCentricConfig$1 } from '../loader-object-centric-C1QteFfG.mjs';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Handler SDK - PixiJS Base Context
|
|
@@ -136,6 +138,14 @@ declare class GameObject {
|
|
|
136
138
|
* Update config and sync (for hot-reload)
|
|
137
139
|
*/
|
|
138
140
|
updateConfig(newConfig: any): void;
|
|
141
|
+
/**
|
|
142
|
+
* Apply anchor from render/transform config (sprites only)
|
|
143
|
+
*/
|
|
144
|
+
private applyAnchor;
|
|
145
|
+
/**
|
|
146
|
+
* Apply optional non-uniform scale from effects (if provided)
|
|
147
|
+
*/
|
|
148
|
+
private applyEffectsScale;
|
|
139
149
|
/**
|
|
140
150
|
* Get component value
|
|
141
151
|
*/
|
|
@@ -247,100 +257,12 @@ declare function registerFont(fontId: string, definition: FontDefinition): void;
|
|
|
247
257
|
declare function getRegisteredFontIds(): string[];
|
|
248
258
|
|
|
249
259
|
/**
|
|
250
|
-
*
|
|
260
|
+
* Object-centric configuration
|
|
251
261
|
*
|
|
252
|
-
*
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Object configuration from JSON files
|
|
256
|
-
*/
|
|
257
|
-
interface ObjectConfig {
|
|
258
|
-
object_config?: string;
|
|
259
|
-
transform?: {
|
|
260
|
-
position?: {
|
|
261
|
-
x: number;
|
|
262
|
-
y: number;
|
|
263
|
-
};
|
|
264
|
-
scale?: number;
|
|
265
|
-
rotation?: number;
|
|
266
|
-
offset?: {
|
|
267
|
-
x?: number;
|
|
268
|
-
y?: number;
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
|
-
render?: {
|
|
272
|
-
z_index?: number;
|
|
273
|
-
alpha?: number;
|
|
274
|
-
visible?: boolean;
|
|
275
|
-
tint?: number | string | null;
|
|
276
|
-
background_color?: string;
|
|
277
|
-
background_alpha?: number;
|
|
278
|
-
border_color?: string;
|
|
279
|
-
};
|
|
280
|
-
gameplay?: {
|
|
281
|
-
rules?: Record<string, unknown>;
|
|
282
|
-
tuning?: Record<string, unknown>;
|
|
283
|
-
};
|
|
284
|
-
ui?: {
|
|
285
|
-
text?: string;
|
|
286
|
-
font?: string;
|
|
287
|
-
fontSize?: number;
|
|
288
|
-
letterSpacing?: number;
|
|
289
|
-
align?: string;
|
|
290
|
-
};
|
|
291
|
-
effects?: Record<string, unknown>;
|
|
292
|
-
audio?: Record<string, unknown>;
|
|
293
|
-
physics?: Record<string, unknown>;
|
|
294
|
-
interaction?: Record<string, unknown>;
|
|
295
|
-
identity?: Record<string, unknown>;
|
|
296
|
-
visibility?: Record<string, unknown>;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Engine configuration
|
|
262
|
+
* Single source of truth is the config loader type.
|
|
263
|
+
* Pixi systems/engine should never diverge from that shape.
|
|
300
264
|
*/
|
|
301
|
-
|
|
302
|
-
assets?: Record<string, string>;
|
|
303
|
-
runtime?: {
|
|
304
|
-
ui?: Record<string, unknown>;
|
|
305
|
-
theme?: Record<string, unknown>;
|
|
306
|
-
ui_styles?: Record<string, unknown>;
|
|
307
|
-
timeline?: Record<string, number>;
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Theme configuration
|
|
312
|
-
*/
|
|
313
|
-
interface ThemeConfig {
|
|
314
|
-
background_color?: string;
|
|
315
|
-
text_color?: string;
|
|
316
|
-
square_color?: string;
|
|
317
|
-
cta_background?: string;
|
|
318
|
-
cta_text?: string;
|
|
319
|
-
melt_color?: string;
|
|
320
|
-
danger_color?: string;
|
|
321
|
-
brush_color?: string;
|
|
322
|
-
success_color?: string;
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Gameplay configuration
|
|
326
|
-
*/
|
|
327
|
-
interface GameplayConfig {
|
|
328
|
-
[key: string]: unknown;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Object-centric configuration
|
|
332
|
-
* This is the main config type that students work with
|
|
333
|
-
*/
|
|
334
|
-
interface ObjectCentricConfig {
|
|
335
|
-
/** Map of object instance IDs to their configurations */
|
|
336
|
-
objects: Map<string, ObjectConfig>;
|
|
337
|
-
/** Engine configuration (assets, runtime settings) */
|
|
338
|
-
engine: EngineConfig;
|
|
339
|
-
/** Theme configuration */
|
|
340
|
-
theme: ThemeConfig;
|
|
341
|
-
/** Gameplay configuration */
|
|
342
|
-
gameplay: GameplayConfig;
|
|
343
|
-
}
|
|
265
|
+
type ObjectCentricConfig = ObjectCentricConfig$1;
|
|
344
266
|
|
|
345
267
|
/**
|
|
346
268
|
* Handler SDK - EndGame UI Panel
|
|
@@ -375,6 +297,69 @@ declare function animatePanelEntrance(elements: EndGamePanelElements, config: Ob
|
|
|
375
297
|
*/
|
|
376
298
|
declare function animateHandClick(hand: Sprite, ctaButton: Graphics, config: ObjectCentricConfig, onClick: () => void): void;
|
|
377
299
|
|
|
300
|
+
interface SplashScreenConfig {
|
|
301
|
+
enabled: boolean;
|
|
302
|
+
show_on_start: boolean;
|
|
303
|
+
background_color: string;
|
|
304
|
+
background_alpha: number;
|
|
305
|
+
title: string;
|
|
306
|
+
subtitle: string;
|
|
307
|
+
button_label: string;
|
|
308
|
+
title_color: string;
|
|
309
|
+
subtitle_color: string;
|
|
310
|
+
button_bg: string;
|
|
311
|
+
button_text: string;
|
|
312
|
+
button_width: number;
|
|
313
|
+
button_height: number;
|
|
314
|
+
button_radius: number;
|
|
315
|
+
loading_blur: boolean;
|
|
316
|
+
loading_blur_strength: number;
|
|
317
|
+
loading_overlay_alpha: number;
|
|
318
|
+
font_family: string;
|
|
319
|
+
title_size: number;
|
|
320
|
+
subtitle_size: number;
|
|
321
|
+
loading_text: string;
|
|
322
|
+
loading_text_scale: number;
|
|
323
|
+
}
|
|
324
|
+
declare class SplashScreen {
|
|
325
|
+
private app;
|
|
326
|
+
private stage;
|
|
327
|
+
private activeConfig;
|
|
328
|
+
private splashConfig;
|
|
329
|
+
private splashEnabled;
|
|
330
|
+
private loadingBlurEnabled;
|
|
331
|
+
private loadingBlurStrength;
|
|
332
|
+
private loadingOverlayAlpha;
|
|
333
|
+
private splashLayer;
|
|
334
|
+
private splashBg;
|
|
335
|
+
private splashTitle;
|
|
336
|
+
private splashSubtitle;
|
|
337
|
+
private splashButton;
|
|
338
|
+
private splashButtonText;
|
|
339
|
+
private loadingLayer;
|
|
340
|
+
private loadingBg;
|
|
341
|
+
private loadingText;
|
|
342
|
+
private loadingTime;
|
|
343
|
+
private tickLoadingHandler;
|
|
344
|
+
constructor(app: Application, stage: Container, activeConfig: ObjectCentricConfig);
|
|
345
|
+
private resolveLoadingTextStyle;
|
|
346
|
+
syncConfig(next?: any): void;
|
|
347
|
+
updateLayout(width: number, height: number): void;
|
|
348
|
+
private updateSplashLayout;
|
|
349
|
+
private updateLoadingLayout;
|
|
350
|
+
show(): void;
|
|
351
|
+
hide(): void;
|
|
352
|
+
startLoadingAnimation(): void;
|
|
353
|
+
stopLoadingAnimation(): void;
|
|
354
|
+
destroyLoadingLayer(): void;
|
|
355
|
+
applyLoadingBlur(background: Sprite | Graphics): any[] | null;
|
|
356
|
+
removeLoadingBlur(background: Sprite | Graphics, prevFilters: any[] | null): void;
|
|
357
|
+
setupWindowGlobals(): void;
|
|
358
|
+
getSplashButton(): Graphics;
|
|
359
|
+
shouldShowOnStart(): boolean;
|
|
360
|
+
destroy(): void;
|
|
361
|
+
}
|
|
362
|
+
|
|
378
363
|
/**
|
|
379
364
|
* Handler SDK - Tutorial UI Components
|
|
380
365
|
*
|
|
@@ -460,6 +445,17 @@ declare function playLottieOverlay(objectId: string, root: HTMLElement, config:
|
|
|
460
445
|
*
|
|
461
446
|
* DO NOT EDIT - Handler SDK Core
|
|
462
447
|
*/
|
|
448
|
+
type BuildMode = 'dev' | 'brand' | 'publish';
|
|
449
|
+
type BuildSettings = {
|
|
450
|
+
buildMode?: BuildMode;
|
|
451
|
+
assetsInlined?: boolean;
|
|
452
|
+
};
|
|
453
|
+
declare global {
|
|
454
|
+
interface Window {
|
|
455
|
+
INLINE_ASSETS?: Record<string, string>;
|
|
456
|
+
__BUILD_SETTINGS__?: BuildSettings;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
463
459
|
type AssetDefinition = {
|
|
464
460
|
type: string;
|
|
465
461
|
path: string;
|
|
@@ -539,4 +535,322 @@ declare class ObjectFactory {
|
|
|
539
535
|
private static applyTransform;
|
|
540
536
|
}
|
|
541
537
|
|
|
542
|
-
|
|
538
|
+
/**
|
|
539
|
+
* Base context provided to all systems
|
|
540
|
+
*/
|
|
541
|
+
interface SystemContext {
|
|
542
|
+
app: Application;
|
|
543
|
+
stage: Container;
|
|
544
|
+
config: ObjectCentricConfig$1;
|
|
545
|
+
gameObjectManager: GameObjectManager;
|
|
546
|
+
destinationUrl: string;
|
|
547
|
+
root: HTMLElement;
|
|
548
|
+
engine: GameEngine;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Base class for all game systems
|
|
552
|
+
*/
|
|
553
|
+
declare abstract class BaseSystem {
|
|
554
|
+
protected context: SystemContext;
|
|
555
|
+
/**
|
|
556
|
+
* Internal initialization by GameEngine
|
|
557
|
+
*/
|
|
558
|
+
setContext(context: SystemContext): void;
|
|
559
|
+
/**
|
|
560
|
+
* Called once during engine initialization
|
|
561
|
+
*/
|
|
562
|
+
init?(): void | Promise<void>;
|
|
563
|
+
/**
|
|
564
|
+
* Called after all systems are initialized
|
|
565
|
+
*/
|
|
566
|
+
onStart?(): void | Promise<void>;
|
|
567
|
+
/**
|
|
568
|
+
* Called every frame
|
|
569
|
+
* @param deltaTime normalized time since last frame
|
|
570
|
+
* @param totalTime total time elapsed since start
|
|
571
|
+
*/
|
|
572
|
+
update?(deltaTime: number, totalTime: number): void;
|
|
573
|
+
/**
|
|
574
|
+
* Called when the screen is resized
|
|
575
|
+
*/
|
|
576
|
+
onResize?(width: number, height: number): void;
|
|
577
|
+
/**
|
|
578
|
+
* Called when config changes (hot-reload)
|
|
579
|
+
*/
|
|
580
|
+
onConfigUpdate?(newConfig: ObjectCentricConfig$1): void;
|
|
581
|
+
/**
|
|
582
|
+
* Cleanup system
|
|
583
|
+
*/
|
|
584
|
+
onDestroy?(): void;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
declare class GameEngine {
|
|
588
|
+
private app;
|
|
589
|
+
private stage;
|
|
590
|
+
private gameObjectManager;
|
|
591
|
+
private systems;
|
|
592
|
+
private totalTime;
|
|
593
|
+
private config;
|
|
594
|
+
private destinationUrl;
|
|
595
|
+
private root;
|
|
596
|
+
constructor(root: HTMLElement, config: ObjectCentricConfig$1, destinationUrl: string);
|
|
597
|
+
/**
|
|
598
|
+
* Initialize PIXI and systems
|
|
599
|
+
*/
|
|
600
|
+
init(theme: any): Promise<{
|
|
601
|
+
app: Application;
|
|
602
|
+
gameObjectManager: GameObjectManager;
|
|
603
|
+
}>;
|
|
604
|
+
/**
|
|
605
|
+
* Register systems before starting
|
|
606
|
+
*/
|
|
607
|
+
registerSystems(systems: BaseSystem[]): void;
|
|
608
|
+
/**
|
|
609
|
+
* Start the game loop
|
|
610
|
+
*/
|
|
611
|
+
start(): Promise<void>;
|
|
612
|
+
/**
|
|
613
|
+
* Central update loop
|
|
614
|
+
*/
|
|
615
|
+
private update;
|
|
616
|
+
/**
|
|
617
|
+
* Propagate resize
|
|
618
|
+
*/
|
|
619
|
+
resize(width: number, height: number): void;
|
|
620
|
+
/**
|
|
621
|
+
* Handle hot-reload
|
|
622
|
+
*/
|
|
623
|
+
updateConfig(newConfig: ObjectCentricConfig$1): void;
|
|
624
|
+
/**
|
|
625
|
+
* Destroy engine and systems
|
|
626
|
+
*/
|
|
627
|
+
destroy(): void;
|
|
628
|
+
getApp(): Application;
|
|
629
|
+
getGameObjectManager(): GameObjectManager;
|
|
630
|
+
getTotalTime(): number;
|
|
631
|
+
/**
|
|
632
|
+
* Find a registered system by its class
|
|
633
|
+
*/
|
|
634
|
+
getSystem<T extends BaseSystem>(type: new (...args: any[]) => T): T;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Runtime Object Registry
|
|
639
|
+
*
|
|
640
|
+
* Passive config registry that reads object configs from loaded ObjectCentricConfig.
|
|
641
|
+
* Hot-reload friendly - config passed at runtime.
|
|
642
|
+
*
|
|
643
|
+
* DO NOT EDIT - Base Layer
|
|
644
|
+
*/
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Runtime object registry - provides access to object configs
|
|
648
|
+
*/
|
|
649
|
+
declare class RuntimeObjectRegistry {
|
|
650
|
+
private config;
|
|
651
|
+
/**
|
|
652
|
+
* Initialize registry with config
|
|
653
|
+
*/
|
|
654
|
+
init(config: ObjectCentricConfig$1): void;
|
|
655
|
+
/**
|
|
656
|
+
* Get object config by instance ID
|
|
657
|
+
*/
|
|
658
|
+
get(instanceId: string): any;
|
|
659
|
+
/**
|
|
660
|
+
* Get all object instance IDs
|
|
661
|
+
*/
|
|
662
|
+
getAllIds(): string[];
|
|
663
|
+
/**
|
|
664
|
+
* Check if object exists
|
|
665
|
+
*/
|
|
666
|
+
has(instanceId: string): boolean;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Base Layer - PixiJS Instance
|
|
671
|
+
*
|
|
672
|
+
* Provides isolated pixi.js instance for base layer.
|
|
673
|
+
* Prevents conflicts with student layer's pixi instance.
|
|
674
|
+
*
|
|
675
|
+
* DO NOT EDIT - Base Layer
|
|
676
|
+
*/
|
|
677
|
+
|
|
678
|
+
declare const basePixi: typeof PixiJS;
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* Assets Proxy - Student-Facing API
|
|
682
|
+
*
|
|
683
|
+
* Provides simple API: Assets.ready() then Assets.xxx
|
|
684
|
+
*
|
|
685
|
+
* RULES:
|
|
686
|
+
* - Singleton instances by default
|
|
687
|
+
* - Assets.ready() resolves when all objects preloaded and Assets.xxx accesses are sync/safe
|
|
688
|
+
* - resetScene() clears instance cache only (NOT asset cache)
|
|
689
|
+
* - reloadObject(id) explicitly recreates single object
|
|
690
|
+
* - Separate asset cache (global) and instance cache (scene-scoped, strong references)
|
|
691
|
+
*
|
|
692
|
+
* DO NOT EDIT - Base Layer
|
|
693
|
+
*/
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Assets core implementation
|
|
697
|
+
*/
|
|
698
|
+
declare class AssetsCore {
|
|
699
|
+
private registry;
|
|
700
|
+
private instanceCache;
|
|
701
|
+
private readyPromise;
|
|
702
|
+
private app;
|
|
703
|
+
constructor();
|
|
704
|
+
/**
|
|
705
|
+
* Initialize with config and app
|
|
706
|
+
*/
|
|
707
|
+
init(config: ObjectCentricConfig$1, app: any): void;
|
|
708
|
+
/**
|
|
709
|
+
* Update config (for hot-reload)
|
|
710
|
+
* Re-initializes registry and clears instance cache
|
|
711
|
+
*/
|
|
712
|
+
updateConfig(config: ObjectCentricConfig$1): void;
|
|
713
|
+
/**
|
|
714
|
+
* Preload all objects
|
|
715
|
+
* RULE: Resolves when all objects are preloaded and Assets.xxx accesses are sync/safe
|
|
716
|
+
* RULE: Idempotent - subsequent calls only reload changed objects
|
|
717
|
+
*/
|
|
718
|
+
ready(): Promise<void>;
|
|
719
|
+
/**
|
|
720
|
+
* Reset scene - clears instance cache but NOT asset cache
|
|
721
|
+
* RULE: Strong references, cleared ONLY by resetScene()
|
|
722
|
+
*/
|
|
723
|
+
resetScene(): void;
|
|
724
|
+
/**
|
|
725
|
+
* Reload a single object explicitly
|
|
726
|
+
*/
|
|
727
|
+
reloadObject(id: string): Promise<void>;
|
|
728
|
+
/**
|
|
729
|
+
* Get object instance by ID
|
|
730
|
+
*/
|
|
731
|
+
get(id: string): any;
|
|
732
|
+
}
|
|
733
|
+
declare const Assets: AssetsCore & {
|
|
734
|
+
[key: string]: any;
|
|
735
|
+
};
|
|
736
|
+
/**
|
|
737
|
+
* Initialize Assets with config and app
|
|
738
|
+
* Must be called before Assets.ready()
|
|
739
|
+
*/
|
|
740
|
+
declare function initAssets(config: ObjectCentricConfig$1, app: any): void;
|
|
741
|
+
|
|
742
|
+
declare class AssetSystem extends BaseSystem {
|
|
743
|
+
private splashScreen;
|
|
744
|
+
init(): Promise<void>;
|
|
745
|
+
onStart(): Promise<void>;
|
|
746
|
+
onConfigUpdate(): void;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
declare let globalResponsiveMultipliers: {
|
|
750
|
+
scale: number;
|
|
751
|
+
position: number;
|
|
752
|
+
};
|
|
753
|
+
declare function clearResponsiveElements(): void;
|
|
754
|
+
declare function updateScreenState(width: number, height: number): void;
|
|
755
|
+
type AnchorSpec = string | {
|
|
756
|
+
x: number;
|
|
757
|
+
y: number;
|
|
758
|
+
} | [number, number] | null | undefined;
|
|
759
|
+
type RatioSpec = {
|
|
760
|
+
x: number;
|
|
761
|
+
y: number;
|
|
762
|
+
} | [number, number] | null | undefined;
|
|
763
|
+
type ScreenInset = {
|
|
764
|
+
top?: number;
|
|
765
|
+
right?: number;
|
|
766
|
+
bottom?: number;
|
|
767
|
+
left?: number;
|
|
768
|
+
};
|
|
769
|
+
declare function resolveAnchorVec2(anchor: AnchorSpec, fallback?: {
|
|
770
|
+
x: number;
|
|
771
|
+
y: number;
|
|
772
|
+
}): {
|
|
773
|
+
x: number;
|
|
774
|
+
y: number;
|
|
775
|
+
};
|
|
776
|
+
declare function resolveScreenAnchorPoint(screenWidth: number, screenHeight: number, anchor: AnchorSpec, opts?: {
|
|
777
|
+
inset?: ScreenInset;
|
|
778
|
+
padding?: {
|
|
779
|
+
x: number;
|
|
780
|
+
y: number;
|
|
781
|
+
};
|
|
782
|
+
}): {
|
|
783
|
+
x: number;
|
|
784
|
+
y: number;
|
|
785
|
+
};
|
|
786
|
+
declare function resolveScreenRatioPoint(screenWidth: number, screenHeight: number, ratio: RatioSpec, opts?: {
|
|
787
|
+
inset?: ScreenInset;
|
|
788
|
+
padding?: {
|
|
789
|
+
x: number;
|
|
790
|
+
y: number;
|
|
791
|
+
};
|
|
792
|
+
}): {
|
|
793
|
+
x: number;
|
|
794
|
+
y: number;
|
|
795
|
+
};
|
|
796
|
+
declare function applyScreenAnchor(element: any, screenWidth: number, screenHeight: number, options?: {
|
|
797
|
+
anchor?: AnchorSpec;
|
|
798
|
+
positionRatio?: RatioSpec;
|
|
799
|
+
offset?: {
|
|
800
|
+
x: number;
|
|
801
|
+
y: number;
|
|
802
|
+
};
|
|
803
|
+
inset?: ScreenInset;
|
|
804
|
+
screenPadding?: {
|
|
805
|
+
x: number;
|
|
806
|
+
y: number;
|
|
807
|
+
};
|
|
808
|
+
renderAnchor?: {
|
|
809
|
+
x: number;
|
|
810
|
+
y: number;
|
|
811
|
+
};
|
|
812
|
+
scale?: number;
|
|
813
|
+
scaleMultiplier?: number;
|
|
814
|
+
}): void;
|
|
815
|
+
/**
|
|
816
|
+
* Layout Manager
|
|
817
|
+
* Strategy: ADAPTIVE ANCHOR
|
|
818
|
+
* - Tall Screens: Show full rope (Anchor Top).
|
|
819
|
+
* - Short Screens: Prioritize Character (Anchor Character Position).
|
|
820
|
+
*/
|
|
821
|
+
interface LayoutScreen {
|
|
822
|
+
width: number;
|
|
823
|
+
height: number;
|
|
824
|
+
}
|
|
825
|
+
interface LayoutElements {
|
|
826
|
+
mainContainer: any;
|
|
827
|
+
label: any;
|
|
828
|
+
background: any;
|
|
829
|
+
backgroundTexture: any;
|
|
830
|
+
app: any;
|
|
831
|
+
}
|
|
832
|
+
declare function layout(elements: LayoutElements, config: ObjectCentricConfig, time: number, screen: LayoutScreen, gameObjectManager?: any, options?: {
|
|
833
|
+
skipInstanceIds?: string[];
|
|
834
|
+
enableDebugLogs?: boolean;
|
|
835
|
+
skipMainContainerTransform?: boolean;
|
|
836
|
+
}): void;
|
|
837
|
+
|
|
838
|
+
interface InitSequenceStates<State = unknown> {
|
|
839
|
+
showHook: State;
|
|
840
|
+
waitInput: State;
|
|
841
|
+
}
|
|
842
|
+
interface InitSequenceOptions<State = unknown> {
|
|
843
|
+
setState: (state: State) => void;
|
|
844
|
+
updateLabelAlpha: (alpha: number) => void;
|
|
845
|
+
updateHandAlpha: (alpha: number) => void;
|
|
846
|
+
config: ObjectCentricConfig;
|
|
847
|
+
states: InitSequenceStates<State>;
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Shared, config-driven init sequence.
|
|
851
|
+
*
|
|
852
|
+
* Keeps the SDK generic by letting the caller pass game-specific state values.
|
|
853
|
+
*/
|
|
854
|
+
declare function runInitSequence<State = unknown>(options: InitSequenceOptions<State>): void;
|
|
855
|
+
|
|
856
|
+
export { AssetCache, type AssetDefinition, AssetLoader, AssetSystem, Assets, BaseSystem, type EndGamePanelElements, GameEngine, GameObject, GameObjectManager, type ObjectCentricConfig, ObjectFactory, type PixiBaseContext, type PixiTheme, Renderer, RuntimeObjectRegistry, SplashScreen, type SplashScreenConfig, type SystemContext, Transform, animateHandClick, animatePanelEntrance, applyScreenAnchor, basePixi, clearResponsiveElements, createEndGamePanel, createHandTutorial, createPixiBase, createTutorialLabel, getRegisteredFontIds, globalResponsiveMultipliers, initAssets, layout, playLottieOverlay, registerFont, registerType, resolveAnchorVec2, resolveFont, resolveFontWeight, resolveScreenAnchorPoint, resolveScreenRatioPoint, runInitSequence, setLottieInstance, updateHandAnimation, updateScreenState };
|