Reorganize client items into per-item folders

This commit is contained in:
Jage9
2026-02-24 02:07:18 -05:00
parent 43cf9316c0
commit cc33e24cd4
16 changed files with 28 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
// Maintainer-controlled web client version. // Maintainer-controlled web client version.
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
window.CHGRID_WEB_VERSION = "2026.02.24 R224"; window.CHGRID_WEB_VERSION = "2026.02.24 R225";
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
window.CHGRID_TIME_ZONE = "America/Detroit"; window.CHGRID_TIME_ZONE = "America/Detroit";

View File

@@ -1,4 +1,4 @@
import { type ItemTypeClientDefinition } from './shared'; import { type ItemTypeClientDefinition } from '../shared';
export const CLOCK_TIME_ZONE_OPTIONS = [ export const CLOCK_TIME_ZONE_OPTIONS = [
'America/Anchorage', 'America/Anchorage',
@@ -61,4 +61,3 @@ export const clockDefinition: ItemTypeClientDefinition = {
timeZone: [...CLOCK_TIME_ZONE_OPTIONS], timeZone: [...CLOCK_TIME_ZONE_OPTIONS],
}, },
}; };

View File

@@ -0,0 +1,2 @@
export { clockDefinition, CLOCK_TIME_ZONE_OPTIONS } from './definition';

View File

@@ -1,4 +1,4 @@
import { type ItemTypeClientDefinition } from './shared'; import { type ItemTypeClientDefinition } from '../shared';
/** Default client-side UI definition for dice items. */ /** Default client-side UI definition for dice items. */
export const diceDefinition: ItemTypeClientDefinition = { export const diceDefinition: ItemTypeClientDefinition = {
@@ -15,4 +15,3 @@ export const diceDefinition: ItemTypeClientDefinition = {
emitSoundTempo: 50, emitSoundTempo: 50,
}, },
}; };

View File

@@ -0,0 +1,2 @@
export { diceDefinition } from './definition';

View File

@@ -19,4 +19,3 @@ export const DEFAULT_ITEM_TYPE_DEFINITIONS: ItemTypeClientDefinition[] = [
/** Default add-item menu ordering derived from local item definitions. */ /** Default add-item menu ordering derived from local item definitions. */
export const DEFAULT_ITEM_TYPE_SEQUENCE: ItemType[] = DEFAULT_ITEM_TYPE_DEFINITIONS.map((definition) => definition.type); export const DEFAULT_ITEM_TYPE_SEQUENCE: ItemType[] = DEFAULT_ITEM_TYPE_DEFINITIONS.map((definition) => definition.type);

View File

@@ -1,5 +1,5 @@
import { PIANO_INSTRUMENT_OPTIONS } from '../../audio/pianoSynth'; import { PIANO_INSTRUMENT_OPTIONS } from '../../../audio/pianoSynth';
import { type ItemTypeClientDefinition } from './shared'; import { type ItemTypeClientDefinition } from '../shared';
/** Default client-side UI definition for piano items. */ /** Default client-side UI definition for piano items. */
export const pianoDefinition: ItemTypeClientDefinition = { export const pianoDefinition: ItemTypeClientDefinition = {
@@ -20,4 +20,3 @@ export const pianoDefinition: ItemTypeClientDefinition = {
voiceMode: ['poly', 'mono'], voiceMode: ['poly', 'mono'],
}, },
}; };

View File

@@ -0,0 +1,3 @@
export { pianoDefinition } from './definition';
export { PianoController } from './runtime';

View File

@@ -3,9 +3,9 @@ import {
PIANO_INSTRUMENT_OPTIONS, PIANO_INSTRUMENT_OPTIONS,
PianoSynth, PianoSynth,
type PianoInstrumentId, type PianoInstrumentId,
} from '../audio/pianoSynth'; } from '../../../audio/pianoSynth';
import { type IncomingMessage, type OutgoingMessage } from '../network/protocol'; import { type IncomingMessage, type OutgoingMessage } from '../../../network/protocol';
import { type GameMode, type WorldItem } from '../state/gameState'; import { type GameMode, type WorldItem } from '../../../state/gameState';
const PIANO_WHITE_KEY_MIDI_BY_CODE: Record<string, number> = { const PIANO_WHITE_KEY_MIDI_BY_CODE: Record<string, number> = {
KeyA: 60, KeyA: 60,
@@ -815,4 +815,3 @@ export class PianoController {
} }
} }
} }

View File

@@ -1,6 +1,6 @@
import { RADIO_CHANNEL_OPTIONS } from '../../audio/radioStationRuntime'; import { RADIO_CHANNEL_OPTIONS } from '../../../audio/radioStationRuntime';
import { EFFECT_SEQUENCE } from '../../audio/effects'; import { EFFECT_SEQUENCE } from '../../../audio/effects';
import { type ItemTypeClientDefinition } from './shared'; import { type ItemTypeClientDefinition } from '../shared';
/** Default client-side UI definition for radio_station items. */ /** Default client-side UI definition for radio_station items. */
export const radioStationDefinition: ItemTypeClientDefinition = { export const radioStationDefinition: ItemTypeClientDefinition = {
@@ -21,4 +21,3 @@ export const radioStationDefinition: ItemTypeClientDefinition = {
mediaChannel: [...RADIO_CHANNEL_OPTIONS], mediaChannel: [...RADIO_CHANNEL_OPTIONS],
}, },
}; };

View File

@@ -0,0 +1,2 @@
export { radioStationDefinition } from './definition';

View File

@@ -1,4 +1,4 @@
import { type ItemTypeClientDefinition } from './shared'; import { type ItemTypeClientDefinition } from '../shared';
/** Default client-side UI definition for wheel items. */ /** Default client-side UI definition for wheel items. */
export const wheelDefinition: ItemTypeClientDefinition = { export const wheelDefinition: ItemTypeClientDefinition = {
@@ -15,4 +15,3 @@ export const wheelDefinition: ItemTypeClientDefinition = {
emitSoundTempo: 50, emitSoundTempo: 50,
}, },
}; };

View File

@@ -0,0 +1,2 @@
export { wheelDefinition } from './definition';

View File

@@ -1,5 +1,5 @@
import { EFFECT_SEQUENCE } from '../../audio/effects'; import { EFFECT_SEQUENCE } from '../../../audio/effects';
import { type ItemTypeClientDefinition } from './shared'; import { type ItemTypeClientDefinition } from '../shared';
/** Default client-side UI definition for widget items. */ /** Default client-side UI definition for widget items. */
export const widgetDefinition: ItemTypeClientDefinition = { export const widgetDefinition: ItemTypeClientDefinition = {
@@ -32,4 +32,3 @@ export const widgetDefinition: ItemTypeClientDefinition = {
emitEffect: EFFECT_SEQUENCE.map((effect) => effect.id), emitEffect: EFFECT_SEQUENCE.map((effect) => effect.id),
}, },
}; };

View File

@@ -0,0 +1,2 @@
export { widgetDefinition } from './definition';

View File

@@ -57,7 +57,7 @@ import {
} from './items/itemRegistry'; } from './items/itemRegistry';
import { createItemPropertyEditor } from './items/itemPropertyEditor'; import { createItemPropertyEditor } from './items/itemPropertyEditor';
import { createItemPropertyPresentation } from './items/itemPropertyPresentation'; import { createItemPropertyPresentation } from './items/itemPropertyPresentation';
import { PianoController } from './items/pianoController'; import { PianoController } from './items/types/piano';
import { NICKNAME_STORAGE_KEY, SettingsStore } from './settings/settingsStore'; import { NICKNAME_STORAGE_KEY, SettingsStore } from './settings/settingsStore';
import { runConnectFlow, runDisconnectFlow, type ConnectFlowDeps } from './session/connectionFlow'; import { runConnectFlow, runDisconnectFlow, type ConnectFlowDeps } from './session/connectionFlow';
import { MediaSession } from './session/mediaSession'; import { MediaSession } from './session/mediaSession';