@joewinke/jatui 0.2.12 → 0.2.13

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.
Files changed (53) hide show
  1. package/dist/actions/attention.js +21 -13
  2. package/dist/actions/collapse.js +15 -29
  3. package/dist/actions/floating.js +29 -37
  4. package/dist/actions/listNav.js +108 -137
  5. package/dist/actions/railNav.js +72 -89
  6. package/dist/actions/staggerEntrance.js +19 -23
  7. package/dist/actions/tooltip.js +63 -51
  8. package/dist/assets/sounds/error.js +1 -1
  9. package/dist/assets/sounds/notify.js +1 -1
  10. package/dist/assets/sounds/pop.js +1 -1
  11. package/dist/assets/sounds/send.js +1 -1
  12. package/dist/assets/sounds/success.js +1 -1
  13. package/dist/assets/sounds/toggle.js +1 -1
  14. package/dist/components/graph/theme.js +26 -36
  15. package/dist/components/markup.js +59 -62
  16. package/dist/components/session-nav/transcriptModel.js +49 -66
  17. package/dist/components/shell/shell.js +14 -15
  18. package/dist/components/table/flexRender.js +2 -2
  19. package/dist/data/emojis.js +4 -4
  20. package/dist/dnd/autoScroll.js +10 -12
  21. package/dist/dnd/createDndBoard.js +94 -185
  22. package/dist/dnd/draggable.js +15 -23
  23. package/dist/dnd/dropTarget.js +15 -29
  24. package/dist/dnd/types.d.ts +9 -0
  25. package/dist/dnd/types.js +2 -14
  26. package/dist/showcase/generative/intent.js +19 -21
  27. package/dist/showcase/generative/manifest.js +27 -80
  28. package/dist/showcase/scroll/scrollProgress.js +20 -22
  29. package/dist/showcase/scroll/scrollReveal.js +17 -20
  30. package/dist/stores/commandPalette.js +18 -46
  31. package/dist/stores/confirmDialog.js +9 -9
  32. package/dist/stores/inputDialog.js +9 -9
  33. package/dist/stores/toast.js +10 -33
  34. package/dist/transitions/glide.js +29 -25
  35. package/dist/types/booking.js +4 -4
  36. package/dist/types/comments.js +2 -2
  37. package/dist/types/messaging.js +3 -3
  38. package/dist/types/pipeline.js +2 -2
  39. package/dist/utils/currency.js +2 -4
  40. package/dist/utils/daisyuiColors.js +25 -27
  41. package/dist/utils/dateFormatters.js +44 -44
  42. package/dist/utils/googleMapsLoader.js +46 -100
  43. package/dist/utils/mentionParser.js +30 -30
  44. package/dist/utils/phone.js +21 -27
  45. package/dist/utils/phoneFormat.js +9 -9
  46. package/dist/utils/sound.js +27 -78
  47. package/dist/utils/splitText.js +15 -26
  48. package/dist/utils/taskUtils.js +1 -1
  49. package/dist/utils/themeWipe.js +27 -72
  50. package/dist/utils/viewTransition.js +6 -51
  51. package/package.json +7 -3
  52. package/dist/dnd/createDndBoard.test.d.ts +0 -1
  53. package/dist/dnd/createDndBoard.test.js +0 -261
@@ -22,17 +22,6 @@
22
22
  * transcript shows just the headline by default and the body is
23
23
  * a drill-down. This is what keeps the left column readable.
24
24
  */
25
- var __assign = (this && this.__assign) || function () {
26
- __assign = Object.assign || function(t) {
27
- for (var s, i = 1, n = arguments.length; i < n; i++) {
28
- s = arguments[i];
29
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
30
- t[p] = s[p];
31
- }
32
- return t;
33
- };
34
- return __assign.apply(this, arguments);
35
- };
36
25
  export function rawTypeToState(raw) {
37
26
  switch (raw) {
38
27
  case 'needs_input':
@@ -48,28 +37,27 @@ export function rawTypeToState(raw) {
48
37
  }
49
38
  /** Detect a `jat-signal <type> '<json>'` invocation in a tool-call body. */
50
39
  function parseSignalBody(body) {
51
- var m = body.match(/jat-signal\s+(starting|working|needs_input|review|completing|complete|completed|paused|idle)\b/);
40
+ const m = body.match(/jat-signal\s+(starting|working|needs_input|review|completing|complete|completed|paused|idle)\b/);
52
41
  if (!m)
53
42
  return null;
54
- var label = '';
55
- var pick = body.match(/"(?:approach|question|reviewFocus|currentStep|summary|reason|taskTitle)"\s*:\s*"([^"]{3,90})/);
43
+ let label = '';
44
+ const pick = body.match(/"(?:approach|question|reviewFocus|currentStep|summary|reason|taskTitle)"\s*:\s*"([^"]{3,90})/);
56
45
  if (pick)
57
46
  label = pick[1];
58
- return { rawType: m[1], label: label };
47
+ return { rawType: m[1], label };
59
48
  }
60
49
  /** Build the linked model from rendered transcript lines. */
61
50
  export function buildLinkedSession(lines) {
62
- var items = [];
63
- var emits = [];
64
- var cur = null;
65
- var flush = function () {
51
+ const items = [];
52
+ const emits = [];
53
+ let cur = null;
54
+ const flush = () => {
66
55
  if (cur) {
67
- items.push(__assign(__assign({ id: items.length }, cur), { signalId: null }));
56
+ items.push({ id: items.length, ...cur, signalId: null });
68
57
  cur = null;
69
58
  }
70
59
  };
71
- for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {
72
- var line = lines_1[_i];
60
+ for (const line of lines) {
73
61
  if (!line.trim()) {
74
62
  flush();
75
63
  continue;
@@ -80,8 +68,8 @@ export function buildLinkedSession(lines) {
80
68
  continue;
81
69
  }
82
70
  if (line.startsWith('⏺ ')) {
83
- var body = line.slice(2);
84
- var sig = parseSignalBody(body);
71
+ const body = line.slice(2);
72
+ const sig = parseSignalBody(body);
85
73
  if (sig) {
86
74
  // signal emission = boundary; consume it, don't render as an item
87
75
  flush();
@@ -93,7 +81,7 @@ export function buildLinkedSession(lines) {
93
81
  continue;
94
82
  }
95
83
  if (line.startsWith(' ⎿ ')) {
96
- var body = line.slice(4);
84
+ const body = line.slice(4);
97
85
  if (cur) {
98
86
  cur.detail.push(body);
99
87
  cur.srcLines++;
@@ -102,7 +90,7 @@ export function buildLinkedSession(lines) {
102
90
  }
103
91
  if (line.startsWith(' ')) {
104
92
  // continuation: tool detail for actions, prose for prompt/assistant
105
- var body = line.trimStart();
93
+ const body = line.trimStart();
106
94
  if (cur && cur.kind === 'action') {
107
95
  cur.detail.push(body);
108
96
  cur.srcLines++;
@@ -125,21 +113,21 @@ export function buildLinkedSession(lines) {
125
113
  }
126
114
  flush();
127
115
  // Build signal nodes from emission boundaries.
128
- var signals = [];
129
- var prevBoundary = -1;
130
- emits.forEach(function (e, i) {
131
- var rowStart = Math.max(0, prevBoundary + 1);
132
- var rowEnd = Math.max(rowStart, e.afterIdx);
133
- var lineCount = 0;
134
- for (var k = rowStart; k <= rowEnd && k < items.length; k++)
116
+ const signals = [];
117
+ let prevBoundary = -1;
118
+ emits.forEach((e, i) => {
119
+ const rowStart = Math.max(0, prevBoundary + 1);
120
+ const rowEnd = Math.max(rowStart, e.afterIdx);
121
+ let lineCount = 0;
122
+ for (let k = rowStart; k <= rowEnd && k < items.length; k++)
135
123
  lineCount += items[k].srcLines;
136
124
  signals.push({
137
- id: "sig-".concat(i),
125
+ id: `sig-${i}`,
138
126
  state: rawTypeToState(e.rawType),
139
127
  rawType: e.rawType,
140
128
  label: e.label,
141
- rowStart: rowStart,
142
- rowEnd: rowEnd,
129
+ rowStart,
130
+ rowEnd,
143
131
  lineCount: Math.max(1, lineCount),
144
132
  // No WorkBlock substrate data in the raw-lines path
145
133
  blockId: null,
@@ -151,13 +139,12 @@ export function buildLinkedSession(lines) {
151
139
  });
152
140
  prevBoundary = e.afterIdx;
153
141
  });
154
- for (var _a = 0, signals_1 = signals; _a < signals_1.length; _a++) {
155
- var sig = signals_1[_a];
156
- for (var k = sig.rowStart; k <= sig.rowEnd && k < items.length; k++) {
142
+ for (const sig of signals) {
143
+ for (let k = sig.rowStart; k <= sig.rowEnd && k < items.length; k++) {
157
144
  items[k].signalId = sig.id;
158
145
  }
159
146
  }
160
- return { items: items, signals: signals };
147
+ return { items, signals };
161
148
  }
162
149
  /**
163
150
  * Build a LinkedSession from the WorkBlock substrate (B1).
@@ -175,49 +162,45 @@ export function buildLinkedSession(lines) {
175
162
  */
176
163
  export function buildLinkedSessionFromWork(blocks, items) {
177
164
  // Map WorkTranscriptItem → TranscriptItem (blockId → signalId mapping happens after)
178
- var transcriptItems = items.map(function (it) { return ({
165
+ const transcriptItems = items.map((it) => ({
179
166
  id: it.id,
180
167
  kind: it.kind,
181
168
  headline: it.headline,
182
169
  detail: it.detail,
183
170
  srcLines: it.srcLines,
184
171
  signalId: null // filled in below
185
- }); });
172
+ }));
186
173
  // Map WorkBlock → SignalNode
187
- var signals = blocks.map(function (blk) {
188
- var _a, _b, _c;
189
- return ({
190
- id: blk.id,
191
- state: rawTypeToState(blk.signal.type),
192
- rawType: blk.signal.type,
193
- label: blk.signal.label,
194
- rowStart: blk.itemRange.start,
195
- rowEnd: blk.itemRange.end,
196
- lineCount: blk.lineCount,
197
- // WorkBlock substrate fields
198
- blockId: blk.id,
199
- summary: blk.summary,
200
- filesTouched: blk.filesTouched,
201
- commits: (_a = blk.commits) !== null && _a !== void 0 ? _a : [],
202
- linesAdded: (_b = blk.linesAdded) !== null && _b !== void 0 ? _b : 0,
203
- linesRemoved: (_c = blk.linesRemoved) !== null && _c !== void 0 ? _c : 0
204
- });
205
- });
174
+ const signals = blocks.map((blk) => ({
175
+ id: blk.id,
176
+ state: rawTypeToState(blk.signal.type),
177
+ rawType: blk.signal.type,
178
+ label: blk.signal.label,
179
+ rowStart: blk.itemRange.start,
180
+ rowEnd: blk.itemRange.end,
181
+ lineCount: blk.lineCount,
182
+ // WorkBlock substrate fields
183
+ blockId: blk.id,
184
+ summary: blk.summary,
185
+ filesTouched: blk.filesTouched,
186
+ commits: blk.commits ?? [],
187
+ linesAdded: blk.linesAdded ?? 0,
188
+ linesRemoved: blk.linesRemoved ?? 0
189
+ }));
206
190
  // Assign signalId to transcript items via block ownership
207
- for (var _i = 0, signals_2 = signals; _i < signals_2.length; _i++) {
208
- var sig = signals_2[_i];
209
- for (var k = sig.rowStart; k <= sig.rowEnd && k < transcriptItems.length; k++) {
191
+ for (const sig of signals) {
192
+ for (let k = sig.rowStart; k <= sig.rowEnd && k < transcriptItems.length; k++) {
210
193
  transcriptItems[k].signalId = sig.id;
211
194
  }
212
195
  }
213
- return { items: transcriptItems, signals: signals };
196
+ return { items: transcriptItems, signals };
214
197
  }
215
198
  /**
216
199
  * A baked, realistic sample so /sankey always demos beautifully even with no live
217
200
  * session. Authored as raw transcript lines with real `jat-signal` calls, so it
218
201
  * flows through the EXACT same parser as live data.
219
202
  */
220
- export var SAMPLE_TRANSCRIPT_LINES = [
203
+ export const SAMPLE_TRANSCRIPT_LINES = [
221
204
  '',
222
205
  '› /jat:start GentleCoast jat-7h2k',
223
206
  '⏺ Bash(get-current-session-id)',
@@ -6,7 +6,7 @@ function readStorage(key) {
6
6
 
7
7
  try {
8
8
  return localStorage.getItem(key);
9
- } catch(_a) {
9
+ } catch {
10
10
  return null;
11
11
  }
12
12
  }
@@ -16,33 +16,32 @@ function writeStorage(key, value) {
16
16
 
17
17
  try {
18
18
  localStorage.setItem(key, value);
19
- } catch(_a) {
19
+ } catch {
20
20
  // silently fail if storage unavailable
21
21
  }
22
22
  }
23
23
 
24
24
  export function createSidebarState(options) {
25
- var _a, _b, _c;
26
- var storageKey = (_a = options === null || options === void 0 ? void 0 : options.storageKey) !== null && _a !== void 0 ? _a : 'jatui-sidebar';
27
- var defaultMode = (_b = options === null || options === void 0 ? void 0 : options.defaultMode) !== null && _b !== void 0 ? _b : 'expanded';
28
- var storedMode = readStorage(storageKey);
29
- var validModes = ['expanded', 'collapsed', 'icon'];
30
- var initialMode = storedMode && validModes.includes(storedMode) ? storedMode : defaultMode;
31
- var mode = $.state($.proxy(initialMode));
32
- var activeId = $.state($.proxy((_c = options === null || options === void 0 ? void 0 : options.defaultActiveId) !== null && _c !== void 0 ? _c : ''));
33
- var mobileOpen = $.state(false);
25
+ const storageKey = options?.storageKey ?? 'jatui-sidebar';
26
+ const defaultMode = options?.defaultMode ?? 'expanded';
27
+ const storedMode = readStorage(storageKey);
28
+ const validModes = ['expanded', 'collapsed', 'icon'];
29
+ const initialMode = storedMode && validModes.includes(storedMode) ? storedMode : defaultMode;
30
+ let mode = $.state($.proxy(initialMode));
31
+ let activeId = $.state($.proxy(options?.defaultActiveId ?? ''));
32
+ let mobileOpen = $.state(false);
34
33
 
35
34
  return {
36
35
  get mode() {
37
- return $.safe_get(mode);
36
+ return $.get(mode);
38
37
  },
39
38
 
40
39
  get activeId() {
41
- return $.safe_get(activeId);
40
+ return $.get(activeId);
42
41
  },
43
42
 
44
43
  get mobileOpen() {
45
- return $.safe_get(mobileOpen);
44
+ return $.get(mobileOpen);
46
45
  },
47
46
 
48
47
  setMode(m) {
@@ -51,7 +50,7 @@ export function createSidebarState(options) {
51
50
  },
52
51
 
53
52
  toggleCollapse() {
54
- var next = $.safe_get(mode) === 'expanded' ? 'icon' : 'expanded';
53
+ const next = $.get(mode) === 'expanded' ? 'icon' : 'expanded';
55
54
 
56
55
  $.set(mode, next, true);
57
56
  writeStorage(storageKey, next);
@@ -24,9 +24,9 @@ export function flexRender(component, props) {
24
24
  if (typeof component === 'string') {
25
25
  return { type: 'value', value: component };
26
26
  }
27
- var result = component(props);
27
+ const result = component(props);
28
28
  if (isSnippet(result)) {
29
- return { type: 'snippet', snippet: result, props: props };
29
+ return { type: 'snippet', snippet: result, props };
30
30
  }
31
31
  return { type: 'value', value: result };
32
32
  }
@@ -3,7 +3,7 @@
3
3
  * Each emoji has a character and searchable name.
4
4
  * Based on Unicode CLDR emoji ordering, minus most flags.
5
5
  */
6
- export var EMOJI_DATA = [
6
+ export const EMOJI_DATA = [
7
7
  {
8
8
  label: 'Smileys & Emotion',
9
9
  emojis: [
@@ -1186,11 +1186,11 @@ export var EMOJI_DATA = [
1186
1186
  },
1187
1187
  ];
1188
1188
  /** Flat array of all emojis for search */
1189
- export var ALL_EMOJIS = EMOJI_DATA.flatMap(function (g) { return g.emojis; });
1189
+ export const ALL_EMOJIS = EMOJI_DATA.flatMap((g) => g.emojis);
1190
1190
  /** Search emojis by name, returns matching entries */
1191
1191
  export function searchEmojis(query) {
1192
1192
  if (!query.trim())
1193
1193
  return [];
1194
- var terms = query.toLowerCase().split(/\s+/);
1195
- return ALL_EMOJIS.filter(function (e) { return terms.every(function (t) { return e.name.includes(t); }); });
1194
+ const terms = query.toLowerCase().split(/\s+/);
1195
+ return ALL_EMOJIS.filter((e) => terms.every((t) => e.name.includes(t)));
1196
1196
  }
@@ -1,27 +1,25 @@
1
1
  import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
2
- export var autoScroll = function (node, params) {
3
- var current = params !== null && params !== void 0 ? params : {};
2
+ export const autoScroll = (node, params) => {
3
+ let current = params ?? {};
4
4
  function register() {
5
5
  return autoScrollForElements({
6
6
  element: node,
7
- canScroll: function (_a) {
8
- var _b;
9
- var source = _a.source;
10
- if (!((_b = current.types) === null || _b === void 0 ? void 0 : _b.length))
7
+ canScroll: ({ source }) => {
8
+ if (!current.types?.length)
11
9
  return true;
12
10
  return current.types.includes(source.data.type);
13
11
  },
14
- getAllowedAxis: function () { var _a; return (_a = current.axis) !== null && _a !== void 0 ? _a : 'all'; },
15
- getConfiguration: function () { var _a; return ({ maxScrollSpeed: (_a = current.speed) !== null && _a !== void 0 ? _a : 'standard' }); },
12
+ getAllowedAxis: () => current.axis ?? 'all',
13
+ getConfiguration: () => ({ maxScrollSpeed: current.speed ?? 'standard' }),
16
14
  });
17
15
  }
18
- var cleanup = register();
16
+ let cleanup = register();
19
17
  return {
20
- update: function (next) {
21
- current = next !== null && next !== void 0 ? next : {};
18
+ update(next) {
19
+ current = next ?? {};
22
20
  cleanup();
23
21
  cleanup = register();
24
22
  },
25
- destroy: function () { return cleanup(); },
23
+ destroy: () => cleanup(),
26
24
  };
27
25
  };