@corva/ui 3.76.0-8 → 3.76.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MCP_README.md +86 -36
- package/README.md +8 -5
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/cjs-bundle/componentsV2/AppCommonsProvider/AppCommonsContext.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.constants.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.constants.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.scss.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/useResponsivity.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/useResponsivity.js.map +1 -1
- package/cjs-bundle/componentsV2/AppPanel/AppPanelDisplay.js +1 -1
- package/cjs-bundle/componentsV2/AppPanel/AppPanelDisplay.js.map +1 -1
- package/cjs-bundle/componentsV2/DatePicker/TimePicker/TimePicker.js +1 -1
- package/cjs-bundle/componentsV2/DatePicker/TimePicker/TimePicker.js.map +1 -1
- package/cjs-bundle/componentsV2/DatePicker/utils.js +1 -1
- package/cjs-bundle/componentsV2/DatePicker/utils.js.map +1 -1
- package/cjs-bundle/componentsV2/Modal/Modal.js +1 -1
- package/cjs-bundle/componentsV2/Modal/Modal.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useInitialize.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/useInitialize.js.map +1 -1
- package/cjs-bundle/effects/useDevCenterApp.js +1 -1
- package/cjs-bundle/effects/useDevCenterApp.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts +2 -9
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/componentsV2/AppCommonsProvider/AppCommonsContext.d.ts +19 -6
- package/componentsV2/AppCommonsProvider/AppCommonsContext.d.ts.map +1 -1
- package/componentsV2/AppCommonsProvider/AppCommonsContext.js.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.d.ts +1 -0
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.js +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.js.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.js +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.js.map +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.scss.js +1 -1
- package/componentsV2/AppHeader/V3/useResponsivity.js +1 -1
- package/componentsV2/AppHeader/V3/useResponsivity.js.map +1 -1
- package/componentsV2/AppHeader/__tests__/AppHeaderEmbedded.test.d.ts +2 -0
- package/componentsV2/AppHeader/__tests__/AppHeaderEmbedded.test.d.ts.map +1 -0
- package/componentsV2/AppPanel/AppPanelDisplay.d.ts.map +1 -1
- package/componentsV2/AppPanel/AppPanelDisplay.js +1 -1
- package/componentsV2/AppPanel/AppPanelDisplay.js.map +1 -1
- package/componentsV2/DatePicker/TimePicker/TimePicker.js +1 -1
- package/componentsV2/DatePicker/TimePicker/TimePicker.js.map +1 -1
- package/componentsV2/DatePicker/utils.js +1 -1
- package/componentsV2/DatePicker/utils.js.map +1 -1
- package/componentsV2/Modal/Modal.d.ts.map +1 -1
- package/componentsV2/Modal/Modal.js +1 -1
- package/componentsV2/Modal/Modal.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useInitialize.d.ts.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useInitialize.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/useInitialize.js.map +1 -1
- package/effects/useDevCenterApp.d.ts.map +1 -1
- package/effects/useDevCenterApp.js +1 -1
- package/effects/useDevCenterApp.js.map +1 -1
- package/mcp-server/server.mjs +11 -11
- package/package.json +1 -1
- package/styles/common.scss +0 -14
- package/styles/mixins.scss +0 -14
- package/tsconfig.tsbuildinfo +1 -1
package/MCP_README.md
CHANGED
|
@@ -22,9 +22,10 @@ supports Claude Code, Cursor, and Codex CLI.
|
|
|
22
22
|
|
|
23
23
|
### Available Tools
|
|
24
24
|
|
|
25
|
-
- `search_corva_ui` - Search components, hooks, utils by name or description. When
|
|
26
|
-
`
|
|
27
|
-
discovers a candidate.
|
|
25
|
+
- `search_corva_ui` - Search components, hooks, utils by name or description. When a search restricted to one
|
|
26
|
+
`category` (`v2` or `v1`) returns nothing at all and components from the other version do match, the response
|
|
27
|
+
surfaces them in a labeled fallback block so a single search still discovers a candidate. Any hook or util hit
|
|
28
|
+
already counts as a result and suppresses the fallback.
|
|
28
29
|
- `get_component_docs` - Get detailed component documentation with props and examples
|
|
29
30
|
- `get_hook_docs` - Get hook documentation
|
|
30
31
|
- `get_theme_docs` - Get theme/styling documentation
|
|
@@ -62,7 +63,7 @@ MCP prompts are surfaced as slash commands in clients that support them. In Clau
|
|
|
62
63
|
`/mcp__corva-ui__<name>`.
|
|
63
64
|
|
|
64
65
|
- `figma_to_code` — Translate a Figma node into React components that follow `@corva/ui` conventions. Orchestrates the
|
|
65
|
-
Figma
|
|
66
|
+
Figma MCP server (for design context and Code Connect mappings) and the `@corva/ui` MCP tools above (for component,
|
|
66
67
|
icon, theme, and hook lookups).
|
|
67
68
|
|
|
68
69
|
**Argument** (optional; the assistant asks if missing):
|
|
@@ -81,9 +82,12 @@ MCP prompts are surfaced as slash commands in clients that support them. In Clau
|
|
|
81
82
|
/mcp__corva-ui__figma_to_code https://www.figma.com/design/ABC/Sample?node-id=1-2 create under src/apps/drilling/RigStatusCard.tsx
|
|
82
83
|
```
|
|
83
84
|
|
|
84
|
-
**Prerequisite:**
|
|
85
|
-
`
|
|
86
|
-
|
|
85
|
+
**Prerequisite:** a Figma MCP server must be connected in the same client session so the prompt can call its
|
|
86
|
+
`get_design_context` tool (the prompt detects the server alias itself). Either connect Figma's remote server
|
|
87
|
+
(`https://mcp.figma.com/mcp`, browser OAuth — Figma's recommended option) or enable the desktop one: open the file in
|
|
88
|
+
Figma Desktop, switch to Dev Mode (`Shift+D`) and click **Enable desktop MCP server** in the MCP server section of the
|
|
89
|
+
inspect panel, then register `http://127.0.0.1:3845/mcp` as an HTTP MCP server in your client — enabling it in Figma
|
|
90
|
+
alone does not connect it. Reconnect or restart your client afterwards.
|
|
87
91
|
|
|
88
92
|
**Scope:** primarily consumer mode — app repos that depend on `@corva/ui` and import from its entry points. Authoring
|
|
89
93
|
mode (inside the `@corva/ui` repo itself) is auto-detected from `package.json` and adjusts output conventions.
|
|
@@ -190,7 +194,14 @@ stays scoped and minimal, and raw sample values are never pasted into committed
|
|
|
190
194
|
> to [Verifying It Works](#verifying-it-works). Older projects scaffolded before MCP was added to the template still
|
|
191
195
|
> need the setup below.
|
|
192
196
|
|
|
193
|
-
> **Minimum Version:**
|
|
197
|
+
> **Minimum Version:** the `npx … corva-ui-mcp` configs work from `@corva/ui` **3.44.0**; the Quick Setup command and
|
|
198
|
+
> the direct `server.mjs` paths need **3.46.0** or newer. Tool and prompt descriptions in this document match current
|
|
199
|
+
> releases.
|
|
200
|
+
|
|
201
|
+
> **Node:** `@corva/ui` declares `engines.node: ^24`, so use Node 24.x for the setup command and the server. Other
|
|
202
|
+
> majors are outside that range: npm prints an unsupported-engine warning when it installs the package, and Yarn
|
|
203
|
+
> classic normally rejects the install unless engine checks are disabled. The nvm examples below assume a Node 24
|
|
204
|
+
> install.
|
|
194
205
|
|
|
195
206
|
### Quick Setup
|
|
196
207
|
|
|
@@ -204,7 +215,12 @@ This creates `.mcp.json` (Claude Code), `.cursor/mcp.json` (Cursor), and `.codex
|
|
|
204
215
|
Restart your IDE or reload MCP servers afterward.
|
|
205
216
|
|
|
206
217
|
> If any of these files already exist, the setup command **extends** them — your existing MCP server entries are
|
|
207
|
-
> preserved, and only the `corva-ui` entry is added or updated.
|
|
218
|
+
> preserved, and only the `corva-ui` entry (`corva_ui` in the Codex TOML) is added or updated. "Updated" means replaced
|
|
219
|
+
> with the stock entry: anything you added to it by hand, such as an `env` block with
|
|
220
|
+
> `CORVA_UI_MCP_TELEMETRY_DISABLED`, is dropped and has to be re-added. The files are re-serialized on write, so
|
|
221
|
+
> comments and hand formatting in the TOML do not survive either. A file that fails to parse is overwritten from
|
|
222
|
+
> scratch (the command warns when it does that). On native Windows the generated entry uses plain `npx`; if your client
|
|
223
|
+
> cannot spawn it, apply the `cmd /c` form from the Native Windows note under [Local Setup](#local-setup-recommended).
|
|
208
224
|
|
|
209
225
|
> **Monorepo:** Run the setup command from the monorepo root, not from individual
|
|
210
226
|
> `apps/*` directories. See [Monorepo Setup](#monorepo-setup) for details.
|
|
@@ -277,11 +293,12 @@ issues, always in sync with your project's `@corva/ui` version.
|
|
|
277
293
|
}
|
|
278
294
|
```
|
|
279
295
|
|
|
280
|
-
2. Restart Cursor or
|
|
296
|
+
2. Restart Cursor (or toggle the `corva-ui` server off and on under **Customize** in the sidebar)
|
|
281
297
|
|
|
282
|
-
3.
|
|
298
|
+
3. Servers from `.cursor/mcp.json` show up under **Customize** in the sidebar, where they can be enabled or disabled.
|
|
299
|
+
If one fails to start, its output is in the Output panel under "MCP Logs".
|
|
283
300
|
|
|
284
|
-
4. Verify: In
|
|
301
|
+
4. Verify: In the agent chat, ask about a @corva/ui component
|
|
285
302
|
|
|
286
303
|
#### OpenAI Codex CLI
|
|
287
304
|
|
|
@@ -380,8 +397,8 @@ issues ([reference](https://github.com/modelcontextprotocol/servers/issues/64)).
|
|
|
380
397
|
1. Find your paths:
|
|
381
398
|
|
|
382
399
|
```bash
|
|
383
|
-
nvm which current # e.g., /Users/you/.nvm/versions/node/
|
|
384
|
-
which corva-ui-mcp # e.g., /Users/you/.nvm/versions/node/
|
|
400
|
+
nvm which current # e.g., /Users/you/.nvm/versions/node/v24.15.0/bin/node
|
|
401
|
+
which corva-ui-mcp # e.g., /Users/you/.nvm/versions/node/v24.15.0/bin/corva-ui-mcp
|
|
385
402
|
```
|
|
386
403
|
|
|
387
404
|
2. Add the `mcpServers` entry to your `~/.claude.json` (create the file if it doesn't exist, or merge into existing
|
|
@@ -391,9 +408,9 @@ which corva-ui-mcp # e.g., /Users/you/.nvm/versions/node/v22.12.0/bin/corva-
|
|
|
391
408
|
{
|
|
392
409
|
"mcpServers": {
|
|
393
410
|
"corva-ui": {
|
|
394
|
-
"command": "/Users/you/.nvm/versions/node/
|
|
411
|
+
"command": "/Users/you/.nvm/versions/node/v24.15.0/bin/node",
|
|
395
412
|
"args": [
|
|
396
|
-
"/Users/you/.nvm/versions/node/
|
|
413
|
+
"/Users/you/.nvm/versions/node/v24.15.0/bin/corva-ui-mcp"
|
|
397
414
|
]
|
|
398
415
|
}
|
|
399
416
|
}
|
|
@@ -469,7 +486,7 @@ got from `npm prefix -g`):
|
|
|
469
486
|
"corva-ui": {
|
|
470
487
|
"command": "C:/Program Files/nodejs/node.exe",
|
|
471
488
|
"args": [
|
|
472
|
-
"C:/Users/you/AppData/Roaming/nvm/
|
|
489
|
+
"C:/Users/you/AppData/Roaming/nvm/v24.15.0/node_modules/@corva/ui/mcp-server/server.mjs"
|
|
473
490
|
]
|
|
474
491
|
}
|
|
475
492
|
}
|
|
@@ -520,9 +537,9 @@ the config to `~/.cursor/mcp.json`.
|
|
|
520
537
|
{
|
|
521
538
|
"mcpServers": {
|
|
522
539
|
"corva-ui": {
|
|
523
|
-
"command": "/Users/you/.nvm/versions/node/
|
|
540
|
+
"command": "/Users/you/.nvm/versions/node/v24.15.0/bin/node",
|
|
524
541
|
"args": [
|
|
525
|
-
"/Users/you/.nvm/versions/node/
|
|
542
|
+
"/Users/you/.nvm/versions/node/v24.15.0/bin/corva-ui-mcp"
|
|
526
543
|
]
|
|
527
544
|
}
|
|
528
545
|
}
|
|
@@ -564,14 +581,15 @@ Find your paths with `where.exe node` and `npm prefix -g` as described in the
|
|
|
564
581
|
"corva-ui": {
|
|
565
582
|
"command": "C:/Program Files/nodejs/node.exe",
|
|
566
583
|
"args": [
|
|
567
|
-
"C:/Users/you/AppData/Roaming/nvm/
|
|
584
|
+
"C:/Users/you/AppData/Roaming/nvm/v24.15.0/node_modules/@corva/ui/mcp-server/server.mjs"
|
|
568
585
|
]
|
|
569
586
|
}
|
|
570
587
|
}
|
|
571
588
|
}
|
|
572
589
|
```
|
|
573
590
|
|
|
574
|
-
> **Note:**
|
|
591
|
+
> **Note:** the server shows up under **Customize** in the sidebar, where it can be enabled or disabled; if it fails to
|
|
592
|
+
> start, its output is in the Output panel under "MCP Logs".
|
|
575
593
|
|
|
576
594
|
#### Cursor (without nvm)
|
|
577
595
|
|
|
@@ -597,14 +615,15 @@ Add to `~/.cursor/mcp.json` (merge into existing config):
|
|
|
597
615
|
> `cmd /c` workaround from the [Native Windows note](#claude-code) under Local Setup. WSL users running
|
|
598
616
|
> native-Windows Cursor should follow the `wsl.exe` config from [Cursor Windows + WSL](#windows--wsl-1) instead.
|
|
599
617
|
|
|
600
|
-
> **Note:**
|
|
618
|
+
> **Note:** the server shows up under **Customize** in the sidebar, where it can be enabled or disabled; if it fails to
|
|
619
|
+
> start, its output is in the Output panel under "MCP Logs".
|
|
601
620
|
|
|
602
621
|
#### Troubleshooting: Direct Node Path
|
|
603
622
|
|
|
604
623
|
If `npx` isn't viable (offline, corporate proxy blocking the registry, or you need a strictly pinned version
|
|
605
624
|
regardless of npm cache state), point Node directly at the global install's `server.mjs`. This shape requires
|
|
606
|
-
Step 1 above and works for any IDE — drop it into `~/.claude.json
|
|
607
|
-
`~/.codex/config.toml
|
|
625
|
+
Step 1 above and works for any IDE — drop it into `~/.claude.json` or `~/.cursor/mcp.json`; the Codex CLI equivalent
|
|
626
|
+
for `~/.codex/config.toml` follows the JSON.
|
|
608
627
|
|
|
609
628
|
Find your global install's path with `npm prefix -g`, then substitute it below:
|
|
610
629
|
|
|
@@ -621,6 +640,12 @@ Find your global install's path with `npm prefix -g`, then substitute it below:
|
|
|
621
640
|
}
|
|
622
641
|
```
|
|
623
642
|
|
|
643
|
+
```toml
|
|
644
|
+
[mcp_servers.corva_ui]
|
|
645
|
+
command = "node"
|
|
646
|
+
args = ["<npm-prefix>/lib/node_modules/@corva/ui/mcp-server/server.mjs"]
|
|
647
|
+
```
|
|
648
|
+
|
|
624
649
|
Native-Windows substitution (default nodejs.org installer): `command` becomes `"C:/Program Files/nodejs/node.exe"`,
|
|
625
650
|
`args` becomes `["C:/Users/you/AppData/Roaming/npm/node_modules/@corva/ui/mcp-server/server.mjs"]`. nvm-windows
|
|
626
651
|
users should use the [Native Windows (nvm-windows)](#native-windows-nvm-windows) shape above instead — its
|
|
@@ -643,30 +668,55 @@ This runs the `get_diagnostics` tool under the hood. Clients without slash-comma
|
|
|
643
668
|
If the AI doesn't pick up the MCP tools, restart your IDE / reload MCP servers, and confirm the config file is at the
|
|
644
669
|
location listed in the [Local Setup](#local-setup-recommended) table for your IDE.
|
|
645
670
|
|
|
646
|
-
|
|
671
|
+
If the very first connection times out, the cause is usually the download. `npx -p @corva/ui corva-ui-mcp` reuses the
|
|
672
|
+
`@corva/ui` installed under the directory the client starts the server from; when it finds none — a repo that doesn't
|
|
673
|
+
depend on it, a workspace root where it isn't hoisted, or a project whose dependencies aren't installed yet — it first
|
|
674
|
+
installs `@corva/ui` with its full dependency tree into npx's cache. One cold-cache run measured roughly 40 seconds and
|
|
675
|
+
about 1 GB on a fast connection; timings vary, but that is past the default MCP startup timeouts of Claude Code (30 s)
|
|
676
|
+
and Codex CLI (10 s). npx then reuses that cache until a newer `@corva/ui` is published. Install `@corva/ui` in the
|
|
677
|
+
project, or run the Quick Setup command once from the same user account (it fills the same npx cache), then
|
|
678
|
+
reconnect. If neither is an option, raise the client's timeout instead: `MCP_TIMEOUT=90000 claude` in a POSIX shell
|
|
679
|
+
for Claude Code, or `startup_timeout_sec = 90` under `[mcp_servers.corva_ui]` in the Codex config.
|
|
647
680
|
|
|
648
|
-
|
|
649
|
-
name/version — when a telemetry endpoint is configured at build time. No hostnames, usernames, IP addresses, or other
|
|
650
|
-
direct machine/user identifiers are collected.
|
|
681
|
+
## Telemetry and Privacy
|
|
651
682
|
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
683
|
+
The MCP server may collect usage telemetry when it is configured to: for every tool call, the tool name, arguments,
|
|
684
|
+
result, latency and MCP client name/version; for every prompt invocation (slash command), the prompt name, arguments,
|
|
685
|
+
latency and the size of the response. Each run also carries a random instance id, the server and `@corva/ui` versions
|
|
686
|
+
and `NODE_ENV`. No hostnames, usernames, IP addresses, or other direct machine/user identifiers are collected — but
|
|
687
|
+
arguments and results are not scrubbed, so they can contain identifying information you typed.
|
|
688
|
+
|
|
689
|
+
When your client reports workspace roots, the session is also tagged with the **project identity**, so the
|
|
690
|
+
maintainers can tell which app the queries come from: the `name` from the nearest `package.json` and, in Corva apps,
|
|
691
|
+
the `application.key` from the nearest `manifest.json`, each searched upward from the first root. Either may be
|
|
692
|
+
absent. `/mcp__corva-ui__healthcheck` shows the resolved values.
|
|
693
|
+
|
|
694
|
+
**Tool arguments, tool results and prompt arguments are exported in full, without redaction or truncation.** Span
|
|
695
|
+
payloads may therefore contain content from your queries (file paths, source snippets, component names, or other text
|
|
696
|
+
you sent to the tool) alongside the documentation responses. This includes anything you send via the `feedback` prompt
|
|
697
|
+
/ `submit_feedback` tool — the free-text message is recorded verbatim and is intended for the `@corva/ui` maintainers.
|
|
698
|
+
|
|
699
|
+
Data goes to Corva's Uptrace project over fixed OTLP endpoints (`otlp.uptrace.dev`). The credentials and the sampling
|
|
700
|
+
rate are not hard-coded: after checking the opt-out below, the server reads `mcp-server/telemetry-config.local.json`
|
|
701
|
+
under its working directory (a development override — a valid file wins, an invalid or disabled one turns telemetry
|
|
702
|
+
off) and otherwise fetches the DSN and sampling rate from a Corva-hosted URL baked in at build time, with a 10-second
|
|
703
|
+
timeout. If that URL is unset, the fetch fails, or the fetched configuration is disabled, telemetry stays off for the
|
|
704
|
+
session.
|
|
656
705
|
|
|
657
706
|
To check whether telemetry is currently active for your install, run `/mcp__corva-ui__healthcheck` (or call the
|
|
658
|
-
`get_diagnostics` tool directly) — it reports the resolved telemetry status
|
|
659
|
-
endpoint is configured.
|
|
707
|
+
`get_diagnostics` tool directly) — it reports the resolved telemetry status and sampling rate.
|
|
660
708
|
|
|
661
709
|
To opt out entirely, set `CORVA_UI_MCP_TELEMETRY_DISABLED=1` in the server's environment (e.g. in the `env` block of
|
|
662
710
|
your MCP config file) — any non-empty value other than `0` or `false` works. The switch is honored at runtime before
|
|
663
|
-
any telemetry configuration is read.
|
|
711
|
+
any telemetry configuration is read. Feedback travels over the same channel and is subject to the same sampling rate:
|
|
712
|
+
`submit_feedback` and the `feedback` prompt always confirm the message, but with telemetry off nothing reaches the
|
|
713
|
+
maintainers, and with a sampling rate below 1 some messages are dropped.
|
|
664
714
|
|
|
665
715
|
## FAQ
|
|
666
716
|
|
|
667
717
|
### Does this affect my application bundle or runtime?
|
|
668
718
|
|
|
669
|
-
No. The MCP server adds ~
|
|
719
|
+
No. The MCP server adds ~3 MB unpacked to the published `@corva/ui` npm package (bundled server, setup CLI, and pre-generated
|
|
670
720
|
documentation data). These files live in `node_modules/@corva/ui/mcp-server/` and are only used when running the CLI binaries (
|
|
671
721
|
`corva-ui-mcp`, `corva-ui-mcp-setup`). Consuming app bundlers resolve imports from the library's ESM/CJS entry points,
|
|
672
722
|
which don't reference MCP files — so they are never included in application bundles or executed at runtime.
|
package/README.md
CHANGED
|
@@ -48,11 +48,14 @@ Quick setup (run from your project root):
|
|
|
48
48
|
npx -p @corva/ui corva-ui-mcp-setup
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
entries are preserved, and only the `corva-ui` entry is
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
This writes `.mcp.json` (Claude Code), `.cursor/mcp.json` (Cursor), and `.codex/config.toml` (Codex CLI). If a file
|
|
52
|
+
already exists, the command extends it — existing MCP server entries are preserved, and only the `corva-ui` entry is
|
|
53
|
+
added or updated. Restart your IDE (or reload its MCP servers) afterward, then ask your AI agent about any `@corva/ui`
|
|
54
|
+
component to confirm the tools are picked up.
|
|
55
|
+
|
|
56
|
+
The full MCP docs (all tools and prompts, per-IDE local / monorepo / global setup, troubleshooting, telemetry and
|
|
57
|
+
privacy) ship inside the package as `node_modules/@corva/ui/MCP_README.md`. The latest published copy is also readable
|
|
58
|
+
online: <https://cdn.jsdelivr.net/npm/@corva/ui/MCP_README.md>.
|
|
56
59
|
|
|
57
60
|
## Figma Code Connect
|
|
58
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevCenterAppContainer.js","sources":["../../../../../src/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.tsx"],"sourcesContent":["import { useContext, useMemo, useState } from 'react';\nimport type { ComponentType, FC } from 'react';\nimport classNames from 'classnames';\nimport { noop, pick, pickBy } from 'lodash';\nimport { useTheme } from '@material-ui/core';\n\nimport AppContext from '../AppContext';\nimport { DevCenterRouterContext } from '../DevCenterRouterContext';\n\nimport {\n useAnnotationsData,\n useAnnotationsList,\n useAppMaximized,\n useAppSettings,\n useDevCenterAppProps,\n} from './effects';\nimport { DcFullscreenElemsCoordinatorProvider } from './components/DcFullscreenElemsCoordinatorProvider';\nimport { DevCenterAppDialogs } from './components/DevCenterAppDialogs';\nimport DevCenterAppView from './components/DevCenterAppView';\nimport { LegacyAppActions } from './components/LegacyAppActions';\nimport RestoreAppSizeButton from './components/RestoreAppSizeButton';\nimport { getAppAvailability, getAppVersion } from './utils';\nimport {\n APP_DATA_ASSET_KEYS,\n HOME_PATH_PREFIX,\n MOBILE_CLI_APP_GRID_WIDTH,\n PAGE_NAME,\n} from './constants';\nimport type {\n AppCoordinates,\n AppDataEntry,\n ChatActions,\n DashboardAppLastAnnotation,\n DevCenterAppResource,\n DevCenterCurrentUser,\n DevCenterMenuItem,\n DevCenterRouter,\n LayoutEnvironment,\n RegisterAITools,\n SetIsFullscreenModalMode,\n UpdateDashboardAppLastAnnotation,\n} from './types';\nimport type { FullscreenModes } from '../../../types';\n// Relative on purpose: a `~/` alias does not resolve from the published `.d.ts`.\nimport type { GlobalOffsetWell } from '../../../componentsV2/AppCommonsProvider/AppCommonsContext';\nimport { CommentsSwitchProvider } from './components/CommentsSwitch';\n\nimport styles from './DevCenterAppContainer.scss';\n\nimport { isInsideNewMobileApp, isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { ToastContainer } from '~/components/Toaster';\nimport { useDevCenterApp } from '~/effects';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport {\n getAppName,\n getAppSegment,\n getTimestampFromQuery,\n isDCAppMultiRig,\n} from '~/utils/devcenter';\nimport { AppCommonsProvider } from '~/componentsV2/AppCommonsProvider';\n\n/**\n * `Partial<FullscreenModes>` carries the seven browser-fullscreen and separate-window members.\n * `AppCommonsProvider` derives `isExpanded` from them and republishes them to the app bundle,\n * so dropping them silently disables both features — and nothing type-checks it, because every\n * member is optional on the provider.\n */\nexport type DevCenterAppContainerProps = Partial<FullscreenModes> & {\n app: DevCenterAppResource;\n currentUser: DevCenterCurrentUser;\n /** Platform router. Not React Router — the DC shell supplies its own. */\n devCenterRouter: DevCenterRouter;\n\n /**\n * Slots for the CLI app bundle's own components. `any` rather than a narrower prop type on\n * purpose: this accepts arbitrary app components, and any narrowing would reject the concretely\n * typed ones consumers pass.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppComponent?: ComponentType<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppSettings?: ComponentType<any> | null;\n /** Defaults to `app.id` when omitted. */\n appId?: number;\n className?: string | null;\n chatActions?: ChatActions | null;\n coordinates?: AppCoordinates | null;\n currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;\n dashboardMeta?: {\n isMultiAsset?: boolean;\n isMultiWell?: boolean;\n isChiplessDashboard?: boolean;\n globalOffsetWells?: GlobalOffsetWell[];\n globalOffsetWellsVersion?: number;\n globalOffsetWellsToken?: number;\n };\n disableAppAssetSelection?: boolean;\n isActionsDisabled?: boolean;\n /**\n * [REACT-18-MIGRATION-TAG] PLT-3099: the platform's isolation decision, passed only by the\n * in-process branch of DevCenterIsolatedApp; iframe mounts leave it false.\n */\n isNonIsolatedApp?: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: LayoutEnvironment | null;\n onAppContainerClick?: () => void;\n onAppRemove?: () => void;\n onCloneDashboard?: () => void;\n onHelpCenterClick?: () => void;\n onIsMaximizedChange?: (isMaximized: boolean) => void;\n onReportBugClick?: (() => void) | null;\n onSettingChange?: (key: string, value: unknown) => void;\n onSettingsChange?: (value: unknown) => void;\n openIntercom?: () => void;\n registerAITools?: RegisterAITools;\n reloadApp?: () => void;\n setIsFullscreenModalMode?: SetIsFullscreenModalMode;\n timestamp?: number | null;\n updateCurrentDashboardAppLastAnnotation?: UpdateDashboardAppLastAnnotation;\n};\n\nconst isHomePage = (router: DevCenterRouter) =>\n !!router.location.pathname?.startsWith(HOME_PATH_PREFIX);\n\nconst DevCenterAppContainer: FC<DevCenterAppContainerProps> = ({\n CLIAppComponent,\n CLIAppSettings,\n app,\n appId,\n className,\n coordinates,\n currentDashboardAppsLastAnnotations,\n currentUser,\n devCenterRouter,\n disableAppAssetSelection,\n isActionsDisabled,\n isBrowserFullscreen,\n enterBrowserFullscreen,\n exitBrowserFullscreen,\n isSeparateWindow,\n openSeparateWindow,\n closeSeparateWindow,\n setSeparateWindowTitle,\n isNonIsolatedApp = false,\n isSettingsDialogHidden,\n layoutEnvironment,\n onAppContainerClick = noop,\n onAppRemove,\n onReportBugClick,\n onCloneDashboard,\n onHelpCenterClick,\n onIsMaximizedChange,\n onSettingChange = noop,\n onSettingsChange = noop,\n openIntercom = noop,\n registerAITools,\n setIsFullscreenModalMode = noop,\n timestamp,\n updateCurrentDashboardAppLastAnnotation,\n dashboardMeta,\n reloadApp,\n chatActions,\n}) => {\n // `AppContext` is still JavaScript and calls `createContext()` with no argument, so it hands\n // back `undefined`. Declared here rather than asserted; the real fix is a type argument on the\n // context itself, which belongs to `DevCenter/AppContext`.\n const appsData: Record<string, AppDataEntry> | undefined = useContext(AppContext);\n const theme = useTheme();\n const isMobileView = isNativeDetected || isMobileDetected;\n const [mainMenuItems, setMainMenuItems] = useState<DevCenterMenuItem[]>([]);\n const [secondaryMenuItems, setSecondaryMenuItems] = useState<DevCenterMenuItem[]>([]);\n // `||`, not `??`: DevCenterEmbeddedApp uses 0 as its unset sentinel for appId.\n const appDataKey = appId || app.id;\n const appData: AppDataEntry = (appDataKey ? appsData?.[appDataKey] : undefined) ?? {\n isLoading: true,\n };\n const application = app.package?.manifest?.application;\n const segment = getAppSegment(app);\n const isChiplessDashboard = !!dashboardMeta?.isChiplessDashboard;\n const isMultiRig = isDCAppMultiRig({\n uiSettings: application?.ui,\n isChiplessDashboard,\n });\n const isCommentsEnabled = !!application?.ui?.enable_comments;\n const appName = getAppName(app);\n const { isMaximized, setIsMaximized } = useAppMaximized({\n onIsMaximizedChange,\n devCenterRouter,\n appId,\n });\n\n // Isolated apps are mounted without the router query the timestamp normally comes from,\n // so the host passes it as a prop instead.\n const appTimestamp = timestamp || getTimestampFromQuery(devCenterRouter.location.query?.query);\n const isCLIApp = app.id === DEV_CENTER_CLI_APP_ID;\n // Memoised because the CLI-on-mobile branch builds a new object: unmemoised it would be a fresh\n // reference on every render and would keep `useDevCenterAppProps` from ever holding its memo.\n const updatedCoordinates = useMemo(\n () =>\n isCLIApp && isMobileView ? { ...coordinates, w: MOBILE_CLI_APP_GRID_WIDTH } : coordinates,\n [isCLIApp, isMobileView, coordinates]\n );\n const version = getAppVersion(app);\n\n const {\n isLoading: isAppLoading,\n AppSettings,\n AppComponent,\n } = useDevCenterApp({\n CLIAppComponent,\n CLIAppSettings,\n app,\n version,\n });\n\n const { isAppSettingsDialogOpened, toggleAppSettingsDialog } = useAppSettings({\n setIsFullscreenModalMode,\n });\n const { isAnnotationsListOpened, toggleAnnotationsList } = useAnnotationsList();\n\n const isLoading = !!(isAppLoading || !currentUser || (!isMultiRig && appData.isLoading));\n\n const {\n appLastAnnotation,\n assetCompanyId,\n assetIdForAnnotation,\n isAppSupportsAnnotations: isAnnotationsSupported,\n } = useAnnotationsData({\n app,\n appData,\n currentDashboardAppsLastAnnotations,\n });\n\n const filteredAppData = useMemo(\n () => pickBy(pick(appData, APP_DATA_ASSET_KEYS), Boolean),\n [appData]\n );\n\n const simplifiedSecondaryMenuItems = useMemo(\n () =>\n secondaryMenuItems.map(item => ({\n ...item,\n onClick: () => {\n item.onClick?.();\n if (item.to) {\n devCenterRouter.push(item.to);\n }\n },\n })),\n [secondaryMenuItems, devCenterRouter]\n );\n\n const isAppHeadersV3Enabled = !!application?.ui?.use_app_header_v3;\n const isInsideHomePage = isHomePage(devCenterRouter);\n\n const appProps = useDevCenterAppProps({\n app,\n appLastAnnotation,\n appTimestamp,\n chatActions,\n coordinates: updatedCoordinates,\n currentUser,\n devCenterRouter,\n filteredAppData,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n updateCurrentDashboardAppLastAnnotation,\n });\n\n // Called without the native event: this crosses an iframe boundary, where a DOM event\n // cannot be serialised.\n const handleAppContainerClick = () => onAppContainerClick();\n\n // ⚠️⚠️⚠️ When adding/changing providers, also add them to/change /src/testing/AppTestWrapper\n return (\n <DevCenterRouterContext.Provider value={devCenterRouter}>\n <DcFullscreenElemsCoordinatorProvider setIsFullscreenModalMode={setIsFullscreenModalMode}>\n <AppCommonsProvider\n maximized={isMaximized}\n setMaximized={setIsMaximized}\n appId={app.app.id}\n app={app}\n appSettings={app.settings}\n onSettingChange={onSettingChange}\n onSettingsChange={onSettingsChange}\n appHeadersV3Enabled={isAppHeadersV3Enabled}\n isBrowserFullscreen={isBrowserFullscreen}\n enterBrowserFullscreen={enterBrowserFullscreen}\n exitBrowserFullscreen={exitBrowserFullscreen}\n isSeparateWindow={isSeparateWindow}\n openSeparateWindow={openSeparateWindow}\n closeSeparateWindow={closeSeparateWindow}\n setSeparateWindowTitle={setSeparateWindowTitle}\n isNonIsolatedApp={isNonIsolatedApp}\n disableAppAssetSelection={disableAppAssetSelection}\n isMultiRig={isMultiRig}\n currentUser={currentUser}\n appData={appData}\n layoutEnvironment={layoutEnvironment}\n appSettingsComponent={AppSettings}\n dashboardMeta={dashboardMeta}\n toggleAnnotationsList={isAnnotationsSupported ? toggleAnnotationsList : undefined}\n onHelpCenterClick={onHelpCenterClick}\n secondaryMenuItems={simplifiedSecondaryMenuItems}\n onAppRemove={onAppRemove}\n isInsideNewMobileApp={isInsideNewMobileApp}\n globalOffsetWells={dashboardMeta?.globalOffsetWells}\n globalOffsetWellsVersion={dashboardMeta?.globalOffsetWellsVersion}\n globalOffsetWellsToken={dashboardMeta?.globalOffsetWellsToken}\n reloadApp={reloadApp}\n {...filteredAppData}\n >\n <CommentsSwitchProvider>\n <article\n className={classNames(\n 'dc-app-container',\n isInsideNewMobileApp && 'dc-app-container--inside-new-mobile-app',\n isInsideHomePage && 'dc-app-container--inside-home-page',\n className,\n // This class is applied so that DC apps developers can style their content\n // when an app is in fullscreen\n isMaximized && 'dc-app-container__maximized',\n theme.isLightTheme && 'dc-app-container__light-theme',\n styles.container\n )}\n data-testid={`${PAGE_NAME}_${appName}`}\n onClick={handleAppContainerClick}\n >\n <ToastContainer />\n <div className={styles.containerContent}>\n <DevCenterAppView\n // DC apps keep per-asset state in mount-time hooks, so a new asset means a\n // new mount. React 18 batching collapses away the `isLoading` frame this used\n // to rely on whenever AppsDataProvider serves the asset from its cache.\n key={appData.appHash}\n AppComponent={AppComponent}\n app={app}\n appData={filteredAppData}\n availability={getAppAvailability(\n app.availability,\n currentUser.company.with_subscription\n )}\n isCLIApp={isCLIApp}\n isLoading={isLoading}\n isMultiRig={isMultiRig}\n layoutEnvironment={layoutEnvironment ?? null}\n openIntercom={openIntercom}\n segment={segment}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n appProps={appProps}\n />\n </div>\n <DevCenterAppDialogs\n app={app}\n appData={appData}\n appName={appName}\n appSettingsComponent={AppSettings}\n assetCompanyId={assetCompanyId}\n assetIdForAnnotation={assetIdForAnnotation}\n currentUser={currentUser}\n disableAppAssetSelection={disableAppAssetSelection}\n isAnnotationsListOpened={isAnnotationsListOpened}\n isAppSettingsDialogOpened={isAppSettingsDialogOpened}\n isMultiRig={isMultiRig}\n isSettingsDialogHidden={isSettingsDialogHidden}\n layoutEnvironment={layoutEnvironment}\n onAppRemove={onAppRemove}\n onCloneDashboard={onCloneDashboard}\n onSettingsChange={onSettingsChange}\n openIntercom={openIntercom}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n {isMaximized && !isAppHeadersV3Enabled && (\n <RestoreAppSizeButton setIsMaximized={setIsMaximized} />\n )}\n\n {!isActionsDisabled && (!isAppHeadersV3Enabled || isLoading) && (\n <LegacyAppActions\n app={app}\n currentUser={currentUser}\n devCenterRouter={devCenterRouter}\n isAnnotationsSupported={isAnnotationsSupported}\n isCLIApp={isCLIApp}\n isCommentsEnabled={isCommentsEnabled}\n isInsideNewMobileApp={isInsideNewMobileApp}\n isMaximized={isMaximized}\n isMobileView={isMobileView}\n mainMenuItems={mainMenuItems}\n secondaryMenuItems={secondaryMenuItems}\n onHelpCenterClick={onHelpCenterClick}\n onReportBugClick={onReportBugClick}\n setIsFullscreenModalMode={setIsFullscreenModalMode}\n setIsMaximized={setIsMaximized}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n )}\n </article>\n </CommentsSwitchProvider>\n </AppCommonsProvider>\n </DcFullscreenElemsCoordinatorProvider>\n </DevCenterRouterContext.Provider>\n );\n};\n\nexport default DevCenterAppContainer;\n"],"names":["_ref","_ref2","_app$package","_app$package$manifest","_application$ui","_devCenterRouter$loca","_application$ui2","_router$location$path","CLIAppComponent","CLIAppSettings","app","appId","className","coordinates","currentDashboardAppsLastAnnotations","currentUser","devCenterRouter","disableAppAssetSelection","isActionsDisabled","isBrowserFullscreen","enterBrowserFullscreen","exitBrowserFullscreen","isSeparateWindow","openSeparateWindow","closeSeparateWindow","setSeparateWindowTitle","_ref$isNonIsolatedApp","isNonIsolatedApp","isSettingsDialogHidden","layoutEnvironment","_ref$onAppContainerCl","onAppContainerClick","noop","onAppRemove","onReportBugClick","onCloneDashboard","onHelpCenterClick","onIsMaximizedChange","_ref$onSettingChange","onSettingChange","_ref$onSettingsChange","onSettingsChange","_ref$openIntercom","openIntercom","registerAITools","_ref$setIsFullscreenM","setIsFullscreenModalMode","timestamp","updateCurrentDashboardAppLastAnnotation","dashboardMeta","reloadApp","chatActions","appsData","useContext","AppContext","theme","useTheme","isMobileView","isNativeDetected","isMobileDetected","useState","_useState2","_slicedToArray","_useState","mainMenuItems","setMainMenuItems","_useState4","_useState3","secondaryMenuItems","setSecondaryMenuItems","appDataKey","id","appData","undefined","isLoading","application","package","manifest","segment","getAppSegment","isChiplessDashboard","isMultiRig","isDCAppMultiRig","uiSettings","ui","isCommentsEnabled","enable_comments","appName","getAppName","_useAppMaximized","useAppMaximized","isMaximized","setIsMaximized","appTimestamp","getTimestampFromQuery","location","query","isCLIApp","DEV_CENTER_CLI_APP_ID","updatedCoordinates","useMemo","_objectSpread","w","MOBILE_CLI_APP_GRID_WIDTH","version","getAppVersion","_useDevCenterApp","useDevCenterApp","isAppLoading","AppSettings","AppComponent","_useAppSettings","useAppSettings","isAppSettingsDialogOpened","toggleAppSettingsDialog","_useAnnotationsList","useAnnotationsList","isAnnotationsListOpened","toggleAnnotationsList","_useAnnotationsData","useAnnotationsData","appLastAnnotation","assetCompanyId","assetIdForAnnotation","isAnnotationsSupported","isAppSupportsAnnotations","filteredAppData","pickBy","pick","APP_DATA_ASSET_KEYS","Boolean","simplifiedSecondaryMenuItems","map","item","onClick","_item$onClick","call","to","push","isAppHeadersV3Enabled","use_app_header_v3","isInsideHomePage","pathname","startsWith","HOME_PATH_PREFIX","appProps","useDevCenterAppProps","_jsx","jsx","DevCenterRouterContext","Provider","value","children","DcFullscreenElemsCoordinatorProvider","AppCommonsProvider","maximized","setMaximized","appSettings","settings","appHeadersV3Enabled","appSettingsComponent","isInsideNewMobileApp","globalOffsetWells","globalOffsetWellsVersion","globalOffsetWellsToken","CommentsSwitchProvider","_jsxs","jsxs","classNames","isLightTheme","styles","container","PAGE_NAME","ToastContainer","containerContent","DevCenterAppView","availability","getAppAvailability","company","with_subscription","appHash","DevCenterAppDialogs","RestoreAppSizeButton","LegacyAppActions"],"mappings":"q5gBA4H8D,SAsCxDA,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAzCqCC,EAIzCC,IAAAA,gBACAC,IAAAA,eACAC,IAAAA,IACAC,IAAAA,MACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,oCACAC,IAAAA,YACAC,IAAAA,gBACAC,IAAAA,yBACAC,IAAAA,kBACAC,IAAAA,oBACAC,IAAAA,uBACAC,IAAAA,sBACAC,IAAAA,iBACAC,IAAAA,mBACAC,IAAA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,iBAAkBA,GAClBE,aAAcA,GACd2E,sBAAuBA,GACvBJ,wBAAyBA,KAE1BvB,KAAgBgD,IACfQ,EAAAA,IAACmC,EAAoB,CAAC1F,eAAgBA,MAGtC1E,KAAuByH,IAAyBjE,KAChDyE,EAAAC,IAACmC,mBAAgB,CACf7K,IAAKA,EACLK,YAAaA,EACbC,gBAAiBA,EACjB4G,uBAAwBA,GACxB3B,SAAUA,GACVZ,kBAAmBA,GACnB4E,qBAAsBA,EAAqBA,qBAC3CtE,YAAaA,GACblC,aAAcA,GACdO,cAAeA,GACfI,mBAAoBA,GACpBhC,kBAAmBA,GACnBF,iBAAkBA,GAClBY,yBAA0BA,GAC1B8C,eAAgBA,GAChB0B,sBAAuBA,GACvBJ,wBAAyBA,gBAS3C"}
|
|
1
|
+
{"version":3,"file":"DevCenterAppContainer.js","sources":["../../../../../src/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.tsx"],"sourcesContent":["import { useContext, useMemo, useState } from 'react';\nimport type { ComponentType, FC } from 'react';\nimport classNames from 'classnames';\nimport { noop, pick, pickBy } from 'lodash';\nimport { useTheme } from '@material-ui/core';\n\nimport AppContext from '../AppContext';\nimport { DevCenterRouterContext } from '../DevCenterRouterContext';\n\nimport {\n useAnnotationsData,\n useAnnotationsList,\n useAppMaximized,\n useAppSettings,\n useDevCenterAppProps,\n} from './effects';\nimport { DcFullscreenElemsCoordinatorProvider } from './components/DcFullscreenElemsCoordinatorProvider';\nimport { DevCenterAppDialogs } from './components/DevCenterAppDialogs';\nimport DevCenterAppView from './components/DevCenterAppView';\nimport { LegacyAppActions } from './components/LegacyAppActions';\nimport RestoreAppSizeButton from './components/RestoreAppSizeButton';\nimport { getAppAvailability, getAppVersion } from './utils';\nimport {\n APP_DATA_ASSET_KEYS,\n HOME_PATH_PREFIX,\n MOBILE_CLI_APP_GRID_WIDTH,\n PAGE_NAME,\n} from './constants';\nimport type {\n AppCoordinates,\n AppDataEntry,\n ChatActions,\n DashboardAppLastAnnotation,\n DevCenterAppResource,\n DevCenterCurrentUser,\n DevCenterMenuItem,\n DevCenterRouter,\n LayoutEnvironment,\n RegisterAITools,\n SetIsFullscreenModalMode,\n UpdateDashboardAppLastAnnotation,\n} from './types';\nimport type { FullscreenModes } from '../../../types';\n// Relative on purpose: a `~/` alias does not resolve from the published `.d.ts`.\nimport type { AppDashboardMeta } from '../../../componentsV2/AppCommonsProvider/AppCommonsContext';\nimport { CommentsSwitchProvider } from './components/CommentsSwitch';\n\nimport styles from './DevCenterAppContainer.scss';\n\nimport { isInsideNewMobileApp, isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { ToastContainer } from '~/components/Toaster';\nimport { useDevCenterApp } from '~/effects';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport {\n getAppName,\n getAppSegment,\n getTimestampFromQuery,\n isDCAppMultiRig,\n} from '~/utils/devcenter';\nimport { AppCommonsProvider } from '~/componentsV2/AppCommonsProvider';\n\n/**\n * `Partial<FullscreenModes>` carries the seven browser-fullscreen and separate-window members.\n * `AppCommonsProvider` derives `isExpanded` from them and republishes them to the app bundle,\n * so dropping them silently disables both features — and nothing type-checks it, because every\n * member is optional on the provider.\n */\nexport type DevCenterAppContainerProps = Partial<FullscreenModes> & {\n app: DevCenterAppResource;\n currentUser: DevCenterCurrentUser;\n /** Platform router. Not React Router — the DC shell supplies its own. */\n devCenterRouter: DevCenterRouter;\n\n /**\n * Slots for the CLI app bundle's own components. `any` rather than a narrower prop type on\n * purpose: this accepts arbitrary app components, and any narrowing would reject the concretely\n * typed ones consumers pass.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppComponent?: ComponentType<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppSettings?: ComponentType<any> | null;\n /** Defaults to `app.id` when omitted. */\n appId?: number;\n className?: string | null;\n chatActions?: ChatActions | null;\n coordinates?: AppCoordinates | null;\n currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;\n dashboardMeta?: AppDashboardMeta;\n disableAppAssetSelection?: boolean;\n isActionsDisabled?: boolean;\n /**\n * [REACT-18-MIGRATION-TAG] PLT-3099: the platform's isolation decision, passed only by the\n * in-process branch of DevCenterIsolatedApp; iframe mounts leave it false.\n */\n isNonIsolatedApp?: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: LayoutEnvironment | null;\n onAppContainerClick?: () => void;\n onAppRemove?: () => void;\n onCloneDashboard?: () => void;\n onHelpCenterClick?: () => void;\n onIsMaximizedChange?: (isMaximized: boolean) => void;\n onReportBugClick?: (() => void) | null;\n onSettingChange?: (key: string, value: unknown) => void;\n onSettingsChange?: (value: unknown) => void;\n openIntercom?: () => void;\n registerAITools?: RegisterAITools;\n reloadApp?: () => void;\n setIsFullscreenModalMode?: SetIsFullscreenModalMode;\n timestamp?: number | null;\n updateCurrentDashboardAppLastAnnotation?: UpdateDashboardAppLastAnnotation;\n};\n\nconst isHomePage = (router: DevCenterRouter) =>\n !!router.location.pathname?.startsWith(HOME_PATH_PREFIX);\n\nconst DevCenterAppContainer: FC<DevCenterAppContainerProps> = ({\n CLIAppComponent,\n CLIAppSettings,\n app,\n appId,\n className,\n coordinates,\n currentDashboardAppsLastAnnotations,\n currentUser,\n devCenterRouter,\n disableAppAssetSelection,\n isActionsDisabled,\n isBrowserFullscreen,\n enterBrowserFullscreen,\n exitBrowserFullscreen,\n isSeparateWindow,\n openSeparateWindow,\n closeSeparateWindow,\n setSeparateWindowTitle,\n isNonIsolatedApp = false,\n isSettingsDialogHidden,\n layoutEnvironment,\n onAppContainerClick = noop,\n onAppRemove,\n onReportBugClick,\n onCloneDashboard,\n onHelpCenterClick,\n onIsMaximizedChange,\n onSettingChange = noop,\n onSettingsChange = noop,\n openIntercom = noop,\n registerAITools,\n setIsFullscreenModalMode = noop,\n timestamp,\n updateCurrentDashboardAppLastAnnotation,\n dashboardMeta,\n reloadApp,\n chatActions,\n}) => {\n // `AppContext` is still JavaScript and calls `createContext()` with no argument, so it hands\n // back `undefined`. Declared here rather than asserted; the real fix is a type argument on the\n // context itself, which belongs to `DevCenter/AppContext`.\n const appsData: Record<string, AppDataEntry> | undefined = useContext(AppContext);\n const theme = useTheme();\n const isMobileView = isNativeDetected || isMobileDetected;\n const [mainMenuItems, setMainMenuItems] = useState<DevCenterMenuItem[]>([]);\n const [secondaryMenuItems, setSecondaryMenuItems] = useState<DevCenterMenuItem[]>([]);\n // `||`, not `??`: DevCenterEmbeddedApp uses 0 as its unset sentinel for appId.\n const appDataKey = appId || app.id;\n const appData: AppDataEntry = (appDataKey ? appsData?.[appDataKey] : undefined) ?? {\n isLoading: true,\n };\n const application = app.package?.manifest?.application;\n const segment = getAppSegment(app);\n const isChiplessDashboard = !!dashboardMeta?.isChiplessDashboard;\n const isMultiRig = isDCAppMultiRig({\n uiSettings: application?.ui,\n isChiplessDashboard,\n });\n const isCommentsEnabled = !!application?.ui?.enable_comments;\n const appName = getAppName(app);\n const { isMaximized, setIsMaximized } = useAppMaximized({\n onIsMaximizedChange,\n devCenterRouter,\n appId,\n });\n\n // Isolated apps are mounted without the router query the timestamp normally comes from,\n // so the host passes it as a prop instead.\n const appTimestamp = timestamp || getTimestampFromQuery(devCenterRouter.location.query?.query);\n const isCLIApp = app.id === DEV_CENTER_CLI_APP_ID;\n // Memoised because the CLI-on-mobile branch builds a new object: unmemoised it would be a fresh\n // reference on every render and would keep `useDevCenterAppProps` from ever holding its memo.\n const updatedCoordinates = useMemo(\n () =>\n isCLIApp && isMobileView ? { ...coordinates, w: MOBILE_CLI_APP_GRID_WIDTH } : coordinates,\n [isCLIApp, isMobileView, coordinates]\n );\n const version = getAppVersion(app);\n\n const {\n isLoading: isAppLoading,\n AppSettings,\n AppComponent,\n } = useDevCenterApp({\n CLIAppComponent,\n CLIAppSettings,\n app,\n version,\n });\n\n const { isAppSettingsDialogOpened, toggleAppSettingsDialog } = useAppSettings({\n setIsFullscreenModalMode,\n });\n const { isAnnotationsListOpened, toggleAnnotationsList } = useAnnotationsList();\n\n const isLoading = !!(isAppLoading || !currentUser || (!isMultiRig && appData.isLoading));\n\n const {\n appLastAnnotation,\n assetCompanyId,\n assetIdForAnnotation,\n isAppSupportsAnnotations: isAnnotationsSupported,\n } = useAnnotationsData({\n app,\n appData,\n currentDashboardAppsLastAnnotations,\n });\n\n const filteredAppData = useMemo(\n () => pickBy(pick(appData, APP_DATA_ASSET_KEYS), Boolean),\n [appData]\n );\n\n const simplifiedSecondaryMenuItems = useMemo(\n () =>\n secondaryMenuItems.map(item => ({\n ...item,\n onClick: () => {\n item.onClick?.();\n if (item.to) {\n devCenterRouter.push(item.to);\n }\n },\n })),\n [secondaryMenuItems, devCenterRouter]\n );\n\n const isAppHeadersV3Enabled = !!application?.ui?.use_app_header_v3;\n const isInsideHomePage = isHomePage(devCenterRouter);\n\n const appProps = useDevCenterAppProps({\n app,\n appLastAnnotation,\n appTimestamp,\n chatActions,\n coordinates: updatedCoordinates,\n currentUser,\n devCenterRouter,\n filteredAppData,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n updateCurrentDashboardAppLastAnnotation,\n });\n\n // Called without the native event: this crosses an iframe boundary, where a DOM event\n // cannot be serialised.\n const handleAppContainerClick = () => onAppContainerClick();\n\n // ⚠️⚠️⚠️ When adding/changing providers, also add them to/change /src/testing/AppTestWrapper\n return (\n <DevCenterRouterContext.Provider value={devCenterRouter}>\n <DcFullscreenElemsCoordinatorProvider setIsFullscreenModalMode={setIsFullscreenModalMode}>\n <AppCommonsProvider\n maximized={isMaximized}\n setMaximized={setIsMaximized}\n appId={app.app.id}\n app={app}\n appSettings={app.settings}\n onSettingChange={onSettingChange}\n onSettingsChange={onSettingsChange}\n appHeadersV3Enabled={isAppHeadersV3Enabled}\n isBrowserFullscreen={isBrowserFullscreen}\n enterBrowserFullscreen={enterBrowserFullscreen}\n exitBrowserFullscreen={exitBrowserFullscreen}\n isSeparateWindow={isSeparateWindow}\n openSeparateWindow={openSeparateWindow}\n closeSeparateWindow={closeSeparateWindow}\n setSeparateWindowTitle={setSeparateWindowTitle}\n isNonIsolatedApp={isNonIsolatedApp}\n disableAppAssetSelection={disableAppAssetSelection}\n isMultiRig={isMultiRig}\n currentUser={currentUser}\n appData={appData}\n layoutEnvironment={layoutEnvironment}\n appSettingsComponent={AppSettings}\n dashboardMeta={dashboardMeta}\n toggleAnnotationsList={isAnnotationsSupported ? toggleAnnotationsList : undefined}\n onHelpCenterClick={onHelpCenterClick}\n secondaryMenuItems={simplifiedSecondaryMenuItems}\n onAppRemove={onAppRemove}\n isInsideNewMobileApp={isInsideNewMobileApp}\n globalOffsetWells={dashboardMeta?.globalOffsetWells}\n globalOffsetWellsVersion={dashboardMeta?.globalOffsetWellsVersion}\n globalOffsetWellsToken={dashboardMeta?.globalOffsetWellsToken}\n reloadApp={reloadApp}\n {...filteredAppData}\n >\n <CommentsSwitchProvider>\n <article\n className={classNames(\n 'dc-app-container',\n isInsideNewMobileApp && 'dc-app-container--inside-new-mobile-app',\n isInsideHomePage && 'dc-app-container--inside-home-page',\n className,\n // This class is applied so that DC apps developers can style their content\n // when an app is in fullscreen\n isMaximized && 'dc-app-container__maximized',\n theme.isLightTheme && 'dc-app-container__light-theme',\n styles.container\n )}\n data-testid={`${PAGE_NAME}_${appName}`}\n onClick={handleAppContainerClick}\n >\n <ToastContainer />\n <div className={styles.containerContent}>\n <DevCenterAppView\n // DC apps keep per-asset state in mount-time hooks, so a new asset means a\n // new mount. React 18 batching collapses away the `isLoading` frame this used\n // to rely on whenever AppsDataProvider serves the asset from its cache.\n key={appData.appHash}\n AppComponent={AppComponent}\n app={app}\n appData={filteredAppData}\n availability={getAppAvailability(\n app.availability,\n currentUser.company.with_subscription\n )}\n isCLIApp={isCLIApp}\n isLoading={isLoading}\n isMultiRig={isMultiRig}\n layoutEnvironment={layoutEnvironment ?? null}\n openIntercom={openIntercom}\n segment={segment}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n appProps={appProps}\n />\n </div>\n <DevCenterAppDialogs\n app={app}\n appData={appData}\n appName={appName}\n appSettingsComponent={AppSettings}\n assetCompanyId={assetCompanyId}\n assetIdForAnnotation={assetIdForAnnotation}\n currentUser={currentUser}\n disableAppAssetSelection={disableAppAssetSelection}\n isAnnotationsListOpened={isAnnotationsListOpened}\n isAppSettingsDialogOpened={isAppSettingsDialogOpened}\n isMultiRig={isMultiRig}\n isSettingsDialogHidden={isSettingsDialogHidden}\n layoutEnvironment={layoutEnvironment}\n onAppRemove={onAppRemove}\n onCloneDashboard={onCloneDashboard}\n onSettingsChange={onSettingsChange}\n openIntercom={openIntercom}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n {isMaximized && !isAppHeadersV3Enabled && (\n <RestoreAppSizeButton setIsMaximized={setIsMaximized} />\n )}\n\n {!isActionsDisabled && (!isAppHeadersV3Enabled || isLoading) && (\n <LegacyAppActions\n app={app}\n currentUser={currentUser}\n devCenterRouter={devCenterRouter}\n isAnnotationsSupported={isAnnotationsSupported}\n isCLIApp={isCLIApp}\n isCommentsEnabled={isCommentsEnabled}\n isInsideNewMobileApp={isInsideNewMobileApp}\n isMaximized={isMaximized}\n isMobileView={isMobileView}\n mainMenuItems={mainMenuItems}\n secondaryMenuItems={secondaryMenuItems}\n onHelpCenterClick={onHelpCenterClick}\n onReportBugClick={onReportBugClick}\n setIsFullscreenModalMode={setIsFullscreenModalMode}\n setIsMaximized={setIsMaximized}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n )}\n </article>\n </CommentsSwitchProvider>\n </AppCommonsProvider>\n </DcFullscreenElemsCoordinatorProvider>\n </DevCenterRouterContext.Provider>\n );\n};\n\nexport default DevCenterAppContainer;\n"],"names":["_ref","_ref2","_app$package","_app$package$manifest","_application$ui","_devCenterRouter$loca","_application$ui2","_router$location$path","CLIAppComponent","CLIAppSettings","app","appId","className","coordinates","currentDashboardAppsLastAnnotations","currentUser","devCenterRouter","disableAppAssetSelection","isActionsDisabled","isBrowserFullscreen","enterBrowserFullscreen","exitBrowserFullscreen","isSeparateWindow","openSeparateWindow","closeSeparateWindow","setSeparateWindowTitle","_ref$isNonIsolatedApp","isNonIsolatedApp","isSettingsDialogHidden","layoutEnvironment","_ref$onAppContainerCl","onAppContainerClick","noop","onAppRemove","onReportBugClick","onCloneDashboard","onHelpCenterClick","onIsMaximizedChange","_ref$onSettingChange","onSettingChange","_ref$onSettingsChange","onSettingsChange","_ref$openIntercom","openIntercom","registerAITools","_ref$setIsFullscreenM","setIsFullscreenModalMode","timestamp","updateCurrentDashboardAppLastAnnotation","dashboardMeta","reloadApp","chatActions","appsData","useContext","AppContext","theme","useTheme","isMobileView","isNativeDetected","isMobileDetected","useState","_useState2","_slicedToArray","_useState","mainMenuItems","setMainMenuItems","_useState4","_useState3","secondaryMenuItems","setSecondaryMenuItems","appDataKey","id","appData","undefined","isLoading","application","package","manifest","segment","getAppSegment","isChiplessDashboard","isMultiRig","isDCAppMultiRig","uiSettings","ui","isCommentsEnabled","enable_comments","appName","getAppName","_useAppMaximized","useAppMaximized","isMaximized","setIsMaximized","appTimestamp","getTimestampFromQuery","location","query","isCLIApp","DEV_CENTER_CLI_APP_ID","updatedCoordinates","useMemo","_objectSpread","w","MOBILE_CLI_APP_GRID_WIDTH","version","getAppVersion","_useDevCenterApp","useDevCenterApp","isAppLoading","AppSettings","AppComponent","_useAppSettings","useAppSettings","isAppSettingsDialogOpened","toggleAppSettingsDialog","_useAnnotationsList","useAnnotationsList","isAnnotationsListOpened","toggleAnnotationsList","_useAnnotationsData","useAnnotationsData","appLastAnnotation","assetCompanyId","assetIdForAnnotation","isAnnotationsSupported","isAppSupportsAnnotations","filteredAppData","pickBy","pick","APP_DATA_ASSET_KEYS","Boolean","simplifiedSecondaryMenuItems","map","item","onClick","_item$onClick","call","to","push","isAppHeadersV3Enabled","use_app_header_v3","isInsideHomePage","pathname","startsWith","HOME_PATH_PREFIX","appProps","useDevCenterAppProps","_jsx","jsx","DevCenterRouterContext","Provider","value","children","DcFullscreenElemsCoordinatorProvider","AppCommonsProvider","maximized","setMaximized","appSettings","settings","appHeadersV3Enabled","appSettingsComponent","isInsideNewMobileApp","globalOffsetWells","globalOffsetWellsVersion","globalOffsetWellsToken","CommentsSwitchProvider","_jsxs","jsxs","classNames","isLightTheme","styles","container","PAGE_NAME","ToastContainer","containerContent","DevCenterAppView","availability","getAppAvailability","company","with_subscription","appHash","DevCenterAppDialogs","RestoreAppSizeButton","LegacyAppActions"],"mappings":"q5gBAqH8D,SAsCxDA,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAzCqCC,EAIzCC,IAAAA,gBACAC,IAAAA,eACAC,IAAAA,IACAC,IAAAA,MACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,oCACAC,IAAAA,YACAC,IAAAA,gBACAC,IAAAA,yBACAC,IAAAA,kBACAC,IAAAA,oBACAC,IAAAA,uBACAC,IAAAA,sBACAC,IAAAA,iBACAC,IAAAA,mBACAC,IAAAA,oBACAC,KAAAA,uBAAsBC,GAAA1B,EACtB2B,iBAAAA,gBAAwBD,GACxBE,KAAAA,uBACAC,KAAAA,kBAAiBC,GAAA9B,EACjB+B,oBAAAA,eAAsBC,EAAIA,KAAAF,GAC1BG,KAAAA,YACAC,KAAAA,iBACAC,KAAAA,iBACAC,KAAAA,kBACAC,KAAAA,oBAAmBC,GAAAtC,EACnBuC,gBAAAA,eAAkBP,EAAIA,KAAAM,GAAAE,GAAAxC,EACtByC,iBAAAA,eAAmBT,EAAIA,KAAAQ,GAAAE,GAAA1C,EACvB2C,aAAAA,eAAeX,EAAIA,KAAAU,GACnBE,KAAAA,gBAAeC,GAAA7C,EACf8C,yBAAAA,eAA2Bd,E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BAAuBA,GACvBJ,wBAAyBA,gBAS3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppCommonsContext.js","sources":["../../../../src/componentsV2/AppCommonsProvider/AppCommonsContext.ts"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useContext } from 'react';\n\nimport {\n App,\n AppSettings,\n Asset,\n FracFleet,\n FullscreenModes,\n InterventionUnit,\n User,\n Well,\n} from '../../types';\n\nexport type GlobalOffsetWell = {\n id: number;\n [key: string]: unknown;\n};\n\n// ⚠️⚠️⚠️ Mentioned in storybook, please update when editing this type\n// Used in AppTestWrapper\nexport type AppCommonsContextType = {\n maximized: boolean;\n appId: number;\n app: App;\n appKey: string;\n appName: string;\n appSettings?: AppSettings;\n onSettingChange: (key: string, value: unknown) => void;\n onSettingsChange: (value: unknown) => void;\n\n well?: Well;\n rig?: Asset;\n fracFleet?: FracFleet;\n interventionUnit?: InterventionUnit;\n wells?: Well[];\n\n // Passed down from corva-web-frontend. May not exist, so everything must be optional\n dashboardMeta?:
|
|
1
|
+
{"version":3,"file":"AppCommonsContext.js","sources":["../../../../src/componentsV2/AppCommonsProvider/AppCommonsContext.ts"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useContext } from 'react';\n\nimport {\n App,\n AppSettings,\n Asset,\n FracFleet,\n FullscreenModes,\n InterventionUnit,\n User,\n Well,\n} from '../../types';\n\nexport type GlobalOffsetWell = {\n id: number;\n [key: string]: unknown;\n};\n\n/** Host-owned planning scope. Presence identifies a Well Planning dashboard. */\nexport type WellPlanningDashboardMeta = {\n assetId: number | null;\n dashboardId: string;\n defaultDashboardKind?: string;\n segment: string | null;\n};\n\nexport type AppDashboardMeta = {\n /** The host owns app identity and maximization controls. */\n isEmbedded?: boolean;\n isMultiAsset?: boolean;\n isMultiWell?: boolean;\n isChiplessDashboard?: boolean;\n globalOffsetWells?: GlobalOffsetWell[];\n globalOffsetWellsVersion?: number;\n globalOffsetWellsToken?: number;\n wellPlanning?: WellPlanningDashboardMeta;\n};\n\n// ⚠️⚠️⚠️ Mentioned in storybook, please update when editing this type\n// Used in AppTestWrapper\nexport type AppCommonsContextType = {\n maximized: boolean;\n appId: number;\n app: App;\n appKey: string;\n appName: string;\n appSettings?: AppSettings;\n onSettingChange: (key: string, value: unknown) => void;\n onSettingsChange: (value: unknown) => void;\n\n well?: Well;\n rig?: Asset;\n fracFleet?: FracFleet;\n interventionUnit?: InterventionUnit;\n wells?: Well[];\n\n // Passed down from corva-web-frontend. May not exist, so everything must be optional\n dashboardMeta?: AppDashboardMeta;\n appHeadersV3Enabled?: boolean;\n // [REACT-18-MIGRATION-TAG] PLT-3099: true when the app renders in-process on the host\n // (the platform isolation decision from DevCenterIsolatedApp); iframe realms leave it unset.\n isNonIsolatedApp?: boolean;\n disableAppAssetSelection?: boolean;\n isMultiRig?: boolean;\n currentUser?: User;\n globalOffsetWells?: GlobalOffsetWell[];\n globalOffsetWellsVersion?: number;\n globalOffsetWellsToken?: number;\n removeApp?: () => void;\n};\n\nexport type AppCommonsContextTypeInternal = AppCommonsContextType &\n Partial<FullscreenModes> & {\n /** True in any of the three modes: dashboard maximize, browser fullscreen, separate window */\n isExpanded?: boolean;\n setMaximized: (maximized: boolean) => void;\n appData?: unknown;\n layoutEnvironment?: ({ type?: string } & Record<string, unknown>) | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n appSettingsComponent?: ComponentType<any>;\n toggleAnnotationsList?: () => void;\n onHelpCenterClick?: () => void;\n secondaryMenuItems?: { title: ReactNode; onClick?: () => void; icon?: ReactNode }[];\n isInsideNewMobileApp?: boolean;\n reloadApp?: () => void;\n };\n\nexport const AppCommonsContext = createContext<AppCommonsContextTypeInternal>(\n // TODO provide defaults\n null as unknown as AppCommonsContextTypeInternal\n);\n\nexport const useAppCommonsInternal = () => useContext(AppCommonsContext);\n\nexport const useAppCommons = () => useContext(AppCommonsContext) as AppCommonsContextType;\n"],"names":["AppCommonsContext","createContext","useContext"],"mappings":"2FAuFaA,EAAoBC,EAAaA,cAE5C,wDAK2B,WAAH,OAASC,EAAAA,WAAWF,EAAkB,gCAF3B,WAAH,OAASE,EAAAA,WAAWF,EAAkB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionsTestIds=void 0,(e=exports.ActionsTestIds||(exports.ActionsTestIds={})).CollapseButtonTestId="CorvaUI.AppHeader.Actions.CollapseButtonTestId",e.ExpandButtonTestId="CorvaUI.AppHeader.Actions.ExpandButtonTestId",e.AdditionalActionItemTestId="CorvaUI.AppHeader.Actions.AdditionalActionItemTestId",e.CloseCommentButtonTestId="CorvaUI.AppHeader.Actions.CloseCommentButtonTestId",e.AddMessageButtonTestId="CorvaUI.AppHeader.Actions.AddMessageButtonTestId",e.MaximizeItemTestId="CorvaUI.AppHeader.Actions.MaximizeItemTestId",e.BrowserFullscreenItemTestId="CorvaUI.AppHeader.Actions.BrowserFullscreenItemTestId",e.SeparateWindowItemTestId="CorvaUI.AppHeader.Actions.SeparateWindowItemTestId";
|
|
1
|
+
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionsTestIds=void 0,(e=exports.ActionsTestIds||(exports.ActionsTestIds={})).MoreButtonTestId="CorvaUI.AppHeader.Actions.MoreButtonTestId",e.CollapseButtonTestId="CorvaUI.AppHeader.Actions.CollapseButtonTestId",e.ExpandButtonTestId="CorvaUI.AppHeader.Actions.ExpandButtonTestId",e.AdditionalActionItemTestId="CorvaUI.AppHeader.Actions.AdditionalActionItemTestId",e.CloseCommentButtonTestId="CorvaUI.AppHeader.Actions.CloseCommentButtonTestId",e.AddMessageButtonTestId="CorvaUI.AppHeader.Actions.AddMessageButtonTestId",e.MaximizeItemTestId="CorvaUI.AppHeader.Actions.MaximizeItemTestId",e.BrowserFullscreenItemTestId="CorvaUI.AppHeader.Actions.BrowserFullscreenItemTestId",e.SeparateWindowItemTestId="CorvaUI.AppHeader.Actions.SeparateWindowItemTestId";
|
|
2
2
|
//# sourceMappingURL=Actions.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.constants.js","sources":["../../../../../../src/componentsV2/AppHeader/V3/Actions/Actions.constants.ts"],"sourcesContent":["export enum ActionsTestIds {\n CollapseButtonTestId = 'CorvaUI.AppHeader.Actions.CollapseButtonTestId',\n ExpandButtonTestId = 'CorvaUI.AppHeader.Actions.ExpandButtonTestId',\n AdditionalActionItemTestId = 'CorvaUI.AppHeader.Actions.AdditionalActionItemTestId',\n CloseCommentButtonTestId = 'CorvaUI.AppHeader.Actions.CloseCommentButtonTestId',\n AddMessageButtonTestId = 'CorvaUI.AppHeader.Actions.AddMessageButtonTestId',\n MaximizeItemTestId = 'CorvaUI.AppHeader.Actions.MaximizeItemTestId',\n BrowserFullscreenItemTestId = 'CorvaUI.AppHeader.Actions.BrowserFullscreenItemTestId',\n SeparateWindowItemTestId = 'CorvaUI.AppHeader.Actions.SeparateWindowItemTestId',\n}\n"],"names":["ActionsTestIds"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.constants.js","sources":["../../../../../../src/componentsV2/AppHeader/V3/Actions/Actions.constants.ts"],"sourcesContent":["export enum ActionsTestIds {\n MoreButtonTestId = 'CorvaUI.AppHeader.Actions.MoreButtonTestId',\n CollapseButtonTestId = 'CorvaUI.AppHeader.Actions.CollapseButtonTestId',\n ExpandButtonTestId = 'CorvaUI.AppHeader.Actions.ExpandButtonTestId',\n AdditionalActionItemTestId = 'CorvaUI.AppHeader.Actions.AdditionalActionItemTestId',\n CloseCommentButtonTestId = 'CorvaUI.AppHeader.Actions.CloseCommentButtonTestId',\n AddMessageButtonTestId = 'CorvaUI.AppHeader.Actions.AddMessageButtonTestId',\n MaximizeItemTestId = 'CorvaUI.AppHeader.Actions.MaximizeItemTestId',\n BrowserFullscreenItemTestId = 'CorvaUI.AppHeader.Actions.BrowserFullscreenItemTestId',\n SeparateWindowItemTestId = 'CorvaUI.AppHeader.Actions.SeparateWindowItemTestId',\n}\n"],"names":["ActionsTestIds"],"mappings":"aAUC,IAVWA,yDAAAA,QAAcA,oBAAA,GAAdA,EAAAA,QAAcA,iBAAdA,uBAAc,CAAA,IAAA,iBAAA,6CAAdA,EAAc,qBAAA,iDAAdA,EAAc,mBAAA,+CAAdA,EAAc,2BAAA,uDAAdA,EAAc,yBAAA,qDAAdA,EAAc,uBAAA,mDAAdA,EAAc,mBAAA,+CAAdA,EAAc,4BAAA,wDAAdA,EAAc,yBAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/toConsumableArray"),s=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/typeof"),i=require("react"),r=require("classnames"),c=require("../../../ButtonIcon/ButtonIcon.js"),t=require("../../../Tooltip/Tooltip.js"),u=require("../SettingsButton/SettingsButton.js");require("../SettingsButton/SettingsButton.constants.js");var l=require("../../../Menu/Menu.js");require("../../../AppCommonsProvider/AppCommonsProvider.js");var a=require("../../../AppCommonsProvider/AppCommonsContext.js"),m=require("../../../AppPanel/AppPanelsContext.js"),d=require("../../../HideInNativeApp/index.js"),j=require("./Actions.constants.js"),p=require("./Actions.scss.js"),q=require("../../../../icons/iconParkIcons.js"),I=require("../../../../icons/customIcons/icons/AddMessage.js");require("../../../../icons/customIcons/icons/DragOne.js"),require("../../../../icons/customIcons/icons/Attention.js"),require("../../../../icons/customIcons/icons/Collapse.js"),require("../../../../icons/customIcons/icons/Dashboard.js"),require("../../../../icons/customIcons/icons/Expand.js"),require("../../../../icons/customIcons/icons/FolderClosed.js"),require("../../../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../../../icons/customIcons/icons/FolderOpened.js"),require("../../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../../icons/customIcons/icons/Search.js"),require("../../../../icons/customIcons/icons/SearchOne.js"),require("../../../../icons/customIcons/icons/Wellhub.js"),require("../../../../icons/customIcons/icons/MultiRuler.js"),require("../../../../icons/customIcons/icons/Checkbox.js"),require("../../../../icons/customIcons/icons/CheckboxChecked.js"),require("../../../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../../../icons/customIcons/icons/Radio.js"),require("../../../../icons/customIcons/icons/RadioChecked.js"),require("../../../../icons/customIcons/icons/SimulFrac.js"),require("../../../../icons/customIcons/icons/ZipperFrac.js"),require("../../../../icons/customIcons/icons/CautionFilled.js"),require("../../../../icons/customIcons/icons/InfoRounded.js"),require("../../../../icons/customIcons/icons/FlameFilled.js"),require("../../../../icons/customIcons/icons/MoreApp.js"),require("../../../../icons/customIcons/icons/Pad.js"),require("../../../../icons/customIcons/icons/DrilloutUnit.js"),require("../../../../icons/customIcons/icons/FracFleet.js"),require("../../../../icons/customIcons/icons/Global.js"),require("../../../../icons/customIcons/icons/Program.js"),require("../../../../icons/customIcons/icons/Rig.js"),require("../../../../icons/customIcons/icons/Well.js"),require("../../../../icons/customIcons/icons/Gap.js"),require("../../../../icons/customIcons/icons/Pin.js"),require("../../../../icons/customIcons/icons/PinOne.js"),require("../../../../icons/customIcons/icons/PinOneCrossed.js"),require("../../../../icons/customIcons/icons/CloseOneFilled.js"),require("../../../../icons/customIcons/icons/AttentionFilled.js"),require("../../../../icons/customIcons/icons/CheckOneFilled.js"),require("../../../../icons/customIcons/icons/Archive.js"),require("../../../../icons/customIcons/icons/ArchiveCancel.js"),require("../../../../icons/customIcons/icons/Unarchive.js"),require("../../../../icons/customIcons/icons/Archived.js"),require("../../../../icons/customIcons/icons/InterventionUnit.js"),require("../../../../icons/customIcons/icons/CloudDelete.js"),require("../../../../icons/customIcons/icons/Lasso.js"),require("../../../../icons/customIcons/icons/Radius.js"),require("../../../../icons/customIcons/icons/ErrorOps.js"),require("../../../../icons/customIcons/icons/DataTypeOps.js"),require("../../../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../../../icons/customIcons/icons/CalibrationOps.js"),require("../../../../icons/customIcons/icons/CriticalOps.js"),require("../../../../icons/customIcons/icons/Company.js"),require("../../../../icons/customIcons/icons/ArchiveOne.js"),require("../../../../icons/customIcons/icons/ParseBotFusion.js"),require("../../../../icons/customIcons/icons/Connect.js"),require("../../../../icons/customIcons/icons/PuzzleOne.js"),require("../../../../icons/customIcons/icons/Feed.js"),require("../../../../icons/customIcons/icons/Prompt.js"),require("../../../../icons/customIcons/icons/Companies.js"),require("../../../../icons/customIcons/icons/ClipboardAi.js"),require("../../../../icons/customIcons/icons/Key.js"),require("../../../../icons/customIcons/icons/AtSignCrossed.js"),require("../../../../icons/customIcons/icons/MappingManual.js"),require("../../../../icons/customIcons/icons/Mapping.js"),require("../../../../icons/customIcons/icons/Metrics.js"),require("../../../../icons/customIcons/icons/Drops.js"),require("../../../../icons/customIcons/icons/ClipboardSearch.js"),require("../../../../icons/customIcons/icons/Template.js"),require("../../../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../../../icons/customIcons/icons/UnitConversion.js"),require("../../../../icons/customIcons/icons/NPT.js"),require("../../../../icons/customIcons/icons/GuidedFrac.js"),require("../../../../clients/subscriptions/constants.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("querystring"),require("uuid/v1"),require("lodash"),require("../../../../clients/subscriptions.v1.js"),require("../../../../clients/jsonApi/index.js"),require("../../../../clients/subscriptions/subscriptions-client.factory.js"),require("immutable"),require("query-string"),require("../../../../constants/goals.js"),require("../../../../constants/segment.js"),require("../../../../constants/alerts.js"),require("../../../../constants/apps.js"),require("../../../../constants/drillstring.js"),require("../../../../constants/completion.js"),require("../../../../constants/appPackages.js"),require("../../../../constants/notifications.js"),require("../../../../constants/feed.js"),require("../../../../constants/bha.js"),require("../../../../constants/corvaCompanyId.js"),require("../../../../components/GradientManager/configuration/constants.js"),require("../../../../utils/index.js"),require("uuid"),require("jsona"),require("../../../../utils/env.js"),require("../../../../components/StatusBadge/constants.js"),require("lodash/set"),require("lodash/get"),require("lodash/unset"),require("moment"),require("../../../../clients/api/apiCore.js"),require("../../../../clients/constants.js"),require("../../../../clients/sso/auth0.js"),require("../../../../clients/sso/oauth2.js"),require("../../../../clients/api/rateLimiter.js"),require("lodash/isEmpty"),require("lodash/sortBy"),require("../../../../constants/streamSourceType.js");var C=require("../../../../components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js"),f=require("../../../../utils/mobileDetect.js"),b=require("react/jsx-runtime");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=h(e),A=h(s),g=h(n),v=h(o),M=h(r);function y(e,s){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);s&&(o=o.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),n.push.apply(n,o)}return n}function O(e){for(var s=1;s<arguments.length;s++){var n=null!=arguments[s]?arguments[s]:{};s%2?y(Object(n),!0).forEach((function(s){A.default(e,s,n[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))}))}return e}var S=function(e){return!!e&&"object"===v.default(e)&&"title"in e};exports.Actions=function(e){var s=e.additionalActions,n=e.showComments,o=e.disableSettings,r=e.hideSettingsUnderMore,h=a.useAppCommonsInternal(),A=h.maximized,v=h.setMaximized,y=h.appSettingsComponent,k=h.isExpanded,B=h.isBrowserFullscreen,T=h.enterBrowserFullscreen,P=h.exitBrowserFullscreen,F=h.isSeparateWindow,w=h.openSeparateWindow,E=h.closeSeparateWindow,D=C.useAppCommentsMode(),N=C.useSetAppCommentsMode(),z=i.useState(!1),R=g.default(z,2),W=R[0],U=R[1],G=i.useRef(null),H=i.useRef(null),L=i.useState(!0),_=g.default(L,2),K=_[0],Z=_[1],J=i.useState(!1),Q=g.default(J,2),V=Q[0],X=Q[1],Y=i.useRef(null),$=i.useRef(!1),ee=m.useAppSettingsPanel(),se=ee.open,ne=ee.isOpen,oe=!!y&&!o,ie=i.useCallback((function(){U((function(e){return!e}))}),[]),re=i.useCallback((function(){N((function(e){return!e}))}),[N]),ce=i.useCallback((function(){$.current=!1,X(!1)}),[]),te=i.useCallback((function(){Z(!1),ce(),F?null==E||E():B?null==P||P():v(!A)}),[ce,E,P,B,F,A,v]),ue=F?"Close Separate Window":k?"Restore":"Maximize",le=i.useCallback((function(){Y.current&&(clearTimeout(Y.current),Y.current=null)}),[]),ae=i.useCallback((function(){!k&&T&&(le(),Y.current=setTimeout((function(){$.current=!0,X(!0)}),500))}),[le,T,k]);i.useEffect((function(){return le}),[le]);var me=i.useCallback((function(){$.current?$.current=!1:te()}),[te]),de=i.useCallback((function(){ce(),null==w||w()}),[ce,w]),je=i.useCallback((function(){ce(),null==T||T()}),[ce,T]);i.useEffect((function(){Z(!0)}),[k]);var pe=i.useMemo((function(){if(f.isInsideNewMobileApp)return[];var e=function(e){return function(){ie(),null==e||e()}},o=(s||[]).filter(S).map((function(s){return O(O({},s),{},{onClick:e(s.onClick)})})),i={icon:b.jsx(q.MessageIcon,{}),onClick:e(re),title:D?"Close Comments Mode":"Add Comment"},c={title:ue,onClick:e(te),icon:k?b.jsx(q.CollapseIcon,{}):b.jsx(q.ExpandIcon,{})},t={title:"Settings",onClick:e(se),icon:b.jsx(q.SettingTwoIcon,{})};return[].concat(x.default(o),x.default(n?[i]:[]),x.default(r&&oe?[t]:[]),[c])}),[s,D,r,k,ue,se,oe,n,re,te,ie]),qe=pe.length>1,Ie=b.jsx(c.ButtonIcon,{size:"small",type:"tertiaryBg",ref:H,onClick:me,onMouseDown:ae,onMouseUp:le,onMouseLeave:le,className:qe?p.fullscreenButton:void 0,testId:k?j.ActionsTestIds.CollapseButtonTestId:j.ActionsTestIds.ExpandButtonTestId,children:k?b.jsx(q.CollapseIcon,{}):b.jsx(q.ExpandIcon,{})});return b.jsxs(b.Fragment,{children:[b.jsx(d.HideInNativeApp,{children:null==s?void 0:s.map((function(e,s){return S(e)?b.jsx(t.Tooltip,{title:e.title,children:b.jsx(c.ButtonIcon,{size:"small",type:"tertiary",onClick:e.onClick,className:M.default(p.additionalActionButton),testId:j.ActionsTestIds.AdditionalActionItemTestId,children:e.icon})},s):b.jsx(i.Fragment,{children:e},s)}))}),b.jsx(d.HideInNativeApp,{children:n&&b.jsx(t.Tooltip,{title:D?"Close Comments Mode":"Add Comment",children:b.jsx(c.ButtonIcon,{size:"small",type:D?"secondaryBg":"tertiaryBg",onClick:re,className:qe?p.commentButton:void 0,testId:D?j.ActionsTestIds.CloseCommentButtonTestId:j.ActionsTestIds.AddMessageButtonTestId,children:D?b.jsx(q.CloseSmallIcon,{}):b.jsx(I.AddMessageCustomIcon,{fill:"currentColor"})})})}),oe&&b.jsx(u.SettingsButton,{className:r&&!f.isInsideNewMobileApp?p.settingsHiddenUnderMore:void 0}),b.jsxs(d.HideInNativeApp,{children:[K?b.jsx(t.Tooltip,{title:ue,children:Ie}):Ie,H.current&&b.jsxs(l.Menu,{anchorEl:H.current,open:V,onClose:ce,placement:"bottom-end",children:[b.jsx(l.Menu.Item,{onClick:te,testId:j.ActionsTestIds.MaximizeItemTestId,children:"Maximize"}),b.jsx(l.Menu.Item,{onClick:je,testId:j.ActionsTestIds.BrowserFullscreenItemTestId,children:"Full Screen"}),b.jsx(l.Menu.Item,{onClick:de,testId:j.ActionsTestIds.SeparateWindowItemTestId,children:"Separate Window"})]})]}),b.jsxs(d.HideInNativeApp,{children:[qe&&b.jsx(t.Tooltip,{title:"More",children:b.jsx(c.ButtonIcon,{type:W||r&&ne?"secondaryBg":"tertiaryBg",className:p.moreButton,ref:G,onClick:ie,size:"small",children:b.jsx(q.MoreOneIcon,{})})}),qe&&G.current&&b.jsx(l.Menu,{anchorEl:G.current,open:W,onClose:ie,placement:"bottom-end",children:pe.map((function(e,s){return b.jsx(l.Menu.Item,{size:"large",prefix:e.icon,onClick:e.onClick,children:e.title},s)}))})]})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/toConsumableArray"),s=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/typeof"),i=require("react"),r=require("classnames"),c=require("../../../ButtonIcon/ButtonIcon.js"),t=require("../../../Tooltip/Tooltip.js"),u=require("../SettingsButton/SettingsButton.js");require("../SettingsButton/SettingsButton.constants.js");var l=require("../../../Menu/Menu.js");require("../../../AppCommonsProvider/AppCommonsProvider.js");var a=require("../../../AppCommonsProvider/AppCommonsContext.js"),m=require("../../../AppPanel/AppPanelsContext.js"),d=require("../../../HideInNativeApp/index.js"),j=require("./Actions.constants.js"),p=require("./Actions.scss.js"),q=require("../../../../icons/iconParkIcons.js"),I=require("../../../../icons/customIcons/icons/AddMessage.js");require("../../../../icons/customIcons/icons/DragOne.js"),require("../../../../icons/customIcons/icons/Attention.js"),require("../../../../icons/customIcons/icons/Collapse.js"),require("../../../../icons/customIcons/icons/Dashboard.js"),require("../../../../icons/customIcons/icons/Expand.js"),require("../../../../icons/customIcons/icons/FolderClosed.js"),require("../../../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../../../icons/customIcons/icons/FolderOpened.js"),require("../../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../../icons/customIcons/icons/Search.js"),require("../../../../icons/customIcons/icons/SearchOne.js"),require("../../../../icons/customIcons/icons/Wellhub.js"),require("../../../../icons/customIcons/icons/MultiRuler.js"),require("../../../../icons/customIcons/icons/Checkbox.js"),require("../../../../icons/customIcons/icons/CheckboxChecked.js"),require("../../../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../../../icons/customIcons/icons/Radio.js"),require("../../../../icons/customIcons/icons/RadioChecked.js"),require("../../../../icons/customIcons/icons/SimulFrac.js"),require("../../../../icons/customIcons/icons/ZipperFrac.js"),require("../../../../icons/customIcons/icons/CautionFilled.js"),require("../../../../icons/customIcons/icons/InfoRounded.js"),require("../../../../icons/customIcons/icons/FlameFilled.js"),require("../../../../icons/customIcons/icons/MoreApp.js"),require("../../../../icons/customIcons/icons/Pad.js"),require("../../../../icons/customIcons/icons/DrilloutUnit.js"),require("../../../../icons/customIcons/icons/FracFleet.js"),require("../../../../icons/customIcons/icons/Global.js"),require("../../../../icons/customIcons/icons/Program.js"),require("../../../../icons/customIcons/icons/Rig.js"),require("../../../../icons/customIcons/icons/Well.js"),require("../../../../icons/customIcons/icons/Gap.js"),require("../../../../icons/customIcons/icons/Pin.js"),require("../../../../icons/customIcons/icons/PinOne.js"),require("../../../../icons/customIcons/icons/PinOneCrossed.js"),require("../../../../icons/customIcons/icons/CloseOneFilled.js"),require("../../../../icons/customIcons/icons/AttentionFilled.js"),require("../../../../icons/customIcons/icons/CheckOneFilled.js"),require("../../../../icons/customIcons/icons/Archive.js"),require("../../../../icons/customIcons/icons/ArchiveCancel.js"),require("../../../../icons/customIcons/icons/Unarchive.js"),require("../../../../icons/customIcons/icons/Archived.js"),require("../../../../icons/customIcons/icons/InterventionUnit.js"),require("../../../../icons/customIcons/icons/CloudDelete.js"),require("../../../../icons/customIcons/icons/Lasso.js"),require("../../../../icons/customIcons/icons/Radius.js"),require("../../../../icons/customIcons/icons/ErrorOps.js"),require("../../../../icons/customIcons/icons/DataTypeOps.js"),require("../../../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../../../icons/customIcons/icons/CalibrationOps.js"),require("../../../../icons/customIcons/icons/CriticalOps.js"),require("../../../../icons/customIcons/icons/Company.js"),require("../../../../icons/customIcons/icons/ArchiveOne.js"),require("../../../../icons/customIcons/icons/ParseBotFusion.js"),require("../../../../icons/customIcons/icons/Connect.js"),require("../../../../icons/customIcons/icons/PuzzleOne.js"),require("../../../../icons/customIcons/icons/Feed.js"),require("../../../../icons/customIcons/icons/Prompt.js"),require("../../../../icons/customIcons/icons/Companies.js"),require("../../../../icons/customIcons/icons/ClipboardAi.js"),require("../../../../icons/customIcons/icons/Key.js"),require("../../../../icons/customIcons/icons/AtSignCrossed.js"),require("../../../../icons/customIcons/icons/MappingManual.js"),require("../../../../icons/customIcons/icons/Mapping.js"),require("../../../../icons/customIcons/icons/Metrics.js"),require("../../../../icons/customIcons/icons/Drops.js"),require("../../../../icons/customIcons/icons/ClipboardSearch.js"),require("../../../../icons/customIcons/icons/Template.js"),require("../../../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../../../icons/customIcons/icons/UnitConversion.js"),require("../../../../icons/customIcons/icons/NPT.js"),require("../../../../icons/customIcons/icons/GuidedFrac.js"),require("../../../../clients/subscriptions/constants.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("querystring"),require("uuid/v1"),require("lodash"),require("../../../../clients/subscriptions.v1.js"),require("../../../../clients/jsonApi/index.js"),require("../../../../clients/subscriptions/subscriptions-client.factory.js"),require("immutable"),require("query-string"),require("../../../../constants/goals.js"),require("../../../../constants/segment.js"),require("../../../../constants/alerts.js"),require("../../../../constants/apps.js"),require("../../../../constants/drillstring.js"),require("../../../../constants/completion.js"),require("../../../../constants/appPackages.js"),require("../../../../constants/notifications.js"),require("../../../../constants/feed.js"),require("../../../../constants/bha.js"),require("../../../../constants/corvaCompanyId.js"),require("../../../../components/GradientManager/configuration/constants.js"),require("../../../../utils/index.js"),require("uuid"),require("jsona"),require("../../../../utils/env.js"),require("../../../../components/StatusBadge/constants.js"),require("lodash/set"),require("lodash/get"),require("lodash/unset"),require("moment"),require("../../../../clients/api/apiCore.js"),require("../../../../clients/constants.js"),require("../../../../clients/sso/auth0.js"),require("../../../../clients/sso/oauth2.js"),require("../../../../clients/api/rateLimiter.js"),require("lodash/isEmpty"),require("lodash/sortBy"),require("../../../../constants/streamSourceType.js");var C=require("../../../../components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js"),f=require("../../../../utils/mobileDetect.js"),b=require("react/jsx-runtime");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=h(e),A=h(s),g=h(n),v=h(o),M=h(r);function y(e,s){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);s&&(o=o.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),n.push.apply(n,o)}return n}function O(e){for(var s=1;s<arguments.length;s++){var n=null!=arguments[s]?arguments[s]:{};s%2?y(Object(n),!0).forEach((function(s){A.default(e,s,n[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))}))}return e}var S=function(e){return!!e&&"object"===v.default(e)&&"title"in e};exports.Actions=function(e){var s=e.additionalActions,n=e.showComments,o=e.disableSettings,r=e.hideSettingsUnderMore,h=a.useAppCommonsInternal(),A=h.maximized,v=h.setMaximized,y=h.appSettingsComponent,k=h.isExpanded,B=h.isBrowserFullscreen,T=h.enterBrowserFullscreen,P=h.exitBrowserFullscreen,F=h.isSeparateWindow,w=h.openSeparateWindow,E=h.closeSeparateWindow,D=h.dashboardMeta,N=!(null==D||!D.isEmbedded),z=C.useAppCommentsMode(),R=C.useSetAppCommentsMode(),W=i.useState(!1),U=g.default(W,2),G=U[0],H=U[1],L=i.useRef(null),_=i.useRef(null),K=i.useState(!0),Z=g.default(K,2),J=Z[0],Q=Z[1],V=i.useState(!1),X=g.default(V,2),Y=X[0],$=X[1],ee=i.useRef(null),se=i.useRef(!1),ne=m.useAppSettingsPanel(),oe=ne.open,ie=ne.isOpen,re=!!y&&!o,ce=i.useCallback((function(){H((function(e){return!e}))}),[]),te=i.useCallback((function(){R((function(e){return!e}))}),[R]),ue=i.useCallback((function(){se.current=!1,$(!1)}),[]),le=i.useCallback((function(){Q(!1),ue(),F?null==E||E():B?null==P||P():v(!A)}),[ue,E,P,B,F,A,v]),ae=F?"Close Separate Window":k?"Restore":"Maximize",me=i.useCallback((function(){ee.current&&(clearTimeout(ee.current),ee.current=null)}),[]),de=i.useCallback((function(){!k&&T&&(me(),ee.current=setTimeout((function(){se.current=!0,$(!0)}),500))}),[me,T,k]);i.useEffect((function(){return me}),[me]);var je=i.useCallback((function(){se.current?se.current=!1:le()}),[le]),pe=i.useCallback((function(){ue(),null==w||w()}),[ue,w]),qe=i.useCallback((function(){ue(),null==T||T()}),[ue,T]);i.useEffect((function(){Q(!0)}),[k]);var Ie=i.useMemo((function(){if(f.isInsideNewMobileApp)return[];var e=function(e){return function(){ce(),null==e||e()}},o=(s||[]).filter(S).map((function(s){return O(O({},s),{},{onClick:e(s.onClick)})})),i={icon:b.jsx(q.MessageIcon,{}),onClick:e(te),title:z?"Close Comments Mode":"Add Comment"},c={title:ae,onClick:e(le),icon:k?b.jsx(q.CollapseIcon,{}):b.jsx(q.ExpandIcon,{})},t={title:"Settings",onClick:e(oe),icon:b.jsx(q.SettingTwoIcon,{})};return[].concat(x.default(o),x.default(n?[i]:[]),x.default(r&&re?[t]:[]),x.default(N?[]:[c]))}),[s,z,r,k,ae,oe,re,n,N,te,le,ce]),Ce=Ie.length>(N?0:1),fe=b.jsx(c.ButtonIcon,{size:"small",type:"tertiaryBg",ref:_,onClick:je,onMouseDown:de,onMouseUp:me,onMouseLeave:me,className:Ce?p.fullscreenButton:void 0,testId:k?j.ActionsTestIds.CollapseButtonTestId:j.ActionsTestIds.ExpandButtonTestId,children:k?b.jsx(q.CollapseIcon,{}):b.jsx(q.ExpandIcon,{})}),be=J?b.jsx(t.Tooltip,{title:ae,children:fe}):fe;return b.jsxs(b.Fragment,{children:[b.jsx(d.HideInNativeApp,{children:null==s?void 0:s.map((function(e,s){return S(e)?b.jsx(t.Tooltip,{title:e.title,children:b.jsx(c.ButtonIcon,{size:"small",type:"tertiary",onClick:e.onClick,className:M.default(p.additionalActionButton),testId:j.ActionsTestIds.AdditionalActionItemTestId,children:e.icon})},s):b.jsx(i.Fragment,{children:e},s)}))}),b.jsx(d.HideInNativeApp,{children:n&&b.jsx(t.Tooltip,{title:z?"Close Comments Mode":"Add Comment",children:b.jsx(c.ButtonIcon,{size:"small",type:z?"secondaryBg":"tertiaryBg",onClick:te,className:Ce?p.commentButton:void 0,testId:z?j.ActionsTestIds.CloseCommentButtonTestId:j.ActionsTestIds.AddMessageButtonTestId,children:z?b.jsx(q.CloseSmallIcon,{}):b.jsx(I.AddMessageCustomIcon,{fill:"currentColor"})})})}),re&&b.jsx(u.SettingsButton,{className:r&&!f.isInsideNewMobileApp?p.settingsHiddenUnderMore:void 0}),b.jsxs(d.HideInNativeApp,{children:[!N&&be,!N&&_.current&&b.jsxs(l.Menu,{anchorEl:_.current,open:Y,onClose:ue,placement:"bottom-end",children:[b.jsx(l.Menu.Item,{onClick:le,testId:j.ActionsTestIds.MaximizeItemTestId,children:"Maximize"}),b.jsx(l.Menu.Item,{onClick:qe,testId:j.ActionsTestIds.BrowserFullscreenItemTestId,children:"Full Screen"}),b.jsx(l.Menu.Item,{onClick:pe,testId:j.ActionsTestIds.SeparateWindowItemTestId,children:"Separate Window"})]})]}),b.jsxs(d.HideInNativeApp,{children:[Ce&&b.jsx(t.Tooltip,{title:"More",children:b.jsx(c.ButtonIcon,{type:G||r&&ie?"secondaryBg":"tertiaryBg",className:p.moreButton,ref:L,testId:j.ActionsTestIds.MoreButtonTestId,onClick:ce,size:"small",children:b.jsx(q.MoreOneIcon,{})})}),Ce&&L.current&&b.jsx(l.Menu,{anchorEl:L.current,open:G,onClose:ce,placement:"bottom-end",children:Ie.map((function(e,s){return b.jsx(l.Menu.Item,{size:"large",prefix:e.icon,onClick:e.onClick,children:e.title},s)}))})]})]})};
|
|
2
2
|
//# sourceMappingURL=Actions.js.map
|