@onerjs/shared-ui-components 8.50.4 → 8.50.6

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.
@@ -15,10 +15,10 @@ export type ModularBridgeOptions = {
15
15
  */
16
16
  name?: string;
17
17
  /**
18
- * Whether the bridge should automatically start trying to connect.
19
- * Defaults to false.
18
+ * Whether the bridge should automatically enable trying to connect.
19
+ * Defaults to true.
20
20
  */
21
- autoStart?: boolean;
21
+ autoEnable?: boolean;
22
22
  /**
23
23
  * Additional service definitions to register with the bridge container.
24
24
  */
@@ -18,7 +18,7 @@ export function MakeModularBridge(options) {
18
18
  get name() {
19
19
  return options?.name ?? (typeof document !== "undefined" ? document.title : "Babylon.js Scene");
20
20
  },
21
- autoStart: options?.autoStart ?? false,
21
+ autoEnable: options?.autoEnable ?? true,
22
22
  });
23
23
  const allDefinitions = [bridgeDefinition];
24
24
  if (options?.serviceDefinitions) {
@@ -1 +1 @@
1
- {"version":3,"file":"modularBridge.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/modularTool/modularBridge.ts"],"names":[],"mappings":"AACA,OAAO,EAAqC,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAE3E,MAAM,WAAW,GAAG,IAAI,CAAC;AAgDzB;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA8B;IAC5D,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAExE,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;QACjD,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,WAAW;QAClC,IAAI,IAAI;YACJ,OAAO,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;QACpG,CAAC;QACD,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,KAAK;KACzC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAmC,CAAC,gBAAgB,CAAC,CAAC;IAC1E,IAAI,OAAO,EAAE,kBAAkB,EAAE,CAAC;QAC9B,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvD,CAAC;IAED,gBAAgB,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC,CAAC;IAEhD,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,OAAO;QACH,IAAI,gBAAgB;YAChB,OAAO,gBAAgB,CAAC;QAC5B,CAAC;QACD,IAAI,UAAU;YACV,OAAO,QAAQ,CAAC;QACpB,CAAC;QACD,OAAO;YACH,QAAQ,GAAG,IAAI,CAAC;YAChB,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAC/B,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { type IDisposable } from \"core/index\";\r\nimport { type WeaklyTypedServiceDefinition, ServiceContainer } from \"./modularity/serviceContainer\";\r\nimport { MakeBridgeServiceDefinition } from \"./services/cli/bridgeService\";\r\n\r\nconst DefaultPort = 4400;\r\n\r\n/**\r\n * Options for creating a modular bridge container.\r\n * @experimental\r\n * @internal\r\n */\r\nexport type ModularBridgeOptions = {\r\n /**\r\n * WebSocket port for the bridge's browser port. Defaults to 4400.\r\n */\r\n port?: number;\r\n\r\n /**\r\n * Session display name reported to the bridge. Defaults to `document.title`.\r\n */\r\n name?: string;\r\n\r\n /**\r\n * Whether the bridge should automatically start trying to connect.\r\n * Defaults to false.\r\n */\r\n autoStart?: boolean;\r\n\r\n /**\r\n * Additional service definitions to register with the bridge container.\r\n */\r\n serviceDefinitions?: readonly WeaklyTypedServiceDefinition[];\r\n};\r\n\r\n/**\r\n * A token returned by {@link MakeModularBridge} that owns the headless\r\n * {@link ServiceContainer}. Dispose it to tear down the bridge and all services.\r\n * @experimental\r\n * @internal\r\n */\r\nexport type ModularBridgeToken = IDisposable & {\r\n /**\r\n * The headless ServiceContainer that hosts the bridge.\r\n */\r\n readonly serviceContainer: ServiceContainer;\r\n\r\n /**\r\n * Whether this token has been disposed.\r\n */\r\n readonly isDisposed: boolean;\r\n};\r\n\r\n/**\r\n * Creates a headless {@link ServiceContainer} that hosts a bridge service.\r\n *\r\n * The returned token owns the container. Dispose it to tear down the bridge.\r\n *\r\n * @param options Optional configuration for the bridge.\r\n * @returns A {@link ModularBridgeToken} that owns the container.\r\n * @experimental\r\n * @internal\r\n */\r\nexport function MakeModularBridge(options?: ModularBridgeOptions): ModularBridgeToken {\r\n const serviceContainer = new ServiceContainer(\"ModularBridgeContainer\");\r\n\r\n const bridgeDefinition = MakeBridgeServiceDefinition({\r\n port: options?.port ?? DefaultPort,\r\n get name() {\r\n return options?.name ?? (typeof document !== \"undefined\" ? document.title : \"Babylon.js Scene\");\r\n },\r\n autoStart: options?.autoStart ?? false,\r\n });\r\n\r\n const allDefinitions: WeaklyTypedServiceDefinition[] = [bridgeDefinition];\r\n if (options?.serviceDefinitions) {\r\n allDefinitions.push(...options.serviceDefinitions);\r\n }\r\n\r\n serviceContainer.addServices(...allDefinitions);\r\n\r\n let disposed = false;\r\n\r\n return {\r\n get serviceContainer() {\r\n return serviceContainer;\r\n },\r\n get isDisposed() {\r\n return disposed;\r\n },\r\n dispose() {\r\n disposed = true;\r\n serviceContainer.dispose();\r\n },\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"modularBridge.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/modularTool/modularBridge.ts"],"names":[],"mappings":"AACA,OAAO,EAAqC,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAE3E,MAAM,WAAW,GAAG,IAAI,CAAC;AAgDzB;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA8B;IAC5D,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAExE,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;QACjD,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,WAAW;QAClC,IAAI,IAAI;YACJ,OAAO,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;QACpG,CAAC;QACD,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,IAAI;KAC1C,CAAC,CAAC;IAEH,MAAM,cAAc,GAAmC,CAAC,gBAAgB,CAAC,CAAC;IAC1E,IAAI,OAAO,EAAE,kBAAkB,EAAE,CAAC;QAC9B,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvD,CAAC;IAED,gBAAgB,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC,CAAC;IAEhD,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,OAAO;QACH,IAAI,gBAAgB;YAChB,OAAO,gBAAgB,CAAC;QAC5B,CAAC;QACD,IAAI,UAAU;YACV,OAAO,QAAQ,CAAC;QACpB,CAAC;QACD,OAAO;YACH,QAAQ,GAAG,IAAI,CAAC;YAChB,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAC/B,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { type IDisposable } from \"core/index\";\r\nimport { type WeaklyTypedServiceDefinition, ServiceContainer } from \"./modularity/serviceContainer\";\r\nimport { MakeBridgeServiceDefinition } from \"./services/cli/bridgeService\";\r\n\r\nconst DefaultPort = 4400;\r\n\r\n/**\r\n * Options for creating a modular bridge container.\r\n * @experimental\r\n * @internal\r\n */\r\nexport type ModularBridgeOptions = {\r\n /**\r\n * WebSocket port for the bridge's browser port. Defaults to 4400.\r\n */\r\n port?: number;\r\n\r\n /**\r\n * Session display name reported to the bridge. Defaults to `document.title`.\r\n */\r\n name?: string;\r\n\r\n /**\r\n * Whether the bridge should automatically enable trying to connect.\r\n * Defaults to true.\r\n */\r\n autoEnable?: boolean;\r\n\r\n /**\r\n * Additional service definitions to register with the bridge container.\r\n */\r\n serviceDefinitions?: readonly WeaklyTypedServiceDefinition[];\r\n};\r\n\r\n/**\r\n * A token returned by {@link MakeModularBridge} that owns the headless\r\n * {@link ServiceContainer}. Dispose it to tear down the bridge and all services.\r\n * @experimental\r\n * @internal\r\n */\r\nexport type ModularBridgeToken = IDisposable & {\r\n /**\r\n * The headless ServiceContainer that hosts the bridge.\r\n */\r\n readonly serviceContainer: ServiceContainer;\r\n\r\n /**\r\n * Whether this token has been disposed.\r\n */\r\n readonly isDisposed: boolean;\r\n};\r\n\r\n/**\r\n * Creates a headless {@link ServiceContainer} that hosts a bridge service.\r\n *\r\n * The returned token owns the container. Dispose it to tear down the bridge.\r\n *\r\n * @param options Optional configuration for the bridge.\r\n * @returns A {@link ModularBridgeToken} that owns the container.\r\n * @experimental\r\n * @internal\r\n */\r\nexport function MakeModularBridge(options?: ModularBridgeOptions): ModularBridgeToken {\r\n const serviceContainer = new ServiceContainer(\"ModularBridgeContainer\");\r\n\r\n const bridgeDefinition = MakeBridgeServiceDefinition({\r\n port: options?.port ?? DefaultPort,\r\n get name() {\r\n return options?.name ?? (typeof document !== \"undefined\" ? document.title : \"Babylon.js Scene\");\r\n },\r\n autoEnable: options?.autoEnable ?? true,\r\n });\r\n\r\n const allDefinitions: WeaklyTypedServiceDefinition[] = [bridgeDefinition];\r\n if (options?.serviceDefinitions) {\r\n allDefinitions.push(...options.serviceDefinitions);\r\n }\r\n\r\n serviceContainer.addServices(...allDefinitions);\r\n\r\n let disposed = false;\r\n\r\n return {\r\n get serviceContainer() {\r\n return serviceContainer;\r\n },\r\n get isDisposed() {\r\n return disposed;\r\n },\r\n dispose() {\r\n disposed = true;\r\n serviceContainer.dispose();\r\n },\r\n };\r\n}\r\n"]}
@@ -18,9 +18,9 @@ export type BridgeServiceOptions = {
18
18
  */
19
19
  name: string;
20
20
  /**
21
- * Whether to automatically start connecting when the service is created.
21
+ * Whether to automatically enable connecting when the service is created.
22
22
  */
23
- autoStart: boolean;
23
+ autoEnable: boolean;
24
24
  };
25
25
  /**
26
26
  * Creates the service definition for the CLI Bridge Service.
@@ -18,7 +18,7 @@ export function MakeBridgeServiceDefinition(options) {
18
18
  let ws = null;
19
19
  let reconnectTimer = null;
20
20
  let disposed = false;
21
- let enabled = options.autoStart;
21
+ let enabled = options.autoEnable;
22
22
  let connected = false;
23
23
  const onConnectionStatusChanged = new Observable();
24
24
  function notifyStatusChanged() {
@@ -1 +1 @@
1
- {"version":3,"file":"bridgeService.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/modularTool/services/cli/bridgeService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAA6B,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAClG,OAAO,EAA6D,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACnI,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA0B1C;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAA6B;IACrE,OAAO;QACH,YAAY,EAAE,oBAAoB;QAClC,QAAQ,EAAE,CAAC,6BAA6B,EAAE,2BAA2B,CAAC;QACtE,OAAO,EAAE,GAAG,EAAE;YACV,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAmC,CAAC;YAC5D,IAAI,EAAE,GAAqB,IAAI,CAAC;YAChC,IAAI,cAAc,GAAyC,IAAI,CAAC;YAChE,IAAI,QAAQ,GAAG,KAAK,CAAC;YACrB,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;YAChC,IAAI,SAAS,GAAG,KAAK,CAAC;YACtB,MAAM,yBAAyB,GAAG,IAAI,UAAU,EAAQ,CAAC;YAEzD,SAAS,mBAAmB;gBACxB,yBAAyB,CAAC,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AO,EAAE,GAAG,EAAE;oBACV,QAAQ,GAAG,IAAI,CAAC;oBAChB,OAAO,GAAG,KAAK,CAAC;oBAChB,UAAU,EAAE,CAAC;oBACb,QAAQ,CAAC,KAAK,EAAE,CAAC;oBACjB,yBAAyB,CAAC,KAAK,EAAE,CAAC;gBACtC,CAAC;aACJ,CAAC;YAEF,OAAO,QAAQ,CAAC;QACpB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { type IDisposable } from \"core/index\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { type BrowserRequest, type BrowserResponse, type CommandInfo } from \"./protocol\";\r\nimport { type ServiceDefinition } from \"../../modularity/serviceDefinition\";\r\nimport { type ICliConnectionStatus, CliConnectionStatusIdentity } from \"./bridgeConnectionStatus\";\r\nimport { type IBridgeCommandRegistry, type BridgeCommandDescriptor, BridgeCommandRegistryIdentity } from \"./bridgeCommandRegistry\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * Options for the CLI bridge service.\r\n * @experimental\r\n * @internal\r\n */\r\nexport type BridgeServiceOptions = {\r\n /**\r\n * The WebSocket port for the bridge's browser port.\r\n */\r\n port: number;\r\n\r\n /**\r\n * The session display name sent to the bridge.\r\n * Can be a getter to provide a dynamic value that is re-read\r\n * each time the bridge queries session information.\r\n */\r\n name: string;\r\n\r\n /**\r\n * Whether to automatically start connecting when the service is created.\r\n */\r\n autoStart: boolean;\r\n};\r\n\r\n/**\r\n * Creates the service definition for the CLI Bridge Service.\r\n * @param options The options for connecting to the bridge.\r\n * @returns A service definition that produces an IBridgeCommandRegistry and ICliConnectionStatus.\r\n * @experimental\r\n * @internal\r\n */\r\nexport function MakeBridgeServiceDefinition(options: BridgeServiceOptions): ServiceDefinition<[IBridgeCommandRegistry, ICliConnectionStatus], []> {\r\n return {\r\n friendlyName: \"CLI Bridge Service\",\r\n produces: [BridgeCommandRegistryIdentity, CliConnectionStatusIdentity],\r\n factory: () => {\r\n const commands = new Map<string, BridgeCommandDescriptor>();\r\n let ws: WebSocket | null = null;\r\n let reconnectTimer: ReturnType<typeof setTimeout> | null = null;\r\n let disposed = false;\r\n let enabled = options.autoStart;\r\n let connected = false;\r\n const onConnectionStatusChanged = new Observable<void>();\r\n\r\n function notifyStatusChanged() {\r\n onConnectionStatusChanged.notifyObservers();\r\n }\r\n\r\n function setConnected(value: boolean) {\r\n if (connected !== value) {\r\n connected = value;\r\n notifyStatusChanged();\r\n }\r\n }\r\n\r\n function sendToBridge(message: BrowserRequest) {\r\n ws?.send(JSON.stringify(message));\r\n }\r\n\r\n function connect() {\r\n if (disposed || !enabled) {\r\n return;\r\n }\r\n\r\n // Close any existing WebSocket to avoid orphaned connections that\r\n // keep a stale session alive on the bridge.\r\n if (ws) {\r\n const oldWs = ws;\r\n oldWs.onopen = null;\r\n oldWs.onclose = null;\r\n oldWs.onmessage = null;\r\n oldWs.onerror = null;\r\n oldWs.close();\r\n ws = null;\r\n }\r\n\r\n try {\r\n // NOTE: The browser unconditionally logs a console error for failed WebSocket\r\n // connections at the network level. This cannot be suppressed from JavaScript.\r\n ws = new WebSocket(`ws://127.0.0.1:${options.port}`);\r\n } catch {\r\n ws = null;\r\n setConnected(false);\r\n Logger.Warn(`CLIBridgeService: Failed to create WebSocket connection on port ${options.port}.`);\r\n scheduleReconnect();\r\n return;\r\n }\r\n\r\n ws.onopen = () => {\r\n setConnected(true);\r\n sendToBridge({ type: \"register\", name: options.name });\r\n };\r\n\r\n ws.onmessage = (event) => {\r\n try {\r\n const message = JSON.parse(event.data as string);\r\n void handleMessage(message);\r\n } catch {\r\n Logger.Warn(\"CLIBridgeService: Failed to parse message from bridge.\");\r\n }\r\n };\r\n\r\n ws.onclose = () => {\r\n ws = null;\r\n setConnected(false);\r\n scheduleReconnect();\r\n };\r\n\r\n ws.onerror = () => {\r\n // onclose will fire after onerror, which handles reconnection.\r\n };\r\n }\r\n\r\n function disconnect() {\r\n if (reconnectTimer !== null) {\r\n clearTimeout(reconnectTimer);\r\n reconnectTimer = null;\r\n }\r\n if (ws) {\r\n ws.onclose = null;\r\n ws.close();\r\n ws = null;\r\n }\r\n setConnected(false);\r\n }\r\n\r\n function scheduleReconnect() {\r\n if (disposed || !enabled || reconnectTimer !== null) {\r\n return;\r\n }\r\n reconnectTimer = setTimeout(() => {\r\n reconnectTimer = null;\r\n connect();\r\n }, 3000);\r\n }\r\n\r\n async function handleMessage(message: BrowserResponse) {\r\n switch (message.type) {\r\n case \"listCommands\": {\r\n const commandList: CommandInfo[] = Array.from(commands.values()).map((cmd) => ({\r\n id: cmd.id,\r\n description: cmd.description,\r\n args: cmd.args,\r\n }));\r\n sendToBridge({\r\n type: \"commandListResponse\",\r\n requestId: message.requestId,\r\n commands: commandList,\r\n });\r\n break;\r\n }\r\n case \"getInfo\": {\r\n sendToBridge({\r\n type: \"infoResponse\",\r\n requestId: message.requestId,\r\n name: options.name,\r\n });\r\n break;\r\n }\r\n case \"execCommand\": {\r\n const command = commands.get(message.commandId);\r\n if (!command) {\r\n sendToBridge({\r\n type: \"commandResponse\",\r\n requestId: message.requestId,\r\n error: `Unknown command: ${message.commandId}`,\r\n });\r\n break;\r\n }\r\n try {\r\n const result = await command.executeAsync(message.args);\r\n sendToBridge({\r\n type: \"commandResponse\",\r\n requestId: message.requestId,\r\n result,\r\n });\r\n } catch (error: unknown) {\r\n sendToBridge({\r\n type: \"commandResponse\",\r\n requestId: message.requestId,\r\n error: String(error),\r\n });\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (enabled) {\r\n connect();\r\n }\r\n\r\n const registry: IBridgeCommandRegistry & ICliConnectionStatus & IDisposable = {\r\n addCommand(descriptor: BridgeCommandDescriptor): IDisposable {\r\n if (commands.has(descriptor.id)) {\r\n throw new Error(`Command '${descriptor.id}' is already registered.`);\r\n }\r\n commands.set(descriptor.id, descriptor);\r\n return {\r\n dispose: () => {\r\n commands.delete(descriptor.id);\r\n },\r\n };\r\n },\r\n get isEnabled() {\r\n return enabled;\r\n },\r\n set isEnabled(value: boolean) {\r\n if (enabled !== value) {\r\n enabled = value;\r\n if (enabled) {\r\n connect();\r\n } else {\r\n disconnect();\r\n }\r\n notifyStatusChanged();\r\n }\r\n },\r\n get isConnected() {\r\n return connected;\r\n },\r\n onConnectionStatusChanged,\r\n dispose: () => {\r\n disposed = true;\r\n enabled = false;\r\n disconnect();\r\n commands.clear();\r\n onConnectionStatusChanged.clear();\r\n },\r\n };\r\n\r\n return registry;\r\n },\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"bridgeService.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/modularTool/services/cli/bridgeService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAA6B,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAClG,OAAO,EAA6D,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACnI,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA0B1C;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAA6B;IACrE,OAAO;QACH,YAAY,EAAE,oBAAoB;QAClC,QAAQ,EAAE,CAAC,6BAA6B,EAAE,2BAA2B,CAAC;QACtE,OAAO,EAAE,GAAG,EAAE;YACV,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAmC,CAAC;YAC5D,IAAI,EAAE,GAAqB,IAAI,CAAC;YAChC,IAAI,cAAc,GAAyC,IAAI,CAAC;YAChE,IAAI,QAAQ,GAAG,KAAK,CAAC;YACrB,IAAI,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;YACjC,IAAI,SAAS,GAAG,KAAK,CAAC;YACtB,MAAM,yBAAyB,GAAG,IAAI,UAAU,EAAQ,CAAC;YAEzD,SAAS,mBAAmB;gBACxB,yBAAyB,CAAC,eAAe,EAAE,CAAC;YAChD,CAAC;YAED,SAAS,YAAY,CAAC,KAAc;gBAChC,IAAI,SAAS,KAAK,KAAK,E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UAAU,EAAE,CAAC;oBACb,QAAQ,CAAC,KAAK,EAAE,CAAC;oBACjB,yBAAyB,CAAC,KAAK,EAAE,CAAC;gBACtC,CAAC;aACJ,CAAC;YAEF,OAAO,QAAQ,CAAC;QACpB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { type IDisposable } from \"core/index\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { type BrowserRequest, type BrowserResponse, type CommandInfo } from \"./protocol\";\r\nimport { type ServiceDefinition } from \"../../modularity/serviceDefinition\";\r\nimport { type ICliConnectionStatus, CliConnectionStatusIdentity } from \"./bridgeConnectionStatus\";\r\nimport { type IBridgeCommandRegistry, type BridgeCommandDescriptor, BridgeCommandRegistryIdentity } from \"./bridgeCommandRegistry\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * Options for the CLI bridge service.\r\n * @experimental\r\n * @internal\r\n */\r\nexport type BridgeServiceOptions = {\r\n /**\r\n * The WebSocket port for the bridge's browser port.\r\n */\r\n port: number;\r\n\r\n /**\r\n * The session display name sent to the bridge.\r\n * Can be a getter to provide a dynamic value that is re-read\r\n * each time the bridge queries session information.\r\n */\r\n name: string;\r\n\r\n /**\r\n * Whether to automatically enable connecting when the service is created.\r\n */\r\n autoEnable: boolean;\r\n};\r\n\r\n/**\r\n * Creates the service definition for the CLI Bridge Service.\r\n * @param options The options for connecting to the bridge.\r\n * @returns A service definition that produces an IBridgeCommandRegistry and ICliConnectionStatus.\r\n * @experimental\r\n * @internal\r\n */\r\nexport function MakeBridgeServiceDefinition(options: BridgeServiceOptions): ServiceDefinition<[IBridgeCommandRegistry, ICliConnectionStatus], []> {\r\n return {\r\n friendlyName: \"CLI Bridge Service\",\r\n produces: [BridgeCommandRegistryIdentity, CliConnectionStatusIdentity],\r\n factory: () => {\r\n const commands = new Map<string, BridgeCommandDescriptor>();\r\n let ws: WebSocket | null = null;\r\n let reconnectTimer: ReturnType<typeof setTimeout> | null = null;\r\n let disposed = false;\r\n let enabled = options.autoEnable;\r\n let connected = false;\r\n const onConnectionStatusChanged = new Observable<void>();\r\n\r\n function notifyStatusChanged() {\r\n onConnectionStatusChanged.notifyObservers();\r\n }\r\n\r\n function setConnected(value: boolean) {\r\n if (connected !== value) {\r\n connected = value;\r\n notifyStatusChanged();\r\n }\r\n }\r\n\r\n function sendToBridge(message: BrowserRequest) {\r\n ws?.send(JSON.stringify(message));\r\n }\r\n\r\n function connect() {\r\n if (disposed || !enabled) {\r\n return;\r\n }\r\n\r\n // Close any existing WebSocket to avoid orphaned connections that\r\n // keep a stale session alive on the bridge.\r\n if (ws) {\r\n const oldWs = ws;\r\n oldWs.onopen = null;\r\n oldWs.onclose = null;\r\n oldWs.onmessage = null;\r\n oldWs.onerror = null;\r\n oldWs.close();\r\n ws = null;\r\n }\r\n\r\n try {\r\n // NOTE: The browser unconditionally logs a console error for failed WebSocket\r\n // connections at the network level. This cannot be suppressed from JavaScript.\r\n ws = new WebSocket(`ws://127.0.0.1:${options.port}`);\r\n } catch {\r\n ws = null;\r\n setConnected(false);\r\n Logger.Warn(`CLIBridgeService: Failed to create WebSocket connection on port ${options.port}.`);\r\n scheduleReconnect();\r\n return;\r\n }\r\n\r\n ws.onopen = () => {\r\n setConnected(true);\r\n sendToBridge({ type: \"register\", name: options.name });\r\n };\r\n\r\n ws.onmessage = (event) => {\r\n try {\r\n const message = JSON.parse(event.data as string);\r\n void handleMessage(message);\r\n } catch {\r\n Logger.Warn(\"CLIBridgeService: Failed to parse message from bridge.\");\r\n }\r\n };\r\n\r\n ws.onclose = () => {\r\n ws = null;\r\n setConnected(false);\r\n scheduleReconnect();\r\n };\r\n\r\n ws.onerror = () => {\r\n // onclose will fire after onerror, which handles reconnection.\r\n };\r\n }\r\n\r\n function disconnect() {\r\n if (reconnectTimer !== null) {\r\n clearTimeout(reconnectTimer);\r\n reconnectTimer = null;\r\n }\r\n if (ws) {\r\n ws.onclose = null;\r\n ws.close();\r\n ws = null;\r\n }\r\n setConnected(false);\r\n }\r\n\r\n function scheduleReconnect() {\r\n if (disposed || !enabled || reconnectTimer !== null) {\r\n return;\r\n }\r\n reconnectTimer = setTimeout(() => {\r\n reconnectTimer = null;\r\n connect();\r\n }, 3000);\r\n }\r\n\r\n async function handleMessage(message: BrowserResponse) {\r\n switch (message.type) {\r\n case \"listCommands\": {\r\n const commandList: CommandInfo[] = Array.from(commands.values()).map((cmd) => ({\r\n id: cmd.id,\r\n description: cmd.description,\r\n args: cmd.args,\r\n }));\r\n sendToBridge({\r\n type: \"commandListResponse\",\r\n requestId: message.requestId,\r\n commands: commandList,\r\n });\r\n break;\r\n }\r\n case \"getInfo\": {\r\n sendToBridge({\r\n type: \"infoResponse\",\r\n requestId: message.requestId,\r\n name: options.name,\r\n });\r\n break;\r\n }\r\n case \"execCommand\": {\r\n const command = commands.get(message.commandId);\r\n if (!command) {\r\n sendToBridge({\r\n type: \"commandResponse\",\r\n requestId: message.requestId,\r\n error: `Unknown command: ${message.commandId}`,\r\n });\r\n break;\r\n }\r\n try {\r\n const result = await command.executeAsync(message.args);\r\n sendToBridge({\r\n type: \"commandResponse\",\r\n requestId: message.requestId,\r\n result,\r\n });\r\n } catch (error: unknown) {\r\n sendToBridge({\r\n type: \"commandResponse\",\r\n requestId: message.requestId,\r\n error: String(error),\r\n });\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (enabled) {\r\n connect();\r\n }\r\n\r\n const registry: IBridgeCommandRegistry & ICliConnectionStatus & IDisposable = {\r\n addCommand(descriptor: BridgeCommandDescriptor): IDisposable {\r\n if (commands.has(descriptor.id)) {\r\n throw new Error(`Command '${descriptor.id}' is already registered.`);\r\n }\r\n commands.set(descriptor.id, descriptor);\r\n return {\r\n dispose: () => {\r\n commands.delete(descriptor.id);\r\n },\r\n };\r\n },\r\n get isEnabled() {\r\n return enabled;\r\n },\r\n set isEnabled(value: boolean) {\r\n if (enabled !== value) {\r\n enabled = value;\r\n if (enabled) {\r\n connect();\r\n } else {\r\n disconnect();\r\n }\r\n notifyStatusChanged();\r\n }\r\n },\r\n get isConnected() {\r\n return connected;\r\n },\r\n onConnectionStatusChanged,\r\n dispose: () => {\r\n disposed = true;\r\n enabled = false;\r\n disconnect();\r\n commands.clear();\r\n onConnectionStatusChanged.clear();\r\n },\r\n };\r\n\r\n return registry;\r\n },\r\n };\r\n}\r\n"]}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useResizeHandle } from "@fluentui-contrib/react-resize-handle";
2
3
  import { Button, Divider, Toolbar as FluentToolbar, makeStyles, Menu, MenuGroup, MenuGroupHeader, MenuItem, MenuList, MenuPopover, MenuTrigger, mergeClasses, SplitButton, Subtitle2Stronger, tokens, ToolbarRadioButton, } from "@fluentui/react-components";
3
4
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
4
5
  import { LayoutColumnTwoFocusLeftFilled, LayoutColumnTwoFocusRightFilled, LayoutColumnTwoSplitLeftFocusBottomLeftFilled, LayoutColumnTwoSplitLeftFocusTopLeftFilled, LayoutColumnTwoSplitRightFocusBottomRightFilled, LayoutColumnTwoSplitRightFocusTopRightFilled, MoreHorizontalRegular, PanelLeftContractRegular, PanelLeftExpandRegular, PanelRightContractRegular, PanelRightExpandRegular, PictureInPictureEnterRegular, } from "@fluentui/react-icons";
@@ -13,7 +14,6 @@ import { Theme } from "../components/theme.js";
13
14
  import { useOrderedObservableCollection } from "../hooks/observableHooks.js";
14
15
  import { useSetting } from "../hooks/settingsHooks.js";
15
16
  import { MakePopoverTeachingMoment } from "../hooks/teachingMomentHooks.js";
16
- import { useResizeHandle } from "../hooks/useResizeHandle.js";
17
17
  import { ObservableCollection } from "../misc/observableCollection.js";
18
18
  /**
19
19
  * Setting descriptor for persisting side pane dock location overrides.
@@ -322,6 +322,12 @@ function usePane(location, defaultWidth, minWidth, sidePanes, onSelectSidePane,
322
322
  }, []);
323
323
  const [paneWidthSetting, setPaneWidthSetting] = useSetting(location === "left" ? LeftSidePaneWidthAdjustSettingDescriptor : RightSidePaneWidthAdjustSettingDescriptor);
324
324
  const [paneHeightSetting, setPaneHeightSetting] = useSetting(location === "left" ? LeftSidePaneHeightAdjustSettingDescriptor : RightSidePaneHeightAdjustSettingDescriptor);
325
+ // Keep setting values in refs so the composed ref callbacks below can read the latest values
326
+ // without causing the callbacks to be recreated (which would cause unnecessary ref detach/reattach).
327
+ const paneWidthSettingRef = useRef(paneWidthSetting);
328
+ paneWidthSettingRef.current = paneWidthSetting;
329
+ const paneHeightSettingRef = useRef(paneHeightSetting);
330
+ paneHeightSettingRef.current = paneHeightSetting;
325
331
  const currentSidePanes = useMemo(() => sidePanes.filter((entry) => entry.horizontalLocation === location), [sidePanes, location]);
326
332
  const topPanes = useMemo(() => currentSidePanes.filter((entry) => entry.verticalLocation === "top"), [currentSidePanes]);
327
333
  const bottomPanes = useMemo(() => currentSidePanes.filter((entry) => entry.verticalLocation === "bottom"), [currentSidePanes]);
@@ -418,28 +424,54 @@ function usePane(location, defaultWidth, minWidth, sidePanes, onSelectSidePane,
418
424
  // This memos the TabList to make it easy for the JSX to be inserted at the top of the pane (in "compact" mode) or returned to the caller to be used in the toolbar (in "full" mode).
419
425
  const topPaneTabList = useMemo(() => createPaneTabList(topPanes, toolbarMode, topSelectedTab, setTopSelectedTab, validTopDockOptions), [createPaneTabList, topPanes, toolbarMode, topSelectedTab]);
420
426
  const bottomPaneTabList = useMemo(() => createPaneTabList(bottomPanes, "compact", bottomSelectedTab, setBottomSelectedTab, validBottomDockOptions), [createPaneTabList, bottomPanes, bottomSelectedTab]);
427
+ // Memoize the resize onChange handlers so the Fluent hook's element ref callbacks remain stable across renders.
428
+ // The contrib hook's returned elementRef callback transitively depends on onChange, so an inline arrow here would
429
+ // force the composed refs below to be recreated every render, defeating the ref-stability optimization.
430
+ const onPaneWidthChange = useCallback((_event, data) => {
431
+ // Whenever the width is adjusted, store the value.
432
+ setPaneWidthSetting(data.value);
433
+ }, [setPaneWidthSetting]);
434
+ const onPaneHeightChange = useCallback((_event, data) => {
435
+ // Whenever the height is adjusted, store the value.
436
+ setPaneHeightSetting(data.value);
437
+ }, [setPaneHeightSetting]);
421
438
  // This manages the CSS variable that controls the width of the side pane.
422
439
  const paneWidthAdjustCSSVar = "--pane-width-adjust";
423
440
  const { elementRef: paneHorizontalResizeElementRef, handleRef: paneHorizontalResizeHandleRef, setValue: setPaneWidthAdjust, } = useResizeHandle({
424
441
  growDirection: location === "left" ? "end" : "start",
442
+ relative: true,
425
443
  variableName: paneWidthAdjustCSSVar,
444
+ variableTarget: "element",
426
445
  minValue: minWidth - defaultWidth,
427
- onChange: (value) => {
428
- // Whenever the width is adjusted, store the value.
429
- setPaneWidthSetting(value);
430
- },
446
+ onChange: onPaneWidthChange,
431
447
  });
432
448
  // This manages the CSS variable that controls the height of the bottom pane.
433
449
  const paneHeightAdjustCSSVar = "--pane-height-adjust";
434
450
  const { elementRef: paneVerticalResizeElementRef, handleRef: paneVerticalResizeHandleRef, setValue: setPaneHeightAdjust, } = useResizeHandle({
435
451
  growDirection: "up",
452
+ relative: true,
436
453
  variableName: paneHeightAdjustCSSVar,
437
- onChange: (value) => {
438
- // Whenever the height is adjusted, store the value.
439
- setPaneHeightSetting(value);
440
- },
454
+ variableTarget: "element",
455
+ onChange: onPaneHeightChange,
441
456
  });
442
- // This ensures that when the component is first rendered, the CSS variable is set from storage.
457
+ // Compose the Fluent hook's element ref callbacks with logic to apply stored settings when elements mount.
458
+ // This is necessary because on the initial render, side pane elements may not be in the DOM yet (no panes
459
+ // registered). The Fluent hook's setValue will silently fail when the element doesn't exist (in relative mode,
460
+ // it measures the element before/after and reverts if unchanged, which always happens when the element is null).
461
+ // By composing the ref callback, we ensure the stored value is applied immediately after the element mounts.
462
+ const composedHorizontalElementRef = useCallback((node) => {
463
+ paneHorizontalResizeElementRef(node);
464
+ if (node) {
465
+ setPaneWidthAdjust(paneWidthSettingRef.current);
466
+ }
467
+ }, [paneHorizontalResizeElementRef, setPaneWidthAdjust]);
468
+ const composedVerticalElementRef = useCallback((node) => {
469
+ paneVerticalResizeElementRef(node);
470
+ if (node) {
471
+ setPaneHeightAdjust(paneHeightSettingRef.current);
472
+ }
473
+ }, [paneVerticalResizeElementRef, setPaneHeightAdjust]);
474
+ // Handle external setting changes (e.g. settings reset) after elements are already mounted.
443
475
  useLayoutEffect(() => {
444
476
  setPaneWidthAdjust(paneWidthSetting);
445
477
  setPaneHeightAdjust(paneHeightSetting);
@@ -454,7 +486,7 @@ function usePane(location, defaultWidth, minWidth, sidePanes, onSelectSidePane,
454
486
  const corePane = useMemo(() => {
455
487
  return (_jsxs(_Fragment, { children: [toolbarMode === "compact" && (topPanes.length > 1 || topBarItems.length > 0) && (_jsx(_Fragment, { children: _jsxs("div", { className: classes.barDiv, children: [!isChildWindowOpen && location === "left" && expandCollapseButton, topPaneTabList, _jsx(Toolbar, { location: "top", components: topBarItems }), !isChildWindowOpen && location === "right" && expandCollapseButton] }) })), topPanes.length > 0 && (_jsx("div", { className: classes.paneContent, children: topSelectedTab && (_jsxs(_Fragment, { children: [_jsx(PaneHeader, { id: topSelectedTab.key, title: topSelectedTab.title, icon: topPanes.length > 1 ? undefined : topSelectedTab.icon, dockOptions: validTopDockOptions }), topPanes
456
488
  .filter((pane) => pane.key === topSelectedTab.key || pane.keepMounted)
457
- .map((pane) => (_jsx("div", { className: mergeClasses(classes.paneContent, pane.key !== topSelectedTab.key ? classes.unselectedPane : undefined), children: _jsx(ErrorBoundary, { name: pane.title, children: _jsx(pane.content, {}) }) }, pane.key)))] })) })), topPanes.length > 0 && bottomPanes.length > 0 && _jsx(Divider, { ref: paneVerticalResizeHandleRef, className: classes.paneDivider }), bottomPanes.length > 1 && (_jsx(_Fragment, { children: _jsx("div", { className: classes.barDiv, children: bottomPaneTabList }) })), bottomPanes.length > 0 && (_jsx("div", { ref: paneVerticalResizeElementRef, className: classes.paneContent, style: { height: `clamp(200px, calc(45% + var(${paneHeightAdjustCSSVar}, 0px)), 100% - 300px)`, flex: "0 0 auto" }, children: bottomSelectedTab && (_jsxs(_Fragment, { children: [_jsx(PaneHeader, { id: bottomSelectedTab.key, title: bottomSelectedTab.title, icon: bottomPanes.length > 1 ? undefined : bottomSelectedTab.icon, dockOptions: validBottomDockOptions }), bottomPanes
489
+ .map((pane) => (_jsx("div", { className: mergeClasses(classes.paneContent, pane.key !== topSelectedTab.key ? classes.unselectedPane : undefined), children: _jsx(ErrorBoundary, { name: pane.title, children: _jsx(pane.content, {}) }) }, pane.key)))] })) })), topPanes.length > 0 && bottomPanes.length > 0 && _jsx(Divider, { ref: paneVerticalResizeHandleRef, className: classes.paneDivider }), bottomPanes.length > 1 && (_jsx(_Fragment, { children: _jsx("div", { className: classes.barDiv, children: bottomPaneTabList }) })), bottomPanes.length > 0 && (_jsx("div", { ref: composedVerticalElementRef, className: classes.paneContent, style: { height: `clamp(200px, calc(45% + var(${paneHeightAdjustCSSVar}, 0px)), 100% - 300px)`, flex: "0 0 auto" }, children: bottomSelectedTab && (_jsxs(_Fragment, { children: [_jsx(PaneHeader, { id: bottomSelectedTab.key, title: bottomSelectedTab.title, icon: bottomPanes.length > 1 ? undefined : bottomSelectedTab.icon, dockOptions: validBottomDockOptions }), bottomPanes
458
490
  .filter((pane) => pane.key === bottomSelectedTab.key || pane.keepMounted)
459
491
  .map((pane) => (_jsx("div", { className: mergeClasses(classes.paneContent, pane.key !== bottomSelectedTab.key ? classes.unselectedPane : undefined), children: _jsx(ErrorBoundary, { name: pane.title, children: _jsx(pane.content, {}) }) }, pane.key)))] })) })), toolbarMode === "compact" && bottomBarItems.length > 0 && (_jsx(_Fragment, { children: _jsx("div", { className: classes.barDiv, children: _jsx(Toolbar, { location: "bottom", components: bottomBarItems }) }) }))] }));
460
492
  }, [
@@ -472,7 +504,7 @@ function usePane(location, defaultWidth, minWidth, sidePanes, onSelectSidePane,
472
504
  ]);
473
505
  // This deals with docked vs undocked state, where undocked is rendered into a separate window via a portal.
474
506
  const pane = useMemo(() => {
475
- return (_jsxs(_Fragment, { children: [!isChildWindowOpen && (_jsx("div", { ref: paneContainerRef, className: classes.paneContainer, children: (topPanes.length > 0 || bottomPanes.length > 0) && (_jsxs("div", { className: `${classes.pane} ${location === "left" ? classes.paneLeft : classes.paneRight}`, children: [_jsx(Collapse, { orientation: "horizontal", visible: !collapsed, children: _jsx("div", { ref: paneHorizontalResizeElementRef, className: classes.paneContainer, style: { width: `clamp(${minWidth}px, calc(${defaultWidth}px + var(${paneWidthAdjustCSSVar}, 0px)), 1000px)` }, children: corePane }) }), _jsx("div", { ref: paneHorizontalResizeHandleRef, className: `${classes.resizer} ${location === "left" ? classes.resizerLeft : classes.resizerRight}`, style: { pointerEvents: `${collapsed ? "none" : "auto"}` } })] })) })), _jsx(ChildWindow, { imperativeRef: childWindow, onOpenChange: (isOpen) => setIsChildWindowOpen(isOpen), children: corePane })] }));
507
+ return (_jsxs(_Fragment, { children: [!isChildWindowOpen && (_jsx("div", { ref: paneContainerRef, className: classes.paneContainer, children: (topPanes.length > 0 || bottomPanes.length > 0) && (_jsxs("div", { className: `${classes.pane} ${location === "left" ? classes.paneLeft : classes.paneRight}`, children: [_jsx(Collapse, { orientation: "horizontal", visible: !collapsed, children: _jsx("div", { ref: composedHorizontalElementRef, className: classes.paneContainer, style: { width: `clamp(${minWidth}px, calc(${defaultWidth}px + var(${paneWidthAdjustCSSVar}, 0px)), 1000px)` }, children: corePane }) }), _jsx("div", { ref: paneHorizontalResizeHandleRef, className: `${classes.resizer} ${location === "left" ? classes.resizerLeft : classes.resizerRight}`, style: { pointerEvents: `${collapsed ? "none" : "auto"}` } })] })) })), _jsx(ChildWindow, { imperativeRef: childWindow, onOpenChange: (isOpen) => setIsChildWindowOpen(isOpen), children: corePane })] }));
476
508
  }, [collapsed, corePane]);
477
509
  const hasPanes = topPanes.length > 0 || bottomPanes.length > 0;
478
510
  return [topPaneTabList, pane, collapsed, setCollapsed, isChildWindowOpen, setUndocked, hasPanes];
@@ -1 +1 @@
1
- {"version":3,"file":"shellService.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/modularTool/services/shellService.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEH,MAAM,EACN,OAAO,EACP,OAAO,IAAI,aAAa,EACxB,UAAU,EACV,IAAI,EACJ,SAAS,EACT,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,MAAM,EACN,kBAAkB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAA8C,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMvI,OAAO,EACH,8BAA8B,EAC9B,+BAA+B,EAC/B,6CAA6C,EAC7C,0CAA0C,EAC1C,+CAA+C,EAC/C,4CAA4C,EAC5C,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,gDAAgD,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,yBAAyB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AAC,GAAG,CAAC;yBACzE,CAAC;oBACN,CAAC,CAAC,CAAC;gBACP,CAAC;gBACD,aAAa;aAChB,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {\r\n type MenuTriggerProps,\r\n Button,\r\n Divider,\r\n Toolbar as FluentToolbar,\r\n makeStyles,\r\n Menu,\r\n MenuGroup,\r\n MenuGroupHeader,\r\n MenuItem,\r\n MenuList,\r\n MenuPopover,\r\n MenuTrigger,\r\n mergeClasses,\r\n SplitButton,\r\n Subtitle2Stronger,\r\n tokens,\r\n ToolbarRadioButton,\r\n} from \"@fluentui/react-components\";\r\nimport { type ComponentType, type FunctionComponent, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\r\n\r\nimport { type IDisposable, type Nullable } from \"core/index\";\r\nimport { type IService, type ServiceDefinition } from \"../modularity/serviceDefinition\";\r\nimport { type SettingDescriptor } from \"./settingsStore\";\r\n\r\nimport {\r\n LayoutColumnTwoFocusLeftFilled,\r\n LayoutColumnTwoFocusRightFilled,\r\n LayoutColumnTwoSplitLeftFocusBottomLeftFilled,\r\n LayoutColumnTwoSplitLeftFocusTopLeftFilled,\r\n LayoutColumnTwoSplitRightFocusBottomRightFilled,\r\n LayoutColumnTwoSplitRightFocusTopRightFilled,\r\n MoreHorizontalRegular,\r\n PanelLeftContractRegular,\r\n PanelLeftExpandRegular,\r\n PanelRightContractRegular,\r\n PanelRightExpandRegular,\r\n PictureInPictureEnterRegular,\r\n} from \"@fluentui/react-icons\";\r\nimport { Fade as FluentFade } from \"@fluentui/react-motion-components-preview\";\r\n\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { ChildWindow } from \"shared-ui-components/fluent/hoc/childWindow\";\r\nimport { Collapse } from \"shared-ui-components/fluent/primitives/collapse\";\r\nimport { Tooltip } from \"shared-ui-components/fluent/primitives/tooltip\";\r\nimport { ErrorBoundary } from \"../components/errorBoundary\";\r\nimport { TeachingMoment } from \"../components/teachingMoment\";\r\nimport { Theme } from \"../components/theme\";\r\nimport { useOrderedObservableCollection } from \"../hooks/observableHooks\";\r\nimport { useSetting } from \"../hooks/settingsHooks\";\r\nimport { MakePopoverTeachingMoment } from \"../hooks/teachingMomentHooks\";\r\nimport { useResizeHandle } from \"../hooks/useResizeHandle\";\r\nimport { ObservableCollection } from \"../misc/observableCollection\";\r\n\r\n/**\r\n * Setting descriptor for persisting side pane dock location overrides.\r\n */\r\nexport const SidePaneDockOverridesSettingDescriptor: SettingDescriptor<\r\n Record<string, Readonly<{ horizontalLocation: HorizontalLocation; verticalLocation: VerticalLocation }> | undefined>\r\n> = {\r\n key: \"SidePaneDockOverrides\",\r\n defaultValue: {},\r\n};\r\n\r\n/**\r\n * Setting descriptor for persisting the left side pane width adjustment.\r\n */\r\nexport const LeftSidePaneWidthAdjustSettingDescriptor: SettingDescriptor<number> = {\r\n key: \"Shell/LeftPane/WidthAdjust\",\r\n defaultValue: 0,\r\n};\r\n\r\n/**\r\n * Setting descriptor for persisting the left side pane height adjustment.\r\n */\r\nexport const LeftSidePaneHeightAdjustSettingDescriptor: SettingDescriptor<number> = {\r\n key: \"Shell/LeftPane/HeightAdjust\",\r\n defaultValue: 0,\r\n};\r\n\r\n/**\r\n * Setting descriptor for persisting the right side pane width adjustment.\r\n */\r\nexport const RightSidePaneWidthAdjustSettingDescriptor: SettingDescriptor<number> = {\r\n key: \"Shell/RightPane/WidthAdjust\",\r\n defaultValue: 0,\r\n};\r\n\r\n/**\r\n * Setting descriptor for persisting the right side pane height adjustment.\r\n */\r\nexport const RightSidePaneHeightAdjustSettingDescriptor: SettingDescriptor<number> = {\r\n key: \"Shell/RightPane/HeightAdjust\",\r\n defaultValue: 0,\r\n};\r\n\r\n/**\r\n * Represents a horizontal location in the shell layout.\r\n */\r\nexport type HorizontalLocation = \"left\" | \"right\";\r\n\r\n/**\r\n * Represents a vertical location in the shell layout.\r\n */\r\nexport type VerticalLocation = \"top\" | \"bottom\";\r\n\r\ntype TeachingMomentInfo = boolean | { readonly title: string; readonly description: string };\r\n\r\ntype DockLocation = `${VerticalLocation}-${HorizontalLocation}` | `full-${HorizontalLocation}`;\r\n\r\n/**\r\n * Describes an item that can be added to one of the shell's toolbars.\r\n */\r\nexport type ToolbarItemDefinition = {\r\n /**\r\n * A unique key for the toolbar item.\r\n */\r\n key: string;\r\n\r\n /**\r\n * The component to render for the toolbar item.\r\n */\r\n component: ComponentType;\r\n\r\n /**\r\n * An optional order for the toolbar item, relative to other items.\r\n * Defaults to 0.\r\n */\r\n order?: number;\r\n\r\n /**\r\n * The horizontal location of the toolbar item.\r\n * Can be either \"left\" or \"right\".\r\n * In \"compact\" toolbar mode, \"left\" and \"right\" mean the \"compact\" toolbars at the top/bottom of the left/right side panes.\r\n * In \"full\" toolbar mode, \"left\" and \"right\" mean the left side and right side of the full width toolbars above/below the side panes.\r\n */\r\n horizontalLocation: HorizontalLocation;\r\n\r\n /**\r\n * The vertical location of the toolbar item.\r\n * Can be either \"top\" or \"bottom\".\r\n */\r\n verticalLocation: VerticalLocation;\r\n\r\n /**\r\n * An optional display name for the toolbar item, used for teaching moments, tooltips, etc.\r\n */\r\n displayName?: string;\r\n\r\n /**\r\n * An optional teaching moment info. The default assumes the toolbar item was added by an extension and provides a generic title and description based on the display name or id, which is helpful for discoverability of new items.\r\n * Set this to false to suppress the teaching moment, which may be desirable for built in items or items that are added in a non-dynamic way.\r\n * Set it to an object with a title and description to provide a custom teaching moment, which may be desirable if the generic title and description are not sufficient.\r\n * Teaching moments are more helpful for dynamically added items, possibly from extensions.\r\n */\r\n teachingMoment?: TeachingMomentInfo;\r\n};\r\n\r\n/**\r\n * Describes a side pane that can be added to the shell's left or right side.\r\n */\r\nexport type SidePaneDefinition = {\r\n /**\r\n * A unique key for the side pane.\r\n */\r\n key: string;\r\n\r\n /**\r\n * An icon component to render for the pane tab.\r\n */\r\n icon: ComponentType;\r\n\r\n /**\r\n * The component to render for the side pane's content.\r\n */\r\n content: ComponentType;\r\n\r\n /**\r\n * An optional order for the side pane, relative to other panes.\r\n * Defaults to 0.\r\n */\r\n order?: number;\r\n\r\n /**\r\n * The horizontal location of the side pane.\r\n * Can be either \"left\" or \"right\".\r\n */\r\n horizontalLocation: HorizontalLocation;\r\n\r\n /**\r\n * The vertical location of the side pane.\r\n * Can be either \"top\" or \"bottom\".\r\n */\r\n verticalLocation: VerticalLocation;\r\n\r\n /**\r\n * The title of the side pane, displayed as a standardized header at the top of the pane.\r\n */\r\n title: string;\r\n\r\n /**\r\n * An optional teaching moment info. The default assumes the side pane was added by an extension and provides a generic title and description based on the display name or id, which is helpful for discoverability of new items.\r\n * Set this to false to suppress the teaching moment, which may be desirable for built in items or items that are added in a non-dynamic way.\r\n * Set it to an object with a title and description to provide a custom teaching moment, which may be desirable if the generic title and description are not sufficient.\r\n * Teaching moments are more helpful for dynamically added panes, possibly from extensions.\r\n */\r\n teachingMoment?: TeachingMomentInfo;\r\n\r\n /**\r\n * Keep the pane mounted even when it is not visible. This is useful if you don't want the\r\n * user to lose the complex visual state when switching between tabs.\r\n */\r\n keepMounted?: boolean;\r\n};\r\n\r\ntype RegisteredSidePane = {\r\n readonly key: string;\r\n select(): void;\r\n};\r\n\r\ntype SidePaneContainer = {\r\n readonly isDocked: boolean;\r\n dock(): void;\r\n undock(): void;\r\n readonly isCollapsed: boolean;\r\n collapse(): void;\r\n expand(): void;\r\n};\r\n\r\n/**\r\n * Describes content that can be added to the shell's central area (between the side panes and toolbars - e.g. the main content).\r\n */\r\nexport type CentralContentDefinition = {\r\n /**\r\n * A unique key for the central content.\r\n */\r\n key: string;\r\n\r\n /**\r\n * The component to render for the central content.\r\n */\r\n component: ComponentType;\r\n\r\n /**\r\n * An optional order for content, relative to other central content.\r\n * Defaults to 0.\r\n */\r\n order?: number;\r\n};\r\n\r\n/**\r\n * The unique identity symbol for the root component service.\r\n */\r\nexport const RootComponentServiceIdentity = Symbol(\"RootComponent\");\r\n\r\n/**\r\n * Exposes a top level component that should be rendered as the React root.\r\n */\r\nexport interface IRootComponentService extends IService<typeof RootComponentServiceIdentity> {\r\n /**\r\n * The root component that should be rendered as the React root.\r\n */\r\n readonly rootComponent: ComponentType;\r\n}\r\n\r\n/**\r\n * The unique identity symbol for the shell service.\r\n */\r\nexport const ShellServiceIdentity = Symbol(\"ShellService\");\r\n\r\n/**\r\n * Provides a shell for the application, including toolbars, side panes, and central content.\r\n * This service allows adding toolbar items, side panes, and central content dynamically.\r\n */\r\nexport interface IShellService extends IService<typeof ShellServiceIdentity> {\r\n /**\r\n * Adds a new item to one of the shell's toolbars.\r\n * @param item Defines the item to add.\r\n */\r\n addToolbarItem(item: Readonly<ToolbarItemDefinition>): IDisposable;\r\n\r\n /**\r\n * Adds a new side pane to the shell.\r\n * @param pane Defines the side pane to add.\r\n */\r\n addSidePane(pane: Readonly<SidePaneDefinition>): IDisposable;\r\n\r\n /**\r\n * Adds new central content to the shell.\r\n * @param content Defines the content area to add.\r\n */\r\n addCentralContent(content: Readonly<CentralContentDefinition>): IDisposable;\r\n\r\n /**\r\n * The left side pane container.\r\n */\r\n readonly leftSidePaneContainer: Nullable<SidePaneContainer>;\r\n\r\n /**\r\n * The right side pane container.\r\n */\r\n readonly rightSidePaneContainer: Nullable<SidePaneContainer>;\r\n\r\n /**\r\n * The side panes currently present in the shell.\r\n */\r\n readonly sidePanes: readonly RegisteredSidePane[];\r\n}\r\n\r\ntype ToolbarMode = \"full\" | \"compact\";\r\n\r\n/**\r\n * Options for configuring the shell service.\r\n */\r\nexport type ShellServiceOptions = {\r\n /**\r\n * The default width of the left side pane.\r\n */\r\n leftPaneDefaultWidth?: number;\r\n\r\n /**\r\n * The minimum width of the left side pane.\r\n */\r\n leftPaneMinWidth?: number;\r\n\r\n /**\r\n * The default width of the right side pane.\r\n */\r\n rightPaneDefaultWidth?: number;\r\n\r\n /**\r\n * The minimum width of the right side pane.\r\n */\r\n rightPaneMinWidth?: number;\r\n\r\n /**\r\n * The mode of the toolbars.\r\n * Can be either \"full\" (default) or \"compact\".\r\n * In \"full\" mode, toolbars are displayed above and below the side panes.\r\n * In \"compact\" mode, toolbars are displayed at the top and bottom of the left and right side panes.\r\n */\r\n toolbarMode?: ToolbarMode;\r\n\r\n /**\r\n * Whether the left side pane should start collapsed. Default is false.\r\n */\r\n leftPaneDefaultCollapsed?: boolean;\r\n\r\n /**\r\n * Whether the right side pane should start collapsed. Default is false.\r\n */\r\n rightPaneDefaultCollapsed?: boolean;\r\n\r\n /**\r\n * A function that can remap the default location of side panes.\r\n * @param sidePane The side pane to remap.\r\n * @returns The new location for the side pane.\r\n */\r\n sidePaneRemapper?: (sidePane: Readonly<SidePaneDefinition>) => Nullable<{ horizontalLocation: HorizontalLocation; verticalLocation: VerticalLocation }>;\r\n};\r\n\r\nconst useStyles = makeStyles({\r\n mainView: {\r\n flex: 1,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n overflow: \"hidden\",\r\n backgroundColor: tokens.colorTransparentBackground,\r\n },\r\n verticallyCentralContent: {\r\n flexGrow: 1,\r\n display: \"flex\",\r\n overflow: \"hidden\",\r\n backgroundColor: tokens.colorTransparentBackground,\r\n },\r\n barDiv: {\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n flex: \"0 0 auto\",\r\n height: \"36px\",\r\n backgroundColor: tokens.colorNeutralBackground2,\r\n pointerEvents: \"auto\",\r\n },\r\n bar: {\r\n display: \"flex\",\r\n flex: \"1\",\r\n overflow: \"hidden\",\r\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalXXS}`,\r\n borderBottom: `1px solid ${tokens.colorNeutralStroke2}`,\r\n backgroundColor: tokens.colorNeutralBackground2,\r\n },\r\n barTop: {\r\n borderTopWidth: 0,\r\n },\r\n barBottom: {\r\n borderTop: `1px solid ${tokens.colorNeutralStroke2}`,\r\n },\r\n barLeft: {\r\n marginRight: \"auto\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n flexDirection: \"row\",\r\n columnGap: tokens.spacingHorizontalSNudge,\r\n },\r\n barRight: {\r\n marginLeft: \"auto\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n flexDirection: \"row-reverse\",\r\n columnGap: tokens.spacingHorizontalSNudge,\r\n },\r\n barItem: {\r\n display: \"flex\",\r\n },\r\n paneTabListDiv: {\r\n backgroundColor: tokens.colorNeutralBackground1,\r\n flex: \"0 0 auto\",\r\n display: \"flex\",\r\n },\r\n paneTabListDivLeft: {\r\n flexDirection: \"row-reverse\",\r\n },\r\n paneTabListDivRight: {\r\n flexDirection: \"row\",\r\n },\r\n paneCollapseButton: {\r\n padding: `0 0 0 ${tokens.spacingHorizontalXS}`,\r\n borderBottom: `1px solid ${tokens.colorNeutralStroke2}`,\r\n },\r\n paneCollapseButtonWithBorder: {\r\n borderLeft: `1px solid ${tokens.colorNeutralStroke2}`,\r\n },\r\n collapseMenuPopover: {\r\n minWidth: 0,\r\n },\r\n pane: {\r\n backgroundColor: tokens.colorNeutralBackground2,\r\n display: \"flex\",\r\n flex: 1,\r\n alignItems: \"stretch\",\r\n overflow: \"hidden\",\r\n },\r\n paneLeft: {\r\n flexDirection: \"row\",\r\n },\r\n paneRight: {\r\n flexDirection: \"row-reverse\",\r\n },\r\n paneContainer: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n overflowX: \"hidden\",\r\n overflowY: \"hidden\",\r\n zIndex: 1,\r\n pointerEvents: \"auto\",\r\n },\r\n paneContent: {\r\n display: \"flex\",\r\n flexGrow: 1,\r\n flexDirection: \"column\",\r\n overflow: \"hidden\",\r\n },\r\n unselectedPane: {\r\n display: \"none\",\r\n },\r\n paneHeaderDiv: {\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n height: \"36px\",\r\n backgroundColor: tokens.colorNeutralBackground1,\r\n color: tokens.colorNeutralForeground1,\r\n },\r\n paneHeaderText: {\r\n flex: 1,\r\n },\r\n paneHeaderTextNoIcon: {\r\n marginLeft: tokens.spacingHorizontalM,\r\n },\r\n paneHeaderIcon: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n height: \"100%\",\r\n aspectRatio: \"1\",\r\n fontSize: \"20px\",\r\n },\r\n paneHeaderButton: {\r\n color: \"inherit\",\r\n },\r\n paneDivider: {\r\n flex: \"0 0 auto\",\r\n marginTop: tokens.spacingVerticalM,\r\n margin: \"0\",\r\n minHeight: tokens.spacingVerticalM,\r\n cursor: \"ns-resize\",\r\n alignItems: \"end\",\r\n },\r\n tabToolbar: {\r\n padding: 0,\r\n borderLeft: `1px solid ${tokens.colorNeutralStroke2}`,\r\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\r\n },\r\n tab: {\r\n display: \"flex\",\r\n height: \"100%\",\r\n boxSizing: \"border-box\",\r\n justifyContent: \"center\",\r\n border: `1px solid ${tokens.colorNeutralStroke2}`,\r\n borderTop: \"none\",\r\n },\r\n firstTab: {\r\n borderLeftColor: \"transparent\",\r\n },\r\n lastTab: {\r\n borderRightColor: \"transparent\",\r\n },\r\n selectedTab: {\r\n borderBottom: \"none\",\r\n },\r\n unselectedTab: {\r\n borderLeftColor: \"transparent\",\r\n borderRightColor: \"transparent\",\r\n },\r\n tabRadioButton: {\r\n backgroundColor: \"transparent\",\r\n borderRadius: 0,\r\n },\r\n resizer: {\r\n width: \"8px\",\r\n cursor: \"ew-resize\",\r\n zIndex: 1000,\r\n },\r\n resizerLeft: {\r\n marginRight: \"-8px\",\r\n transform: \"translateX(-8px)\",\r\n },\r\n resizerRight: {\r\n marginLeft: \"-8px\",\r\n transform: \"translateX(8px)\",\r\n },\r\n centralContent: {\r\n position: \"relative\",\r\n flexGrow: 1,\r\n display: \"flex\",\r\n overflow: \"hidden\",\r\n backgroundColor: tokens.colorTransparentBackground,\r\n \"> *\": {\r\n pointerEvents: \"auto\",\r\n },\r\n },\r\n expandButtonContainer: {\r\n position: \"absolute\",\r\n },\r\n expandButtonContainerLeft: {\r\n left: 0,\r\n },\r\n expandButtonContainerRight: {\r\n right: 0,\r\n },\r\n expandButton: {},\r\n});\r\n\r\nconst DockMenu: FunctionComponent<\r\n Pick<MenuTriggerProps, \"children\"> & { openOnContext?: boolean; sidePaneId: string; dockOptions: Map<DockLocation, (sidePaneKey: string) => void> }\r\n> = (props) => {\r\n const { openOnContext, sidePaneId, dockOptions, children } = props;\r\n\r\n const dockLeft = dockOptions.get(\"full-left\");\r\n const dockTopLeft = dockOptions.get(\"top-left\");\r\n const dockBottomLeft = dockOptions.get(\"bottom-left\");\r\n const dockRight = dockOptions.get(\"full-right\");\r\n const dockTopRight = dockOptions.get(\"top-right\");\r\n const dockBottomRight = dockOptions.get(\"bottom-right\");\r\n\r\n return (\r\n <Menu openOnContext={openOnContext}>\r\n <MenuTrigger disableButtonEnhancement>{children}</MenuTrigger>\r\n <Theme>\r\n <MenuPopover>\r\n <MenuList>\r\n <MenuGroup>\r\n <MenuGroupHeader>Dock</MenuGroupHeader>\r\n {dockLeft && (\r\n <MenuItem icon={<LayoutColumnTwoFocusLeftFilled />} onClick={() => dockLeft(sidePaneId)}>\r\n Left\r\n </MenuItem>\r\n )}\r\n {dockTopLeft && (\r\n <MenuItem icon={<LayoutColumnTwoSplitLeftFocusTopLeftFilled />} onClick={() => dockTopLeft(sidePaneId)}>\r\n Top Left\r\n </MenuItem>\r\n )}\r\n {dockBottomLeft && (\r\n <MenuItem icon={<LayoutColumnTwoSplitLeftFocusBottomLeftFilled />} onClick={() => dockBottomLeft(sidePaneId)}>\r\n Bottom Left\r\n </MenuItem>\r\n )}\r\n {dockRight && (\r\n <MenuItem icon={<LayoutColumnTwoFocusRightFilled />} onClick={() => dockRight(sidePaneId)}>\r\n Right\r\n </MenuItem>\r\n )}\r\n {dockTopRight && (\r\n <MenuItem icon={<LayoutColumnTwoSplitRightFocusTopRightFilled />} onClick={() => dockTopRight(sidePaneId)}>\r\n Top Right\r\n </MenuItem>\r\n )}\r\n {dockBottomRight && (\r\n <MenuItem icon={<LayoutColumnTwoSplitRightFocusBottomRightFilled />} onClick={() => dockBottomRight(sidePaneId)}>\r\n Bottom Right\r\n </MenuItem>\r\n )}\r\n </MenuGroup>\r\n </MenuList>\r\n </MenuPopover>\r\n </Theme>\r\n </Menu>\r\n );\r\n};\r\n\r\nconst PaneHeader: FunctionComponent<{ id: string; title: string; icon?: ComponentType; dockOptions: Map<DockLocation, (sidePaneKey: string) => void> }> = (props) => {\r\n const { id, title, dockOptions } = props;\r\n\r\n const classes = useStyles();\r\n\r\n return (\r\n <div className={classes.paneHeaderDiv}>\r\n {props.icon && (\r\n <div className={classes.paneHeaderIcon}>\r\n <props.icon />\r\n </div>\r\n )}\r\n <Subtitle2Stronger className={mergeClasses(classes.paneHeaderText, !props.icon && classes.paneHeaderTextNoIcon)}>{title}</Subtitle2Stronger>\r\n <DockMenu sidePaneId={id} dockOptions={dockOptions}>\r\n <Button className={classes.paneHeaderButton} appearance=\"transparent\" icon={<MoreHorizontalRegular />} />\r\n </DockMenu>\r\n </div>\r\n );\r\n};\r\n\r\n// This is a wrapper for an item in a toolbar that simply adds a teaching moment, which is useful for dynamically added items, possibly from extensions.\r\nconst ToolbarItem: FunctionComponent<{\r\n verticalLocation: VerticalLocation;\r\n horizontalLocation: HorizontalLocation;\r\n id: string;\r\n component: ComponentType;\r\n displayName?: string;\r\n teachingMoment?: TeachingMomentInfo;\r\n}> = (props) => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const { verticalLocation, horizontalLocation, id, component: Component, displayName } = props;\r\n const classes = useStyles();\r\n\r\n const useTeachingMoment = useMemo(() => MakePopoverTeachingMoment(`Bar/${verticalLocation}/${horizontalLocation}/${displayName ?? id}`), [displayName, id]);\r\n const teachingMoment = useTeachingMoment(props.teachingMoment === false);\r\n\r\n const title = typeof props.teachingMoment === \"object\" ? props.teachingMoment.title : (displayName ?? id);\r\n const description = typeof props.teachingMoment === \"object\" ? props.teachingMoment.description : `The \"${displayName ?? id}\" extension can be accessed here.`;\r\n\r\n return (\r\n <>\r\n <TeachingMoment {...teachingMoment} shouldDisplay={teachingMoment.shouldDisplay} title={title} description={description} />\r\n <div className={classes.barItem} ref={teachingMoment.targetRef}>\r\n <Component />\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\n// TODO: Handle overflow, possibly via https://react.fluentui.dev/?path=/docs/components-overflow--docs with priority.\r\n// This component just renders a toolbar with left aligned toolbar items on the left and right aligned toolbar items on the right.\r\nconst Toolbar: FunctionComponent<{ location: VerticalLocation; components: Readonly<ToolbarItemDefinition[]> }> = ({ location, components }) => {\r\n const classes = useStyles();\r\n\r\n const leftComponents = useMemo(() => components.filter((entry) => entry.horizontalLocation === \"left\"), [components]);\r\n const rightComponents = useMemo(() => components.filter((entry) => entry.horizontalLocation === \"right\"), [components]);\r\n\r\n return (\r\n <>\r\n {components.length > 0 && (\r\n <div className={`${classes.bar} ${location === \"top\" ? classes.barTop : classes.barBottom}`}>\r\n <div className={classes.barLeft}>\r\n {leftComponents.map((entry) => (\r\n <ToolbarItem\r\n key={entry.key}\r\n verticalLocation={location}\r\n horizontalLocation={entry.horizontalLocation}\r\n id={entry.key}\r\n component={entry.component}\r\n displayName={entry.displayName}\r\n teachingMoment={entry.teachingMoment}\r\n />\r\n ))}\r\n </div>\r\n <div className={classes.barRight}>\r\n {rightComponents.map((entry) => (\r\n <ToolbarItem\r\n key={entry.key}\r\n verticalLocation={location}\r\n horizontalLocation={entry.horizontalLocation}\r\n id={entry.key}\r\n component={entry.component}\r\n displayName={entry.displayName}\r\n teachingMoment={entry.teachingMoment}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\n// This is a wrapper for a tab in a side pane that simply adds a teaching moment, which is useful for dynamically added items, possibly from extensions.\r\nconst SidePaneTab: FunctionComponent<\r\n { location: HorizontalLocation; id: string; isSelected: boolean; isFirst: boolean; isLast: boolean; dockOptions: Map<DockLocation, (sidePaneKey: string) => void> } & Pick<\r\n Readonly<SidePaneDefinition>,\r\n \"title\" | \"icon\" | \"teachingMoment\"\r\n >\r\n> = (props) => {\r\n const {\r\n location,\r\n id,\r\n isSelected,\r\n isFirst,\r\n isLast,\r\n dockOptions,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n icon: Icon,\r\n title,\r\n } = props;\r\n const classes = useStyles();\r\n const useTeachingMoment = useMemo(() => MakePopoverTeachingMoment(`Pane/${location}/${title ?? id}`), [title, id]);\r\n const teachingMoment = useTeachingMoment(props.teachingMoment === false);\r\n\r\n const tabClass = mergeClasses(\r\n classes.tab,\r\n isSelected ? classes.selectedTab : classes.unselectedTab,\r\n isFirst ? classes.firstTab : undefined,\r\n isLast ? classes.lastTab : undefined\r\n );\r\n\r\n return (\r\n <>\r\n <TeachingMoment\r\n {...teachingMoment}\r\n shouldDisplay={teachingMoment.shouldDisplay}\r\n title={typeof props.teachingMoment === \"object\" ? props.teachingMoment.title : (title ?? \"Extension\")}\r\n description={typeof props.teachingMoment === \"object\" ? props.teachingMoment.description : `The \"${title ?? id}\" extension can be accessed here.`}\r\n />\r\n <div className={tabClass}>\r\n <DockMenu openOnContext sidePaneId={id} dockOptions={dockOptions}>\r\n <Tooltip content={title ?? id}>\r\n <ToolbarRadioButton\r\n ref={teachingMoment.targetRef}\r\n appearance=\"transparent\"\r\n className={classes.tabRadioButton}\r\n name=\"selectedTab\"\r\n value={id}\r\n icon={{\r\n children: <Icon />,\r\n }}\r\n />\r\n </Tooltip>\r\n </DockMenu>\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\n// This hook provides a side pane container and the tab list.\r\n// In \"compact\" mode, the tab list is integrated into the pane itself.\r\n// In \"full\" mode, the returned tab list is later injected into the toolbar.\r\nfunction usePane(\r\n location: HorizontalLocation,\r\n defaultWidth: number,\r\n minWidth: number,\r\n sidePanes: SidePaneDefinition[],\r\n onSelectSidePane: Observable<string>,\r\n dockOperations: Map<DockLocation, (sidePaneKey: string) => void>,\r\n toolbarMode: ToolbarMode,\r\n topBarItems: Readonly<ToolbarItemDefinition[]>,\r\n bottomBarItems: Readonly<ToolbarItemDefinition[]>,\r\n initialCollapsed: boolean\r\n) {\r\n const classes = useStyles();\r\n\r\n const [topSelectedTab, setTopSelectedTab] = useState<SidePaneDefinition>();\r\n const [bottomSelectedTab, setBottomSelectedTab] = useState<SidePaneDefinition>();\r\n const [collapsed, setCollapsed] = useState(initialCollapsed);\r\n const childWindow = useRef<ChildWindow>(null);\r\n const [isChildWindowOpen, setIsChildWindowOpen] = useState(false);\r\n const paneContainerRef = useRef<HTMLDivElement>(null);\r\n\r\n const onExpandCollapseClick = useCallback(() => {\r\n setCollapsed((collapsed) => !collapsed);\r\n }, []);\r\n\r\n const [paneWidthSetting, setPaneWidthSetting] = useSetting(location === \"left\" ? LeftSidePaneWidthAdjustSettingDescriptor : RightSidePaneWidthAdjustSettingDescriptor);\r\n const [paneHeightSetting, setPaneHeightSetting] = useSetting(location === \"left\" ? LeftSidePaneHeightAdjustSettingDescriptor : RightSidePaneHeightAdjustSettingDescriptor);\r\n\r\n const currentSidePanes = useMemo(() => sidePanes.filter((entry) => entry.horizontalLocation === location), [sidePanes, location]);\r\n const topPanes = useMemo(() => currentSidePanes.filter((entry) => entry.verticalLocation === \"top\"), [currentSidePanes]);\r\n const bottomPanes = useMemo(() => currentSidePanes.filter((entry) => entry.verticalLocation === \"bottom\"), [currentSidePanes]);\r\n\r\n const getValidDockOperations = useCallback(\r\n (verticalLocation: VerticalLocation) => {\r\n const validDockOperations = new Map(dockOperations);\r\n\r\n // Can't re-dock to the current location.\r\n validDockOperations.delete(`${verticalLocation}-${location}`);\r\n\r\n // Full would mean there are no bottom panes, so this is also re-docking to the current location.\r\n validDockOperations.delete(`full-${location}`);\r\n\r\n // If there is only one pane left, it can't be docked to the bottom (as this would leave no top panes).\r\n if (currentSidePanes.length === 1) {\r\n validDockOperations.delete(`bottom-${location}`);\r\n }\r\n\r\n return validDockOperations;\r\n },\r\n [location, dockOperations, currentSidePanes]\r\n );\r\n\r\n const validTopDockOptions = useMemo(() => getValidDockOperations(\"top\"), [getValidDockOperations]);\r\n const validBottomDockOptions = useMemo(() => getValidDockOperations(\"bottom\"), [getValidDockOperations]);\r\n\r\n // Selects a default top tab (during initialization or if the selected tab is removed).\r\n useEffect(() => {\r\n if ((topSelectedTab && !topPanes.includes(topSelectedTab)) || (!topSelectedTab && topPanes.length > 0)) {\r\n setTopSelectedTab(topPanes[0]);\r\n } else if (topSelectedTab && topPanes.length === 0) {\r\n setTopSelectedTab(undefined);\r\n }\r\n }, [topSelectedTab, topPanes]);\r\n\r\n // Selects a default bottom tab (during initialization or if the selected tab is removed).\r\n useEffect(() => {\r\n if ((bottomSelectedTab && !bottomPanes.includes(bottomSelectedTab)) || (!bottomSelectedTab && bottomPanes.length > 0)) {\r\n setBottomSelectedTab(bottomPanes[0]);\r\n } else if (bottomSelectedTab && bottomPanes.length === 0) {\r\n setBottomSelectedTab(undefined);\r\n }\r\n }, [bottomSelectedTab, bottomPanes]);\r\n\r\n // Selects a tab when explicitly requested.\r\n useEffect(() => {\r\n const observer = onSelectSidePane.add((key) => {\r\n const topPane = topPanes.find((entry) => entry.key === key);\r\n if (topPane) {\r\n setTopSelectedTab(topPane);\r\n setCollapsed(false);\r\n }\r\n\r\n const bottomPane = bottomPanes.find((entry) => entry.key === key);\r\n if (bottomPane) {\r\n setBottomSelectedTab(bottomPane);\r\n setCollapsed(false);\r\n }\r\n });\r\n\r\n return () => observer.remove();\r\n }, [topPanes, bottomPanes, onSelectSidePane]);\r\n\r\n const setUndocked = useCallback(\r\n (undocked: boolean) => {\r\n if (!undocked) {\r\n childWindow.current?.close();\r\n } else {\r\n const paneContainer = paneContainerRef.current;\r\n if (!paneContainer) {\r\n // It shouldn't be possible to get here and have this ref be null, but just in case,\r\n // bail out of the undock operation.\r\n childWindow.current?.close();\r\n } else {\r\n // This is the extra buffer needed on top of minWidth to account for window chrome to avoid a horizontal scrollbar.\r\n const widthBuffer = 4;\r\n // This offsets the window's top position to account for window chrome/title bar.\r\n const topOffset = 100;\r\n\r\n // Create the child window with approximately the same location and size as the side pane.\r\n const bounds = paneContainer.getBoundingClientRect();\r\n\r\n childWindow.current?.open({\r\n defaultWidth: Math.max(bounds.width, minWidth + widthBuffer),\r\n defaultHeight: bounds.height - topOffset,\r\n defaultTop: bounds.top + window.screenY + topOffset,\r\n defaultLeft: bounds.left + window.screenX,\r\n title: location === \"left\" ? \"Left\" : \"Right\",\r\n });\r\n }\r\n }\r\n },\r\n [childWindow, location]\r\n );\r\n\r\n const expandCollapseButton = useMemo(() => {\r\n const expandCollapseIcon =\r\n location === \"left\" ? collapsed ? <PanelLeftExpandRegular /> : <PanelLeftContractRegular /> : collapsed ? <PanelRightExpandRegular /> : <PanelRightContractRegular />;\r\n\r\n return (\r\n <Menu positioning=\"below-end\">\r\n <MenuTrigger disableButtonEnhancement={true}>\r\n {(triggerProps) => (\r\n <Tooltip content={collapsed ? \"Show Side Pane\" : \"Hide Side Pane\"}>\r\n <SplitButton\r\n className={mergeClasses(\r\n classes.paneCollapseButton,\r\n location === \"right\" && toolbarMode === \"compact\" ? classes.paneCollapseButtonWithBorder : undefined\r\n )}\r\n menuButton={triggerProps}\r\n primaryActionButton={{ onClick: onExpandCollapseClick }}\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n icon={expandCollapseIcon}\r\n />\r\n </Tooltip>\r\n )}\r\n </MenuTrigger>\r\n <MenuPopover className={classes.collapseMenuPopover}>\r\n <MenuList>\r\n <MenuItem icon={<PictureInPictureEnterRegular />} onClick={() => setUndocked(true)}>\r\n Undock\r\n </MenuItem>\r\n </MenuList>\r\n </MenuPopover>\r\n </Menu>\r\n );\r\n }, [collapsed, onExpandCollapseClick, location]);\r\n\r\n const createPaneTabList = useCallback(\r\n (\r\n paneComponents: SidePaneDefinition[],\r\n toolbarMode: \"full\" | \"compact\",\r\n selectedTab: SidePaneDefinition | undefined,\r\n setSelectedTab: (tab: SidePaneDefinition | undefined) => void,\r\n dockOptions: Map<DockLocation, (sidePaneKey: string) => void>\r\n ) => {\r\n return (\r\n <>\r\n {paneComponents.length > 0 && (\r\n <div className={`${classes.paneTabListDiv} ${location === \"left\" || toolbarMode === \"compact\" ? classes.paneTabListDivLeft : classes.paneTabListDivRight}`}>\r\n {/* Only render the tab list if there is more than tab. It's kind of pointless to show a tab list with just one tab. */}\r\n {paneComponents.length > 1 && (\r\n <>\r\n <FluentToolbar\r\n className={classes.tabToolbar}\r\n checkedValues={{ selectedTab: [selectedTab?.key ?? \"\"] }}\r\n onCheckedValueChange={(event, data) => {\r\n const tab = paneComponents.find((entry) => entry.key === data.checkedItems[0]);\r\n setSelectedTab(tab);\r\n setCollapsed(false);\r\n }}\r\n >\r\n {paneComponents.map((entry, index) => {\r\n const isSelected = selectedTab?.key === entry.key;\r\n return (\r\n <SidePaneTab\r\n key={entry.key}\r\n location={location}\r\n id={entry.key}\r\n title={entry.title}\r\n icon={entry.icon}\r\n teachingMoment={entry.teachingMoment}\r\n isSelected={isSelected && !collapsed}\r\n isFirst={index === 0}\r\n isLast={index === paneComponents.length - 1}\r\n dockOptions={dockOptions}\r\n />\r\n );\r\n })}\r\n </FluentToolbar>\r\n </>\r\n )}\r\n\r\n {/* When the toolbar mode is \"full\", we add an extra button that allows the side panes to be collapsed. */}\r\n {toolbarMode === \"full\" && (\r\n <Collapse visible={!isChildWindowOpen} orientation=\"horizontal\">\r\n {expandCollapseButton}\r\n </Collapse>\r\n )}\r\n </div>\r\n )}\r\n </>\r\n );\r\n },\r\n [location, collapsed, isChildWindowOpen, expandCollapseButton]\r\n );\r\n\r\n // This memos the TabList to make it easy for the JSX to be inserted at the top of the pane (in \"compact\" mode) or returned to the caller to be used in the toolbar (in \"full\" mode).\r\n const topPaneTabList = useMemo(\r\n () => createPaneTabList(topPanes, toolbarMode, topSelectedTab, setTopSelectedTab, validTopDockOptions),\r\n [createPaneTabList, topPanes, toolbarMode, topSelectedTab]\r\n );\r\n const bottomPaneTabList = useMemo(\r\n () => createPaneTabList(bottomPanes, \"compact\", bottomSelectedTab, setBottomSelectedTab, validBottomDockOptions),\r\n [createPaneTabList, bottomPanes, bottomSelectedTab]\r\n );\r\n\r\n // This manages the CSS variable that controls the width of the side pane.\r\n const paneWidthAdjustCSSVar = \"--pane-width-adjust\";\r\n const {\r\n elementRef: paneHorizontalResizeElementRef,\r\n handleRef: paneHorizontalResizeHandleRef,\r\n setValue: setPaneWidthAdjust,\r\n } = useResizeHandle({\r\n growDirection: location === \"left\" ? \"end\" : \"start\",\r\n variableName: paneWidthAdjustCSSVar,\r\n minValue: minWidth - defaultWidth,\r\n onChange: (value) => {\r\n // Whenever the width is adjusted, store the value.\r\n setPaneWidthSetting(value);\r\n },\r\n });\r\n\r\n // This manages the CSS variable that controls the height of the bottom pane.\r\n const paneHeightAdjustCSSVar = \"--pane-height-adjust\";\r\n const {\r\n elementRef: paneVerticalResizeElementRef,\r\n handleRef: paneVerticalResizeHandleRef,\r\n setValue: setPaneHeightAdjust,\r\n } = useResizeHandle({\r\n growDirection: \"up\",\r\n variableName: paneHeightAdjustCSSVar,\r\n onChange: (value) => {\r\n // Whenever the height is adjusted, store the value.\r\n setPaneHeightSetting(value);\r\n },\r\n });\r\n\r\n // This ensures that when the component is first rendered, the CSS variable is set from storage.\r\n useLayoutEffect(() => {\r\n setPaneWidthAdjust(paneWidthSetting);\r\n setPaneHeightAdjust(paneHeightSetting);\r\n }, [paneWidthSetting, paneHeightSetting]);\r\n\r\n // This effect closes the window if all panes have been removed.\r\n useEffect(() => {\r\n if (isChildWindowOpen && topPanes.length === 0 && bottomPanes.length === 0) {\r\n childWindow.current?.close();\r\n }\r\n }, [childWindow, isChildWindowOpen, topPanes, bottomPanes]);\r\n\r\n // This memoizes the pane itself, which may or may not include the tab list, depending on the toolbar mode.\r\n const corePane = useMemo(() => {\r\n return (\r\n <>\r\n {/* If toolbar mode is \"compact\" then the top toolbar is embedded at the top of the pane. */}\r\n {toolbarMode === \"compact\" && (topPanes.length > 1 || topBarItems.length > 0) && (\r\n <>\r\n <div className={classes.barDiv}>\r\n {/* The tablist gets merged in with the toolbar. */}\r\n {!isChildWindowOpen && location === \"left\" && expandCollapseButton}\r\n {topPaneTabList}\r\n <Toolbar location=\"top\" components={topBarItems} />\r\n {!isChildWindowOpen && location === \"right\" && expandCollapseButton}\r\n </div>\r\n </>\r\n )}\r\n\r\n {/* Render the top pane content. */}\r\n {topPanes.length > 0 && (\r\n <div className={classes.paneContent}>\r\n {topSelectedTab && (\r\n <>\r\n <PaneHeader\r\n id={topSelectedTab.key}\r\n title={topSelectedTab.title}\r\n icon={topPanes.length > 1 ? undefined : topSelectedTab.icon}\r\n dockOptions={validTopDockOptions}\r\n />\r\n {/* Render all panes to retain their state even when they are not selected, but only display the selected pane. */}\r\n {topPanes\r\n .filter((pane) => pane.key === topSelectedTab.key || pane.keepMounted)\r\n .map((pane) => (\r\n <div key={pane.key} className={mergeClasses(classes.paneContent, pane.key !== topSelectedTab.key ? classes.unselectedPane : undefined)}>\r\n <ErrorBoundary name={pane.title}>\r\n <pane.content />\r\n </ErrorBoundary>\r\n </div>\r\n ))}\r\n </>\r\n )}\r\n </div>\r\n )}\r\n\r\n {/* If we have both top and bottom panes, show a divider. This divider is also the resizer for the bottom pane. */}\r\n {topPanes.length > 0 && bottomPanes.length > 0 && <Divider ref={paneVerticalResizeHandleRef} className={classes.paneDivider} />}\r\n\r\n {/* Render the bottom pane tablist. */}\r\n {bottomPanes.length > 1 && (\r\n <>\r\n <div className={classes.barDiv}>{bottomPaneTabList}</div>\r\n </>\r\n )}\r\n\r\n {/* Render the bottom pane content. This is the element that can be resized vertically. */}\r\n {bottomPanes.length > 0 && (\r\n <div\r\n ref={paneVerticalResizeElementRef}\r\n className={classes.paneContent}\r\n style={{ height: `clamp(200px, calc(45% + var(${paneHeightAdjustCSSVar}, 0px)), 100% - 300px)`, flex: \"0 0 auto\" }}\r\n >\r\n {bottomSelectedTab && (\r\n <>\r\n <PaneHeader\r\n id={bottomSelectedTab.key}\r\n title={bottomSelectedTab.title}\r\n icon={bottomPanes.length > 1 ? undefined : bottomSelectedTab.icon}\r\n dockOptions={validBottomDockOptions}\r\n />\r\n {/* Render all panes to retain their state even when they are not selected, but only display the selected pane. */}\r\n {bottomPanes\r\n .filter((pane) => pane.key === bottomSelectedTab.key || pane.keepMounted)\r\n .map((pane) => (\r\n <div key={pane.key} className={mergeClasses(classes.paneContent, pane.key !== bottomSelectedTab.key ? classes.unselectedPane : undefined)}>\r\n <ErrorBoundary name={pane.title}>\r\n <pane.content />\r\n </ErrorBoundary>\r\n </div>\r\n ))}\r\n </>\r\n )}\r\n </div>\r\n )}\r\n\r\n {/* If toolbar mode is \"compact\" then the bottom toolbar is embedded at the bottom of the pane. */}\r\n {toolbarMode === \"compact\" && bottomBarItems.length > 0 && (\r\n <>\r\n <div className={classes.barDiv}>\r\n <Toolbar location=\"bottom\" components={bottomBarItems} />\r\n </div>\r\n </>\r\n )}\r\n </>\r\n );\r\n }, [\r\n topPanes,\r\n topSelectedTab,\r\n validTopDockOptions,\r\n bottomPanes,\r\n bottomSelectedTab,\r\n validBottomDockOptions,\r\n topBarItems,\r\n bottomBarItems,\r\n topPaneTabList,\r\n bottomPaneTabList,\r\n isChildWindowOpen,\r\n ]);\r\n\r\n // This deals with docked vs undocked state, where undocked is rendered into a separate window via a portal.\r\n const pane = useMemo(() => {\r\n return (\r\n <>\r\n {/* If there is no window state, then we are docked, so render the resizable div and the collapse container. */}\r\n {!isChildWindowOpen && (\r\n <div ref={paneContainerRef} className={classes.paneContainer}>\r\n {(topPanes.length > 0 || bottomPanes.length > 0) && (\r\n <div className={`${classes.pane} ${location === \"left\" ? classes.paneLeft : classes.paneRight}`}>\r\n <Collapse orientation=\"horizontal\" visible={!collapsed}>\r\n <div\r\n ref={paneHorizontalResizeElementRef}\r\n className={classes.paneContainer}\r\n style={{ width: `clamp(${minWidth}px, calc(${defaultWidth}px + var(${paneWidthAdjustCSSVar}, 0px)), 1000px)` }}\r\n >\r\n {corePane}\r\n </div>\r\n </Collapse>\r\n {/* This is the resizer (width) for the pane container. */}\r\n <div\r\n ref={paneHorizontalResizeHandleRef}\r\n className={`${classes.resizer} ${location === \"left\" ? classes.resizerLeft : classes.resizerRight}`}\r\n style={{ pointerEvents: `${collapsed ? \"none\" : \"auto\"}` }}\r\n />\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n <ChildWindow imperativeRef={childWindow} onOpenChange={(isOpen) => setIsChildWindowOpen(isOpen)}>\r\n {corePane}\r\n </ChildWindow>\r\n </>\r\n );\r\n }, [collapsed, corePane]);\r\n\r\n const hasPanes = topPanes.length > 0 || bottomPanes.length > 0;\r\n\r\n return [topPaneTabList, pane, collapsed, setCollapsed, isChildWindowOpen, setUndocked, hasPanes] as const;\r\n}\r\n\r\nexport function MakeShellServiceDefinition({\r\n leftPaneDefaultWidth = 350,\r\n leftPaneMinWidth = 350,\r\n rightPaneDefaultWidth = 350,\r\n rightPaneMinWidth = 350,\r\n leftPaneDefaultCollapsed = false,\r\n rightPaneDefaultCollapsed = false,\r\n toolbarMode = \"full\",\r\n sidePaneRemapper = undefined,\r\n}: ShellServiceOptions = {}): ServiceDefinition<[IShellService, IRootComponentService], []> {\r\n return {\r\n friendlyName: \"Shell Service\",\r\n produces: [ShellServiceIdentity, RootComponentServiceIdentity],\r\n factory: () => {\r\n const toolbarItemCollection = new ObservableCollection<Readonly<ToolbarItemDefinition>>();\r\n const sidePaneCollection = new ObservableCollection<Readonly<SidePaneDefinition>>();\r\n const centralContentCollection = new ObservableCollection<Readonly<CentralContentDefinition>>();\r\n\r\n const onSelectSidePane = new Observable<string>(undefined, true);\r\n\r\n const onDockChanged = new Observable<{ location: HorizontalLocation; dock: boolean }>(undefined, true);\r\n const onCollapseChanged = new Observable<{ location: HorizontalLocation; collapsed: boolean }>();\r\n const leftSidePaneContainerState = {\r\n isPresent: false,\r\n isDocked: true,\r\n dock: () => onDockChanged.notifyObservers({ location: \"left\", dock: true }),\r\n undock: () => onDockChanged.notifyObservers({ location: \"left\", dock: false }),\r\n isCollapsed: leftPaneDefaultCollapsed,\r\n collapse: () => onCollapseChanged.notifyObservers({ location: \"left\", collapsed: true }),\r\n expand: () => onCollapseChanged.notifyObservers({ location: \"left\", collapsed: false }),\r\n };\r\n const rightSidePaneContainerState = {\r\n isPresent: false,\r\n isDocked: true,\r\n dock: () => onDockChanged.notifyObservers({ location: \"right\", dock: true }),\r\n undock: () => onDockChanged.notifyObservers({ location: \"right\", dock: false }),\r\n isCollapsed: rightPaneDefaultCollapsed,\r\n collapse: () => onCollapseChanged.notifyObservers({ location: \"right\", collapsed: true }),\r\n expand: () => onCollapseChanged.notifyObservers({ location: \"right\", collapsed: false }),\r\n };\r\n\r\n const rootComponent: FunctionComponent = () => {\r\n const classes = useStyles();\r\n\r\n const [sidePaneDockOverrides, setSidePaneDockOverrides] = useSetting(SidePaneDockOverridesSettingDescriptor);\r\n\r\n // This function returns a promise that resolves after the dock change takes effect so that\r\n // we can then select the re-docked pane.\r\n const pendingPaneReselects = useRef<string[]>([]);\r\n const updateSidePaneDockOverride = useCallback(\r\n (key: string, horizontalLocation: HorizontalLocation, verticalLocation: VerticalLocation) => {\r\n setSidePaneDockOverrides((current) => ({\r\n ...current,\r\n [key]: { horizontalLocation, verticalLocation },\r\n }));\r\n\r\n pendingPaneReselects.current.push(key);\r\n },\r\n [setSidePaneDockOverrides]\r\n );\r\n\r\n const toolbarItems = useOrderedObservableCollection(toolbarItemCollection);\r\n\r\n const sidePanes = useOrderedObservableCollection(sidePaneCollection);\r\n const coercedSidePaneCache = useRef(new Map<string, SidePaneDefinition>());\r\n const coercedSidePanes = useMemo(() => {\r\n // First pass - apply overrides and respect the side pane mode.\r\n const coercedSidePanes = sidePanes\r\n .map((sidePaneDefinition) => {\r\n let coercedSidePane = coercedSidePaneCache.current.get(sidePaneDefinition.key);\r\n if (!coercedSidePane) {\r\n coercedSidePane = { ...sidePaneDefinition };\r\n coercedSidePaneCache.current.set(sidePaneDefinition.key, coercedSidePane);\r\n }\r\n\r\n const override = sidePaneDockOverrides[sidePaneDefinition.key];\r\n if (override) {\r\n // Override (user manually re-docked) has the highest priority.\r\n coercedSidePane.horizontalLocation = override.horizontalLocation;\r\n coercedSidePane.verticalLocation = override.verticalLocation;\r\n } else if (sidePaneRemapper) {\r\n // A side pane remapper has the next highest priority.\r\n const remapping = sidePaneRemapper(sidePaneDefinition);\r\n if (!remapping) {\r\n coercedSidePane = undefined;\r\n } else {\r\n coercedSidePane.horizontalLocation = remapping.horizontalLocation;\r\n coercedSidePane.verticalLocation = remapping.verticalLocation;\r\n }\r\n } else {\r\n // Otherwise use the default defined location.\r\n coercedSidePane.horizontalLocation = sidePaneDefinition.horizontalLocation;\r\n coercedSidePane.verticalLocation = sidePaneDefinition.verticalLocation;\r\n }\r\n\r\n return coercedSidePane;\r\n })\r\n .filter((sidePane): sidePane is SidePaneDefinition => !!sidePane);\r\n\r\n // Second pass - correct any invalid state, specifically if there are only bottom panes, force them to be top panes.\r\n for (const side of [\"left\", \"right\"] as const) {\r\n const topPanes = coercedSidePanes.filter((entry) => entry.horizontalLocation === side && entry.verticalLocation === \"top\");\r\n const bottomPanes = coercedSidePanes.filter((entry) => entry.horizontalLocation === side && entry.verticalLocation === \"bottom\");\r\n if (bottomPanes.length > 0 && topPanes.length === 0) {\r\n for (const pane of bottomPanes) {\r\n pane.verticalLocation = \"top\";\r\n updateSidePaneDockOverride(pane.key, side, \"top\");\r\n }\r\n }\r\n }\r\n\r\n // Cleanup any cached panes that are no longer present.\r\n for (const key of coercedSidePaneCache.current.keys()) {\r\n if (!coercedSidePanes.some((entry) => entry.key === key)) {\r\n coercedSidePaneCache.current.delete(key);\r\n }\r\n }\r\n\r\n return coercedSidePanes;\r\n }, [sidePanes, sidePaneDockOverrides, updateSidePaneDockOverride, sidePaneRemapper]);\r\n\r\n useEffect(() => {\r\n for (const paneKey of pendingPaneReselects.current.splice(0)) {\r\n onSelectSidePane.notifyObservers(paneKey);\r\n }\r\n }, [coercedSidePanes]);\r\n\r\n const sidePaneDockOperations = useMemo(() => {\r\n const sidePaneDockOperations = new Map<DockLocation, (sidePaneKey: string) => void>();\r\n for (const side of [\"left\", \"right\"] as const) {\r\n const currentSidePanes = coercedSidePanes.filter((entry) => entry.horizontalLocation === side);\r\n\r\n const dockTop = (sidePaneKey: string) => {\r\n updateSidePaneDockOverride(sidePaneKey, side, \"top\");\r\n };\r\n const dockBottom = (sidePaneKey: string) => {\r\n updateSidePaneDockOverride(sidePaneKey, side, \"bottom\");\r\n };\r\n\r\n if (currentSidePanes.some((entry) => entry.verticalLocation === \"bottom\")) {\r\n // If there are bottom panes, there must also be top panes, and so top and bottom are valid locations.\r\n sidePaneDockOperations.set(`top-${side}`, dockTop);\r\n sidePaneDockOperations.set(`bottom-${side}`, dockBottom);\r\n } else if (currentSidePanes.length > 0) {\r\n // If there are only top panes, then full and bottom are valid locations.\r\n sidePaneDockOperations.set(`full-${side}`, dockTop);\r\n sidePaneDockOperations.set(`bottom-${side}`, dockBottom);\r\n } else {\r\n // If there are no panes, then only full is a valid location.\r\n sidePaneDockOperations.set(`full-${side}`, dockTop);\r\n }\r\n }\r\n return sidePaneDockOperations;\r\n }, [coercedSidePanes]);\r\n\r\n const hasLeftPanes = coercedSidePanes.some((entry) => entry.horizontalLocation === \"left\");\r\n const hasRightPanes = coercedSidePanes.some((entry) => entry.horizontalLocation === \"right\");\r\n\r\n useEffect(() => {\r\n leftSidePaneContainerState.isPresent = hasLeftPanes;\r\n rightSidePaneContainerState.isPresent = hasRightPanes;\r\n\r\n return () => {\r\n leftSidePaneContainerState.isPresent = false;\r\n rightSidePaneContainerState.isPresent = false;\r\n };\r\n }, [hasLeftPanes, hasRightPanes]);\r\n\r\n // If we are in compact toolbar mode, we may need to move toolbar items from the left to the right or vice versa,\r\n // depending on whether there are any side panes on that side.\r\n const coerceToolBarItemHorizontalLocation = useMemo(\r\n () => (item: Readonly<ToolbarItemDefinition>) => {\r\n let horizontalLocation = item.horizontalLocation;\r\n // Coercion is only needed in compact toolbar mode since there might not be a left or right pane.\r\n if (toolbarMode === \"compact\") {\r\n if (horizontalLocation === \"left\" && !hasLeftPanes) {\r\n horizontalLocation = \"right\";\r\n }\r\n if (horizontalLocation === \"right\" && !hasRightPanes) {\r\n horizontalLocation = \"left\";\r\n }\r\n }\r\n return horizontalLocation;\r\n },\r\n [toolbarMode, hasLeftPanes, hasRightPanes]\r\n );\r\n\r\n const topToolBarItems = useMemo(() => toolbarItems.filter((entry) => entry.verticalLocation === \"top\"), [toolbarItems]);\r\n const bottomToolBarItems = useMemo(() => toolbarItems.filter((entry) => entry.verticalLocation === \"bottom\"), [toolbarItems]);\r\n\r\n const topBarLeftItems = useMemo(\r\n () => topToolBarItems.filter((entry) => coerceToolBarItemHorizontalLocation(entry) === \"left\"),\r\n [topToolBarItems, coerceToolBarItemHorizontalLocation]\r\n );\r\n const topBarRightItems = useMemo(\r\n () => topToolBarItems.filter((entry) => coerceToolBarItemHorizontalLocation(entry) === \"right\"),\r\n [topToolBarItems, coerceToolBarItemHorizontalLocation]\r\n );\r\n const bottomBarLeftItems = useMemo(\r\n () => bottomToolBarItems.filter((entry) => coerceToolBarItemHorizontalLocation(entry) === \"left\"),\r\n [bottomToolBarItems, coerceToolBarItemHorizontalLocation]\r\n );\r\n const bottomBarRightItems = useMemo(\r\n () => bottomToolBarItems.filter((entry) => coerceToolBarItemHorizontalLocation(entry) === \"right\"),\r\n [bottomToolBarItems, coerceToolBarItemHorizontalLocation]\r\n );\r\n\r\n const centralContents = useOrderedObservableCollection(centralContentCollection);\r\n\r\n const [leftPaneTabList, leftPane, leftPaneCollapsed, setLeftPaneCollapsed, leftPaneUndocked, setLeftPaneUndocked, leftPaneHasPanes] = usePane(\r\n \"left\",\r\n leftPaneDefaultWidth,\r\n leftPaneMinWidth,\r\n coercedSidePanes,\r\n onSelectSidePane,\r\n sidePaneDockOperations,\r\n toolbarMode,\r\n topBarLeftItems,\r\n bottomBarLeftItems,\r\n leftPaneDefaultCollapsed\r\n );\r\n\r\n useEffect(() => {\r\n // Propagate shorter lived React component state out to longer lived service state.\r\n leftSidePaneContainerState.isDocked = !leftPaneUndocked;\r\n }, [leftPaneUndocked]);\r\n\r\n useEffect(() => {\r\n // Propagate shorter lived React component state out to longer lived service state.\r\n leftSidePaneContainerState.isCollapsed = leftPaneCollapsed;\r\n }, [leftPaneCollapsed]);\r\n\r\n const [rightPaneTabList, rightPane, rightPaneCollapsed, setRightPaneCollapsed, rightPaneUndocked, setRightPaneUndocked, rightPaneHasPanes] = usePane(\r\n \"right\",\r\n rightPaneDefaultWidth,\r\n rightPaneMinWidth,\r\n coercedSidePanes,\r\n onSelectSidePane,\r\n sidePaneDockOperations,\r\n toolbarMode,\r\n topBarRightItems,\r\n bottomBarRightItems,\r\n rightPaneDefaultCollapsed\r\n );\r\n\r\n useEffect(() => {\r\n // Propagate shorter lived React component state out to longer lived service state.\r\n rightSidePaneContainerState.isDocked = !rightPaneUndocked;\r\n }, [rightPaneUndocked]);\r\n\r\n useEffect(() => {\r\n // Propagate shorter lived React component state out to longer lived service state.\r\n rightSidePaneContainerState.isCollapsed = rightPaneCollapsed;\r\n }, [rightPaneCollapsed]);\r\n\r\n useEffect(() => {\r\n // If at the service level dock state change is requested, propagate to the React component state.\r\n const observer = onDockChanged.add(({ location, dock }) => {\r\n if (location === \"left\") {\r\n setLeftPaneUndocked(!dock);\r\n } else {\r\n setRightPaneUndocked(!dock);\r\n }\r\n });\r\n\r\n return () => {\r\n observer.remove();\r\n leftSidePaneContainerState.isDocked = true;\r\n rightSidePaneContainerState.isDocked = true;\r\n };\r\n }, [setLeftPaneUndocked, setRightPaneUndocked]);\r\n\r\n useEffect(() => {\r\n // If at the service level collapse state change is requested, propagate to the React component state.\r\n const observer = onCollapseChanged.add(({ location, collapsed }) => {\r\n if (location === \"left\") {\r\n setLeftPaneCollapsed(collapsed);\r\n } else {\r\n setRightPaneCollapsed(collapsed);\r\n }\r\n });\r\n\r\n return () => {\r\n observer.remove();\r\n leftSidePaneContainerState.isCollapsed = false;\r\n rightSidePaneContainerState.isCollapsed = false;\r\n };\r\n }, [setLeftPaneCollapsed, setRightPaneCollapsed]);\r\n\r\n return (\r\n <div className={classes.mainView}>\r\n {/* Only render the top toolbar if the toolbar mode is \"full\". Otherwise it will be embedded at the top of the side panes. */}\r\n {toolbarMode === \"full\" && (\r\n <>\r\n <div className={classes.barDiv}>\r\n {leftPaneTabList}\r\n <Toolbar location=\"top\" components={topToolBarItems} />\r\n {rightPaneTabList}\r\n </div>\r\n </>\r\n )}\r\n\r\n {/* This renders the side panes and the main/central content. */}\r\n <div className={classes.verticallyCentralContent}>\r\n {/* Render the left pane container. */}\r\n {leftPane}\r\n\r\n {/* Render the main/central content. */}\r\n <div className={classes.centralContent}>\r\n {centralContents.map((entry) => (\r\n <ErrorBoundary key={entry.key} name={entry.key}>\r\n <entry.component />\r\n </ErrorBoundary>\r\n ))}\r\n {toolbarMode === \"compact\" && (\r\n <>\r\n <FluentFade visible={leftPaneCollapsed && leftPaneHasPanes} delay={50} duration={100} unmountOnExit>\r\n <div className={mergeClasses(classes.expandButtonContainer, classes.expandButtonContainerLeft)}>\r\n <Tooltip content=\"Show Side Pane\">\r\n <Button className={classes.expandButton} icon={<PanelLeftExpandRegular />} onClick={() => setLeftPaneCollapsed(false)} />\r\n </Tooltip>\r\n </div>\r\n </FluentFade>\r\n <FluentFade visible={rightPaneCollapsed && rightPaneHasPanes} delay={50} duration={100} unmountOnExit>\r\n <div className={mergeClasses(classes.expandButtonContainer, classes.expandButtonContainerRight)}>\r\n <Tooltip content=\"Show Side Pane\">\r\n <Button className={classes.expandButton} icon={<PanelRightExpandRegular />} onClick={() => setRightPaneCollapsed(false)} />\r\n </Tooltip>\r\n </div>\r\n </FluentFade>\r\n </>\r\n )}\r\n </div>\r\n\r\n {/* Render the right pane container. */}\r\n {rightPane}\r\n </div>\r\n\r\n {/* Only render the bottom toolbar if the toolbar mode is \"full\". Otherwise it will be embedded at the bottom of the side panes. */}\r\n {toolbarMode === \"full\" && (\r\n <>\r\n <div className={classes.barDiv}>\r\n <Toolbar location=\"bottom\" components={bottomToolBarItems} />\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n );\r\n };\r\n rootComponent.displayName = \"Shell Service Root\";\r\n\r\n return {\r\n addToolbarItem: (entry) => {\r\n if (!entry.component.displayName) {\r\n entry.component.displayName = `${entry.key} | ${entry.verticalLocation} ${entry.horizontalLocation} bar item`;\r\n }\r\n\r\n return toolbarItemCollection.add(entry);\r\n },\r\n addSidePane: (entry) => {\r\n if (!entry.content.displayName) {\r\n entry.content.displayName = `${entry.key} | ${entry.horizontalLocation} pane`;\r\n }\r\n\r\n return sidePaneCollection.add(entry);\r\n },\r\n addCentralContent: (entry) => centralContentCollection.add(entry),\r\n get leftSidePaneContainer() {\r\n return leftSidePaneContainerState.isPresent ? leftSidePaneContainerState : null;\r\n },\r\n get rightSidePaneContainer() {\r\n return rightSidePaneContainerState.isPresent ? rightSidePaneContainerState : null;\r\n },\r\n onDockChanged,\r\n get sidePanes() {\r\n return [...sidePaneCollection.items].map((sidePaneDefinition) => {\r\n return {\r\n key: sidePaneDefinition.key,\r\n select: () => onSelectSidePane.notifyObservers(sidePaneDefinition.key),\r\n };\r\n });\r\n },\r\n rootComponent,\r\n };\r\n },\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"shellService.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/modularTool/services/shellService.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAA8B,MAAM,uCAAuC,CAAC;AACpG,OAAO,EAEH,MAAM,EACN,OAAO,EACP,OAAO,IAAI,aAAa,EACxB,UAAU,EACV,IAAI,EACJ,SAAS,EACT,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,MAAM,EACN,kBAAkB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAA8C,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,E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CAAC,GAAG,MAAM,KAAK,CAAC,kBAAkB,OAAO,CAAC;oBAClF,CAAC;oBAED,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBACzC,CAAC;gBACD,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,wBAAwB,CAAC,GAAG,CAAC,KAAK,CAAC;gBACjE,IAAI,qBAAqB;oBACrB,OAAO,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,IAAI,CAAC;gBACpF,CAAC;gBACD,IAAI,sBAAsB;oBACtB,OAAO,2BAA2B,CAAC,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,IAAI,CAAC;gBACtF,CAAC;gBACD,aAAa;gBACb,IAAI,SAAS;oBACT,OAAO,CAAC,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,kBAAkB,EAAE,EAAE;wBAC5D,OAAO;4BACH,GAAG,EAAE,kBAAkB,CAAC,GAAG;4BAC3B,MAAM,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,eAAe,CAAC,kBAAkB,CAAC,GAAG,CAAC;yBACzE,CAAC;oBACN,CAAC,CAAC,CAAC;gBACP,CAAC;gBACD,aAAa;aAChB,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { useResizeHandle, type UseResizeHandleParams } from \"@fluentui-contrib/react-resize-handle\";\r\nimport {\r\n type MenuTriggerProps,\r\n Button,\r\n Divider,\r\n Toolbar as FluentToolbar,\r\n makeStyles,\r\n Menu,\r\n MenuGroup,\r\n MenuGroupHeader,\r\n MenuItem,\r\n MenuList,\r\n MenuPopover,\r\n MenuTrigger,\r\n mergeClasses,\r\n SplitButton,\r\n Subtitle2Stronger,\r\n tokens,\r\n ToolbarRadioButton,\r\n} from \"@fluentui/react-components\";\r\nimport { type ComponentType, type FunctionComponent, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\r\n\r\nimport { type IDisposable, type Nullable } from \"core/index\";\r\nimport { type IService, type ServiceDefinition } from \"../modularity/serviceDefinition\";\r\nimport { type SettingDescriptor } from \"./settingsStore\";\r\n\r\nimport {\r\n LayoutColumnTwoFocusLeftFilled,\r\n LayoutColumnTwoFocusRightFilled,\r\n LayoutColumnTwoSplitLeftFocusBottomLeftFilled,\r\n LayoutColumnTwoSplitLeftFocusTopLeftFilled,\r\n LayoutColumnTwoSplitRightFocusBottomRightFilled,\r\n LayoutColumnTwoSplitRightFocusTopRightFilled,\r\n MoreHorizontalRegular,\r\n PanelLeftContractRegular,\r\n PanelLeftExpandRegular,\r\n PanelRightContractRegular,\r\n PanelRightExpandRegular,\r\n PictureInPictureEnterRegular,\r\n} from \"@fluentui/react-icons\";\r\nimport { Fade as FluentFade } from \"@fluentui/react-motion-components-preview\";\r\n\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { ChildWindow } from \"shared-ui-components/fluent/hoc/childWindow\";\r\nimport { Collapse } from \"shared-ui-components/fluent/primitives/collapse\";\r\nimport { Tooltip } from \"shared-ui-components/fluent/primitives/tooltip\";\r\nimport { ErrorBoundary } from \"../components/errorBoundary\";\r\nimport { TeachingMoment } from \"../components/teachingMoment\";\r\nimport { Theme } from \"../components/theme\";\r\nimport { useOrderedObservableCollection } from \"../hooks/observableHooks\";\r\nimport { useSetting } from \"../hooks/settingsHooks\";\r\nimport { MakePopoverTeachingMoment } from \"../hooks/teachingMomentHooks\";\r\nimport { ObservableCollection } from \"../misc/observableCollection\";\r\n\r\n/**\r\n * Setting descriptor for persisting side pane dock location overrides.\r\n */\r\nexport const SidePaneDockOverridesSettingDescriptor: SettingDescriptor<\r\n Record<string, Readonly<{ horizontalLocation: HorizontalLocation; verticalLocation: VerticalLocation }> | undefined>\r\n> = {\r\n key: \"SidePaneDockOverrides\",\r\n defaultValue: {},\r\n};\r\n\r\n/**\r\n * Setting descriptor for persisting the left side pane width adjustment.\r\n */\r\nexport const LeftSidePaneWidthAdjustSettingDescriptor: SettingDescriptor<number> = {\r\n key: \"Shell/LeftPane/WidthAdjust\",\r\n defaultValue: 0,\r\n};\r\n\r\n/**\r\n * Setting descriptor for persisting the left side pane height adjustment.\r\n */\r\nexport const LeftSidePaneHeightAdjustSettingDescriptor: SettingDescriptor<number> = {\r\n key: \"Shell/LeftPane/HeightAdjust\",\r\n defaultValue: 0,\r\n};\r\n\r\n/**\r\n * Setting descriptor for persisting the right side pane width adjustment.\r\n */\r\nexport const RightSidePaneWidthAdjustSettingDescriptor: SettingDescriptor<number> = {\r\n key: \"Shell/RightPane/WidthAdjust\",\r\n defaultValue: 0,\r\n};\r\n\r\n/**\r\n * Setting descriptor for persisting the right side pane height adjustment.\r\n */\r\nexport const RightSidePaneHeightAdjustSettingDescriptor: SettingDescriptor<number> = {\r\n key: \"Shell/RightPane/HeightAdjust\",\r\n defaultValue: 0,\r\n};\r\n\r\n/**\r\n * Represents a horizontal location in the shell layout.\r\n */\r\nexport type HorizontalLocation = \"left\" | \"right\";\r\n\r\n/**\r\n * Represents a vertical location in the shell layout.\r\n */\r\nexport type VerticalLocation = \"top\" | \"bottom\";\r\n\r\ntype TeachingMomentInfo = boolean | { readonly title: string; readonly description: string };\r\n\r\ntype DockLocation = `${VerticalLocation}-${HorizontalLocation}` | `full-${HorizontalLocation}`;\r\n\r\n/**\r\n * Describes an item that can be added to one of the shell's toolbars.\r\n */\r\nexport type ToolbarItemDefinition = {\r\n /**\r\n * A unique key for the toolbar item.\r\n */\r\n key: string;\r\n\r\n /**\r\n * The component to render for the toolbar item.\r\n */\r\n component: ComponentType;\r\n\r\n /**\r\n * An optional order for the toolbar item, relative to other items.\r\n * Defaults to 0.\r\n */\r\n order?: number;\r\n\r\n /**\r\n * The horizontal location of the toolbar item.\r\n * Can be either \"left\" or \"right\".\r\n * In \"compact\" toolbar mode, \"left\" and \"right\" mean the \"compact\" toolbars at the top/bottom of the left/right side panes.\r\n * In \"full\" toolbar mode, \"left\" and \"right\" mean the left side and right side of the full width toolbars above/below the side panes.\r\n */\r\n horizontalLocation: HorizontalLocation;\r\n\r\n /**\r\n * The vertical location of the toolbar item.\r\n * Can be either \"top\" or \"bottom\".\r\n */\r\n verticalLocation: VerticalLocation;\r\n\r\n /**\r\n * An optional display name for the toolbar item, used for teaching moments, tooltips, etc.\r\n */\r\n displayName?: string;\r\n\r\n /**\r\n * An optional teaching moment info. The default assumes the toolbar item was added by an extension and provides a generic title and description based on the display name or id, which is helpful for discoverability of new items.\r\n * Set this to false to suppress the teaching moment, which may be desirable for built in items or items that are added in a non-dynamic way.\r\n * Set it to an object with a title and description to provide a custom teaching moment, which may be desirable if the generic title and description are not sufficient.\r\n * Teaching moments are more helpful for dynamically added items, possibly from extensions.\r\n */\r\n teachingMoment?: TeachingMomentInfo;\r\n};\r\n\r\n/**\r\n * Describes a side pane that can be added to the shell's left or right side.\r\n */\r\nexport type SidePaneDefinition = {\r\n /**\r\n * A unique key for the side pane.\r\n */\r\n key: string;\r\n\r\n /**\r\n * An icon component to render for the pane tab.\r\n */\r\n icon: ComponentType;\r\n\r\n /**\r\n * The component to render for the side pane's content.\r\n */\r\n content: ComponentType;\r\n\r\n /**\r\n * An optional order for the side pane, relative to other panes.\r\n * Defaults to 0.\r\n */\r\n order?: number;\r\n\r\n /**\r\n * The horizontal location of the side pane.\r\n * Can be either \"left\" or \"right\".\r\n */\r\n horizontalLocation: HorizontalLocation;\r\n\r\n /**\r\n * The vertical location of the side pane.\r\n * Can be either \"top\" or \"bottom\".\r\n */\r\n verticalLocation: VerticalLocation;\r\n\r\n /**\r\n * The title of the side pane, displayed as a standardized header at the top of the pane.\r\n */\r\n title: string;\r\n\r\n /**\r\n * An optional teaching moment info. The default assumes the side pane was added by an extension and provides a generic title and description based on the display name or id, which is helpful for discoverability of new items.\r\n * Set this to false to suppress the teaching moment, which may be desirable for built in items or items that are added in a non-dynamic way.\r\n * Set it to an object with a title and description to provide a custom teaching moment, which may be desirable if the generic title and description are not sufficient.\r\n * Teaching moments are more helpful for dynamically added panes, possibly from extensions.\r\n */\r\n teachingMoment?: TeachingMomentInfo;\r\n\r\n /**\r\n * Keep the pane mounted even when it is not visible. This is useful if you don't want the\r\n * user to lose the complex visual state when switching between tabs.\r\n */\r\n keepMounted?: boolean;\r\n};\r\n\r\ntype RegisteredSidePane = {\r\n readonly key: string;\r\n select(): void;\r\n};\r\n\r\ntype SidePaneContainer = {\r\n readonly isDocked: boolean;\r\n dock(): void;\r\n undock(): void;\r\n readonly isCollapsed: boolean;\r\n collapse(): void;\r\n expand(): void;\r\n};\r\n\r\n/**\r\n * Describes content that can be added to the shell's central area (between the side panes and toolbars - e.g. the main content).\r\n */\r\nexport type CentralContentDefinition = {\r\n /**\r\n * A unique key for the central content.\r\n */\r\n key: string;\r\n\r\n /**\r\n * The component to render for the central content.\r\n */\r\n component: ComponentType;\r\n\r\n /**\r\n * An optional order for content, relative to other central content.\r\n * Defaults to 0.\r\n */\r\n order?: number;\r\n};\r\n\r\n/**\r\n * The unique identity symbol for the root component service.\r\n */\r\nexport const RootComponentServiceIdentity = Symbol(\"RootComponent\");\r\n\r\n/**\r\n * Exposes a top level component that should be rendered as the React root.\r\n */\r\nexport interface IRootComponentService extends IService<typeof RootComponentServiceIdentity> {\r\n /**\r\n * The root component that should be rendered as the React root.\r\n */\r\n readonly rootComponent: ComponentType;\r\n}\r\n\r\n/**\r\n * The unique identity symbol for the shell service.\r\n */\r\nexport const ShellServiceIdentity = Symbol(\"ShellService\");\r\n\r\n/**\r\n * Provides a shell for the application, including toolbars, side panes, and central content.\r\n * This service allows adding toolbar items, side panes, and central content dynamically.\r\n */\r\nexport interface IShellService extends IService<typeof ShellServiceIdentity> {\r\n /**\r\n * Adds a new item to one of the shell's toolbars.\r\n * @param item Defines the item to add.\r\n */\r\n addToolbarItem(item: Readonly<ToolbarItemDefinition>): IDisposable;\r\n\r\n /**\r\n * Adds a new side pane to the shell.\r\n * @param pane Defines the side pane to add.\r\n */\r\n addSidePane(pane: Readonly<SidePaneDefinition>): IDisposable;\r\n\r\n /**\r\n * Adds new central content to the shell.\r\n * @param content Defines the content area to add.\r\n */\r\n addCentralContent(content: Readonly<CentralContentDefinition>): IDisposable;\r\n\r\n /**\r\n * The left side pane container.\r\n */\r\n readonly leftSidePaneContainer: Nullable<SidePaneContainer>;\r\n\r\n /**\r\n * The right side pane container.\r\n */\r\n readonly rightSidePaneContainer: Nullable<SidePaneContainer>;\r\n\r\n /**\r\n * The side panes currently present in the shell.\r\n */\r\n readonly sidePanes: readonly RegisteredSidePane[];\r\n}\r\n\r\ntype ToolbarMode = \"full\" | \"compact\";\r\n\r\n/**\r\n * Options for configuring the shell service.\r\n */\r\nexport type ShellServiceOptions = {\r\n /**\r\n * The default width of the left side pane.\r\n */\r\n leftPaneDefaultWidth?: number;\r\n\r\n /**\r\n * The minimum width of the left side pane.\r\n */\r\n leftPaneMinWidth?: number;\r\n\r\n /**\r\n * The default width of the right side pane.\r\n */\r\n rightPaneDefaultWidth?: number;\r\n\r\n /**\r\n * The minimum width of the right side pane.\r\n */\r\n rightPaneMinWidth?: number;\r\n\r\n /**\r\n * The mode of the toolbars.\r\n * Can be either \"full\" (default) or \"compact\".\r\n * In \"full\" mode, toolbars are displayed above and below the side panes.\r\n * In \"compact\" mode, toolbars are displayed at the top and bottom of the left and right side panes.\r\n */\r\n toolbarMode?: ToolbarMode;\r\n\r\n /**\r\n * Whether the left side pane should start collapsed. Default is false.\r\n */\r\n leftPaneDefaultCollapsed?: boolean;\r\n\r\n /**\r\n * Whether the right side pane should start collapsed. Default is false.\r\n */\r\n rightPaneDefaultCollapsed?: boolean;\r\n\r\n /**\r\n * A function that can remap the default location of side panes.\r\n * @param sidePane The side pane to remap.\r\n * @returns The new location for the side pane.\r\n */\r\n sidePaneRemapper?: (sidePane: Readonly<SidePaneDefinition>) => Nullable<{ horizontalLocation: HorizontalLocation; verticalLocation: VerticalLocation }>;\r\n};\r\n\r\nconst useStyles = makeStyles({\r\n mainView: {\r\n flex: 1,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n overflow: \"hidden\",\r\n backgroundColor: tokens.colorTransparentBackground,\r\n },\r\n verticallyCentralContent: {\r\n flexGrow: 1,\r\n display: \"flex\",\r\n overflow: \"hidden\",\r\n backgroundColor: tokens.colorTransparentBackground,\r\n },\r\n barDiv: {\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n flex: \"0 0 auto\",\r\n height: \"36px\",\r\n backgroundColor: tokens.colorNeutralBackground2,\r\n pointerEvents: \"auto\",\r\n },\r\n bar: {\r\n display: \"flex\",\r\n flex: \"1\",\r\n overflow: \"hidden\",\r\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalXXS}`,\r\n borderBottom: `1px solid ${tokens.colorNeutralStroke2}`,\r\n backgroundColor: tokens.colorNeutralBackground2,\r\n },\r\n barTop: {\r\n borderTopWidth: 0,\r\n },\r\n barBottom: {\r\n borderTop: `1px solid ${tokens.colorNeutralStroke2}`,\r\n },\r\n barLeft: {\r\n marginRight: \"auto\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n flexDirection: \"row\",\r\n columnGap: tokens.spacingHorizontalSNudge,\r\n },\r\n barRight: {\r\n marginLeft: \"auto\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n flexDirection: \"row-reverse\",\r\n columnGap: tokens.spacingHorizontalSNudge,\r\n },\r\n barItem: {\r\n display: \"flex\",\r\n },\r\n paneTabListDiv: {\r\n backgroundColor: tokens.colorNeutralBackground1,\r\n flex: \"0 0 auto\",\r\n display: \"flex\",\r\n },\r\n paneTabListDivLeft: {\r\n flexDirection: \"row-reverse\",\r\n },\r\n paneTabListDivRight: {\r\n flexDirection: \"row\",\r\n },\r\n paneCollapseButton: {\r\n padding: `0 0 0 ${tokens.spacingHorizontalXS}`,\r\n borderBottom: `1px solid ${tokens.colorNeutralStroke2}`,\r\n },\r\n paneCollapseButtonWithBorder: {\r\n borderLeft: `1px solid ${tokens.colorNeutralStroke2}`,\r\n },\r\n collapseMenuPopover: {\r\n minWidth: 0,\r\n },\r\n pane: {\r\n backgroundColor: tokens.colorNeutralBackground2,\r\n display: \"flex\",\r\n flex: 1,\r\n alignItems: \"stretch\",\r\n overflow: \"hidden\",\r\n },\r\n paneLeft: {\r\n flexDirection: \"row\",\r\n },\r\n paneRight: {\r\n flexDirection: \"row-reverse\",\r\n },\r\n paneContainer: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n overflowX: \"hidden\",\r\n overflowY: \"hidden\",\r\n zIndex: 1,\r\n pointerEvents: \"auto\",\r\n },\r\n paneContent: {\r\n display: \"flex\",\r\n flexGrow: 1,\r\n flexDirection: \"column\",\r\n overflow: \"hidden\",\r\n },\r\n unselectedPane: {\r\n display: \"none\",\r\n },\r\n paneHeaderDiv: {\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n height: \"36px\",\r\n backgroundColor: tokens.colorNeutralBackground1,\r\n color: tokens.colorNeutralForeground1,\r\n },\r\n paneHeaderText: {\r\n flex: 1,\r\n },\r\n paneHeaderTextNoIcon: {\r\n marginLeft: tokens.spacingHorizontalM,\r\n },\r\n paneHeaderIcon: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n height: \"100%\",\r\n aspectRatio: \"1\",\r\n fontSize: \"20px\",\r\n },\r\n paneHeaderButton: {\r\n color: \"inherit\",\r\n },\r\n paneDivider: {\r\n flex: \"0 0 auto\",\r\n marginTop: tokens.spacingVerticalM,\r\n margin: \"0\",\r\n minHeight: tokens.spacingVerticalM,\r\n cursor: \"ns-resize\",\r\n alignItems: \"end\",\r\n },\r\n tabToolbar: {\r\n padding: 0,\r\n borderLeft: `1px solid ${tokens.colorNeutralStroke2}`,\r\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\r\n },\r\n tab: {\r\n display: \"flex\",\r\n height: \"100%\",\r\n boxSizing: \"border-box\",\r\n justifyContent: \"center\",\r\n border: `1px solid ${tokens.colorNeutralStroke2}`,\r\n borderTop: \"none\",\r\n },\r\n firstTab: {\r\n borderLeftColor: \"transparent\",\r\n },\r\n lastTab: {\r\n borderRightColor: \"transparent\",\r\n },\r\n selectedTab: {\r\n borderBottom: \"none\",\r\n },\r\n unselectedTab: {\r\n borderLeftColor: \"transparent\",\r\n borderRightColor: \"transparent\",\r\n },\r\n tabRadioButton: {\r\n backgroundColor: \"transparent\",\r\n borderRadius: 0,\r\n },\r\n resizer: {\r\n width: \"8px\",\r\n cursor: \"ew-resize\",\r\n zIndex: 1000,\r\n },\r\n resizerLeft: {\r\n marginRight: \"-8px\",\r\n transform: \"translateX(-8px)\",\r\n },\r\n resizerRight: {\r\n marginLeft: \"-8px\",\r\n transform: \"translateX(8px)\",\r\n },\r\n centralContent: {\r\n position: \"relative\",\r\n flexGrow: 1,\r\n display: \"flex\",\r\n overflow: \"hidden\",\r\n backgroundColor: tokens.colorTransparentBackground,\r\n \"> *\": {\r\n pointerEvents: \"auto\",\r\n },\r\n },\r\n expandButtonContainer: {\r\n position: \"absolute\",\r\n },\r\n expandButtonContainerLeft: {\r\n left: 0,\r\n },\r\n expandButtonContainerRight: {\r\n right: 0,\r\n },\r\n expandButton: {},\r\n});\r\n\r\nconst DockMenu: FunctionComponent<\r\n Pick<MenuTriggerProps, \"children\"> & { openOnContext?: boolean; sidePaneId: string; dockOptions: Map<DockLocation, (sidePaneKey: string) => void> }\r\n> = (props) => {\r\n const { openOnContext, sidePaneId, dockOptions, children } = props;\r\n\r\n const dockLeft = dockOptions.get(\"full-left\");\r\n const dockTopLeft = dockOptions.get(\"top-left\");\r\n const dockBottomLeft = dockOptions.get(\"bottom-left\");\r\n const dockRight = dockOptions.get(\"full-right\");\r\n const dockTopRight = dockOptions.get(\"top-right\");\r\n const dockBottomRight = dockOptions.get(\"bottom-right\");\r\n\r\n return (\r\n <Menu openOnContext={openOnContext}>\r\n <MenuTrigger disableButtonEnhancement>{children}</MenuTrigger>\r\n <Theme>\r\n <MenuPopover>\r\n <MenuList>\r\n <MenuGroup>\r\n <MenuGroupHeader>Dock</MenuGroupHeader>\r\n {dockLeft && (\r\n <MenuItem icon={<LayoutColumnTwoFocusLeftFilled />} onClick={() => dockLeft(sidePaneId)}>\r\n Left\r\n </MenuItem>\r\n )}\r\n {dockTopLeft && (\r\n <MenuItem icon={<LayoutColumnTwoSplitLeftFocusTopLeftFilled />} onClick={() => dockTopLeft(sidePaneId)}>\r\n Top Left\r\n </MenuItem>\r\n )}\r\n {dockBottomLeft && (\r\n <MenuItem icon={<LayoutColumnTwoSplitLeftFocusBottomLeftFilled />} onClick={() => dockBottomLeft(sidePaneId)}>\r\n Bottom Left\r\n </MenuItem>\r\n )}\r\n {dockRight && (\r\n <MenuItem icon={<LayoutColumnTwoFocusRightFilled />} onClick={() => dockRight(sidePaneId)}>\r\n Right\r\n </MenuItem>\r\n )}\r\n {dockTopRight && (\r\n <MenuItem icon={<LayoutColumnTwoSplitRightFocusTopRightFilled />} onClick={() => dockTopRight(sidePaneId)}>\r\n Top Right\r\n </MenuItem>\r\n )}\r\n {dockBottomRight && (\r\n <MenuItem icon={<LayoutColumnTwoSplitRightFocusBottomRightFilled />} onClick={() => dockBottomRight(sidePaneId)}>\r\n Bottom Right\r\n </MenuItem>\r\n )}\r\n </MenuGroup>\r\n </MenuList>\r\n </MenuPopover>\r\n </Theme>\r\n </Menu>\r\n );\r\n};\r\n\r\nconst PaneHeader: FunctionComponent<{ id: string; title: string; icon?: ComponentType; dockOptions: Map<DockLocation, (sidePaneKey: string) => void> }> = (props) => {\r\n const { id, title, dockOptions } = props;\r\n\r\n const classes = useStyles();\r\n\r\n return (\r\n <div className={classes.paneHeaderDiv}>\r\n {props.icon && (\r\n <div className={classes.paneHeaderIcon}>\r\n <props.icon />\r\n </div>\r\n )}\r\n <Subtitle2Stronger className={mergeClasses(classes.paneHeaderText, !props.icon && classes.paneHeaderTextNoIcon)}>{title}</Subtitle2Stronger>\r\n <DockMenu sidePaneId={id} dockOptions={dockOptions}>\r\n <Button className={classes.paneHeaderButton} appearance=\"transparent\" icon={<MoreHorizontalRegular />} />\r\n </DockMenu>\r\n </div>\r\n );\r\n};\r\n\r\n// This is a wrapper for an item in a toolbar that simply adds a teaching moment, which is useful for dynamically added items, possibly from extensions.\r\nconst ToolbarItem: FunctionComponent<{\r\n verticalLocation: VerticalLocation;\r\n horizontalLocation: HorizontalLocation;\r\n id: string;\r\n component: ComponentType;\r\n displayName?: string;\r\n teachingMoment?: TeachingMomentInfo;\r\n}> = (props) => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const { verticalLocation, horizontalLocation, id, component: Component, displayName } = props;\r\n const classes = useStyles();\r\n\r\n const useTeachingMoment = useMemo(() => MakePopoverTeachingMoment(`Bar/${verticalLocation}/${horizontalLocation}/${displayName ?? id}`), [displayName, id]);\r\n const teachingMoment = useTeachingMoment(props.teachingMoment === false);\r\n\r\n const title = typeof props.teachingMoment === \"object\" ? props.teachingMoment.title : (displayName ?? id);\r\n const description = typeof props.teachingMoment === \"object\" ? props.teachingMoment.description : `The \"${displayName ?? id}\" extension can be accessed here.`;\r\n\r\n return (\r\n <>\r\n <TeachingMoment {...teachingMoment} shouldDisplay={teachingMoment.shouldDisplay} title={title} description={description} />\r\n <div className={classes.barItem} ref={teachingMoment.targetRef}>\r\n <Component />\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\n// TODO: Handle overflow, possibly via https://react.fluentui.dev/?path=/docs/components-overflow--docs with priority.\r\n// This component just renders a toolbar with left aligned toolbar items on the left and right aligned toolbar items on the right.\r\nconst Toolbar: FunctionComponent<{ location: VerticalLocation; components: Readonly<ToolbarItemDefinition[]> }> = ({ location, components }) => {\r\n const classes = useStyles();\r\n\r\n const leftComponents = useMemo(() => components.filter((entry) => entry.horizontalLocation === \"left\"), [components]);\r\n const rightComponents = useMemo(() => components.filter((entry) => entry.horizontalLocation === \"right\"), [components]);\r\n\r\n return (\r\n <>\r\n {components.length > 0 && (\r\n <div className={`${classes.bar} ${location === \"top\" ? classes.barTop : classes.barBottom}`}>\r\n <div className={classes.barLeft}>\r\n {leftComponents.map((entry) => (\r\n <ToolbarItem\r\n key={entry.key}\r\n verticalLocation={location}\r\n horizontalLocation={entry.horizontalLocation}\r\n id={entry.key}\r\n component={entry.component}\r\n displayName={entry.displayName}\r\n teachingMoment={entry.teachingMoment}\r\n />\r\n ))}\r\n </div>\r\n <div className={classes.barRight}>\r\n {rightComponents.map((entry) => (\r\n <ToolbarItem\r\n key={entry.key}\r\n verticalLocation={location}\r\n horizontalLocation={entry.horizontalLocation}\r\n id={entry.key}\r\n component={entry.component}\r\n displayName={entry.displayName}\r\n teachingMoment={entry.teachingMoment}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\n// This is a wrapper for a tab in a side pane that simply adds a teaching moment, which is useful for dynamically added items, possibly from extensions.\r\nconst SidePaneTab: FunctionComponent<\r\n { location: HorizontalLocation; id: string; isSelected: boolean; isFirst: boolean; isLast: boolean; dockOptions: Map<DockLocation, (sidePaneKey: string) => void> } & Pick<\r\n Readonly<SidePaneDefinition>,\r\n \"title\" | \"icon\" | \"teachingMoment\"\r\n >\r\n> = (props) => {\r\n const {\r\n location,\r\n id,\r\n isSelected,\r\n isFirst,\r\n isLast,\r\n dockOptions,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n icon: Icon,\r\n title,\r\n } = props;\r\n const classes = useStyles();\r\n const useTeachingMoment = useMemo(() => MakePopoverTeachingMoment(`Pane/${location}/${title ?? id}`), [title, id]);\r\n const teachingMoment = useTeachingMoment(props.teachingMoment === false);\r\n\r\n const tabClass = mergeClasses(\r\n classes.tab,\r\n isSelected ? classes.selectedTab : classes.unselectedTab,\r\n isFirst ? classes.firstTab : undefined,\r\n isLast ? classes.lastTab : undefined\r\n );\r\n\r\n return (\r\n <>\r\n <TeachingMoment\r\n {...teachingMoment}\r\n shouldDisplay={teachingMoment.shouldDisplay}\r\n title={typeof props.teachingMoment === \"object\" ? props.teachingMoment.title : (title ?? \"Extension\")}\r\n description={typeof props.teachingMoment === \"object\" ? props.teachingMoment.description : `The \"${title ?? id}\" extension can be accessed here.`}\r\n />\r\n <div className={tabClass}>\r\n <DockMenu openOnContext sidePaneId={id} dockOptions={dockOptions}>\r\n <Tooltip content={title ?? id}>\r\n <ToolbarRadioButton\r\n ref={teachingMoment.targetRef}\r\n appearance=\"transparent\"\r\n className={classes.tabRadioButton}\r\n name=\"selectedTab\"\r\n value={id}\r\n icon={{\r\n children: <Icon />,\r\n }}\r\n />\r\n </Tooltip>\r\n </DockMenu>\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\n// This hook provides a side pane container and the tab list.\r\n// In \"compact\" mode, the tab list is integrated into the pane itself.\r\n// In \"full\" mode, the returned tab list is later injected into the toolbar.\r\nfunction usePane(\r\n location: HorizontalLocation,\r\n defaultWidth: number,\r\n minWidth: number,\r\n sidePanes: SidePaneDefinition[],\r\n onSelectSidePane: Observable<string>,\r\n dockOperations: Map<DockLocation, (sidePaneKey: string) => void>,\r\n toolbarMode: ToolbarMode,\r\n topBarItems: Readonly<ToolbarItemDefinition[]>,\r\n bottomBarItems: Readonly<ToolbarItemDefinition[]>,\r\n initialCollapsed: boolean\r\n) {\r\n const classes = useStyles();\r\n\r\n const [topSelectedTab, setTopSelectedTab] = useState<SidePaneDefinition>();\r\n const [bottomSelectedTab, setBottomSelectedTab] = useState<SidePaneDefinition>();\r\n const [collapsed, setCollapsed] = useState(initialCollapsed);\r\n const childWindow = useRef<ChildWindow>(null);\r\n const [isChildWindowOpen, setIsChildWindowOpen] = useState(false);\r\n const paneContainerRef = useRef<HTMLDivElement>(null);\r\n\r\n const onExpandCollapseClick = useCallback(() => {\r\n setCollapsed((collapsed) => !collapsed);\r\n }, []);\r\n\r\n const [paneWidthSetting, setPaneWidthSetting] = useSetting(location === \"left\" ? LeftSidePaneWidthAdjustSettingDescriptor : RightSidePaneWidthAdjustSettingDescriptor);\r\n const [paneHeightSetting, setPaneHeightSetting] = useSetting(location === \"left\" ? LeftSidePaneHeightAdjustSettingDescriptor : RightSidePaneHeightAdjustSettingDescriptor);\r\n\r\n // Keep setting values in refs so the composed ref callbacks below can read the latest values\r\n // without causing the callbacks to be recreated (which would cause unnecessary ref detach/reattach).\r\n const paneWidthSettingRef = useRef(paneWidthSetting);\r\n paneWidthSettingRef.current = paneWidthSetting;\r\n const paneHeightSettingRef = useRef(paneHeightSetting);\r\n paneHeightSettingRef.current = paneHeightSetting;\r\n\r\n const currentSidePanes = useMemo(() => sidePanes.filter((entry) => entry.horizontalLocation === location), [sidePanes, location]);\r\n const topPanes = useMemo(() => currentSidePanes.filter((entry) => entry.verticalLocation === \"top\"), [currentSidePanes]);\r\n const bottomPanes = useMemo(() => currentSidePanes.filter((entry) => entry.verticalLocation === \"bottom\"), [currentSidePanes]);\r\n\r\n const getValidDockOperations = useCallback(\r\n (verticalLocation: VerticalLocation) => {\r\n const validDockOperations = new Map(dockOperations);\r\n\r\n // Can't re-dock to the current location.\r\n validDockOperations.delete(`${verticalLocation}-${location}`);\r\n\r\n // Full would mean there are no bottom panes, so this is also re-docking to the current location.\r\n validDockOperations.delete(`full-${location}`);\r\n\r\n // If there is only one pane left, it can't be docked to the bottom (as this would leave no top panes).\r\n if (currentSidePanes.length === 1) {\r\n validDockOperations.delete(`bottom-${location}`);\r\n }\r\n\r\n return validDockOperations;\r\n },\r\n [location, dockOperations, currentSidePanes]\r\n );\r\n\r\n const validTopDockOptions = useMemo(() => getValidDockOperations(\"top\"), [getValidDockOperations]);\r\n const validBottomDockOptions = useMemo(() => getValidDockOperations(\"bottom\"), [getValidDockOperations]);\r\n\r\n // Selects a default top tab (during initialization or if the selected tab is removed).\r\n useEffect(() => {\r\n if ((topSelectedTab && !topPanes.includes(topSelectedTab)) || (!topSelectedTab && topPanes.length > 0)) {\r\n setTopSelectedTab(topPanes[0]);\r\n } else if (topSelectedTab && topPanes.length === 0) {\r\n setTopSelectedTab(undefined);\r\n }\r\n }, [topSelectedTab, topPanes]);\r\n\r\n // Selects a default bottom tab (during initialization or if the selected tab is removed).\r\n useEffect(() => {\r\n if ((bottomSelectedTab && !bottomPanes.includes(bottomSelectedTab)) || (!bottomSelectedTab && bottomPanes.length > 0)) {\r\n setBottomSelectedTab(bottomPanes[0]);\r\n } else if (bottomSelectedTab && bottomPanes.length === 0) {\r\n setBottomSelectedTab(undefined);\r\n }\r\n }, [bottomSelectedTab, bottomPanes]);\r\n\r\n // Selects a tab when explicitly requested.\r\n useEffect(() => {\r\n const observer = onSelectSidePane.add((key) => {\r\n const topPane = topPanes.find((entry) => entry.key === key);\r\n if (topPane) {\r\n setTopSelectedTab(topPane);\r\n setCollapsed(false);\r\n }\r\n\r\n const bottomPane = bottomPanes.find((entry) => entry.key === key);\r\n if (bottomPane) {\r\n setBottomSelectedTab(bottomPane);\r\n setCollapsed(false);\r\n }\r\n });\r\n\r\n return () => observer.remove();\r\n }, [topPanes, bottomPanes, onSelectSidePane]);\r\n\r\n const setUndocked = useCallback(\r\n (undocked: boolean) => {\r\n if (!undocked) {\r\n childWindow.current?.close();\r\n } else {\r\n const paneContainer = paneContainerRef.current;\r\n if (!paneContainer) {\r\n // It shouldn't be possible to get here and have this ref be null, but just in case,\r\n // bail out of the undock operation.\r\n childWindow.current?.close();\r\n } else {\r\n // This is the extra buffer needed on top of minWidth to account for window chrome to avoid a horizontal scrollbar.\r\n const widthBuffer = 4;\r\n // This offsets the window's top position to account for window chrome/title bar.\r\n const topOffset = 100;\r\n\r\n // Create the child window with approximately the same location and size as the side pane.\r\n const bounds = paneContainer.getBoundingClientRect();\r\n\r\n childWindow.current?.open({\r\n defaultWidth: Math.max(bounds.width, minWidth + widthBuffer),\r\n defaultHeight: bounds.height - topOffset,\r\n defaultTop: bounds.top + window.screenY + topOffset,\r\n defaultLeft: bounds.left + window.screenX,\r\n title: location === \"left\" ? \"Left\" : \"Right\",\r\n });\r\n }\r\n }\r\n },\r\n [childWindow, location]\r\n );\r\n\r\n const expandCollapseButton = useMemo(() => {\r\n const expandCollapseIcon =\r\n location === \"left\" ? collapsed ? <PanelLeftExpandRegular /> : <PanelLeftContractRegular /> : collapsed ? <PanelRightExpandRegular /> : <PanelRightContractRegular />;\r\n\r\n return (\r\n <Menu positioning=\"below-end\">\r\n <MenuTrigger disableButtonEnhancement={true}>\r\n {(triggerProps) => (\r\n <Tooltip content={collapsed ? \"Show Side Pane\" : \"Hide Side Pane\"}>\r\n <SplitButton\r\n className={mergeClasses(\r\n classes.paneCollapseButton,\r\n location === \"right\" && toolbarMode === \"compact\" ? classes.paneCollapseButtonWithBorder : undefined\r\n )}\r\n menuButton={triggerProps}\r\n primaryActionButton={{ onClick: onExpandCollapseClick }}\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n icon={expandCollapseIcon}\r\n />\r\n </Tooltip>\r\n )}\r\n </MenuTrigger>\r\n <MenuPopover className={classes.collapseMenuPopover}>\r\n <MenuList>\r\n <MenuItem icon={<PictureInPictureEnterRegular />} onClick={() => setUndocked(true)}>\r\n Undock\r\n </MenuItem>\r\n </MenuList>\r\n </MenuPopover>\r\n </Menu>\r\n );\r\n }, [collapsed, onExpandCollapseClick, location]);\r\n\r\n const createPaneTabList = useCallback(\r\n (\r\n paneComponents: SidePaneDefinition[],\r\n toolbarMode: \"full\" | \"compact\",\r\n selectedTab: SidePaneDefinition | undefined,\r\n setSelectedTab: (tab: SidePaneDefinition | undefined) => void,\r\n dockOptions: Map<DockLocation, (sidePaneKey: string) => void>\r\n ) => {\r\n return (\r\n <>\r\n {paneComponents.length > 0 && (\r\n <div className={`${classes.paneTabListDiv} ${location === \"left\" || toolbarMode === \"compact\" ? classes.paneTabListDivLeft : classes.paneTabListDivRight}`}>\r\n {/* Only render the tab list if there is more than tab. It's kind of pointless to show a tab list with just one tab. */}\r\n {paneComponents.length > 1 && (\r\n <>\r\n <FluentToolbar\r\n className={classes.tabToolbar}\r\n checkedValues={{ selectedTab: [selectedTab?.key ?? \"\"] }}\r\n onCheckedValueChange={(event, data) => {\r\n const tab = paneComponents.find((entry) => entry.key === data.checkedItems[0]);\r\n setSelectedTab(tab);\r\n setCollapsed(false);\r\n }}\r\n >\r\n {paneComponents.map((entry, index) => {\r\n const isSelected = selectedTab?.key === entry.key;\r\n return (\r\n <SidePaneTab\r\n key={entry.key}\r\n location={location}\r\n id={entry.key}\r\n title={entry.title}\r\n icon={entry.icon}\r\n teachingMoment={entry.teachingMoment}\r\n isSelected={isSelected && !collapsed}\r\n isFirst={index === 0}\r\n isLast={index === paneComponents.length - 1}\r\n dockOptions={dockOptions}\r\n />\r\n );\r\n })}\r\n </FluentToolbar>\r\n </>\r\n )}\r\n\r\n {/* When the toolbar mode is \"full\", we add an extra button that allows the side panes to be collapsed. */}\r\n {toolbarMode === \"full\" && (\r\n <Collapse visible={!isChildWindowOpen} orientation=\"horizontal\">\r\n {expandCollapseButton}\r\n </Collapse>\r\n )}\r\n </div>\r\n )}\r\n </>\r\n );\r\n },\r\n [location, collapsed, isChildWindowOpen, expandCollapseButton]\r\n );\r\n\r\n // This memos the TabList to make it easy for the JSX to be inserted at the top of the pane (in \"compact\" mode) or returned to the caller to be used in the toolbar (in \"full\" mode).\r\n const topPaneTabList = useMemo(\r\n () => createPaneTabList(topPanes, toolbarMode, topSelectedTab, setTopSelectedTab, validTopDockOptions),\r\n [createPaneTabList, topPanes, toolbarMode, topSelectedTab]\r\n );\r\n const bottomPaneTabList = useMemo(\r\n () => createPaneTabList(bottomPanes, \"compact\", bottomSelectedTab, setBottomSelectedTab, validBottomDockOptions),\r\n [createPaneTabList, bottomPanes, bottomSelectedTab]\r\n );\r\n\r\n // Memoize the resize onChange handlers so the Fluent hook's element ref callbacks remain stable across renders.\r\n // The contrib hook's returned elementRef callback transitively depends on onChange, so an inline arrow here would\r\n // force the composed refs below to be recreated every render, defeating the ref-stability optimization.\r\n const onPaneWidthChange = useCallback<NonNullable<UseResizeHandleParams[\"onChange\"]>>(\r\n (_event, data) => {\r\n // Whenever the width is adjusted, store the value.\r\n setPaneWidthSetting(data.value);\r\n },\r\n [setPaneWidthSetting]\r\n );\r\n const onPaneHeightChange = useCallback<NonNullable<UseResizeHandleParams[\"onChange\"]>>(\r\n (_event, data) => {\r\n // Whenever the height is adjusted, store the value.\r\n setPaneHeightSetting(data.value);\r\n },\r\n [setPaneHeightSetting]\r\n );\r\n\r\n // This manages the CSS variable that controls the width of the side pane.\r\n const paneWidthAdjustCSSVar = \"--pane-width-adjust\";\r\n const {\r\n elementRef: paneHorizontalResizeElementRef,\r\n handleRef: paneHorizontalResizeHandleRef,\r\n setValue: setPaneWidthAdjust,\r\n } = useResizeHandle({\r\n growDirection: location === \"left\" ? \"end\" : \"start\",\r\n relative: true,\r\n variableName: paneWidthAdjustCSSVar,\r\n variableTarget: \"element\",\r\n minValue: minWidth - defaultWidth,\r\n onChange: onPaneWidthChange,\r\n });\r\n\r\n // This manages the CSS variable that controls the height of the bottom pane.\r\n const paneHeightAdjustCSSVar = \"--pane-height-adjust\";\r\n const {\r\n elementRef: paneVerticalResizeElementRef,\r\n handleRef: paneVerticalResizeHandleRef,\r\n setValue: setPaneHeightAdjust,\r\n } = useResizeHandle({\r\n growDirection: \"up\",\r\n relative: true,\r\n variableName: paneHeightAdjustCSSVar,\r\n variableTarget: \"element\",\r\n onChange: onPaneHeightChange,\r\n });\r\n\r\n // Compose the Fluent hook's element ref callbacks with logic to apply stored settings when elements mount.\r\n // This is necessary because on the initial render, side pane elements may not be in the DOM yet (no panes\r\n // registered). The Fluent hook's setValue will silently fail when the element doesn't exist (in relative mode,\r\n // it measures the element before/after and reverts if unchanged, which always happens when the element is null).\r\n // By composing the ref callback, we ensure the stored value is applied immediately after the element mounts.\r\n const composedHorizontalElementRef = useCallback(\r\n (node: HTMLElement | null) => {\r\n paneHorizontalResizeElementRef(node);\r\n if (node) {\r\n setPaneWidthAdjust(paneWidthSettingRef.current);\r\n }\r\n },\r\n [paneHorizontalResizeElementRef, setPaneWidthAdjust]\r\n );\r\n const composedVerticalElementRef = useCallback(\r\n (node: HTMLElement | null) => {\r\n paneVerticalResizeElementRef(node);\r\n if (node) {\r\n setPaneHeightAdjust(paneHeightSettingRef.current);\r\n }\r\n },\r\n [paneVerticalResizeElementRef, setPaneHeightAdjust]\r\n );\r\n\r\n // Handle external setting changes (e.g. settings reset) after elements are already mounted.\r\n useLayoutEffect(() => {\r\n setPaneWidthAdjust(paneWidthSetting);\r\n setPaneHeightAdjust(paneHeightSetting);\r\n }, [paneWidthSetting, paneHeightSetting]);\r\n\r\n // This effect closes the window if all panes have been removed.\r\n useEffect(() => {\r\n if (isChildWindowOpen && topPanes.length === 0 && bottomPanes.length === 0) {\r\n childWindow.current?.close();\r\n }\r\n }, [childWindow, isChildWindowOpen, topPanes, bottomPanes]);\r\n\r\n // This memoizes the pane itself, which may or may not include the tab list, depending on the toolbar mode.\r\n const corePane = useMemo(() => {\r\n return (\r\n <>\r\n {/* If toolbar mode is \"compact\" then the top toolbar is embedded at the top of the pane. */}\r\n {toolbarMode === \"compact\" && (topPanes.length > 1 || topBarItems.length > 0) && (\r\n <>\r\n <div className={classes.barDiv}>\r\n {/* The tablist gets merged in with the toolbar. */}\r\n {!isChildWindowOpen && location === \"left\" && expandCollapseButton}\r\n {topPaneTabList}\r\n <Toolbar location=\"top\" components={topBarItems} />\r\n {!isChildWindowOpen && location === \"right\" && expandCollapseButton}\r\n </div>\r\n </>\r\n )}\r\n\r\n {/* Render the top pane content. */}\r\n {topPanes.length > 0 && (\r\n <div className={classes.paneContent}>\r\n {topSelectedTab && (\r\n <>\r\n <PaneHeader\r\n id={topSelectedTab.key}\r\n title={topSelectedTab.title}\r\n icon={topPanes.length > 1 ? undefined : topSelectedTab.icon}\r\n dockOptions={validTopDockOptions}\r\n />\r\n {/* Render all panes to retain their state even when they are not selected, but only display the selected pane. */}\r\n {topPanes\r\n .filter((pane) => pane.key === topSelectedTab.key || pane.keepMounted)\r\n .map((pane) => (\r\n <div key={pane.key} className={mergeClasses(classes.paneContent, pane.key !== topSelectedTab.key ? classes.unselectedPane : undefined)}>\r\n <ErrorBoundary name={pane.title}>\r\n <pane.content />\r\n </ErrorBoundary>\r\n </div>\r\n ))}\r\n </>\r\n )}\r\n </div>\r\n )}\r\n\r\n {/* If we have both top and bottom panes, show a divider. This divider is also the resizer for the bottom pane. */}\r\n {topPanes.length > 0 && bottomPanes.length > 0 && <Divider ref={paneVerticalResizeHandleRef} className={classes.paneDivider} />}\r\n\r\n {/* Render the bottom pane tablist. */}\r\n {bottomPanes.length > 1 && (\r\n <>\r\n <div className={classes.barDiv}>{bottomPaneTabList}</div>\r\n </>\r\n )}\r\n\r\n {/* Render the bottom pane content. This is the element that can be resized vertically. */}\r\n {bottomPanes.length > 0 && (\r\n <div\r\n ref={composedVerticalElementRef}\r\n className={classes.paneContent}\r\n style={{ height: `clamp(200px, calc(45% + var(${paneHeightAdjustCSSVar}, 0px)), 100% - 300px)`, flex: \"0 0 auto\" }}\r\n >\r\n {bottomSelectedTab && (\r\n <>\r\n <PaneHeader\r\n id={bottomSelectedTab.key}\r\n title={bottomSelectedTab.title}\r\n icon={bottomPanes.length > 1 ? undefined : bottomSelectedTab.icon}\r\n dockOptions={validBottomDockOptions}\r\n />\r\n {/* Render all panes to retain their state even when they are not selected, but only display the selected pane. */}\r\n {bottomPanes\r\n .filter((pane) => pane.key === bottomSelectedTab.key || pane.keepMounted)\r\n .map((pane) => (\r\n <div key={pane.key} className={mergeClasses(classes.paneContent, pane.key !== bottomSelectedTab.key ? classes.unselectedPane : undefined)}>\r\n <ErrorBoundary name={pane.title}>\r\n <pane.content />\r\n </ErrorBoundary>\r\n </div>\r\n ))}\r\n </>\r\n )}\r\n </div>\r\n )}\r\n\r\n {/* If toolbar mode is \"compact\" then the bottom toolbar is embedded at the bottom of the pane. */}\r\n {toolbarMode === \"compact\" && bottomBarItems.length > 0 && (\r\n <>\r\n <div className={classes.barDiv}>\r\n <Toolbar location=\"bottom\" components={bottomBarItems} />\r\n </div>\r\n </>\r\n )}\r\n </>\r\n );\r\n }, [\r\n topPanes,\r\n topSelectedTab,\r\n validTopDockOptions,\r\n bottomPanes,\r\n bottomSelectedTab,\r\n validBottomDockOptions,\r\n topBarItems,\r\n bottomBarItems,\r\n topPaneTabList,\r\n bottomPaneTabList,\r\n isChildWindowOpen,\r\n ]);\r\n\r\n // This deals with docked vs undocked state, where undocked is rendered into a separate window via a portal.\r\n const pane = useMemo(() => {\r\n return (\r\n <>\r\n {/* If there is no window state, then we are docked, so render the resizable div and the collapse container. */}\r\n {!isChildWindowOpen && (\r\n <div ref={paneContainerRef} className={classes.paneContainer}>\r\n {(topPanes.length > 0 || bottomPanes.length > 0) && (\r\n <div className={`${classes.pane} ${location === \"left\" ? classes.paneLeft : classes.paneRight}`}>\r\n <Collapse orientation=\"horizontal\" visible={!collapsed}>\r\n <div\r\n ref={composedHorizontalElementRef}\r\n className={classes.paneContainer}\r\n style={{ width: `clamp(${minWidth}px, calc(${defaultWidth}px + var(${paneWidthAdjustCSSVar}, 0px)), 1000px)` }}\r\n >\r\n {corePane}\r\n </div>\r\n </Collapse>\r\n {/* This is the resizer (width) for the pane container. */}\r\n <div\r\n ref={paneHorizontalResizeHandleRef}\r\n className={`${classes.resizer} ${location === \"left\" ? classes.resizerLeft : classes.resizerRight}`}\r\n style={{ pointerEvents: `${collapsed ? \"none\" : \"auto\"}` }}\r\n />\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n <ChildWindow imperativeRef={childWindow} onOpenChange={(isOpen) => setIsChildWindowOpen(isOpen)}>\r\n {corePane}\r\n </ChildWindow>\r\n </>\r\n );\r\n }, [collapsed, corePane]);\r\n\r\n const hasPanes = topPanes.length > 0 || bottomPanes.length > 0;\r\n\r\n return [topPaneTabList, pane, collapsed, setCollapsed, isChildWindowOpen, setUndocked, hasPanes] as const;\r\n}\r\n\r\nexport function MakeShellServiceDefinition({\r\n leftPaneDefaultWidth = 350,\r\n leftPaneMinWidth = 350,\r\n rightPaneDefaultWidth = 350,\r\n rightPaneMinWidth = 350,\r\n leftPaneDefaultCollapsed = false,\r\n rightPaneDefaultCollapsed = false,\r\n toolbarMode = \"full\",\r\n sidePaneRemapper = undefined,\r\n}: ShellServiceOptions = {}): ServiceDefinition<[IShellService, IRootComponentService], []> {\r\n return {\r\n friendlyName: \"Shell Service\",\r\n produces: [ShellServiceIdentity, RootComponentServiceIdentity],\r\n factory: () => {\r\n const toolbarItemCollection = new ObservableCollection<Readonly<ToolbarItemDefinition>>();\r\n const sidePaneCollection = new ObservableCollection<Readonly<SidePaneDefinition>>();\r\n const centralContentCollection = new ObservableCollection<Readonly<CentralContentDefinition>>();\r\n\r\n const onSelectSidePane = new Observable<string>(undefined, true);\r\n\r\n const onDockChanged = new Observable<{ location: HorizontalLocation; dock: boolean }>(undefined, true);\r\n const onCollapseChanged = new Observable<{ location: HorizontalLocation; collapsed: boolean }>();\r\n const leftSidePaneContainerState = {\r\n isPresent: false,\r\n isDocked: true,\r\n dock: () => onDockChanged.notifyObservers({ location: \"left\", dock: true }),\r\n undock: () => onDockChanged.notifyObservers({ location: \"left\", dock: false }),\r\n isCollapsed: leftPaneDefaultCollapsed,\r\n collapse: () => onCollapseChanged.notifyObservers({ location: \"left\", collapsed: true }),\r\n expand: () => onCollapseChanged.notifyObservers({ location: \"left\", collapsed: false }),\r\n };\r\n const rightSidePaneContainerState = {\r\n isPresent: false,\r\n isDocked: true,\r\n dock: () => onDockChanged.notifyObservers({ location: \"right\", dock: true }),\r\n undock: () => onDockChanged.notifyObservers({ location: \"right\", dock: false }),\r\n isCollapsed: rightPaneDefaultCollapsed,\r\n collapse: () => onCollapseChanged.notifyObservers({ location: \"right\", collapsed: true }),\r\n expand: () => onCollapseChanged.notifyObservers({ location: \"right\", collapsed: false }),\r\n };\r\n\r\n const rootComponent: FunctionComponent = () => {\r\n const classes = useStyles();\r\n\r\n const [sidePaneDockOverrides, setSidePaneDockOverrides] = useSetting(SidePaneDockOverridesSettingDescriptor);\r\n\r\n // This function returns a promise that resolves after the dock change takes effect so that\r\n // we can then select the re-docked pane.\r\n const pendingPaneReselects = useRef<string[]>([]);\r\n const updateSidePaneDockOverride = useCallback(\r\n (key: string, horizontalLocation: HorizontalLocation, verticalLocation: VerticalLocation) => {\r\n setSidePaneDockOverrides((current) => ({\r\n ...current,\r\n [key]: { horizontalLocation, verticalLocation },\r\n }));\r\n\r\n pendingPaneReselects.current.push(key);\r\n },\r\n [setSidePaneDockOverrides]\r\n );\r\n\r\n const toolbarItems = useOrderedObservableCollection(toolbarItemCollection);\r\n\r\n const sidePanes = useOrderedObservableCollection(sidePaneCollection);\r\n const coercedSidePaneCache = useRef(new Map<string, SidePaneDefinition>());\r\n const coercedSidePanes = useMemo(() => {\r\n // First pass - apply overrides and respect the side pane mode.\r\n const coercedSidePanes = sidePanes\r\n .map((sidePaneDefinition) => {\r\n let coercedSidePane = coercedSidePaneCache.current.get(sidePaneDefinition.key);\r\n if (!coercedSidePane) {\r\n coercedSidePane = { ...sidePaneDefinition };\r\n coercedSidePaneCache.current.set(sidePaneDefinition.key, coercedSidePane);\r\n }\r\n\r\n const override = sidePaneDockOverrides[sidePaneDefinition.key];\r\n if (override) {\r\n // Override (user manually re-docked) has the highest priority.\r\n coercedSidePane.horizontalLocation = override.horizontalLocation;\r\n coercedSidePane.verticalLocation = override.verticalLocation;\r\n } else if (sidePaneRemapper) {\r\n // A side pane remapper has the next highest priority.\r\n const remapping = sidePaneRemapper(sidePaneDefinition);\r\n if (!remapping) {\r\n coercedSidePane = undefined;\r\n } else {\r\n coercedSidePane.horizontalLocation = remapping.horizontalLocation;\r\n coercedSidePane.verticalLocation = remapping.verticalLocation;\r\n }\r\n } else {\r\n // Otherwise use the default defined location.\r\n coercedSidePane.horizontalLocation = sidePaneDefinition.horizontalLocation;\r\n coercedSidePane.verticalLocation = sidePaneDefinition.verticalLocation;\r\n }\r\n\r\n return coercedSidePane;\r\n })\r\n .filter((sidePane): sidePane is SidePaneDefinition => !!sidePane);\r\n\r\n // Second pass - correct any invalid state, specifically if there are only bottom panes, force them to be top panes.\r\n for (const side of [\"left\", \"right\"] as const) {\r\n const topPanes = coercedSidePanes.filter((entry) => entry.horizontalLocation === side && entry.verticalLocation === \"top\");\r\n const bottomPanes = coercedSidePanes.filter((entry) => entry.horizontalLocation === side && entry.verticalLocation === \"bottom\");\r\n if (bottomPanes.length > 0 && topPanes.length === 0) {\r\n for (const pane of bottomPanes) {\r\n pane.verticalLocation = \"top\";\r\n updateSidePaneDockOverride(pane.key, side, \"top\");\r\n }\r\n }\r\n }\r\n\r\n // Cleanup any cached panes that are no longer present.\r\n for (const key of coercedSidePaneCache.current.keys()) {\r\n if (!coercedSidePanes.some((entry) => entry.key === key)) {\r\n coercedSidePaneCache.current.delete(key);\r\n }\r\n }\r\n\r\n return coercedSidePanes;\r\n }, [sidePanes, sidePaneDockOverrides, updateSidePaneDockOverride, sidePaneRemapper]);\r\n\r\n useEffect(() => {\r\n for (const paneKey of pendingPaneReselects.current.splice(0)) {\r\n onSelectSidePane.notifyObservers(paneKey);\r\n }\r\n }, [coercedSidePanes]);\r\n\r\n const sidePaneDockOperations = useMemo(() => {\r\n const sidePaneDockOperations = new Map<DockLocation, (sidePaneKey: string) => void>();\r\n for (const side of [\"left\", \"right\"] as const) {\r\n const currentSidePanes = coercedSidePanes.filter((entry) => entry.horizontalLocation === side);\r\n\r\n const dockTop = (sidePaneKey: string) => {\r\n updateSidePaneDockOverride(sidePaneKey, side, \"top\");\r\n };\r\n const dockBottom = (sidePaneKey: string) => {\r\n updateSidePaneDockOverride(sidePaneKey, side, \"bottom\");\r\n };\r\n\r\n if (currentSidePanes.some((entry) => entry.verticalLocation === \"bottom\")) {\r\n // If there are bottom panes, there must also be top panes, and so top and bottom are valid locations.\r\n sidePaneDockOperations.set(`top-${side}`, dockTop);\r\n sidePaneDockOperations.set(`bottom-${side}`, dockBottom);\r\n } else if (currentSidePanes.length > 0) {\r\n // If there are only top panes, then full and bottom are valid locations.\r\n sidePaneDockOperations.set(`full-${side}`, dockTop);\r\n sidePaneDockOperations.set(`bottom-${side}`, dockBottom);\r\n } else {\r\n // If there are no panes, then only full is a valid location.\r\n sidePaneDockOperations.set(`full-${side}`, dockTop);\r\n }\r\n }\r\n return sidePaneDockOperations;\r\n }, [coercedSidePanes]);\r\n\r\n const hasLeftPanes = coercedSidePanes.some((entry) => entry.horizontalLocation === \"left\");\r\n const hasRightPanes = coercedSidePanes.some((entry) => entry.horizontalLocation === \"right\");\r\n\r\n useEffect(() => {\r\n leftSidePaneContainerState.isPresent = hasLeftPanes;\r\n rightSidePaneContainerState.isPresent = hasRightPanes;\r\n\r\n return () => {\r\n leftSidePaneContainerState.isPresent = false;\r\n rightSidePaneContainerState.isPresent = false;\r\n };\r\n }, [hasLeftPanes, hasRightPanes]);\r\n\r\n // If we are in compact toolbar mode, we may need to move toolbar items from the left to the right or vice versa,\r\n // depending on whether there are any side panes on that side.\r\n const coerceToolBarItemHorizontalLocation = useMemo(\r\n () => (item: Readonly<ToolbarItemDefinition>) => {\r\n let horizontalLocation = item.horizontalLocation;\r\n // Coercion is only needed in compact toolbar mode since there might not be a left or right pane.\r\n if (toolbarMode === \"compact\") {\r\n if (horizontalLocation === \"left\" && !hasLeftPanes) {\r\n horizontalLocation = \"right\";\r\n }\r\n if (horizontalLocation === \"right\" && !hasRightPanes) {\r\n horizontalLocation = \"left\";\r\n }\r\n }\r\n return horizontalLocation;\r\n },\r\n [toolbarMode, hasLeftPanes, hasRightPanes]\r\n );\r\n\r\n const topToolBarItems = useMemo(() => toolbarItems.filter((entry) => entry.verticalLocation === \"top\"), [toolbarItems]);\r\n const bottomToolBarItems = useMemo(() => toolbarItems.filter((entry) => entry.verticalLocation === \"bottom\"), [toolbarItems]);\r\n\r\n const topBarLeftItems = useMemo(\r\n () => topToolBarItems.filter((entry) => coerceToolBarItemHorizontalLocation(entry) === \"left\"),\r\n [topToolBarItems, coerceToolBarItemHorizontalLocation]\r\n );\r\n const topBarRightItems = useMemo(\r\n () => topToolBarItems.filter((entry) => coerceToolBarItemHorizontalLocation(entry) === \"right\"),\r\n [topToolBarItems, coerceToolBarItemHorizontalLocation]\r\n );\r\n const bottomBarLeftItems = useMemo(\r\n () => bottomToolBarItems.filter((entry) => coerceToolBarItemHorizontalLocation(entry) === \"left\"),\r\n [bottomToolBarItems, coerceToolBarItemHorizontalLocation]\r\n );\r\n const bottomBarRightItems = useMemo(\r\n () => bottomToolBarItems.filter((entry) => coerceToolBarItemHorizontalLocation(entry) === \"right\"),\r\n [bottomToolBarItems, coerceToolBarItemHorizontalLocation]\r\n );\r\n\r\n const centralContents = useOrderedObservableCollection(centralContentCollection);\r\n\r\n const [leftPaneTabList, leftPane, leftPaneCollapsed, setLeftPaneCollapsed, leftPaneUndocked, setLeftPaneUndocked, leftPaneHasPanes] = usePane(\r\n \"left\",\r\n leftPaneDefaultWidth,\r\n leftPaneMinWidth,\r\n coercedSidePanes,\r\n onSelectSidePane,\r\n sidePaneDockOperations,\r\n toolbarMode,\r\n topBarLeftItems,\r\n bottomBarLeftItems,\r\n leftPaneDefaultCollapsed\r\n );\r\n\r\n useEffect(() => {\r\n // Propagate shorter lived React component state out to longer lived service state.\r\n leftSidePaneContainerState.isDocked = !leftPaneUndocked;\r\n }, [leftPaneUndocked]);\r\n\r\n useEffect(() => {\r\n // Propagate shorter lived React component state out to longer lived service state.\r\n leftSidePaneContainerState.isCollapsed = leftPaneCollapsed;\r\n }, [leftPaneCollapsed]);\r\n\r\n const [rightPaneTabList, rightPane, rightPaneCollapsed, setRightPaneCollapsed, rightPaneUndocked, setRightPaneUndocked, rightPaneHasPanes] = usePane(\r\n \"right\",\r\n rightPaneDefaultWidth,\r\n rightPaneMinWidth,\r\n coercedSidePanes,\r\n onSelectSidePane,\r\n sidePaneDockOperations,\r\n toolbarMode,\r\n topBarRightItems,\r\n bottomBarRightItems,\r\n rightPaneDefaultCollapsed\r\n );\r\n\r\n useEffect(() => {\r\n // Propagate shorter lived React component state out to longer lived service state.\r\n rightSidePaneContainerState.isDocked = !rightPaneUndocked;\r\n }, [rightPaneUndocked]);\r\n\r\n useEffect(() => {\r\n // Propagate shorter lived React component state out to longer lived service state.\r\n rightSidePaneContainerState.isCollapsed = rightPaneCollapsed;\r\n }, [rightPaneCollapsed]);\r\n\r\n useEffect(() => {\r\n // If at the service level dock state change is requested, propagate to the React component state.\r\n const observer = onDockChanged.add(({ location, dock }) => {\r\n if (location === \"left\") {\r\n setLeftPaneUndocked(!dock);\r\n } else {\r\n setRightPaneUndocked(!dock);\r\n }\r\n });\r\n\r\n return () => {\r\n observer.remove();\r\n leftSidePaneContainerState.isDocked = true;\r\n rightSidePaneContainerState.isDocked = true;\r\n };\r\n }, [setLeftPaneUndocked, setRightPaneUndocked]);\r\n\r\n useEffect(() => {\r\n // If at the service level collapse state change is requested, propagate to the React component state.\r\n const observer = onCollapseChanged.add(({ location, collapsed }) => {\r\n if (location === \"left\") {\r\n setLeftPaneCollapsed(collapsed);\r\n } else {\r\n setRightPaneCollapsed(collapsed);\r\n }\r\n });\r\n\r\n return () => {\r\n observer.remove();\r\n leftSidePaneContainerState.isCollapsed = false;\r\n rightSidePaneContainerState.isCollapsed = false;\r\n };\r\n }, [setLeftPaneCollapsed, setRightPaneCollapsed]);\r\n\r\n return (\r\n <div className={classes.mainView}>\r\n {/* Only render the top toolbar if the toolbar mode is \"full\". Otherwise it will be embedded at the top of the side panes. */}\r\n {toolbarMode === \"full\" && (\r\n <>\r\n <div className={classes.barDiv}>\r\n {leftPaneTabList}\r\n <Toolbar location=\"top\" components={topToolBarItems} />\r\n {rightPaneTabList}\r\n </div>\r\n </>\r\n )}\r\n\r\n {/* This renders the side panes and the main/central content. */}\r\n <div className={classes.verticallyCentralContent}>\r\n {/* Render the left pane container. */}\r\n {leftPane}\r\n\r\n {/* Render the main/central content. */}\r\n <div className={classes.centralContent}>\r\n {centralContents.map((entry) => (\r\n <ErrorBoundary key={entry.key} name={entry.key}>\r\n <entry.component />\r\n </ErrorBoundary>\r\n ))}\r\n {toolbarMode === \"compact\" && (\r\n <>\r\n <FluentFade visible={leftPaneCollapsed && leftPaneHasPanes} delay={50} duration={100} unmountOnExit>\r\n <div className={mergeClasses(classes.expandButtonContainer, classes.expandButtonContainerLeft)}>\r\n <Tooltip content=\"Show Side Pane\">\r\n <Button className={classes.expandButton} icon={<PanelLeftExpandRegular />} onClick={() => setLeftPaneCollapsed(false)} />\r\n </Tooltip>\r\n </div>\r\n </FluentFade>\r\n <FluentFade visible={rightPaneCollapsed && rightPaneHasPanes} delay={50} duration={100} unmountOnExit>\r\n <div className={mergeClasses(classes.expandButtonContainer, classes.expandButtonContainerRight)}>\r\n <Tooltip content=\"Show Side Pane\">\r\n <Button className={classes.expandButton} icon={<PanelRightExpandRegular />} onClick={() => setRightPaneCollapsed(false)} />\r\n </Tooltip>\r\n </div>\r\n </FluentFade>\r\n </>\r\n )}\r\n </div>\r\n\r\n {/* Render the right pane container. */}\r\n {rightPane}\r\n </div>\r\n\r\n {/* Only render the bottom toolbar if the toolbar mode is \"full\". Otherwise it will be embedded at the bottom of the side panes. */}\r\n {toolbarMode === \"full\" && (\r\n <>\r\n <div className={classes.barDiv}>\r\n <Toolbar location=\"bottom\" components={bottomToolBarItems} />\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n );\r\n };\r\n rootComponent.displayName = \"Shell Service Root\";\r\n\r\n return {\r\n addToolbarItem: (entry) => {\r\n if (!entry.component.displayName) {\r\n entry.component.displayName = `${entry.key} | ${entry.verticalLocation} ${entry.horizontalLocation} bar item`;\r\n }\r\n\r\n return toolbarItemCollection.add(entry);\r\n },\r\n addSidePane: (entry) => {\r\n if (!entry.content.displayName) {\r\n entry.content.displayName = `${entry.key} | ${entry.horizontalLocation} pane`;\r\n }\r\n\r\n return sidePaneCollection.add(entry);\r\n },\r\n addCentralContent: (entry) => centralContentCollection.add(entry),\r\n get leftSidePaneContainer() {\r\n return leftSidePaneContainerState.isPresent ? leftSidePaneContainerState : null;\r\n },\r\n get rightSidePaneContainer() {\r\n return rightSidePaneContainerState.isPresent ? rightSidePaneContainerState : null;\r\n },\r\n onDockChanged,\r\n get sidePanes() {\r\n return [...sidePaneCollection.items].map((sidePaneDefinition) => {\r\n return {\r\n key: sidePaneDefinition.key,\r\n select: () => onSelectSidePane.notifyObservers(sidePaneDefinition.key),\r\n };\r\n });\r\n },\r\n rootComponent,\r\n };\r\n },\r\n };\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onerjs/shared-ui-components",
3
- "version": "8.50.4",
3
+ "version": "8.50.6",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,35 +0,0 @@
1
- export type GrowDirection = "end" | "start" | "up" | "down";
2
- export type UseResizeHandleParams = {
3
- /**
4
- * The direction in which the element is considered growing in size ('end', 'start', 'up', or 'down').
5
- */
6
- growDirection: GrowDirection;
7
- /**
8
- * The name of the CSS variable that will be set on the wrapper element to reflect the current size of the element.
9
- */
10
- variableName: string;
11
- /**
12
- * A callback that will be called when the element is resized.
13
- *
14
- * @remarks The passed function should be memoized for better performance.
15
- */
16
- onChange?: (value: number) => void;
17
- /**
18
- * The minimum change allowed (e.g. the smallest negative number allowed).
19
- */
20
- minValue?: number;
21
- /**
22
- * The maximum change allowed (e.g. the largest positive number allowed).
23
- */
24
- maxValue?: number;
25
- };
26
- /**
27
- * A custom hook that helps with element resizing.
28
- * @param params The parameters for the resize handle.
29
- * @returns An object containing refs and a function to set the value.
30
- */
31
- export declare function useResizeHandle(params: UseResizeHandleParams): {
32
- elementRef: import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
33
- handleRef: import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
34
- setValue: (value: number) => void;
35
- };
@@ -1,75 +0,0 @@
1
- // NOTE: This is basically a super simplified version of https://github.com/microsoft/fluentui-contrib/blob/main/packages/react-resize-handle/src/hooks
2
- // This version does not support keyboard interactions, absolute values, automatically clamping to the actual adjusted size, accessibility, and various other features.
3
- // We can switch back to Fluent's implementation once some known bugs are fixed:
4
- // 1. https://github.com/microsoft/fluentui-contrib/issues/523
5
- // 2. React 19 compatibility
6
- import { useCallback, useEffect, useRef, useState } from "react";
7
- import { Clamp } from "@onerjs/core/Maths/math.scalar.functions.js";
8
- /**
9
- * A custom hook that helps with element resizing.
10
- * @param params The parameters for the resize handle.
11
- * @returns An object containing refs and a function to set the value.
12
- */
13
- export function useResizeHandle(params) {
14
- const { growDirection, variableName, onChange } = params;
15
- const valueRef = useRef(0);
16
- const [elementRef, setElementRef] = useState(null);
17
- const [handleRef, setHandleRef] = useState(null);
18
- const updateElementStyle = useCallback((value) => {
19
- if (elementRef) {
20
- elementRef.style.setProperty(variableName, `${value}px`);
21
- }
22
- }, [elementRef, variableName]);
23
- const setValue = useCallback((value) => {
24
- valueRef.current = value;
25
- updateElementStyle(value);
26
- onChange?.(value);
27
- }, [updateElementStyle, onChange]);
28
- useEffect(() => {
29
- updateElementStyle(valueRef.current);
30
- }, [updateElementStyle]);
31
- useEffect(() => {
32
- if (handleRef) {
33
- let delta = 0;
34
- const coerceDelta = (delta) => Clamp(delta, params.minValue ?? -Infinity, params.maxValue ?? Infinity);
35
- const onPointerMove = (event) => {
36
- event.preventDefault();
37
- switch (growDirection) {
38
- case "up":
39
- delta -= event.movementY;
40
- break;
41
- case "down":
42
- delta += event.movementY;
43
- break;
44
- case "start":
45
- delta -= event.movementX;
46
- break;
47
- case "end":
48
- delta += event.movementX;
49
- break;
50
- }
51
- setValue(coerceDelta(delta));
52
- };
53
- const onPointerDown = (event) => {
54
- event.preventDefault();
55
- delta = valueRef.current;
56
- handleRef.setPointerCapture(event.pointerId);
57
- handleRef.addEventListener("pointermove", onPointerMove);
58
- };
59
- const onPointerUp = (event) => {
60
- event.preventDefault();
61
- handleRef.releasePointerCapture(event.pointerId);
62
- handleRef.removeEventListener("pointermove", onPointerMove);
63
- valueRef.current = coerceDelta(valueRef.current);
64
- };
65
- handleRef.addEventListener("pointerdown", onPointerDown);
66
- handleRef.addEventListener("pointerup", onPointerUp);
67
- }
68
- }, [handleRef, setValue]);
69
- return {
70
- elementRef: setElementRef,
71
- handleRef: setHandleRef,
72
- setValue,
73
- };
74
- }
75
- //# sourceMappingURL=useResizeHandle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useResizeHandle.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/modularTool/hooks/useResizeHandle.ts"],"names":[],"mappings":"AAAA,uJAAuJ;AACvJ,uKAAuK;AACvK,gFAAgF;AAChF,8DAA8D;AAC9D,4BAA4B;AAE5B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AA6BzD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAA6B;IACzD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAEzD,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC3B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC,CAAC;IACvE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC,CAAC;IAErE,MAAM,kBAAkB,GAAG,WAAW,CAClC,CAAC,KAAa,EAAE,EAAE;QACd,IAAI,UAAU,EAAE,CAAC;YACb,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,YAAY,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;QAC7D,CAAC;IACL,CAAC,EACD,CAAC,UAAU,EAAE,YAAY,CAAC,CAC7B,CAAC;IAEF,MAAM,QAAQ,GAAG,WAAW,CACxB,CAAC,KAAa,EAAE,EAAE;QACd,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;QACzB,kBAAkB,CAAC,KAA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C,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;YAC7D,CAAC,CAAC;YAEF,MAAM,WAAW,GAAG,CAAC,KAAmB,EAAE,EAAE;gBACxC,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,SAAS,CAAC,qBAAqB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;gBACjD,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;gBAC5D,QAAQ,CAAC,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACrD,CAAC,CAAC;YAEF,SAAS,CAAC,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;YACzD,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QACzD,CAAC;IACL,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE1B,OAAO;QACH,UAAU,EAAE,aAAa;QACzB,SAAS,EAAE,YAAY;QACvB,QAAQ;KACX,CAAC;AACN,CAAC","sourcesContent":["// NOTE: This is basically a super simplified version of https://github.com/microsoft/fluentui-contrib/blob/main/packages/react-resize-handle/src/hooks\r\n// This version does not support keyboard interactions, absolute values, automatically clamping to the actual adjusted size, accessibility, and various other features.\r\n// We can switch back to Fluent's implementation once some known bugs are fixed:\r\n// 1. https://github.com/microsoft/fluentui-contrib/issues/523\r\n// 2. React 19 compatibility\r\n\r\nimport { useCallback, useEffect, useRef, useState } from \"react\";\r\n\r\nimport { Clamp } from \"core/Maths/math.scalar.functions\";\r\n\r\nexport type GrowDirection = \"end\" | \"start\" | \"up\" | \"down\";\r\n\r\nexport type UseResizeHandleParams = {\r\n /**\r\n * The direction in which the element is considered growing in size ('end', 'start', 'up', or 'down').\r\n */\r\n growDirection: GrowDirection;\r\n /**\r\n * The name of the CSS variable that will be set on the wrapper element to reflect the current size of the element.\r\n */\r\n variableName: string;\r\n /**\r\n * A callback that will be called when the element is resized.\r\n *\r\n * @remarks The passed function should be memoized for better performance.\r\n */\r\n onChange?: (value: number) => void;\r\n /**\r\n * The minimum change allowed (e.g. the smallest negative number allowed).\r\n */\r\n minValue?: number;\r\n /**\r\n * The maximum change allowed (e.g. the largest positive number allowed).\r\n */\r\n maxValue?: number;\r\n};\r\n\r\n/**\r\n * A custom hook that helps with element resizing.\r\n * @param params The parameters for the resize handle.\r\n * @returns An object containing refs and a function to set the value.\r\n */\r\nexport function useResizeHandle(params: UseResizeHandleParams) {\r\n const { growDirection, variableName, onChange } = params;\r\n\r\n const valueRef = useRef(0);\r\n const [elementRef, setElementRef] = useState<HTMLElement | null>(null);\r\n const [handleRef, setHandleRef] = useState<HTMLElement | null>(null);\r\n\r\n const updateElementStyle = useCallback(\r\n (value: number) => {\r\n if (elementRef) {\r\n elementRef.style.setProperty(variableName, `${value}px`);\r\n }\r\n },\r\n [elementRef, variableName]\r\n );\r\n\r\n const setValue = useCallback(\r\n (value: number) => {\r\n valueRef.current = value;\r\n updateElementStyle(value);\r\n onChange?.(value);\r\n },\r\n [updateElementStyle, onChange]\r\n );\r\n\r\n useEffect(() => {\r\n updateElementStyle(valueRef.current);\r\n }, [updateElementStyle]);\r\n\r\n useEffect(() => {\r\n if (handleRef) {\r\n let delta = 0;\r\n\r\n const coerceDelta = (delta: number) => Clamp(delta, params.minValue ?? -Infinity, params.maxValue ?? Infinity);\r\n\r\n const onPointerMove = (event: PointerEvent) => {\r\n event.preventDefault();\r\n switch (growDirection) {\r\n case \"up\":\r\n delta -= event.movementY;\r\n break;\r\n case \"down\":\r\n delta += event.movementY;\r\n break;\r\n case \"start\":\r\n delta -= event.movementX;\r\n break;\r\n case \"end\":\r\n delta += event.movementX;\r\n break;\r\n }\r\n setValue(coerceDelta(delta));\r\n };\r\n\r\n const onPointerDown = (event: PointerEvent) => {\r\n event.preventDefault();\r\n delta = valueRef.current;\r\n handleRef.setPointerCapture(event.pointerId);\r\n handleRef.addEventListener(\"pointermove\", onPointerMove);\r\n };\r\n\r\n const onPointerUp = (event: PointerEvent) => {\r\n event.preventDefault();\r\n handleRef.releasePointerCapture(event.pointerId);\r\n handleRef.removeEventListener(\"pointermove\", onPointerMove);\r\n valueRef.current = coerceDelta(valueRef.current);\r\n };\r\n\r\n handleRef.addEventListener(\"pointerdown\", onPointerDown);\r\n handleRef.addEventListener(\"pointerup\", onPointerUp);\r\n }\r\n }, [handleRef, setValue]);\r\n\r\n return {\r\n elementRef: setElementRef,\r\n handleRef: setHandleRef,\r\n setValue,\r\n };\r\n}\r\n"]}