@foldkit/devtools 0.129.0 → 0.131.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/dist/overlay.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
1
2
|
import { clsx } from 'clsx';
|
|
2
3
|
import { Array as Array_, Context, Effect, Function, HashSet, Match as M, Number as Number_, Option, Order, Predicate, Queue, Record, Schema as S, Stream, String as String_, SubscriptionRef, pipe, } from 'effect';
|
|
3
4
|
import { KeyValueStore } from 'effect/unstable/persistence';
|
|
4
5
|
import * as Command from 'foldkit/command';
|
|
5
6
|
import { DEVTOOLS_HOST_ID, GOT_MESSAGE_PATTERN, INIT_INDEX, extractSubmodelInfo, isTagged, latestEntryIndex, toInspectableValue, } from 'foldkit/devtools-host';
|
|
6
7
|
import { lockScroll, unlockScroll } from 'foldkit/dom';
|
|
7
|
-
import {
|
|
8
|
+
import { createKeyedLazy, createLazy, html } from 'foldkit/html';
|
|
8
9
|
import { m } from 'foldkit/message';
|
|
9
10
|
import { makeElement } from 'foldkit/runtime';
|
|
11
|
+
import { ts } from 'foldkit/schema';
|
|
10
12
|
import { evo } from 'foldkit/struct';
|
|
11
13
|
import * as Subscription from 'foldkit/subscription';
|
|
12
14
|
import { BrowserKeyValueStore } from '@effect/platform-browser';
|
|
@@ -54,7 +56,7 @@ const InspectorTabs = Tabs.create();
|
|
|
54
56
|
* through-traffic (different reference per frame iff different content),
|
|
55
57
|
* which makes reference equality the correct comparison.
|
|
56
58
|
*/
|
|
57
|
-
const UnknownByReference = S.Unknown.pipe(S.overrideToEquivalence(() => (a, b) => a === b));
|
|
59
|
+
const UnknownByReference = S.Unknown.pipe(S.overrideToEquivalence(() => __foldkitBrandViewResult(((a, b) => __foldkitBrandViewResult((a === b), "@foldkit/devtools/overlay.js#anonymous~2")), "@foldkit/devtools/overlay.js#anonymous")));
|
|
58
60
|
const Screen = S.Literals(['Messages', 'Settings']);
|
|
59
61
|
const Model = S.Struct({
|
|
60
62
|
isOpen: S.Boolean,
|
|
@@ -89,7 +91,7 @@ const Model = S.Struct({
|
|
|
89
91
|
// through the same import chain; the exact cause of the asymmetry isn't
|
|
90
92
|
// pinned down. Suspend is the conservative fix until the runtime ↔ overlay
|
|
91
93
|
// cycle is broken at the source.
|
|
92
|
-
scrubberSlider: S.suspend(() => Slider.Model),
|
|
94
|
+
scrubberSlider: S.suspend(() => __foldkitBrandViewResult((Slider.Model), "@foldkit/devtools/overlay.js#anonymous~3")),
|
|
93
95
|
scrubberValue: S.Number,
|
|
94
96
|
});
|
|
95
97
|
const Flags = S.Struct({
|
|
@@ -146,7 +148,7 @@ const GotSubmodelFilterMessage = m('GotSubmodelFilterMessage', {
|
|
|
146
148
|
});
|
|
147
149
|
// NOTE: suspend for the same init-order reason as scrubberSlider above.
|
|
148
150
|
const GotScrubberSliderMessage = m('GotScrubberSliderMessage', {
|
|
149
|
-
message: S.suspend(() => Slider.Message),
|
|
151
|
+
message: S.suspend(() => __foldkitBrandViewResult((Slider.Message), "@foldkit/devtools/overlay.js#anonymous~4")),
|
|
150
152
|
});
|
|
151
153
|
const Message = S.Union([
|
|
152
154
|
ClickedToggle,
|
|
@@ -183,7 +185,7 @@ const ALL_MESSAGES_VALUE = '';
|
|
|
183
185
|
const DEVTOOLS_STORAGE_KEY = 'foldkit-devtools';
|
|
184
186
|
const NO_COMMANDS = [];
|
|
185
187
|
const NO_MOUNTS = [];
|
|
186
|
-
const formatTimeDelta = (deltaMs) => M.value(deltaMs).pipe(M.when(0, () => '0ms'), M.when(Number_.isLessThan(MILLIS_PER_SECOND), ms => `+${Math.round(ms)}ms`), M.orElse(ms => `+${(ms / MILLIS_PER_SECOND).toFixed(1)}s`));
|
|
188
|
+
const formatTimeDelta = (deltaMs) => __foldkitBrandViewResult((M.value(deltaMs).pipe(M.when(0, () => __foldkitBrandViewResult(('0ms'), "@foldkit/devtools/overlay.js#anonymous~5")), M.when(Number_.isLessThan(MILLIS_PER_SECOND), ms => __foldkitBrandViewResult((`+${Math.round(ms)}ms`), "@foldkit/devtools/overlay.js#anonymous~6")), M.orElse(ms => __foldkitBrandViewResult((`+${(ms / MILLIS_PER_SECOND).toFixed(1)}s`), "@foldkit/devtools/overlay.js#anonymous~7")))), "@foldkit/devtools/overlay.js#formatTimeDelta");
|
|
187
189
|
const MESSAGE_LIST_SELECTOR = '.message-list';
|
|
188
190
|
// NOTE: scrubber slider value space is independent of the store's host
|
|
189
191
|
// indices. Slider value 0 represents init; 1..entries.length represents
|
|
@@ -191,21 +193,21 @@ const MESSAGE_LIST_SELECTOR = '.message-list';
|
|
|
191
193
|
// index) straight into setValue, or treating ChangedValue.value as a host
|
|
192
194
|
// index in jumpTo, will silently produce wrong navigation. Translate at
|
|
193
195
|
// the boundaries via the helpers below.
|
|
194
|
-
const hostIndexToSliderValue = (hostIndex, startIndex) => (hostIndex === INIT_INDEX ? 0 : hostIndex - startIndex + 1);
|
|
195
|
-
const sliderValueToHostIndex = (sliderValue, startIndex) => (sliderValue === 0 ? INIT_INDEX : startIndex + sliderValue - 1);
|
|
196
|
+
const hostIndexToSliderValue = (hostIndex, startIndex) => (__foldkitBrandViewResult((hostIndex === INIT_INDEX ? 0 : hostIndex - startIndex + 1), "@foldkit/devtools/overlay.js#hostIndexToSliderValue"));
|
|
197
|
+
const sliderValueToHostIndex = (sliderValue, startIndex) => (__foldkitBrandViewResult((sliderValue === 0 ? INIT_INDEX : startIndex + sliderValue - 1), "@foldkit/devtools/overlay.js#sliderValueToHostIndex"));
|
|
196
198
|
const SCROLL_FOLLOW_THRESHOLD_PX = 8;
|
|
197
|
-
const computeSubmodelTags = (entries) => pipe(entries, Array_.flatMap(({ submodelPath }) => submodelPath), Array_.dedupe, Array_.sort(Order.String));
|
|
198
|
-
const toDisplayCommand = (command) => ({
|
|
199
|
+
const computeSubmodelTags = (entries) => __foldkitBrandViewResult((pipe(entries, Array_.flatMap(({ submodelPath }) => __foldkitBrandViewResult((submodelPath), "@foldkit/devtools/overlay.js#anonymous~8")), Array_.dedupe, Array_.sort(Order.String))), "@foldkit/devtools/overlay.js#computeSubmodelTags");
|
|
200
|
+
const toDisplayCommand = (command) => (__foldkitBrandViewResult(({
|
|
199
201
|
name: command.name,
|
|
200
202
|
args: Option.fromNullishOr(command.args),
|
|
201
|
-
});
|
|
202
|
-
const toDisplayMount = (mount) => ({
|
|
203
|
+
}), "@foldkit/devtools/overlay.js#toDisplayCommand"));
|
|
204
|
+
const toDisplayMount = (mount) => (__foldkitBrandViewResult(({
|
|
203
205
|
name: mount.name,
|
|
204
206
|
args: Option.fromNullishOr(mount.args),
|
|
205
|
-
});
|
|
206
|
-
const toDisplayEntries = ({ entries }) => Array_.map(entries, entry => {
|
|
207
|
+
}), "@foldkit/devtools/overlay.js#toDisplayMount"));
|
|
208
|
+
const toDisplayEntries = ({ entries }) => __foldkitBrandViewResult((Array_.map(entries, entry => {
|
|
207
209
|
const { submodelPath, maybeLeafTag } = extractSubmodelInfo(entry.tag, entry.message);
|
|
208
|
-
return {
|
|
210
|
+
return __foldkitBrandViewResult(({
|
|
209
211
|
tag: entry.tag,
|
|
210
212
|
submodelPath,
|
|
211
213
|
maybeLeafTag,
|
|
@@ -214,35 +216,35 @@ const toDisplayEntries = ({ entries }) => Array_.map(entries, entry => {
|
|
|
214
216
|
mountEnds: Array_.map(entry.mountEnds, toDisplayMount),
|
|
215
217
|
timestamp: entry.timestamp,
|
|
216
218
|
isModelChanged: entry.isModelChanged,
|
|
217
|
-
};
|
|
218
|
-
});
|
|
219
|
-
const toDisplayState = (state) => ({
|
|
219
|
+
}), "@foldkit/devtools/overlay.js#anonymous~9");
|
|
220
|
+
})), "@foldkit/devtools/overlay.js#toDisplayEntries");
|
|
221
|
+
const toDisplayState = (state) => (__foldkitBrandViewResult(({
|
|
220
222
|
entries: toDisplayEntries(state),
|
|
221
223
|
initCommands: Array_.map(state.initCommands, toDisplayCommand),
|
|
222
224
|
initMountStarts: Array_.map(state.initMountStarts, toDisplayMount),
|
|
223
225
|
startIndex: state.startIndex,
|
|
224
226
|
isPaused: state.isPaused,
|
|
225
227
|
pausedAtIndex: state.pausedAtIndex,
|
|
226
|
-
});
|
|
228
|
+
}), "@foldkit/devtools/overlay.js#toDisplayState"));
|
|
227
229
|
const isExpandable = Predicate.isObjectOrArray;
|
|
228
|
-
const objectPreview = (value) => pipe(value, Record.keys, Array_.filter(key => key !== '_tag'), Array_.match({
|
|
229
|
-
onEmpty: () => '{}',
|
|
230
|
+
const objectPreview = (value) => __foldkitBrandViewResult((pipe(value, Record.keys, Array_.filter(key => __foldkitBrandViewResult((key !== '_tag'), "@foldkit/devtools/overlay.js#anonymous~10")), Array_.match({
|
|
231
|
+
onEmpty: () => __foldkitBrandViewResult(('{}'), "@foldkit/devtools/overlay.js#onEmpty"),
|
|
230
232
|
onNonEmpty: keys => {
|
|
231
233
|
const preview = pipe(keys, Array_.take(MAX_PREVIEW_KEYS), Array_.join(', '));
|
|
232
|
-
return Array_.length(keys) > MAX_PREVIEW_KEYS
|
|
234
|
+
return __foldkitBrandViewResult((Array_.length(keys) > MAX_PREVIEW_KEYS
|
|
233
235
|
? `{ ${preview}, … }`
|
|
234
|
-
: `{ ${preview} }
|
|
236
|
+
: `{ ${preview} }`), "@foldkit/devtools/overlay.js#onNonEmpty");
|
|
235
237
|
},
|
|
236
|
-
}));
|
|
237
|
-
const collapsedPreview = (value) => M.value(value).pipe(M.when(Array.isArray, array => `(${array.length})`), M.when(Predicate.isObject, objectPreview), M.orElse(() => ''));
|
|
238
|
+
}))), "@foldkit/devtools/overlay.js#objectPreview");
|
|
239
|
+
const collapsedPreview = (value) => __foldkitBrandViewResult((M.value(value).pipe(M.when(Array.isArray, array => __foldkitBrandViewResult((`(${array.length})`), "@foldkit/devtools/overlay.js#anonymous~11")), M.when(Predicate.isObject, objectPreview), M.orElse(() => __foldkitBrandViewResult((''), "@foldkit/devtools/overlay.js#anonymous~12")))), "@foldkit/devtools/overlay.js#collapsedPreview");
|
|
238
240
|
class StoreService extends Context.Service()('foldkit/DevToolsStore') {
|
|
239
241
|
}
|
|
240
242
|
class ShadowRootService extends Context.Service()('foldkit/DevToolsShadowRoot') {
|
|
241
243
|
}
|
|
242
244
|
export const LockScroll = Command.define('LockScroll', LockedScroll)(lockScroll.pipe(Effect.as(LockedScroll())));
|
|
243
245
|
export const UnlockScroll = Command.define('UnlockScroll', UnlockedScroll)(unlockScroll.pipe(Effect.as(UnlockedScroll())));
|
|
244
|
-
const maybeToggleScrollLock = (isEnabled, shouldLock) => OptionExt.when(isEnabled, shouldLock ? LockScroll() : UnlockScroll());
|
|
245
|
-
const maybeLockScroll = (isOpen, isMobile) => OptionExt.when(isOpen && isMobile, LockScroll());
|
|
246
|
+
const maybeToggleScrollLock = (isEnabled, shouldLock) => __foldkitBrandViewResult((OptionExt.when(isEnabled, shouldLock ? LockScroll() : UnlockScroll())), "@foldkit/devtools/overlay.js#maybeToggleScrollLock");
|
|
247
|
+
const maybeLockScroll = (isOpen, isMobile) => __foldkitBrandViewResult((OptionExt.when(isOpen && isMobile, LockScroll())), "@foldkit/devtools/overlay.js#maybeLockScroll");
|
|
246
248
|
const DevToolsPersistedState = S.Struct({
|
|
247
249
|
isOpen: S.Boolean.pipe(S.withDecodingDefault(Effect.succeed(false))),
|
|
248
250
|
isFlattened: S.Boolean.pipe(S.withDecodingDefault(Effect.succeed(false))),
|
|
@@ -255,54 +257,54 @@ const DEFAULT_PERSISTED_STATE = {
|
|
|
255
257
|
const readPersistedState = Effect.gen(function* () {
|
|
256
258
|
const store = yield* KeyValueStore.KeyValueStore;
|
|
257
259
|
const json = yield* Effect.fromOption(Option.fromNullishOr(yield* store.get(DEVTOOLS_STORAGE_KEY)));
|
|
258
|
-
return yield* S.decodeEffect(DevToolsPersistedStateJson)(json);
|
|
259
|
-
}).pipe(Effect.catch(() => Effect.succeed(DEFAULT_PERSISTED_STATE)), Effect.provide(BrowserKeyValueStore.layerLocalStorage));
|
|
260
|
-
export const PersistDevToolsState = Command.define('PersistDevToolsState', { isOpen: S.Boolean, isFlattened: S.Boolean }, CompletedPersistDevToolsState)(({ isOpen, isFlattened }) => Effect.gen(function* () {
|
|
260
|
+
return __foldkitBrandViewResult((yield* S.decodeEffect(DevToolsPersistedStateJson)(json)), "@foldkit/devtools/overlay.js#anonymous~13");
|
|
261
|
+
}).pipe(Effect.catch(() => __foldkitBrandViewResult((Effect.succeed(DEFAULT_PERSISTED_STATE)), "@foldkit/devtools/overlay.js#anonymous~14")), Effect.provide(BrowserKeyValueStore.layerLocalStorage));
|
|
262
|
+
export const PersistDevToolsState = Command.define('PersistDevToolsState', { isOpen: S.Boolean, isFlattened: S.Boolean }, CompletedPersistDevToolsState)(({ isOpen, isFlattened }) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
261
263
|
const store = yield* KeyValueStore.KeyValueStore;
|
|
262
264
|
const json = yield* S.encodeEffect(DevToolsPersistedStateJson)({
|
|
263
265
|
isOpen,
|
|
264
266
|
isFlattened,
|
|
265
267
|
});
|
|
266
268
|
yield* store.set(DEVTOOLS_STORAGE_KEY, json);
|
|
267
|
-
return CompletedPersistDevToolsState();
|
|
268
|
-
}).pipe(Effect.catch(() => Effect.succeed(CompletedPersistDevToolsState())), Effect.provide(BrowserKeyValueStore.layerLocalStorage)));
|
|
269
|
-
const buildInspectionFromModel = (index, model) => Effect.gen(function* () {
|
|
269
|
+
return __foldkitBrandViewResult((CompletedPersistDevToolsState()), "@foldkit/devtools/overlay.js#anonymous~16");
|
|
270
|
+
}).pipe(Effect.catch(() => __foldkitBrandViewResult((Effect.succeed(CompletedPersistDevToolsState())), "@foldkit/devtools/overlay.js#anonymous~17")), Effect.provide(BrowserKeyValueStore.layerLocalStorage))), "@foldkit/devtools/overlay.js#anonymous~15"));
|
|
271
|
+
const buildInspectionFromModel = (index, model) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
270
272
|
const store = yield* StoreService;
|
|
271
273
|
const maybeMessage = yield* store.getMessageAtIndex(index);
|
|
272
274
|
const diff = yield* store.getDiffAtIndex(index);
|
|
273
|
-
return ReceivedInspectedState({ model, maybeMessage, ...diff });
|
|
274
|
-
});
|
|
275
|
-
const buildInspectionEffect = (index) => Effect.gen(function* () {
|
|
275
|
+
return __foldkitBrandViewResult((ReceivedInspectedState({ model, maybeMessage, ...diff })), "@foldkit/devtools/overlay.js#anonymous~18");
|
|
276
|
+
})), "@foldkit/devtools/overlay.js#buildInspectionFromModel");
|
|
277
|
+
const buildInspectionEffect = (index) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
276
278
|
const store = yield* StoreService;
|
|
277
279
|
const model = yield* store.getModelAtIndex(index);
|
|
278
|
-
return yield* buildInspectionFromModel(index, model);
|
|
279
|
-
});
|
|
280
|
+
return __foldkitBrandViewResult((yield* buildInspectionFromModel(index, model)), "@foldkit/devtools/overlay.js#anonymous~19");
|
|
281
|
+
})), "@foldkit/devtools/overlay.js#buildInspectionEffect");
|
|
280
282
|
// NOTE: jump and inspect both need the model at `index`. Resolving it twice
|
|
281
283
|
// (once to render the host, once to feed the inspector) replays the segment
|
|
282
284
|
// from the nearest keyframe twice for a mid-segment jump. `store.jumpTo`
|
|
283
285
|
// returns the model it resolved so the inspector reuses that single
|
|
284
286
|
// resolution. Inspect-only navigation (no host pause) still uses
|
|
285
287
|
// `InspectState`, which resolves once on its own.
|
|
286
|
-
export const JumpToAndInspect = Command.define('JumpToAndInspect', { index: S.Number }, ReceivedInspectedState)(({ index }) => Effect.gen(function* () {
|
|
288
|
+
export const JumpToAndInspect = Command.define('JumpToAndInspect', { index: S.Number }, ReceivedInspectedState)(({ index }) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
287
289
|
const store = yield* StoreService;
|
|
288
290
|
const model = yield* store.jumpTo(index);
|
|
289
|
-
return yield* buildInspectionFromModel(index, model);
|
|
290
|
-
}));
|
|
291
|
-
export const InspectState = Command.define('InspectState', { index: S.Number }, ReceivedInspectedState)(({ index }) => buildInspectionEffect(index));
|
|
291
|
+
return __foldkitBrandViewResult((yield* buildInspectionFromModel(index, model)), "@foldkit/devtools/overlay.js#anonymous~21");
|
|
292
|
+
})), "@foldkit/devtools/overlay.js#anonymous~20"));
|
|
293
|
+
export const InspectState = Command.define('InspectState', { index: S.Number }, ReceivedInspectedState)(({ index }) => __foldkitBrandViewResult((buildInspectionEffect(index)), "@foldkit/devtools/overlay.js#anonymous~22"));
|
|
292
294
|
export const InspectLatest = Command.define('InspectLatest', ReceivedInspectedState)(Effect.gen(function* () {
|
|
293
295
|
const store = yield* StoreService;
|
|
294
296
|
const state = yield* SubscriptionRef.get(store.stateRef);
|
|
295
|
-
return yield* buildInspectionEffect(latestEntryIndex(state));
|
|
297
|
+
return __foldkitBrandViewResult((yield* buildInspectionEffect(latestEntryIndex(state))), "@foldkit/devtools/overlay.js#anonymous~23");
|
|
296
298
|
}));
|
|
297
299
|
export const Resume = Command.define('Resume', CompletedResume)(Effect.gen(function* () {
|
|
298
300
|
const store = yield* StoreService;
|
|
299
301
|
yield* store.resume;
|
|
300
|
-
return CompletedResume();
|
|
302
|
+
return __foldkitBrandViewResult((CompletedResume()), "@foldkit/devtools/overlay.js#anonymous~24");
|
|
301
303
|
}));
|
|
302
304
|
export const Clear = Command.define('Clear', CompletedClear)(Effect.gen(function* () {
|
|
303
305
|
const store = yield* StoreService;
|
|
304
306
|
yield* store.clear;
|
|
305
|
-
return CompletedClear();
|
|
307
|
+
return __foldkitBrandViewResult((CompletedClear()), "@foldkit/devtools/overlay.js#anonymous~25");
|
|
306
308
|
}));
|
|
307
309
|
export const ScrollToTop = Command.define('ScrollToTop', ScrolledToTop)(Effect.gen(function* () {
|
|
308
310
|
const shadow = yield* ShadowRootService;
|
|
@@ -310,21 +312,21 @@ export const ScrollToTop = Command.define('ScrollToTop', ScrolledToTop)(Effect.g
|
|
|
310
312
|
if (messageList instanceof HTMLElement) {
|
|
311
313
|
messageList.scrollTop = 0;
|
|
312
314
|
}
|
|
313
|
-
return ScrolledToTop();
|
|
315
|
+
return __foldkitBrandViewResult((ScrolledToTop()), "@foldkit/devtools/overlay.js#anonymous~26");
|
|
314
316
|
}));
|
|
315
317
|
const makeUpdate = (store, shadow, mode) => {
|
|
316
|
-
const provideContext = (effect) => effect.pipe(Effect.provideService(StoreService, store), Effect.provideService(ShadowRootService, shadow));
|
|
318
|
+
const provideContext = (effect) => __foldkitBrandViewResult((effect.pipe(Effect.provideService(StoreService, store), Effect.provideService(ShadowRootService, shadow))), "@foldkit/devtools/overlay.js#provideContext");
|
|
317
319
|
const inspectLatest = Command.mapEffect(InspectLatest(), provideContext);
|
|
318
320
|
const resume = Command.mapEffect(Resume(), provideContext);
|
|
319
321
|
const clear = Command.mapEffect(Clear(), provideContext);
|
|
320
322
|
const scrollToTop = Command.mapEffect(ScrollToTop(), provideContext);
|
|
321
|
-
const jumpToAndInspect = (index) => Command.mapEffect(JumpToAndInspect({ index }), provideContext);
|
|
322
|
-
const inspectState = (index) => Command.mapEffect(InspectState({ index }), provideContext);
|
|
323
|
-
return (model, message) => M.value(message).pipe(M.withReturnType(), M.tags({
|
|
323
|
+
const jumpToAndInspect = (index) => __foldkitBrandViewResult((Command.mapEffect(JumpToAndInspect({ index }), provideContext)), "@foldkit/devtools/overlay.js#jumpToAndInspect");
|
|
324
|
+
const inspectState = (index) => __foldkitBrandViewResult((Command.mapEffect(InspectState({ index }), provideContext)), "@foldkit/devtools/overlay.js#inspectState");
|
|
325
|
+
return __foldkitBrandViewResult(((model, message) => __foldkitBrandViewResult((M.value(message).pipe(M.withReturnType(), M.tags({
|
|
324
326
|
ClickedToggle: () => {
|
|
325
327
|
const nextIsOpen = !model.isOpen;
|
|
326
|
-
return [
|
|
327
|
-
evo(model, { isOpen: () => nextIsOpen }),
|
|
328
|
+
return __foldkitBrandViewResult(([
|
|
329
|
+
evo(model, { isOpen: () => __foldkitBrandViewResult((nextIsOpen), "@foldkit/devtools/overlay.js#isOpen") }),
|
|
328
330
|
[
|
|
329
331
|
...Option.toArray(maybeToggleScrollLock(model.isMobile, nextIsOpen)),
|
|
330
332
|
PersistDevToolsState({
|
|
@@ -332,167 +334,167 @@ const makeUpdate = (store, shadow, mode) => {
|
|
|
332
334
|
isFlattened: model.isFlattened,
|
|
333
335
|
}),
|
|
334
336
|
],
|
|
335
|
-
];
|
|
337
|
+
]), "@foldkit/devtools/overlay.js#ClickedToggle");
|
|
336
338
|
},
|
|
337
|
-
ClickedSettingsToggle: () => [
|
|
339
|
+
ClickedSettingsToggle: () => __foldkitBrandViewResult(([
|
|
338
340
|
evo(model, {
|
|
339
|
-
screen: currentScreen => M.value(currentScreen).pipe(M.withReturnType(), M.when('Messages', () => 'Settings'), M.when('Settings', () => 'Messages'), M.exhaustive),
|
|
341
|
+
screen: currentScreen => __foldkitBrandViewResult((M.value(currentScreen).pipe(M.withReturnType(), M.when('Messages', () => __foldkitBrandViewResult(('Settings'), "@foldkit/devtools/overlay.js#anonymous~28")), M.when('Settings', () => __foldkitBrandViewResult(('Messages'), "@foldkit/devtools/overlay.js#anonymous~29")), M.exhaustive)), "@foldkit/devtools/overlay.js#screen"),
|
|
340
342
|
}),
|
|
341
343
|
[],
|
|
342
|
-
],
|
|
343
|
-
ToggledFlatten: ({ isFlattened }) => [
|
|
344
|
-
evo(model, { isFlattened: () => isFlattened }),
|
|
344
|
+
]), "@foldkit/devtools/overlay.js#ClickedSettingsToggle"),
|
|
345
|
+
ToggledFlatten: ({ isFlattened }) => __foldkitBrandViewResult(([
|
|
346
|
+
evo(model, { isFlattened: () => __foldkitBrandViewResult((isFlattened), "@foldkit/devtools/overlay.js#isFlattened") }),
|
|
345
347
|
[PersistDevToolsState({ isOpen: model.isOpen, isFlattened })],
|
|
346
|
-
],
|
|
347
|
-
CrossedMobileBreakpoint: ({ isMobile }) => [
|
|
348
|
-
evo(model, { isMobile: () => isMobile }),
|
|
348
|
+
]), "@foldkit/devtools/overlay.js#ToggledFlatten"),
|
|
349
|
+
CrossedMobileBreakpoint: ({ isMobile }) => __foldkitBrandViewResult(([
|
|
350
|
+
evo(model, { isMobile: () => __foldkitBrandViewResult((isMobile), "@foldkit/devtools/overlay.js#isMobile") }),
|
|
349
351
|
Option.toArray(maybeToggleScrollLock(model.isOpen, isMobile)),
|
|
350
|
-
],
|
|
351
|
-
ClickedRow: ({ index }) => M.value(mode).pipe(M.withReturnType(), M.when('TimeTravel', () => [model, [jumpToAndInspect(index)]]), M.when('Inspect', () => [
|
|
352
|
+
]), "@foldkit/devtools/overlay.js#CrossedMobileBreakpoint"),
|
|
353
|
+
ClickedRow: ({ index }) => __foldkitBrandViewResult((M.value(mode).pipe(M.withReturnType(), M.when('TimeTravel', () => __foldkitBrandViewResult(([model, [jumpToAndInspect(index)]]), "@foldkit/devtools/overlay.js#anonymous~30")), M.when('Inspect', () => __foldkitBrandViewResult(([
|
|
352
354
|
evo(model, {
|
|
353
|
-
selectedIndex: () => index,
|
|
354
|
-
isFollowingLatest: () => false,
|
|
355
|
+
selectedIndex: () => __foldkitBrandViewResult((index), "@foldkit/devtools/overlay.js#selectedIndex"),
|
|
356
|
+
isFollowingLatest: () => __foldkitBrandViewResult((false), "@foldkit/devtools/overlay.js#isFollowingLatest"),
|
|
355
357
|
}),
|
|
356
358
|
[inspectState(index)],
|
|
357
|
-
]), M.exhaustive),
|
|
358
|
-
ClickedResume: () => [
|
|
359
|
+
]), "@foldkit/devtools/overlay.js#anonymous~31")), M.exhaustive)), "@foldkit/devtools/overlay.js#ClickedRow"),
|
|
360
|
+
ClickedResume: () => __foldkitBrandViewResult(([
|
|
359
361
|
evo(model, {
|
|
360
|
-
isFollowingTop: () => true,
|
|
361
|
-
expandedPaths: () => HashSet.empty(),
|
|
362
|
-
changedPaths: () => HashSet.empty(),
|
|
363
|
-
affectedPaths: () => HashSet.empty(),
|
|
362
|
+
isFollowingTop: () => __foldkitBrandViewResult((true), "@foldkit/devtools/overlay.js#isFollowingTop"),
|
|
363
|
+
expandedPaths: () => __foldkitBrandViewResult((HashSet.empty()), "@foldkit/devtools/overlay.js#expandedPaths"),
|
|
364
|
+
changedPaths: () => __foldkitBrandViewResult((HashSet.empty()), "@foldkit/devtools/overlay.js#changedPaths"),
|
|
365
|
+
affectedPaths: () => __foldkitBrandViewResult((HashSet.empty()), "@foldkit/devtools/overlay.js#affectedPaths"),
|
|
364
366
|
}),
|
|
365
367
|
[resume, inspectLatest, scrollToTop],
|
|
366
|
-
],
|
|
367
|
-
ClickedClear: () => [
|
|
368
|
+
]), "@foldkit/devtools/overlay.js#ClickedResume"),
|
|
369
|
+
ClickedClear: () => __foldkitBrandViewResult(([
|
|
368
370
|
evo(model, {
|
|
369
|
-
selectedIndex: () => INIT_INDEX,
|
|
370
|
-
isFollowingLatest: () => true,
|
|
371
|
-
isFollowingTop: () => true,
|
|
372
|
-
maybeSubmodelFilter: () => Option.none(),
|
|
373
|
-
expandedPaths: () => HashSet.empty(),
|
|
374
|
-
changedPaths: () => HashSet.empty(),
|
|
375
|
-
affectedPaths: () => HashSet.empty(),
|
|
371
|
+
selectedIndex: () => __foldkitBrandViewResult((INIT_INDEX), "@foldkit/devtools/overlay.js#selectedIndex~2"),
|
|
372
|
+
isFollowingLatest: () => __foldkitBrandViewResult((true), "@foldkit/devtools/overlay.js#isFollowingLatest~2"),
|
|
373
|
+
isFollowingTop: () => __foldkitBrandViewResult((true), "@foldkit/devtools/overlay.js#isFollowingTop~2"),
|
|
374
|
+
maybeSubmodelFilter: () => __foldkitBrandViewResult((Option.none()), "@foldkit/devtools/overlay.js#maybeSubmodelFilter"),
|
|
375
|
+
expandedPaths: () => __foldkitBrandViewResult((HashSet.empty()), "@foldkit/devtools/overlay.js#expandedPaths~2"),
|
|
376
|
+
changedPaths: () => __foldkitBrandViewResult((HashSet.empty()), "@foldkit/devtools/overlay.js#changedPaths~2"),
|
|
377
|
+
affectedPaths: () => __foldkitBrandViewResult((HashSet.empty()), "@foldkit/devtools/overlay.js#affectedPaths~2"),
|
|
376
378
|
}),
|
|
377
379
|
[clear, inspectLatest, scrollToTop],
|
|
378
|
-
],
|
|
380
|
+
]), "@foldkit/devtools/overlay.js#ClickedClear"),
|
|
379
381
|
ClickedFollowLatest: () => {
|
|
380
382
|
const latestIndex = Array_.match(model.entries, {
|
|
381
|
-
onEmpty: () => INIT_INDEX,
|
|
382
|
-
onNonEmpty: () => model.startIndex + model.entries.length - 1,
|
|
383
|
+
onEmpty: () => __foldkitBrandViewResult((INIT_INDEX), "@foldkit/devtools/overlay.js#onEmpty~2"),
|
|
384
|
+
onNonEmpty: () => __foldkitBrandViewResult((model.startIndex + model.entries.length - 1), "@foldkit/devtools/overlay.js#onNonEmpty~2"),
|
|
383
385
|
});
|
|
384
|
-
return [
|
|
386
|
+
return __foldkitBrandViewResult(([
|
|
385
387
|
evo(model, {
|
|
386
|
-
selectedIndex: () => latestIndex,
|
|
387
|
-
isFollowingLatest: () => true,
|
|
388
|
-
isFollowingTop: () => true,
|
|
389
|
-
expandedPaths: () => HashSet.empty(),
|
|
390
|
-
changedPaths: () => HashSet.empty(),
|
|
391
|
-
affectedPaths: () => HashSet.empty(),
|
|
388
|
+
selectedIndex: () => __foldkitBrandViewResult((latestIndex), "@foldkit/devtools/overlay.js#selectedIndex~3"),
|
|
389
|
+
isFollowingLatest: () => __foldkitBrandViewResult((true), "@foldkit/devtools/overlay.js#isFollowingLatest~3"),
|
|
390
|
+
isFollowingTop: () => __foldkitBrandViewResult((true), "@foldkit/devtools/overlay.js#isFollowingTop~3"),
|
|
391
|
+
expandedPaths: () => __foldkitBrandViewResult((HashSet.empty()), "@foldkit/devtools/overlay.js#expandedPaths~3"),
|
|
392
|
+
changedPaths: () => __foldkitBrandViewResult((HashSet.empty()), "@foldkit/devtools/overlay.js#changedPaths~3"),
|
|
393
|
+
affectedPaths: () => __foldkitBrandViewResult((HashSet.empty()), "@foldkit/devtools/overlay.js#affectedPaths~3"),
|
|
392
394
|
}),
|
|
393
395
|
[inspectLatest, scrollToTop],
|
|
394
|
-
];
|
|
396
|
+
]), "@foldkit/devtools/overlay.js#ClickedFollowLatest");
|
|
395
397
|
},
|
|
396
|
-
ClickedScrollToTopPill: () => [
|
|
398
|
+
ClickedScrollToTopPill: () => __foldkitBrandViewResult(([
|
|
397
399
|
evo(model, {
|
|
398
|
-
isFollowingTop: () => true,
|
|
400
|
+
isFollowingTop: () => __foldkitBrandViewResult((true), "@foldkit/devtools/overlay.js#isFollowingTop~4"),
|
|
399
401
|
}),
|
|
400
402
|
[scrollToTop],
|
|
401
|
-
],
|
|
403
|
+
]), "@foldkit/devtools/overlay.js#ClickedScrollToTopPill"),
|
|
402
404
|
ScrolledMessageList: ({ scrollTop }) => {
|
|
403
405
|
const isAtTop = scrollTop <= SCROLL_FOLLOW_THRESHOLD_PX;
|
|
404
|
-
return isAtTop === model.isFollowingTop
|
|
406
|
+
return __foldkitBrandViewResult((isAtTop === model.isFollowingTop
|
|
405
407
|
? [model, []]
|
|
406
|
-
: [evo(model, { isFollowingTop: () => isAtTop }), []];
|
|
408
|
+
: [evo(model, { isFollowingTop: () => __foldkitBrandViewResult((isAtTop), "@foldkit/devtools/overlay.js#isFollowingTop~5") }), []]), "@foldkit/devtools/overlay.js#ScrolledMessageList");
|
|
407
409
|
},
|
|
408
|
-
ReceivedInspectedState: ({ model: inspectedModel, maybeMessage, changedPaths, affectedPaths, }) => [
|
|
410
|
+
ReceivedInspectedState: ({ model: inspectedModel, maybeMessage, changedPaths, affectedPaths, }) => __foldkitBrandViewResult(([
|
|
409
411
|
evo(model, {
|
|
410
|
-
maybeInspectedModel: () => Option.some(inspectedModel),
|
|
411
|
-
maybeInspectedMessage: () => maybeMessage,
|
|
412
|
-
changedPaths: () => changedPaths,
|
|
413
|
-
affectedPaths: () => affectedPaths,
|
|
412
|
+
maybeInspectedModel: () => __foldkitBrandViewResult((Option.some(inspectedModel)), "@foldkit/devtools/overlay.js#maybeInspectedModel"),
|
|
413
|
+
maybeInspectedMessage: () => __foldkitBrandViewResult((maybeMessage), "@foldkit/devtools/overlay.js#maybeInspectedMessage"),
|
|
414
|
+
changedPaths: () => __foldkitBrandViewResult((changedPaths), "@foldkit/devtools/overlay.js#changedPaths~4"),
|
|
415
|
+
affectedPaths: () => __foldkitBrandViewResult((affectedPaths), "@foldkit/devtools/overlay.js#affectedPaths~4"),
|
|
414
416
|
}),
|
|
415
417
|
[],
|
|
416
|
-
],
|
|
418
|
+
]), "@foldkit/devtools/overlay.js#ReceivedInspectedState"),
|
|
417
419
|
GotInspectorTabsMessage: ({ message: tabsMessage }) => {
|
|
418
420
|
const [nextTabsModel, tabsCommands, maybeOutMessage] = InspectorTabs.update(model.inspectorTabs, tabsMessage);
|
|
419
421
|
const nextActiveInspectorTab = Option.match(maybeOutMessage, {
|
|
420
|
-
onNone: () => model.activeInspectorTab,
|
|
422
|
+
onNone: () => __foldkitBrandViewResult((model.activeInspectorTab), "@foldkit/devtools/overlay.js#onNone"),
|
|
421
423
|
onSome: M.type().pipe(M.tagsExhaustive({
|
|
422
|
-
Selected: ({ value }) => value,
|
|
424
|
+
Selected: ({ value }) => __foldkitBrandViewResult((value), "@foldkit/devtools/overlay.js#Selected"),
|
|
423
425
|
})),
|
|
424
426
|
});
|
|
425
|
-
return [
|
|
427
|
+
return __foldkitBrandViewResult(([
|
|
426
428
|
evo(model, {
|
|
427
|
-
inspectorTabs: () => nextTabsModel,
|
|
428
|
-
activeInspectorTab: () => nextActiveInspectorTab,
|
|
429
|
+
inspectorTabs: () => __foldkitBrandViewResult((nextTabsModel), "@foldkit/devtools/overlay.js#inspectorTabs"),
|
|
430
|
+
activeInspectorTab: () => __foldkitBrandViewResult((nextActiveInspectorTab), "@foldkit/devtools/overlay.js#activeInspectorTab"),
|
|
429
431
|
}),
|
|
430
|
-
Command.mapMessages(tabsCommands, message => GotInspectorTabsMessage({ message })),
|
|
431
|
-
];
|
|
432
|
+
Command.mapMessages(tabsCommands, message => __foldkitBrandViewResult((GotInspectorTabsMessage({ message })), "@foldkit/devtools/overlay.js#anonymous~32")),
|
|
433
|
+
]), "@foldkit/devtools/overlay.js#GotInspectorTabsMessage");
|
|
432
434
|
},
|
|
433
|
-
ToggledTreeNode: ({ path }) => [
|
|
435
|
+
ToggledTreeNode: ({ path }) => __foldkitBrandViewResult(([
|
|
434
436
|
evo(model, {
|
|
435
|
-
expandedPaths: paths => HashSet.has(paths, path)
|
|
437
|
+
expandedPaths: paths => __foldkitBrandViewResult((HashSet.has(paths, path)
|
|
436
438
|
? HashSet.remove(paths, path)
|
|
437
|
-
: HashSet.add(paths, path),
|
|
439
|
+
: HashSet.add(paths, path)), "@foldkit/devtools/overlay.js#expandedPaths~4"),
|
|
438
440
|
}),
|
|
439
441
|
[],
|
|
440
|
-
],
|
|
442
|
+
]), "@foldkit/devtools/overlay.js#ToggledTreeNode"),
|
|
441
443
|
ReceivedStoreUpdate: ({ entries, initCommands, initMountStarts, startIndex, isPaused, pausedAtIndex, }) => {
|
|
442
|
-
const shouldFollowSelection = M.value(mode).pipe(M.when('TimeTravel', () => !isPaused), M.when('Inspect', () => model.isFollowingLatest), M.exhaustive);
|
|
443
|
-
const shouldFollowScroll = M.value(mode).pipe(M.when('TimeTravel', () => !isPaused && model.isFollowingTop), M.when('Inspect', () => model.isFollowingTop), M.exhaustive);
|
|
444
|
+
const shouldFollowSelection = M.value(mode).pipe(M.when('TimeTravel', () => __foldkitBrandViewResult((!isPaused), "@foldkit/devtools/overlay.js#anonymous~33")), M.when('Inspect', () => __foldkitBrandViewResult((model.isFollowingLatest), "@foldkit/devtools/overlay.js#anonymous~34")), M.exhaustive);
|
|
445
|
+
const shouldFollowScroll = M.value(mode).pipe(M.when('TimeTravel', () => __foldkitBrandViewResult((!isPaused && model.isFollowingTop), "@foldkit/devtools/overlay.js#anonymous~35")), M.when('Inspect', () => __foldkitBrandViewResult((model.isFollowingTop), "@foldkit/devtools/overlay.js#anonymous~36")), M.exhaustive);
|
|
444
446
|
const latestIndex = Array_.match(entries, {
|
|
445
|
-
onEmpty: () => INIT_INDEX,
|
|
446
|
-
onNonEmpty: () => startIndex + entries.length - 1,
|
|
447
|
+
onEmpty: () => __foldkitBrandViewResult((INIT_INDEX), "@foldkit/devtools/overlay.js#onEmpty~3"),
|
|
448
|
+
onNonEmpty: () => __foldkitBrandViewResult((startIndex + entries.length - 1), "@foldkit/devtools/overlay.js#onNonEmpty~3"),
|
|
447
449
|
});
|
|
448
450
|
const nextSubmodelTags = computeSubmodelTags(entries);
|
|
449
|
-
const isFilterStale = Option.exists(model.maybeSubmodelFilter, filterTag => !Array_.contains(nextSubmodelTags, filterTag));
|
|
451
|
+
const isFilterStale = Option.exists(model.maybeSubmodelFilter, filterTag => __foldkitBrandViewResult((!Array_.contains(nextSubmodelTags, filterTag)), "@foldkit/devtools/overlay.js#anonymous~37"));
|
|
450
452
|
const sliderMax = entries.length;
|
|
451
453
|
const targetSliderValue = isPaused
|
|
452
454
|
? hostIndexToSliderValue(pausedAtIndex, startIndex)
|
|
453
455
|
: sliderMax;
|
|
454
|
-
return [
|
|
456
|
+
return __foldkitBrandViewResult(([
|
|
455
457
|
evo(model, {
|
|
456
|
-
entries: () => entries,
|
|
457
|
-
initCommands: () => initCommands,
|
|
458
|
-
initMountStarts: () => initMountStarts,
|
|
459
|
-
startIndex: () => startIndex,
|
|
460
|
-
isPaused: () => isPaused,
|
|
461
|
-
pausedAtIndex: () => pausedAtIndex,
|
|
462
|
-
submodelTags: () => nextSubmodelTags,
|
|
463
|
-
maybeSubmodelFilter: current => isFilterStale ? Option.none() : current,
|
|
464
|
-
selectedIndex: current => shouldFollowSelection ? latestIndex : current,
|
|
465
|
-
scrubberSlider: current => Slider.reflectRange(current, { min: 0, max: sliderMax }),
|
|
466
|
-
scrubberValue: current => M.value(model.scrubberSlider.dragState).pipe(M.tag('Dragging', () => Slider.snapAndClamp(current, 0, sliderMax, 1)), M.orElse(() => Slider.snapAndClamp(targetSliderValue, 0, sliderMax, 1))),
|
|
458
|
+
entries: () => __foldkitBrandViewResult((entries), "@foldkit/devtools/overlay.js#entries"),
|
|
459
|
+
initCommands: () => __foldkitBrandViewResult((initCommands), "@foldkit/devtools/overlay.js#initCommands"),
|
|
460
|
+
initMountStarts: () => __foldkitBrandViewResult((initMountStarts), "@foldkit/devtools/overlay.js#initMountStarts"),
|
|
461
|
+
startIndex: () => __foldkitBrandViewResult((startIndex), "@foldkit/devtools/overlay.js#startIndex"),
|
|
462
|
+
isPaused: () => __foldkitBrandViewResult((isPaused), "@foldkit/devtools/overlay.js#isPaused"),
|
|
463
|
+
pausedAtIndex: () => __foldkitBrandViewResult((pausedAtIndex), "@foldkit/devtools/overlay.js#pausedAtIndex"),
|
|
464
|
+
submodelTags: () => __foldkitBrandViewResult((nextSubmodelTags), "@foldkit/devtools/overlay.js#submodelTags"),
|
|
465
|
+
maybeSubmodelFilter: current => __foldkitBrandViewResult((isFilterStale ? Option.none() : current), "@foldkit/devtools/overlay.js#maybeSubmodelFilter~2"),
|
|
466
|
+
selectedIndex: current => __foldkitBrandViewResult((shouldFollowSelection ? latestIndex : current), "@foldkit/devtools/overlay.js#selectedIndex~4"),
|
|
467
|
+
scrubberSlider: current => __foldkitBrandViewResult((Slider.reflectRange(current, { min: 0, max: sliderMax })), "@foldkit/devtools/overlay.js#scrubberSlider"),
|
|
468
|
+
scrubberValue: current => __foldkitBrandViewResult((M.value(model.scrubberSlider.dragState).pipe(M.tag('Dragging', () => __foldkitBrandViewResult((Slider.snapAndClamp(current, 0, sliderMax, 1)), "@foldkit/devtools/overlay.js#anonymous~38")), M.orElse(() => __foldkitBrandViewResult((Slider.snapAndClamp(targetSliderValue, 0, sliderMax, 1)), "@foldkit/devtools/overlay.js#anonymous~39")))), "@foldkit/devtools/overlay.js#scrubberValue"),
|
|
467
469
|
}),
|
|
468
470
|
[
|
|
469
471
|
...(shouldFollowSelection ? [inspectLatest] : []),
|
|
470
472
|
...(shouldFollowScroll ? [scrollToTop] : []),
|
|
471
473
|
],
|
|
472
|
-
];
|
|
474
|
+
]), "@foldkit/devtools/overlay.js#ReceivedStoreUpdate");
|
|
473
475
|
},
|
|
474
476
|
GotSubmodelFilterMessage: ({ message: listboxMessage }) => {
|
|
475
477
|
const [nextListboxModel, listboxCommands, maybeOutMessage] = SubmodelFilterListbox.update(model.submodelFilterListbox, listboxMessage);
|
|
476
|
-
const mappedCommands = Command.mapMessages(listboxCommands, message => GotSubmodelFilterMessage({ message }));
|
|
477
|
-
return Option.match(maybeOutMessage, {
|
|
478
|
-
onNone: () => [
|
|
479
|
-
evo(model, { submodelFilterListbox: () => nextListboxModel }),
|
|
478
|
+
const mappedCommands = Command.mapMessages(listboxCommands, message => __foldkitBrandViewResult((GotSubmodelFilterMessage({ message })), "@foldkit/devtools/overlay.js#anonymous~40"));
|
|
479
|
+
return __foldkitBrandViewResult((Option.match(maybeOutMessage, {
|
|
480
|
+
onNone: () => __foldkitBrandViewResult(([
|
|
481
|
+
evo(model, { submodelFilterListbox: () => __foldkitBrandViewResult((nextListboxModel), "@foldkit/devtools/overlay.js#submodelFilterListbox") }),
|
|
480
482
|
mappedCommands,
|
|
481
|
-
],
|
|
483
|
+
]), "@foldkit/devtools/overlay.js#onNone~2"),
|
|
482
484
|
onSome: M.type().pipe(M.withReturnType(), M.tagsExhaustive({
|
|
483
|
-
Selected: ({ value }) => [
|
|
485
|
+
Selected: ({ value }) => __foldkitBrandViewResult(([
|
|
484
486
|
evo(model, {
|
|
485
|
-
maybeSubmodelFilter: () => Option.liftPredicate(value, String_.isNonEmpty),
|
|
486
|
-
submodelFilterListbox: () => nextListboxModel,
|
|
487
|
+
maybeSubmodelFilter: () => __foldkitBrandViewResult((Option.liftPredicate(value, String_.isNonEmpty)), "@foldkit/devtools/overlay.js#maybeSubmodelFilter~3"),
|
|
488
|
+
submodelFilterListbox: () => __foldkitBrandViewResult((nextListboxModel), "@foldkit/devtools/overlay.js#submodelFilterListbox~2"),
|
|
487
489
|
}),
|
|
488
490
|
mappedCommands,
|
|
489
|
-
],
|
|
491
|
+
]), "@foldkit/devtools/overlay.js#Selected~2"),
|
|
490
492
|
})),
|
|
491
|
-
});
|
|
493
|
+
})), "@foldkit/devtools/overlay.js#GotSubmodelFilterMessage");
|
|
492
494
|
},
|
|
493
495
|
GotScrubberSliderMessage: ({ message: sliderMessage }) => {
|
|
494
496
|
const [nextSlider, sliderCommands, maybeOutMessage] = Slider.update(model.scrubberSlider, sliderMessage);
|
|
495
|
-
const mappedSliderCommands = Command.mapMessages(sliderCommands, message => GotScrubberSliderMessage({ message }));
|
|
497
|
+
const mappedSliderCommands = Command.mapMessages(sliderCommands, message => __foldkitBrandViewResult((GotScrubberSliderMessage({ message })), "@foldkit/devtools/overlay.js#anonymous~41"));
|
|
496
498
|
// NOTE: the thumb tracks every pointermove (cheap, model-only via
|
|
497
499
|
// `nextSlider`), but the heavy jump-plus-inspect is coalesced to one
|
|
498
500
|
// navigation per animation frame. Each `ChangedValue` overwrites the
|
|
@@ -500,61 +502,61 @@ const makeUpdate = (store, shadow, mode) => {
|
|
|
500
502
|
// latest on the next frame, so a fast drag can't enqueue jumps faster
|
|
501
503
|
// than they complete.
|
|
502
504
|
const nextMaybePendingScrubIndex = Option.match(maybeOutMessage, {
|
|
503
|
-
onNone: () => model.maybePendingScrubIndex,
|
|
505
|
+
onNone: () => __foldkitBrandViewResult((model.maybePendingScrubIndex), "@foldkit/devtools/overlay.js#onNone~3"),
|
|
504
506
|
onSome: M.type().pipe(M.tagsExhaustive({
|
|
505
|
-
ChangedValue: ({ value }) => Option.some(sliderValueToHostIndex(value, model.startIndex)),
|
|
507
|
+
ChangedValue: ({ value }) => __foldkitBrandViewResult((Option.some(sliderValueToHostIndex(value, model.startIndex))), "@foldkit/devtools/overlay.js#ChangedValue"),
|
|
506
508
|
})),
|
|
507
509
|
});
|
|
508
510
|
const nextScrubberValue = Option.match(maybeOutMessage, {
|
|
509
|
-
onNone: () => model.scrubberValue,
|
|
511
|
+
onNone: () => __foldkitBrandViewResult((model.scrubberValue), "@foldkit/devtools/overlay.js#onNone~4"),
|
|
510
512
|
onSome: M.type().pipe(M.tagsExhaustive({
|
|
511
|
-
ChangedValue: ({ value }) => value,
|
|
513
|
+
ChangedValue: ({ value }) => __foldkitBrandViewResult((value), "@foldkit/devtools/overlay.js#ChangedValue~2"),
|
|
512
514
|
})),
|
|
513
515
|
});
|
|
514
|
-
return [
|
|
516
|
+
return __foldkitBrandViewResult(([
|
|
515
517
|
evo(model, {
|
|
516
|
-
scrubberSlider: () => nextSlider,
|
|
517
|
-
scrubberValue: () => nextScrubberValue,
|
|
518
|
-
maybePendingScrubIndex: () => nextMaybePendingScrubIndex,
|
|
518
|
+
scrubberSlider: () => __foldkitBrandViewResult((nextSlider), "@foldkit/devtools/overlay.js#scrubberSlider~2"),
|
|
519
|
+
scrubberValue: () => __foldkitBrandViewResult((nextScrubberValue), "@foldkit/devtools/overlay.js#scrubberValue~2"),
|
|
520
|
+
maybePendingScrubIndex: () => __foldkitBrandViewResult((nextMaybePendingScrubIndex), "@foldkit/devtools/overlay.js#maybePendingScrubIndex"),
|
|
519
521
|
}),
|
|
520
522
|
mappedSliderCommands,
|
|
521
|
-
];
|
|
523
|
+
]), "@foldkit/devtools/overlay.js#GotScrubberSliderMessage");
|
|
522
524
|
},
|
|
523
|
-
TickedScrubFrame: () => Option.match(model.maybePendingScrubIndex, {
|
|
524
|
-
onNone: () => [model, []],
|
|
525
|
-
onSome: (hostIndex) => [
|
|
526
|
-
evo(model, { maybePendingScrubIndex: () => Option.none() }),
|
|
525
|
+
TickedScrubFrame: () => __foldkitBrandViewResult((Option.match(model.maybePendingScrubIndex, {
|
|
526
|
+
onNone: () => __foldkitBrandViewResult(([model, []]), "@foldkit/devtools/overlay.js#onNone~5"),
|
|
527
|
+
onSome: (hostIndex) => __foldkitBrandViewResult(([
|
|
528
|
+
evo(model, { maybePendingScrubIndex: () => __foldkitBrandViewResult((Option.none()), "@foldkit/devtools/overlay.js#maybePendingScrubIndex~2") }),
|
|
527
529
|
[jumpToAndInspect(hostIndex)],
|
|
528
|
-
],
|
|
529
|
-
}),
|
|
530
|
-
}), M.tag('CompletedResume', 'CompletedClear', 'CompletedPersistDevToolsState', 'LockedScroll', 'UnlockedScroll', 'ScrolledToTop', () => [model, []]), M.exhaustive);
|
|
530
|
+
]), "@foldkit/devtools/overlay.js#onSome"),
|
|
531
|
+
})), "@foldkit/devtools/overlay.js#TickedScrubFrame"),
|
|
532
|
+
}), M.tag('CompletedResume', 'CompletedClear', 'CompletedPersistDevToolsState', 'LockedScroll', 'UnlockedScroll', 'ScrolledToTop', () => __foldkitBrandViewResult(([model, []]), "@foldkit/devtools/overlay.js#anonymous~42")), M.exhaustive)), "@foldkit/devtools/overlay.js#anonymous~27")), "@foldkit/devtools/overlay.js#makeUpdate");
|
|
531
533
|
};
|
|
532
534
|
// SUBSCRIPTION
|
|
533
535
|
const makeOverlaySubscriptions = (store, shadow) => {
|
|
534
|
-
const sliderSubscriptions = Slider.subscriptionsForRoot(() => shadow);
|
|
536
|
+
const sliderSubscriptions = Slider.subscriptionsForRoot(() => __foldkitBrandViewResult((shadow), "@foldkit/devtools/overlay.js#anonymous~43"));
|
|
535
537
|
const scrubberSubscriptions = Subscription.lift({
|
|
536
538
|
scrubberPointer: sliderSubscriptions.dragPointer,
|
|
537
539
|
scrubberEscape: sliderSubscriptions.dragEscape,
|
|
538
540
|
})({
|
|
539
|
-
toChildModel: model => model.scrubberSlider,
|
|
540
|
-
toParentMessage: message => GotScrubberSliderMessage({ message }),
|
|
541
|
+
toChildModel: model => __foldkitBrandViewResult((model.scrubberSlider), "@foldkit/devtools/overlay.js#toChildModel"),
|
|
542
|
+
toParentMessage: message => __foldkitBrandViewResult((GotScrubberSliderMessage({ message })), "@foldkit/devtools/overlay.js#toParentMessage"),
|
|
541
543
|
});
|
|
542
|
-
const ownSubscriptions = Subscription.make()(_entry => ({
|
|
544
|
+
const ownSubscriptions = Subscription.make()(_entry => (__foldkitBrandViewResult(({
|
|
543
545
|
scrubFrame: Subscription.animationFrame({
|
|
544
|
-
isActive: model => Option.isSome(model.maybePendingScrubIndex),
|
|
545
|
-
toMessage: () => TickedScrubFrame(),
|
|
546
|
+
isActive: model => __foldkitBrandViewResult((Option.isSome(model.maybePendingScrubIndex)), "@foldkit/devtools/overlay.js#isActive"),
|
|
547
|
+
toMessage: () => __foldkitBrandViewResult((TickedScrubFrame()), "@foldkit/devtools/overlay.js#toMessage"),
|
|
546
548
|
}),
|
|
547
|
-
storeUpdates: Subscription.persistent(Stream.concat(Stream.fromEffect(SubscriptionRef.get(store.stateRef).pipe(Effect.map(state => ReceivedStoreUpdate(toDisplayState(state))))), Stream.map(SubscriptionRef.changes(store.stateRef), state => ReceivedStoreUpdate(toDisplayState(state))))),
|
|
548
|
-
mobileBreakpoint: Subscription.persistent(Stream.callback(queue => Effect.acquireRelease(Effect.sync(() => {
|
|
549
|
+
storeUpdates: Subscription.persistent(Stream.concat(Stream.fromEffect(SubscriptionRef.get(store.stateRef).pipe(Effect.map(state => __foldkitBrandViewResult((ReceivedStoreUpdate(toDisplayState(state))), "@foldkit/devtools/overlay.js#anonymous~45")))), Stream.map(SubscriptionRef.changes(store.stateRef), state => __foldkitBrandViewResult((ReceivedStoreUpdate(toDisplayState(state))), "@foldkit/devtools/overlay.js#anonymous~46")))),
|
|
550
|
+
mobileBreakpoint: Subscription.persistent(Stream.callback(queue => __foldkitBrandViewResult((Effect.acquireRelease(Effect.sync(() => {
|
|
549
551
|
const mediaQuery = window.matchMedia(MOBILE_BREAKPOINT_QUERY);
|
|
550
552
|
const handler = (event) => {
|
|
551
553
|
Queue.offerUnsafe(queue, CrossedMobileBreakpoint({ isMobile: event.matches }));
|
|
552
554
|
};
|
|
553
555
|
mediaQuery.addEventListener('change', handler);
|
|
554
|
-
return { mediaQuery, handler };
|
|
555
|
-
}), ({ mediaQuery, handler }) => Effect.sync(() => mediaQuery.removeEventListener('change', handler))).pipe(Effect.flatMap(() => Effect.never)))),
|
|
556
|
-
}));
|
|
557
|
-
return Subscription.aggregate()(ownSubscriptions, scrubberSubscriptions);
|
|
556
|
+
return __foldkitBrandViewResult(({ mediaQuery, handler }), "@foldkit/devtools/overlay.js#anonymous~48");
|
|
557
|
+
}), ({ mediaQuery, handler }) => __foldkitBrandViewResult((Effect.sync(() => __foldkitBrandViewResult((mediaQuery.removeEventListener('change', handler)), "@foldkit/devtools/overlay.js#anonymous~50"))), "@foldkit/devtools/overlay.js#anonymous~49")).pipe(Effect.flatMap(() => __foldkitBrandViewResult((Effect.never), "@foldkit/devtools/overlay.js#anonymous~51")))), "@foldkit/devtools/overlay.js#anonymous~47"))),
|
|
558
|
+
}), "@foldkit/devtools/overlay.js#anonymous~44")));
|
|
559
|
+
return __foldkitBrandViewResult((Subscription.aggregate()(ownSubscriptions, scrubberSubscriptions)), "@foldkit/devtools/overlay.js#makeOverlaySubscriptions");
|
|
558
560
|
};
|
|
559
561
|
// VIEW
|
|
560
562
|
const indexClass = 'text-2xs text-dt-muted font-mono min-w-5';
|
|
@@ -579,20 +581,12 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
579
581
|
const lazyTabContent = createKeyedLazy();
|
|
580
582
|
const lazyMessageList = createLazy();
|
|
581
583
|
// JSON TREE
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
// `sel = tagName` with classes stored in `data.class`. Without per-role
|
|
586
|
-
// keys, two unkeyed spans with different classes (e.g. `.json-key` and
|
|
587
|
-
// `.diff-dot`) are sameVnode to snabbdom, so a single DOM span gets
|
|
588
|
-
// recycled across roles as rows transition shape \u2014 and the text-node
|
|
589
|
-
// children from the old role can leak into the new role's element.
|
|
590
|
-
// Keying by role pins each slot to its own DOM element.
|
|
591
|
-
const keyView = (key) => h.span([h.Key('key'), h.Class('json-key')], [`${key}:\u00a0`]);
|
|
584
|
+
const leafSpan = (className, text) => __foldkitBrandViewResult((h.span([h.Class(className)], [text])), "@foldkit/devtools/overlay.js#leafSpan");
|
|
585
|
+
const leafValueView = (value) => __foldkitBrandViewResult((M.value(value).pipe(M.when(Predicate.isNull, () => __foldkitBrandViewResult((leafSpan('json-null italic', 'null')), "@foldkit/devtools/overlay.js#anonymous~52")), M.when(Predicate.isUndefined, () => __foldkitBrandViewResult((leafSpan('json-null italic', 'undefined')), "@foldkit/devtools/overlay.js#anonymous~53")), M.when(Predicate.isString, stringValue => __foldkitBrandViewResult((leafSpan('json-string', `"${stringValue}"`)), "@foldkit/devtools/overlay.js#anonymous~54")), M.when(Predicate.isNumber, numberValue => __foldkitBrandViewResult((leafSpan('json-number', String(numberValue))), "@foldkit/devtools/overlay.js#anonymous~55")), M.when(Predicate.isBoolean, booleanValue => __foldkitBrandViewResult((leafSpan('json-boolean', String(booleanValue))), "@foldkit/devtools/overlay.js#anonymous~56")), M.orElse(unknownValue => __foldkitBrandViewResult((leafSpan('json-null', String(unknownValue))), "@foldkit/devtools/overlay.js#anonymous~57")))), "@foldkit/devtools/overlay.js#leafValueView");
|
|
586
|
+
const keyView = (key) => __foldkitBrandViewResult((h.span([h.Class('json-key')], [`${key}:\u00a0`])), "@foldkit/devtools/overlay.js#keyView");
|
|
592
587
|
const CHEVRON_RIGHT = 'M8.25 4.5l7.5 7.5-7.5 7.5';
|
|
593
588
|
const CHEVRON_DOWN = 'M19.5 8.25l-7.5 7.5-7.5-7.5';
|
|
594
|
-
const arrowView = (isExpanded) => h.svg([
|
|
595
|
-
h.Key('arrow'),
|
|
589
|
+
const arrowView = (isExpanded) => __foldkitBrandViewResult((h.svg([
|
|
596
590
|
h.AriaHidden(true),
|
|
597
591
|
h.Class('json-arrow shrink-0'),
|
|
598
592
|
h.Xmlns('http://www.w3.org/2000/svg'),
|
|
@@ -606,10 +600,33 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
606
600
|
h.StrokeLinejoin('round'),
|
|
607
601
|
h.D(isExpanded ? CHEVRON_DOWN : CHEVRON_RIGHT),
|
|
608
602
|
], []),
|
|
609
|
-
]);
|
|
610
|
-
const tagLabelView = (tag) => h.span([h.
|
|
611
|
-
const
|
|
603
|
+
])), "@foldkit/devtools/overlay.js#arrowView");
|
|
604
|
+
const tagLabelView = (tag) => __foldkitBrandViewResult((h.span([h.Class('json-tag')], [tag])), "@foldkit/devtools/overlay.js#tagLabelView");
|
|
605
|
+
const previewView = (preview) => __foldkitBrandViewResult((h.span([h.Class('json-preview')], [preview])), "@foldkit/devtools/overlay.js#previewView");
|
|
606
|
+
const diffDotView = h.span([h.Class('diff-dot')], []);
|
|
612
607
|
const inlineDiffDotView = h.span([h.Class('diff-dot-inline')], []);
|
|
608
|
+
const ArrowSegment = ts('ArrowSegment', { isExpanded: S.Boolean });
|
|
609
|
+
const DiffDotSegment = ts('DiffDotSegment');
|
|
610
|
+
const KeyLabelSegment = ts('KeyLabelSegment', { key: S.String });
|
|
611
|
+
const TagLabelSegment = ts('TagLabelSegment', { tag: S.String });
|
|
612
|
+
const PreviewSegment = ts('PreviewSegment', { preview: S.String });
|
|
613
|
+
const LeafValueSegment = ts('LeafValueSegment', { value: S.Unknown });
|
|
614
|
+
const RowSegment = S.Union([
|
|
615
|
+
ArrowSegment,
|
|
616
|
+
DiffDotSegment,
|
|
617
|
+
KeyLabelSegment,
|
|
618
|
+
TagLabelSegment,
|
|
619
|
+
PreviewSegment,
|
|
620
|
+
LeafValueSegment,
|
|
621
|
+
]);
|
|
622
|
+
const rowSegmentView = M.type().pipe(M.tagsExhaustive({
|
|
623
|
+
ArrowSegment: ({ isExpanded }) => __foldkitBrandViewResult((arrowView(isExpanded)), "@foldkit/devtools/overlay.js#ArrowSegment"),
|
|
624
|
+
DiffDotSegment: () => __foldkitBrandViewResult((diffDotView), "@foldkit/devtools/overlay.js#DiffDotSegment"),
|
|
625
|
+
KeyLabelSegment: ({ key }) => __foldkitBrandViewResult((keyView(key)), "@foldkit/devtools/overlay.js#KeyLabelSegment"),
|
|
626
|
+
TagLabelSegment: ({ tag }) => __foldkitBrandViewResult((tagLabelView(tag)), "@foldkit/devtools/overlay.js#TagLabelSegment"),
|
|
627
|
+
PreviewSegment: ({ preview }) => __foldkitBrandViewResult((previewView(preview)), "@foldkit/devtools/overlay.js#PreviewSegment"),
|
|
628
|
+
LeafValueSegment: ({ value }) => __foldkitBrandViewResult((leafValueView(value)), "@foldkit/devtools/overlay.js#LeafValueSegment"),
|
|
629
|
+
}));
|
|
613
630
|
const flattenTree = ({ value, treePath, depth, key, ...shared }) => {
|
|
614
631
|
const { rootPath, expandedPaths, changedPaths, affectedPaths, accumulator, indentRootChildren, } = shared;
|
|
615
632
|
const isRoot = treePath === rootPath;
|
|
@@ -633,46 +650,54 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
633
650
|
}
|
|
634
651
|
const childDepth = isRoot && !indentRootChildren ? depth : depth + 1;
|
|
635
652
|
if (Array.isArray(value)) {
|
|
636
|
-
value.forEach((item, arrayIndex) => flattenTree({
|
|
653
|
+
value.forEach((item, arrayIndex) => __foldkitBrandViewResult((flattenTree({
|
|
637
654
|
...shared,
|
|
638
655
|
value: item,
|
|
639
656
|
treePath: `${treePath}.${arrayIndex}`,
|
|
640
657
|
depth: childDepth,
|
|
641
658
|
key: String(arrayIndex),
|
|
642
|
-
}));
|
|
659
|
+
})), "@foldkit/devtools/overlay.js#anonymous~58"));
|
|
643
660
|
}
|
|
644
661
|
else if (Predicate.isObject(value)) {
|
|
645
|
-
pipe(value, Record.toEntries, Array_.filter(([entryKey]) => entryKey !== '_tag'), Array_.forEach(([entryKey, childValue]) => flattenTree({
|
|
662
|
+
pipe(value, Record.toEntries, Array_.filter(([entryKey]) => __foldkitBrandViewResult((entryKey !== '_tag'), "@foldkit/devtools/overlay.js#anonymous~59")), Array_.forEach(([entryKey, childValue]) => __foldkitBrandViewResult((flattenTree({
|
|
646
663
|
...shared,
|
|
647
664
|
value: childValue,
|
|
648
665
|
treePath: `${treePath}.${entryKey}`,
|
|
649
666
|
depth: childDepth,
|
|
650
667
|
key: entryKey,
|
|
651
|
-
})));
|
|
668
|
+
})), "@foldkit/devtools/overlay.js#anonymous~60")));
|
|
652
669
|
}
|
|
653
670
|
};
|
|
654
671
|
const flatNodeView = (value, treePath, depth, key, nodeIsExpandable, isExpanded, isChanged, isAffected, isRoot, tag) => {
|
|
655
672
|
const indent = h.Style({ paddingLeft: `${depth * TREE_INDENT_PX}px` });
|
|
656
673
|
const hasDiffDot = isChanged || isAffected;
|
|
657
674
|
if (!nodeIsExpandable) {
|
|
658
|
-
|
|
675
|
+
const rowSegments = [
|
|
676
|
+
...(hasDiffDot ? [DiffDotSegment()] : []),
|
|
677
|
+
...(String_.isNonEmpty(key) ? [KeyLabelSegment({ key })] : []),
|
|
678
|
+
LeafValueSegment({ value }),
|
|
679
|
+
];
|
|
680
|
+
return __foldkitBrandViewResult((h.ul([
|
|
659
681
|
h.Key(treePath),
|
|
660
682
|
h.Class(clsx('tree-row flex items-center gap-px font-mono text-2xs', {
|
|
661
683
|
'diff-changed': isChanged,
|
|
662
684
|
})),
|
|
663
685
|
indent,
|
|
664
|
-
], [
|
|
665
|
-
...(hasDiffDot ? [diffDotView] : []),
|
|
666
|
-
...(String_.isNonEmpty(key) ? [keyView(key)] : []),
|
|
667
|
-
leafValueView(value),
|
|
668
|
-
]);
|
|
686
|
+
], rowSegments.map(segment => __foldkitBrandViewResult((h.keyed('li')(segment._tag, [h.Class('contents')], [rowSegmentView(segment)])), "@foldkit/devtools/overlay.js#anonymous~61")))), "@foldkit/devtools/overlay.js#flatNodeView");
|
|
669
687
|
}
|
|
670
688
|
const preview = isExpanded
|
|
671
689
|
? Array.isArray(value)
|
|
672
690
|
? `(${value.length})`
|
|
673
691
|
: ''
|
|
674
692
|
: collapsedPreview(value);
|
|
675
|
-
|
|
693
|
+
const rowSegments = [
|
|
694
|
+
...(isRoot ? [] : [ArrowSegment({ isExpanded })]),
|
|
695
|
+
...(!isRoot && hasDiffDot ? [DiffDotSegment()] : []),
|
|
696
|
+
...(String_.isNonEmpty(key) ? [KeyLabelSegment({ key })] : []),
|
|
697
|
+
...(String_.isNonEmpty(tag) ? [TagLabelSegment({ tag })] : []),
|
|
698
|
+
PreviewSegment({ preview }),
|
|
699
|
+
];
|
|
700
|
+
return __foldkitBrandViewResult((h.ul([
|
|
676
701
|
h.Key(treePath),
|
|
677
702
|
h.Class(clsx('tree-row flex items-center gap-px font-mono text-2xs', {
|
|
678
703
|
'tree-row-expandable cursor-pointer': !isRoot,
|
|
@@ -680,15 +705,9 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
680
705
|
})),
|
|
681
706
|
indent,
|
|
682
707
|
...(isRoot ? [] : [h.OnClick(ToggledTreeNode({ path: treePath }))]),
|
|
683
|
-
], [
|
|
684
|
-
...(isRoot ? [] : [arrowView(isExpanded)]),
|
|
685
|
-
...(!isRoot && hasDiffDot ? [diffDotView] : []),
|
|
686
|
-
...(String_.isNonEmpty(key) ? [keyView(key)] : []),
|
|
687
|
-
...(String_.isNonEmpty(tag) ? [tagLabelView(tag)] : []),
|
|
688
|
-
h.span([h.Key('value'), h.Class('json-preview')], [preview]),
|
|
689
|
-
]);
|
|
708
|
+
], rowSegments.map(segment => __foldkitBrandViewResult((h.keyed('li')(segment._tag, [h.Class('contents')], [rowSegmentView(segment)])), "@foldkit/devtools/overlay.js#anonymous~62")))), "@foldkit/devtools/overlay.js#flatNodeView");
|
|
690
709
|
};
|
|
691
|
-
const renderFlatNode = (node) => lazyTreeNode(node.treePath, flatNodeView, [
|
|
710
|
+
const renderFlatNode = (node) => __foldkitBrandViewResult((lazyTreeNode(node.treePath, flatNodeView, [
|
|
692
711
|
node.value,
|
|
693
712
|
node.treePath,
|
|
694
713
|
node.depth,
|
|
@@ -699,7 +718,7 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
699
718
|
node.isAffected,
|
|
700
719
|
node.isRoot,
|
|
701
720
|
node.tag,
|
|
702
|
-
]);
|
|
721
|
+
])), "@foldkit/devtools/overlay.js#renderFlatNode");
|
|
703
722
|
const treeView = (value, rootPath, expandedPaths, changedPaths, affectedPaths, maybeRootLabel, indentRootChildren) => {
|
|
704
723
|
const nodes = [];
|
|
705
724
|
flattenTree({
|
|
@@ -710,53 +729,53 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
710
729
|
changedPaths,
|
|
711
730
|
affectedPaths,
|
|
712
731
|
depth: 0,
|
|
713
|
-
key: Option.getOrElse(maybeRootLabel, () => ''),
|
|
732
|
+
key: Option.getOrElse(maybeRootLabel, () => __foldkitBrandViewResult((''), "@foldkit/devtools/overlay.js#anonymous~63")),
|
|
714
733
|
accumulator: nodes,
|
|
715
734
|
indentRootChildren,
|
|
716
735
|
});
|
|
717
|
-
return h.div([
|
|
736
|
+
return __foldkitBrandViewResult((h.div([
|
|
718
737
|
h.Class('inspector-tree flex-1 overflow-auto min-h-0 min-w-0 overscroll-none'),
|
|
719
|
-
], nodes.map(renderFlatNode));
|
|
738
|
+
], nodes.map(renderFlatNode))), "@foldkit/devtools/overlay.js#treeView");
|
|
720
739
|
};
|
|
721
740
|
const inspectedTimestamp = (model) => {
|
|
722
741
|
const selectedIndex = selectedHistoryIndex(model);
|
|
723
742
|
if (selectedIndex === INIT_INDEX) {
|
|
724
|
-
return '0ms';
|
|
743
|
+
return __foldkitBrandViewResult(('0ms'), "@foldkit/devtools/overlay.js#inspectedTimestamp");
|
|
725
744
|
}
|
|
726
745
|
const baseTimestamp = pipe(model.entries, Array_.head, Option.match({
|
|
727
|
-
onNone: () => 0,
|
|
728
|
-
onSome: ({ timestamp }) => timestamp,
|
|
746
|
+
onNone: () => __foldkitBrandViewResult((0), "@foldkit/devtools/overlay.js#onNone~6"),
|
|
747
|
+
onSome: ({ timestamp }) => __foldkitBrandViewResult((timestamp), "@foldkit/devtools/overlay.js#onSome~2"),
|
|
729
748
|
}));
|
|
730
|
-
return pipe(Array_.get(model.entries, selectedIndex - model.startIndex), Option.map(entry => {
|
|
749
|
+
return __foldkitBrandViewResult((pipe(Array_.get(model.entries, selectedIndex - model.startIndex), Option.map(entry => {
|
|
731
750
|
const delta = entry.timestamp - baseTimestamp;
|
|
732
751
|
const seconds = Math.floor(delta / MILLIS_PER_SECOND);
|
|
733
752
|
const remainingMs = delta % MILLIS_PER_SECOND;
|
|
734
|
-
return seconds > 0
|
|
753
|
+
return __foldkitBrandViewResult((seconds > 0
|
|
735
754
|
? `+${seconds}s ${remainingMs.toFixed(1)}ms`
|
|
736
|
-
: `+${remainingMs.toFixed(1)}ms
|
|
737
|
-
}), Option.getOrElse(() => ''));
|
|
755
|
+
: `+${remainingMs.toFixed(1)}ms`), "@foldkit/devtools/overlay.js#anonymous~64");
|
|
756
|
+
}), Option.getOrElse(() => __foldkitBrandViewResult((''), "@foldkit/devtools/overlay.js#anonymous~65")))), "@foldkit/devtools/overlay.js#inspectedTimestamp");
|
|
738
757
|
};
|
|
739
758
|
const emptyInspectorView = h.div([
|
|
740
759
|
h.Class('flex-1 flex items-center justify-center text-dt-muted text-2xs font-mono min-w-0'),
|
|
741
760
|
], ['Click a message to inspect']);
|
|
742
|
-
const noMessageView = () => h.div([
|
|
761
|
+
const noMessageView = () => __foldkitBrandViewResult((h.div([
|
|
743
762
|
h.Class('flex-1 flex items-center justify-center text-dt-muted text-2xs font-mono min-w-0'),
|
|
744
|
-
], ['init: no Message']);
|
|
745
|
-
const modelTabContent = (inspectedModel, expandedPaths, changedPaths, affectedPaths) => treeView(inspectedModel, 'root', expandedPaths, changedPaths, affectedPaths, Option.none(), true);
|
|
763
|
+
], ['init: no Message'])), "@foldkit/devtools/overlay.js#noMessageView");
|
|
764
|
+
const modelTabContent = (inspectedModel, expandedPaths, changedPaths, affectedPaths) => __foldkitBrandViewResult((treeView(inspectedModel, 'root', expandedPaths, changedPaths, affectedPaths, Option.none(), true)), "@foldkit/devtools/overlay.js#modelTabContent");
|
|
746
765
|
const unwrapToLeaf = (message) => {
|
|
747
766
|
if (isTagged(message) &&
|
|
748
767
|
GOT_MESSAGE_PATTERN.test(message._tag) &&
|
|
749
768
|
Predicate.hasProperty(message, 'message') &&
|
|
750
769
|
Predicate.isNotUndefined(message.message)) {
|
|
751
|
-
return unwrapToLeaf(message.message);
|
|
770
|
+
return __foldkitBrandViewResult((unwrapToLeaf(message.message)), "@foldkit/devtools/overlay.js#unwrapToLeaf");
|
|
752
771
|
}
|
|
753
772
|
else {
|
|
754
|
-
return message;
|
|
773
|
+
return __foldkitBrandViewResult((message), "@foldkit/devtools/overlay.js#unwrapToLeaf");
|
|
755
774
|
}
|
|
756
775
|
};
|
|
757
776
|
const unwrapIfFiltered = (message, maybeSubmodelFilter) => {
|
|
758
777
|
if (Option.isNone(maybeSubmodelFilter)) {
|
|
759
|
-
return message;
|
|
778
|
+
return __foldkitBrandViewResult((message), "@foldkit/devtools/overlay.js#unwrapIfFiltered");
|
|
760
779
|
}
|
|
761
780
|
const { value: filterTag } = maybeSubmodelFilter;
|
|
762
781
|
let current = message;
|
|
@@ -775,44 +794,44 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
775
794
|
break;
|
|
776
795
|
}
|
|
777
796
|
}
|
|
778
|
-
return current;
|
|
797
|
+
return __foldkitBrandViewResult((current), "@foldkit/devtools/overlay.js#unwrapIfFiltered");
|
|
779
798
|
};
|
|
780
|
-
const messageTabContent = (maybeInspectedMessage, maybeSubmodelFilter, isFlattened, expandedPaths, timestamp) => Option.match(maybeInspectedMessage, {
|
|
799
|
+
const messageTabContent = (maybeInspectedMessage, maybeSubmodelFilter, isFlattened, expandedPaths, timestamp) => __foldkitBrandViewResult((Option.match(maybeInspectedMessage, {
|
|
781
800
|
onNone: noMessageView,
|
|
782
801
|
onSome: rawMessage => {
|
|
783
802
|
const message = isFlattened
|
|
784
803
|
? unwrapToLeaf(rawMessage)
|
|
785
804
|
: unwrapIfFiltered(rawMessage, maybeSubmodelFilter);
|
|
786
|
-
return h.div([h.Class('flex flex-col flex-1 min-h-0 min-w-0')], [
|
|
805
|
+
return __foldkitBrandViewResult((h.div([h.Class('flex flex-col flex-1 min-h-0 min-w-0')], [
|
|
787
806
|
h.div([
|
|
788
807
|
h.Class('px-2 py-1 border-b text-2xs text-dt-muted font-mono shrink-0'),
|
|
789
808
|
], [timestamp]),
|
|
790
809
|
h.div([h.Class('flex flex-col flex-1 min-h-0 min-w-0 pt-1 pl-1')], [
|
|
791
810
|
treeView(message, 'root', expandedPaths, HashSet.empty(), HashSet.empty(), Option.none(), false),
|
|
792
811
|
]),
|
|
793
|
-
]);
|
|
812
|
+
])), "@foldkit/devtools/overlay.js#onSome~3");
|
|
794
813
|
},
|
|
795
|
-
});
|
|
814
|
+
})), "@foldkit/devtools/overlay.js#messageTabContent");
|
|
796
815
|
const selectedHistoryIndex = (model) => {
|
|
797
816
|
const lastIndex = Array_.match(model.entries, {
|
|
798
|
-
onEmpty: () => INIT_INDEX,
|
|
799
|
-
onNonEmpty: () => model.startIndex + model.entries.length - 1,
|
|
817
|
+
onEmpty: () => __foldkitBrandViewResult((INIT_INDEX), "@foldkit/devtools/overlay.js#onEmpty~4"),
|
|
818
|
+
onNonEmpty: () => __foldkitBrandViewResult((model.startIndex + model.entries.length - 1), "@foldkit/devtools/overlay.js#onNonEmpty~4"),
|
|
800
819
|
});
|
|
801
|
-
return M.value(mode).pipe(M.when('TimeTravel', () => model.isPaused ? model.pausedAtIndex : lastIndex), M.when('Inspect', () => model.selectedIndex), M.exhaustive);
|
|
820
|
+
return __foldkitBrandViewResult((M.value(mode).pipe(M.when('TimeTravel', () => __foldkitBrandViewResult((model.isPaused ? model.pausedAtIndex : lastIndex), "@foldkit/devtools/overlay.js#anonymous~66")), M.when('Inspect', () => __foldkitBrandViewResult((model.selectedIndex), "@foldkit/devtools/overlay.js#anonymous~67")), M.exhaustive)), "@foldkit/devtools/overlay.js#selectedHistoryIndex");
|
|
802
821
|
};
|
|
803
822
|
const selectedCommands = (model) => {
|
|
804
823
|
const selectedIndex = selectedHistoryIndex(model);
|
|
805
824
|
if (selectedIndex === INIT_INDEX) {
|
|
806
|
-
return model.initCommands;
|
|
825
|
+
return __foldkitBrandViewResult((model.initCommands), "@foldkit/devtools/overlay.js#selectedCommands");
|
|
807
826
|
}
|
|
808
827
|
else {
|
|
809
|
-
return pipe(model.entries, Array_.get(selectedIndex - model.startIndex), Option.map(entry => entry.commands), Option.getOrElse(() => NO_COMMANDS));
|
|
828
|
+
return __foldkitBrandViewResult((pipe(model.entries, Array_.get(selectedIndex - model.startIndex), Option.map(entry => __foldkitBrandViewResult((entry.commands), "@foldkit/devtools/overlay.js#anonymous~68")), Option.getOrElse(() => __foldkitBrandViewResult((NO_COMMANDS), "@foldkit/devtools/overlay.js#anonymous~69")))), "@foldkit/devtools/overlay.js#selectedCommands");
|
|
810
829
|
}
|
|
811
830
|
};
|
|
812
831
|
const flattenCommand = (command, index, expandedPaths) => {
|
|
813
832
|
const taggedValue = Option.match(command.args, {
|
|
814
|
-
onNone: () => ({ _tag: command.name }),
|
|
815
|
-
onSome: argsValue => ({ ...argsValue, _tag: command.name }),
|
|
833
|
+
onNone: () => (__foldkitBrandViewResult(({ _tag: command.name }), "@foldkit/devtools/overlay.js#onNone~7")),
|
|
834
|
+
onSome: argsValue => (__foldkitBrandViewResult(({ ...argsValue, _tag: command.name }), "@foldkit/devtools/overlay.js#onSome~4")),
|
|
816
835
|
});
|
|
817
836
|
const rootPath = `command-${index}`;
|
|
818
837
|
const nodes = [];
|
|
@@ -828,38 +847,38 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
828
847
|
accumulator: nodes,
|
|
829
848
|
indentRootChildren: false,
|
|
830
849
|
});
|
|
831
|
-
return nodes;
|
|
850
|
+
return __foldkitBrandViewResult((nodes), "@foldkit/devtools/overlay.js#flattenCommand");
|
|
832
851
|
};
|
|
833
|
-
const commandsTabContent = (commands, expandedPaths) => Array_.match(commands, {
|
|
834
|
-
onEmpty: () => h.div([
|
|
852
|
+
const commandsTabContent = (commands, expandedPaths) => __foldkitBrandViewResult((Array_.match(commands, {
|
|
853
|
+
onEmpty: () => __foldkitBrandViewResult((h.div([
|
|
835
854
|
h.Class('flex-1 flex items-center justify-center text-dt-muted text-2xs font-mono min-w-0'),
|
|
836
|
-
], ['No Commands returned']),
|
|
837
|
-
onNonEmpty: commandList => h.div([
|
|
855
|
+
], ['No Commands returned'])), "@foldkit/devtools/overlay.js#onEmpty~5"),
|
|
856
|
+
onNonEmpty: commandList => __foldkitBrandViewResult((h.div([
|
|
838
857
|
h.Class('flex flex-col flex-1 min-h-0 min-w-0 overflow-auto overscroll-none'),
|
|
839
|
-
], Array_.map(commandList, (command, index) => h.div([h.Class('flex items-start px-2 py-1 border-b gap-1.5')], [
|
|
858
|
+
], Array_.map(commandList, (command, index) => __foldkitBrandViewResult((h.div([h.Class('flex items-start px-2 py-1 border-b gap-1.5')], [
|
|
840
859
|
h.span([h.Class(indexClass)], [String(index + 1)]),
|
|
841
860
|
h.div([h.Class('flex flex-col flex-1 min-w-0')], Array_.map(flattenCommand(command, index, expandedPaths), renderFlatNode)),
|
|
842
|
-
]))),
|
|
843
|
-
});
|
|
861
|
+
])), "@foldkit/devtools/overlay.js#anonymous~70")))), "@foldkit/devtools/overlay.js#onNonEmpty~5"),
|
|
862
|
+
})), "@foldkit/devtools/overlay.js#commandsTabContent");
|
|
844
863
|
const selectedMountActivity = (model) => {
|
|
845
864
|
const selectedIndex = selectedHistoryIndex(model);
|
|
846
865
|
if (selectedIndex === INIT_INDEX) {
|
|
847
|
-
return { starts: model.initMountStarts, ends: NO_MOUNTS };
|
|
866
|
+
return __foldkitBrandViewResult(({ starts: model.initMountStarts, ends: NO_MOUNTS }), "@foldkit/devtools/overlay.js#selectedMountActivity");
|
|
848
867
|
}
|
|
849
868
|
else {
|
|
850
|
-
return pipe(model.entries, Array_.get(selectedIndex - model.startIndex), Option.match({
|
|
851
|
-
onNone: () => ({ starts: NO_MOUNTS, ends: NO_MOUNTS }),
|
|
852
|
-
onSome: entry => ({
|
|
869
|
+
return __foldkitBrandViewResult((pipe(model.entries, Array_.get(selectedIndex - model.startIndex), Option.match({
|
|
870
|
+
onNone: () => (__foldkitBrandViewResult(({ starts: NO_MOUNTS, ends: NO_MOUNTS }), "@foldkit/devtools/overlay.js#onNone~8")),
|
|
871
|
+
onSome: entry => (__foldkitBrandViewResult(({
|
|
853
872
|
starts: entry.mountStarts,
|
|
854
873
|
ends: entry.mountEnds,
|
|
855
|
-
}),
|
|
856
|
-
}));
|
|
874
|
+
}), "@foldkit/devtools/overlay.js#onSome~5")),
|
|
875
|
+
}))), "@foldkit/devtools/overlay.js#selectedMountActivity");
|
|
857
876
|
}
|
|
858
877
|
};
|
|
859
878
|
const flattenMount = (mount, sectionLabel, index, expandedPaths) => {
|
|
860
879
|
const taggedValue = Option.match(mount.args, {
|
|
861
|
-
onNone: () => ({ _tag: mount.name }),
|
|
862
|
-
onSome: argsValue => ({ ...argsValue, _tag: mount.name }),
|
|
880
|
+
onNone: () => (__foldkitBrandViewResult(({ _tag: mount.name }), "@foldkit/devtools/overlay.js#onNone~9")),
|
|
881
|
+
onSome: argsValue => (__foldkitBrandViewResult(({ ...argsValue, _tag: mount.name }), "@foldkit/devtools/overlay.js#onSome~6")),
|
|
863
882
|
});
|
|
864
883
|
const rootPath = `mount-${sectionLabel}-${index}`;
|
|
865
884
|
const nodes = [];
|
|
@@ -875,26 +894,26 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
875
894
|
accumulator: nodes,
|
|
876
895
|
indentRootChildren: false,
|
|
877
896
|
});
|
|
878
|
-
return nodes;
|
|
897
|
+
return __foldkitBrandViewResult((nodes), "@foldkit/devtools/overlay.js#flattenMount");
|
|
879
898
|
};
|
|
880
|
-
const mountListSection = (label, mounts, expandedPaths) => h.div([h.Class('flex flex-col shrink-0')], [
|
|
899
|
+
const mountListSection = (label, mounts, expandedPaths) => __foldkitBrandViewResult((h.div([h.Class('flex flex-col shrink-0')], [
|
|
881
900
|
h.div([
|
|
882
901
|
h.Class('px-2 py-1 border-b text-2xs text-dt-muted font-mono shrink-0'),
|
|
883
902
|
], [label]),
|
|
884
|
-
...Array_.map(mounts, (mount, index) => h.div([h.Class('flex items-start px-2 py-1 border-b gap-1.5')], [
|
|
903
|
+
...Array_.map(mounts, (mount, index) => __foldkitBrandViewResult((h.div([h.Class('flex items-start px-2 py-1 border-b gap-1.5')], [
|
|
885
904
|
h.span([h.Class(indexClass)], [String(index + 1)]),
|
|
886
905
|
h.div([h.Class('flex flex-col flex-1 min-w-0')], Array_.map(flattenMount(mount, label, index, expandedPaths), renderFlatNode)),
|
|
887
|
-
])),
|
|
888
|
-
]);
|
|
906
|
+
])), "@foldkit/devtools/overlay.js#anonymous~71")),
|
|
907
|
+
])), "@foldkit/devtools/overlay.js#mountListSection");
|
|
889
908
|
const mountsTabContent = (starts, ends, expandedPaths) => {
|
|
890
909
|
const hasAny = Array_.isReadonlyArrayNonEmpty(starts) ||
|
|
891
910
|
Array_.isReadonlyArrayNonEmpty(ends);
|
|
892
911
|
if (!hasAny) {
|
|
893
|
-
return h.div([
|
|
912
|
+
return __foldkitBrandViewResult((h.div([
|
|
894
913
|
h.Class('flex-1 flex items-center justify-center text-dt-muted text-2xs font-mono min-w-0'),
|
|
895
|
-
], ['No Mounts during this render']);
|
|
914
|
+
], ['No Mounts during this render'])), "@foldkit/devtools/overlay.js#mountsTabContent");
|
|
896
915
|
}
|
|
897
|
-
return h.div([
|
|
916
|
+
return __foldkitBrandViewResult((h.div([
|
|
898
917
|
h.Class('flex flex-col flex-1 min-h-0 min-w-0 overflow-auto overscroll-none'),
|
|
899
918
|
], [
|
|
900
919
|
...(Array_.isReadonlyArrayNonEmpty(starts)
|
|
@@ -903,31 +922,31 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
903
922
|
...(Array_.isReadonlyArrayNonEmpty(ends)
|
|
904
923
|
? [mountListSection('Ended', ends, expandedPaths)]
|
|
905
924
|
: []),
|
|
906
|
-
]);
|
|
925
|
+
])), "@foldkit/devtools/overlay.js#mountsTabContent");
|
|
907
926
|
};
|
|
908
|
-
const inspectorTabContent = (model, tab, inspectedModel) => M.value(tab).pipe(M.when('Model', () => lazyTabContent('Model', modelTabContent, [
|
|
927
|
+
const inspectorTabContent = (model, tab, inspectedModel) => __foldkitBrandViewResult((M.value(tab).pipe(M.when('Model', () => __foldkitBrandViewResult((lazyTabContent('Model', modelTabContent, [
|
|
909
928
|
inspectedModel,
|
|
910
929
|
model.expandedPaths,
|
|
911
930
|
model.changedPaths,
|
|
912
931
|
model.affectedPaths,
|
|
913
|
-
])), M.when('Message', () => lazyTabContent('Message', messageTabContent, [
|
|
932
|
+
])), "@foldkit/devtools/overlay.js#anonymous~72")), M.when('Message', () => __foldkitBrandViewResult((lazyTabContent('Message', messageTabContent, [
|
|
914
933
|
model.maybeInspectedMessage,
|
|
915
934
|
model.maybeSubmodelFilter,
|
|
916
935
|
model.isFlattened,
|
|
917
936
|
model.expandedPaths,
|
|
918
937
|
inspectedTimestamp(model),
|
|
919
|
-
])), M.when('Commands', () => lazyTabContent('Commands', commandsTabContent, [
|
|
938
|
+
])), "@foldkit/devtools/overlay.js#anonymous~73")), M.when('Commands', () => __foldkitBrandViewResult((lazyTabContent('Commands', commandsTabContent, [
|
|
920
939
|
selectedCommands(model),
|
|
921
940
|
model.expandedPaths,
|
|
922
|
-
])), M.when('Mounts', () => {
|
|
941
|
+
])), "@foldkit/devtools/overlay.js#anonymous~74")), M.when('Mounts', () => {
|
|
923
942
|
const { starts, ends } = selectedMountActivity(model);
|
|
924
|
-
return lazyTabContent('Mounts', mountsTabContent, [
|
|
943
|
+
return __foldkitBrandViewResult((lazyTabContent('Mounts', mountsTabContent, [
|
|
925
944
|
starts,
|
|
926
945
|
ends,
|
|
927
946
|
model.expandedPaths,
|
|
928
|
-
]);
|
|
929
|
-
}), M.exhaustive);
|
|
930
|
-
const inspectorPaneView = (model) => h.div([
|
|
947
|
+
])), "@foldkit/devtools/overlay.js#anonymous~75");
|
|
948
|
+
}), M.exhaustive)), "@foldkit/devtools/overlay.js#inspectorTabContent");
|
|
949
|
+
const inspectorPaneView = (model) => __foldkitBrandViewResult((h.div([
|
|
931
950
|
h.Class('flex flex-col border-l min-w-0 min-h-0 flex-1 dt-inspector-pane'),
|
|
932
951
|
], [
|
|
933
952
|
h.submodel({
|
|
@@ -938,14 +957,14 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
938
957
|
tabs: INSPECTOR_TABS,
|
|
939
958
|
selectedValue: model.activeInspectorTab,
|
|
940
959
|
ariaLabel: 'Inspector tabs',
|
|
941
|
-
toView: ({ tablist, tabs, activeIndex }) => h.div([h.Class('flex flex-col flex-1 min-h-0')], [
|
|
942
|
-
h.div([...tablist, h.Class('flex border-b shrink-0')], tabs.map(tab => h.button([
|
|
960
|
+
toView: ({ tablist, tabs, activeIndex }) => __foldkitBrandViewResult((h.div([h.Class('flex flex-col flex-1 min-h-0')], [
|
|
961
|
+
h.div([...tablist, h.Class('flex border-b shrink-0')], tabs.map(tab => __foldkitBrandViewResult((h.button([
|
|
943
962
|
...tab.tab,
|
|
944
963
|
h.Class(clsx('dt-tab-button cursor-pointer text-base font-mono px-3 py-1', tab.isActive
|
|
945
964
|
? 'text-dt dt-tab-active'
|
|
946
965
|
: 'text-dt-muted')),
|
|
947
|
-
], [h.span([], [tab.value])]))),
|
|
948
|
-
...tabs.map(tab => h.div([
|
|
966
|
+
], [h.span([], [tab.value])])), "@foldkit/devtools/overlay.js#anonymous~76"))),
|
|
967
|
+
...tabs.map(tab => __foldkitBrandViewResult((h.div([
|
|
949
968
|
...tab.panel,
|
|
950
969
|
h.Class('flex flex-col flex-1 min-h-0 min-w-0'),
|
|
951
970
|
h.Hidden(tab.index !== activeIndex),
|
|
@@ -954,17 +973,17 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
954
973
|
: [h.Style({ display: 'none' })]),
|
|
955
974
|
], [
|
|
956
975
|
Option.match(model.maybeInspectedModel, {
|
|
957
|
-
onNone: () => emptyInspectorView,
|
|
958
|
-
onSome: inspectedModel => inspectorTabContent(model, tab.value, inspectedModel),
|
|
976
|
+
onNone: () => __foldkitBrandViewResult((emptyInspectorView), "@foldkit/devtools/overlay.js#onNone~10"),
|
|
977
|
+
onSome: inspectedModel => __foldkitBrandViewResult((inspectorTabContent(model, tab.value, inspectedModel)), "@foldkit/devtools/overlay.js#onSome~7"),
|
|
959
978
|
}),
|
|
960
|
-
])),
|
|
961
|
-
]),
|
|
979
|
+
])), "@foldkit/devtools/overlay.js#anonymous~77")),
|
|
980
|
+
])), "@foldkit/devtools/overlay.js#toView"),
|
|
962
981
|
},
|
|
963
|
-
toParentMessage: message => GotInspectorTabsMessage({ message }),
|
|
982
|
+
toParentMessage: message => __foldkitBrandViewResult((GotInspectorTabsMessage({ message })), "@foldkit/devtools/overlay.js#toParentMessage~2"),
|
|
964
983
|
}),
|
|
965
|
-
]);
|
|
984
|
+
])), "@foldkit/devtools/overlay.js#inspectorPaneView");
|
|
966
985
|
// MESSAGE LIST
|
|
967
|
-
const badgeView = (model) => h.button([
|
|
986
|
+
const badgeView = (model) => __foldkitBrandViewResult((h.button([
|
|
968
987
|
h.Class(clsx('fixed bg-dt-bg text-dt cursor-pointer flex flex-col items-center justify-center font-mono outline-none dt-badge', BADGE_POSITION_CLASS[position], model.isPaused ? 'dt-badge-paused' : 'dt-badge-accent')),
|
|
969
988
|
h.Style({ width: '22px', height: '56px', fontSize: '10px' }),
|
|
970
989
|
h.OnClick(ClickedToggle()),
|
|
@@ -988,12 +1007,12 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
988
1007
|
: h.div([
|
|
989
1008
|
h.Class(clsx('flex flex-col items-center gap-0.5 font-semibold tracking-wider leading-none', model.isPaused ? 'text-dt-bg' : 'text-dt-muted')),
|
|
990
1009
|
], [h.span([], ['D']), h.span([], ['E']), h.span([], ['V'])]),
|
|
991
|
-
]);
|
|
1010
|
+
])), "@foldkit/devtools/overlay.js#badgeView");
|
|
992
1011
|
const headerClass = 'flex items-center justify-between px-3 py-1.5 border-b shrink-0';
|
|
993
1012
|
const actionButtonClass = 'dt-resume-button bg-transparent border-none text-dt-live cursor-pointer text-base font-mono font-medium';
|
|
994
1013
|
const statusClass = 'text-base font-mono';
|
|
995
|
-
const clearHistoryButton = () => h.button([h.Class(headerButtonClass), h.OnClick(ClickedClear())], ['Clear history']);
|
|
996
|
-
const submodelLabel = (tag) => pipe(tag, String_.replace(/^Got/, ''), String_.replace(/Message$/, ''));
|
|
1014
|
+
const clearHistoryButton = () => __foldkitBrandViewResult((h.button([h.Class(headerButtonClass), h.OnClick(ClickedClear())], ['Clear history'])), "@foldkit/devtools/overlay.js#clearHistoryButton");
|
|
1015
|
+
const submodelLabel = (tag) => __foldkitBrandViewResult((pipe(tag, String_.replace(/^Got/, ''), String_.replace(/Message$/, ''))), "@foldkit/devtools/overlay.js#submodelLabel");
|
|
997
1016
|
const CHECK_ICON = 'M4.5 12.75l6 6 9-13.5';
|
|
998
1017
|
const checkIconView = h.svg([
|
|
999
1018
|
h.AriaHidden(true),
|
|
@@ -1006,7 +1025,7 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1006
1025
|
], [
|
|
1007
1026
|
h.path([h.D(CHECK_ICON), h.StrokeLinecap('round'), h.StrokeLinejoin('round')], []),
|
|
1008
1027
|
]);
|
|
1009
|
-
const filterItemLabel = (item) => String_.isNonEmpty(item) ? submodelLabel(item) : 'All Messages';
|
|
1028
|
+
const filterItemLabel = (item) => __foldkitBrandViewResult((String_.isNonEmpty(item) ? submodelLabel(item) : 'All Messages'), "@foldkit/devtools/overlay.js#filterItemLabel");
|
|
1010
1029
|
const ARROW_UP = 'M4.5 10.5L12 3m0 0l7.5 7.5M12 3v18';
|
|
1011
1030
|
const arrowUpIconView = h.svg([
|
|
1012
1031
|
h.AriaHidden(true),
|
|
@@ -1019,30 +1038,26 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1019
1038
|
], [
|
|
1020
1039
|
h.path([h.D(ARROW_UP), h.StrokeLinecap('round'), h.StrokeLinejoin('round')], []),
|
|
1021
1040
|
]);
|
|
1022
|
-
const scrollToTopPillView = () => h.button([
|
|
1023
|
-
h.Key('scroll-pill'),
|
|
1024
|
-
h.Class('dt-scroll-pill'),
|
|
1025
|
-
h.OnClick(ClickedScrollToTopPill()),
|
|
1026
|
-
], [
|
|
1041
|
+
const scrollToTopPillView = () => __foldkitBrandViewResult((h.button([h.Class('dt-scroll-pill'), h.OnClick(ClickedScrollToTopPill())], [
|
|
1027
1042
|
arrowUpIconView,
|
|
1028
1043
|
h.span([h.Class('dt-scroll-pill-text')], ['Jump to top']),
|
|
1029
|
-
]);
|
|
1044
|
+
])), "@foldkit/devtools/overlay.js#scrollToTopPillView");
|
|
1030
1045
|
const submodelFilterView = (model) => {
|
|
1031
1046
|
const buttonLabel = Option.match(model.maybeSubmodelFilter, {
|
|
1032
|
-
onNone: () => 'All Messages',
|
|
1047
|
+
onNone: () => __foldkitBrandViewResult(('All Messages'), "@foldkit/devtools/overlay.js#onNone~11"),
|
|
1033
1048
|
onSome: submodelLabel,
|
|
1034
1049
|
});
|
|
1035
|
-
return h.submodel({
|
|
1050
|
+
return __foldkitBrandViewResult((h.submodel({
|
|
1036
1051
|
slotId: 'submodel-filter',
|
|
1037
1052
|
model: model.submodelFilterListbox,
|
|
1038
1053
|
view: SubmodelFilterListbox.view,
|
|
1039
1054
|
viewInputs: {
|
|
1040
1055
|
items: [ALL_MESSAGES_VALUE, ...model.submodelTags],
|
|
1041
|
-
maybeSelectedValue: Option.orElseSome(model.maybeSubmodelFilter, () => ALL_MESSAGES_VALUE),
|
|
1042
|
-
itemToConfig: item => ({
|
|
1056
|
+
maybeSelectedValue: Option.orElseSome(model.maybeSubmodelFilter, () => __foldkitBrandViewResult((ALL_MESSAGES_VALUE), "@foldkit/devtools/overlay.js#anonymous~78")),
|
|
1057
|
+
itemToConfig: item => (__foldkitBrandViewResult(({
|
|
1043
1058
|
className: 'dt-filter-item',
|
|
1044
1059
|
content: h.div([h.Class('flex items-center gap-2')], [checkIconView, h.span([], [filterItemLabel(item)])]),
|
|
1045
|
-
}),
|
|
1060
|
+
}), "@foldkit/devtools/overlay.js#itemToConfig")),
|
|
1046
1061
|
buttonContent: h.span([h.Class('flex flex-1 items-center justify-between')], [
|
|
1047
1062
|
h.span([], [buttonLabel]),
|
|
1048
1063
|
h.svg([
|
|
@@ -1064,18 +1079,17 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1064
1079
|
buttonClassName: 'dt-filter-button',
|
|
1065
1080
|
itemsClassName: 'dt-filter-items',
|
|
1066
1081
|
className: 'dt-filter-wrapper',
|
|
1067
|
-
attributes: childAttributes([h.Key('submodel-filter')]),
|
|
1068
1082
|
backdropClassName: 'dt-filter-backdrop',
|
|
1069
1083
|
},
|
|
1070
|
-
toParentMessage: message => GotSubmodelFilterMessage({ message }),
|
|
1071
|
-
});
|
|
1084
|
+
toParentMessage: message => __foldkitBrandViewResult((GotSubmodelFilterMessage({ message })), "@foldkit/devtools/overlay.js#toParentMessage~3"),
|
|
1085
|
+
})), "@foldkit/devtools/overlay.js#submodelFilterView");
|
|
1072
1086
|
};
|
|
1073
1087
|
// SETTINGS
|
|
1074
|
-
const flattenSwitchView = (model) => Switch.view({
|
|
1088
|
+
const flattenSwitchView = (model) => __foldkitBrandViewResult((Switch.view({
|
|
1075
1089
|
id: FLATTEN_SWITCH_ID,
|
|
1076
1090
|
isChecked: model.isFlattened,
|
|
1077
|
-
onToggle: isFlattened => ToggledFlatten({ isFlattened }),
|
|
1078
|
-
toView: attributes => h.div([h.Class('dt-settings-row')], [
|
|
1091
|
+
onToggle: isFlattened => __foldkitBrandViewResult((ToggledFlatten({ isFlattened })), "@foldkit/devtools/overlay.js#onToggle"),
|
|
1092
|
+
toView: attributes => __foldkitBrandViewResult((h.div([h.Class('dt-settings-row')], [
|
|
1079
1093
|
h.div([...attributes.button, h.Class('dt-switch')], [h.span([h.Class('dt-switch-thumb')], [])]),
|
|
1080
1094
|
h.div([h.Class('dt-settings-row-text')], [
|
|
1081
1095
|
h.label([...attributes.label, h.Class('dt-settings-row-label')], ['Flatten to leaf Message']),
|
|
@@ -1084,16 +1098,16 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1084
1098
|
h.Class('dt-settings-row-description'),
|
|
1085
1099
|
], ['Label each row with its innermost Message']),
|
|
1086
1100
|
]),
|
|
1087
|
-
]),
|
|
1088
|
-
});
|
|
1089
|
-
const settingsScreenView = (model) => h.
|
|
1101
|
+
])), "@foldkit/devtools/overlay.js#toView~2"),
|
|
1102
|
+
})), "@foldkit/devtools/overlay.js#flattenSwitchView");
|
|
1103
|
+
const settingsScreenView = (model) => __foldkitBrandViewResult((h.div([h.Class('flex flex-col flex-1 min-h-0 overflow-y-auto overscroll-none')], [
|
|
1090
1104
|
h.div([h.Class('flex flex-col')], [
|
|
1091
1105
|
h.span([h.Class('dt-settings-section-title')], ['Message List']),
|
|
1092
1106
|
flattenSwitchView(model),
|
|
1093
1107
|
]),
|
|
1094
|
-
]);
|
|
1108
|
+
])), "@foldkit/devtools/overlay.js#settingsScreenView");
|
|
1095
1109
|
const headerView = (model) => {
|
|
1096
|
-
const { status, maybeAction } = M.value(mode).pipe(M.withReturnType(), M.when('TimeTravel', () => model.isPaused
|
|
1110
|
+
const { status, maybeAction } = M.value(mode).pipe(M.withReturnType(), M.when('TimeTravel', () => __foldkitBrandViewResult((model.isPaused
|
|
1097
1111
|
? {
|
|
1098
1112
|
status: h.span([h.Class(`${statusClass} text-dt-paused`)], [
|
|
1099
1113
|
model.pausedAtIndex === INIT_INDEX
|
|
@@ -1105,22 +1119,22 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1105
1119
|
: {
|
|
1106
1120
|
status: h.span([h.Class(`${statusClass} text-dt-live font-medium`)], ['Live']),
|
|
1107
1121
|
maybeAction: Option.none(),
|
|
1108
|
-
}), M.when('Inspect', () => ({
|
|
1122
|
+
}), "@foldkit/devtools/overlay.js#anonymous~79")), M.when('Inspect', () => (__foldkitBrandViewResult(({
|
|
1109
1123
|
status: h.span([h.Class(`${statusClass} text-dt-accent`)], [
|
|
1110
1124
|
model.selectedIndex === INIT_INDEX
|
|
1111
1125
|
? 'Inspecting (init)'
|
|
1112
1126
|
: `Inspecting (${model.selectedIndex + 1})`,
|
|
1113
1127
|
]),
|
|
1114
1128
|
maybeAction: OptionExt.when(!model.isFollowingLatest, h.button([h.Class(actionButtonClass), h.OnClick(ClickedFollowLatest())], ['Follow Latest →'])),
|
|
1115
|
-
})), M.exhaustive);
|
|
1129
|
+
}), "@foldkit/devtools/overlay.js#anonymous~80"))), M.exhaustive);
|
|
1116
1130
|
const maybeClearHistoryButton = OptionExt.when(!model.isPaused, clearHistoryButton());
|
|
1117
|
-
return h.header([h.Class(headerClass)], [
|
|
1131
|
+
return __foldkitBrandViewResult((h.header([h.Class(headerClass)], [
|
|
1118
1132
|
status,
|
|
1119
1133
|
...Option.toArray(maybeAction),
|
|
1120
1134
|
...Option.toArray(maybeClearHistoryButton),
|
|
1121
|
-
]);
|
|
1135
|
+
])), "@foldkit/devtools/overlay.js#headerView");
|
|
1122
1136
|
};
|
|
1123
|
-
const initRowView = (isSelected, isPausedHere) => h.keyed('li')('init', [
|
|
1137
|
+
const initRowView = (isSelected, isPausedHere) => __foldkitBrandViewResult((h.keyed('li')('init', [
|
|
1124
1138
|
h.Class(clsx(ROW_BASE, { selected: isSelected })),
|
|
1125
1139
|
h.OnClick(ClickedRow({ index: INIT_INDEX })),
|
|
1126
1140
|
], [
|
|
@@ -1128,7 +1142,7 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1128
1142
|
h.span([h.Class('dot-column')], []),
|
|
1129
1143
|
h.span([h.Class(indexClass)], []),
|
|
1130
1144
|
h.span([h.Class('text-base text-dt-muted font-mono')], ['init']),
|
|
1131
|
-
]);
|
|
1145
|
+
])), "@foldkit/devtools/overlay.js#initRowView");
|
|
1132
1146
|
const pauseIconView = h.svg([
|
|
1133
1147
|
h.AriaHidden(true),
|
|
1134
1148
|
h.Class('dt-pause-icon'),
|
|
@@ -1144,7 +1158,7 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1144
1158
|
h.D('M5.75 3v18M18.25 3v18'),
|
|
1145
1159
|
], []),
|
|
1146
1160
|
]);
|
|
1147
|
-
const messageRowView = (tag, absoluteIndex, isSelected, isPausedHere, timeDelta, isModelChanged) => h.keyed('li')(String(absoluteIndex), [
|
|
1161
|
+
const messageRowView = (tag, absoluteIndex, isSelected, isPausedHere, timeDelta, isModelChanged) => __foldkitBrandViewResult((h.keyed('li')(String(absoluteIndex), [
|
|
1148
1162
|
h.Class(clsx(ROW_BASE, { selected: isSelected })),
|
|
1149
1163
|
h.OnClick(ClickedRow({ index: absoluteIndex })),
|
|
1150
1164
|
], [
|
|
@@ -1155,59 +1169,58 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1155
1169
|
h.span([
|
|
1156
1170
|
h.Class('text-2xs text-dt-muted font-mono shrink-0 text-right min-w-5'),
|
|
1157
1171
|
], [formatTimeDelta(timeDelta)]),
|
|
1158
|
-
]);
|
|
1172
|
+
])), "@foldkit/devtools/overlay.js#messageRowView");
|
|
1159
1173
|
const messageListBody = (entries, startIndex, selectedIndex, isPaused, pausedAtIndex, maybeFilterTag, isFlattened) => {
|
|
1160
1174
|
const baseTimestamp = pipe(entries, Array_.head, Option.match({
|
|
1161
|
-
onNone: () => 0,
|
|
1162
|
-
onSome: ({ timestamp }) => timestamp,
|
|
1175
|
+
onNone: () => __foldkitBrandViewResult((0), "@foldkit/devtools/overlay.js#onNone~12"),
|
|
1176
|
+
onSome: ({ timestamp }) => __foldkitBrandViewResult((timestamp), "@foldkit/devtools/overlay.js#onSome~8"),
|
|
1163
1177
|
}));
|
|
1164
1178
|
const isInitSelected = selectedIndex === INIT_INDEX;
|
|
1165
1179
|
const isFiltered = Option.isSome(maybeFilterTag);
|
|
1166
|
-
const leafOrTag = (entry) => Option.getOrElse(entry.maybeLeafTag, () => entry.tag);
|
|
1180
|
+
const leafOrTag = (entry) => __foldkitBrandViewResult((Option.getOrElse(entry.maybeLeafTag, () => __foldkitBrandViewResult((entry.tag), "@foldkit/devtools/overlay.js#anonymous~81"))), "@foldkit/devtools/overlay.js#leafOrTag");
|
|
1167
1181
|
const displayTagFor = (entry) => {
|
|
1168
1182
|
if (isFlattened) {
|
|
1169
|
-
return leafOrTag(entry);
|
|
1183
|
+
return __foldkitBrandViewResult((leafOrTag(entry)), "@foldkit/devtools/overlay.js#displayTagFor");
|
|
1170
1184
|
}
|
|
1171
1185
|
else {
|
|
1172
|
-
return Option.match(maybeFilterTag, {
|
|
1173
|
-
onNone: () => entry.tag,
|
|
1174
|
-
onSome: filterTag => pipe(entry.submodelPath, Array_.findFirstIndex(pathTag => pathTag === filterTag), Option.flatMap(filterIndex => Array_.get(entry.submodelPath, Number_.increment(filterIndex))), Option.orElse(() => entry.maybeLeafTag), Option.getOrElse(() => entry.tag)),
|
|
1175
|
-
});
|
|
1186
|
+
return __foldkitBrandViewResult((Option.match(maybeFilterTag, {
|
|
1187
|
+
onNone: () => __foldkitBrandViewResult((entry.tag), "@foldkit/devtools/overlay.js#onNone~13"),
|
|
1188
|
+
onSome: filterTag => __foldkitBrandViewResult((pipe(entry.submodelPath, Array_.findFirstIndex(pathTag => __foldkitBrandViewResult((pathTag === filterTag), "@foldkit/devtools/overlay.js#anonymous~82")), Option.flatMap(filterIndex => __foldkitBrandViewResult((Array_.get(entry.submodelPath, Number_.increment(filterIndex))), "@foldkit/devtools/overlay.js#anonymous~83")), Option.orElse(() => __foldkitBrandViewResult((entry.maybeLeafTag), "@foldkit/devtools/overlay.js#anonymous~84")), Option.getOrElse(() => __foldkitBrandViewResult((entry.tag), "@foldkit/devtools/overlay.js#anonymous~85")))), "@foldkit/devtools/overlay.js#onSome~9"),
|
|
1189
|
+
})), "@foldkit/devtools/overlay.js#displayTagFor");
|
|
1176
1190
|
}
|
|
1177
1191
|
};
|
|
1178
|
-
const indexedEntries = pipe(entries, Array_.map((entry, arrayIndex) => ({
|
|
1192
|
+
const indexedEntries = pipe(entries, Array_.map((entry, arrayIndex) => (__foldkitBrandViewResult(({
|
|
1179
1193
|
entry,
|
|
1180
1194
|
absoluteIndex: startIndex + arrayIndex,
|
|
1181
|
-
})), isFiltered
|
|
1182
|
-
? Array_.filter(({ entry }) => Array_.contains(entry.submodelPath, maybeFilterTag.value))
|
|
1195
|
+
}), "@foldkit/devtools/overlay.js#anonymous~86"))), isFiltered
|
|
1196
|
+
? Array_.filter(({ entry }) => __foldkitBrandViewResult((Array_.contains(entry.submodelPath, maybeFilterTag.value)), "@foldkit/devtools/overlay.js#anonymous~87"))
|
|
1183
1197
|
: Function.identity);
|
|
1184
1198
|
const messageRows = pipe(indexedEntries, Array_.map(({ entry, absoluteIndex }) => {
|
|
1185
1199
|
const isSelected = selectedIndex === absoluteIndex;
|
|
1186
1200
|
const isPausedHere = isPaused && pausedAtIndex === absoluteIndex;
|
|
1187
1201
|
const displayTag = displayTagFor(entry);
|
|
1188
|
-
return lazyMessageRow(String(absoluteIndex), messageRowView, [
|
|
1202
|
+
return __foldkitBrandViewResult((lazyMessageRow(String(absoluteIndex), messageRowView, [
|
|
1189
1203
|
displayTag,
|
|
1190
1204
|
absoluteIndex,
|
|
1191
1205
|
isSelected,
|
|
1192
1206
|
isPausedHere,
|
|
1193
1207
|
entry.timestamp - baseTimestamp,
|
|
1194
1208
|
entry.isModelChanged,
|
|
1195
|
-
]);
|
|
1209
|
+
])), "@foldkit/devtools/overlay.js#anonymous~88");
|
|
1196
1210
|
}), Array_.reverse);
|
|
1197
|
-
return h.ul([
|
|
1198
|
-
h.Key('message-list'),
|
|
1211
|
+
return __foldkitBrandViewResult((h.ul([
|
|
1199
1212
|
h.Class('message-list flex-1 overflow-y-auto min-h-0 overscroll-none'),
|
|
1200
|
-
h.OnScroll(scrollTop => ScrolledMessageList({ scrollTop })),
|
|
1213
|
+
h.OnScroll(scrollTop => __foldkitBrandViewResult((ScrolledMessageList({ scrollTop })), "@foldkit/devtools/overlay.js#anonymous~89")),
|
|
1201
1214
|
], isFiltered
|
|
1202
1215
|
? messageRows
|
|
1203
1216
|
: [
|
|
1204
1217
|
...messageRows,
|
|
1205
1218
|
initRowView(isInitSelected, isPaused && pausedAtIndex === INIT_INDEX),
|
|
1206
|
-
]);
|
|
1219
|
+
])), "@foldkit/devtools/overlay.js#messageListBody");
|
|
1207
1220
|
};
|
|
1208
1221
|
const messageListView = (model) => {
|
|
1209
1222
|
const selectedIndex = selectedHistoryIndex(model);
|
|
1210
|
-
return lazyMessageList(messageListBody, [
|
|
1223
|
+
return __foldkitBrandViewResult((lazyMessageList(messageListBody, [
|
|
1211
1224
|
model.entries,
|
|
1212
1225
|
model.startIndex,
|
|
1213
1226
|
selectedIndex,
|
|
@@ -1215,24 +1228,24 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1215
1228
|
model.pausedAtIndex,
|
|
1216
1229
|
model.maybeSubmodelFilter,
|
|
1217
1230
|
model.isFlattened,
|
|
1218
|
-
]);
|
|
1231
|
+
])), "@foldkit/devtools/overlay.js#messageListView");
|
|
1219
1232
|
};
|
|
1220
1233
|
// SCRUBBER
|
|
1221
1234
|
const scrubberPositionLabel = (model) => {
|
|
1222
1235
|
const total = String(model.entries.length).padStart(3, '0');
|
|
1223
1236
|
const current = String(model.scrubberValue).padStart(3, '0');
|
|
1224
|
-
return `${current} / ${total}
|
|
1237
|
+
return __foldkitBrandViewResult((`${current} / ${total}`), "@foldkit/devtools/overlay.js#scrubberPositionLabel");
|
|
1225
1238
|
};
|
|
1226
|
-
const scrubberView = (model) => h.submodel({
|
|
1239
|
+
const scrubberView = (model) => __foldkitBrandViewResult((h.submodel({
|
|
1227
1240
|
slotId: model.scrubberSlider.id,
|
|
1228
1241
|
model: model.scrubberSlider,
|
|
1229
1242
|
view: Slider.view,
|
|
1230
1243
|
viewInputs: {
|
|
1231
1244
|
value: model.scrubberValue,
|
|
1232
1245
|
ariaLabel: 'Session scrubber',
|
|
1233
|
-
getTrackRoot: () => shadow,
|
|
1234
|
-
formatValue: value => value === 0 ? 'init' : `Message ${String(value)}
|
|
1235
|
-
toView: attributes => h.div([h.Class('flex items-center gap-3 flex-1 min-w-0')], [
|
|
1246
|
+
getTrackRoot: () => __foldkitBrandViewResult((shadow), "@foldkit/devtools/overlay.js#getTrackRoot"),
|
|
1247
|
+
formatValue: value => __foldkitBrandViewResult((value === 0 ? 'init' : `Message ${String(value)}`), "@foldkit/devtools/overlay.js#formatValue"),
|
|
1248
|
+
toView: attributes => __foldkitBrandViewResult((h.div([h.Class('flex items-center gap-3 flex-1 min-w-0')], [
|
|
1236
1249
|
h.div([
|
|
1237
1250
|
...attributes.root,
|
|
1238
1251
|
h.Class('dt-scrubber-control flex-1 flex items-center'),
|
|
@@ -1248,17 +1261,16 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1248
1261
|
h.span([
|
|
1249
1262
|
h.Class('dt-scrubber-position text-2xs text-dt-muted font-mono shrink-0 tabular-nums'),
|
|
1250
1263
|
], [scrubberPositionLabel(model)]),
|
|
1251
|
-
]),
|
|
1264
|
+
])), "@foldkit/devtools/overlay.js#toView~3"),
|
|
1252
1265
|
},
|
|
1253
|
-
toParentMessage: message => GotScrubberSliderMessage({ message }),
|
|
1254
|
-
});
|
|
1266
|
+
toParentMessage: message => __foldkitBrandViewResult((GotScrubberSliderMessage({ message })), "@foldkit/devtools/overlay.js#toParentMessage~4"),
|
|
1267
|
+
})), "@foldkit/devtools/overlay.js#scrubberView");
|
|
1255
1268
|
// FOOTER
|
|
1256
1269
|
const isScrubberVisible = mode === 'TimeTravel';
|
|
1257
1270
|
const GEAR_OUTER = 'M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z';
|
|
1258
1271
|
const GEAR_INNER = 'M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z';
|
|
1259
1272
|
const X_MARK = 'M6 18L18 6M6 6l12 12';
|
|
1260
1273
|
const gearIconView = h.svg([
|
|
1261
|
-
h.Key('gear-icon'),
|
|
1262
1274
|
h.AriaHidden(true),
|
|
1263
1275
|
h.Class('dt-settings-icon shrink-0'),
|
|
1264
1276
|
h.Xmlns('http://www.w3.org/2000/svg'),
|
|
@@ -1271,7 +1283,6 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1271
1283
|
h.path([h.D(GEAR_INNER), h.StrokeLinecap('round'), h.StrokeLinejoin('round')], []),
|
|
1272
1284
|
]);
|
|
1273
1285
|
const closeSettingsIconView = h.svg([
|
|
1274
|
-
h.Key('close-icon'),
|
|
1275
1286
|
h.AriaHidden(true),
|
|
1276
1287
|
h.Class('dt-settings-icon shrink-0'),
|
|
1277
1288
|
h.Xmlns('http://www.w3.org/2000/svg'),
|
|
@@ -1284,51 +1295,51 @@ const makeView = (position, mode, shadow, maybeBanner) => {
|
|
|
1284
1295
|
]);
|
|
1285
1296
|
const settingsToggleView = (screen) => {
|
|
1286
1297
|
const isSettingsOpen = screen === 'Settings';
|
|
1287
|
-
return h.button([
|
|
1298
|
+
return __foldkitBrandViewResult((h.button([
|
|
1288
1299
|
h.Class(clsx('dt-settings-button', {
|
|
1289
1300
|
'dt-settings-button-active': isSettingsOpen,
|
|
1290
1301
|
})),
|
|
1291
1302
|
h.AriaLabel(isSettingsOpen ? 'Close settings' : 'Settings'),
|
|
1292
1303
|
h.AriaPressed(String(isSettingsOpen)),
|
|
1293
1304
|
h.OnClick(ClickedSettingsToggle()),
|
|
1294
|
-
], [isSettingsOpen ? closeSettingsIconView : gearIconView]);
|
|
1305
|
+
], [isSettingsOpen ? closeSettingsIconView : gearIconView])), "@foldkit/devtools/overlay.js#settingsToggleView");
|
|
1295
1306
|
};
|
|
1296
|
-
const footerView = (model) => h.div([
|
|
1307
|
+
const footerView = (model) => __foldkitBrandViewResult((h.div([
|
|
1297
1308
|
h.Class('dt-footer flex items-center gap-3 px-3 py-2 border-t shrink-0'),
|
|
1298
1309
|
], [
|
|
1299
1310
|
settingsToggleView(model.screen),
|
|
1300
1311
|
...OptionExt.when(isScrubberVisible, scrubberView(model)).pipe(Option.toArray),
|
|
1301
|
-
]);
|
|
1312
|
+
])), "@foldkit/devtools/overlay.js#footerView");
|
|
1302
1313
|
// PANEL
|
|
1303
1314
|
const messagesScreenView = (model) => {
|
|
1304
1315
|
const maybeSubmodelFilterView = OptionExt.when(Array_.isReadonlyArrayNonEmpty(model.submodelTags), submodelFilterView(model));
|
|
1305
1316
|
const maybeScrollToTopPillView = OptionExt.when(!model.isFollowingTop, scrollToTopPillView());
|
|
1306
|
-
return h.
|
|
1317
|
+
return __foldkitBrandViewResult((h.div([h.Class('flex flex-1 min-h-0 dt-content')], [
|
|
1307
1318
|
h.div([h.Class('flex flex-col min-h-0 dt-message-pane')], [
|
|
1308
1319
|
...Option.toArray(maybeSubmodelFilterView),
|
|
1309
1320
|
...Option.toArray(maybeScrollToTopPillView),
|
|
1310
1321
|
messageListView(model),
|
|
1311
1322
|
]),
|
|
1312
1323
|
inspectorPaneView(model),
|
|
1313
|
-
]);
|
|
1324
|
+
])), "@foldkit/devtools/overlay.js#messagesScreenView");
|
|
1314
1325
|
};
|
|
1315
|
-
const contentView = (model) => M.value(model.screen).pipe(M.withReturnType(), M.when('Messages', () => messagesScreenView(model)), M.when('Settings', () => settingsScreenView(model)), M.exhaustive);
|
|
1316
|
-
const panelView = (model) => h.
|
|
1326
|
+
const contentView = (model) => __foldkitBrandViewResult((M.value(model.screen).pipe(M.withReturnType(), M.when('Messages', () => __foldkitBrandViewResult((messagesScreenView(model)), "@foldkit/devtools/overlay.js#anonymous~90")), M.when('Settings', () => __foldkitBrandViewResult((settingsScreenView(model)), "@foldkit/devtools/overlay.js#anonymous~91")), M.exhaustive)), "@foldkit/devtools/overlay.js#contentView");
|
|
1327
|
+
const panelView = (model) => __foldkitBrandViewResult((h.div([
|
|
1317
1328
|
h.Class(clsx('fixed dt-panel dt-panel-wide bg-dt-bg border rounded-lg flex flex-col overflow-hidden font-mono text-dt', PANEL_POSITION_CLASS[position])),
|
|
1318
1329
|
], [
|
|
1319
|
-
...Option.map(maybeBanner, banner => h.div([
|
|
1330
|
+
...Option.map(maybeBanner, banner => __foldkitBrandViewResult((h.div([
|
|
1320
1331
|
h.Class('px-3 py-2 border-b text-sm text-dt-muted font-mono shrink-0 leading-snug'),
|
|
1321
|
-
], [banner])).pipe(Option.toArray),
|
|
1332
|
+
], [banner])), "@foldkit/devtools/overlay.js#anonymous~92")).pipe(Option.toArray),
|
|
1322
1333
|
headerView(model),
|
|
1323
1334
|
contentView(model),
|
|
1324
1335
|
footerView(model),
|
|
1325
|
-
]);
|
|
1326
|
-
const interactionBlocker = () => h.div([h.Class('dt-interaction-blocker')], []);
|
|
1327
|
-
return (model) => h.div([], [
|
|
1336
|
+
])), "@foldkit/devtools/overlay.js#panelView");
|
|
1337
|
+
const interactionBlocker = () => __foldkitBrandViewResult((h.div([h.Class('dt-interaction-blocker')], [])), "@foldkit/devtools/overlay.js#interactionBlocker");
|
|
1338
|
+
return __foldkitBrandViewResult(((model) => __foldkitBrandViewResult((h.div([], [
|
|
1328
1339
|
...OptionExt.when(model.isPaused && mode === 'TimeTravel', interactionBlocker()).pipe(Option.toArray),
|
|
1329
1340
|
...OptionExt.when(model.isOpen, panelView(model)).pipe(Option.toArray),
|
|
1330
1341
|
badgeView(model),
|
|
1331
|
-
]);
|
|
1342
|
+
])), "@foldkit/devtools/overlay.js#anonymous~93")), "@foldkit/devtools/overlay.js#makeView");
|
|
1332
1343
|
};
|
|
1333
1344
|
// CREATE
|
|
1334
1345
|
const createShadowContainer = () => {
|
|
@@ -1353,22 +1364,22 @@ const createShadowContainer = () => {
|
|
|
1353
1364
|
shadow.appendChild(styleElement);
|
|
1354
1365
|
const container = document.createElement('div');
|
|
1355
1366
|
shadow.appendChild(container);
|
|
1356
|
-
return { container, shadow };
|
|
1367
|
+
return __foldkitBrandViewResult(({ container, shadow }), "@foldkit/devtools/overlay.js#createShadowContainer");
|
|
1357
1368
|
};
|
|
1358
|
-
export const createOverlay = (store, position, mode, maybeBanner) => Effect.gen(function* () {
|
|
1359
|
-
const { container, shadow } = yield* Effect.acquireRelease(Effect.sync(() => createShadowContainer()), createdShadowContainer => Effect.sync(() => {
|
|
1369
|
+
export const createOverlay = (store, position, mode, maybeBanner) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
1370
|
+
const { container, shadow } = yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((createShadowContainer()), "@foldkit/devtools/overlay.js#anonymous~96")), createdShadowContainer => __foldkitBrandViewResult((Effect.sync(() => {
|
|
1360
1371
|
createdShadowContainer.shadow.host.remove();
|
|
1361
|
-
}));
|
|
1372
|
+
})), "@foldkit/devtools/overlay.js#anonymous~97"));
|
|
1362
1373
|
container.id = '__foldkit_devtools_overlay__';
|
|
1363
1374
|
const flags = Effect.gen(function* () {
|
|
1364
1375
|
const storeState = yield* SubscriptionRef.get(store.stateRef);
|
|
1365
1376
|
const { isOpen, isFlattened } = yield* readPersistedState;
|
|
1366
|
-
return {
|
|
1377
|
+
return __foldkitBrandViewResult(({
|
|
1367
1378
|
isOpen,
|
|
1368
1379
|
isMobile: window.matchMedia(MOBILE_BREAKPOINT_QUERY).matches,
|
|
1369
1380
|
isFlattened,
|
|
1370
1381
|
...toDisplayState(storeState),
|
|
1371
|
-
};
|
|
1382
|
+
}), "@foldkit/devtools/overlay.js#anonymous~99");
|
|
1372
1383
|
});
|
|
1373
1384
|
const init = (flags) => {
|
|
1374
1385
|
const { isFlattened, ...displayFlags } = flags;
|
|
@@ -1376,7 +1387,7 @@ export const createOverlay = (store, position, mode, maybeBanner) => Effect.gen(
|
|
|
1376
1387
|
const initialSliderValue = flags.isPaused
|
|
1377
1388
|
? hostIndexToSliderValue(flags.pausedAtIndex, flags.startIndex)
|
|
1378
1389
|
: sliderMax;
|
|
1379
|
-
return [
|
|
1390
|
+
return __foldkitBrandViewResult(([
|
|
1380
1391
|
{
|
|
1381
1392
|
screen: 'Messages',
|
|
1382
1393
|
...displayFlags,
|
|
@@ -1406,7 +1417,7 @@ export const createOverlay = (store, position, mode, maybeBanner) => Effect.gen(
|
|
|
1406
1417
|
scrubberValue: Slider.snapAndClamp(initialSliderValue, 0, sliderMax, 1),
|
|
1407
1418
|
},
|
|
1408
1419
|
Option.toArray(maybeLockScroll(flags.isOpen, flags.isMobile)),
|
|
1409
|
-
];
|
|
1420
|
+
]), "@foldkit/devtools/overlay.js#init");
|
|
1410
1421
|
};
|
|
1411
1422
|
const overlayRuntime = makeElement({
|
|
1412
1423
|
Model,
|
|
@@ -1421,4 +1432,4 @@ export const createOverlay = (store, position, mode, maybeBanner) => Effect.gen(
|
|
|
1421
1432
|
freezeModel: false,
|
|
1422
1433
|
});
|
|
1423
1434
|
yield* Effect.forkScoped(overlayRuntime.start());
|
|
1424
|
-
});
|
|
1435
|
+
})), "@foldkit/devtools/overlay.js#createOverlay");
|