@puzzmo/sdk 0.0.6 → 1.0.0
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/README.md +80 -260
- package/dist/createSimulator-9IxV0l3_.js +2749 -0
- package/dist/createSimulator-9IxV0l3_.js.map +1 -0
- package/dist/createSimulator-DxhvbnJB.cjs +1428 -0
- package/dist/createSimulator-DxhvbnJB.cjs.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +267 -14
- package/dist/index.js.map +1 -1
- package/dist/objectSpread2-C4RR_HMd.cjs +1 -0
- package/dist/objectSpread2-CJo2CZQ6.js +76 -0
- package/dist/sdk.d.ts +61 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/simulator/createSimulator.d.ts +41 -0
- package/dist/simulator/createSimulator.d.ts.map +1 -0
- package/dist/simulator/fixtures.d.ts +18 -0
- package/dist/simulator/fixtures.d.ts.map +1 -0
- package/dist/simulator/index.cjs +1 -0
- package/dist/simulator/index.d.ts +3 -0
- package/dist/simulator/index.d.ts.map +1 -0
- package/dist/simulator/index.js +2 -0
- package/dist/simulator/messaging.d.ts +12 -0
- package/dist/simulator/messaging.d.ts.map +1 -0
- package/dist/simulator/standalone.cjs +2 -0
- package/dist/simulator/standalone.cjs.map +1 -0
- package/dist/simulator/standalone.d.ts +7 -0
- package/dist/simulator/standalone.d.ts.map +1 -0
- package/dist/simulator/standalone.js +19 -0
- package/dist/simulator/standalone.js.map +1 -0
- package/dist/simulator/state.d.ts +12 -0
- package/dist/simulator/state.d.ts.map +1 -0
- package/dist/simulator/styles.d.ts +2 -0
- package/dist/simulator/styles.d.ts.map +1 -0
- package/dist/simulator/types.d.ts +72 -0
- package/dist/simulator/types.d.ts.map +1 -0
- package/dist/simulator/views/AuthView.d.ts +3 -0
- package/dist/simulator/views/AuthView.d.ts.map +1 -0
- package/dist/simulator/views/CheckpointsView.d.ts +3 -0
- package/dist/simulator/views/CheckpointsView.d.ts.map +1 -0
- package/dist/simulator/views/CtrlView.d.ts +3 -0
- package/dist/simulator/views/CtrlView.d.ts.map +1 -0
- package/dist/simulator/views/DataView.d.ts +3 -0
- package/dist/simulator/views/DataView.d.ts.map +1 -0
- package/dist/simulator/views/DoneView.d.ts +3 -0
- package/dist/simulator/views/DoneView.d.ts.map +1 -0
- package/dist/simulator/views/FeaturesView.d.ts +4 -0
- package/dist/simulator/views/FeaturesView.d.ts.map +1 -0
- package/dist/simulator/views/MsgsView.d.ts +6 -0
- package/dist/simulator/views/MsgsView.d.ts.map +1 -0
- package/dist/simulator/views/ThemeView.d.ts +3 -0
- package/dist/simulator/views/ThemeView.d.ts.map +1 -0
- package/dist/simulator/views/ThumbView.d.ts +6 -0
- package/dist/simulator/views/ThumbView.d.ts.map +1 -0
- package/dist/simulator/views/index.d.ts +10 -0
- package/dist/simulator/views/index.d.ts.map +1 -0
- package/dist/themes.d.ts +46 -0
- package/dist/themes.d.ts.map +1 -0
- package/dist/types.d.ts +232 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/vite.cjs +11 -0
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.d.ts +16 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +45 -0
- package/dist/vite.js.map +1 -0
- package/dist/workshop.d.ts +7 -145
- package/dist/workshop.d.ts.map +1 -1
- package/package.json +22 -16
- package/dist/index.iife.js +0 -2
- package/dist/index.iife.js.map +0 -1
- package/dist/index.umd.js +0 -2
- package/dist/index.umd.js.map +0 -1
- package/dist/puzzmoSDK.d.ts +0 -237
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standalone.js","names":[],"sources":["../../src/simulator/standalone.ts"],"sourcesContent":["/**\n * Standalone entry point for the simulator.\n *\n * Use as an IIFE script tag for non-Vite setups:\n * ```html\n * <script>\n * window.SIMULATOR_CONFIG = { puzzlePath: \"./sample-puzzle.json\" }\n * </script>\n * <script src=\"path/to/simulator/standalone.iife.js\"></script>\n * ```\n */\nimport { createSimulator } from \"./createSimulator\"\nimport type { SimulatorConfig } from \"./types\"\n\ndeclare global {\n interface Window {\n SIMULATOR_CONFIG?: SimulatorConfig\n }\n}\n\nconst init = () => {\n const config = window.SIMULATOR_CONFIG ?? {}\n createSimulator(config)\n}\n\nif (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", init)\n} else {\n init()\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAM,UAAa;;AAEjB,IAAA,IADe,OAAO,qBAAA,OAAoB,EAAE,GAAtB,EACC;;AAGrB,SAAS,eAAe,YAC1B,SAAS,iBAAiB,oBAAoB,EAAK,GAEnD,GAAM"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ThumbnailConfig } from "../types";
|
|
2
|
+
import type { SimulatorConfig, SimulatorState, TabName } from "./types";
|
|
3
|
+
export declare function createInitialState(config: SimulatorConfig, fixtureCategories: string[], validTabIds: string[]): SimulatorState;
|
|
4
|
+
export declare function persistCollapsed(collapsed: boolean): void;
|
|
5
|
+
export declare function persistTab(tab: TabName): void;
|
|
6
|
+
export declare function persistTheme(themeName: string): void;
|
|
7
|
+
export declare function persistFixtureCategory(category: string): void;
|
|
8
|
+
export declare function persistFixturePuzzle(puzzle: string): void;
|
|
9
|
+
export declare function clearFixturePuzzle(): void;
|
|
10
|
+
export declare function persistRenderHost(host: ThumbnailConfig["renderHost"]): void;
|
|
11
|
+
export declare function persistRenderContext(context: ThumbnailConfig["renderContext"]): void;
|
|
12
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/simulator/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,eAAe,EAAE,MAAM,UAAU,CAAA;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAqDvE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,cAAc,CAoB9H;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAEzD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAE7C;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAE7D;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,YAAY,CAAC,GAAG,IAAI,CAM3E;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,GAAG,IAAI,CAMpF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const simulatorStyles = "\n :root {\n --sim-bg: #1a1a2e;\n --sim-bg-alt: #16213e;\n --sim-panel: #0f0f1a;\n --sim-border: #3a3a5c;\n --sim-border-light: #5a5a8c;\n --sim-accent: #ffd700;\n --sim-accent-hover: #ffed4a;\n --sim-text: #e8e8e8;\n --sim-text-dim: #888899;\n --sim-success: #4ade80;\n --sim-error: #f87171;\n --sim-warning: #fbbf24;\n --sim-blue: #60a5fa;\n }\n #simulator {\n position: fixed;\n bottom: 4px;\n left: 4px;\n z-index: 999999;\n font: 11px/1.4 \"Menlo\", \"Monaco\", \"Consolas\", monospace;\n user-select: none;\n }\n #simulator-panel {\n background: var(--sim-panel);\n border: 2px solid var(--sim-border);\n border-radius: 4px;\n color: var(--sim-text);\n width: 420px;\n box-shadow: 4px 4px 0 rgba(0,0,0,0.5);\n }\n #simulator-panel.collapsed {\n width: auto;\n }\n #simulator-header {\n display: flex;\n align-items: center;\n padding: 4px 8px;\n background: var(--sim-bg);\n border-bottom: 2px solid var(--sim-border);\n gap: 0;\n }\n #simulator-panel.collapsed #simulator-header {\n border-bottom: none;\n cursor: pointer;\n }\n #simulator-panel.collapsed #simulator-header:hover {\n background: var(--sim-bg-alt);\n }\n .header-sep {\n color: var(--sim-border-light);\n margin: 0 8px;\n opacity: 0.6;\n }\n .header-spacer {\n flex: 1;\n }\n #simulator-title {\n color: var(--sim-accent);\n text-transform: uppercase;\n letter-spacing: 1px;\n font-size: 10px;\n font-weight: bold;\n }\n #simulator-header-controls {\n display: flex;\n gap: 2px;\n }\n .header-icon-btn {\n width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n border-radius: 2px;\n color: var(--sim-text);\n cursor: pointer;\n padding: 0;\n }\n .header-icon-btn:hover:not(:disabled) {\n background: var(--sim-border);\n color: var(--sim-accent);\n }\n .header-icon-btn:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n }\n .header-icon-btn.active {\n background: var(--sim-accent);\n color: var(--sim-panel);\n }\n #simulator-header-status {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 9px;\n color: var(--sim-text-dim);\n }\n #simulator-header-indicator {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--sim-text-dim);\n flex-shrink: 0;\n }\n #simulator-header-indicator.ready {\n background: var(--sim-success);\n box-shadow: 0 0 4px var(--sim-success);\n }\n #simulator-header-indicator.waiting {\n background: var(--sim-warning);\n box-shadow: 0 0 4px var(--sim-warning);\n }\n #simulator-header-indicator.paused {\n background: var(--sim-error);\n box-shadow: 0 0 4px var(--sim-error);\n }\n #simulator-timer {\n font-size: 11px;\n color: var(--sim-text);\n font-family: \"Menlo\", monospace;\n font-weight: bold;\n font-variant-numeric: tabular-nums;\n min-width: 38px;\n }\n #simulator-timer .penalty {\n color: var(--sim-error);\n margin-left: 2px;\n }\n /* Collapsed state - show minimal bar */\n #simulator-panel.collapsed .header-sep,\n #simulator-panel.collapsed #simulator-header-controls,\n #simulator-panel.collapsed #simulator-header-status,\n #simulator-panel.collapsed #simulator-header-settings,\n #simulator-panel.collapsed #simulator-toggle {\n display: none;\n }\n #simulator-panel.collapsed #simulator-title {\n cursor: pointer;\n }\n #simulator-panel.collapsed #simulator-timer {\n margin-left: 8px;\n }\n #simulator-body {\n display: flex;\n flex-direction: row;\n }\n #simulator-panel.collapsed #simulator-body {\n display: none;\n }\n #simulator-tabs {\n display: flex;\n flex-direction: column;\n background: var(--sim-bg);\n padding: 4px;\n gap: 2px;\n border-right: 2px solid var(--sim-border);\n }\n .simulator-tab {\n padding: 2px 3px;\n background: var(--sim-bg-alt);\n border: 2px solid var(--sim-border);\n border-radius: 2px;\n color: var(--sim-text-dim);\n cursor: pointer;\n font: inherit;\n text-transform: uppercase;\n font-size: 9px;\n font-weight: bold;\n letter-spacing: 0.5px;\n min-height: 0;\n }\n .simulator-tab:hover {\n color: var(--sim-text);\n background: var(--sim-border);\n }\n .simulator-tab.active {\n color: var(--sim-panel);\n background: var(--sim-accent);\n border-color: var(--sim-accent);\n }\n .simulator-tab {\n position: relative;\n }\n .simulator-tab-badge {\n position: absolute;\n top: -4px;\n right: -4px;\n min-width: 14px;\n height: 14px;\n padding: 0 3px;\n background: var(--sim-blue);\n color: #fff;\n font-size: 8px;\n font-weight: bold;\n border-radius: 7px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 1px 2px rgba(0,0,0,0.3);\n line-height: 1;\n text-align: center;\n box-sizing: border-box;\n }\n .simulator-tab-badge:empty {\n display: none;\n }\n #simulator-content {\n padding: 6px;\n background: var(--sim-panel);\n height: 500px;\n flex: 1;\n overflow-y: auto;\n }\n #simulator-content.hidden {\n display: none;\n }\n #simulator-content::-webkit-scrollbar {\n width: 8px;\n }\n #simulator-content::-webkit-scrollbar-track {\n background: var(--sim-bg);\n }\n #simulator-content::-webkit-scrollbar-thumb {\n background: var(--sim-border);\n border-radius: 2px;\n }\n .simulator-btn {\n padding: 4px 8px;\n background: var(--sim-bg-alt);\n border: 2px solid var(--sim-border);\n border-radius: 2px;\n color: var(--sim-text);\n font: inherit;\n font-size: 10px;\n font-weight: bold;\n text-transform: uppercase;\n letter-spacing: 1px;\n cursor: pointer;\n }\n .simulator-btn:hover {\n background: var(--sim-border);\n border-color: var(--sim-border-light);\n }\n .simulator-btn:active {\n transform: translate(1px, 1px);\n }\n .simulator-btn.primary {\n background: var(--sim-accent);\n border-color: var(--sim-accent);\n color: var(--sim-panel);\n }\n .simulator-btn.primary:hover {\n background: var(--sim-accent-hover);\n border-color: var(--sim-accent-hover);\n }\n .simulator-btn.danger {\n background: var(--sim-error);\n border-color: var(--sim-error);\n color: #fff;\n }\n .simulator-btn.danger:hover {\n background: #ef4444;\n border-color: #ef4444;\n }\n .simulator-btn:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n transform: none;\n }\n .simulator-btn.subtle {\n background: transparent;\n border-color: transparent;\n color: var(--sim-text-dim);\n }\n .simulator-btn.subtle:hover:not(:disabled) {\n background: var(--sim-bg-alt);\n border-color: var(--sim-border);\n color: var(--sim-text);\n }\n #simulator-status {\n font-size: 10px;\n color: var(--sim-text-dim);\n padding: 4px 0 6px;\n display: flex;\n align-items: center;\n gap: 6px;\n }\n #simulator-status .indicator {\n width: 8px;\n height: 8px;\n border-radius: 2px;\n background: var(--sim-text-dim);\n }\n #simulator-status .indicator.ready {\n background: var(--sim-success);\n box-shadow: 0 0 6px var(--sim-success);\n }\n #simulator-status .indicator.waiting {\n background: var(--sim-warning);\n box-shadow: 0 0 6px var(--sim-warning);\n }\n #simulator-status .indicator.paused {\n background: var(--sim-error);\n box-shadow: 0 0 6px var(--sim-error);\n }\n .simulator-row {\n display: flex;\n gap: 4px;\n margin-top: 4px;\n }\n .simulator-row .simulator-btn {\n flex: 1;\n }\n .simulator-divider {\n height: 2px;\n background: var(--sim-border);\n margin: 8px 0;\n }\n .simulator-field {\n margin-bottom: 6px;\n }\n .simulator-select {\n width: 100%;\n padding: 4px 6px;\n background: var(--sim-bg);\n border: 2px solid var(--sim-border);\n border-radius: 2px;\n color: var(--sim-text);\n font: inherit;\n font-size: 10px;\n cursor: pointer;\n }\n .simulator-select:focus {\n outline: none;\n border-color: var(--sim-accent);\n }\n .simulator-select option {\n background: var(--sim-bg);\n color: var(--sim-text);\n }\n .simulator-fixtures {\n margin-bottom: 8px;\n padding-bottom: 8px;\n border-bottom: 2px solid var(--sim-border);\n }\n .simulator-label {\n display: block;\n color: var(--sim-accent);\n text-transform: uppercase;\n font-size: 9px;\n font-weight: bold;\n letter-spacing: 1px;\n margin-bottom: 4px;\n }\n .simulator-textarea {\n width: 100%;\n min-height: 40px;\n background: var(--sim-bg);\n border: 2px solid var(--sim-border);\n border-radius: 2px;\n color: var(--sim-text);\n font: 10px/1.4 \"Menlo\", monospace;\n padding: 4px;\n resize: none;\n box-sizing: border-box;\n overflow-y: auto;\n }\n .simulator-textarea.auto-resize {\n resize: none;\n overflow-y: auto;\n }\n .simulator-textarea:focus {\n outline: none;\n border-color: var(--sim-accent);\n }\n .simulator-input {\n width: 100%;\n background: var(--sim-bg);\n border: 2px solid var(--sim-border);\n border-radius: 2px;\n color: var(--sim-text);\n font: 10px/1.4 \"Menlo\", monospace;\n padding: 4px 6px;\n box-sizing: border-box;\n }\n .simulator-input:focus {\n outline: none;\n border-color: var(--sim-accent);\n }\n .simulator-input::placeholder {\n color: var(--sim-text-dim);\n }\n .simulator-tab-content {\n display: none;\n }\n .simulator-tab-content.active {\n display: block;\n }\n .msgs-view-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n }\n .msgs-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 6px;\n flex-shrink: 0;\n }\n #simulator-msgs-log {\n display: flex;\n flex-direction: column;\n gap: 2px;\n flex: 1;\n overflow-y: auto;\n }\n .simulator-msg {\n padding: 3px 4px;\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n font-size: 10px;\n }\n .simulator-msg.out {\n border-left: 2px solid var(--sim-accent);\n }\n .simulator-msg.in {\n border-left: 2px solid var(--sim-blue);\n }\n .simulator-msg-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 2px;\n }\n .simulator-msg-type {\n font-weight: bold;\n color: var(--sim-text);\n }\n .simulator-msg.out .simulator-msg-type {\n color: var(--sim-accent);\n }\n .simulator-msg.in .simulator-msg-type {\n color: var(--sim-blue);\n }\n .simulator-msg-time {\n color: var(--sim-text-dim);\n font-size: 9px;\n }\n .simulator-msg-data {\n color: var(--sim-text-dim);\n font-size: 9px;\n white-space: pre-wrap;\n word-break: break-all;\n max-height: 60px;\n overflow: hidden;\n cursor: pointer;\n border-radius: 2px;\n padding: 2px 4px;\n background: var(--sim-bg-alt);\n }\n .simulator-msg-data:hover {\n background: var(--sim-border);\n }\n .simulator-msg.expanded {\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n .simulator-msg.expanded .simulator-msg-data {\n max-height: none;\n flex: 1;\n overflow-y: auto;\n }\n .simulator-empty {\n color: var(--sim-text-dim);\n font-size: 10px;\n text-align: center;\n padding: 20px;\n }\n .simulator-value {\n color: var(--sim-text);\n font-size: 10px;\n padding: 4px;\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n }\n .simulator-deeds {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n .simulator-deed {\n display: flex;\n justify-content: space-between;\n padding: 3px 4px;\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n font-size: 10px;\n }\n .simulator-deed-name {\n color: var(--sim-text);\n }\n .simulator-deed-value {\n color: var(--sim-accent);\n font-weight: bold;\n }\n .thumb-view-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n }\n .thumb-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 6px;\n flex-shrink: 0;\n }\n #simulator-thumb-preview {\n background: var(--sim-thumb-bg, transparent);\n border: 2px solid var(--sim-border);\n border-radius: 2px;\n padding: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n aspect-ratio: 1;\n width: 100%;\n box-sizing: border-box;\n }\n #simulator-thumb-preview svg {\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n }\n #simulator-thumb-fn {\n font-size: 10px;\n color: var(--sim-text-dim);\n margin-top: 4px;\n }\n .theme-view-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n }\n .theme-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 6px;\n flex-shrink: 0;\n }\n .simulator-themes {\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n overflow-y: auto;\n }\n .simulator-theme-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px;\n background: var(--sim-bg);\n border: 2px solid var(--sim-border);\n border-radius: 2px;\n cursor: pointer;\n }\n .simulator-theme-item:hover {\n border-color: var(--sim-border-light);\n }\n .simulator-theme-item.selected {\n border-color: var(--sim-accent);\n background: var(--sim-bg-alt);\n }\n .simulator-theme-preview {\n width: 48px;\n height: 32px;\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-template-rows: repeat(2, 1fr);\n gap: 1px;\n border-radius: 2px;\n overflow: hidden;\n flex-shrink: 0;\n }\n .simulator-theme-preview-cell {\n width: 100%;\n height: 100%;\n }\n .simulator-theme-name {\n font-size: 10px;\n color: var(--sim-text);\n flex: 1;\n }\n .simulator-theme-type {\n font-size: 9px;\n color: var(--sim-text-dim);\n text-transform: uppercase;\n }\n /* Auth tab styles */\n .simulator-section {\n margin-bottom: 12px;\n }\n .simulator-section-title {\n color: var(--sim-accent);\n text-transform: uppercase;\n font-size: 10px;\n font-weight: bold;\n letter-spacing: 1px;\n margin-bottom: 6px;\n padding-bottom: 4px;\n border-bottom: 1px solid var(--sim-border);\n }\n .auth-header-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 6px;\n }\n .auth-status {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 10px;\n color: var(--sim-text-dim);\n padding: 4px 0;\n }\n .auth-status.authenticated {\n color: var(--sim-success);\n }\n .simulator-btn.small {\n padding: 2px 6px;\n font-size: 9px;\n }\n .simulator-btn.tiny {\n padding: 3px 2px;\n font-size: 8px;\n border-width: 1px;\n line-height: 1;\n min-height: 0;\n height: auto;\n }\n .auth-title-row {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n .auth-title-row > span:first-child {\n flex: 1;\n }\n .auth-title-row .simulator-btn.active {\n background: var(--sim-accent);\n color: black;\n }\n .auth-description {\n font-size: 10px;\n color: var(--sim-text-dim);\n margin: 6px 0;\n line-height: 1.4;\n }\n .auth-user-info {\n font-size: 10px;\n color: var(--sim-text-dim);\n padding: 6px;\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n margin-bottom: 8px;\n }\n .auth-user-info div {\n margin-bottom: 4px;\n }\n .auth-user-info div:last-child {\n margin-bottom: 0;\n }\n .auth-user-info code {\n color: var(--sim-text);\n background: var(--sim-bg-alt);\n padding: 1px 4px;\n border-radius: 2px;\n }\n .auth-warning {\n color: var(--sim-warning);\n font-style: italic;\n }\n .auth-error {\n margin-top: 8px;\n }\n .auth-error .error,\n .auth-api-result .error {\n color: var(--sim-error);\n font-size: 10px;\n padding: 6px;\n background: rgba(248, 113, 113, 0.1);\n border: 1px solid var(--sim-error);\n border-radius: 2px;\n }\n .auth-api-result {\n margin-top: 8px;\n }\n .auth-api-result pre {\n font-size: 9px;\n color: var(--sim-text);\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n padding: 6px;\n margin: 0;\n white-space: pre-wrap;\n word-break: break-all;\n max-height: 150px;\n overflow-y: auto;\n }\n .auth-api-result .loading {\n font-size: 10px;\n color: var(--sim-text-dim);\n padding: 6px;\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n }\n /* Data view styles */\n .data-view-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n }\n .data-subtabs {\n display: flex;\n gap: 2px;\n margin-bottom: 8px;\n flex-shrink: 0;\n }\n .data-subtab {\n padding: 4px 10px;\n background: var(--sim-bg-alt);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n color: var(--sim-text-dim);\n cursor: pointer;\n font: inherit;\n font-size: 9px;\n font-weight: bold;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n }\n .data-subtab:hover {\n color: var(--sim-text);\n background: var(--sim-border);\n }\n .data-subtab.active {\n color: var(--sim-panel);\n background: var(--sim-accent);\n border-color: var(--sim-accent);\n }\n .data-subtab-content {\n display: none;\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n }\n .data-subtab-content.active {\n display: flex;\n flex-direction: column;\n }\n /* History tab styles */\n .history-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 6px;\n flex-shrink: 0;\n }\n .history-list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n overflow-y: auto;\n }\n .history-item {\n padding: 6px;\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n display: flex;\n flex-direction: row;\n gap: 8px;\n }\n .history-item:hover {\n border-color: var(--sim-border-light);\n }\n .history-item-thumb {\n width: 80px;\n height: 80px;\n flex-shrink: 0;\n background: var(--history-thumb-bg, var(--sim-bg-alt));\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n }\n .history-item-thumb svg {\n width: 100%;\n height: 100%;\n }\n .history-item-thumb:empty {\n display: none;\n }\n .history-item-content {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n .history-item-header {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n .history-item-num {\n color: var(--sim-accent);\n font-weight: bold;\n font-size: 9px;\n }\n .history-item-time {\n color: var(--sim-text-dim);\n font-size: 9px;\n flex: 1;\n }\n .history-item-preview {\n font-size: 9px;\n color: var(--sim-text);\n word-break: break-all;\n line-height: 1.3;\n background: var(--sim-bg-alt);\n padding: 3px 4px;\n border-radius: 2px;\n flex: 1;\n overflow: hidden;\n }\n /* Saves tab styles */\n .save-new {\n display: flex;\n gap: 4px;\n margin-bottom: 8px;\n flex-shrink: 0;\n }\n .save-new .simulator-input {\n flex: 1;\n }\n .saves-list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n overflow-y: auto;\n }\n .save-item {\n padding: 6px;\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n }\n .save-item:hover {\n border-color: var(--sim-border-light);\n }\n .save-item-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 4px;\n }\n .save-item-name {\n color: var(--sim-text);\n font-weight: bold;\n font-size: 10px;\n }\n .save-item-time {\n color: var(--sim-text-dim);\n font-size: 9px;\n }\n .save-item-actions {\n display: flex;\n gap: 4px;\n }\n /* Features view styles */\n .features-view-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n }\n .features-slug-input {\n display: flex;\n gap: 4px;\n margin-bottom: 8px;\n }\n .features-slug-input .simulator-input {\n flex: 1;\n }\n .features-content {\n flex: 1;\n overflow-y: auto;\n }\n .features-loading {\n color: var(--sim-text-dim);\n font-size: 10px;\n text-align: center;\n padding: 20px;\n }\n .features-error {\n color: var(--sim-error);\n font-size: 10px;\n padding: 8px;\n background: rgba(248, 113, 113, 0.1);\n border: 1px solid var(--sim-error);\n border-radius: 2px;\n }\n .features-empty {\n color: var(--sim-text-dim);\n font-size: 10px;\n text-align: center;\n padding: 20px;\n }\n .features-auth-required {\n color: var(--sim-text-dim);\n font-size: 10px;\n padding: 12px;\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n line-height: 1.5;\n }\n .features-auth-required p {\n margin: 0 0 8px 0;\n }\n .features-auth-required p:last-child {\n margin-bottom: 0;\n }\n .features-game-name {\n color: var(--sim-accent);\n font-size: 11px;\n font-weight: bold;\n margin-bottom: 8px;\n padding-bottom: 4px;\n border-bottom: 1px solid var(--sim-border);\n }\n .feature-group {\n margin-bottom: 12px;\n }\n .feature-group-title {\n color: var(--sim-text);\n font-size: 10px;\n font-weight: bold;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n margin-bottom: 6px;\n padding-bottom: 2px;\n border-bottom: 1px solid var(--sim-border);\n }\n .feature-group-items {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n .feature-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 6px;\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-radius: 2px;\n cursor: pointer;\n transition: all 0.15s ease;\n }\n .feature-item:hover {\n border-color: var(--sim-border-light);\n background: var(--sim-bg-alt);\n }\n .feature-item.updating {\n opacity: 0.5;\n pointer-events: none;\n }\n .feature-status {\n font-size: 14px;\n width: 18px;\n text-align: center;\n flex-shrink: 0;\n }\n .feature-item.enabled .feature-status {\n color: var(--sim-success);\n }\n .feature-item.disabled .feature-status {\n color: var(--sim-error);\n opacity: 0.5;\n }\n .feature-title {\n font-size: 10px;\n color: var(--sim-text);\n flex: 1;\n }\n .feature-item.disabled .feature-title {\n color: var(--sim-text-dim);\n }\n /* Checkpoints view styles */\n .checkpoints-view-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n }\n .checkpoints-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 6px;\n flex-shrink: 0;\n }\n .checkpoints-list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n overflow-y: auto;\n }\n .checkpoint-item {\n padding: 6px;\n background: var(--sim-bg);\n border: 1px solid var(--sim-border);\n border-left: 3px solid var(--sim-accent);\n border-radius: 2px;\n }\n .checkpoint-item:hover {\n border-color: var(--sim-border-light);\n border-left-color: var(--sim-accent);\n }\n .checkpoint-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n .checkpoint-item .simulator-deeds {\n margin-top: 4px;\n }\n .checkpoint-name {\n color: var(--sim-accent);\n font-weight: bold;\n font-size: 10px;\n }\n .checkpoint-time {\n color: var(--sim-text-dim);\n font-size: 9px;\n }\n";
|
|
2
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/simulator/styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,8rwBAijC3B,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { MessagesReceived, Theme, ThumbnailConfig } from "../types";
|
|
2
|
+
/** Type for Vite's glob import with eager loading - supports both Vite 5 and 6 formats */
|
|
3
|
+
export type FixtureImports = Record<string, {
|
|
4
|
+
default?: any;
|
|
5
|
+
}>;
|
|
6
|
+
export interface SimulatorConfig {
|
|
7
|
+
/** Path to the puzzle JSON file (default: "./sample-puzzle.json") */
|
|
8
|
+
puzzlePath?: string;
|
|
9
|
+
/** Whether to auto-start the game after READY (default: true) */
|
|
10
|
+
autoStart?: boolean;
|
|
11
|
+
/** Initial collapsed state (default: true) */
|
|
12
|
+
collapsed?: boolean;
|
|
13
|
+
/** Fixture imports from Vite's import.meta.glob - supports { default: data } (Vite 5) or { json: data } (Vite 6) */
|
|
14
|
+
fixtures?: FixtureImports;
|
|
15
|
+
/** Game slug for API features (e.g. "crossword", "ribbit") */
|
|
16
|
+
slug?: string;
|
|
17
|
+
}
|
|
18
|
+
export type TabName = string;
|
|
19
|
+
export interface SimulatorState {
|
|
20
|
+
isCollapsed: boolean;
|
|
21
|
+
isPaused: boolean;
|
|
22
|
+
hasStarted: boolean;
|
|
23
|
+
activeTab: TabName;
|
|
24
|
+
puzzleData: any;
|
|
25
|
+
originalPuzzle: string;
|
|
26
|
+
currentInputStr: string;
|
|
27
|
+
completionData: any;
|
|
28
|
+
selectedTheme: Theme;
|
|
29
|
+
selectedCategory: string | null;
|
|
30
|
+
selectedPuzzle: string | null;
|
|
31
|
+
renderHost: ThumbnailConfig["renderHost"];
|
|
32
|
+
renderContext: ThumbnailConfig["renderContext"];
|
|
33
|
+
}
|
|
34
|
+
export interface MessageLogEntry {
|
|
35
|
+
type: string;
|
|
36
|
+
data: any;
|
|
37
|
+
time: string;
|
|
38
|
+
direction: "in" | "out";
|
|
39
|
+
}
|
|
40
|
+
export interface SimulatorContext {
|
|
41
|
+
state: SimulatorState;
|
|
42
|
+
getElement: <T extends HTMLElement>(selector: string) => T | null;
|
|
43
|
+
sendToGame: (type: keyof MessagesReceived, data: any) => void;
|
|
44
|
+
logMessage: (type: string, data: any, direction: "in" | "out") => void;
|
|
45
|
+
loadPuzzle: () => Promise<any>;
|
|
46
|
+
updateStatus: (text: string, className: string) => void;
|
|
47
|
+
updateTimer: (display: string, penalty?: string) => void;
|
|
48
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
49
|
+
switchTab: (tab: TabName) => void;
|
|
50
|
+
updateThumbnail: () => void;
|
|
51
|
+
/** Update the badge count for a tab. Pass 0 or undefined to hide the badge. */
|
|
52
|
+
updateBadge: (tabId: TabName, count: number | undefined) => void;
|
|
53
|
+
fixtures: Map<string, Map<string, any>> | null;
|
|
54
|
+
fixtureCategories: string[];
|
|
55
|
+
/** Game slug for API features */
|
|
56
|
+
gameSlug: string | null;
|
|
57
|
+
}
|
|
58
|
+
export interface SimulatorView {
|
|
59
|
+
/** Tab identifier */
|
|
60
|
+
id: TabName;
|
|
61
|
+
/** Display label for tab button */
|
|
62
|
+
label: string;
|
|
63
|
+
/** Returns HTML for the tab content */
|
|
64
|
+
render(): string;
|
|
65
|
+
/** Bind event listeners after render */
|
|
66
|
+
bind(context: SimulatorContext): void;
|
|
67
|
+
/** Called when tab becomes active */
|
|
68
|
+
onActivate?(context: SimulatorContext): void;
|
|
69
|
+
/** Handle incoming messages from game */
|
|
70
|
+
onMessage?(type: string, data: any, context: SimulatorContext): void;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/simulator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAExE,0FAA0F;AAC1F,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAAA;AAE9D,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,oHAAoH;IACpH,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,OAAO,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,GAAG,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,GAAG,CAAA;IACnB,aAAa,EAAE,KAAK,CAAA;IACpB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAA;IACzC,aAAa,EAAE,eAAe,CAAC,eAAe,CAAC,CAAA;CAChD;AAED,MAAM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,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,EAAE,EAAE,OAAO,CAAA;IACX,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,uCAAuC;IACvC,MAAM,IAAI,MAAM,CAAA;IAChB,wCAAwC;IACxC,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACrC,qCAAqC;IACrC,UAAU,CAAC,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC5C,yCAAyC;IACzC,SAAS,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAA;CACrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthView.d.ts","sourceRoot":"","sources":["../../../src/simulator/views/AuthView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,UAAU,CAAA;AA8Q/D,wBAAgB,cAAc,IAAI,aAAa,CAkN9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckpointsView.d.ts","sourceRoot":"","sources":["../../../src/simulator/views/CheckpointsView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,UAAU,CAAA;AAS/D,wBAAgB,qBAAqB,IAAI,aAAa,CAqFrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CtrlView.d.ts","sourceRoot":"","sources":["../../../src/simulator/views/CtrlView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,UAAU,CAAA;AAI/D,wBAAgB,cAAc,IAAI,aAAa,CAiJ9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataView.d.ts","sourceRoot":"","sources":["../../../src/simulator/views/DataView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,UAAU,CAAA;AAqE/D,wBAAgB,cAAc,IAAI,aAAa,CAsQ9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DoneView.d.ts","sourceRoot":"","sources":["../../../src/simulator/views/DoneView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,UAAU,CAAA;AAE/D,wBAAgB,cAAc,IAAI,aAAa,CAsF9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeaturesView.d.ts","sourceRoot":"","sources":["../../../src/simulator/views/FeaturesView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,UAAU,CAAA;AAwL/D,eAAO,MAAM,eAAe,QAAO,OAGlC,CAAA;AAED,wBAAgB,kBAAkB,IAAI,aAAa,CAmNlD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SimulatorContext, SimulatorView, MessageLogEntry } from "../types";
|
|
2
|
+
export interface MsgsViewExtended extends SimulatorView {
|
|
3
|
+
addLogEntry: (entry: MessageLogEntry, ctx: SimulatorContext) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function createMsgsView(): MsgsViewExtended;
|
|
6
|
+
//# sourceMappingURL=MsgsView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MsgsView.d.ts","sourceRoot":"","sources":["../../../src/simulator/views/MsgsView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAEhF,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,WAAW,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAA;CACrE;AAOD,wBAAgB,cAAc,IAAI,gBAAgB,CAuEjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeView.d.ts","sourceRoot":"","sources":["../../../src/simulator/views/ThemeView.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,UAAU,CAAA;AAa/D,wBAAgB,eAAe,IAAI,aAAa,CAqC/C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SimulatorContext, SimulatorView } from "../types";
|
|
2
|
+
export interface ThumbViewExtended extends SimulatorView {
|
|
3
|
+
updatePreview: (ctx: SimulatorContext) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function createThumbView(): ThumbViewExtended;
|
|
6
|
+
//# sourceMappingURL=ThumbView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbView.d.ts","sourceRoot":"","sources":["../../../src/simulator/views/ThumbView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAgB/D,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,aAAa,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAC/C;AAED,wBAAgB,eAAe,IAAI,iBAAiB,CAkInD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { createCtrlView } from "./CtrlView";
|
|
2
|
+
export { createDataView } from "./DataView";
|
|
3
|
+
export { createMsgsView, type MsgsViewExtended } from "./MsgsView";
|
|
4
|
+
export { createDoneView } from "./DoneView";
|
|
5
|
+
export { createCheckpointsView } from "./CheckpointsView";
|
|
6
|
+
export { createThumbView, type ThumbViewExtended } from "./ThumbView";
|
|
7
|
+
export { createThemeView } from "./ThemeView";
|
|
8
|
+
export { createAuthView } from "./AuthView";
|
|
9
|
+
export { createFeaturesView, isAuthenticated } from "./FeaturesView";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simulator/views/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/themes.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Theme } from "./types";
|
|
2
|
+
export declare const lightTheme: Theme;
|
|
3
|
+
export declare const themes: Theme[];
|
|
4
|
+
export declare const defaultLightTheme: Theme;
|
|
5
|
+
export declare const defaultDarkTheme: Theme;
|
|
6
|
+
export declare const newsPaperLightTheme: Theme;
|
|
7
|
+
export declare const modifiedNewsPaperTheme: (type: "light" | "dark", hexes: string[] | readonly string[], partnerSlug: string) => {
|
|
8
|
+
name: string;
|
|
9
|
+
a_puzmo: string;
|
|
10
|
+
key: string;
|
|
11
|
+
keyLight: string;
|
|
12
|
+
keyStrong: string;
|
|
13
|
+
alt1: string;
|
|
14
|
+
alt2: string;
|
|
15
|
+
alt3: string;
|
|
16
|
+
keyFG: string;
|
|
17
|
+
player: string;
|
|
18
|
+
playerLight: string;
|
|
19
|
+
playerFG: string;
|
|
20
|
+
subBrand: string;
|
|
21
|
+
subBrandFG: string;
|
|
22
|
+
g_key: string;
|
|
23
|
+
a_infoBG: string;
|
|
24
|
+
type: "light" | "dark";
|
|
25
|
+
fg: string;
|
|
26
|
+
error: string;
|
|
27
|
+
alwaysDark: string;
|
|
28
|
+
alwaysLight: string;
|
|
29
|
+
g_bg: string;
|
|
30
|
+
g_bgAlt: string;
|
|
31
|
+
g_bgDark: string;
|
|
32
|
+
g_textDark: string;
|
|
33
|
+
g_textLight: string;
|
|
34
|
+
g_blank: string;
|
|
35
|
+
g_unsolved: string;
|
|
36
|
+
g_outline: string;
|
|
37
|
+
a_bg: string;
|
|
38
|
+
a_bgAlt: string;
|
|
39
|
+
a_headerText: string;
|
|
40
|
+
a_table: string;
|
|
41
|
+
a_tableAlt: string;
|
|
42
|
+
a_inlineTag: string;
|
|
43
|
+
a_anchor: string;
|
|
44
|
+
};
|
|
45
|
+
export type PuzmoTheme = typeof lightTheme;
|
|
46
|
+
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,eAAO,MAAM,UAAU,EAAE,KA8ExB,CAAA;AAmID,eAAO,MAAM,MAAM,EAAE,KAAK,EA8MzB,CAAA;AAED,eAAO,MAAM,iBAAiB,OAAa,CAAA;AAC3C,eAAO,MAAM,gBAAgB,OAAY,CAAA;AACzC,eAAO,MAAM,mBAAmB,OAAmB,CAAA;AAEnD,eAAO,MAAM,sBAAsB,GAAI,MAAM,OAAO,GAAG,MAAM,EAAE,OAAO,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EAAE,aAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBtH,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/** Theme info provided by Puzzmo */
|
|
2
|
+
export type Theme = {
|
|
3
|
+
name: string;
|
|
4
|
+
type: "light" | "dark";
|
|
5
|
+
key: string;
|
|
6
|
+
keyFG: string;
|
|
7
|
+
keyStrong: string;
|
|
8
|
+
keyLight: string;
|
|
9
|
+
g_key: string;
|
|
10
|
+
subBrand: string;
|
|
11
|
+
subBrandFG: string;
|
|
12
|
+
player: string;
|
|
13
|
+
playerLight: string;
|
|
14
|
+
playerFG: string;
|
|
15
|
+
alt1: string;
|
|
16
|
+
alt2: string;
|
|
17
|
+
alt3: string;
|
|
18
|
+
fg: string;
|
|
19
|
+
error: string;
|
|
20
|
+
alwaysDark: string;
|
|
21
|
+
alwaysLight: string;
|
|
22
|
+
g_bg: string;
|
|
23
|
+
g_bgAlt: string;
|
|
24
|
+
g_bgDark: string;
|
|
25
|
+
g_textDark: string;
|
|
26
|
+
g_textLight: string;
|
|
27
|
+
g_blank: string;
|
|
28
|
+
g_unsolved: string;
|
|
29
|
+
g_outline: string;
|
|
30
|
+
a_bg: string;
|
|
31
|
+
a_bgAlt: string;
|
|
32
|
+
a_infoBG: string;
|
|
33
|
+
a_puzmo: string;
|
|
34
|
+
a_headerText: string;
|
|
35
|
+
a_table: string;
|
|
36
|
+
a_tableAlt: string;
|
|
37
|
+
a_inlineTag: string;
|
|
38
|
+
a_anchor: string;
|
|
39
|
+
};
|
|
40
|
+
/** Gameplay metrics sent to the host */
|
|
41
|
+
export type GamePlay = {
|
|
42
|
+
elapsedTimeSecs: number;
|
|
43
|
+
additionalTimeAddedSecs: number;
|
|
44
|
+
hintsUsed: number;
|
|
45
|
+
resetsUsed: number;
|
|
46
|
+
metric1: number;
|
|
47
|
+
metric2: number;
|
|
48
|
+
metric3: number;
|
|
49
|
+
metric4: number;
|
|
50
|
+
metricStrings: string[];
|
|
51
|
+
pointsAwarded: number;
|
|
52
|
+
completed?: boolean;
|
|
53
|
+
pipelineStats?: any;
|
|
54
|
+
cheatsUsed: number;
|
|
55
|
+
};
|
|
56
|
+
/** Things the server uses for meta-game augmentations */
|
|
57
|
+
export type AugmentationConfig = {
|
|
58
|
+
augmentations?: any;
|
|
59
|
+
deeds?: Deed[] | Readonly<Deed[]>;
|
|
60
|
+
};
|
|
61
|
+
export type CheckpointConfig = {
|
|
62
|
+
interruptible: boolean;
|
|
63
|
+
complete: boolean;
|
|
64
|
+
process: "leaderboards"[];
|
|
65
|
+
};
|
|
66
|
+
export type Deed = {
|
|
67
|
+
id: string;
|
|
68
|
+
value: any;
|
|
69
|
+
textRepresentation?: string | null;
|
|
70
|
+
puzzmoPoints?: number | null;
|
|
71
|
+
};
|
|
72
|
+
export type GameOverMessageUIComponent = {
|
|
73
|
+
type: "md";
|
|
74
|
+
text: string;
|
|
75
|
+
} | {
|
|
76
|
+
type: "streak";
|
|
77
|
+
} | {
|
|
78
|
+
type: "augmentation";
|
|
79
|
+
value: string | number;
|
|
80
|
+
display: string;
|
|
81
|
+
};
|
|
82
|
+
export type BootstrapGameData = {
|
|
83
|
+
userState: {
|
|
84
|
+
gameSettings: any;
|
|
85
|
+
id: string;
|
|
86
|
+
nakamaLogin: string;
|
|
87
|
+
ownerID: string;
|
|
88
|
+
};
|
|
89
|
+
currentUser: any;
|
|
90
|
+
startOrFindGameplay: {
|
|
91
|
+
failed?: boolean | null;
|
|
92
|
+
gamePlayed?: {
|
|
93
|
+
additionalTimeAddedSecs: number;
|
|
94
|
+
boardState: string;
|
|
95
|
+
cheatsUsed: number;
|
|
96
|
+
combinedTimeSecs: number;
|
|
97
|
+
completed: boolean;
|
|
98
|
+
createdAt: any;
|
|
99
|
+
elapsedTimeSecs: number;
|
|
100
|
+
hintsUsed: number;
|
|
101
|
+
id: string;
|
|
102
|
+
metric1: number;
|
|
103
|
+
metric2: number;
|
|
104
|
+
metric3: number;
|
|
105
|
+
metric4: number;
|
|
106
|
+
metricStrings: ReadonlyArray<string>;
|
|
107
|
+
ownerID: string;
|
|
108
|
+
pointsAwarded: number;
|
|
109
|
+
resetsUsed: number;
|
|
110
|
+
slug: string;
|
|
111
|
+
viewerOwnsPuzzle: boolean;
|
|
112
|
+
puzzle: {
|
|
113
|
+
id: string;
|
|
114
|
+
name?: string | null;
|
|
115
|
+
puzzle: string;
|
|
116
|
+
seriesNumber: number;
|
|
117
|
+
game: {
|
|
118
|
+
assetsPath: string;
|
|
119
|
+
assetsSha: string;
|
|
120
|
+
displayName: string;
|
|
121
|
+
exposedGlobalFunction: string;
|
|
122
|
+
jsPath: string;
|
|
123
|
+
slug: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
theme: Theme;
|
|
129
|
+
hostFlags: ("sandbox" | "embed" | "desktop" | "native-ios")[];
|
|
130
|
+
hostContext: any[];
|
|
131
|
+
appRuntimeContract: string;
|
|
132
|
+
};
|
|
133
|
+
/** Callable thumbnail renderer attached to globalThis */
|
|
134
|
+
export type ThumbnailFunction = {
|
|
135
|
+
(puzzleStr: string, inputStr?: string, config?: ThumbnailConfig): string;
|
|
136
|
+
interpolate?: (inputStr: string, puzzleStr: string, value: number) => {
|
|
137
|
+
inputStr: string;
|
|
138
|
+
display: string;
|
|
139
|
+
time?: number;
|
|
140
|
+
};
|
|
141
|
+
getStepCount?: (inputStr: string) => {
|
|
142
|
+
count: number;
|
|
143
|
+
};
|
|
144
|
+
getShareString?: (inputStr: string, title: string, extraData?: {
|
|
145
|
+
puzzleString: string;
|
|
146
|
+
dateKey: string;
|
|
147
|
+
gameplaySlug: string;
|
|
148
|
+
partnerSlug?: string;
|
|
149
|
+
}) => {
|
|
150
|
+
str: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
/** Configuration passed to thumbnail renderers */
|
|
154
|
+
export type ThumbnailConfig = {
|
|
155
|
+
theme: Theme;
|
|
156
|
+
viewerIsOwner: boolean;
|
|
157
|
+
optForReadability?: boolean;
|
|
158
|
+
strict?: true;
|
|
159
|
+
/** @deprecated check for gameplay.completed instead */
|
|
160
|
+
completed?: boolean;
|
|
161
|
+
gameplay?: Partial<GamePlay>;
|
|
162
|
+
renderHost?: "game" | "app" | "opengraph";
|
|
163
|
+
renderContext?: "preview" | "share" | "completed" | "timeline";
|
|
164
|
+
viewerMetadata?: any | null;
|
|
165
|
+
};
|
|
166
|
+
/** Messages from the SDK to the host */
|
|
167
|
+
export type MessagesSentFromEmbed = {
|
|
168
|
+
READY: object;
|
|
169
|
+
READY_GAME_LOADED: {
|
|
170
|
+
state: any;
|
|
171
|
+
gameRuntimeContract: string;
|
|
172
|
+
embedRuntimeContract: string;
|
|
173
|
+
};
|
|
174
|
+
UPLOAD_NEW_GAME_STATE: {
|
|
175
|
+
id: string;
|
|
176
|
+
input: {
|
|
177
|
+
elapsedTimeSecs?: number | null;
|
|
178
|
+
additionalTimeAddedSecs?: number | null;
|
|
179
|
+
pauses?: number | null;
|
|
180
|
+
hintsUsed?: number | null;
|
|
181
|
+
resetsUsed?: number | null;
|
|
182
|
+
cheatsUsed?: number | null;
|
|
183
|
+
boardState?: string | null;
|
|
184
|
+
metric1?: number | null;
|
|
185
|
+
metric2?: number | null;
|
|
186
|
+
metric3?: number | null;
|
|
187
|
+
metric4?: number | null;
|
|
188
|
+
metricStrings?: string[] | null;
|
|
189
|
+
collabUserReferences: string[];
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
GAME_COMPLETED: {
|
|
193
|
+
id: string;
|
|
194
|
+
input: any;
|
|
195
|
+
pipelineStats?: any[];
|
|
196
|
+
config?: {
|
|
197
|
+
deeds?: Deed[] | readonly Deed[];
|
|
198
|
+
augmentations?: any;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
SHOW_GAME_COMPLETE_SCREEN: {
|
|
202
|
+
results: GameOverMessageUIComponent[];
|
|
203
|
+
showRetry: boolean;
|
|
204
|
+
gameplay: GamePlay;
|
|
205
|
+
};
|
|
206
|
+
TIMER_TICK: {
|
|
207
|
+
display: [string, string];
|
|
208
|
+
};
|
|
209
|
+
TIMER_SYNC: number;
|
|
210
|
+
HIT_CHECKPOINT: {
|
|
211
|
+
checkpointName: string;
|
|
212
|
+
gameplay: {
|
|
213
|
+
inputStr: string;
|
|
214
|
+
play: Partial<GamePlay>;
|
|
215
|
+
};
|
|
216
|
+
checkpointConfig: CheckpointConfig;
|
|
217
|
+
augConfig: AugmentationConfig;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
/** Messages from the host to the SDK */
|
|
221
|
+
export type MessagesReceived = {
|
|
222
|
+
READY_DATA: BootstrapGameData;
|
|
223
|
+
RESET_DATA: {
|
|
224
|
+
data: any;
|
|
225
|
+
};
|
|
226
|
+
RETRY_PUZZLE: object;
|
|
227
|
+
START_GAME: undefined;
|
|
228
|
+
PAUSE_GAME: object;
|
|
229
|
+
RESUME_GAME: object;
|
|
230
|
+
SETTINGS_UPDATE: any;
|
|
231
|
+
};
|
|
232
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,GAAG,MAAM,CAAA;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAA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AA;KAC9B,CAAA;CACF,CAAA;AAED,wCAAwC;AACxC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,iBAAiB,CAAA;IAC7B,UAAU,EAAE;QAAE,IAAI,EAAE,GAAG,CAAA;KAAE,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,SAAS,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,GAAG,CAAA;CACrB,CAAA"}
|
package/dist/vite.cjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function t(t,n){if(t==null)return{};var r,i,a=e(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],n.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}var n=[`fixturesGlob`];function r(e={}){return{name:`puzzmo-simulator`,apply:`serve`,configureServer(e){e.middlewares.use(`/oauth/callback`,(e,t)=>{t.setHeader(`Content-Type`,`text/html`),t.end(`<!DOCTYPE html>
|
|
2
|
+
<html><head><title>Puzzmo OAuth</title></head>
|
|
3
|
+
<body><script>
|
|
4
|
+
var params = new URLSearchParams(window.location.search);
|
|
5
|
+
var returnUrl = sessionStorage.getItem("oauth_return_url") || "/";
|
|
6
|
+
var url = new URL(returnUrl);
|
|
7
|
+
params.forEach(function(v, k) { url.searchParams.set(k, v); });
|
|
8
|
+
window.location.href = url.toString();
|
|
9
|
+
<\/script></body></html>`)})},transformIndexHtml(){let{fixturesGlob:r}=e,i=t(e,n),a=[`import { createSimulator } from "@puzzmo/sdk/simulator"`];r&&a.push(`const fixtures = import.meta.glob(${JSON.stringify(r)}, { eager: true })`);let o=Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>`${e}: ${JSON.stringify(t)}`);return r&&o.push(`fixtures`),a.push(`createSimulator({ ${o.join(`, `)} })`),[{tag:`script`,attrs:{type:`module`},children:a.join(`
|
|
10
|
+
`),injectTo:`head`}]}}}exports.puzzmoSimulator=r;
|
|
11
|
+
//# sourceMappingURL=vite.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.cjs","names":[],"sources":["../src/vite.ts"],"sourcesContent":["import type { Plugin } from \"vite\"\n\nexport type PuzzmoSimulatorPluginOptions = {\n /** Path to the puzzle JSON file (default: \"./sample-puzzle.json\") */\n puzzlePath?: string\n /** Whether to auto-start the game after READY (default: true) */\n autoStart?: boolean\n /** Initial collapsed state (default: true) */\n collapsed?: boolean\n /** Game slug for API features (e.g. \"crossword\", \"my-game\") */\n slug?: string\n /** Glob pattern for fixture files, passed to import.meta.glob (e.g. \"./fixtures/puzzles/**\\/*.json\") */\n fixturesGlob?: string\n}\n\n/** Vite plugin that injects the Puzzmo simulator in dev mode and handles OAuth callbacks. */\nexport function puzzmoSimulator(options: PuzzmoSimulatorPluginOptions = {}): Plugin {\n return {\n name: \"puzzmo-simulator\",\n apply: \"serve\",\n\n configureServer(server) {\n server.middlewares.use(\"/oauth/callback\", (_req, res) => {\n res.setHeader(\"Content-Type\", \"text/html\")\n res.end(`<!DOCTYPE html>\n<html><head><title>Puzzmo OAuth</title></head>\n<body><script>\nvar params = new URLSearchParams(window.location.search);\nvar returnUrl = sessionStorage.getItem(\"oauth_return_url\") || \"/\";\nvar url = new URL(returnUrl);\nparams.forEach(function(v, k) { url.searchParams.set(k, v); });\nwindow.location.href = url.toString();\n</script></body></html>`)\n })\n },\n\n transformIndexHtml() {\n const { fixturesGlob, ...config } = options\n\n const lines = [\n `import { createSimulator } from \"@puzzmo/sdk/simulator\"`,\n ]\n\n if (fixturesGlob) {\n lines.push(`const fixtures = import.meta.glob(${JSON.stringify(fixturesGlob)}, { eager: true })`)\n }\n\n const configEntries = Object.entries(config).filter(([, v]) => v !== undefined)\n const configParts = configEntries.map(([k, v]) => `${k}: ${JSON.stringify(v)}`)\n if (fixturesGlob) configParts.push(\"fixtures\")\n\n lines.push(`createSimulator({ ${configParts.join(\", \")} })`)\n\n return [\n {\n tag: \"script\",\n attrs: { type: \"module\" },\n children: lines.join(\"\\n\"),\n injectTo: \"head\",\n },\n ]\n },\n }\n}\n"],"mappings":"obAqCc,eAAA,CArBd,SAAgB,EAAgB,EAAwC,EAAE,CAAU,CAClF,MAAO,CACL,KAAM,mBACN,MAAO,QAEP,gBAAgB,EAAQ,CACtB,EAAO,YAAY,IAAI,mBAAoB,EAAM,IAAQ,CACvD,EAAI,UAAU,eAAgB,YAAY,CAC1C,EAAI,IAAI;;;;;;;;0BAQS,EACjB,EAGJ,oBAAqB,CACnB,GAAM,CAAE,gBAAA,EAAiB,EAAA,EAAW,EAAA,EAAA,CAE9B,EAAQ,CACZ,0DACD,CAEG,GACF,EAAM,KAAK,qCAAqC,KAAK,UAAU,EAAa,CAAC,oBAAoB,CAInG,IAAM,EADgB,OAAO,QAAQ,EAAO,CAAC,QAAQ,EAAG,KAAO,IAAM,IAAA,GAAU,CAC7C,KAAK,CAAC,EAAG,KAAO,GAAG,EAAE,IAAI,KAAK,UAAU,EAAE,GAAG,CAK/E,OAJI,GAAc,EAAY,KAAK,WAAW,CAE9C,EAAM,KAAK,qBAAqB,EAAY,KAAK,KAAK,CAAC,KAAK,CAErD,CACL,CACE,IAAK,SACL,MAAO,CAAE,KAAM,SAAU,CACzB,SAAU,EAAM,KAAK;EAAK,CAC1B,SAAU,OACX,CACF,EAEJ"}
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Plugin } from "vite";
|
|
2
|
+
export type PuzzmoSimulatorPluginOptions = {
|
|
3
|
+
/** Path to the puzzle JSON file (default: "./sample-puzzle.json") */
|
|
4
|
+
puzzlePath?: string;
|
|
5
|
+
/** Whether to auto-start the game after READY (default: true) */
|
|
6
|
+
autoStart?: boolean;
|
|
7
|
+
/** Initial collapsed state (default: true) */
|
|
8
|
+
collapsed?: boolean;
|
|
9
|
+
/** Game slug for API features (e.g. "crossword", "my-game") */
|
|
10
|
+
slug?: string;
|
|
11
|
+
/** Glob pattern for fixture files, passed to import.meta.glob (e.g. "./fixtures/puzzles/**\/*.json") */
|
|
12
|
+
fixturesGlob?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Vite plugin that injects the Puzzmo simulator in dev mode and handles OAuth callbacks. */
|
|
15
|
+
export declare function puzzmoSimulator(options?: PuzzmoSimulatorPluginOptions): Plugin;
|
|
16
|
+
//# sourceMappingURL=vite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAElC,MAAM,MAAM,4BAA4B,GAAG;IACzC,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wGAAwG;IACxG,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAAC,OAAO,GAAE,4BAAiC,GAAG,MAAM,CA+ClF"}
|