point-click-components 0.2.3 → 0.3.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/dist/point-click-components.d.ts +74 -28
- package/dist/point-click-components.js +4995 -4900
- package/package.json +1 -1
|
@@ -17,12 +17,14 @@ import { HotspotZone } from 'point-click-lib';
|
|
|
17
17
|
import { InGameEventReporter } from 'point-click-lib';
|
|
18
18
|
import { ItemData } from 'point-click-lib';
|
|
19
19
|
import { LogToDebug } from 'point-click-lib';
|
|
20
|
+
import { MouseEventHandler } from 'react';
|
|
20
21
|
import { Order } from 'point-click-lib';
|
|
21
22
|
import { Provider } from 'react';
|
|
22
23
|
import { ReactElement } from 'react';
|
|
23
24
|
import { ReactNode } from 'react';
|
|
24
25
|
import { Reducer } from 'react';
|
|
25
26
|
import { RoomData } from 'point-click-lib';
|
|
27
|
+
import { SerializedStyles } from '@emotion/react';
|
|
26
28
|
import { SoundValue } from 'point-click-lib';
|
|
27
29
|
import { SpriteData } from 'point-click-lib';
|
|
28
30
|
import { StaticFrameParamsS } from 'point-click-lib';
|
|
@@ -30,7 +32,7 @@ import { StoryBoard } from 'point-click-lib';
|
|
|
30
32
|
import { StoryBoardPage } from 'point-click-lib';
|
|
31
33
|
import { Zone } from 'point-click-lib';
|
|
32
34
|
|
|
33
|
-
export declare const ActorFigure: ({ data, isPaused, clickHandler, handleHover, contextClickHandler, orders, overrideSpriteData, noSound, getImageAsset, getSoundAsset, sprites, SoundHandler, }: Props) => JSX.Element;
|
|
35
|
+
export declare const ActorFigure: ({ data, isPaused, clickHandler, handleHover, contextClickHandler, orders, overrideSpriteData, noSound, getImageAsset, getSoundAsset, sprites, SoundHandler, highlight, customInteractableStyling, }: Props) => JSX.Element;
|
|
34
36
|
|
|
35
37
|
export declare const ActorPreview: ({ data, overrideSpriteData, scale, noBaseLine, maxHeight, animation, direction, getImageAsset, sprites }: ActorPreviewProps) => JSX.Element;
|
|
36
38
|
|
|
@@ -46,7 +48,7 @@ export declare type ActorPreviewProps = {
|
|
|
46
48
|
sprites: SpriteData[];
|
|
47
49
|
};
|
|
48
50
|
|
|
49
|
-
declare type ActorWithOrdersAndClickHandlers = {
|
|
51
|
+
export declare type ActorWithOrdersAndClickHandlers = {
|
|
50
52
|
data: ActorData;
|
|
51
53
|
orders?: Order[];
|
|
52
54
|
clickHandler?: HandleClickFunction<ActorData>;
|
|
@@ -74,9 +76,32 @@ export declare const ContextualGameRoom: ({ handleTargetContextClick, handleRoom
|
|
|
74
76
|
|
|
75
77
|
export declare const ConversationChoices: () => JSX.Element | null;
|
|
76
78
|
|
|
79
|
+
export declare type CustomInteractableStyling = {
|
|
80
|
+
actor?: {
|
|
81
|
+
highlight?: {
|
|
82
|
+
className?: string;
|
|
83
|
+
css?: SerializedStyles;
|
|
84
|
+
};
|
|
85
|
+
standard?: {
|
|
86
|
+
className?: string;
|
|
87
|
+
css?: SerializedStyles;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
hotspot?: {
|
|
91
|
+
highlight?: {
|
|
92
|
+
className?: string;
|
|
93
|
+
css?: SerializedStyles;
|
|
94
|
+
};
|
|
95
|
+
standard?: {
|
|
96
|
+
className?: string;
|
|
97
|
+
css?: SerializedStyles;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
77
102
|
export declare const DefaultLayout: () => JSX.Element;
|
|
78
103
|
|
|
79
|
-
declare type FileAsset = {
|
|
104
|
+
export declare type FileAsset = {
|
|
80
105
|
id: string;
|
|
81
106
|
href: string;
|
|
82
107
|
originalFileName?: string;
|
|
@@ -128,22 +153,23 @@ getSoundAsset: GetSoundAsset;
|
|
|
128
153
|
SoundHandler?: SoundPlayerComponent;
|
|
129
154
|
allowLocalSaves?: boolean;
|
|
130
155
|
SpeechBubbleComponent?: FunctionComponent<SpeechBubbleProps>;
|
|
156
|
+
customInteractableStyling?: CustomInteractableStyling;
|
|
131
157
|
}>;
|
|
132
158
|
|
|
133
159
|
export declare const GameMetaControls: () => JSX.Element;
|
|
134
160
|
|
|
135
161
|
export declare const GameRoom: FunctionComponent<Props_2>;
|
|
136
162
|
|
|
137
|
-
export declare const GameRunner: ({ gameDesign, Layout, getImageAsset, getSoundAsset, SoundHandler, initialRoomSize, options, SpeechBubbleComponent, }: Props_3) => JSX.Element;
|
|
163
|
+
export declare const GameRunner: ({ gameDesign, Layout, getImageAsset, getSoundAsset, SoundHandler, initialRoomSize, options, SpeechBubbleComponent, customInteractableStyling, }: Props_3) => JSX.Element;
|
|
138
164
|
|
|
139
|
-
declare type GameRunnerOptions = Partial<GameRuntimeOptions> & {
|
|
165
|
+
export declare type GameRunnerOptions = Partial<GameRuntimeOptions> & {
|
|
140
166
|
eventReporter?: InGameEventReporter;
|
|
141
167
|
debugLogger?: LogToDebug;
|
|
142
168
|
allowLocalSaves?: boolean;
|
|
143
169
|
maxCameraMove?: number;
|
|
144
170
|
};
|
|
145
171
|
|
|
146
|
-
declare type GetImageAsset = {
|
|
172
|
+
export declare type GetImageAsset = {
|
|
147
173
|
(id: string): ImageAsset | undefined;
|
|
148
174
|
};
|
|
149
175
|
|
|
@@ -156,7 +182,7 @@ export declare function getLayerHeight(parallax: number, roomData: RoomData): nu
|
|
|
156
182
|
|
|
157
183
|
export declare function getLayerWidth(parallax: number, roomData: RoomData): number;
|
|
158
184
|
|
|
159
|
-
declare type GetSoundAsset = {
|
|
185
|
+
export declare type GetSoundAsset = {
|
|
160
186
|
(id: string): SoundAsset | undefined;
|
|
161
187
|
};
|
|
162
188
|
|
|
@@ -164,11 +190,11 @@ export declare function getXShift(viewAngleX: number, parallax: number, roomData
|
|
|
164
190
|
|
|
165
191
|
export declare function getYShift(viewAngleY: number, parallax: number, roomData: RoomData): number;
|
|
166
192
|
|
|
167
|
-
declare type HandleClickFunction<T extends CommandTarget> = {
|
|
193
|
+
export declare type HandleClickFunction<T extends CommandTarget> = {
|
|
168
194
|
(target: T, event: PointerEvent): void;
|
|
169
195
|
};
|
|
170
196
|
|
|
171
|
-
declare type HandleHoverFunction = {
|
|
197
|
+
export declare type HandleHoverFunction = {
|
|
172
198
|
(target: CommandTarget, event: 'enter' | 'leave'): void;
|
|
173
199
|
};
|
|
174
200
|
|
|
@@ -176,7 +202,7 @@ export declare const HorizontalLine: FunctionComponent<Props_4>;
|
|
|
176
202
|
|
|
177
203
|
export declare const Hotspot: FunctionComponent<Props_5>;
|
|
178
204
|
|
|
179
|
-
declare type ImageAsset = FileAsset & {
|
|
205
|
+
export declare type ImageAsset = FileAsset & {
|
|
180
206
|
category: ImageAssetCategory;
|
|
181
207
|
rows?: number;
|
|
182
208
|
cols?: number;
|
|
@@ -185,7 +211,7 @@ declare type ImageAsset = FileAsset & {
|
|
|
185
211
|
img?: HTMLImageElement;
|
|
186
212
|
};
|
|
187
213
|
|
|
188
|
-
declare type ImageAssetCategory = 'background' | 'item' | 'spriteSheet' | 'any';
|
|
214
|
+
export declare type ImageAssetCategory = 'background' | 'item' | 'spriteSheet' | 'any';
|
|
189
215
|
|
|
190
216
|
/**
|
|
191
217
|
* Renders a figure with the aspect ratio scaled to be contained by its parent, with the sprite
|
|
@@ -239,8 +265,18 @@ declare interface Props {
|
|
|
239
265
|
getSoundAsset: GetSoundAsset;
|
|
240
266
|
sprites: SpriteData[];
|
|
241
267
|
SoundHandler?: SoundPlayerComponent;
|
|
268
|
+
highlight?: boolean;
|
|
269
|
+
customInteractableStyling?: CustomInteractableStyling;
|
|
242
270
|
}
|
|
243
271
|
|
|
272
|
+
declare type Props_10 = {
|
|
273
|
+
page: StoryBoardPage;
|
|
274
|
+
font?: BoardFont;
|
|
275
|
+
getImageAsset: {
|
|
276
|
+
(id: string): ImageAsset | undefined;
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
|
|
244
280
|
declare type Props_2 = {
|
|
245
281
|
gameState: GameData;
|
|
246
282
|
handleTargetClick: HandleClickFunction<CommandTarget>;
|
|
@@ -255,6 +291,7 @@ declare interface Props_3 {
|
|
|
255
291
|
gameDesign: GameDesign;
|
|
256
292
|
Layout?: FunctionComponent;
|
|
257
293
|
SpeechBubbleComponent?: FunctionComponent<SpeechBubbleProps>;
|
|
294
|
+
customInteractableStyling?: CustomInteractableStyling;
|
|
258
295
|
getImageAsset: GetImageAsset;
|
|
259
296
|
getSoundAsset: GetSoundAsset;
|
|
260
297
|
SoundHandler?: SoundPlayerComponent;
|
|
@@ -278,8 +315,8 @@ declare interface Props_5 {
|
|
|
278
315
|
handleHover?: HandleHoverFunction;
|
|
279
316
|
highlight?: boolean;
|
|
280
317
|
markVertices?: boolean;
|
|
281
|
-
flash?: boolean;
|
|
282
318
|
stopPropogation?: boolean;
|
|
319
|
+
customInteractableStyling?: CustomInteractableStyling;
|
|
283
320
|
}
|
|
284
321
|
|
|
285
322
|
declare interface Props_6 {
|
|
@@ -294,16 +331,16 @@ declare interface Props_7 {
|
|
|
294
331
|
}
|
|
295
332
|
|
|
296
333
|
declare interface Props_8 {
|
|
297
|
-
|
|
334
|
+
zone: Zone;
|
|
335
|
+
markVertices?: boolean;
|
|
336
|
+
shapeSerialisedStyle?: SerializedStyles | SerializedStyles[];
|
|
337
|
+
processClick?: MouseEventHandler<SVGElement>;
|
|
338
|
+
processContextClick?: MouseEventHandler<SVGElement>;
|
|
298
339
|
}
|
|
299
340
|
|
|
300
|
-
declare
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
getImageAsset: {
|
|
304
|
-
(id: string): ImageAsset | undefined;
|
|
305
|
-
};
|
|
306
|
-
};
|
|
341
|
+
declare interface Props_9 {
|
|
342
|
+
storyBoard: StoryBoard;
|
|
343
|
+
}
|
|
307
344
|
|
|
308
345
|
export declare const putActorsInDisplayOrder: (a: ActorData, b: ActorData) => number;
|
|
309
346
|
|
|
@@ -330,6 +367,7 @@ export declare interface RoomProps {
|
|
|
330
367
|
handleHover?: HandleHoverFunction;
|
|
331
368
|
renderAllZones?: boolean;
|
|
332
369
|
highlightHotspots?: boolean;
|
|
370
|
+
highlightActors?: boolean;
|
|
333
371
|
obstacleCells?: CellMatrix;
|
|
334
372
|
hotspotIndexToMark?: number;
|
|
335
373
|
obstacleIndexToMark?: number;
|
|
@@ -340,6 +378,7 @@ export declare interface RoomProps {
|
|
|
340
378
|
noSound?: boolean;
|
|
341
379
|
noMargin?: boolean;
|
|
342
380
|
parallaxContent?: ReactNode;
|
|
381
|
+
parallaxBackgroundContent?: ReactNode;
|
|
343
382
|
surfaceContent?: ReactNode;
|
|
344
383
|
orderSpeed?: number;
|
|
345
384
|
sprites: SpriteData[];
|
|
@@ -347,6 +386,7 @@ export declare interface RoomProps {
|
|
|
347
386
|
getSoundAsset: GetSoundAsset;
|
|
348
387
|
SoundHandler?: SoundPlayerComponent;
|
|
349
388
|
SpeechBubbleComponent?: FunctionComponent<SpeechBubbleProps>;
|
|
389
|
+
customInteractableStyling?: CustomInteractableStyling;
|
|
350
390
|
}
|
|
351
391
|
|
|
352
392
|
export declare const RoomRenderContext: Context< {
|
|
@@ -357,20 +397,20 @@ scale: number;
|
|
|
357
397
|
orderSpeed: number;
|
|
358
398
|
}>;
|
|
359
399
|
|
|
360
|
-
declare type SoundAsset = FileAsset & {
|
|
400
|
+
export declare type SoundAsset = FileAsset & {
|
|
361
401
|
category: SoundAssetCategory;
|
|
362
402
|
};
|
|
363
403
|
|
|
364
|
-
declare type SoundAssetCategory = 'sfx' | 'music';
|
|
404
|
+
export declare type SoundAssetCategory = 'sfx' | 'music';
|
|
365
405
|
|
|
366
|
-
declare type SoundPlayerComponent = FunctionComponent<{
|
|
406
|
+
export declare type SoundPlayerComponent = FunctionComponent<{
|
|
367
407
|
soundValues: SoundValue[];
|
|
368
408
|
isPaused: boolean;
|
|
369
409
|
frameIndex?: number;
|
|
370
410
|
getSoundAsset: GetSoundAsset;
|
|
371
411
|
}>;
|
|
372
412
|
|
|
373
|
-
declare type SpeechBubbleProps = {
|
|
413
|
+
export declare type SpeechBubbleProps = {
|
|
374
414
|
actorData: ActorData;
|
|
375
415
|
text: string;
|
|
376
416
|
fromTextBoxLeftToActor: number;
|
|
@@ -379,9 +419,9 @@ declare type SpeechBubbleProps = {
|
|
|
379
419
|
atRightEdge: boolean;
|
|
380
420
|
};
|
|
381
421
|
|
|
382
|
-
export declare const StoryBoardPlayer: React.FunctionComponent<
|
|
422
|
+
export declare const StoryBoardPlayer: React.FunctionComponent<Props_9>;
|
|
383
423
|
|
|
384
|
-
export declare const StoryPageDisplay: FunctionComponent<
|
|
424
|
+
export declare const StoryPageDisplay: FunctionComponent<Props_10>;
|
|
385
425
|
|
|
386
426
|
export declare const SurfaceFrame: ({ children }: Props_6) => JSX.Element;
|
|
387
427
|
|
|
@@ -405,6 +445,9 @@ export declare type UiAction = {
|
|
|
405
445
|
type: 'SET_SCREEN_SIZE';
|
|
406
446
|
height?: number;
|
|
407
447
|
width?: number;
|
|
448
|
+
} | {
|
|
449
|
+
type: 'SET_HIGHLIGHT';
|
|
450
|
+
on: boolean;
|
|
408
451
|
};
|
|
409
452
|
|
|
410
453
|
export declare type UiState = {
|
|
@@ -413,6 +456,7 @@ export declare type UiState = {
|
|
|
413
456
|
hoverTarget?: CommandTarget;
|
|
414
457
|
roomWidth?: number;
|
|
415
458
|
roomHeight?: number;
|
|
459
|
+
highlightOn: boolean;
|
|
416
460
|
};
|
|
417
461
|
|
|
418
462
|
export declare const UiStateContext: Context< {
|
|
@@ -529,15 +573,17 @@ export declare const VerbRadioButton: () => JSX.Element;
|
|
|
529
573
|
|
|
530
574
|
export declare const WalkableOrObstacle: ({ zone, markVertices, zoneType, zoneOptions }: Props_7) => JSX.Element;
|
|
531
575
|
|
|
532
|
-
declare type XY = {
|
|
576
|
+
export declare type XY = {
|
|
533
577
|
x: number;
|
|
534
578
|
y: number;
|
|
535
579
|
};
|
|
536
580
|
|
|
537
|
-
declare interface ZoneOptions {
|
|
581
|
+
export declare interface ZoneOptions {
|
|
538
582
|
disabled?: boolean;
|
|
539
583
|
flash?: boolean;
|
|
540
584
|
blink?: boolean;
|
|
541
585
|
}
|
|
542
586
|
|
|
587
|
+
export declare const ZoneShape: ({ zone, markVertices, shapeSerialisedStyle, processClick, processContextClick, }: Props_8) => JSX.Element;
|
|
588
|
+
|
|
543
589
|
export { }
|