@dxos/plugin-deck 0.8.4-main.c85a9c8dae → 0.8.4-main.d05673bc65
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/lib/browser/Banner-HXRXEUOZ.mjs +14 -0
- package/dist/lib/{node-esm/Banner-HR7DPUZU.mjs.map → browser/Banner-HXRXEUOZ.mjs.map} +1 -1
- package/dist/lib/browser/{DeckSettings-HB5TKG2F.mjs → DeckSettings-HSSQKFNE.mjs} +3 -3
- package/dist/lib/browser/{app-graph-builder-22XAL7YE.mjs → app-graph-builder-MP6INIM2.mjs} +7 -7
- package/dist/lib/browser/{app-graph-builder-22XAL7YE.mjs.map → app-graph-builder-MP6INIM2.mjs.map} +1 -1
- package/dist/lib/browser/{check-app-scheme-ZV3QWNNZ.mjs → check-app-scheme-AUNCD2Y6.mjs} +3 -3
- package/dist/lib/browser/{chunk-OAPMV5ZR.mjs → chunk-3P2FJVXC.mjs} +15 -17
- package/dist/lib/browser/chunk-3P2FJVXC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YGOOWRJE.mjs → chunk-ITNJS5QX.mjs} +27 -31
- package/dist/lib/browser/chunk-ITNJS5QX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FBL4WVYZ.mjs → chunk-L3RYMAV7.mjs} +2 -2
- package/dist/lib/browser/{chunk-FBL4WVYZ.mjs.map → chunk-L3RYMAV7.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-Q4GUCIRE.mjs → chunk-TAHLKBDO.mjs} +6 -19
- package/dist/lib/browser/chunk-TAHLKBDO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +12 -13
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-BLZGJWLO.mjs → operation-resolver-2TEGT4PG.mjs} +78 -19
- package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs.map +7 -0
- package/dist/lib/browser/{react-root-4ESZAM6D.mjs → react-root-AS4IOYDG.mjs} +5 -6
- package/dist/lib/{node-esm/react-root-YO7IIC75.mjs.map → browser/react-root-AS4IOYDG.mjs.map} +1 -1
- package/dist/lib/browser/{react-surface-KYQGCALN.mjs → react-surface-FH7TC6WW.mjs} +6 -6
- package/dist/lib/browser/{react-surface-KYQGCALN.mjs.map → react-surface-FH7TC6WW.mjs.map} +1 -1
- package/dist/lib/browser/{settings-RY2TBSGP.mjs → settings-PTMGCSJH.mjs} +3 -3
- package/dist/lib/browser/{state-CSTTMJ43.mjs → state-MA4SQ7BE.mjs} +4 -4
- package/dist/lib/browser/{state-CSTTMJ43.mjs.map → state-MA4SQ7BE.mjs.map} +1 -1
- package/dist/lib/browser/{toolkit-EONRPYA5.mjs → toolkit-6B34QFU3.mjs} +3 -3
- package/dist/lib/browser/types/index.mjs +2 -4
- package/dist/lib/browser/{url-handler-EM3SYHHX.mjs → url-handler-FEUFPQIP.mjs} +14 -11
- package/dist/lib/browser/url-handler-FEUFPQIP.mjs.map +7 -0
- package/dist/lib/node-esm/{Banner-HR7DPUZU.mjs → Banner-RN7XXOXY.mjs} +5 -6
- package/dist/lib/node-esm/{DeckSettings-MWTR7HU2.mjs → DeckSettings-DJRFLKQS.mjs} +3 -3
- package/dist/lib/node-esm/{app-graph-builder-GNNNCWGN.mjs → app-graph-builder-ACHG5HY7.mjs} +7 -7
- package/dist/lib/node-esm/{app-graph-builder-GNNNCWGN.mjs.map → app-graph-builder-ACHG5HY7.mjs.map} +1 -1
- package/dist/lib/node-esm/{check-app-scheme-ZNISVRFH.mjs → check-app-scheme-WN76GWVC.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-O4IOJICP.mjs → chunk-EMU4VIPH.mjs} +6 -19
- package/dist/lib/node-esm/chunk-EMU4VIPH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-L2NPJPGL.mjs → chunk-GZJAQ5IP.mjs} +15 -17
- package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-Z43MBISY.mjs → chunk-MBCCNIWY.mjs} +27 -31
- package/dist/lib/node-esm/chunk-MBCCNIWY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-EGFOT3DE.mjs → chunk-XCNF4COU.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-EGFOT3DE.mjs.map → chunk-XCNF4COU.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +12 -13
- package/dist/lib/node-esm/index.mjs.map +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-5BYDNQND.mjs → operation-resolver-GCMCCI7A.mjs} +78 -19
- package/dist/lib/node-esm/operation-resolver-GCMCCI7A.mjs.map +7 -0
- package/dist/lib/node-esm/{react-root-YO7IIC75.mjs → react-root-7DTDLAF4.mjs} +5 -6
- package/dist/lib/node-esm/{react-surface-G7VRKT4U.mjs → react-surface-U6Z2K324.mjs} +6 -6
- package/dist/lib/node-esm/{react-surface-G7VRKT4U.mjs.map → react-surface-U6Z2K324.mjs.map} +1 -1
- package/dist/lib/node-esm/{settings-GYLWWOBK.mjs → settings-LPPFLXNJ.mjs} +3 -3
- package/dist/lib/node-esm/{state-RQXTBWUX.mjs → state-KNRU3GDC.mjs} +4 -4
- package/dist/lib/node-esm/{state-RQXTBWUX.mjs.map → state-KNRU3GDC.mjs.map} +1 -1
- package/dist/lib/node-esm/{toolkit-EU3Z2R4H.mjs → toolkit-SOWYKJY3.mjs} +3 -3
- package/dist/lib/node-esm/types/index.mjs +2 -4
- package/dist/lib/node-esm/{url-handler-VUK2LBJV.mjs → url-handler-4LEB7UWF.mjs} +14 -11
- package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs.map +7 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +0 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts +1 -7
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +10 -10
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -34
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +4 -4
- package/src/capabilities/operation-resolver/operation-resolver.ts +5 -7
- package/src/capabilities/react-surface/react-surface.tsx +2 -2
- package/src/capabilities/state/state.ts +1 -1
- package/src/capabilities/url-handler/url-handler.ts +11 -9
- package/src/components/Plank/Plank.tsx +11 -6
- package/src/components/Plank/PlankHeading.tsx +5 -6
- package/src/components/Sidebar/ComplementarySidebar.tsx +12 -19
- package/src/components/Sidebar/SidebarButton.tsx +3 -3
- package/src/hooks/useDeckCompanions.ts +1 -6
- package/src/hooks/useSelectedCompanion.ts +4 -10
- package/src/layout.ts +1 -14
- package/src/meta.ts +1 -1
- package/src/types/capabilities.ts +3 -3
- package/src/types/events.ts +1 -1
- package/src/types/schema.ts +8 -10
- package/dist/lib/browser/Banner-DR6B7XTO.mjs +0 -15
- package/dist/lib/browser/chunk-OAPMV5ZR.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q4GUCIRE.mjs.map +0 -7
- package/dist/lib/browser/chunk-SKBPLX5T.mjs +0 -81
- package/dist/lib/browser/chunk-SKBPLX5T.mjs.map +0 -7
- package/dist/lib/browser/chunk-YGOOWRJE.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-BLZGJWLO.mjs.map +0 -7
- package/dist/lib/browser/url-handler-EM3SYHHX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IR6ODCNC.mjs +0 -83
- package/dist/lib/node-esm/chunk-IR6ODCNC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-L2NPJPGL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O4IOJICP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z43MBISY.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-5BYDNQND.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-VUK2LBJV.mjs.map +0 -7
- /package/dist/lib/browser/{DeckSettings-HB5TKG2F.mjs.map → DeckSettings-HSSQKFNE.mjs.map} +0 -0
- /package/dist/lib/browser/{check-app-scheme-ZV3QWNNZ.mjs.map → check-app-scheme-AUNCD2Y6.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-RY2TBSGP.mjs.map → settings-PTMGCSJH.mjs.map} +0 -0
- /package/dist/lib/browser/{toolkit-EONRPYA5.mjs.map → toolkit-6B34QFU3.mjs.map} +0 -0
- /package/dist/lib/{browser/Banner-DR6B7XTO.mjs.map → node-esm/Banner-RN7XXOXY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{DeckSettings-MWTR7HU2.mjs.map → DeckSettings-DJRFLKQS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{check-app-scheme-ZNISVRFH.mjs.map → check-app-scheme-WN76GWVC.mjs.map} +0 -0
- /package/dist/lib/{browser/react-root-4ESZAM6D.mjs.map → node-esm/react-root-7DTDLAF4.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-GYLWWOBK.mjs.map → settings-LPPFLXNJ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{toolkit-EU3Z2R4H.mjs.map → toolkit-SOWYKJY3.mjs.map} +0 -0
package/dist/lib/browser/{operation-resolver-BLZGJWLO.mjs → operation-resolver-2TEGT4PG.mjs}
RENAMED
|
@@ -2,30 +2,23 @@ import {
|
|
|
2
2
|
computeActiveUpdates
|
|
3
3
|
} from "./chunk-BJDEG7YZ.mjs";
|
|
4
4
|
import {
|
|
5
|
-
closeEntry,
|
|
6
|
-
createEntryId,
|
|
7
|
-
incrementPlank,
|
|
8
|
-
openEntry
|
|
9
|
-
} from "./chunk-SKBPLX5T.mjs";
|
|
10
|
-
import {
|
|
11
|
-
ATTENDABLE_PATH_SEPARATOR,
|
|
12
5
|
DeckCapabilities,
|
|
13
6
|
DeckOperation,
|
|
14
7
|
PLANK_COMPANION_TYPE,
|
|
15
8
|
defaultDeck,
|
|
16
9
|
getMode,
|
|
17
10
|
isLayoutMode
|
|
18
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3P2FJVXC.mjs";
|
|
19
12
|
import {
|
|
20
13
|
meta
|
|
21
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-L3RYMAV7.mjs";
|
|
22
15
|
|
|
23
16
|
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
24
17
|
import * as Effect from "effect/Effect";
|
|
25
18
|
import * as Function from "effect/Function";
|
|
26
19
|
import * as Option from "effect/Option";
|
|
27
20
|
import { Capabilities, Capability, UndoOperation } from "@dxos/app-framework";
|
|
28
|
-
import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
|
|
21
|
+
import { AppCapabilities, LayoutOperation, getCompanionVariant, isPinnedWorkspace } from "@dxos/app-toolkit";
|
|
29
22
|
import { Obj } from "@dxos/echo";
|
|
30
23
|
import { invariant } from "@dxos/invariant";
|
|
31
24
|
import { log } from "@dxos/log";
|
|
@@ -35,12 +28,77 @@ import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
|
35
28
|
import { Graph, Node } from "@dxos/plugin-graph";
|
|
36
29
|
import { ObservabilityOperation } from "@dxos/plugin-observability/types";
|
|
37
30
|
import { byPosition, isNonNullable } from "@dxos/util";
|
|
31
|
+
|
|
32
|
+
// src/layout.ts
|
|
33
|
+
import { produce } from "immer";
|
|
34
|
+
var openEntry = (deck, entryId, options) => {
|
|
35
|
+
return produce(deck, (draft) => {
|
|
36
|
+
if (draft.find((id) => id === entryId)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const key = options?.key;
|
|
40
|
+
const plankPositioning = options?.positioning ?? "start";
|
|
41
|
+
const pivotId = options?.pivotId;
|
|
42
|
+
if (key) {
|
|
43
|
+
const index = draft.findIndex((id) => id.split("+")[0] === key);
|
|
44
|
+
if (index !== -1) {
|
|
45
|
+
draft.splice(index, 1, entryId);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (pivotId) {
|
|
50
|
+
const pivotIndex = draft.findIndex((id) => id === pivotId);
|
|
51
|
+
if (pivotIndex !== -1) {
|
|
52
|
+
if (plankPositioning === "start") {
|
|
53
|
+
draft.splice(pivotIndex, 0, entryId);
|
|
54
|
+
} else {
|
|
55
|
+
draft.splice(pivotIndex + 1, 0, entryId);
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (plankPositioning === "start") {
|
|
61
|
+
draft.unshift(entryId);
|
|
62
|
+
} else {
|
|
63
|
+
draft.push(entryId);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
var closeEntry = (deck, entryId) => {
|
|
68
|
+
return produce(deck, (draft) => {
|
|
69
|
+
const index = draft.findIndex((id) => id === entryId);
|
|
70
|
+
if (index !== -1) {
|
|
71
|
+
draft.splice(index, 1);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
var incrementPlank = (deck, adjustment) => {
|
|
76
|
+
return produce(deck, (draft) => {
|
|
77
|
+
const index = draft.findIndex((id) => id === adjustment.id);
|
|
78
|
+
if (index === -1 || adjustment.type === "increment-start" && index === 0 || adjustment.type === "increment-end" && index === draft.length - 1) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (adjustment.type === "increment-start") {
|
|
82
|
+
[draft[index - 1], draft[index]] = [
|
|
83
|
+
draft[index],
|
|
84
|
+
draft[index - 1]
|
|
85
|
+
];
|
|
86
|
+
} else if (adjustment.type === "increment-end") {
|
|
87
|
+
[draft[index], draft[index + 1]] = [
|
|
88
|
+
draft[index + 1],
|
|
89
|
+
draft[index]
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
38
96
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/capabilities/operation-resolver/operation-resolver.ts";
|
|
39
97
|
var updateActiveDeck = (current, deckUpdates) => {
|
|
40
98
|
const currentDeck = current.decks[current.activeDeck];
|
|
41
99
|
invariant(currentDeck, `Deck not found: ${current.activeDeck}`, {
|
|
42
100
|
F: __dxlog_file,
|
|
43
|
-
L:
|
|
101
|
+
L: 41,
|
|
44
102
|
S: void 0,
|
|
45
103
|
A: [
|
|
46
104
|
"currentDeck",
|
|
@@ -268,7 +326,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
268
326
|
} else {
|
|
269
327
|
log.warn("Invalid layout mode", input, {
|
|
270
328
|
F: __dxlog_file,
|
|
271
|
-
L:
|
|
329
|
+
L: 258,
|
|
272
330
|
S: this,
|
|
273
331
|
C: (f, a) => f(...a)
|
|
274
332
|
});
|
|
@@ -284,7 +342,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
284
342
|
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
285
343
|
{
|
|
286
344
|
const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
287
|
-
const shouldUpdatePrevious = !state.activeDeck
|
|
345
|
+
const shouldUpdatePrevious = !isPinnedWorkspace(state.activeDeck);
|
|
288
346
|
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state2) => {
|
|
289
347
|
const newDecks = state2.decks[input.subject] ? state2.decks : {
|
|
290
348
|
...state2.decks,
|
|
@@ -305,7 +363,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
305
363
|
const deck = state.decks[input.subject];
|
|
306
364
|
invariant(deck, `Deck not found: ${input.subject}`, {
|
|
307
365
|
F: __dxlog_file,
|
|
308
|
-
L:
|
|
366
|
+
L: 293,
|
|
309
367
|
S: this,
|
|
310
368
|
A: [
|
|
311
369
|
"deck",
|
|
@@ -365,11 +423,12 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
365
423
|
previouslyOpenIds = new Set(deck.solo ? [
|
|
366
424
|
deck.solo
|
|
367
425
|
] : deck.active);
|
|
368
|
-
const next = deck.solo ?
|
|
426
|
+
const next = deck.solo ? [
|
|
427
|
+
...input.subject
|
|
428
|
+
] : input.subject.reduce((acc, entryId) => openEntry(acc, entryId, {
|
|
369
429
|
key: input.key,
|
|
370
430
|
positioning: input.positioning ?? settings?.newPlankPositioning,
|
|
371
|
-
pivotId: input.pivotId
|
|
372
|
-
variant: input.variant
|
|
431
|
+
pivotId: input.pivotId
|
|
373
432
|
}), deck.active);
|
|
374
433
|
const { deckUpdates, toAttend: _toAttend } = computeActiveUpdates({
|
|
375
434
|
next,
|
|
@@ -506,7 +565,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
506
565
|
companionOpen: false
|
|
507
566
|
}));
|
|
508
567
|
} else {
|
|
509
|
-
const
|
|
568
|
+
const variant = getCompanionVariant(input.companion);
|
|
510
569
|
yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, {
|
|
511
570
|
companionOpen: true,
|
|
512
571
|
companionVariant: variant
|
|
@@ -577,4 +636,4 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
577
636
|
export {
|
|
578
637
|
operation_resolver_default as default
|
|
579
638
|
};
|
|
580
|
-
//# sourceMappingURL=operation-resolver-
|
|
639
|
+
//# sourceMappingURL=operation-resolver-2TEGT4PG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts", "../../../src/layout.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, Capability, UndoOperation } from '@dxos/app-framework';\nimport { AppCapabilities, LayoutOperation, getCompanionVariant, isPinnedWorkspace } from '@dxos/app-toolkit';\nimport { Obj } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { OperationResolver } from '@dxos/operation';\nimport { Operation } from '@dxos/operation';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { Graph, Node } from '@dxos/plugin-graph';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/types';\nimport { byPosition, isNonNullable } from '@dxos/util';\n\nimport { closeEntry, incrementPlank, openEntry } from '../../layout';\nimport { meta } from '../../meta';\nimport {\n DeckCapabilities,\n DeckOperation,\n type DeckState,\n type DeckStateProps,\n type LayoutMode,\n PLANK_COMPANION_TYPE,\n defaultDeck,\n getMode,\n isLayoutMode,\n} from '../../types';\nimport { computeActiveUpdates } from '../../util';\n\n/**\n * Helper to update the active deck within the persisted state.\n */\nconst updateActiveDeck = (current: DeckStateProps, deckUpdates: Partial<DeckState>): DeckStateProps => {\n const currentDeck = current.decks[current.activeDeck];\n invariant(currentDeck, `Deck not found: ${current.activeDeck}`);\n return {\n ...current,\n decks: {\n ...current.decks,\n [current.activeDeck]: {\n ...currentDeck,\n ...deckUpdates,\n },\n },\n };\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationResolver, [\n //\n // UpdateSidebar\n //\n OperationResolver.make({\n operation: LayoutOperation.UpdateSidebar,\n handler: Effect.fnUntraced(function* (input) {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n const next = input.state ?? state.sidebarState;\n if (next !== state.sidebarState) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => ({\n ...state,\n sidebarState: next,\n }));\n }\n }),\n }),\n\n //\n // UpdateComplementary\n //\n OperationResolver.make({\n operation: LayoutOperation.UpdateComplementary,\n handler: Effect.fnUntraced(function* (input) {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n const panelChanged = state.complementarySidebarPanel !== input.subject;\n const next = input.subject ? 'expanded' : (input.state ?? state.complementarySidebarState);\n const stateChanged = next !== state.complementarySidebarState;\n\n if (panelChanged || stateChanged) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => ({\n ...state,\n complementarySidebarPanel: panelChanged ? input.subject : state.complementarySidebarPanel,\n complementarySidebarState: stateChanged ? next : state.complementarySidebarState,\n }));\n }\n }),\n }),\n\n //\n // UpdateDialog\n //\n OperationResolver.make({\n operation: LayoutOperation.UpdateDialog,\n handler: Effect.fnUntraced(function* (input) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({\n ...state,\n dialogOpen: input.state ?? Boolean(input.subject),\n dialogType: input.type ?? 'default',\n dialogBlockAlign: input.blockAlign ?? 'center',\n dialogOverlayClasses: input.overlayClasses,\n dialogOverlayStyle: input.overlayStyle,\n dialogContent: input.subject\n ? {\n component: input.subject,\n props: input.props,\n }\n : null,\n }));\n }),\n }),\n\n //\n // UpdatePopover\n //\n OperationResolver.make({\n operation: LayoutOperation.UpdatePopover,\n handler: Effect.fnUntraced(function* (input) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({\n ...state,\n popoverOpen: input.state ?? Boolean(input.subject),\n popoverKind: input.kind ?? 'base',\n popoverTitle: input.kind === 'card' ? input.title : undefined,\n popoverContentRef: input.subjectRef,\n popoverContent:\n typeof input.subject === 'string'\n ? { component: input.subject, props: input.props }\n : input.subject\n ? { subject: input.subject }\n : null,\n popoverSide: input.side,\n popoverAnchor: input.variant === 'virtual' ? input.anchor : state.popoverAnchor,\n popoverAnchorId: input.variant !== 'virtual' ? input.anchorId : state.popoverAnchorId,\n }));\n }),\n }),\n\n //\n // AddToast\n //\n OperationResolver.make({\n operation: LayoutOperation.AddToast,\n handler: Effect.fnUntraced(function* (input) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({\n ...state,\n toasts: [...state.toasts, input as LayoutOperation.Toast],\n }));\n }),\n }),\n\n //\n // ShowUndo\n //\n OperationResolver.make({\n operation: UndoOperation.ShowUndo,\n handler: Effect.fnUntraced(function* (input) {\n const historyTracker = yield* Capability.get(Capabilities.HistoryTracker);\n\n const newUndoId = `show-undo-${Date.now()}`;\n // TODO(wittjosiah): Support undoing further back than the last action.\n yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => {\n const filteredToasts = state.currentUndoId\n ? state.toasts.filter((toast) => toast.id !== state.currentUndoId)\n : state.toasts;\n\n const toast: LayoutOperation.Toast = {\n id: newUndoId,\n title: input.message ?? ['undo available label', { ns: meta.id }],\n duration: 10_000,\n actionLabel: ['undo action label', { ns: meta.id }],\n actionAlt: ['undo action alt', { ns: meta.id }],\n closeLabel: ['undo close label', { ns: meta.id }],\n onAction: () => historyTracker.undoPromise(),\n };\n\n return {\n ...state,\n currentUndoId: newUndoId,\n toasts: [...filteredToasts, toast],\n };\n });\n }),\n }),\n\n //\n // SetLayoutMode\n //\n OperationResolver.make({\n operation: LayoutOperation.SetLayoutMode,\n filter: (input) => {\n if ('mode' in input) {\n return isLayoutMode(input.mode);\n }\n return true;\n },\n handler: Effect.fnUntraced(function* (input) {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n const deck = yield* DeckCapabilities.getDeck();\n\n const computeModeUpdate = (mode: LayoutMode, subject?: string): Partial<DeckState> => {\n const current = deck.solo ? [deck.solo] : deck.active;\n // When un-soloing, the solo entry is added to the deck.\n const next = (\n mode !== 'deck' ? [subject ?? deck.solo ?? deck.active[0]] : [...deck.active, deck.solo]\n ).filter(isNonNullable);\n\n const removed = current.filter((id: string) => !next.includes(id));\n const closed = Array.from(\n new Set([...deck.inactive.filter((id: string) => !next.includes(id)), ...removed]),\n );\n\n // Build deckUpdates object without mutating.\n const soloUpdate =\n mode !== 'deck' && next[0]\n ? { solo: next[0] }\n : mode === 'deck' && deck.solo\n ? { solo: undefined, initialized: true }\n : {};\n\n const fullscreenUpdate = mode === 'solo--fullscreen' ? { fullscreen: !deck.fullscreen } : {};\n\n return {\n inactive: closed,\n ...soloUpdate,\n ...fullscreenUpdate,\n };\n };\n\n if ('mode' in input) {\n const currentMode = getMode(deck);\n const deckUpdates = computeModeUpdate(\n input.mode as LayoutMode,\n 'subject' in input ? input.subject : undefined,\n );\n\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => {\n const newPreviousMode =\n currentMode !== input.mode\n ? { ...state.previousMode, [state.activeDeck]: currentMode }\n : state.previousMode;\n return {\n ...updateActiveDeck(state, deckUpdates),\n previousMode: newPreviousMode,\n };\n });\n } else if ('revert' in input) {\n const last = state.previousMode[state.activeDeck];\n const deckUpdates = computeModeUpdate(last ?? 'solo');\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>\n updateActiveDeck(state, deckUpdates),\n );\n } else {\n log.warn('Invalid layout mode', input);\n }\n }),\n }),\n\n //\n // SwitchWorkspace\n //\n OperationResolver.make({\n operation: LayoutOperation.SwitchWorkspace,\n handler: Effect.fnUntraced(function* (input) {\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n\n {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n // Ideally this should be worked into the data model in a generic way.\n const shouldUpdatePrevious = !isPinnedWorkspace(state.activeDeck);\n\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => {\n const newDecks = state.decks[input.subject]\n ? state.decks\n : { ...state.decks, [input.subject]: { ...defaultDeck } };\n return {\n ...state,\n previousDeck: shouldUpdatePrevious ? state.activeDeck : state.previousDeck,\n activeDeck: input.subject,\n decks: newDecks,\n };\n });\n }\n\n {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n const deck = state.decks[input.subject];\n invariant(deck, `Deck not found: ${input.subject}`);\n\n const first = deck.solo ? deck.solo : deck.active[0];\n if (first) {\n yield* Operation.schedule(LayoutOperation.ScrollIntoView, { subject: first });\n } else {\n const [item] = Graph.getConnections(graph, input.subject, 'child').filter(\n (node) => !Node.isActionLike(node) && !node.properties.disposition,\n );\n if (item) {\n yield* Operation.schedule(LayoutOperation.Open, { subject: [item.id] });\n }\n }\n }\n }),\n }),\n\n //\n // RevertWorkspace\n //\n OperationResolver.make({\n operation: LayoutOperation.RevertWorkspace,\n handler: Effect.fnUntraced(function* () {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: state.previousDeck });\n }),\n }),\n\n //\n // Open\n //\n OperationResolver.make({\n operation: LayoutOperation.Open,\n handler: Effect.fnUntraced(function* (input) {\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n const settings = yield* Capabilities.getAtomValue(DeckCapabilities.Settings);\n\n {\n const state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n if (input.workspace && state.activeDeck !== input.workspace) {\n yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: input.workspace });\n }\n }\n\n let previouslyOpenIds: Set<string>;\n {\n const deck = yield* DeckCapabilities.getDeck();\n previouslyOpenIds = new Set<string>(deck.solo ? [deck.solo] : deck.active);\n const next = deck.solo\n ? [...input.subject]\n : input.subject.reduce(\n (acc, entryId) =>\n openEntry(acc, entryId, {\n key: input.key,\n positioning: input.positioning ?? settings?.newPlankPositioning,\n pivotId: input.pivotId,\n }),\n deck.active,\n );\n\n const { deckUpdates, toAttend: _toAttend } = computeActiveUpdates({ next, deck, attention });\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>\n updateActiveDeck(state, deckUpdates),\n );\n }\n\n {\n const deck = yield* DeckCapabilities.getDeck();\n const ids = deck.solo ? [deck.solo] : deck.active;\n const newlyOpen = ids.filter((i: string) => !previouslyOpenIds.has(i));\n\n if (input.scrollIntoView !== false && (newlyOpen[0] ?? input.subject[0])) {\n yield* Operation.schedule(LayoutOperation.ScrollIntoView, {\n subject: newlyOpen[0] ?? input.subject[0],\n });\n }\n\n if (newlyOpen[0] ?? input.subject[0]) {\n yield* Operation.schedule(LayoutOperation.Expose, { subject: newlyOpen[0] ?? input.subject[0] });\n }\n\n // Send analytics events for newly opened items.\n for (const subjectId of newlyOpen) {\n const typename = Option.match(Graph.getNode(graph, subjectId), {\n onNone: () => undefined,\n onSome: (node) => {\n const active = node.data;\n return Obj.isObject(active) ? Obj.getTypename(active) : undefined;\n },\n });\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'navigation.activate',\n properties: { subjectId, typename },\n });\n }\n }\n }),\n }),\n\n //\n // UpdatePlankSize\n //\n OperationResolver.make({\n operation: DeckOperation.UpdatePlankSize,\n handler: Effect.fnUntraced(function* (input) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>\n updateActiveDeck(state, {\n plankSizing: {\n ...state.decks[state.activeDeck]?.plankSizing,\n [input.id]: input.size,\n },\n }),\n );\n }),\n }),\n\n //\n // Adjust\n //\n OperationResolver.make({\n operation: DeckOperation.Adjust,\n handler: Effect.fnUntraced(function* (input) {\n const _state = yield* Capabilities.getAtomValue(DeckCapabilities.State);\n const deck = yield* DeckCapabilities.getDeck();\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n\n // Collect layout operations to run after state updates.\n let soloOperation:\n | { type: 'solo'; entryId: string; mode: string }\n | { type: 'unsolo'; entryId: string }\n | undefined;\n\n if (input.type === 'increment-end' || input.type === 'increment-start') {\n const next = incrementPlank(deck.active, input);\n const { deckUpdates } = computeActiveUpdates({ next, deck, attention });\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>\n updateActiveDeck(state, deckUpdates),\n );\n }\n\n if (input.type.startsWith('solo')) {\n const entryId = input.id;\n if (!deck.solo) {\n // Solo the entry.\n soloOperation = { type: 'solo', entryId, mode: input.type };\n } else {\n if (input.type === 'solo--fullscreen') {\n // Toggle fullscreen on the current entry.\n soloOperation = { type: 'solo', entryId, mode: 'solo--fullscreen' };\n } else if (input.type === 'solo') {\n // Un-solo the current entry and open it.\n soloOperation = { type: 'unsolo', entryId };\n }\n }\n }\n\n // Run collected solo operations.\n if (soloOperation?.type === 'solo') {\n yield* Operation.invoke(LayoutOperation.SetLayoutMode, {\n subject: soloOperation.entryId,\n mode: soloOperation.mode,\n });\n } else if (soloOperation?.type === 'unsolo') {\n yield* Operation.invoke(LayoutOperation.SetLayoutMode, { mode: 'deck' });\n yield* Operation.invoke(LayoutOperation.Open, { subject: [soloOperation.entryId] });\n }\n\n if (input.type === 'companion') {\n const companion = Function.pipe(\n Graph.getNode(graph, input.id),\n Option.map((node) =>\n Graph.getConnections(graph, node.id, 'child')\n .filter((n) => n.type === PLANK_COMPANION_TYPE)\n .toSorted((a, b) => byPosition(a.properties, b.properties)),\n ),\n Option.flatMap((companions) => (companions.length > 0 ? Option.some(companions[0]) : Option.none())),\n );\n\n if (Option.isSome(companion)) {\n yield* Operation.invoke(DeckOperation.ChangeCompanion, { companion: companion.value.id });\n }\n }\n }),\n }),\n\n //\n // ChangeCompanion\n //\n OperationResolver.make({\n operation: DeckOperation.ChangeCompanion,\n handler: Effect.fnUntraced(function* (input) {\n if (input.companion === null) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>\n updateActiveDeck(state, { companionOpen: false }),\n );\n } else {\n const variant = getCompanionVariant(input.companion);\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) =>\n updateActiveDeck(state, {\n companionOpen: true,\n companionVariant: variant,\n }),\n );\n }\n }),\n }),\n\n //\n // Close\n //\n OperationResolver.make({\n operation: LayoutOperation.Close,\n handler: Effect.fnUntraced(function* (input) {\n const deck = yield* DeckCapabilities.getDeck();\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n\n const active = deck.solo ? [deck.solo] : deck.active;\n const next = input.subject.reduce((acc, id) => closeEntry(acc, id), active);\n const { deckUpdates, toAttend } = computeActiveUpdates({ next, deck, attention });\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));\n\n if (toAttend) {\n yield* Operation.schedule(LayoutOperation.ScrollIntoView, { subject: toAttend });\n }\n }),\n }),\n\n //\n // Set\n //\n OperationResolver.make({\n operation: LayoutOperation.Set,\n handler: Effect.fnUntraced(function* (input) {\n const deck = yield* DeckCapabilities.getDeck();\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n\n const { deckUpdates, toAttend } = computeActiveUpdates({\n next: input.subject as string[],\n deck,\n attention,\n });\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (state) => updateActiveDeck(state, deckUpdates));\n\n if (toAttend) {\n yield* Operation.schedule(LayoutOperation.ScrollIntoView, { subject: toAttend });\n }\n }),\n }),\n\n //\n // ScrollIntoView\n //\n OperationResolver.make({\n operation: LayoutOperation.ScrollIntoView,\n handler: Effect.fnUntraced(function* (input) {\n yield* Capabilities.updateAtomValue(DeckCapabilities.EphemeralState, (state) => ({\n ...state,\n scrollIntoView: input.subject,\n }));\n }),\n }),\n ]);\n }),\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { produce } from 'immer';\n\nimport { type DeckAction, type NewPlankPositioning } from './types';\n\ntype OpenLayoutEntryOptions = {\n key?: string;\n positioning?: NewPlankPositioning;\n pivotId?: string;\n};\n\nexport const openEntry = (deck: string[], entryId: string, options?: OpenLayoutEntryOptions): string[] => {\n return produce(deck, (draft) => {\n // Check that the entry is not already in the part\n if (draft.find((id) => id === entryId)) {\n return;\n }\n\n const key = options?.key;\n const plankPositioning = options?.positioning ?? 'start';\n const pivotId = options?.pivotId;\n\n if (key) {\n const index = draft.findIndex((id) => id.split('+')[0] === key);\n if (index !== -1) {\n draft.splice(index, 1, entryId);\n return;\n }\n }\n\n if (pivotId) {\n const pivotIndex = draft.findIndex((id) => id === pivotId);\n if (pivotIndex !== -1) {\n if (plankPositioning === 'start') {\n draft.splice(pivotIndex, 0, entryId);\n } else {\n draft.splice(pivotIndex + 1, 0, entryId);\n }\n return;\n }\n }\n\n // If no pivot found or provided, fall back to original behavior\n if (plankPositioning === 'start') {\n draft.unshift(entryId);\n } else {\n draft.push(entryId);\n }\n });\n};\n\nexport const closeEntry = (deck: string[], entryId: string): string[] => {\n return produce(deck, (draft) => {\n const index = draft.findIndex((id) => id === entryId);\n if (index !== -1) {\n draft.splice(index, 1);\n }\n });\n};\n\nexport const incrementPlank = (deck: string[], adjustment: DeckAction.Adjustment): string[] => {\n return produce(deck, (draft) => {\n const index = draft.findIndex((id) => id === adjustment.id);\n if (\n index === -1 ||\n (adjustment.type === 'increment-start' && index === 0) ||\n (adjustment.type === 'increment-end' && index === draft.length - 1)\n ) {\n return;\n }\n\n if (adjustment.type === 'increment-start') {\n // Swap the current item with the previous item.\n [draft[index - 1], draft[index]] = [draft[index], draft[index - 1]];\n } else if (adjustment.type === 'increment-end') {\n // Swap the current item with the next item.\n [draft[index], draft[index + 1]] = [draft[index + 1], draft[index]];\n }\n });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,cAAcC,YAAYC,qBAAqB;AACxD,SAASC,iBAAiBC,iBAAiBC,qBAAqBC,yBAAyB;AACzF,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,yBAAyB;AAClC,SAASC,iBAAiB;AAC1B,SAASC,6BAA6B;AACtC,SAASC,OAAOC,YAAY;AAC5B,SAASC,8BAA8B;AACvC,SAASC,YAAYC,qBAAqB;;;ACd1C,SAASC,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GA;UACH8I,gBAAgB/I,MAAMW;QACxB,EAAA;MACF,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Function", "Option", "Capabilities", "Capability", "UndoOperation", "AppCapabilities", "LayoutOperation", "getCompanionVariant", "isPinnedWorkspace", "Obj", "invariant", "log", "OperationResolver", "Operation", "AttentionCapabilities", "Graph", "Node", "ObservabilityOperation", "byPosition", "isNonNullable", "produce", "openEntry", "deck", "entryId", "options", "produce", "draft", "find", "id", "key", "plankPositioning", "positioning", "pivotId", "index", "findIndex", "split", "splice", "pivotIndex", "unshift", "push", "closeEntry", "incrementPlank", "adjustment", "type", "length", "updateActiveDeck", "current", "deckUpdates", "currentDeck", "decks", "activeDeck", "invariant", "Capability", "makeModule", "fnUntraced", "contributes", "Capabilities", "OperationResolver", "make", "operation", "LayoutOperation", "UpdateSidebar", "handler", "input", "state", "getAtomValue", "DeckCapabilities", "State", "next", "sidebarState", "updateAtomValue", "UpdateComplementary", "panelChanged", "complementarySidebarPanel", "subject", "complementarySidebarState", "stateChanged", "UpdateDialog", "EphemeralState", "dialogOpen", "Boolean", "dialogType", "type", "dialogBlockAlign", "blockAlign", "dialogOverlayClasses", "overlayClasses", "dialogOverlayStyle", "overlayStyle", "dialogContent", "component", "props", "UpdatePopover", "popoverOpen", "popoverKind", "kind", "popoverTitle", "title", "undefined", "popoverContentRef", "subjectRef", "popoverContent", "popoverSide", "side", "popoverAnchor", "variant", "anchor", "popoverAnchorId", "anchorId", "AddToast", "toasts", "UndoOperation", "ShowUndo", "historyTracker", "get", "HistoryTracker", "newUndoId", "Date", "now", "filteredToasts", "currentUndoId", "filter", "toast", "id", "message", "ns", "meta", "duration", "actionLabel", "actionAlt", "closeLabel", "onAction", "undoPromise", "SetLayoutMode", "isLayoutMode", "mode", "deck", "getDeck", "computeModeUpdate", "solo", "active", "isNonNullable", "removed", "includes", "closed", "Array", "from", "Set", "inactive", "soloUpdate", "initialized", "fullscreenUpdate", "fullscreen", "currentMode", "getMode", "newPreviousMode", "previousMode", "last", "log", "warn", "SwitchWorkspace", "graph", "AppCapabilities", "AppGraph", "shouldUpdatePrevious", "isPinnedWorkspace", "newDecks", "defaultDeck", "previousDeck", "first", "Operation", "schedule", "ScrollIntoView", "item", "Graph", "getConnections", "node", "Node", "isActionLike", "properties", "disposition", "Open", "RevertWorkspace", "invoke", "attention", "AttentionCapabilities", "Attention", "settings", "Settings", "workspace", "previouslyOpenIds", "reduce", "acc", "entryId", "openEntry", "key", "positioning", "newPlankPositioning", "pivotId", "toAttend", "_toAttend", "computeActiveUpdates", "ids", "newlyOpen", "i", "has", "scrollIntoView", "Expose", "subjectId", "typename", "match", "getNode", "onNone", "onSome", "data", "Obj", "isObject", "getTypename", "ObservabilityOperation", "SendEvent", "name", "DeckOperation", "UpdatePlankSize", "plankSizing", "size", "Adjust", "_state", "soloOperation", "incrementPlank", "startsWith", "companion", "pipe", "map", "n", "PLANK_COMPANION_TYPE", "toSorted", "a", "b", "byPosition", "flatMap", "companions", "length", "some", "none", "isSome", "ChangeCompanion", "value", "companionOpen", "getCompanionVariant", "companionVariant", "Close", "closeEntry"]
|
|
7
|
+
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeckLayout
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ITNJS5QX.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useDeckState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TAHLKBDO.mjs";
|
|
7
7
|
import "./chunk-BJDEG7YZ.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-OAPMV5ZR.mjs";
|
|
8
|
+
import "./chunk-3P2FJVXC.mjs";
|
|
10
9
|
import {
|
|
11
10
|
meta
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-L3RYMAV7.mjs";
|
|
13
12
|
|
|
14
13
|
// src/capabilities/react-root/react-root.tsx
|
|
15
14
|
import * as Effect from "effect/Effect";
|
|
@@ -46,4 +45,4 @@ var react_root_default = Capability.makeModule(() => Effect.succeed(Capability.c
|
|
|
46
45
|
export {
|
|
47
46
|
react_root_default as default
|
|
48
47
|
};
|
|
49
|
-
//# sourceMappingURL=react-root-
|
|
48
|
+
//# sourceMappingURL=react-root-AS4IOYDG.mjs.map
|
package/dist/lib/{node-esm/react-root-YO7IIC75.mjs.map → browser/react-root-AS4IOYDG.mjs.map}
RENAMED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/react-root/react-root.tsx"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React, { useCallback } from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\n\nimport { DeckLayout } from '../../components';\nimport { useDeckState } from '../../hooks';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactRoot, {\n id: meta.id,\n root: () => {\n const { state, updateEphemeral } = useDeckState();\n\n const handleDismissToast = useCallback(\n (id: string) => {\n const index = state.toasts.findIndex((toast) => toast.id === id);\n if (index !== -1) {\n // Allow time for the toast to animate out.\n // TODO(burdon): Factor out and unregister timeout.\n setTimeout(() => {\n updateEphemeral((s) => {\n const toastToRemove = s.toasts[index];\n const newCurrentUndoId = toastToRemove?.id === s.currentUndoId ? undefined : s.currentUndoId;\n return {\n ...s,\n currentUndoId: newCurrentUndoId,\n toasts: s.toasts.filter((_, i) => i !== index),\n };\n });\n }, 1_000);\n }\n },\n [state.toasts, updateEphemeral],\n );\n\n return <DeckLayout onDismissToast={handleDismissToast} />;\n },\n }),\n ),\n);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,SAASC,mBAAmB;AAEnC,SAASC,cAAcC,kBAAkB;AAMzC,IAAA,qBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,WAAW;EAC7CC,IAAIC,KAAKD;EACTE,MAAM,MAAA;AACJ,UAAM,EAAEC,OAAOC,gBAAe,IAAKC,aAAAA;AAEnC,UAAMC,qBAAqBC,YACzB,CAACP,OAAAA;AACC,YAAMQ,QAAQL,MAAMM,OAAOC,UAAU,CAACC,UAAUA,MAAMX,OAAOA,EAAAA;AAC7D,UAAIQ,UAAU,IAAI;AAGhBI,mBAAW,MAAA;AACTR,0BAAgB,CAACS,MAAAA;AACf,kBAAMC,gBAAgBD,EAAEJ,OAAOD,KAAAA;AAC/B,kBAAMO,mBAAmBD,eAAed,OAAOa,EAAEG,gBAAgBC,SAAYJ,EAAEG;AAC/E,mBAAO;cACL,GAAGH;cACHG,eAAeD;cACfN,QAAQI,EAAEJ,OAAOS,OAAO,CAACC,GAAGC,MAAMA,MAAMZ,KAAAA;YAC1C;UACF,CAAA;QACF,GAAG,GAAA;MACL;IACF,GACA;MAACL,MAAMM;MAAQL;KAAgB;AAGjC,WAAO,sBAAA,cAACiB,YAAAA;MAAWC,gBAAgBhB;;EACrC;AACF,CAAA,CAAA,CAAA;",
|
|
6
6
|
"names": ["Effect", "React", "useCallback", "Capabilities", "Capability", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactRoot", "id", "meta", "root", "state", "updateEphemeral", "useDeckState", "handleDismissToast", "useCallback", "index", "toasts", "findIndex", "toast", "setTimeout", "s", "toastToRemove", "newCurrentUndoId", "currentUndoId", "undefined", "filter", "_", "i", "DeckLayout", "onDismissToast"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
meta
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L3RYMAV7.mjs";
|
|
4
4
|
|
|
5
5
|
// src/capabilities/react-surface/react-surface.tsx
|
|
6
6
|
import * as Effect from "effect/Effect";
|
|
@@ -11,13 +11,13 @@ import { AppCapabilities } from "@dxos/app-toolkit";
|
|
|
11
11
|
|
|
12
12
|
// src/containers/index.ts
|
|
13
13
|
import { lazy } from "react";
|
|
14
|
-
var Banner = lazy(() => import("./Banner-
|
|
15
|
-
var DeckSettings = lazy(() => import("./DeckSettings-
|
|
14
|
+
var Banner = lazy(() => import("./Banner-HXRXEUOZ.mjs"));
|
|
15
|
+
var DeckSettings = lazy(() => import("./DeckSettings-HSSQKFNE.mjs"));
|
|
16
16
|
|
|
17
17
|
// src/capabilities/react-surface/react-surface.tsx
|
|
18
18
|
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
|
|
19
19
|
Surface.create({
|
|
20
|
-
id: `${meta.id}
|
|
20
|
+
id: `${meta.id}.plugin-settings`,
|
|
21
21
|
role: "article",
|
|
22
22
|
filter: (data) => AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,
|
|
23
23
|
component: ({ data: { subject } }) => {
|
|
@@ -29,7 +29,7 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
|
|
|
29
29
|
}
|
|
30
30
|
}),
|
|
31
31
|
Surface.create({
|
|
32
|
-
id: `${meta.id}
|
|
32
|
+
id: `${meta.id}.banner`,
|
|
33
33
|
role: "banner",
|
|
34
34
|
component: ({ data }) => {
|
|
35
35
|
return /* @__PURE__ */ React.createElement(Banner, {
|
|
@@ -41,4 +41,4 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
|
|
|
41
41
|
export {
|
|
42
42
|
react_surface_default as default
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=react-surface-
|
|
44
|
+
//# sourceMappingURL=react-surface-FH7TC6WW.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/containers/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface, useSettingsState } from '@dxos/app-framework/ui';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n\nimport { Banner, DeckSettings } from '../../containers';\nimport { meta } from '../../meta';\nimport { type DeckSettingsProps } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: `${meta.id}
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface, useSettingsState } from '@dxos/app-framework/ui';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n\nimport { Banner, DeckSettings } from '../../containers';\nimport { meta } from '../../meta';\nimport { type DeckSettingsProps } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: `${meta.id}.plugin-settings`,\n role: 'article',\n filter: (data): data is { subject: AppCapabilities.Settings } =>\n AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,\n component: ({ data: { subject } }) => {\n const { settings, updateSettings } = useSettingsState<DeckSettingsProps>(subject.atom);\n return <DeckSettings settings={settings} onSettingsChange={updateSettings} />;\n },\n }),\n Surface.create({\n id: `${meta.id}.banner`,\n role: 'banner',\n component: ({ data }: { data: { variant?: 'topbar' | 'sidebar' } }) => {\n return <Banner variant={data.variant} />;\n },\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const Banner: ComponentType<any> = lazy(() => import('./Banner'));\nexport const DeckSettings: ComponentType<any> = lazy(() => import('./DeckSettings'));\n"],
|
|
5
5
|
"mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,SAASC,wBAAwB;AAC1C,SAASC,uBAAuB;;;ACLhC,SAA6BC,YAAY;AAElC,IAAMC,SAA6BC,KAAK,MAAM,OAAO,uBAAA,CAAA;AACrD,IAAMC,eAAmCD,KAAK,MAAM,OAAO,6BAAA,CAAA;;;ADQlE,IAAA,wBAAeE,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,cAAc;EAChDC,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SACPC,gBAAgBC,WAAWF,KAAKG,OAAO,KAAKH,KAAKG,QAAQC,WAAWP,KAAKD;IAC3ES,WAAW,CAAC,EAAEL,MAAM,EAAEG,QAAO,EAAE,MAAE;AAC/B,YAAM,EAAEG,UAAUC,eAAc,IAAKC,iBAAoCL,QAAQM,IAAI;AACrF,aAAO,sBAAA,cAACC,cAAAA;QAAaJ;QAAoBK,kBAAkBJ;;IAC7D;EACF,CAAA;EACAb,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNO,WAAW,CAAC,EAAEL,KAAI,MAAgD;AAChE,aAAO,sBAAA,cAACY,QAAAA;QAAOC,SAASb,KAAKa;;IAC/B;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
6
|
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "useSettingsState", "AppCapabilities", "lazy", "Banner", "lazy", "DeckSettings", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "AppCapabilities", "isSettings", "subject", "prefix", "component", "settings", "updateSettings", "useSettingsState", "atom", "DeckSettings", "onSettingsChange", "Banner", "variant"]
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeckCapabilities,
|
|
3
3
|
DeckSettingsSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3P2FJVXC.mjs";
|
|
5
5
|
import {
|
|
6
6
|
meta
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-L3RYMAV7.mjs";
|
|
8
8
|
|
|
9
9
|
// src/capabilities/settings/settings.ts
|
|
10
10
|
import * as Effect from "effect/Effect";
|
|
@@ -37,4 +37,4 @@ var settings_default = Capability.makeModule(() => Effect.sync(() => {
|
|
|
37
37
|
export {
|
|
38
38
|
settings_default as default
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=settings-
|
|
40
|
+
//# sourceMappingURL=settings-PTMGCSJH.mjs.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
DeckStateSchema,
|
|
4
4
|
defaultDeck,
|
|
5
5
|
getMode
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3P2FJVXC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
meta
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-L3RYMAV7.mjs";
|
|
10
10
|
|
|
11
11
|
// src/capabilities/state/state.ts
|
|
12
12
|
import { Atom } from "@effect-atom/atom-react";
|
|
@@ -45,7 +45,7 @@ var defaultDeckEphemeralState = {
|
|
|
45
45
|
var state_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
46
46
|
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
47
47
|
const stateAtom = createKvsStore({
|
|
48
|
-
key: `${meta.id}
|
|
48
|
+
key: `${meta.id}.state`,
|
|
49
49
|
schema: DeckStateSchema,
|
|
50
50
|
defaultValue: () => ({
|
|
51
51
|
...defaultDeckState
|
|
@@ -103,4 +103,4 @@ var state_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
103
103
|
export {
|
|
104
104
|
state_default as default
|
|
105
105
|
};
|
|
106
|
-
//# sourceMappingURL=state-
|
|
106
|
+
//# sourceMappingURL=state-MA4SQ7BE.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/state/state.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { createKvsStore } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\n\nimport { meta } from '../../meta';\nimport {\n DeckCapabilities,\n type DeckEphemeralStateProps,\n type DeckStateProps,\n DeckStateSchema,\n defaultDeck,\n getMode,\n} from '../../types';\n\n/** Default persisted state. */\nconst defaultDeckState: DeckStateProps = {\n sidebarState: 'expanded',\n complementarySidebarState: 'collapsed',\n complementarySidebarPanel: undefined,\n activeDeck: 'default',\n previousDeck: 'default',\n decks: {\n default: { ...defaultDeck },\n },\n previousMode: {},\n};\n\n/** Default ephemeral state. */\nconst defaultDeckEphemeralState: DeckEphemeralStateProps = {\n dialogContent: null,\n dialogOpen: false,\n dialogBlockAlign: undefined,\n dialogType: undefined,\n popoverContent: null,\n popoverAnchor: undefined,\n popoverAnchorId: undefined,\n popoverOpen: false,\n toasts: [],\n currentUndoId: undefined,\n scrollIntoView: undefined,\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n\n // Persisted state using KVS store.\n const stateAtom = createKvsStore({\n key: `${meta.id}
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { createKvsStore } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\n\nimport { meta } from '../../meta';\nimport {\n DeckCapabilities,\n type DeckEphemeralStateProps,\n type DeckStateProps,\n DeckStateSchema,\n defaultDeck,\n getMode,\n} from '../../types';\n\n/** Default persisted state. */\nconst defaultDeckState: DeckStateProps = {\n sidebarState: 'expanded',\n complementarySidebarState: 'collapsed',\n complementarySidebarPanel: undefined,\n activeDeck: 'default',\n previousDeck: 'default',\n decks: {\n default: { ...defaultDeck },\n },\n previousMode: {},\n};\n\n/** Default ephemeral state. */\nconst defaultDeckEphemeralState: DeckEphemeralStateProps = {\n dialogContent: null,\n dialogOpen: false,\n dialogBlockAlign: undefined,\n dialogType: undefined,\n popoverContent: null,\n popoverAnchor: undefined,\n popoverAnchorId: undefined,\n popoverOpen: false,\n toasts: [],\n currentUndoId: undefined,\n scrollIntoView: undefined,\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n\n // Persisted state using KVS store.\n const stateAtom = createKvsStore({\n key: `${meta.id}.state`,\n schema: DeckStateSchema,\n defaultValue: () => ({ ...defaultDeckState }),\n });\n\n // Ephemeral state (not persisted, but kept alive to prevent GC resets).\n const ephemeralAtom = Atom.make<DeckEphemeralStateProps>({ ...defaultDeckEphemeralState }).pipe(Atom.keepAlive);\n\n // Don't allow fullscreen mode to be persisted to prevent getting stuck in it.\n const currentState = registry.get(stateAtom);\n const currentDeck = currentState.decks[currentState.activeDeck];\n if (currentDeck?.fullscreen) {\n registry.set(stateAtom, {\n ...currentState,\n decks: {\n ...currentState.decks,\n [currentState.activeDeck]: {\n ...currentDeck,\n fullscreen: false,\n },\n },\n });\n }\n\n // Create derived layout atom (read-only) from both state atoms.\n const layoutAtom = Atom.make((get) => {\n const state = get(stateAtom);\n const ephemeral = get(ephemeralAtom);\n const deck = state.decks[state.activeDeck];\n invariant(deck, `Deck not found: ${state.activeDeck}`);\n return {\n mode: getMode(deck),\n dialogOpen: ephemeral.dialogOpen,\n sidebarOpen: state.sidebarState === 'expanded',\n complementarySidebarOpen: state.complementarySidebarState === 'expanded',\n workspace: state.activeDeck,\n active: deck.solo ? [deck.solo] : deck.active,\n inactive: deck.inactive,\n scrollIntoView: ephemeral.scrollIntoView,\n } satisfies AppCapabilities.Layout;\n }).pipe(Atom.keepAlive);\n\n return [\n Capability.contributes(DeckCapabilities.State, stateAtom),\n Capability.contributes(DeckCapabilities.EphemeralState, ephemeralAtom),\n Capability.contributes(AppCapabilities.Layout, layoutAtom),\n ];\n }),\n);\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,sBAAsB;AAC/B,SAASC,iBAAiB;;AAa1B,IAAMC,mBAAmC;EACvCC,cAAc;EACdC,2BAA2B;EAC3BC,2BAA2BC;EAC3BC,YAAY;EACZC,cAAc;EACdC,OAAO;IACLC,SAAS;MAAE,GAAGC;IAAY;EAC5B;EACAC,cAAc,CAAC;AACjB;AAGA,IAAMC,4BAAqD;EACzDC,eAAe;EACfC,YAAY;EACZC,kBAAkBV;EAClBW,YAAYX;EACZY,gBAAgB;EAChBC,eAAeb;EACfc,iBAAiBd;EACjBe,aAAa;EACbC,QAAQ,CAAA;EACRC,eAAejB;EACfkB,gBAAgBlB;AAClB;AAEA,IAAA,gBAAemB,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,aAAaC,YAAY;AAGhE,QAAMC,YAAYC,eAAe;IAC/BC,KAAK,GAAGC,KAAKC,EAAE;IACfC,QAAQC;IACRC,cAAc,OAAO;MAAE,GAAGrC;IAAiB;EAC7C,CAAA;AAGA,QAAMsC,gBAAgBC,KAAKC,KAA8B;IAAE,GAAG7B;EAA0B,CAAA,EAAG8B,KAAKF,KAAKG,SAAS;AAG9G,QAAMC,eAAejB,SAASC,IAAIG,SAAAA;AAClC,QAAMc,cAAcD,aAAapC,MAAMoC,aAAatC,UAAU;AAC9D,MAAIuC,aAAaC,YAAY;AAC3BnB,aAASoB,IAAIhB,WAAW;MACtB,GAAGa;MACHpC,OAAO;QACL,GAAGoC,aAAapC;QAChB,CAACoC,aAAatC,UAAU,GAAG;UACzB,GAAGuC;UACHC,YAAY;QACd;MACF;IACF,CAAA;EACF;AAGA,QAAME,aAAaR,KAAKC,KAAK,CAACb,QAAAA;AAC5B,UAAMqB,QAAQrB,IAAIG,SAAAA;AAClB,UAAMmB,YAAYtB,IAAIW,aAAAA;AACtB,UAAMY,OAAOF,MAAMzC,MAAMyC,MAAM3C,UAAU;AACzC8C,cAAUD,MAAM,mBAAmBF,MAAM3C,UAAU,IAAE;;;;;;;;;AACrD,WAAO;MACL+C,MAAMC,QAAQH,IAAAA;MACdrC,YAAYoC,UAAUpC;MACtByC,aAAaN,MAAM/C,iBAAiB;MACpCsD,0BAA0BP,MAAM9C,8BAA8B;MAC9DsD,WAAWR,MAAM3C;MACjBoD,QAAQP,KAAKQ,OAAO;QAACR,KAAKQ;UAAQR,KAAKO;MACvCE,UAAUT,KAAKS;MACfrC,gBAAgB2B,UAAU3B;IAC5B;EACF,CAAA,EAAGmB,KAAKF,KAAKG,SAAS;AAEtB,SAAO;IACLnB,WAAWqC,YAAYC,iBAAiBC,OAAOhC,SAAAA;IAC/CP,WAAWqC,YAAYC,iBAAiBE,gBAAgBzB,aAAAA;IACxDf,WAAWqC,YAAYI,gBAAgBC,QAAQlB,UAAAA;;AAEnD,CAAA,CAAA;",
|
|
6
6
|
"names": ["Atom", "Effect", "Capabilities", "Capability", "AppCapabilities", "createKvsStore", "invariant", "defaultDeckState", "sidebarState", "complementarySidebarState", "complementarySidebarPanel", "undefined", "activeDeck", "previousDeck", "decks", "default", "defaultDeck", "previousMode", "defaultDeckEphemeralState", "dialogContent", "dialogOpen", "dialogBlockAlign", "dialogType", "popoverContent", "popoverAnchor", "popoverAnchorId", "popoverOpen", "toasts", "currentUndoId", "scrollIntoView", "Capability", "makeModule", "fnUntraced", "registry", "get", "Capabilities", "AtomRegistry", "stateAtom", "createKvsStore", "key", "meta", "id", "schema", "DeckStateSchema", "defaultValue", "ephemeralAtom", "Atom", "make", "pipe", "keepAlive", "currentState", "currentDeck", "fullscreen", "set", "layoutAtom", "state", "ephemeral", "deck", "invariant", "mode", "getMode", "sidebarOpen", "complementarySidebarOpen", "workspace", "active", "solo", "inactive", "contributes", "DeckCapabilities", "State", "EphemeralState", "AppCapabilities", "Layout"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeckCapabilities
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-3P2FJVXC.mjs";
|
|
4
|
+
import "./chunk-L3RYMAV7.mjs";
|
|
5
5
|
|
|
6
6
|
// src/capabilities/toolkit/toolkit.ts
|
|
7
7
|
import * as Tool from "@effect/ai/Tool";
|
|
@@ -52,4 +52,4 @@ export {
|
|
|
52
52
|
DeckToolkit,
|
|
53
53
|
toolkit_default as default
|
|
54
54
|
};
|
|
55
|
-
//# sourceMappingURL=toolkit-
|
|
55
|
+
//# sourceMappingURL=toolkit-6B34QFU3.mjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ATTENDABLE_PATH_SEPARATOR,
|
|
3
2
|
DECK_COMPANION_TYPE,
|
|
4
3
|
DeckAction,
|
|
5
4
|
DeckCapabilities,
|
|
@@ -16,10 +15,9 @@ import {
|
|
|
16
15
|
defaultDeck,
|
|
17
16
|
getMode,
|
|
18
17
|
isLayoutMode
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-3P2FJVXC.mjs";
|
|
19
|
+
import "../chunk-L3RYMAV7.mjs";
|
|
21
20
|
export {
|
|
22
|
-
ATTENDABLE_PATH_SEPARATOR,
|
|
23
21
|
DECK_COMPANION_TYPE,
|
|
24
22
|
DeckAction,
|
|
25
23
|
DeckCapabilities,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeckCapabilities,
|
|
3
3
|
defaultDeck
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-3P2FJVXC.mjs";
|
|
5
|
+
import "./chunk-L3RYMAV7.mjs";
|
|
6
6
|
|
|
7
7
|
// src/capabilities/url-handler/url-handler.ts
|
|
8
8
|
import * as Effect from "effect/Effect";
|
|
9
9
|
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
10
|
-
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
10
|
+
import { LayoutOperation, fromUrlPath, getWorkspaceFromPath, toUrlPath } from "@dxos/app-toolkit";
|
|
11
11
|
import { invariant } from "@dxos/invariant";
|
|
12
|
+
import { Node } from "@dxos/plugin-graph";
|
|
12
13
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/capabilities/url-handler/url-handler.ts";
|
|
13
14
|
var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
14
15
|
const { invokeSync } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
@@ -48,19 +49,21 @@ var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
48
49
|
window.location.pathname = "/";
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
51
|
-
const
|
|
52
|
-
|
|
52
|
+
const qualifiedId = fromUrlPath(pathname);
|
|
53
|
+
const workspace = getWorkspaceFromPath(qualifiedId);
|
|
54
|
+
if (workspace !== Node.RootId && workspace !== state.activeDeck) {
|
|
53
55
|
invokeSync(LayoutOperation.SwitchWorkspace, {
|
|
54
|
-
subject:
|
|
56
|
+
subject: workspace
|
|
55
57
|
});
|
|
56
58
|
}
|
|
57
59
|
const deck = getDeck();
|
|
58
|
-
|
|
60
|
+
const activeId = qualifiedId !== workspace ? qualifiedId : void 0;
|
|
61
|
+
if (activeId && activeId !== deck.solo) {
|
|
59
62
|
invokeSync(LayoutOperation.SetLayoutMode, {
|
|
60
|
-
subject:
|
|
63
|
+
subject: activeId,
|
|
61
64
|
mode: "solo"
|
|
62
65
|
});
|
|
63
|
-
} else if (!
|
|
66
|
+
} else if (!activeId && deck.solo) {
|
|
64
67
|
invokeSync(LayoutOperation.SetLayoutMode, {
|
|
65
68
|
mode: "deck"
|
|
66
69
|
});
|
|
@@ -78,7 +81,7 @@ var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
78
81
|
if (solo !== lastSolo || activeDeck !== lastActiveDeck) {
|
|
79
82
|
lastSolo = solo;
|
|
80
83
|
lastActiveDeck = activeDeck;
|
|
81
|
-
const path = solo ?
|
|
84
|
+
const path = solo ? toUrlPath(solo) : toUrlPath(activeDeck);
|
|
82
85
|
if (window.location.pathname !== path) {
|
|
83
86
|
history.pushState(null, "", `${path}${window.location.search}`);
|
|
84
87
|
}
|
|
@@ -92,4 +95,4 @@ var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
92
95
|
export {
|
|
93
96
|
url_handler_default as default
|
|
94
97
|
};
|
|
95
|
-
//# sourceMappingURL=url-handler-
|
|
98
|
+
//# sourceMappingURL=url-handler-FEUFPQIP.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/url-handler/url-handler.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation, fromUrlPath, getWorkspaceFromPath, toUrlPath } from '@dxos/app-toolkit';\nimport { invariant } from '@dxos/invariant';\nimport { Node } from '@dxos/plugin-graph';\n\nimport { DeckCapabilities, type DeckStateProps, defaultDeck } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const { invokeSync } = yield* Capability.get(Capabilities.OperationInvoker);\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(DeckCapabilities.State);\n\n // Helper to get state.\n const getState = () => registry.get(stateAtom);\n\n // Helper to get computed deck from state.\n const getDeck = () => {\n const state = getState();\n const deck = state.decks[state.activeDeck];\n invariant(deck, `Deck not found: ${state.activeDeck}`);\n return deck;\n };\n\n // Helper to update state.\n const updateState = (fn: (current: DeckStateProps) => DeckStateProps) => {\n registry.set(stateAtom, fn(getState()));\n };\n\n const handleNavigation = () => {\n const pathname = window.location.pathname;\n const state = getState();\n if (pathname === '/reset') {\n updateState((s) => ({\n ...s,\n activeDeck: 'default',\n decks: {\n default: { ...defaultDeck },\n },\n }));\n window.location.pathname = '/';\n return;\n }\n\n const qualifiedId = fromUrlPath(pathname);\n const workspace = getWorkspaceFromPath(qualifiedId);\n if (workspace !== Node.RootId && workspace !== state.activeDeck) {\n invokeSync(LayoutOperation.SwitchWorkspace, { subject: workspace });\n }\n\n const deck = getDeck();\n const activeId = qualifiedId !== workspace ? qualifiedId : undefined;\n if (activeId && activeId !== deck.solo) {\n invokeSync(LayoutOperation.SetLayoutMode, { subject: activeId, mode: 'solo' });\n } else if (!activeId && deck.solo) {\n invokeSync(LayoutOperation.SetLayoutMode, { mode: 'deck' });\n }\n };\n\n yield* Effect.sync(() => handleNavigation());\n window.addEventListener('popstate', handleNavigation);\n\n // Subscribe to state changes to update the URL.\n let lastSolo: string | undefined;\n let lastActiveDeck: string | undefined;\n const unsubscribe = registry.subscribe(stateAtom, () => {\n const state = getState();\n const deck = getDeck();\n const solo = deck.solo;\n const activeDeck = state.activeDeck;\n\n // Only update URL if relevant state changed.\n if (solo !== lastSolo || activeDeck !== lastActiveDeck) {\n lastSolo = solo;\n lastActiveDeck = activeDeck;\n\n const path = solo ? toUrlPath(solo) : toUrlPath(activeDeck);\n if (window.location.pathname !== path) {\n // TODO(thure): In some browsers, this only preserves the most recent state change, even though this is not `history.replace`…\n history.pushState(null, '', `${path}${window.location.search}`);\n }\n }\n });\n\n return Capability.contributes(Capabilities.Null, null, () =>\n Effect.sync(() => {\n window.removeEventListener('popstate', handleNavigation);\n un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AAA;AACb,UAAMyB,WAAWT,gBAAgBE,YAAYF,cAAcU;AAC3D,QAAID,YAAYA,aAAavB,KAAKyB,MAAM;AACtCrC,iBAAWgC,gBAAgBM,eAAe;QAAEJ,SAASC;QAAUI,MAAM;MAAO,CAAA;IAC9E,WAAW,CAACJ,YAAYvB,KAAKyB,MAAM;AACjCrC,iBAAWgC,gBAAgBM,eAAe;QAAEC,MAAM;MAAO,CAAA;IAC3D;EACF;AAEA,SAAcC,YAAK,MAAMrB,iBAAAA,CAAAA;AACzBE,SAAOoB,iBAAiB,YAAYtB,gBAAAA;AAGpC,MAAIuB;AACJ,MAAIC;AACJ,QAAMC,cAAcxC,SAASyC,UAAUvC,WAAW,MAAA;AAChD,UAAMK,QAAQF,SAAAA;AACd,UAAMG,OAAOF,QAAAA;AACb,UAAM2B,OAAOzB,KAAKyB;AAClB,UAAMvB,aAAaH,MAAMG;AAGzB,QAAIuB,SAASK,YAAY5B,eAAe6B,gBAAgB;AACtDD,iBAAWL;AACXM,uBAAiB7B;AAEjB,YAAMgC,OAAOT,OAAOU,UAAUV,IAAAA,IAAQU,UAAUjC,UAAAA;AAChD,UAAIO,OAAOC,SAASF,aAAa0B,MAAM;AAErCE,gBAAQC,UAAU,MAAM,IAAI,GAAGH,IAAAA,GAAOzB,OAAOC,SAAS4B,MAAM,EAAE;MAChE;IACF;EACF,CAAA;AAEA,SAAOrD,WAAWsD,YAAYjD,aAAakD,MAAM,MAAM,MAC9CZ,YAAK,MAAA;AACVnB,WAAOgC,oBAAoB,YAAYlC,gBAAAA;AACvCyB,gBAAAA;EACF,CAAA,CAAA;AAEJ,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "fromUrlPath", "getWorkspaceFromPath", "toUrlPath", "invariant", "Node", "Capability", "makeModule", "fnUntraced", "invokeSync", "get", "Capabilities", "OperationInvoker", "registry", "AtomRegistry", "stateAtom", "DeckCapabilities", "State", "getState", "getDeck", "state", "deck", "decks", "activeDeck", "invariant", "updateState", "fn", "set", "handleNavigation", "pathname", "window", "location", "s", "default", "defaultDeck", "qualifiedId", "fromUrlPath", "workspace", "getWorkspaceFromPath", "Node", "RootId", "LayoutOperation", "SwitchWorkspace", "subject", "activeId", "undefined", "solo", "SetLayoutMode", "mode", "sync", "addEventListener", "lastSolo", "lastActiveDeck", "unsubscribe", "subscribe", "path", "toUrlPath", "history", "pushState", "search", "contributes", "Null", "removeEventListener"]
|
|
7
|
+
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
Banner
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-MBCCNIWY.mjs";
|
|
5
|
+
import "./chunk-EMU4VIPH.mjs";
|
|
6
6
|
import "./chunk-DGTRKKWZ.mjs";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-EGFOT3DE.mjs";
|
|
7
|
+
import "./chunk-GZJAQ5IP.mjs";
|
|
8
|
+
import "./chunk-XCNF4COU.mjs";
|
|
10
9
|
|
|
11
10
|
// src/containers/Banner/index.ts
|
|
12
11
|
var Banner_default = Banner;
|
|
13
12
|
export {
|
|
14
13
|
Banner_default as default
|
|
15
14
|
};
|
|
16
|
-
//# sourceMappingURL=Banner-
|
|
15
|
+
//# sourceMappingURL=Banner-RN7XXOXY.mjs.map
|
|
@@ -2,10 +2,10 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
NewPlankPositions,
|
|
4
4
|
OverScrollToProps
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GZJAQ5IP.mjs";
|
|
6
6
|
import {
|
|
7
7
|
meta
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XCNF4COU.mjs";
|
|
9
9
|
|
|
10
10
|
// src/containers/DeckSettings/DeckSettings.tsx
|
|
11
11
|
import React from "react";
|
|
@@ -94,4 +94,4 @@ var DeckSettings_default = DeckSettings;
|
|
|
94
94
|
export {
|
|
95
95
|
DeckSettings_default as default
|
|
96
96
|
};
|
|
97
|
-
//# sourceMappingURL=DeckSettings-
|
|
97
|
+
//# sourceMappingURL=DeckSettings-DJRFLKQS.mjs.map
|