@dxos/plugin-deck 0.8.2-main.12df754 → 0.8.2-main.30e4dbb
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/{check-app-scheme-SEYECDHI.mjs → check-app-scheme-O7JPE4TM.mjs} +2 -3
- package/dist/lib/browser/check-app-scheme-O7JPE4TM.mjs.map +7 -0
- package/dist/lib/browser/chunk-E7TOEOGO.mjs +157 -0
- package/dist/lib/browser/chunk-E7TOEOGO.mjs.map +7 -0
- package/dist/lib/browser/chunk-HWEH5OJ7.mjs +24 -0
- package/dist/lib/browser/{chunk-6HJZL3WT.mjs → chunk-PGSJT5PG.mjs} +2 -2
- package/dist/lib/browser/{chunk-VP6FCWFV.mjs → chunk-ZAL26IIZ.mjs} +104 -80
- package/dist/lib/browser/chunk-ZAL26IIZ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3 -3
- package/dist/lib/browser/{intent-resolver-6AK45PT5.mjs → intent-resolver-NO6L67KF.mjs} +33 -26
- package/dist/lib/browser/intent-resolver-NO6L67KF.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-KA2IL5RA.mjs → react-root-SK3KDPHZ.mjs} +5 -5
- package/dist/lib/browser/{react-surface-LIPGYEYN.mjs → react-surface-LSSPY2BU.mjs} +5 -5
- package/dist/lib/browser/{settings-6NU7CF2B.mjs → settings-C7LX2GXF.mjs} +2 -2
- package/dist/lib/browser/{state-Z6UY2Z3M.mjs → state-AX74YEJD.mjs} +2 -2
- package/dist/lib/browser/{tools-VDVQTJMD.mjs → tools-7W7KZRAX.mjs} +7 -7
- package/dist/lib/browser/tools-7W7KZRAX.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/browser/{url-handler-3CARFXQK.mjs → url-handler-AF5SYROZ.mjs} +2 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.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/components/Sidebar/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +104 -104
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/overscroll.d.ts.map +1 -1
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/src/util/useCompanions.d.ts.map +1 -1
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -29
- package/src/capabilities/check-app-scheme.ts +3 -5
- package/src/capabilities/intent-resolver.ts +85 -77
- package/src/capabilities/tools.ts +4 -3
- package/src/components/DeckLayout/Popover.tsx +71 -43
- package/src/components/Plank/Plank.stories.tsx +1 -1
- package/src/components/Plank/Plank.tsx +3 -1
- package/src/components/Plank/PlankControls.tsx +14 -28
- package/src/components/Plank/PlankError.tsx +2 -6
- package/src/components/Plank/PlankHeading.tsx +12 -4
- package/src/components/Sidebar/SidebarButton.tsx +3 -0
- package/src/types.ts +72 -71
- package/dist/lib/browser/check-app-scheme-SEYECDHI.mjs.map +0 -7
- package/dist/lib/browser/chunk-4QSEGMY3.mjs +0 -24
- package/dist/lib/browser/chunk-VP6FCWFV.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZMJMCN7O.mjs +0 -157
- package/dist/lib/browser/chunk-ZMJMCN7O.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-6AK45PT5.mjs.map +0 -7
- package/dist/lib/browser/tools-VDVQTJMD.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-4QSEGMY3.mjs.map → chunk-HWEH5OJ7.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-6HJZL3WT.mjs.map → chunk-PGSJT5PG.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-KA2IL5RA.mjs.map → react-root-SK3KDPHZ.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-LIPGYEYN.mjs.map → react-surface-LSSPY2BU.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-6NU7CF2B.mjs.map → settings-C7LX2GXF.mjs.map} +0 -0
- /package/dist/lib/browser/{state-Z6UY2Z3M.mjs.map → state-AX74YEJD.mjs.map} +0 -0
- /package/dist/lib/browser/{url-handler-3CARFXQK.mjs.map → url-handler-AF5SYROZ.mjs.map} +0 -0
|
@@ -20,8 +20,7 @@ var checkAppScheme = (url) => {
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
var check_app_scheme_default = async (context) => {
|
|
23
|
-
const
|
|
24
|
-
const settings = settingsStore.getStore(DECK_PLUGIN)?.value;
|
|
23
|
+
const settings = context.requestCapability(Capabilities.SettingsStore).getStore(DECK_PLUGIN)?.value;
|
|
25
24
|
if (!isSocket && settings?.enableNativeRedirect) {
|
|
26
25
|
checkAppScheme(appScheme);
|
|
27
26
|
}
|
|
@@ -30,4 +29,4 @@ var check_app_scheme_default = async (context) => {
|
|
|
30
29
|
export {
|
|
31
30
|
check_app_scheme_default as default
|
|
32
31
|
};
|
|
33
|
-
//# sourceMappingURL=check-app-scheme-
|
|
32
|
+
//# sourceMappingURL=check-app-scheme-O7JPE4TM.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/check-app-scheme.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckSettingsProps } from '../types';\n\nconst isSocket = !!(globalThis as any).__args;\n\n// TODO(mjamesderocher): Can we get this directly from Socket?\nconst appScheme = 'composer://';\n\n// TODO(mjamesderocher): Factor out as part of NavigationPlugin.\nconst checkAppScheme = (url: string) => {\n const iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n iframe.src = url + window.location.pathname.replace(/^\\/+/, '') + window.location.search;\n\n const timer = setTimeout(() => {\n document.body.removeChild(iframe);\n }, 3000);\n\n window.addEventListener('pagehide', (event) => {\n clearTimeout(timer);\n document.body.removeChild(iframe);\n });\n};\n\nexport default async (context: PluginsContext) => {\n const settings = context\n .requestCapability(Capabilities.SettingsStore)\n .getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;\n if (!isSocket && settings?.enableNativeRedirect) {\n checkAppScheme(appScheme);\n }\n\n return contributes(Capabilities.Null, null);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,cAAcC,mBAAwC;AAK/D,IAAMC,WAAW,CAAC,CAAEC,WAAmBC;AAGvC,IAAMC,YAAY;AAGlB,IAAMC,iBAAiB,CAACC,QAAAA;AACtB,QAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,SAAOG,MAAMC,UAAU;AACvBH,WAASI,KAAKC,YAAYN,MAAAA;AAE1BA,SAAOO,MAAMR,MAAMS,OAAOC,SAASC,SAASC,QAAQ,QAAQ,EAAA,IAAMH,OAAOC,SAASG;AAElF,QAAMC,QAAQC,WAAW,MAAA;AACvBb,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,GAAG,GAAA;AAEHQ,SAAOQ,iBAAiB,YAAY,CAACC,UAAAA;AACnCC,iBAAaL,KAAAA;AACbZ,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,CAAA;AACF;AAEA,IAAA,2BAAe,OAAOmB,YAAAA;AACpB,QAAMC,WAAWD,QACdE,kBAAkBC,aAAaC,aAAa,EAC5CC,SAA4BC,WAAAA,GAAcC;AAC7C,MAAI,CAAChC,YAAY0B,UAAUO,sBAAsB;AAC/C7B,mBAAeD,SAAAA;EACjB;AAEA,SAAO+B,YAAYN,aAAaO,MAAM,IAAA;AACxC;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "isSocket", "globalThis", "__args", "appScheme", "checkAppScheme", "url", "iframe", "document", "createElement", "style", "display", "body", "appendChild", "src", "window", "location", "pathname", "replace", "search", "timer", "setTimeout", "removeChild", "addEventListener", "event", "clearTimeout", "context", "settings", "requestCapability", "Capabilities", "SettingsStore", "getStore", "DECK_PLUGIN", "value", "enableNativeRedirect", "contributes", "Null"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DECK_PLUGIN
|
|
3
|
+
} from "./chunk-NSATFAEE.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/plugin-deck/src/types.ts
|
|
6
|
+
import { Schema } from "effect";
|
|
7
|
+
import { LayoutAction } from "@dxos/app-framework";
|
|
8
|
+
import { ATTENDABLE_PATH_SEPARATOR } from "@dxos/react-ui-attention";
|
|
9
|
+
var PLANK_COMPANION_TYPE = "dxos.org/plugin/deck/plank-companion";
|
|
10
|
+
var DECK_COMPANION_TYPE = "dxos.org/plugin/deck/deck-companion";
|
|
11
|
+
var NewPlankPositions = [
|
|
12
|
+
"start",
|
|
13
|
+
"end"
|
|
14
|
+
];
|
|
15
|
+
var OverscrollOptions = [
|
|
16
|
+
"none",
|
|
17
|
+
"centering"
|
|
18
|
+
];
|
|
19
|
+
var DeckSettingsSchema = Schema.Struct({
|
|
20
|
+
showHints: Schema.optional(Schema.Boolean),
|
|
21
|
+
enableDeck: Schema.optional(Schema.Boolean),
|
|
22
|
+
enableNativeRedirect: Schema.optional(Schema.Boolean),
|
|
23
|
+
enableStatusbar: Schema.optional(Schema.Boolean),
|
|
24
|
+
newPlankPositioning: Schema.optional(Schema.Literal(...NewPlankPositions)),
|
|
25
|
+
overscroll: Schema.optional(Schema.Literal(...OverscrollOptions))
|
|
26
|
+
}).pipe(Schema.mutable);
|
|
27
|
+
var PlankSizing = Schema.Record({
|
|
28
|
+
key: Schema.String,
|
|
29
|
+
value: Schema.Number
|
|
30
|
+
});
|
|
31
|
+
var DeckState = Schema.Struct({
|
|
32
|
+
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
33
|
+
initialized: Schema.Boolean,
|
|
34
|
+
active: Schema.mutable(Schema.Array(Schema.String)),
|
|
35
|
+
// TODO(wittjosiah): Piping into both mutable and optional caused invalid typescript output.
|
|
36
|
+
activeCompanions: Schema.optional(Schema.mutable(Schema.Record({
|
|
37
|
+
key: Schema.String,
|
|
38
|
+
value: Schema.String
|
|
39
|
+
}))),
|
|
40
|
+
inactive: Schema.mutable(Schema.Array(Schema.String)),
|
|
41
|
+
solo: Schema.optional(Schema.String),
|
|
42
|
+
fullscreen: Schema.Boolean,
|
|
43
|
+
plankSizing: Schema.mutable(PlankSizing),
|
|
44
|
+
companionFrameSizing: Schema.mutable(PlankSizing)
|
|
45
|
+
});
|
|
46
|
+
var defaultDeck = {
|
|
47
|
+
initialized: false,
|
|
48
|
+
active: [],
|
|
49
|
+
activeCompanions: {},
|
|
50
|
+
inactive: [],
|
|
51
|
+
solo: void 0,
|
|
52
|
+
fullscreen: false,
|
|
53
|
+
plankSizing: {},
|
|
54
|
+
companionFrameSizing: {}
|
|
55
|
+
};
|
|
56
|
+
var LayoutMode = Schema.Literal("deck", "solo", "solo--fullscreen");
|
|
57
|
+
var isLayoutMode = (value) => Schema.is(LayoutMode)(value);
|
|
58
|
+
var getMode = (deck) => {
|
|
59
|
+
if (deck.solo) {
|
|
60
|
+
return deck.fullscreen ? "solo--fullscreen" : "solo";
|
|
61
|
+
}
|
|
62
|
+
return "deck";
|
|
63
|
+
};
|
|
64
|
+
var DeckPluginState = Schema.Struct({
|
|
65
|
+
sidebarState: Schema.Literal("closed", "collapsed", "expanded"),
|
|
66
|
+
complementarySidebarState: Schema.Literal("closed", "collapsed", "expanded"),
|
|
67
|
+
complementarySidebarPanel: Schema.optional(Schema.String),
|
|
68
|
+
dialogOpen: Schema.Boolean,
|
|
69
|
+
dialogBlockAlign: Schema.optional(Schema.Literal("start", "center", "end")),
|
|
70
|
+
dialogType: Schema.optional(Schema.Literal("default", "alert")),
|
|
71
|
+
/** Data to be passed to the dialog Surface. */
|
|
72
|
+
dialogContent: Schema.optional(Schema.Any),
|
|
73
|
+
popoverOpen: Schema.Boolean,
|
|
74
|
+
popoverSide: Schema.optional(Schema.Literal("top", "right", "bottom", "left")),
|
|
75
|
+
popoverAnchor: Schema.optional(Schema.Any),
|
|
76
|
+
popoverAnchorId: Schema.optional(Schema.String),
|
|
77
|
+
/** Data to be passed to the popover Surface. */
|
|
78
|
+
popoverContent: Schema.optional(Schema.Any),
|
|
79
|
+
toasts: Schema.mutable(Schema.Array(LayoutAction.Toast)),
|
|
80
|
+
currentUndoId: Schema.optional(Schema.String),
|
|
81
|
+
activeDeck: Schema.String,
|
|
82
|
+
previousDeck: Schema.String,
|
|
83
|
+
decks: Schema.mutable(Schema.Record({
|
|
84
|
+
key: Schema.String,
|
|
85
|
+
value: Schema.mutable(DeckState)
|
|
86
|
+
})),
|
|
87
|
+
previousMode: Schema.mutable(Schema.Record({
|
|
88
|
+
key: Schema.String,
|
|
89
|
+
value: LayoutMode
|
|
90
|
+
})),
|
|
91
|
+
deck: Schema.mutable(DeckState),
|
|
92
|
+
/** The identifier of a component to scroll into view when it is mounted. */
|
|
93
|
+
scrollIntoView: Schema.optional(Schema.String)
|
|
94
|
+
}).pipe(Schema.mutable);
|
|
95
|
+
var DECK_ACTION = `${DECK_PLUGIN}/action`;
|
|
96
|
+
var DeckAction;
|
|
97
|
+
(function(DeckAction2) {
|
|
98
|
+
const PartAdjustmentSchema = Schema.Union(Schema.Literal("close").annotations({
|
|
99
|
+
description: "Close the plank."
|
|
100
|
+
}), Schema.Literal("companion").annotations({
|
|
101
|
+
description: "Open the companion plank."
|
|
102
|
+
}), Schema.Literal("solo").annotations({
|
|
103
|
+
description: "Solo the plank."
|
|
104
|
+
}), Schema.Literal("solo--fullscreen").annotations({
|
|
105
|
+
description: "Fullscreen the plank."
|
|
106
|
+
}), Schema.Literal("increment-start").annotations({
|
|
107
|
+
description: "Move the plank towards the start of the deck."
|
|
108
|
+
}), Schema.Literal("increment-end").annotations({
|
|
109
|
+
description: "Move the plank towards the end of the deck."
|
|
110
|
+
}));
|
|
111
|
+
DeckAction2.Adjustment = Schema.mutable(Schema.Struct({
|
|
112
|
+
id: Schema.String,
|
|
113
|
+
type: PartAdjustmentSchema
|
|
114
|
+
}));
|
|
115
|
+
class Adjust extends Schema.TaggedClass()(`${DECK_ACTION}/adjust`, {
|
|
116
|
+
input: DeckAction2.Adjustment,
|
|
117
|
+
output: Schema.Void
|
|
118
|
+
}) {
|
|
119
|
+
}
|
|
120
|
+
DeckAction2.Adjust = Adjust;
|
|
121
|
+
class UpdatePlankSize extends Schema.TaggedClass()(`${DECK_ACTION}/update-plank-size`, {
|
|
122
|
+
input: Schema.Struct({
|
|
123
|
+
id: Schema.String,
|
|
124
|
+
size: Schema.Number
|
|
125
|
+
}),
|
|
126
|
+
output: Schema.Void
|
|
127
|
+
}) {
|
|
128
|
+
}
|
|
129
|
+
DeckAction2.UpdatePlankSize = UpdatePlankSize;
|
|
130
|
+
class ChangeCompanion extends Schema.TaggedClass()(`${DECK_ACTION}/change-companion`, {
|
|
131
|
+
input: Schema.Struct({
|
|
132
|
+
primary: Schema.String,
|
|
133
|
+
companion: Schema.Union(Schema.String, Schema.Null)
|
|
134
|
+
}),
|
|
135
|
+
output: Schema.Void
|
|
136
|
+
}) {
|
|
137
|
+
}
|
|
138
|
+
DeckAction2.ChangeCompanion = ChangeCompanion;
|
|
139
|
+
})(DeckAction || (DeckAction = {}));
|
|
140
|
+
|
|
141
|
+
export {
|
|
142
|
+
PLANK_COMPANION_TYPE,
|
|
143
|
+
DECK_COMPANION_TYPE,
|
|
144
|
+
NewPlankPositions,
|
|
145
|
+
OverscrollOptions,
|
|
146
|
+
DeckSettingsSchema,
|
|
147
|
+
PlankSizing,
|
|
148
|
+
DeckState,
|
|
149
|
+
defaultDeck,
|
|
150
|
+
isLayoutMode,
|
|
151
|
+
getMode,
|
|
152
|
+
DeckPluginState,
|
|
153
|
+
DECK_ACTION,
|
|
154
|
+
DeckAction,
|
|
155
|
+
ATTENDABLE_PATH_SEPARATOR
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=chunk-E7TOEOGO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { LayoutAction } from '@dxos/app-framework';\nimport { type DeepReadonly } from '@dxos/util';\n\nimport { DECK_PLUGIN } from './meta';\n\nexport { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';\n\nexport const PLANK_COMPANION_TYPE = 'dxos.org/plugin/deck/plank-companion';\nexport const DECK_COMPANION_TYPE = 'dxos.org/plugin/deck/deck-companion';\n\n// TODO(Zan): In the future we should consider adding new planks adjacent to the attended plank.\nexport const NewPlankPositions = ['start', 'end'] as const;\nexport type NewPlankPositioning = (typeof NewPlankPositions)[number];\n\nexport const OverscrollOptions = ['none', 'centering'] as const;\nexport type Overscroll = (typeof OverscrollOptions)[number];\n\nexport type Part = 'solo' | 'deck' | 'complementary';\nexport type ResolvedPart = Part | 'solo-primary' | 'solo-companion';\n\nexport const DeckSettingsSchema = Schema.Struct({\n showHints: Schema.optional(Schema.Boolean),\n enableDeck: Schema.optional(Schema.Boolean),\n enableNativeRedirect: Schema.optional(Schema.Boolean),\n enableStatusbar: Schema.optional(Schema.Boolean),\n newPlankPositioning: Schema.optional(Schema.Literal(...NewPlankPositions)),\n overscroll: Schema.optional(Schema.Literal(...OverscrollOptions)),\n}).pipe(Schema.mutable);\nexport type DeckSettingsProps = Schema.Schema.Type<typeof DeckSettingsSchema>;\n\nexport const PlankSizing = Schema.Record({ key: Schema.String, value: Schema.Number });\nexport type PlankSizing = Schema.Schema.Type<typeof PlankSizing>;\n\n// State of an individual deck.\nexport const DeckState = Schema.Struct({\n /** If false, the deck has not yet left solo mode and new planks should be soloed. */\n initialized: Schema.Boolean,\n active: Schema.mutable(Schema.Array(Schema.String)),\n // TODO(wittjosiah): Piping into both mutable and optional caused invalid typescript output.\n activeCompanions: Schema.optional(Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.String }))),\n inactive: Schema.mutable(Schema.Array(Schema.String)),\n solo: Schema.optional(Schema.String),\n fullscreen: Schema.Boolean,\n plankSizing: Schema.mutable(PlankSizing),\n companionFrameSizing: Schema.mutable(PlankSizing),\n});\nexport type DeckState = Schema.Schema.Type<typeof DeckState>;\n\nexport const defaultDeck: DeckState = {\n initialized: false,\n active: [],\n activeCompanions: {},\n inactive: [],\n solo: undefined,\n fullscreen: false,\n plankSizing: {},\n companionFrameSizing: {},\n};\n\nconst LayoutMode = Schema.Literal('deck', 'solo', 'solo--fullscreen');\nexport type LayoutMode = Schema.Schema.Type<typeof LayoutMode>;\nexport const isLayoutMode = (value: any): value is LayoutMode => Schema.is(LayoutMode)(value);\n\nexport const getMode = (deck: DeckState | DeepReadonly<DeckState>): LayoutMode => {\n if (deck.solo) {\n return deck.fullscreen ? 'solo--fullscreen' : 'solo';\n }\n\n return 'deck';\n};\n\n// State of the deck plugin.\nexport const DeckPluginState = Schema.Struct({\n sidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarState: Schema.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarPanel: Schema.optional(Schema.String),\n\n dialogOpen: Schema.Boolean,\n dialogBlockAlign: Schema.optional(Schema.Literal('start', 'center', 'end')),\n dialogType: Schema.optional(Schema.Literal('default', 'alert')),\n /** Data to be passed to the dialog Surface. */\n dialogContent: Schema.optional(Schema.Any),\n\n popoverOpen: Schema.Boolean,\n popoverSide: Schema.optional(Schema.Literal('top', 'right', 'bottom', 'left')),\n popoverAnchor: Schema.optional(Schema.Any),\n popoverAnchorId: Schema.optional(Schema.String),\n /** Data to be passed to the popover Surface. */\n popoverContent: Schema.optional(Schema.Any),\n\n toasts: Schema.mutable(Schema.Array(LayoutAction.Toast)),\n currentUndoId: Schema.optional(Schema.String),\n\n activeDeck: Schema.String,\n previousDeck: Schema.String,\n decks: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(DeckState) })),\n previousMode: Schema.mutable(Schema.Record({ key: Schema.String, value: LayoutMode })),\n deck: Schema.mutable(DeckState),\n\n /** The identifier of a component to scroll into view when it is mounted. */\n scrollIntoView: Schema.optional(Schema.String),\n}).pipe(Schema.mutable);\n\nexport type DeckPluginState = Schema.Schema.Type<typeof DeckPluginState>;\n\nexport const DECK_ACTION = `${DECK_PLUGIN}/action`;\n\nexport namespace DeckAction {\n const PartAdjustmentSchema = Schema.Union(\n Schema.Literal('close').annotations({ description: 'Close the plank.' }),\n Schema.Literal('companion').annotations({ description: 'Open the companion plank.' }),\n Schema.Literal('solo').annotations({ description: 'Solo the plank.' }),\n Schema.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),\n Schema.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),\n Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),\n );\n export type PartAdjustment = Schema.Schema.Type<typeof PartAdjustmentSchema>;\n export const Adjustment = Schema.mutable(Schema.Struct({ id: Schema.String, type: PartAdjustmentSchema }));\n export type Adjustment = Schema.Schema.Type<typeof Adjustment>;\n\n // An atomic transaction to apply to the deck, describing which element to move to which location.\n export class Adjust extends Schema.TaggedClass<Adjust>()(`${DECK_ACTION}/adjust`, {\n input: Adjustment,\n output: Schema.Void,\n }) {}\n\n export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${DECK_ACTION}/update-plank-size`, {\n input: Schema.Struct({\n id: Schema.String,\n size: Schema.Number,\n }),\n output: Schema.Void,\n }) {}\n\n export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${DECK_ACTION}/change-companion`, {\n input: Schema.Struct({\n primary: Schema.String,\n companion: Schema.Union(Schema.String, Schema.Null),\n }),\n output: Schema.Void,\n }) {}\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Schema", "LayoutAction", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "DECK_COMPANION_TYPE", "NewPlankPositions", "OverscrollOptions", "DeckSettingsSchema", "Schema", "Struct", "showHints", "optional", "Boolean", "enableDeck", "enableNativeRedirect", "enableStatusbar", "newPlankPositioning", "Literal", "overscroll", "pipe", "mutable", "PlankSizing", "Record", "key", "String", "value", "Number", "DeckState", "initialized", "active", "Array", "activeCompanions", "inactive", "solo", "fullscreen", "plankSizing", "companionFrameSizing", "defaultDeck", "undefined", "LayoutMode", "isLayoutMode", "is", "getMode", "deck", "DeckPluginState", "sidebarState", "complementarySidebarState", "complementarySidebarPanel", "dialogOpen", "dialogBlockAlign", "dialogType", "dialogContent", "Any", "popoverOpen", "popoverSide", "popoverAnchor", "popoverAnchorId", "popoverContent", "toasts", "LayoutAction", "Toast", "currentUndoId", "activeDeck", "previousDeck", "decks", "previousMode", "scrollIntoView", "DECK_ACTION", "DECK_PLUGIN", "DeckAction", "PartAdjustmentSchema", "Union", "annotations", "description", "Adjustment", "id", "type", "Adjust", "TaggedClass", "input", "output", "Void", "UpdatePlankSize", "size", "ChangeCompanion", "primary", "companion", "Null"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// packages/plugins/plugin-deck/src/capabilities/index.ts
|
|
2
|
+
import { lazy } from "@dxos/app-framework";
|
|
3
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-VYZ4IWI3.mjs"));
|
|
4
|
+
var CheckAppScheme = lazy(() => import("./check-app-scheme-O7JPE4TM.mjs"));
|
|
5
|
+
var DeckSettings = lazy(() => import("./settings-C7LX2GXF.mjs"));
|
|
6
|
+
var DeckState = lazy(() => import("./state-AX74YEJD.mjs"));
|
|
7
|
+
var LayoutIntentResolver = lazy(() => import("./intent-resolver-NO6L67KF.mjs"));
|
|
8
|
+
var ReactRoot = lazy(() => import("./react-root-SK3KDPHZ.mjs"));
|
|
9
|
+
var ReactSurface = lazy(() => import("./react-surface-LSSPY2BU.mjs"));
|
|
10
|
+
var Tools = lazy(() => import("./tools-7W7KZRAX.mjs"));
|
|
11
|
+
var UrlHandler = lazy(() => import("./url-handler-AF5SYROZ.mjs"));
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
AppGraphBuilder,
|
|
15
|
+
CheckAppScheme,
|
|
16
|
+
DeckSettings,
|
|
17
|
+
DeckState,
|
|
18
|
+
LayoutIntentResolver,
|
|
19
|
+
ReactRoot,
|
|
20
|
+
ReactSurface,
|
|
21
|
+
Tools,
|
|
22
|
+
UrlHandler
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-HWEH5OJ7.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PLANK_COMPANION_TYPE
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E7TOEOGO.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DECK_PLUGIN
|
|
6
6
|
} from "./chunk-NSATFAEE.mjs";
|
|
@@ -115,4 +115,4 @@ export {
|
|
|
115
115
|
useHoistStatusbar,
|
|
116
116
|
useCompanions
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
//# sourceMappingURL=chunk-PGSJT5PG.mjs.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
useBreakpoints,
|
|
8
8
|
useCompanions,
|
|
9
9
|
useHoistStatusbar
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PGSJT5PG.mjs";
|
|
11
11
|
import {
|
|
12
12
|
DeckCapabilities
|
|
13
13
|
} from "./chunk-XMCG42ID.mjs";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
OverscrollOptions,
|
|
20
20
|
PLANK_COMPANION_TYPE,
|
|
21
21
|
getMode
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-E7TOEOGO.mjs";
|
|
23
23
|
import {
|
|
24
24
|
DECK_PLUGIN
|
|
25
25
|
} from "./chunk-NSATFAEE.mjs";
|
|
@@ -33,7 +33,7 @@ import { mx as mx4 } from "@dxos/react-ui-theme";
|
|
|
33
33
|
// packages/plugins/plugin-deck/src/components/Sidebar/ComplementarySidebar.tsx
|
|
34
34
|
import React7, { Fragment as Fragment3, useCallback as useCallback4, useEffect as useEffect4, useMemo as useMemo3, useState as useState2 } from "react";
|
|
35
35
|
import { LayoutAction as LayoutAction3, Surface as Surface3, createIntent as createIntent4, useAppGraph as useAppGraph3, useCapability as useCapability3, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
36
|
-
import { Main, useTranslation as useTranslation5, toLocalizedString as toLocalizedString2, IconButton as
|
|
36
|
+
import { Main, useTranslation as useTranslation5, toLocalizedString as toLocalizedString2, IconButton as IconButton4 } from "@dxos/react-ui";
|
|
37
37
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
38
38
|
import { byPosition } from "@dxos/util";
|
|
39
39
|
|
|
@@ -71,6 +71,7 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames }) => {
|
|
|
71
71
|
const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
|
|
72
72
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
73
73
|
return /* @__PURE__ */ React.createElement(IconButton, {
|
|
74
|
+
noTooltip: true,
|
|
74
75
|
iconOnly: true,
|
|
75
76
|
onClick: () => layoutContext.complementarySidebarState = layoutContext.complementarySidebarState === "expanded" ? "collapsed" : "expanded",
|
|
76
77
|
variant: "ghost",
|
|
@@ -97,12 +98,12 @@ import { mainIntrinsicSize, mx as mx3 } from "@dxos/react-ui-theme";
|
|
|
97
98
|
// packages/plugins/plugin-deck/src/components/Plank/PlankError.tsx
|
|
98
99
|
import React5, { useEffect as useEffect2, useState } from "react";
|
|
99
100
|
import { useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
100
|
-
import {
|
|
101
|
+
import { descriptionMessage, mx as mx2 } from "@dxos/react-ui-theme";
|
|
101
102
|
|
|
102
103
|
// packages/plugins/plugin-deck/src/components/Plank/PlankHeading.tsx
|
|
103
104
|
import React3, { Fragment, memo, useCallback as useCallback2, useEffect, useMemo } from "react";
|
|
104
105
|
import { createIntent as createIntent2, LayoutAction, Surface, useAppGraph, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
105
|
-
import { Icon
|
|
106
|
+
import { Icon, IconButton as IconButton3, Popover, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
106
107
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
107
108
|
import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
108
109
|
|
|
@@ -110,31 +111,27 @@ import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
|
110
111
|
import React2, { forwardRef, useCallback } from "react";
|
|
111
112
|
import { createIntent, useIntentDispatcher } from "@dxos/app-framework";
|
|
112
113
|
import { invariant } from "@dxos/invariant";
|
|
113
|
-
import {
|
|
114
|
+
import { ButtonGroup, IconButton as IconButton2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
114
115
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-deck/src/components/Plank/PlankControls.tsx";
|
|
115
116
|
var PlankControl = ({ icon, label: label3, ...props }) => {
|
|
116
|
-
return /* @__PURE__ */ React2.createElement(
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
return /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
118
|
+
iconOnly: true,
|
|
119
|
+
label: label3,
|
|
120
|
+
icon,
|
|
121
|
+
size: 5,
|
|
119
122
|
variant: "ghost",
|
|
123
|
+
tooltipSide: "bottom",
|
|
120
124
|
...props
|
|
121
|
-
}
|
|
122
|
-
className: "sr-only"
|
|
123
|
-
}, label3), /* @__PURE__ */ React2.createElement(Icon, {
|
|
124
|
-
icon,
|
|
125
|
-
size: 5
|
|
126
|
-
}))), /* @__PURE__ */ React2.createElement(Tooltip.Portal, null, /* @__PURE__ */ React2.createElement(Tooltip.Content, {
|
|
127
|
-
side: "bottom"
|
|
128
|
-
}, label3)));
|
|
125
|
+
});
|
|
129
126
|
};
|
|
130
|
-
var plankControlSpacing = "pli-2
|
|
127
|
+
var plankControlSpacing = "pli-2";
|
|
131
128
|
var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedRef) => {
|
|
132
129
|
const { t } = useTranslation2(DECK_PLUGIN);
|
|
133
130
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
134
131
|
const handleCloseCompanion = useCallback(() => {
|
|
135
132
|
invariant(primary, void 0, {
|
|
136
133
|
F: __dxlog_file,
|
|
137
|
-
L:
|
|
134
|
+
L: 48,
|
|
138
135
|
S: void 0,
|
|
139
136
|
A: [
|
|
140
137
|
"primary",
|
|
@@ -152,7 +149,7 @@ var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedR
|
|
|
152
149
|
}, /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
153
150
|
label: t("close companion label"),
|
|
154
151
|
variant: "ghost",
|
|
155
|
-
icon: "ph--
|
|
152
|
+
icon: "ph--x--regular",
|
|
156
153
|
onClick: handleCloseCompanion,
|
|
157
154
|
classNames: plankControlSpacing
|
|
158
155
|
}));
|
|
@@ -174,9 +171,9 @@ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant
|
|
|
174
171
|
icon: "ph--corners-out--regular",
|
|
175
172
|
onClick: () => onClick?.("solo--fullscreen")
|
|
176
173
|
}), /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
177
|
-
label: t(layoutMode === "solo--fullscreen" ? "exit fullscreen label" :
|
|
174
|
+
label: t(layoutMode === "solo--fullscreen" ? "exit fullscreen label" : layoutIsAnySolo ? "show deck plank label" : "show solo plank label"),
|
|
178
175
|
classNames: buttonClassNames,
|
|
179
|
-
icon:
|
|
176
|
+
icon: layoutMode === "solo--fullscreen" ? "ph--corners-in--regular" : layoutIsAnySolo ? "ph--arrows-in-line-horizontal--regular" : "ph--arrows-out-line-horizontal--regular",
|
|
180
177
|
onClick: () => onClick?.(layoutMode === "solo--fullscreen" ? "solo--fullscreen" : "solo")
|
|
181
178
|
})), !layoutIsAnySolo && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
182
179
|
label: t("increment start label"),
|
|
@@ -213,6 +210,7 @@ var fixedSidebarToggleStyles = mx(sidebarToggleStyles, "inline-start-2");
|
|
|
213
210
|
var fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, "inline-end-2");
|
|
214
211
|
|
|
215
212
|
// packages/plugins/plugin-deck/src/components/Plank/PlankHeading.tsx
|
|
213
|
+
var MAX_COMPANIONS = 5;
|
|
216
214
|
var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncrementStart, canIncrementEnd, popoverAnchorId, primaryId, pending, companioned, companions, layoutMode, actions = [] }) => {
|
|
217
215
|
const { t } = useTranslation3(DECK_PLUGIN);
|
|
218
216
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
@@ -270,10 +268,12 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
270
268
|
]);
|
|
271
269
|
const handleAction = useCallback2((action) => {
|
|
272
270
|
typeof action.data === "function" && action.data?.({
|
|
273
|
-
|
|
271
|
+
parent: node,
|
|
274
272
|
caller: DECK_PLUGIN
|
|
275
273
|
});
|
|
276
|
-
}, [
|
|
274
|
+
}, [
|
|
275
|
+
node
|
|
276
|
+
]);
|
|
277
277
|
const handlePlankAction = useCallback2((eventType) => {
|
|
278
278
|
if (eventType.startsWith("solo")) {
|
|
279
279
|
return dispatch(createIntent2(DeckAction.Adjust, {
|
|
@@ -326,16 +326,18 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
326
326
|
return /* @__PURE__ */ React3.createElement(StackItem.Heading, {
|
|
327
327
|
classNames: [
|
|
328
328
|
"plb-1 border-be border-separator items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 contain-layout",
|
|
329
|
-
part === "solo" ? soloInlinePadding : "pli-1"
|
|
330
|
-
|
|
329
|
+
part === "solo" ? soloInlinePadding : "pli-1",
|
|
330
|
+
layoutMode === "solo--fullscreen" && "opacity-0 border-transparent hover:border-separator hover:opacity-100 transition-[border-color,opacity]"
|
|
331
|
+
],
|
|
332
|
+
"data-plank-heading": true
|
|
331
333
|
}, companions && isCompanionNode ? /* @__PURE__ */ React3.createElement("div", {
|
|
332
334
|
role: "none",
|
|
333
335
|
className: "flex-1 min-is-0 overflow-x-auto scrollbar-thin flex gap-1"
|
|
334
|
-
}, companions.map(({ id: id2, properties: { icon: icon2, label: label4 } }) => /* @__PURE__ */ React3.createElement(
|
|
336
|
+
}, companions.map(({ id: id2, properties: { icon: icon2, label: label4 } }) => /* @__PURE__ */ React3.createElement(IconButton3, {
|
|
335
337
|
key: id2,
|
|
336
338
|
"data-id": id2,
|
|
337
339
|
icon: icon2,
|
|
338
|
-
iconOnly: node?.id !== id2,
|
|
340
|
+
iconOnly: companions.length > MAX_COMPANIONS && node?.id !== id2,
|
|
339
341
|
label: toLocalizedString(label4, t),
|
|
340
342
|
size: 5,
|
|
341
343
|
variant: node?.id === id2 ? "primary" : "default",
|
|
@@ -354,7 +356,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
354
356
|
}
|
|
355
357
|
})) : /* @__PURE__ */ React3.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React3.createElement("span", {
|
|
356
358
|
className: "sr-only"
|
|
357
|
-
}, label3), /* @__PURE__ */ React3.createElement(
|
|
359
|
+
}, label3), /* @__PURE__ */ React3.createElement(Icon, {
|
|
358
360
|
icon,
|
|
359
361
|
size: 5
|
|
360
362
|
}))), /* @__PURE__ */ React3.createElement(TextTooltip, {
|
|
@@ -399,7 +401,7 @@ var PlankContentError = ({ error }) => {
|
|
|
399
401
|
className: "overflow-auto p-8 attention-surface grid place-items-center"
|
|
400
402
|
}, /* @__PURE__ */ React5.createElement("p", {
|
|
401
403
|
role: "alert",
|
|
402
|
-
className: mx2(
|
|
404
|
+
className: mx2(descriptionMessage, "break-words rounded-lg p-8", errorString.length < 256 && "text-lg")
|
|
403
405
|
}, error ? errorString : t("error fallback message")));
|
|
404
406
|
};
|
|
405
407
|
var PlankError = ({ id, part, node, error }) => {
|
|
@@ -512,10 +514,11 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
|
|
|
512
514
|
node?.data,
|
|
513
515
|
path,
|
|
514
516
|
popoverAnchorId,
|
|
515
|
-
primary?.data
|
|
517
|
+
primary?.data,
|
|
518
|
+
variant
|
|
516
519
|
]);
|
|
517
520
|
const placeholder = useMemo2(() => /* @__PURE__ */ React6.createElement(PlankLoading, null), []);
|
|
518
|
-
const className = mx3("attention-surface relative", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal, isSolo && "absolute inset-0", part.startsWith("solo") && "grid", part === "deck" && (companioned === "companion" ? "!border-separator border-ie" : "!border-separator border-li"), part.startsWith("solo-") && "row-span-2 grid-rows-subgrid min-is-0", part === "solo-companion" && "!border-separator border-is");
|
|
521
|
+
const className = mx3("attention-surface relative", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal, isSolo && "absolute inset-0", part.startsWith("solo") && "grid", part === "deck" && (companioned === "companion" ? "!border-separator border-ie" : "!border-separator border-li"), part.startsWith("solo-") && "row-span-2 grid-rows-subgrid min-is-0", part === "solo-companion" && "!border-separator border-is", layoutMode === "solo--fullscreen" && "!transition-[margin-block-start,inline-size] -mbs-[--rail-action] has-[[data-plank-heading]:hover]:mbs-0");
|
|
519
522
|
return /* @__PURE__ */ React6.createElement(Root, {
|
|
520
523
|
ref: rootElement,
|
|
521
524
|
"data-testid": "deck.plank",
|
|
@@ -697,7 +700,7 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
697
700
|
key: getCompanionId(companion.id),
|
|
698
701
|
value: getCompanionId(companion.id),
|
|
699
702
|
asChild: true
|
|
700
|
-
}, /* @__PURE__ */ React7.createElement(
|
|
703
|
+
}, /* @__PURE__ */ React7.createElement(IconButton4, {
|
|
701
704
|
label: toLocalizedString2(companion.properties.label, t),
|
|
702
705
|
icon: companion.properties.icon,
|
|
703
706
|
size: 5,
|
|
@@ -829,7 +832,7 @@ var Banner = ({ variant, classNames }) => {
|
|
|
829
832
|
|
|
830
833
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
831
834
|
import { untracked } from "@preact/signals-core";
|
|
832
|
-
import React17, { useCallback as useCallback6, useEffect as useEffect6, useMemo as
|
|
835
|
+
import React17, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo6, useRef as useRef3, Fragment as Fragment4 } from "react";
|
|
833
836
|
import { Capabilities, LayoutAction as LayoutAction4, createIntent as createIntent5, useCapability as useCapability8, useIntentDispatcher as useIntentDispatcher5, usePluginManager } from "@dxos/app-framework";
|
|
834
837
|
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
835
838
|
import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
|
|
@@ -911,62 +914,83 @@ var Dialog = () => {
|
|
|
911
914
|
};
|
|
912
915
|
|
|
913
916
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Popover.tsx
|
|
914
|
-
import
|
|
917
|
+
import { createContext } from "@radix-ui/react-context";
|
|
918
|
+
import React13, { useCallback as useCallback5, useEffect as useEffect5, useMemo as useMemo5, useRef as useRef2, useState as useState3 } from "react";
|
|
915
919
|
import { Surface as Surface9, useCapability as useCapability7 } from "@dxos/app-framework";
|
|
916
920
|
import { Popover as Popover2 } from "@dxos/react-ui";
|
|
921
|
+
var DEBOUNCE_DELAY = 40;
|
|
922
|
+
var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
|
|
917
923
|
var PopoverRoot = ({ children }) => {
|
|
918
|
-
const
|
|
924
|
+
const layout = useCapability7(DeckCapabilities.MutableDeckState);
|
|
919
925
|
const virtualRef = useRef2(null);
|
|
920
926
|
const [virtualIter, setVirtualIter] = useState3(0);
|
|
921
|
-
const [
|
|
927
|
+
const [open, setOpen] = useState3(false);
|
|
928
|
+
const debounceRef = useRef2(null);
|
|
922
929
|
useEffect5(() => {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
context.popoverAnchorId = void 0;
|
|
934
|
-
context.popoverSide = void 0;
|
|
930
|
+
setOpen(false);
|
|
931
|
+
if (layout.popoverOpen) {
|
|
932
|
+
if (debounceRef.current) {
|
|
933
|
+
clearTimeout(debounceRef.current);
|
|
934
|
+
}
|
|
935
|
+
if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
|
|
936
|
+
virtualRef.current = layout.popoverAnchor ?? null;
|
|
937
|
+
setVirtualIter((iter) => iter + 1);
|
|
938
|
+
}
|
|
939
|
+
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
935
940
|
}
|
|
936
941
|
}, [
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
setVirtualIter((iter) => iter + 1);
|
|
942
|
-
}, [
|
|
943
|
-
context.popoverAnchor
|
|
942
|
+
layout.popoverOpen,
|
|
943
|
+
layout.popoverAnchorId,
|
|
944
|
+
layout.popoverAnchor,
|
|
945
|
+
layout.popoverContent
|
|
944
946
|
]);
|
|
945
|
-
return /* @__PURE__ */ React13.createElement(
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
947
|
+
return /* @__PURE__ */ React13.createElement(DeckPopoverProvider, {
|
|
948
|
+
setOpen
|
|
949
|
+
}, /* @__PURE__ */ React13.createElement(Popover2.Root, {
|
|
950
|
+
modal: false,
|
|
951
|
+
open
|
|
952
|
+
}, layout.popoverAnchor && /* @__PURE__ */ React13.createElement(Popover2.VirtualTrigger, {
|
|
950
953
|
key: virtualIter,
|
|
951
954
|
virtualRef
|
|
952
|
-
}), children);
|
|
955
|
+
}), children));
|
|
953
956
|
};
|
|
954
957
|
var PopoverContent = () => {
|
|
955
|
-
const
|
|
956
|
-
const
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
958
|
+
const layout = useCapability7(DeckCapabilities.MutableDeckState);
|
|
959
|
+
const { setOpen } = useDeckPopoverContext("PopoverContent");
|
|
960
|
+
const handleClose = useCallback5((event) => {
|
|
961
|
+
if (
|
|
962
|
+
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
963
|
+
event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
|
|
964
|
+
) {
|
|
965
|
+
event.preventDefault();
|
|
966
|
+
} else {
|
|
967
|
+
setOpen(false);
|
|
968
|
+
layout.popoverOpen = false;
|
|
969
|
+
layout.popoverAnchor = void 0;
|
|
970
|
+
layout.popoverAnchorId = void 0;
|
|
971
|
+
layout.popoverSide = void 0;
|
|
972
|
+
}
|
|
973
|
+
}, [
|
|
974
|
+
setOpen
|
|
975
|
+
]);
|
|
976
|
+
const collisionBoundaries = useMemo5(() => {
|
|
977
|
+
const closest = layout.popoverAnchor?.closest("[data-popover-collision-boundary]");
|
|
978
|
+
return closest ? [
|
|
979
|
+
closest
|
|
980
|
+
] : [];
|
|
961
981
|
}, [
|
|
962
|
-
|
|
982
|
+
layout.popoverAnchor
|
|
963
983
|
]);
|
|
964
984
|
return /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
|
|
965
|
-
side:
|
|
966
|
-
|
|
985
|
+
side: layout.popoverSide,
|
|
986
|
+
onInteractOutside: handleClose,
|
|
987
|
+
onEscapeKeyDown: handleClose,
|
|
988
|
+
collisionBoundary: collisionBoundaries,
|
|
989
|
+
sticky: "always",
|
|
990
|
+
hideWhenDetached: true
|
|
967
991
|
}, /* @__PURE__ */ React13.createElement(Popover2.Viewport, null, /* @__PURE__ */ React13.createElement(Surface9, {
|
|
968
992
|
role: "popover",
|
|
969
|
-
data:
|
|
993
|
+
data: layout.popoverContent,
|
|
970
994
|
limit: 1
|
|
971
995
|
})), /* @__PURE__ */ React13.createElement(Popover2.Arrow, null)));
|
|
972
996
|
};
|
|
@@ -992,7 +1016,7 @@ var StatusBar = ({ showHints }) => {
|
|
|
992
1016
|
|
|
993
1017
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Toast.tsx
|
|
994
1018
|
import React15 from "react";
|
|
995
|
-
import { Button
|
|
1019
|
+
import { Button, Icon as Icon2, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
996
1020
|
var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
|
|
997
1021
|
const { t } = useTranslation7(DECK_PLUGIN);
|
|
998
1022
|
return /* @__PURE__ */ React15.createElement(NaturalToast.Root, {
|
|
@@ -1002,20 +1026,20 @@ var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, c
|
|
|
1002
1026
|
onOpenChange
|
|
1003
1027
|
}, /* @__PURE__ */ React15.createElement(NaturalToast.Body, null, /* @__PURE__ */ React15.createElement(NaturalToast.Title, {
|
|
1004
1028
|
classNames: "items-center"
|
|
1005
|
-
}, icon && /* @__PURE__ */ React15.createElement(
|
|
1029
|
+
}, icon && /* @__PURE__ */ React15.createElement(Icon2, {
|
|
1006
1030
|
icon,
|
|
1007
1031
|
size: 5,
|
|
1008
1032
|
classNames: "inline mr-1"
|
|
1009
1033
|
}), title && /* @__PURE__ */ React15.createElement("span", null, toLocalizedString3(title, t))), description && /* @__PURE__ */ React15.createElement(NaturalToast.Description, null, description && toLocalizedString3(description, t))), /* @__PURE__ */ React15.createElement(NaturalToast.Actions, null, onAction && actionAlt && actionLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Action, {
|
|
1010
1034
|
altText: toLocalizedString3(actionAlt, t),
|
|
1011
1035
|
asChild: true
|
|
1012
|
-
}, /* @__PURE__ */ React15.createElement(
|
|
1036
|
+
}, /* @__PURE__ */ React15.createElement(Button, {
|
|
1013
1037
|
"data-testid": "toast.action",
|
|
1014
1038
|
variant: "primary",
|
|
1015
1039
|
onClick: () => onAction?.()
|
|
1016
1040
|
}, toLocalizedString3(actionLabel, t))), closeLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Close, {
|
|
1017
1041
|
asChild: true
|
|
1018
|
-
}, /* @__PURE__ */ React15.createElement(
|
|
1042
|
+
}, /* @__PURE__ */ React15.createElement(Button, {
|
|
1019
1043
|
"data-testid": "toast.close"
|
|
1020
1044
|
}, toLocalizedString3(closeLabel, t)))));
|
|
1021
1045
|
};
|
|
@@ -1128,7 +1152,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1128
1152
|
solo
|
|
1129
1153
|
]);
|
|
1130
1154
|
const isEmpty = !solo && active.length === 0;
|
|
1131
|
-
const padding =
|
|
1155
|
+
const padding = useMemo6(() => {
|
|
1132
1156
|
if (!solo && settings.overscroll === "centering") {
|
|
1133
1157
|
return calculateOverscroll(active.length);
|
|
1134
1158
|
}
|
|
@@ -1138,7 +1162,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1138
1162
|
settings.overscroll,
|
|
1139
1163
|
deck
|
|
1140
1164
|
]);
|
|
1141
|
-
const mainPosition =
|
|
1165
|
+
const mainPosition = useMemo6(() => [
|
|
1142
1166
|
"grid !block-start-[env(safe-area-inset-top)]",
|
|
1143
1167
|
topbar && "!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
|
|
1144
1168
|
hoistStatusbar && "lg:block-end-[--statusbar-size]"
|
|
@@ -1146,7 +1170,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1146
1170
|
topbar,
|
|
1147
1171
|
hoistStatusbar
|
|
1148
1172
|
]);
|
|
1149
|
-
const { order, itemsCount } =
|
|
1173
|
+
const { order, itemsCount } = useMemo6(() => {
|
|
1150
1174
|
return active.reduce((acc, entryId) => {
|
|
1151
1175
|
acc.order[entryId] = acc.itemsCount + 1;
|
|
1152
1176
|
acc.itemsCount += activeCompanions?.[entryId] ? 3 : 2;
|
|
@@ -1306,4 +1330,4 @@ export {
|
|
|
1306
1330
|
DeckLayout,
|
|
1307
1331
|
DeckSettings
|
|
1308
1332
|
};
|
|
1309
|
-
//# sourceMappingURL=chunk-
|
|
1333
|
+
//# sourceMappingURL=chunk-ZAL26IIZ.mjs.map
|