@xenosystem/blocks 0.11.0 → 0.11.1
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/time/index.js +47 -209
- package/package.json +3 -3
package/dist/time/index.js
CHANGED
|
@@ -780,6 +780,7 @@ function ticksPerStep(unit, timebase) {
|
|
|
780
780
|
|
|
781
781
|
// src/time/transport/react/TransportPanelView.tsx
|
|
782
782
|
import { useCallback, useEffect, useRef, useSyncExternalStore } from "react";
|
|
783
|
+
import { Column, IconButton, NumberInput, Readout, Slider, Stack, TextButton } from "@xenosystem/components/chrome";
|
|
783
784
|
|
|
784
785
|
// src/time/transport/react/icons.tsx
|
|
785
786
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -928,9 +929,8 @@ function TransportPanelView({ controller }) {
|
|
|
928
929
|
[controller]
|
|
929
930
|
);
|
|
930
931
|
return /* @__PURE__ */ jsxs2(
|
|
931
|
-
|
|
932
|
+
Column,
|
|
932
933
|
{
|
|
933
|
-
style: S.root,
|
|
934
934
|
className: "xeno-transport-panel",
|
|
935
935
|
onKeyDown,
|
|
936
936
|
onKeyUp,
|
|
@@ -938,228 +938,66 @@ function TransportPanelView({ controller }) {
|
|
|
938
938
|
role: "group",
|
|
939
939
|
"aria-label": "Transport",
|
|
940
940
|
children: [
|
|
941
|
-
/* @__PURE__ */ jsxs2(
|
|
942
|
-
/* @__PURE__ */ jsx2(
|
|
943
|
-
/* @__PURE__ */ jsx2(
|
|
944
|
-
controller.showsControl("shuttle") && /* @__PURE__ */ jsx2(
|
|
941
|
+
/* @__PURE__ */ jsxs2(Stack, { direction: "row", gap: 3, pad: "gutter", children: [
|
|
942
|
+
/* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(StartIcon, {}), label: "Go to start", onClick: () => controller.goToStart() }),
|
|
943
|
+
/* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(StepBackIcon, {}), label: "Step back", onClick: () => controller.step(-1) }),
|
|
944
|
+
controller.showsControl("shuttle") && /* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(ShuttleLeftIcon, {}), label: "Shuttle reverse (J)", onClick: () => controller.shuttleStep(-1) }),
|
|
945
945
|
/* @__PURE__ */ jsx2(
|
|
946
|
-
|
|
947
|
-
{
|
|
948
|
-
type: "button",
|
|
949
|
-
style: { ...S.iconBtn, ...S.primaryBtn },
|
|
950
|
-
onClick: () => controller.togglePlay(),
|
|
951
|
-
title: playing ? "Pause (Space)" : "Play (Space)",
|
|
952
|
-
"aria-label": playing ? "Pause" : "Play",
|
|
953
|
-
"aria-pressed": playing,
|
|
954
|
-
children: playing ? /* @__PURE__ */ jsx2(PauseIcon, {}) : /* @__PURE__ */ jsx2(PlayIcon, {})
|
|
955
|
-
}
|
|
956
|
-
),
|
|
957
|
-
/* @__PURE__ */ jsx2("button", { type: "button", style: S.iconBtn, onClick: () => controller.stop(), title: "Stop", "aria-label": "Stop", children: /* @__PURE__ */ jsx2(StopIcon, {}) }),
|
|
958
|
-
controller.showsControl("shuttle") && /* @__PURE__ */ jsx2("button", { type: "button", style: S.iconBtn, onClick: () => controller.shuttleStep(1), title: "Shuttle forward (L)", "aria-label": "Shuttle forward", children: /* @__PURE__ */ jsx2(ShuttleRightIcon, {}) }),
|
|
959
|
-
/* @__PURE__ */ jsx2("button", { type: "button", style: S.iconBtn, onClick: () => controller.step(1), title: "Step forward", "aria-label": "Step forward", children: /* @__PURE__ */ jsx2(StepForwardIcon, {}) }),
|
|
960
|
-
/* @__PURE__ */ jsx2("button", { type: "button", style: S.iconBtn, onClick: () => controller.goToEnd(), title: "Go to end", "aria-label": "Go to end", children: /* @__PURE__ */ jsx2(EndIcon, {}) }),
|
|
961
|
-
controller.showsControl("record") && /* @__PURE__ */ jsx2(
|
|
962
|
-
"button",
|
|
946
|
+
IconButton,
|
|
963
947
|
{
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
children: /* @__PURE__ */ jsx2(RecordIcon, {})
|
|
948
|
+
size: "sm",
|
|
949
|
+
variant: "primary",
|
|
950
|
+
icon: playing ? /* @__PURE__ */ jsx2(PauseIcon, {}) : /* @__PURE__ */ jsx2(PlayIcon, {}),
|
|
951
|
+
label: playing ? "Pause (Space)" : "Play (Space)",
|
|
952
|
+
active: playing,
|
|
953
|
+
onClick: () => controller.togglePlay()
|
|
971
954
|
}
|
|
972
955
|
),
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
}
|
|
984
|
-
),
|
|
985
|
-
controller.showsControl("metronome") && /* @__PURE__ */ jsx2(
|
|
986
|
-
"button",
|
|
987
|
-
{
|
|
988
|
-
type: "button",
|
|
989
|
-
style: { ...S.iconBtn, opacity: state.metronome ? 1 : 0.4 },
|
|
990
|
-
onClick: () => controller.toggleMetronome(),
|
|
991
|
-
title: "Metronome",
|
|
992
|
-
"aria-label": "Metronome",
|
|
993
|
-
"aria-pressed": !!state.metronome,
|
|
994
|
-
children: /* @__PURE__ */ jsx2(MetronomeIcon, {})
|
|
995
|
-
}
|
|
996
|
-
),
|
|
997
|
-
controller.showsControl("punch") && /* @__PURE__ */ jsx2("button", { type: "button", style: { ...S.chipBtn, opacity: state.punch ? 1 : 0.4 }, "aria-pressed": !!state.punch, title: "Punch", children: "PUNCH" }),
|
|
998
|
-
/* @__PURE__ */ jsxs2(
|
|
999
|
-
"button",
|
|
956
|
+
/* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(StopIcon, {}), label: "Stop", onClick: () => controller.stop() }),
|
|
957
|
+
controller.showsControl("shuttle") && /* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(ShuttleRightIcon, {}), label: "Shuttle forward (L)", onClick: () => controller.shuttleStep(1) }),
|
|
958
|
+
/* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(StepForwardIcon, {}), label: "Step forward", onClick: () => controller.step(1) }),
|
|
959
|
+
/* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(EndIcon, {}), label: "Go to end", onClick: () => controller.goToEnd() }),
|
|
960
|
+
controller.showsControl("record") && /* @__PURE__ */ jsx2(IconButton, { size: "sm", variant: "danger", icon: /* @__PURE__ */ jsx2(RecordIcon, {}), label: "Record", active: !!state.recording, onClick: () => controller.record() }),
|
|
961
|
+
controller.showsControl("loop") && /* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(LoopIcon, {}), label: "Loop", active: !!state.loopEnabled, onClick: () => controller.toggleLoop() }),
|
|
962
|
+
controller.showsControl("metronome") && /* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(MetronomeIcon, {}), label: "Metronome", active: !!state.metronome, onClick: () => controller.toggleMetronome() }),
|
|
963
|
+
controller.showsControl("punch") && /* @__PURE__ */ jsx2(TextButton, { strong: !!state.punch, children: "PUNCH" }),
|
|
964
|
+
/* @__PURE__ */ jsx2(
|
|
965
|
+
Readout,
|
|
1000
966
|
{
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
967
|
+
value: controller.getReadout(),
|
|
968
|
+
unit: (0, format_exports.displayLabel)(controller.getDisplay()),
|
|
969
|
+
label: `Position ${controller.getReadout()}`,
|
|
1004
970
|
title: "Click to change time display",
|
|
1005
|
-
|
|
1006
|
-
children: [
|
|
1007
|
-
/* @__PURE__ */ jsx2("span", { style: S.readoutValue, children: controller.getReadout() }),
|
|
1008
|
-
/* @__PURE__ */ jsx2("span", { style: S.readoutUnit, children: (0, format_exports.displayLabel)(controller.getDisplay()) })
|
|
1009
|
-
]
|
|
971
|
+
onClick: () => controller.cycleDisplay()
|
|
1010
972
|
}
|
|
1011
973
|
),
|
|
1012
|
-
/* @__PURE__ */ jsx2(
|
|
1013
|
-
controller.showsControl("bpm") && /* @__PURE__ */
|
|
1014
|
-
|
|
1015
|
-
/* @__PURE__ */ jsx2(
|
|
1016
|
-
|
|
1017
|
-
{
|
|
1018
|
-
type: "number",
|
|
1019
|
-
value: state.bpm ?? 120,
|
|
1020
|
-
onChange: (e) => controller.setTempo(Number(e.target.value)),
|
|
1021
|
-
style: S.bpmInput,
|
|
1022
|
-
"aria-label": "Tempo"
|
|
1023
|
-
}
|
|
1024
|
-
)
|
|
1025
|
-
] }),
|
|
1026
|
-
controller.showsControl("inOut") && /* @__PURE__ */ jsxs2("span", { style: S.inOut, children: [
|
|
1027
|
-
/* @__PURE__ */ jsx2("button", { type: "button", style: S.chipBtn, onClick: () => controller.setInPoint(), title: "Set in point", children: "IN" }),
|
|
1028
|
-
/* @__PURE__ */ jsx2("button", { type: "button", style: S.chipBtn, onClick: () => controller.setOutPoint(), title: "Set out point", children: "OUT" })
|
|
974
|
+
/* @__PURE__ */ jsx2(Readout, { size: "sm", value: controller.getDurationReadout() }),
|
|
975
|
+
controller.showsControl("bpm") && /* @__PURE__ */ jsx2(NumberInput, { caption: "BPM", label: "Tempo", value: state.bpm ?? 120, onChange: (bpm) => controller.setTempo(bpm) }),
|
|
976
|
+
controller.showsControl("inOut") && /* @__PURE__ */ jsxs2(Stack, { direction: "row", gap: 2, pad: "none", children: [
|
|
977
|
+
/* @__PURE__ */ jsx2(TextButton, { onClick: () => controller.setInPoint(), children: "IN" }),
|
|
978
|
+
/* @__PURE__ */ jsx2(TextButton, { onClick: () => controller.setOutPoint(), children: "OUT" })
|
|
1029
979
|
] })
|
|
1030
980
|
] }),
|
|
1031
|
-
controller.showsControl("scrubber") && /* @__PURE__ */
|
|
1032
|
-
|
|
981
|
+
controller.showsControl("scrubber") && /* @__PURE__ */ jsx2(
|
|
982
|
+
Slider,
|
|
1033
983
|
{
|
|
1034
|
-
|
|
1035
|
-
|
|
984
|
+
trackRef: scrubRef,
|
|
985
|
+
progress: controller.getProgress(),
|
|
986
|
+
label: "Playhead",
|
|
987
|
+
valueMin: 0,
|
|
988
|
+
valueMax: controller.getDuration(),
|
|
989
|
+
valueNow: controller.getCurrentTick(),
|
|
990
|
+
valueText: controller.getReadout(),
|
|
1036
991
|
onPointerDown: onScrubDown,
|
|
1037
992
|
onPointerMove: onScrubMove,
|
|
1038
993
|
onPointerUp: onScrubUp,
|
|
1039
|
-
onPointerCancel: () => controller.cancelScrub()
|
|
1040
|
-
role: "slider",
|
|
1041
|
-
"aria-label": "Playhead",
|
|
1042
|
-
"aria-valuemin": 0,
|
|
1043
|
-
"aria-valuemax": controller.getDuration(),
|
|
1044
|
-
"aria-valuenow": controller.getCurrentTick(),
|
|
1045
|
-
"aria-valuetext": controller.getReadout(),
|
|
1046
|
-
tabIndex: 0,
|
|
1047
|
-
children: [
|
|
1048
|
-
/* @__PURE__ */ jsx2("span", { style: { ...S.scrubFill, width: `${controller.getProgress() * 100}%` } }),
|
|
1049
|
-
/* @__PURE__ */ jsx2("span", { style: { ...S.scrubKnob, left: `${controller.getProgress() * 100}%` } })
|
|
1050
|
-
]
|
|
994
|
+
onPointerCancel: () => controller.cancelScrub()
|
|
1051
995
|
}
|
|
1052
996
|
)
|
|
1053
997
|
]
|
|
1054
998
|
}
|
|
1055
999
|
);
|
|
1056
1000
|
}
|
|
1057
|
-
var S = {
|
|
1058
|
-
root: {
|
|
1059
|
-
display: "flex",
|
|
1060
|
-
flexDirection: "column",
|
|
1061
|
-
gap: 3,
|
|
1062
|
-
padding: "4px 6px",
|
|
1063
|
-
fontSize: 11,
|
|
1064
|
-
color: "var(--xeno-text)",
|
|
1065
|
-
background: "var(--xeno-canvas)",
|
|
1066
|
-
userSelect: "none",
|
|
1067
|
-
outline: "none"
|
|
1068
|
-
},
|
|
1069
|
-
row: { display: "flex", alignItems: "center", gap: 3, flexWrap: "wrap" },
|
|
1070
|
-
iconBtn: {
|
|
1071
|
-
display: "flex",
|
|
1072
|
-
alignItems: "center",
|
|
1073
|
-
justifyContent: "center",
|
|
1074
|
-
width: 20,
|
|
1075
|
-
height: 18,
|
|
1076
|
-
padding: 0,
|
|
1077
|
-
border: "none",
|
|
1078
|
-
borderRadius: 2,
|
|
1079
|
-
background: "var(--xeno-border-subtle)",
|
|
1080
|
-
color: "inherit",
|
|
1081
|
-
cursor: "pointer",
|
|
1082
|
-
flex: "0 0 auto"
|
|
1083
|
-
},
|
|
1084
|
-
primaryBtn: { background: "var(--xeno-control)", width: 26 },
|
|
1085
|
-
chipBtn: {
|
|
1086
|
-
height: 18,
|
|
1087
|
-
padding: "0 5px",
|
|
1088
|
-
border: "none",
|
|
1089
|
-
borderRadius: 2,
|
|
1090
|
-
background: "var(--xeno-border-subtle)",
|
|
1091
|
-
color: "inherit",
|
|
1092
|
-
cursor: "pointer",
|
|
1093
|
-
fontSize: 9,
|
|
1094
|
-
letterSpacing: "0.05em",
|
|
1095
|
-
flex: "0 0 auto"
|
|
1096
|
-
},
|
|
1097
|
-
readout: {
|
|
1098
|
-
display: "flex",
|
|
1099
|
-
alignItems: "baseline",
|
|
1100
|
-
gap: 4,
|
|
1101
|
-
height: 18,
|
|
1102
|
-
padding: "0 6px",
|
|
1103
|
-
marginLeft: 4,
|
|
1104
|
-
border: "1px solid var(--xeno-border)",
|
|
1105
|
-
borderRadius: 2,
|
|
1106
|
-
background: "var(--xeno-canvas)",
|
|
1107
|
-
color: "inherit",
|
|
1108
|
-
cursor: "pointer",
|
|
1109
|
-
flex: "0 0 auto"
|
|
1110
|
-
},
|
|
1111
|
-
readoutValue: { fontVariantNumeric: "tabular-nums", fontSize: 12, letterSpacing: "0.02em" },
|
|
1112
|
-
readoutUnit: { fontSize: 8, color: "var(--xeno-muted)", letterSpacing: "0.06em" },
|
|
1113
|
-
duration: {
|
|
1114
|
-
fontVariantNumeric: "tabular-nums",
|
|
1115
|
-
fontSize: 10,
|
|
1116
|
-
color: "var(--xeno-muted)",
|
|
1117
|
-
flex: "0 0 auto"
|
|
1118
|
-
},
|
|
1119
|
-
bpm: { display: "flex", alignItems: "center", gap: 3, flex: "0 0 auto" },
|
|
1120
|
-
bpmLabel: { fontSize: 8, color: "var(--xeno-muted)", letterSpacing: "0.06em" },
|
|
1121
|
-
bpmInput: {
|
|
1122
|
-
width: 42,
|
|
1123
|
-
height: 18,
|
|
1124
|
-
background: "var(--xeno-canvas)",
|
|
1125
|
-
color: "inherit",
|
|
1126
|
-
border: "1px solid var(--xeno-border)",
|
|
1127
|
-
borderRadius: 2,
|
|
1128
|
-
fontSize: 11,
|
|
1129
|
-
padding: "0 4px",
|
|
1130
|
-
outline: "none",
|
|
1131
|
-
fontVariantNumeric: "tabular-nums"
|
|
1132
|
-
},
|
|
1133
|
-
inOut: { display: "flex", gap: 2, flex: "0 0 auto" },
|
|
1134
|
-
scrubTrack: {
|
|
1135
|
-
position: "relative",
|
|
1136
|
-
height: 8,
|
|
1137
|
-
borderRadius: 2,
|
|
1138
|
-
background: "var(--xeno-border-subtle)",
|
|
1139
|
-
cursor: "pointer",
|
|
1140
|
-
touchAction: "none",
|
|
1141
|
-
outline: "none"
|
|
1142
|
-
},
|
|
1143
|
-
scrubFill: {
|
|
1144
|
-
position: "absolute",
|
|
1145
|
-
left: 0,
|
|
1146
|
-
top: 0,
|
|
1147
|
-
bottom: 0,
|
|
1148
|
-
background: "var(--xeno-control)",
|
|
1149
|
-
borderRadius: 2,
|
|
1150
|
-
pointerEvents: "none"
|
|
1151
|
-
},
|
|
1152
|
-
scrubKnob: {
|
|
1153
|
-
position: "absolute",
|
|
1154
|
-
top: -1,
|
|
1155
|
-
width: 3,
|
|
1156
|
-
height: 10,
|
|
1157
|
-
marginLeft: -1,
|
|
1158
|
-
background: "var(--xeno-text)",
|
|
1159
|
-
borderRadius: 1,
|
|
1160
|
-
pointerEvents: "none"
|
|
1161
|
-
}
|
|
1162
|
-
};
|
|
1163
1001
|
|
|
1164
1002
|
// src/time/transport/panel.ts
|
|
1165
1003
|
function createTransportPanel(options = {}) {
|
|
@@ -4177,13 +4015,13 @@ import {
|
|
|
4177
4015
|
Badge,
|
|
4178
4016
|
EmptyState as EmptyState2,
|
|
4179
4017
|
ErrorState,
|
|
4180
|
-
IconButton,
|
|
4018
|
+
IconButton as IconButton2,
|
|
4181
4019
|
Row,
|
|
4182
4020
|
RowList,
|
|
4183
4021
|
ScrollArea,
|
|
4184
4022
|
SegmentedControl,
|
|
4185
4023
|
StatusBar as StatusBar2,
|
|
4186
|
-
TextButton,
|
|
4024
|
+
TextButton as TextButton2,
|
|
4187
4025
|
Toolbar as Toolbar2,
|
|
4188
4026
|
ToolbarGroup as ToolbarGroup2
|
|
4189
4027
|
} from "@xenosystem/components/chrome";
|
|
@@ -4222,7 +4060,7 @@ function CalendarPanelView({
|
|
|
4222
4060
|
{
|
|
4223
4061
|
left: /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
4224
4062
|
/* @__PURE__ */ jsx5(
|
|
4225
|
-
|
|
4063
|
+
IconButton2,
|
|
4226
4064
|
{
|
|
4227
4065
|
icon: /* @__PURE__ */ jsx5(ChevronGlyph, { direction: "left" }),
|
|
4228
4066
|
label: "Previous",
|
|
@@ -4230,14 +4068,14 @@ function CalendarPanelView({
|
|
|
4230
4068
|
}
|
|
4231
4069
|
),
|
|
4232
4070
|
/* @__PURE__ */ jsx5(
|
|
4233
|
-
|
|
4071
|
+
IconButton2,
|
|
4234
4072
|
{
|
|
4235
4073
|
icon: /* @__PURE__ */ jsx5(ChevronGlyph, { direction: "right" }),
|
|
4236
4074
|
label: "Next",
|
|
4237
4075
|
onClick: () => controller.navigate(1)
|
|
4238
4076
|
}
|
|
4239
4077
|
),
|
|
4240
|
-
/* @__PURE__ */ jsx5(
|
|
4078
|
+
/* @__PURE__ */ jsx5(TextButton2, { onClick: () => controller.goToToday(), children: "Today" }),
|
|
4241
4079
|
/* @__PURE__ */ jsx5("span", { style: { fontSize: 11, opacity: 0.8 }, children: controller.anchorKey().slice(0, 7) })
|
|
4242
4080
|
] }),
|
|
4243
4081
|
right: /* @__PURE__ */ jsxs4(ToolbarGroup2, { end: true, children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenosystem/blocks",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "XENO Blocks — rung 3 of the front ladder: components composed into a contract-bearing unit (manifest: ports, intents, commands, agent surface), rendered by @xenosystem/workbench. ONE package, one subpath per family (/auth, /edit, /data, /time, /ops, /trust, /agent), one named export per block — XENO PACKAGE NAMING - STANDARD.md.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@duckdb/duckdb-wasm": ">=1.28.0",
|
|
62
62
|
"@xenosystem/block-sdk": "^0.3.0",
|
|
63
|
-
"@xenosystem/components": ">=0.
|
|
63
|
+
"@xenosystem/components": ">=0.10.2 <1",
|
|
64
64
|
"@xenosystem/data-core": "^0.1.0",
|
|
65
65
|
"@xenosystem/elements-react": ">=0.0.1",
|
|
66
66
|
"@xenosystem/time-core": "^0.1.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@types/react": "^19.0.0",
|
|
77
77
|
"@types/react-dom": "^19.0.0",
|
|
78
78
|
"@xenosystem/block-sdk": "^0.3.1",
|
|
79
|
-
"@xenosystem/components": "^0.
|
|
79
|
+
"@xenosystem/components": "^0.10.2",
|
|
80
80
|
"@xenosystem/data-core": "^0.1.0",
|
|
81
81
|
"@xenosystem/elements-react": "0.0.1",
|
|
82
82
|
"@xenosystem/time-core": "^0.1.0",
|