even-toolkit 1.3.1 → 1.3.2
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.
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
* Shared action button bar for G2 glasses display.
|
|
3
3
|
*
|
|
4
4
|
* Renders a row of named buttons with triangle indicators:
|
|
5
|
-
* ▶Timer◀ Scroll
|
|
5
|
+
* ▶Timer◀ ▷Scroll◁ Steps
|
|
6
6
|
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - Active button (mode entered): filled triangles ▶Name◀
|
|
8
|
+
* - Selected button (hovering in button-select mode): empty triangles ▷Name◁
|
|
9
9
|
* - Inactive button: plain Name
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
12
|
* Build an action bar string from a list of button names.
|
|
13
13
|
*
|
|
14
14
|
* @param buttons Array of button label strings, e.g. ['Timer', 'Scroll', 'Steps']
|
|
15
|
-
* @param selectedIndex Index of the currently highlighted button
|
|
16
|
-
* @param activeLabel Label of the currently active mode button
|
|
17
|
-
* @param
|
|
15
|
+
* @param selectedIndex Index of the currently highlighted button
|
|
16
|
+
* @param activeLabel Label of the currently active mode button, or null if in button-select mode
|
|
17
|
+
* @param _flashPhase Unused, kept for API compatibility
|
|
18
18
|
*/
|
|
19
|
-
export declare function buildActionBar(buttons: string[], selectedIndex: number, activeLabel: string | null,
|
|
19
|
+
export declare function buildActionBar(buttons: string[], selectedIndex: number, activeLabel: string | null, _flashPhase?: boolean): string;
|
|
20
20
|
/**
|
|
21
|
-
* Build a static action bar (
|
|
21
|
+
* Build a static action bar (empty triangles on selected).
|
|
22
22
|
* Useful for screens like recipe detail or completion where there's no mode switching.
|
|
23
23
|
*/
|
|
24
24
|
export declare function buildStaticActionBar(buttons: string[], selectedIndex: number): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-bar.d.ts","sourceRoot":"","sources":["../../glasses/action-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EAAE,EACjB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,
|
|
1
|
+
{"version":3,"file":"action-bar.d.ts","sourceRoot":"","sources":["../../glasses/action-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EAAE,EACjB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,WAAW,CAAC,EAAE,OAAO,GACpB,MAAM,CAcR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EAAE,EACjB,aAAa,EAAE,MAAM,GACpB,MAAM,CAOR"}
|
|
@@ -2,38 +2,36 @@
|
|
|
2
2
|
* Shared action button bar for G2 glasses display.
|
|
3
3
|
*
|
|
4
4
|
* Renders a row of named buttons with triangle indicators:
|
|
5
|
-
* ▶Timer◀ Scroll
|
|
5
|
+
* ▶Timer◀ ▷Scroll◁ Steps
|
|
6
6
|
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - Active button (mode entered): filled triangles ▶Name◀
|
|
8
|
+
* - Selected button (hovering in button-select mode): empty triangles ▷Name◁
|
|
9
9
|
* - Inactive button: plain Name
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
12
|
* Build an action bar string from a list of button names.
|
|
13
13
|
*
|
|
14
14
|
* @param buttons Array of button label strings, e.g. ['Timer', 'Scroll', 'Steps']
|
|
15
|
-
* @param selectedIndex Index of the currently highlighted button
|
|
16
|
-
* @param activeLabel Label of the currently active mode button
|
|
17
|
-
* @param
|
|
15
|
+
* @param selectedIndex Index of the currently highlighted button
|
|
16
|
+
* @param activeLabel Label of the currently active mode button, or null if in button-select mode
|
|
17
|
+
* @param _flashPhase Unused, kept for API compatibility
|
|
18
18
|
*/
|
|
19
|
-
export function buildActionBar(buttons, selectedIndex, activeLabel,
|
|
19
|
+
export function buildActionBar(buttons, selectedIndex, activeLabel, _flashPhase) {
|
|
20
20
|
const activeIdx = activeLabel ? buttons.indexOf(activeLabel) : -1;
|
|
21
21
|
return buttons.map((name, i) => {
|
|
22
22
|
if (activeIdx === i) {
|
|
23
|
-
// Active mode:
|
|
24
|
-
|
|
25
|
-
const R = flashPhase ? '\u25C0' : '\u25C1'; // ◀ / ◁
|
|
26
|
-
return `${L}${name}${R}`;
|
|
23
|
+
// Active mode: filled triangles
|
|
24
|
+
return `\u25B6${name}\u25C0`;
|
|
27
25
|
}
|
|
28
26
|
if (activeIdx < 0 && i === selectedIndex) {
|
|
29
|
-
//
|
|
27
|
+
// Hovering in button-select mode: empty triangles
|
|
30
28
|
return `\u25B7${name}\u25C1`;
|
|
31
29
|
}
|
|
32
30
|
return ` ${name} `;
|
|
33
31
|
}).join(' ');
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
|
-
* Build a static action bar (
|
|
34
|
+
* Build a static action bar (empty triangles on selected).
|
|
37
35
|
* Useful for screens like recipe detail or completion where there's no mode switching.
|
|
38
36
|
*/
|
|
39
37
|
export function buildStaticActionBar(buttons, selectedIndex) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-bar.js","sourceRoot":"","sources":["../../glasses/action-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAiB,EACjB,aAAqB,EACrB,WAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"action-bar.js","sourceRoot":"","sources":["../../glasses/action-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAiB,EACjB,aAAqB,EACrB,WAA0B,EAC1B,WAAqB;IAErB,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAElE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QAC7B,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;YACpB,gCAAgC;YAChC,OAAO,SAAS,IAAI,QAAQ,CAAC;QAC/B,CAAC;QACD,IAAI,SAAS,GAAG,CAAC,IAAI,CAAC,KAAK,aAAa,EAAE,CAAC;YACzC,kDAAkD;YAClD,OAAO,SAAS,IAAI,QAAQ,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,IAAI,GAAG,CAAC;IACrB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAiB,EACjB,aAAqB;IAErB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QAC7B,IAAI,CAAC,KAAK,aAAa,EAAE,CAAC;YACxB,OAAO,SAAS,IAAI,QAAQ,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,IAAI,GAAG,CAAC;IACrB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
package/glasses/action-bar.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Shared action button bar for G2 glasses display.
|
|
3
3
|
*
|
|
4
4
|
* Renders a row of named buttons with triangle indicators:
|
|
5
|
-
* ▶Timer◀ Scroll
|
|
5
|
+
* ▶Timer◀ ▷Scroll◁ Steps
|
|
6
6
|
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - Active button (mode entered): filled triangles ▶Name◀
|
|
8
|
+
* - Selected button (hovering in button-select mode): empty triangles ▷Name◁
|
|
9
9
|
* - Inactive button: plain Name
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -13,27 +13,25 @@
|
|
|
13
13
|
* Build an action bar string from a list of button names.
|
|
14
14
|
*
|
|
15
15
|
* @param buttons Array of button label strings, e.g. ['Timer', 'Scroll', 'Steps']
|
|
16
|
-
* @param selectedIndex Index of the currently highlighted button
|
|
17
|
-
* @param activeLabel Label of the currently active mode button
|
|
18
|
-
* @param
|
|
16
|
+
* @param selectedIndex Index of the currently highlighted button
|
|
17
|
+
* @param activeLabel Label of the currently active mode button, or null if in button-select mode
|
|
18
|
+
* @param _flashPhase Unused, kept for API compatibility
|
|
19
19
|
*/
|
|
20
20
|
export function buildActionBar(
|
|
21
21
|
buttons: string[],
|
|
22
22
|
selectedIndex: number,
|
|
23
23
|
activeLabel: string | null,
|
|
24
|
-
|
|
24
|
+
_flashPhase?: boolean,
|
|
25
25
|
): string {
|
|
26
26
|
const activeIdx = activeLabel ? buttons.indexOf(activeLabel) : -1;
|
|
27
27
|
|
|
28
28
|
return buttons.map((name, i) => {
|
|
29
29
|
if (activeIdx === i) {
|
|
30
|
-
// Active mode:
|
|
31
|
-
|
|
32
|
-
const R = flashPhase ? '\u25C0' : '\u25C1'; // ◀ / ◁
|
|
33
|
-
return `${L}${name}${R}`;
|
|
30
|
+
// Active mode: filled triangles
|
|
31
|
+
return `\u25B6${name}\u25C0`;
|
|
34
32
|
}
|
|
35
33
|
if (activeIdx < 0 && i === selectedIndex) {
|
|
36
|
-
//
|
|
34
|
+
// Hovering in button-select mode: empty triangles
|
|
37
35
|
return `\u25B7${name}\u25C1`;
|
|
38
36
|
}
|
|
39
37
|
return ` ${name} `;
|
|
@@ -41,7 +39,7 @@ export function buildActionBar(
|
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
/**
|
|
44
|
-
* Build a static action bar (
|
|
42
|
+
* Build a static action bar (empty triangles on selected).
|
|
45
43
|
* Useful for screens like recipe detail or completion where there's no mode switching.
|
|
46
44
|
*/
|
|
47
45
|
export function buildStaticActionBar(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "even-toolkit",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Design system & component library for Even Realities G2 smart glasses apps — 55+ web components, 191 pixel-art icons, glasses SDK bridge, and design tokens.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/glasses/index.js",
|