@morgan-and-morgan/intake-agent 1.6.0-beta.1 → 1.7.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/README.md +6 -0
- package/dist/mm-intake-widget.js +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,3 +34,9 @@ major. Every release is tagged `intake-agent-vx.y.z`.
|
|
|
34
34
|
| --- | --- | --- |
|
|
35
35
|
| `data-chat-url` | Release environment URL | Chat iframe target |
|
|
36
36
|
| `data-auto-open` | `false` | Open the chat immediately after mount |
|
|
37
|
+
|
|
38
|
+
The consultation modal reads `window.drupalSettings.mxPopup`, falling back to
|
|
39
|
+
`window.mxChatbotSettings.mxPopup` when the Drupal field is absent. Only the
|
|
40
|
+
boolean `false` suppresses the modal, including calls to `showPrompt()`.
|
|
41
|
+
Missing settings preserve the usual display rules. Settings are read when the
|
|
42
|
+
modal is about to appear; the launcher and chat remain available.
|
package/dist/mm-intake-widget.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const readLoaderConfig = (script, baseUri) => {
|
|
4
4
|
var _a;
|
|
5
5
|
const scriptUrl = new URL(script.src, baseUri);
|
|
6
|
-
const bundledChatUrl = "https://chat
|
|
6
|
+
const bundledChatUrl = "https://chat.mx2.law/embed/intake";
|
|
7
7
|
const chatUrl = new URL((_a = script.dataset.chatUrl) != null ? _a : bundledChatUrl, scriptUrl).href;
|
|
8
8
|
return {
|
|
9
9
|
assetBaseUrl: new URL(".", scriptUrl).href,
|
|
@@ -475,9 +475,12 @@
|
|
|
475
475
|
}
|
|
476
476
|
};
|
|
477
477
|
const showPrompt = () => {
|
|
478
|
+
var _a2, _b, _c;
|
|
478
479
|
globalThis.clearTimeout(promptTimer);
|
|
479
480
|
promptTimer = void 0;
|
|
480
|
-
|
|
481
|
+
const host = globalThis;
|
|
482
|
+
const mxPopup = (_c = (_a2 = host.drupalSettings) == null ? void 0 : _a2.mxPopup) != null ? _c : (_b = host.mxChatbotSettings) == null ? void 0 : _b.mxPopup;
|
|
483
|
+
if (mxPopup === false || hasPromptCooldown() || elements.chatDialog.dataset.state === "open") {
|
|
481
484
|
return;
|
|
482
485
|
}
|
|
483
486
|
promptReturnFocus = document.activeElement instanceof HTMLElement && document.activeElement !== mount ? document.activeElement : null;
|