@selimssevgi/cube-design-angular 0.8.0 → 0.9.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/package.json
CHANGED
|
@@ -2330,4 +2330,204 @@ export declare class ReportClient {
|
|
|
2330
2330
|
static ɵfac: i0.ɵɵFactoryDeclaration<ReportClient, never>;
|
|
2331
2331
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2332
2332
|
}
|
|
2333
|
-
|
|
2333
|
+
type Id = string;
|
|
2334
|
+
/**
|
|
2335
|
+
* what a piece is, fixed by the place it was added and never read again (invariant 3):
|
|
2336
|
+
* - `lobby`: a tile of the app's lobby (what the app gives, or a group i made there)
|
|
2337
|
+
* - `domain`: the door from the lobby into my domain, where my tables stand side by side
|
|
2338
|
+
* - `table`: a table of mine in the domain (moments, people)
|
|
2339
|
+
* - `item`: a thing i added to a table's names (a moment, a person)
|
|
2340
|
+
* - `way`: a way of looking at every item of a table (added at the table, or close up)
|
|
2341
|
+
* - `answer`: an answer of a way (added inside it)
|
|
2342
|
+
* where a piece stands later (a way carried into a way i made stands there as its answer) never
|
|
2343
|
+
* changes what it was made as; the screen reads where it stands.
|
|
2344
|
+
*/
|
|
2345
|
+
type Place = 'lobby' | 'domain' | 'table' | 'item' | 'way' | 'answer';
|
|
2346
|
+
interface Piece {
|
|
2347
|
+
id: Id;
|
|
2348
|
+
/** every name it has had, the one in use first; [] is not named yet. */
|
|
2349
|
+
names: string[];
|
|
2350
|
+
hidden: boolean;
|
|
2351
|
+
/** made by the app, never by the person. */
|
|
2352
|
+
given: boolean;
|
|
2353
|
+
place: Place;
|
|
2354
|
+
made: number;
|
|
2355
|
+
/** a table only: every word its names tile has had, the one in use first; none is the default, "names" (round four). */
|
|
2356
|
+
list?: string[];
|
|
2357
|
+
}
|
|
2358
|
+
/** a piece standing in a holder: one row per place. taking out ends it; nothing is deleted. */
|
|
2359
|
+
interface In {
|
|
2360
|
+
piece: Id;
|
|
2361
|
+
holder: Id;
|
|
2362
|
+
order: number;
|
|
2363
|
+
since: number;
|
|
2364
|
+
ended?: number;
|
|
2365
|
+
/** the place it was added (or given); a carry moves it with the piece. */
|
|
2366
|
+
home: boolean;
|
|
2367
|
+
}
|
|
2368
|
+
interface World {
|
|
2369
|
+
top: Id;
|
|
2370
|
+
pieces: Record<Id, Piece>;
|
|
2371
|
+
ins: In[];
|
|
2372
|
+
clock: number;
|
|
2373
|
+
}
|
|
2374
|
+
interface Note {
|
|
2375
|
+
says: string;
|
|
2376
|
+
undo?: World;
|
|
2377
|
+
refused?: boolean;
|
|
2378
|
+
}
|
|
2379
|
+
interface Result {
|
|
2380
|
+
world: World;
|
|
2381
|
+
note?: Note;
|
|
2382
|
+
}
|
|
2383
|
+
type TileKind = 'lobby' | 'group' | 'door' | 'table' | 'list' | 'row' | 'column' | 'option' | 'unknown' | 'choice' | 'hidden' | 'name' | 'add';
|
|
2384
|
+
interface Tile {
|
|
2385
|
+
id: Id;
|
|
2386
|
+
kind: TileKind;
|
|
2387
|
+
name: string;
|
|
2388
|
+
line: string;
|
|
2389
|
+
ticked?: boolean;
|
|
2390
|
+
given?: boolean;
|
|
2391
|
+
holds?: number;
|
|
2392
|
+
}
|
|
2393
|
+
interface Level {
|
|
2394
|
+
path: Id[];
|
|
2395
|
+
title: string;
|
|
2396
|
+
line: string;
|
|
2397
|
+
/** kept for the runner: nothing is ever lifted in round three. */
|
|
2398
|
+
lifted: boolean;
|
|
2399
|
+
tiles: Tile[];
|
|
2400
|
+
}
|
|
2401
|
+
export interface CubePhysicsWords {
|
|
2402
|
+
/** a piece with no name yet ("not named yet"): the app never names. */
|
|
2403
|
+
notNamed: string;
|
|
2404
|
+
/** a table's names tile until i give it a word of mine ("names"). */
|
|
2405
|
+
names: string;
|
|
2406
|
+
/** the pale tile of what was hidden on a level, and its level ("hidden"). */
|
|
2407
|
+
hidden: string;
|
|
2408
|
+
/** inside a way: the items in none of its answers; close up, a way not answered ("not known yet"). */
|
|
2409
|
+
notKnownYet: string;
|
|
2410
|
+
/** the add tile ("add"). */
|
|
2411
|
+
add: string;
|
|
2412
|
+
/** close up, under the item's own name tile ("its name"). */
|
|
2413
|
+
itsName: string;
|
|
2414
|
+
/** close up, a yes or no way the item stands in ("yes"). */
|
|
2415
|
+
yes: string;
|
|
2416
|
+
/** a level whose piece is gone ("not here any more"). */
|
|
2417
|
+
notHereAnyMore: string;
|
|
2418
|
+
/** under a feature's name in the lobby ("what the app keeps here"). */
|
|
2419
|
+
appKeepsHere: string;
|
|
2420
|
+
/** between the first names a tile lists (", "), and after the last when there are more (" …"). */
|
|
2421
|
+
and: string;
|
|
2422
|
+
more: string;
|
|
2423
|
+
/** the refusals: why a move does nothing. */
|
|
2424
|
+
notHere: string;
|
|
2425
|
+
notInsideItself: string;
|
|
2426
|
+
notWithItself: string;
|
|
2427
|
+
standsOnItsOwn: string;
|
|
2428
|
+
eachOnItsOwn: string;
|
|
2429
|
+
domainHoldsTables: string;
|
|
2430
|
+
domainHoldsThings: string;
|
|
2431
|
+
lobbyIsTheApp: string;
|
|
2432
|
+
tablesSideBySide: string;
|
|
2433
|
+
inOneOfItsAnswers: string;
|
|
2434
|
+
notInThisTable: string;
|
|
2435
|
+
staysWhereMade: string;
|
|
2436
|
+
needsOnePlace: string;
|
|
2437
|
+
staysWhereGiven: string;
|
|
2438
|
+
neverOutOfHome: string;
|
|
2439
|
+
/** the quiet line after a move (with undo): names in use filled in. */
|
|
2440
|
+
stoodIn: (piece: string, onto: string) => string;
|
|
2441
|
+
madeOne: (name: string, a: string, b: string, way: string) => string;
|
|
2442
|
+
movedInto: (piece: string, to: string) => string;
|
|
2443
|
+
hiddenKept: (piece: string) => string;
|
|
2444
|
+
shownAgain: (piece: string) => string;
|
|
2445
|
+
}
|
|
2446
|
+
/** a step: the names of the table before it (the items). an id, never shown. */
|
|
2447
|
+
declare const NAMES = "names";
|
|
2448
|
+
/** a step: the pale tile of what was hidden on the level before it (F1). */
|
|
2449
|
+
declare const HIDDEN = "hidden";
|
|
2450
|
+
/** a step: inside a way, the items in none of its answers. */
|
|
2451
|
+
declare const UNKNOWN = "unknown";
|
|
2452
|
+
/** a step: close up, one way with answers asked of the item (choice:<way>). */
|
|
2453
|
+
declare const CHOICE = "choice:";
|
|
2454
|
+
/** the names tile of a table is held as `names:<table>`; its word is mine, the app's default until i say. */
|
|
2455
|
+
declare const LIST = "names:";
|
|
2456
|
+
declare const isToken: (s: string) => boolean;
|
|
2457
|
+
type Role = 'lobby' | 'domain' | 'table' | 'names' | 'item' | 'way' | 'answer' | 'hidden' | 'unknown' | 'choice';
|
|
2458
|
+
/**
|
|
2459
|
+
* the physics, speaking the app's words. every reading and move is pure: it takes a world and gives
|
|
2460
|
+
* back a level, or a new world with what to say (a note, with the world before it for undo).
|
|
2461
|
+
*/
|
|
2462
|
+
export declare function cubePhysics(words: CubePhysicsWords): {
|
|
2463
|
+
listWords: (w: World, t: Id) => string[];
|
|
2464
|
+
nameOf: (w: World, id: Id) => string;
|
|
2465
|
+
placeOf: (w: World, id: Id) => Place | null;
|
|
2466
|
+
partsIn: (w: World, holder: Id, hidden?: boolean) => Id[];
|
|
2467
|
+
holdersOf: (w: World, id: Id) => string[];
|
|
2468
|
+
stands: (w: World, piece: Id, holder: Id) => boolean;
|
|
2469
|
+
homeOf: (w: World, id: Id) => Id | null;
|
|
2470
|
+
lobbyZone: (w: World, id: Id) => boolean;
|
|
2471
|
+
itemsOf: (w: World, t: Id) => string[];
|
|
2472
|
+
tableOf: (w: World, id: Id) => Id | null;
|
|
2473
|
+
domainOf: (w: World, id: Id) => Id | null;
|
|
2474
|
+
tablesIn: (w: World, d: Id, hidden?: boolean) => string[];
|
|
2475
|
+
waysOf: (w: World, t: Id, hidden?: boolean) => string[];
|
|
2476
|
+
answersOf: (w: World, way: Id, t?: Id | null, hidden?: boolean) => Id[];
|
|
2477
|
+
shared: (w: World, way: Id) => boolean;
|
|
2478
|
+
siblings: (w: World, a: Id, b: Id) => boolean;
|
|
2479
|
+
outOf: (path: Id[]) => Id[];
|
|
2480
|
+
roleAt: (w: World, path: Id[]) => Role;
|
|
2481
|
+
contextTable: (w: World, path: Id[]) => Id | null;
|
|
2482
|
+
walksThrough: (_w: World, _path: Id[]) => boolean;
|
|
2483
|
+
choicesOf: (w: World, item: Id, t: Id) => Tile[];
|
|
2484
|
+
linkedTables: (w: World, _item: Id, t: Id) => Id[];
|
|
2485
|
+
hiddenOf: (w: World, path: Id[]) => Id[];
|
|
2486
|
+
stepOf: (t: Tile) => string | null;
|
|
2487
|
+
stepsInto: (w: World, path: Id[], t: Tile) => string[] | null;
|
|
2488
|
+
levelAt: (w: World, path: Id[]) => Level;
|
|
2489
|
+
livesIn: (w: World, id: Id) => string;
|
|
2490
|
+
lobbyLinkable: (w: World, holder: Id) => Id[];
|
|
2491
|
+
pathTo: (w: World, id: Id) => Id[] | null;
|
|
2492
|
+
pathInto: (w: World, path: Id[], t: Tile) => Id[] | null;
|
|
2493
|
+
addAt: (w: World, at: string, name: string, given?: boolean) => Result;
|
|
2494
|
+
dropIn: (w: World, piece: Id, onto: Id, path: Id[]) => Result;
|
|
2495
|
+
makeOne: (w: World, a: Id, b: Id, path: Id[], name?: string) => Result;
|
|
2496
|
+
placeRefusal: (w: World, piece: Id, holder: Id) => string | null;
|
|
2497
|
+
placeAlso: (w: World, piece: Id, holder: Id) => Result;
|
|
2498
|
+
givenAt: (w: World, id: Id) => Id | null;
|
|
2499
|
+
takeOutRefusal: (w: World, piece: Id, holder: Id) => string | null;
|
|
2500
|
+
takeOut: (w: World, piece: Id, holder: Id) => Result;
|
|
2501
|
+
pick: (w: World, item: Id, _way: Id, answer: Id) => Result;
|
|
2502
|
+
linkable: (w: World, item: Id, t: Id) => Id[];
|
|
2503
|
+
linked: (w: World, a: Id, b: Id) => boolean;
|
|
2504
|
+
link: (w: World, a: Id, b: Id) => Result;
|
|
2505
|
+
rename: (w: World, piece: Id, name: string) => Result;
|
|
2506
|
+
hide: (w: World, piece: Id) => Result;
|
|
2507
|
+
show: (w: World, piece: Id) => Result;
|
|
2508
|
+
undo: (note: Note) => Result;
|
|
2509
|
+
settle: (_w: World, _left: Id, _before: World) => Result | null;
|
|
2510
|
+
build: {
|
|
2511
|
+
make: (w: World, at: Id, name: string | null, p: Place, given?: boolean) => Id;
|
|
2512
|
+
stand: (w: World, piece: Id, holder: Id, home?: boolean) => void;
|
|
2513
|
+
};
|
|
2514
|
+
model: {
|
|
2515
|
+
levelAt: (w: World, path: Id[]) => Level;
|
|
2516
|
+
outOf: (path: Id[]) => Id[];
|
|
2517
|
+
add: (w: World, at: string, name: string, given?: boolean) => Result;
|
|
2518
|
+
dropIn: (w: World, piece: Id, onto: Id, path: Id[]) => Result;
|
|
2519
|
+
makeOne: (w: World, a: Id, b: Id, path: Id[], name?: string) => Result;
|
|
2520
|
+
placeAlso: (w: World, piece: Id, holder: Id) => Result;
|
|
2521
|
+
takeOut: (w: World, piece: Id, holder: Id) => Result;
|
|
2522
|
+
pick: (w: World, item: Id, _way: Id, answer: Id) => Result;
|
|
2523
|
+
link: (w: World, a: Id, b: Id) => Result;
|
|
2524
|
+
rename: (w: World, piece: Id, name: string) => Result;
|
|
2525
|
+
hide: (w: World, piece: Id) => Result;
|
|
2526
|
+
show: (w: World, piece: Id) => Result;
|
|
2527
|
+
undo: (note: Note) => Result;
|
|
2528
|
+
settle: (_w: World, _left: Id, _before: World) => Result | null;
|
|
2529
|
+
};
|
|
2530
|
+
};
|
|
2531
|
+
/** the physics an app made with its words (`cubePhysics(words)`). */
|
|
2532
|
+
type CubePhysics = ReturnType<typeof cubePhysics>;
|
|
2533
|
+
export { type ArtDrawing, type ArtOptions, type ArtShape, type CubeArt, type CubePhysics, type DrawnArt, CHOICE as PHYSICS_CHOICE, HIDDEN as PHYSICS_HIDDEN, LIST as PHYSICS_LIST, NAMES as PHYSICS_NAMES, UNKNOWN as PHYSICS_UNKNOWN, type Id as PhysicsId, type In as PhysicsIn, type Level as PhysicsLevel, type Note as PhysicsNote, type Piece as PhysicsPiece, type Place as PhysicsPlace, type Result as PhysicsResult, type Role as PhysicsRole, type Tile as PhysicsTile, type TileKind as PhysicsTileKind, type World as PhysicsWorld, isToken as isPhysicsToken };
|