@selimssevgi/cube-design-angular 0.7.0 → 0.8.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/CHANGELOG.md +15 -0
- package/README.md +15 -2
- package/fesm2022/selimssevgi-cube-design-angular.mjs +1369 -10
- package/fesm2022/selimssevgi-cube-design-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/tokens/dark.css +22 -0
- package/tokens/light.css +22 -0
- package/types/selimssevgi-cube-design-angular.d.ts +564 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ErrorHandler, InjectionToken, Provider, TemplateRef } from "@angular/core";
|
|
2
|
+
import { ErrorHandler, InjectionToken, OnDestroy, Provider, TemplateRef } from "@angular/core";
|
|
3
|
+
import { Observable } from "rxjs";
|
|
3
4
|
import { HttpInterceptorFn } from "@angular/common/http";
|
|
4
5
|
import { ActivatedRouteSnapshot } from "@angular/router";
|
|
5
|
-
import { Observable } from "rxjs";
|
|
6
6
|
/**
|
|
7
7
|
* drawing a cube of small cubes in isometric view: the left, right and top faces, each split into
|
|
8
8
|
* n × n stickers. a sticker is coloured by a piece, or pale while nothing is known for it.
|
|
@@ -268,7 +268,7 @@ export interface CubePinched {
|
|
|
268
268
|
* firefox send a trackpad's pinch; `gesture`: safari's own gesture events for a trackpad's pinch.
|
|
269
269
|
*/
|
|
270
270
|
via: 'touch' | 'wheel' | 'gesture';
|
|
271
|
-
/** the event that decided it: the `pointerup`, the first `wheel`
|
|
271
|
+
/** the event that decided it: the `pointerup`, the stream's first real `wheel` step, the `gestureend`. */
|
|
272
272
|
event: Event;
|
|
273
273
|
}
|
|
274
274
|
/** two fingers this much further apart than they started is a pinch in (cubes', mosaic's, anlat's). */
|
|
@@ -286,6 +286,19 @@ export declare const CUBE_WHEEL_QUIET_MS = 250;
|
|
|
286
286
|
* the same rule.
|
|
287
287
|
*/
|
|
288
288
|
export declare function startsWheelGesture(lastAt: number, now: number, quietMs?: number): boolean;
|
|
289
|
+
/**
|
|
290
|
+
* the least `deltaY` of one ctrl + wheel event that decides a pinch's way. a trackpad begins a pinch
|
|
291
|
+
* with a still event (0) or the fingers settling the other way (-1) before the real steps come, so a
|
|
292
|
+
* smaller step only moves the stream's end (the every-level prototype's rule, 6 nov 2026).
|
|
293
|
+
*/
|
|
294
|
+
export declare const CUBE_WHEEL_STEP = 2;
|
|
295
|
+
/**
|
|
296
|
+
* which way a ctrl + wheel stream that has not decided yet goes, given its event's `deltaY` and the
|
|
297
|
+
* sum of the stream's deltas so far, this one counted: the first step of at least `least` decides
|
|
298
|
+
* by its own sign; a slow pinch of small steps decides once they add up to three times `least`;
|
|
299
|
+
* else not yet (null). pure, so an app with a wheel of its own reads a stream the same way.
|
|
300
|
+
*/
|
|
301
|
+
export declare function wheelWay(deltaY: number, sum: number, least?: number): 'in' | 'out' | null;
|
|
289
302
|
/**
|
|
290
303
|
* the pinch (principle 25, two fingers together is one level out): fingers apart on a piece raise
|
|
291
304
|
* one `cubePinched` with `way: 'in'`, fingers together one with `way: 'out'`. on a computer a
|
|
@@ -1122,6 +1135,21 @@ export declare function squareLayout(view: ViewKey, count: number, room: SquareR
|
|
|
1122
1135
|
listRow?: number;
|
|
1123
1136
|
least?: number;
|
|
1124
1137
|
}): SquareLayout;
|
|
1138
|
+
/**
|
|
1139
|
+
* the one tile size on a screen (0.8.0): the cell of `across` tiles in `width` px, with the gap a
|
|
1140
|
+
* square of that many across has. every square on the screen given this `cell` draws its tiles at
|
|
1141
|
+
* it, whatever its count or view, the context cube's too (selim, 6 november 2026: the tiles got
|
|
1142
|
+
* smaller between the lobby, all and a thing, "a problem also in current prod apps").
|
|
1143
|
+
*/
|
|
1144
|
+
export declare function squareCell(width: number, across: number): number;
|
|
1145
|
+
/**
|
|
1146
|
+
* the side a square of `count` tiles in `view` (at least `least` across) takes to draw each at
|
|
1147
|
+
* `cell` px: what `[cell]` gives `<cube-square>` as its `maxSide` (0.8.0; the every-level page's
|
|
1148
|
+
* `sizes.ts`, moved in).
|
|
1149
|
+
*/
|
|
1150
|
+
export declare function squareSideAt(view: ViewKey, count: number, cell: number, opts?: {
|
|
1151
|
+
least?: number;
|
|
1152
|
+
}): number;
|
|
1125
1153
|
/** what a tile's template is given. */
|
|
1126
1154
|
export interface CubeSquareTileContext<T> {
|
|
1127
1155
|
/** the tile, as the app gave it. */
|
|
@@ -1176,6 +1204,13 @@ export declare class CubeSquare<T> {
|
|
|
1176
1204
|
readonly view: import("@angular/core").InputSignal<ViewKey>;
|
|
1177
1205
|
/** the largest side the square takes on a wide screen, in px. */
|
|
1178
1206
|
readonly maxSide: import("@angular/core").InputSignal<number>;
|
|
1207
|
+
/**
|
|
1208
|
+
* one tile size on every screen (0.8.0): each tile drawn `cell` px wide, whatever the count or the
|
|
1209
|
+
* view (`squareSideAt`), never wider than `maxSide` nor the room. null (the default) sizes the
|
|
1210
|
+
* tiles from the room, as before. give every square on a screen the same cell (`squareCell`,
|
|
1211
|
+
* `CubeRoom`).
|
|
1212
|
+
*/
|
|
1213
|
+
readonly cell: import("@angular/core").InputSignal<number | null>;
|
|
1179
1214
|
/**
|
|
1180
1215
|
* where a square narrower than its place stands (0.6.2): `'center'` (the default) in the middle,
|
|
1181
1216
|
* its spare width shared on both sides, `'start'` at the start, as before 0.6.2. a square is
|
|
@@ -1275,6 +1310,11 @@ export declare class CubeSquare<T> {
|
|
|
1275
1310
|
"required": false;
|
|
1276
1311
|
"isSignal": true;
|
|
1277
1312
|
};
|
|
1313
|
+
"cell": {
|
|
1314
|
+
"alias": "cell";
|
|
1315
|
+
"required": false;
|
|
1316
|
+
"isSignal": true;
|
|
1317
|
+
};
|
|
1278
1318
|
"align": {
|
|
1279
1319
|
"alias": "align";
|
|
1280
1320
|
"required": false;
|
|
@@ -1381,6 +1421,11 @@ export declare class CubeContext {
|
|
|
1381
1421
|
readonly words: import("@angular/core").InputSignal<ContextWords | null>;
|
|
1382
1422
|
/** the largest side the square takes on a wide screen, in px. */
|
|
1383
1423
|
readonly maxSide: import("@angular/core").InputSignal<number>;
|
|
1424
|
+
/**
|
|
1425
|
+
* one tile size on every screen (0.8.0): its tiles drawn `cell` px wide, as the level's square
|
|
1426
|
+
* beside it (`<cube-square [cell]>`, `CubeRoom.cell()`); null sizes them from the room.
|
|
1427
|
+
*/
|
|
1428
|
+
readonly cell: import("@angular/core").InputSignal<number | null>;
|
|
1384
1429
|
/**
|
|
1385
1430
|
* what keeps the held thing the same thing while a pick is answered (itself by default). an app
|
|
1386
1431
|
* whose store gives a new object when the pick changes it (a rename, a hide) passes its id here, or
|
|
@@ -1446,6 +1491,11 @@ export declare class CubeContext {
|
|
|
1446
1491
|
"required": false;
|
|
1447
1492
|
"isSignal": true;
|
|
1448
1493
|
};
|
|
1494
|
+
"cell": {
|
|
1495
|
+
"alias": "cell";
|
|
1496
|
+
"required": false;
|
|
1497
|
+
"isSignal": true;
|
|
1498
|
+
};
|
|
1449
1499
|
"heldKey": {
|
|
1450
1500
|
"alias": "heldKey";
|
|
1451
1501
|
"required": false;
|
|
@@ -1478,6 +1528,517 @@ export interface TurningRows<T> {
|
|
|
1478
1528
|
/** the sides of one row: its front and the three behind it. */
|
|
1479
1529
|
export declare const TURNING_SIDES = 4;
|
|
1480
1530
|
export declare function turningRows<T>(pieces: readonly T[], own: T | null, cols?: number, rows?: number): TurningRows<T>;
|
|
1531
|
+
/** below this width a screen is a phone: three tiles across; from it, four (0.8.0). */
|
|
1532
|
+
export declare const CUBE_ROOM_NARROW = 640;
|
|
1533
|
+
/**
|
|
1534
|
+
* the room a screen's squares share (0.8.0): the width the square has (the column beside or below
|
|
1535
|
+
* the head, the same on every level), measured by `[cubeRoom]`, and from it the one tile size
|
|
1536
|
+
* (`cell()`) every square on the screen is given, `<cube-square [cell]>` and `<cube-context [cell]>`
|
|
1537
|
+
* alike. three across on a phone, four from 640 px. the every-level model page's `sizes.ts`, moved
|
|
1538
|
+
* in; one per app (root).
|
|
1539
|
+
*/
|
|
1540
|
+
export declare class CubeRoom {
|
|
1541
|
+
/** the width a square has on this screen, at most `SQUARE_MAX_SIDE`; 0 before the first measure. */
|
|
1542
|
+
readonly width: import("@angular/core").WritableSignal<number>;
|
|
1543
|
+
/** a phone: narrower than `CUBE_ROOM_NARROW`. */
|
|
1544
|
+
readonly narrow: import("@angular/core").WritableSignal<boolean>;
|
|
1545
|
+
constructor();
|
|
1546
|
+
private static isNarrow;
|
|
1547
|
+
/** tiles across on this screen. */
|
|
1548
|
+
across(): number;
|
|
1549
|
+
/** the one tile size on this screen, in px, or 0 before the first measure. */
|
|
1550
|
+
cell(): number;
|
|
1551
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CubeRoom, never>;
|
|
1552
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1553
|
+
}
|
|
1554
|
+
/**
|
|
1555
|
+
* `[cubeRoom]` on the element that holds a screen's square: its width is the room every square on
|
|
1556
|
+
* the screen has (`CubeRoom.width`), measured when it is drawn and whenever it changes size.
|
|
1557
|
+
*/
|
|
1558
|
+
export declare class CubeRoomMeasure implements OnDestroy {
|
|
1559
|
+
private readonly room;
|
|
1560
|
+
private readonly el;
|
|
1561
|
+
private readonly seen;
|
|
1562
|
+
constructor();
|
|
1563
|
+
private measure;
|
|
1564
|
+
ngOnDestroy(): void;
|
|
1565
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CubeRoomMeasure, never>;
|
|
1566
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CubeRoomMeasure, "[cubeRoom]", never, {}, {}, never, never, true, never>;
|
|
1567
|
+
}
|
|
1568
|
+
/** what the zoom does beyond the trail; `provideCubeZoom` sets it. */
|
|
1569
|
+
export interface CubeZoomOptions {
|
|
1570
|
+
/**
|
|
1571
|
+
* a step out puts the page back where the level was left, and holds it there while the level
|
|
1572
|
+
* settles (mosaic's RC-2). true by default; false leaves the scroll to the app.
|
|
1573
|
+
*/
|
|
1574
|
+
keepScroll: boolean;
|
|
1575
|
+
}
|
|
1576
|
+
export declare const CUBE_ZOOM_OPTIONS: InjectionToken<CubeZoomOptions>;
|
|
1577
|
+
/** `providers: [provideCubeZoom({ keepScroll: false })]` in an app's config. */
|
|
1578
|
+
export declare function provideCubeZoom(options: Partial<CubeZoomOptions>): {
|
|
1579
|
+
provide: InjectionToken<CubeZoomOptions>;
|
|
1580
|
+
useValue: {
|
|
1581
|
+
keepScroll: boolean;
|
|
1582
|
+
};
|
|
1583
|
+
};
|
|
1584
|
+
/**
|
|
1585
|
+
* "i left this level": a step out through the cube (`stepBack`, `leaveAll`), said before the
|
|
1586
|
+
* navigation. `from` is the address being left, `to` where the step goes (null when the app goes
|
|
1587
|
+
* by place, not by the trail, and did not say where). an app reads what the person did inside a
|
|
1588
|
+
* level here, when they leave it, never while they are in it (the every-level model's reading).
|
|
1589
|
+
*/
|
|
1590
|
+
export interface CubeLeft {
|
|
1591
|
+
from: string;
|
|
1592
|
+
to: string | null;
|
|
1593
|
+
/** one step out (`stepBack`), or out of a whole stretch at once (`leaveAll`). */
|
|
1594
|
+
via: 'step' | 'all';
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* Whether an event is the person moving the page, so the kept scroll lets go of it. The step out
|
|
1598
|
+
* itself is not: a trackpad's pinch (ctrl and the wheel) goes on after the level it stepped out of
|
|
1599
|
+
* is gone, and the escape that stepped out is still on its way up when the level is back (RC-5,
|
|
1600
|
+
* RC-7: both landed at the top on a computer).
|
|
1601
|
+
*/
|
|
1602
|
+
export declare function cubeMovesThePage(e: Event, since: number): boolean;
|
|
1603
|
+
/**
|
|
1604
|
+
* Whether the trail still says the way the person came, when they go from `from` to `to`: only when
|
|
1605
|
+
* they step on from the last screen they left through the cube, or go back to one on the trail. A
|
|
1606
|
+
* screen reached another way (a menu, a tab, the address bar) starts a new way, so ‹ never names a
|
|
1607
|
+
* place left long ago (UAT mosaic-14: "‹ lately" after opening todarch from the menu).
|
|
1608
|
+
*/
|
|
1609
|
+
export declare function cubeTrailHolds(trail: readonly {
|
|
1610
|
+
url: string;
|
|
1611
|
+
}[], from: string, to: string): boolean;
|
|
1612
|
+
export interface CubeEntrance {
|
|
1613
|
+
kind: 'in' | 'out';
|
|
1614
|
+
/** Where the screen grows from: the middle of the tile that was opened. */
|
|
1615
|
+
origin: string | null;
|
|
1616
|
+
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Moving through the cube is a change of distance, never of place (Anlat's `zoom.ts`): the next
|
|
1619
|
+
* screen grows out of the piece that was opened, or settles from closer when stepping out. It
|
|
1620
|
+
* also keeps the way the person came, so back goes the way they came.
|
|
1621
|
+
*/
|
|
1622
|
+
export declare class CubeZoomService {
|
|
1623
|
+
private next;
|
|
1624
|
+
private readonly trail;
|
|
1625
|
+
/** Where each screen left through the cube was scrolled to, so stepping out finds it there. */
|
|
1626
|
+
private readonly scrolled;
|
|
1627
|
+
/** The scroll to put back once the screen being stepped out to has been drawn (RC-2). */
|
|
1628
|
+
private restore;
|
|
1629
|
+
/**
|
|
1630
|
+
* Where the last step out through the cube goes (`stepBack`, `leaveAll`), taken off the trail just
|
|
1631
|
+
* before the navigation: going there is the way i came, so the trail is kept (RC-3).
|
|
1632
|
+
*/
|
|
1633
|
+
private steppingOutTo;
|
|
1634
|
+
private readonly options;
|
|
1635
|
+
private readonly router;
|
|
1636
|
+
private readonly leaving;
|
|
1637
|
+
/** "i left this level", once a step out (see `CubeLeft`). */
|
|
1638
|
+
readonly left: Observable<CubeLeft>;
|
|
1639
|
+
constructor();
|
|
1640
|
+
leave(url: string, label: string): void;
|
|
1641
|
+
/**
|
|
1642
|
+
* Puts the page back at `top` and holds it there while the level settles: the screen left is
|
|
1643
|
+
* taken away, the level grows in from closer and may still be loading, and each of those moves
|
|
1644
|
+
* the page. It lets go once the page has stood still at `top` for a moment, after a short while
|
|
1645
|
+
* at most, or as soon as a finger, the wheel or a key moves it (never the pinch or the escape that
|
|
1646
|
+
* stepped out, `cubeMovesThePage`), or the next navigation starts.
|
|
1647
|
+
*/
|
|
1648
|
+
private scrollBack;
|
|
1649
|
+
/** The screen back would go to, if the person came here from one. */
|
|
1650
|
+
previous(url: string): {
|
|
1651
|
+
url: string;
|
|
1652
|
+
label: string;
|
|
1653
|
+
} | null;
|
|
1654
|
+
/**
|
|
1655
|
+
* one step out, the way i came: the screen being stepped out to comes off the trail. `to` is
|
|
1656
|
+
* where the app goes when the trail is empty (one level out by place), so `left` can say it.
|
|
1657
|
+
*/
|
|
1658
|
+
stepBack(to?: string): void;
|
|
1659
|
+
/**
|
|
1660
|
+
* Out of a whole stretch at once (a context cube, after its journey ended): the screens on the
|
|
1661
|
+
* trail that `inside` says are part of it are passed by, and the one before them is where it goes.
|
|
1662
|
+
*/
|
|
1663
|
+
leaveAll(inside: (url: string) => boolean): {
|
|
1664
|
+
url: string;
|
|
1665
|
+
label: string;
|
|
1666
|
+
} | null;
|
|
1667
|
+
into(element: Element | null): void;
|
|
1668
|
+
outOf(): void;
|
|
1669
|
+
/** The way the screen opening now comes in, once. */
|
|
1670
|
+
take(): CubeEntrance | null;
|
|
1671
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CubeZoomService, never>;
|
|
1672
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1673
|
+
}
|
|
1674
|
+
/**
|
|
1675
|
+
* `cubeZoomPinch`: a pinch on a screen of the cube goes where the cube goes. fingers apart on a
|
|
1676
|
+
* piece goes into it (the nearest `[data-zoom]` under the fingers is tapped), fingers together says
|
|
1677
|
+
* `cubeZoomOut`, where the app steps out the way i came. the gesture is `cubePinch` (one pinch is
|
|
1678
|
+
* one level, however long a trackpad's stream), worn as a host directive.
|
|
1679
|
+
*/
|
|
1680
|
+
export declare class CubeZoomPinch {
|
|
1681
|
+
private readonly host;
|
|
1682
|
+
readonly cubeZoomOut: import("@angular/core").OutputEmitterRef<void>;
|
|
1683
|
+
constructor();
|
|
1684
|
+
private zoomInto;
|
|
1685
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CubeZoomPinch, never>;
|
|
1686
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CubeZoomPinch, "[cubeZoomPinch]", never, {}, {
|
|
1687
|
+
"cubeZoomOut": "cubeZoomOut";
|
|
1688
|
+
}, never, never, true, [{
|
|
1689
|
+
directive: typeof CubePinch;
|
|
1690
|
+
inputs: {
|
|
1691
|
+
"cubePinchDisabled": "cubePinchDisabled";
|
|
1692
|
+
"cubePinchQuietMs": "cubePinchQuietMs";
|
|
1693
|
+
};
|
|
1694
|
+
outputs: {};
|
|
1695
|
+
}]>;
|
|
1696
|
+
}
|
|
1697
|
+
/** how far a finger goes sideways to turn the head's cube, in px. */
|
|
1698
|
+
export declare const CUBE_HEAD_SWIPE = 30;
|
|
1699
|
+
/**
|
|
1700
|
+
* `<cube-head>`: the top of every level of a cube (0.8.0). one step out (‹ and where it goes back
|
|
1701
|
+
* to), the level's cube in its circle, its name and its line, and a place under them for what the
|
|
1702
|
+
* app says once (the quiet line, `<cube-quiet>`, or "this cube grew"), given as content. mosaic
|
|
1703
|
+
* wrote it (lang-app-fe `shared/cube/cube-head` and `core/groups/level/groups-head`), todarch and
|
|
1704
|
+
* the every-level model page copied it; this is the one they share.
|
|
1705
|
+
*
|
|
1706
|
+
* it says no words: the back label, its aria label, the name and the line are the app's. held,
|
|
1707
|
+
* the cube says `held` (the app opens its context cube); with two pieces or more and `turns`, a
|
|
1708
|
+
* sideways swipe or an arrow key turns it. a carried piece can be dropped on ‹ when the app gives
|
|
1709
|
+
* `backDrop` (it is a `data-drop` place for `cubeCarry`). its look is css variables
|
|
1710
|
+
* (`--cube-head-*`), set in both token files. on a phone it stands on top; the app's split puts it
|
|
1711
|
+
* beside the square from 900 px: its host is `display: contents`, so its parts are the split's.
|
|
1712
|
+
*/
|
|
1713
|
+
export declare class CubeHead {
|
|
1714
|
+
/** the level's cube: how many stickers, their colours (null is not known yet), its art. */
|
|
1715
|
+
readonly count: import("@angular/core").InputSignal<number>;
|
|
1716
|
+
readonly colours: import("@angular/core").InputSignal<(string | null)[]>;
|
|
1717
|
+
readonly art: import("@angular/core").InputSignal<CubeArt>;
|
|
1718
|
+
readonly whole: import("@angular/core").InputSignal<boolean>;
|
|
1719
|
+
readonly hint: import("@angular/core").InputSignal<boolean>;
|
|
1720
|
+
/** the cube's width in px; the circle around it is `--cube-head-circle-size`. */
|
|
1721
|
+
readonly width: import("@angular/core").InputSignal<number>;
|
|
1722
|
+
/**
|
|
1723
|
+
* the level's name (an `h1`) and its line, the app's words. with a name, the line's place is kept
|
|
1724
|
+
* on a phone even when it says nothing; with neither, neither is drawn.
|
|
1725
|
+
*/
|
|
1726
|
+
readonly title: import("@angular/core").InputSignal<string | null>;
|
|
1727
|
+
readonly line: import("@angular/core").InputSignal<string | null>;
|
|
1728
|
+
/** where ‹ goes back to, in the app's words; null draws no ‹. */
|
|
1729
|
+
readonly backLabel: import("@angular/core").InputSignal<string | null>;
|
|
1730
|
+
/** what a screen reader hears for ‹ (the app's words: "back to moments"); the label by default. */
|
|
1731
|
+
readonly backAria: import("@angular/core").InputSignal<string | null>;
|
|
1732
|
+
/** ‹ is a place a carried piece can be dropped on: its `data-drop` key; null is not. */
|
|
1733
|
+
readonly backDrop: import("@angular/core").InputSignal<string | null>;
|
|
1734
|
+
/** something is being carried now: ‹ with a `backDrop` is marked as a place to drop. */
|
|
1735
|
+
readonly carrying: import("@angular/core").InputSignal<boolean>;
|
|
1736
|
+
/** a press and hold on the cube says `held`; off unless asked. */
|
|
1737
|
+
readonly holds: import("@angular/core").InputSignal<boolean>;
|
|
1738
|
+
/** how long a hold takes, in ms (`cubeHoldMs`). */
|
|
1739
|
+
readonly holdMs: import("@angular/core").InputSignal<number>;
|
|
1740
|
+
/** with two pieces or more, a sideways swipe or an arrow key turns the cube. */
|
|
1741
|
+
readonly turns: import("@angular/core").InputSignal<boolean>;
|
|
1742
|
+
/** the app changes the look itself on a turn (`turned`); otherwise the colours move one on. */
|
|
1743
|
+
readonly regroups: import("@angular/core").InputSignal<boolean>;
|
|
1744
|
+
/** the cube grows in, once (something was added to it). */
|
|
1745
|
+
readonly grew: import("@angular/core").InputSignal<boolean>;
|
|
1746
|
+
readonly back: import("@angular/core").OutputEmitterRef<void>;
|
|
1747
|
+
readonly held: import("@angular/core").OutputEmitterRef<CubeHeld>;
|
|
1748
|
+
/** a turn, at its middle when the side is edge on: 1 forward, -1 back. */
|
|
1749
|
+
readonly turned: import("@angular/core").OutputEmitterRef<1 | -1>;
|
|
1750
|
+
protected readonly rot: import("@angular/core").WritableSignal<number>;
|
|
1751
|
+
protected readonly turning: import("@angular/core").WritableSignal<boolean>;
|
|
1752
|
+
protected startX: number | null;
|
|
1753
|
+
private readonly timers;
|
|
1754
|
+
constructor();
|
|
1755
|
+
protected start(event: PointerEvent): void;
|
|
1756
|
+
protected end(event: PointerEvent): void;
|
|
1757
|
+
protected key(event: KeyboardEvent): void;
|
|
1758
|
+
private turn;
|
|
1759
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CubeHead, never>;
|
|
1760
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CubeHead, "cube-head", never, {
|
|
1761
|
+
"count": {
|
|
1762
|
+
"alias": "count";
|
|
1763
|
+
"required": false;
|
|
1764
|
+
"isSignal": true;
|
|
1765
|
+
};
|
|
1766
|
+
"colours": {
|
|
1767
|
+
"alias": "colours";
|
|
1768
|
+
"required": false;
|
|
1769
|
+
"isSignal": true;
|
|
1770
|
+
};
|
|
1771
|
+
"art": {
|
|
1772
|
+
"alias": "art";
|
|
1773
|
+
"required": false;
|
|
1774
|
+
"isSignal": true;
|
|
1775
|
+
};
|
|
1776
|
+
"whole": {
|
|
1777
|
+
"alias": "whole";
|
|
1778
|
+
"required": false;
|
|
1779
|
+
"isSignal": true;
|
|
1780
|
+
};
|
|
1781
|
+
"hint": {
|
|
1782
|
+
"alias": "hint";
|
|
1783
|
+
"required": false;
|
|
1784
|
+
"isSignal": true;
|
|
1785
|
+
};
|
|
1786
|
+
"width": {
|
|
1787
|
+
"alias": "width";
|
|
1788
|
+
"required": false;
|
|
1789
|
+
"isSignal": true;
|
|
1790
|
+
};
|
|
1791
|
+
"title": {
|
|
1792
|
+
"alias": "title";
|
|
1793
|
+
"required": false;
|
|
1794
|
+
"isSignal": true;
|
|
1795
|
+
};
|
|
1796
|
+
"line": {
|
|
1797
|
+
"alias": "line";
|
|
1798
|
+
"required": false;
|
|
1799
|
+
"isSignal": true;
|
|
1800
|
+
};
|
|
1801
|
+
"backLabel": {
|
|
1802
|
+
"alias": "backLabel";
|
|
1803
|
+
"required": false;
|
|
1804
|
+
"isSignal": true;
|
|
1805
|
+
};
|
|
1806
|
+
"backAria": {
|
|
1807
|
+
"alias": "backAria";
|
|
1808
|
+
"required": false;
|
|
1809
|
+
"isSignal": true;
|
|
1810
|
+
};
|
|
1811
|
+
"backDrop": {
|
|
1812
|
+
"alias": "backDrop";
|
|
1813
|
+
"required": false;
|
|
1814
|
+
"isSignal": true;
|
|
1815
|
+
};
|
|
1816
|
+
"carrying": {
|
|
1817
|
+
"alias": "carrying";
|
|
1818
|
+
"required": false;
|
|
1819
|
+
"isSignal": true;
|
|
1820
|
+
};
|
|
1821
|
+
"holds": {
|
|
1822
|
+
"alias": "holds";
|
|
1823
|
+
"required": false;
|
|
1824
|
+
"isSignal": true;
|
|
1825
|
+
};
|
|
1826
|
+
"holdMs": {
|
|
1827
|
+
"alias": "holdMs";
|
|
1828
|
+
"required": false;
|
|
1829
|
+
"isSignal": true;
|
|
1830
|
+
};
|
|
1831
|
+
"turns": {
|
|
1832
|
+
"alias": "turns";
|
|
1833
|
+
"required": false;
|
|
1834
|
+
"isSignal": true;
|
|
1835
|
+
};
|
|
1836
|
+
"regroups": {
|
|
1837
|
+
"alias": "regroups";
|
|
1838
|
+
"required": false;
|
|
1839
|
+
"isSignal": true;
|
|
1840
|
+
};
|
|
1841
|
+
"grew": {
|
|
1842
|
+
"alias": "grew";
|
|
1843
|
+
"required": false;
|
|
1844
|
+
"isSignal": true;
|
|
1845
|
+
};
|
|
1846
|
+
}, {
|
|
1847
|
+
"back": "back";
|
|
1848
|
+
"held": "held";
|
|
1849
|
+
"turned": "turned";
|
|
1850
|
+
}, never, ["*"], true, never>;
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* how a tile looks (0.8.0): a piece (`piece`, the default), my own box where something is added
|
|
1854
|
+
* (`own`, a + before its name, dashed in the accent), a place that holds nothing yet (`dashed`), or
|
|
1855
|
+
* something not known yet or set aside (`pale`).
|
|
1856
|
+
*/
|
|
1857
|
+
export type CubeTileLook = 'piece' | 'own' | 'dashed' | 'pale';
|
|
1858
|
+
/**
|
|
1859
|
+
* the small cube's width on a tile, for its level and its cell's side (mosaic's grouped home): as
|
|
1860
|
+
* a tile says less, the cube takes more of it.
|
|
1861
|
+
*/
|
|
1862
|
+
export declare function cubeTilePicture(level: SquareLevel, cell: number): number;
|
|
1863
|
+
/**
|
|
1864
|
+
* `<cube-tile>`: one piece inside a `<cube-square>` (0.8.0): its small cube, its name and its line,
|
|
1865
|
+
* ticked when it is in use, in one of four looks (`CubeTileLook`). mosaic drew it three times, todarch
|
|
1866
|
+
* once, the every-level model page once more; this is the one they share. it fills the cell the
|
|
1867
|
+
* square gives (`level`, `cell`, from `cubeSquareTile`'s context) and says only what the app gives
|
|
1868
|
+
* it. the host is the tile: the app puts its own attributes, `role`, `tabindex`, `(click)` and the
|
|
1869
|
+
* gestures (`cubeCarry`, `cubeHold`) on `<cube-tile>` itself. its look is css variables
|
|
1870
|
+
* (`--cube-tile-*`), set in both token files.
|
|
1871
|
+
*
|
|
1872
|
+
* ```html
|
|
1873
|
+
* <cube-square [tiles]="tiles" [cell]="room.cell()">
|
|
1874
|
+
* <ng-template [cubeSquareTile]="tiles" let-t let-level="level" let-cell="cell">
|
|
1875
|
+
* <cube-tile [name]="t.name" [line]="t.line" [level]="level" [cell]="cell" [count]="t.count"
|
|
1876
|
+
* [colours]="t.colours" role="button" tabindex="0" (click)="open(t)" />
|
|
1877
|
+
* </ng-template>
|
|
1878
|
+
* </cube-square>
|
|
1879
|
+
* ```
|
|
1880
|
+
*/
|
|
1881
|
+
export declare class CubeTile {
|
|
1882
|
+
/** the piece's name, as the app says it. */
|
|
1883
|
+
readonly name: import("@angular/core").InputSignal<string>;
|
|
1884
|
+
/** its line under the name; said on the face at the nearer levels when `says`, else only to a screen reader. */
|
|
1885
|
+
readonly line: import("@angular/core").InputSignal<string | null | undefined>;
|
|
1886
|
+
/** whether the line is said on the face (true), or kept for a screen reader only. */
|
|
1887
|
+
readonly says: import("@angular/core").InputSignal<boolean>;
|
|
1888
|
+
/** how much it says (the square's `level`) and its cell's side in px (the square's `cell`). */
|
|
1889
|
+
readonly level: import("@angular/core").InputSignal<SquareLevel>;
|
|
1890
|
+
readonly cell: import("@angular/core").InputSignal<number>;
|
|
1891
|
+
/** its small cube: how many stickers, their colours (null is not known yet), its art, whole. */
|
|
1892
|
+
readonly count: import("@angular/core").InputSignal<number>;
|
|
1893
|
+
readonly colours: import("@angular/core").InputSignal<(string | null)[]>;
|
|
1894
|
+
readonly art: import("@angular/core").InputSignal<CubeArt>;
|
|
1895
|
+
/** one colour on every face; by default when it holds one. */
|
|
1896
|
+
readonly whole: import("@angular/core").InputSignal<boolean | null>;
|
|
1897
|
+
readonly look: import("@angular/core").InputSignal<CubeTileLook>;
|
|
1898
|
+
/** in use (chosen, an answer it stands in): a ring and the tick. */
|
|
1899
|
+
readonly ticked: import("@angular/core").InputSignal<boolean>;
|
|
1900
|
+
/** the tick's mark (a sign, not a word) and what a screen reader hears for it (the app's word). */
|
|
1901
|
+
readonly tick: import("@angular/core").InputSignal<string>;
|
|
1902
|
+
readonly tickedWord: import("@angular/core").InputSignal<string | null>;
|
|
1903
|
+
/** a faint edge in the accent: a piece with a way of its own, as the app decides. */
|
|
1904
|
+
readonly marked: import("@angular/core").InputSignal<boolean>;
|
|
1905
|
+
protected readonly picture: import("@angular/core").Signal<number>;
|
|
1906
|
+
protected readonly classes: import("@angular/core").Signal<string>;
|
|
1907
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CubeTile, never>;
|
|
1908
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CubeTile, "cube-tile", never, {
|
|
1909
|
+
"name": {
|
|
1910
|
+
"alias": "name";
|
|
1911
|
+
"required": true;
|
|
1912
|
+
"isSignal": true;
|
|
1913
|
+
};
|
|
1914
|
+
"line": {
|
|
1915
|
+
"alias": "line";
|
|
1916
|
+
"required": false;
|
|
1917
|
+
"isSignal": true;
|
|
1918
|
+
};
|
|
1919
|
+
"says": {
|
|
1920
|
+
"alias": "says";
|
|
1921
|
+
"required": false;
|
|
1922
|
+
"isSignal": true;
|
|
1923
|
+
};
|
|
1924
|
+
"level": {
|
|
1925
|
+
"alias": "level";
|
|
1926
|
+
"required": false;
|
|
1927
|
+
"isSignal": true;
|
|
1928
|
+
};
|
|
1929
|
+
"cell": {
|
|
1930
|
+
"alias": "cell";
|
|
1931
|
+
"required": false;
|
|
1932
|
+
"isSignal": true;
|
|
1933
|
+
};
|
|
1934
|
+
"count": {
|
|
1935
|
+
"alias": "count";
|
|
1936
|
+
"required": false;
|
|
1937
|
+
"isSignal": true;
|
|
1938
|
+
};
|
|
1939
|
+
"colours": {
|
|
1940
|
+
"alias": "colours";
|
|
1941
|
+
"required": false;
|
|
1942
|
+
"isSignal": true;
|
|
1943
|
+
};
|
|
1944
|
+
"art": {
|
|
1945
|
+
"alias": "art";
|
|
1946
|
+
"required": false;
|
|
1947
|
+
"isSignal": true;
|
|
1948
|
+
};
|
|
1949
|
+
"whole": {
|
|
1950
|
+
"alias": "whole";
|
|
1951
|
+
"required": false;
|
|
1952
|
+
"isSignal": true;
|
|
1953
|
+
};
|
|
1954
|
+
"look": {
|
|
1955
|
+
"alias": "look";
|
|
1956
|
+
"required": false;
|
|
1957
|
+
"isSignal": true;
|
|
1958
|
+
};
|
|
1959
|
+
"ticked": {
|
|
1960
|
+
"alias": "ticked";
|
|
1961
|
+
"required": false;
|
|
1962
|
+
"isSignal": true;
|
|
1963
|
+
};
|
|
1964
|
+
"tick": {
|
|
1965
|
+
"alias": "tick";
|
|
1966
|
+
"required": false;
|
|
1967
|
+
"isSignal": true;
|
|
1968
|
+
};
|
|
1969
|
+
"tickedWord": {
|
|
1970
|
+
"alias": "tickedWord";
|
|
1971
|
+
"required": false;
|
|
1972
|
+
"isSignal": true;
|
|
1973
|
+
};
|
|
1974
|
+
"marked": {
|
|
1975
|
+
"alias": "marked";
|
|
1976
|
+
"required": false;
|
|
1977
|
+
"isSignal": true;
|
|
1978
|
+
};
|
|
1979
|
+
}, {}, never, never, true, never>;
|
|
1980
|
+
}
|
|
1981
|
+
/** what an app says once, quietly: its words and, when it can be undone, how (the app's own). */
|
|
1982
|
+
export interface CubeQuietNote<U = unknown> {
|
|
1983
|
+
says: string;
|
|
1984
|
+
/** what undoes it, the app's own; none when it cannot be undone. */
|
|
1985
|
+
undo?: U | null;
|
|
1986
|
+
}
|
|
1987
|
+
/**
|
|
1988
|
+
* the quiet line, headless (0.8.0): what the app read from what the person did, said once on the
|
|
1989
|
+
* level it was said on, with one tap to undo, and gone after the next move (pin 4 of the every-level
|
|
1990
|
+
* study). a step in and back out keeps it on its level; the app says what clears it (`say(null)` on
|
|
1991
|
+
* its next move). it keeps no words: the app gives them, and draws the line with `<cube-quiet>`.
|
|
1992
|
+
*
|
|
1993
|
+
* ```ts
|
|
1994
|
+
* readonly quiet = new CubeQuietLine<Note>();
|
|
1995
|
+
* apply(r: { note?: Note }) { this.quiet.say(r.note ?? null, this.router.url); }
|
|
1996
|
+
* // the head's content: <cube-quiet [note]="quiet.on(here())" undoWord="undo" (undo)="undo()" />
|
|
1997
|
+
* ```
|
|
1998
|
+
*/
|
|
1999
|
+
export declare class CubeQuietLine<N extends CubeQuietNote = CubeQuietNote> {
|
|
2000
|
+
private readonly said;
|
|
2001
|
+
/** the note said last, wherever it was said. */
|
|
2002
|
+
readonly note: import("@angular/core").Signal<N | null>;
|
|
2003
|
+
/** the level (its address) it was said on. */
|
|
2004
|
+
readonly at: import("@angular/core").Signal<string | null>;
|
|
2005
|
+
/** say `note` on the level at `at` (an address); null clears the line. */
|
|
2006
|
+
say(note: N | null, at: string): void;
|
|
2007
|
+
/** the line goes with the person to `at` (a level a step out lands on in place of the one it was said on). */
|
|
2008
|
+
move(at: string): void;
|
|
2009
|
+
clear(): void;
|
|
2010
|
+
/** the note on the level at `url`, or null when it was said elsewhere. */
|
|
2011
|
+
on(url: string): N | null;
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* `<cube-quiet [note] undoWord (undo)>`: the quiet line drawn (0.8.0), a `role="status"` line with
|
|
2015
|
+
* the app's words and, when the note can be undone, a button in the app's word. nothing is drawn
|
|
2016
|
+
* without a note. put it in `<cube-head>`'s content so the head keeps its place; give the place a
|
|
2017
|
+
* fixed height on a phone so the square below does not move when it is said. its look is css
|
|
2018
|
+
* variables (`--cube-quiet-*`).
|
|
2019
|
+
*/
|
|
2020
|
+
export declare class CubeQuiet {
|
|
2021
|
+
readonly note: import("@angular/core").InputSignal<CubeQuietNote<unknown> | null>;
|
|
2022
|
+
/** the app's word for undo; without it no button is drawn. */
|
|
2023
|
+
readonly undoWord: import("@angular/core").InputSignal<string | null>;
|
|
2024
|
+
/** undo was tapped: the note it undoes. */
|
|
2025
|
+
readonly undo: import("@angular/core").OutputEmitterRef<CubeQuietNote<unknown>>;
|
|
2026
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CubeQuiet, never>;
|
|
2027
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CubeQuiet, "cube-quiet", never, {
|
|
2028
|
+
"note": {
|
|
2029
|
+
"alias": "note";
|
|
2030
|
+
"required": false;
|
|
2031
|
+
"isSignal": true;
|
|
2032
|
+
};
|
|
2033
|
+
"undoWord": {
|
|
2034
|
+
"alias": "undoWord";
|
|
2035
|
+
"required": false;
|
|
2036
|
+
"isSignal": true;
|
|
2037
|
+
};
|
|
2038
|
+
}, {
|
|
2039
|
+
"undo": "undo";
|
|
2040
|
+
}, never, never, true, never>;
|
|
2041
|
+
}
|
|
1481
2042
|
/**
|
|
1482
2043
|
* something on its way, the cube design way: the cube picture's pale stickers take colour (a page,
|
|
1483
2044
|
* a cube) or its colours turn round the stickers (a piece: a tile, a button saving). picked by selim
|