@openmrs/esm-implementer-tools-app 6.2.1-pre.2748 → 6.2.1-pre.2749

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.
@@ -1,57 +1,152 @@
1
- import React from 'react';
2
- import styles from './styles.css';
1
+ import React, { useMemo, useState } from 'react';
2
+ import classNames from 'classnames';
3
+ import { useTranslation, type TFunction } from 'react-i18next';
4
+ import { Button } from '@carbon/react';
3
5
  import {
4
6
  CloseIcon,
5
7
  getExtensionInternalStore,
6
8
  useStore,
7
9
  useStoreWithActions,
8
10
  } from '@openmrs/esm-framework/src/internal';
9
- import { Button } from '@carbon/react';
10
- import { Portal } from './portal';
11
11
  import { ExtensionOverlay } from './extension-overlay.component';
12
+ import { Portal } from './portal';
12
13
  import { type ImplementerToolsStore, implementerToolsStore } from '../store';
14
+ import styles from './styles.scss';
15
+
16
+ interface ExitButtonProps {
17
+ t: TFunction;
18
+ }
19
+
20
+ interface SlotOverlayProps {
21
+ extensionCount: number;
22
+ moduleName: string;
23
+ slotName: string;
24
+ t: TFunction;
25
+ colorScheme: 'blue' | 'green';
26
+ }
13
27
 
14
28
  export default function UiEditor() {
29
+ const { t } = useTranslation();
15
30
  const { slots, extensions } = useStore(getExtensionInternalStore());
16
- const { isOpen: implementerToolsIsOpen } = useStore(implementerToolsStore);
31
+ const { isOpen: areImplementerToolsOpen } = useStore(implementerToolsStore);
32
+
33
+ const getExtensionCount = (slotName: string, moduleName: string) => {
34
+ if (!extensions || !moduleName) return 0;
35
+
36
+ let count = 0;
37
+
38
+ const slot = slots?.[slotName];
39
+
40
+ if (slot && Array.isArray(slot.attachedIds)) {
41
+ return slot.attachedIds.length;
42
+ }
43
+
44
+ return count;
45
+ };
46
+
47
+ const slotElements = useMemo(() => {
48
+ if (!slots) {
49
+ return [];
50
+ }
51
+
52
+ return Object.entries(slots)
53
+ .map(([slotName, slotInfo]) => {
54
+ if (!slotName) {
55
+ return null;
56
+ }
57
+
58
+ return {
59
+ slotName,
60
+ slotInfo,
61
+ element: document.querySelector(
62
+ `*[data-extension-slot-name="${slotName}"][data-extension-slot-module-name="${slotInfo.moduleName}"]`,
63
+ ) as HTMLElement | null,
64
+ };
65
+ })
66
+ .filter((x): x is NonNullable<typeof x> => Boolean(x));
67
+ }, [slots]);
68
+
69
+ const extensionElements = useMemo(() => {
70
+ if (!extensions) {
71
+ return [];
72
+ }
73
+
74
+ return Object.entries(extensions).flatMap(([extensionName, extensionInfo]) =>
75
+ Object.entries(extensionInfo.instances).flatMap(([slotModuleName, bySlotName]) =>
76
+ Object.entries(bySlotName).map(([slotName, extensionInstance]) => ({
77
+ extensionName,
78
+ slotModuleName,
79
+ slotName,
80
+ extensionInstance,
81
+ element: document.querySelector(
82
+ `*[data-extension-slot-name="${slotName}"][data-extension-slot-module-name="${slotModuleName}"] *[data-extension-id="${extensionInstance.id}"]`,
83
+ ) as HTMLElement | null,
84
+ })),
85
+ ),
86
+ );
87
+ }, [extensions]);
17
88
 
18
89
  return (
19
90
  <>
20
- {implementerToolsIsOpen ? null : <ExitButton />}
21
- {slots
22
- ? Object.entries(slots).map(([slotName, slotInfo]) => (
23
- <Portal
24
- key={`slot-overlay-${slotInfo.moduleName}-${slotName}`}
25
- el={document.querySelector(
26
- `*[data-extension-slot-name="${slotName}"][data-extension-slot-module-name="${slotInfo.moduleName}"]`,
27
- )}
28
- >
29
- <SlotOverlay slotName={slotName} moduleName={slotInfo.moduleName} />
91
+ <ExitButton t={t} />
92
+ {slotElements.map(
93
+ ({ slotName, slotInfo, element }, index) =>
94
+ element && (
95
+ <Portal key={`slot-overlay-${slotInfo.moduleName}-${slotName}`} el={element}>
96
+ <SlotOverlay
97
+ extensionCount={getExtensionCount(slotName, slotInfo.moduleName ?? '')}
98
+ moduleName={slotInfo.moduleName ?? ''}
99
+ slotName={slotName}
100
+ t={t}
101
+ colorScheme={index % 2 === 0 ? 'blue' : 'green'}
102
+ />
30
103
  </Portal>
31
- ))
32
- : null}
33
- {extensions
34
- ? Object.entries(extensions).map(([extensionName, extensionInfo]) =>
35
- Object.entries(extensionInfo.instances).map(([slotModuleName, bySlotName]) =>
36
- Object.entries(bySlotName).map(([slotName, extensionInstance]) => (
37
- <ExtensionOverlay
38
- key={slotName}
39
- extensionName={extensionName}
40
- slotModuleName={slotModuleName}
41
- slotName={slotName}
42
- domElement={document.querySelector(
43
- `*[data-extension-slot-name="${slotName}"][data-extension-slot-module-name="${slotModuleName}"] *[data-extension-id="${extensionInstance.id}"]`,
44
- )}
45
- />
46
- )),
47
- ),
48
- )
49
- : null}
104
+ ),
105
+ )}
106
+ {extensionElements.map(
107
+ ({ extensionName, slotModuleName, slotName, extensionInstance, element }) =>
108
+ element && (
109
+ <ExtensionOverlay
110
+ domElement={element}
111
+ extensionName={extensionName}
112
+ key={`${slotName}-${extensionInstance.id}`}
113
+ slotModuleName={slotModuleName}
114
+ slotName={slotName}
115
+ />
116
+ ),
117
+ )}
50
118
  </>
51
119
  );
52
120
  }
53
121
 
54
- export function SlotOverlay({ slotName, moduleName }) {
122
+ export function SlotOverlay({ slotName, moduleName, extensionCount = 0, colorScheme }: SlotOverlayProps) {
123
+ const { slots } = useStore(getExtensionInternalStore());
124
+ const [isHovering, setIsHovering] = useState(false);
125
+
126
+ const overlayClass = classNames(styles.slotOverlay, {
127
+ [styles.blueScheme]: colorScheme === 'blue',
128
+ [styles.greenScheme]: colorScheme === 'green',
129
+ [styles.slotOverlayHover]: isHovering,
130
+ });
131
+
132
+ const buttonClass = classNames(styles.slotName, {
133
+ [styles.blueScheme]: colorScheme === 'blue',
134
+ [styles.greenScheme]: colorScheme === 'green',
135
+ });
136
+
137
+ const getTooltipContent = () => {
138
+ let content = `Slot: ${slotName}\nModule: ${moduleName}`;
139
+
140
+ if (extensionCount > 0) {
141
+ const slot = slots?.[slotName];
142
+ if (slot?.attachedIds?.length) {
143
+ content += `\nExtensions (${extensionCount}):\n- ${slot.attachedIds.join('\n- ')}`;
144
+ }
145
+ }
146
+
147
+ return content;
148
+ };
149
+
55
150
  const setActiveExtensionSlot = (moduleName: string, slotName: string) => {
56
151
  if (!implementerToolsStore.getState().configPathBeingEdited) {
57
152
  implementerToolsStore.setState({
@@ -60,40 +155,47 @@ export function SlotOverlay({ slotName, moduleName }) {
60
155
  });
61
156
  }
62
157
  };
158
+
63
159
  return (
64
160
  <>
65
- <div className={styles.slotOverlay}></div>
161
+ <div className={overlayClass}></div>
66
162
  <button
163
+ className={buttonClass}
67
164
  onClick={(event) => {
68
165
  event.preventDefault();
69
- setActiveExtensionSlot(moduleName, slotName);
166
+ if (moduleName && slotName) {
167
+ setActiveExtensionSlot(moduleName, slotName);
168
+ }
70
169
  }}
71
- className={styles.slotName}
170
+ onMouseEnter={() => setIsHovering(true)}
171
+ onMouseLeave={() => setIsHovering(false)}
172
+ title={getTooltipContent()}
72
173
  >
73
- Slot: {slotName}
174
+ {slotName}
74
175
  </button>
75
176
  </>
76
177
  );
77
178
  }
78
179
 
79
- const actions = {
80
- toggleIsUIEditorEnabled({ isUIEditorEnabled }: ImplementerToolsStore) {
81
- return { isUIEditorEnabled: !isUIEditorEnabled };
82
- },
83
- };
84
-
85
- export function ExitButton() {
180
+ export function ExitButton({ t }: ExitButtonProps) {
86
181
  const { toggleIsUIEditorEnabled } = useStoreWithActions(implementerToolsStore, actions);
87
182
  return (
88
183
  <Button
89
184
  className={styles.exitButton}
185
+ hasIconOnly
186
+ iconDescription={t('exitUIEditor', 'Exit UI Editor')}
90
187
  kind="danger"
91
- size="sm"
188
+ onClick={toggleIsUIEditorEnabled}
92
189
  renderIcon={(props) => <CloseIcon {...props} size={16} />}
93
- iconDescription="Exit UI Editor"
190
+ size="sm"
94
191
  tooltipPosition="left"
95
- onClick={toggleIsUIEditorEnabled}
96
- hasIconOnly
192
+ wrapperClasses={styles.popover}
97
193
  />
98
194
  );
99
195
  }
196
+
197
+ const actions = {
198
+ toggleIsUIEditorEnabled({ isUIEditorEnabled }: ImplementerToolsStore) {
199
+ return { isUIEditorEnabled: !isUIEditorEnabled };
200
+ },
201
+ };
package/dist/587.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_openmrs_esm_implementer_tools_app=globalThis.webpackChunk_openmrs_esm_implementer_tools_app||[]).push([[587],{3539:(e,n,t)=>{t.d(n,{Z:()=>s});var o=t(9233),r=t.n(o),l=t(361),i=t.n(l)()(r());i.push([e.id,".-esm-implementer-tools__styles__slotOverlay___0dSua {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(43, 43, 185, 0.1);\n border: 1px solid rgba(43, 43, 185, 0.4);\n pointer-events: none;\n}\n\n.-esm-implementer-tools__styles__slotName___gwNsi {\n background-color: rgb(255, 255, 255, 0.85);\n border: 1px solid rgba(43, 43, 185, 0.4);\n color: #393939;\n cursor: pointer;\n position: absolute;\n bottom: 0;\n right: 0;\n padding: 0.5em 0.5em 0.5em 0.5em;\n z-index: 99999;\n}\n\n.-esm-implementer-tools__styles__extensionOverlay___EKzCd {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: none;\n border: none;\n}\n\n.-esm-implementer-tools__styles__extensionOverlay___EKzCd:hover {\n background-color: rgba(43, 43, 185, 0.1);\n}\n\n/* Show the tooltip text when you mouse over the tooltip container */\n.-esm-implementer-tools__styles__extensionOverlay___EKzCd:focus .-esm-implementer-tools__styles__extensionTooltip___QVban,\n.-esm-implementer-tools__styles__extensionOverlay___EKzCd:hover .-esm-implementer-tools__styles__extensionTooltip___QVban {\n visibility: visible;\n opacity: 1;\n}\n\n.-esm-implementer-tools__styles__extensionTooltip___QVban {\n visibility: hidden;\n width: auto;\n background-color: rgb(255, 255, 255, 0.85);\n text-align: center;\n padding: 0.5em 0.5em 0.5em 0.5em;\n border: 1px solid rgba(43, 43, 185, 0.4);\n\n position: absolute;\n top: 0;\n left: 0;\n}\n\n.-esm-implementer-tools__styles__exitButton___VWj92 {\n position: fixed !important;\n bottom: 0;\n right: 0;\n z-index: 999999;\n}\n","",{version:3,sources:["webpack://./src/ui-editor/styles.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,wCAAwC;EACxC,wCAAwC;EACxC,oBAAoB;AACtB;;AAEA;EACE,0CAA0C;EAC1C,wCAAwC;EACxC,cAAc;EACd,eAAe;EACf,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,gCAAgC;EAChC,cAAc;AAChB;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,gBAAgB;EAChB,YAAY;AACd;;AAEA;EACE,wCAAwC;AAC1C;;AAEA,oEAAoE;AACpE;;EAEE,mBAAmB;EACnB,UAAU;AACZ;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,0CAA0C;EAC1C,kBAAkB;EAClB,gCAAgC;EAChC,wCAAwC;;EAExC,kBAAkB;EAClB,MAAM;EACN,OAAO;AACT;;AAEA;EACE,0BAA0B;EAC1B,SAAS;EACT,QAAQ;EACR,eAAe;AACjB",sourcesContent:[".slotOverlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(43, 43, 185, 0.1);\n border: 1px solid rgba(43, 43, 185, 0.4);\n pointer-events: none;\n}\n\n.slotName {\n background-color: rgb(255, 255, 255, 0.85);\n border: 1px solid rgba(43, 43, 185, 0.4);\n color: #393939;\n cursor: pointer;\n position: absolute;\n bottom: 0;\n right: 0;\n padding: 0.5em 0.5em 0.5em 0.5em;\n z-index: 99999;\n}\n\n.extensionOverlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: none;\n border: none;\n}\n\n.extensionOverlay:hover {\n background-color: rgba(43, 43, 185, 0.1);\n}\n\n/* Show the tooltip text when you mouse over the tooltip container */\n.extensionOverlay:focus .extensionTooltip,\n.extensionOverlay:hover .extensionTooltip {\n visibility: visible;\n opacity: 1;\n}\n\n.extensionTooltip {\n visibility: hidden;\n width: auto;\n background-color: rgb(255, 255, 255, 0.85);\n text-align: center;\n padding: 0.5em 0.5em 0.5em 0.5em;\n border: 1px solid rgba(43, 43, 185, 0.4);\n\n position: absolute;\n top: 0;\n left: 0;\n}\n\n.exitButton {\n position: fixed !important;\n bottom: 0;\n right: 0;\n z-index: 999999;\n}\n"],sourceRoot:""}]),i.locals={slotOverlay:"-esm-implementer-tools__styles__slotOverlay___0dSua",slotName:"-esm-implementer-tools__styles__slotName___gwNsi",extensionOverlay:"-esm-implementer-tools__styles__extensionOverlay___EKzCd",extensionTooltip:"-esm-implementer-tools__styles__extensionTooltip___QVban",exitButton:"-esm-implementer-tools__styles__exitButton___VWj92"};const s=i},587:(e,n,t)=>{t.r(n),t.d(n,{ExitButton:()=>P,SlotOverlay:()=>T,default:()=>j});var o=t(5776),r=t.n(o),l=t(487),i=t.n(l),s=t(631),a=t.n(s),c=t(2052),u=t.n(c),A=t(4010),m=t.n(A),d=t(1469),p=t.n(d),_=t(9329),b=t.n(_),y=t(3539),E={};E.styleTagTransform=b(),E.setAttributes=m(),E.insert=u().bind(null,"head"),E.domAPI=a(),E.insertStyleElement=p(),i()(y.Z,E);const f=y.Z&&y.Z.locals?y.Z.locals:void 0;var C=t(8478),g=t(4313),v=t(6551);function h(e){var n=e.el,t=e.children;return n?(0,v.createPortal)(t,n):null}function x(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function O(e){var n,t,l=e.extensionName,i=e.slotModuleName,s=e.slotName,a=e.domElement,c=(n=(0,o.useState)(),t=2,function(e){if(Array.isArray(e))return e}(n)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,r,l=[],i=!0,s=!1;try{for(t=t.call(e);!(i=(o=t.next()).done)&&(l.push(o.value),!n||l.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==t.return||t.return()}finally{if(s)throw r}}return l}}(n,t)||function(e,n){if(e){if("string"==typeof e)return x(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?x(e,n):void 0}}(n,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=c[0],A=c[1];return(0,o.useEffect)((function(){if(a){var e,n=document.createElement("div");null===(e=a.parentElement)||void 0===e||e.appendChild(n),A(n)}}),[a]),u?r().createElement(h,{key:"extension-overlay-".concat(i,"-").concat(s,"-").concat(l),el:u},r().createElement(w,{extensionId:l})):null}function w(e){var n=e.extensionId;return r().createElement("button",{className:f.extensionOverlay},r().createElement("span",{className:f.extensionTooltip},n))}var B=t(1004);function S(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function k(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function N(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,r,l=[],i=!0,s=!1;try{for(t=t.call(e);!(i=(o=t.next()).done)&&(l.push(o.value),!n||l.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==t.return||t.return()}finally{if(s)throw r}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return S(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?S(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(){var e=(0,C.useStore)((0,C.getExtensionInternalStore)()),n=e.slots,t=e.extensions,o=(0,C.useStore)(B.wT).isOpen;return r().createElement(r().Fragment,null,o?null:r().createElement(P,null),n?Object.entries(n).map((function(e){var n=N(e,2),t=n[0],o=n[1];return r().createElement(h,{key:"slot-overlay-".concat(o.moduleName,"-").concat(t),el:document.querySelector('*[data-extension-slot-name="'.concat(t,'"][data-extension-slot-module-name="').concat(o.moduleName,'"]'))},r().createElement(T,{slotName:t,moduleName:o.moduleName}))})):null,t?Object.entries(t).map((function(e){var n=N(e,2),t=n[0],o=n[1];return Object.entries(o.instances).map((function(e){var n=N(e,2),o=n[0],l=n[1];return Object.entries(l).map((function(e){var n=N(e,2),l=n[0],i=n[1];return r().createElement(O,{key:l,extensionName:t,slotModuleName:o,slotName:l,domElement:document.querySelector('*[data-extension-slot-name="'.concat(l,'"][data-extension-slot-module-name="').concat(o,'"] *[data-extension-id="').concat(i.id,'"]'))})}))}))})):null)}function T(e){var n=e.slotName,t=e.moduleName;return r().createElement(r().Fragment,null,r().createElement("div",{className:f.slotOverlay}),r().createElement("button",{onClick:function(e){e.preventDefault(),function(e,n){B.wT.getState().configPathBeingEdited||B.wT.setState({uiSelectedPath:[e,"extensionSlots",n],isOpen:!0})}(t,n)},className:f.slotName},"Slot: ",n))}var I={toggleIsUIEditorEnabled:function(e){return{isUIEditorEnabled:!e.isUIEditorEnabled}}};function P(){var e=(0,C.useStoreWithActions)(B.wT,I).toggleIsUIEditorEnabled;return r().createElement(g.Button,{className:f.exitButton,kind:"danger",size:"sm",renderIcon:function(e){return r().createElement(C.CloseIcon,(n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(n){k(e,n,t[n])}))}return e}({},e),t=null!=(t={size:16})?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t.push.apply(t,o)}return t}(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})),n));var n,t},iconDescription:"Exit UI Editor",tooltipPosition:"left",onClick:e,hasIconOnly:!0})}}}]);
package/dist/587.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"587.js","mappings":"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","sources":["webpack://@openmrs/esm-implementer-tools-app/./src/ui-editor/styles.css","webpack://@openmrs/esm-implementer-tools-app/./src/ui-editor/styles.css?545d","webpack://@openmrs/esm-implementer-tools-app/./src/ui-editor/portal.tsx","webpack://@openmrs/esm-implementer-tools-app/./src/ui-editor/extension-overlay.component.tsx","webpack://@openmrs/esm-implementer-tools-app/./src/ui-editor/ui-editor.tsx"],"names":["___CSS_LOADER_EXPORT___","push","module","id","locals","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","undefined","Portal","el","children","createPortal","ExtensionOverlay","extensionName","slotModuleName","slotName","domElement","useState","overlayDomElement","setOverlayDomElement","useEffect","newOverlayDomElement","document","createElement","parentElement","appendChild","key","Content","extensionId","button","className","styles","extensionOverlay","span","extensionTooltip","UiEditor","useStore","getExtensionInternalStore","slots","extensions","isOpen","implementerToolsStore","implementerToolsIsOpen","ExitButton","Object","entries","map","slotInfo","moduleName","querySelector","SlotOverlay","extensionInfo","instances","bySlotName","extensionInstance","div","slotOverlay","onClick","event","preventDefault","getState","configPathBeingEdited","setState","uiSelectedPath","setActiveExtensionSlot","actions","toggleIsUIEditorEnabled","isUIEditorEnabled","useStoreWithActions","Button","exitButton","kind","size","renderIcon","props","CloseIcon","iconDescription","tooltipPosition","hasIconOnly"],"sourceRoot":""}
@@ -1,63 +0,0 @@
1
- .slotOverlay {
2
- position: absolute;
3
- top: 0;
4
- left: 0;
5
- width: 100%;
6
- height: 100%;
7
- background-color: rgba(43, 43, 185, 0.1);
8
- border: 1px solid rgba(43, 43, 185, 0.4);
9
- pointer-events: none;
10
- }
11
-
12
- .slotName {
13
- background-color: rgb(255, 255, 255, 0.85);
14
- border: 1px solid rgba(43, 43, 185, 0.4);
15
- color: #393939;
16
- cursor: pointer;
17
- position: absolute;
18
- bottom: 0;
19
- right: 0;
20
- padding: 0.5em 0.5em 0.5em 0.5em;
21
- z-index: 99999;
22
- }
23
-
24
- .extensionOverlay {
25
- position: absolute;
26
- top: 0;
27
- left: 0;
28
- width: 100%;
29
- height: 100%;
30
- background: none;
31
- border: none;
32
- }
33
-
34
- .extensionOverlay:hover {
35
- background-color: rgba(43, 43, 185, 0.1);
36
- }
37
-
38
- /* Show the tooltip text when you mouse over the tooltip container */
39
- .extensionOverlay:focus .extensionTooltip,
40
- .extensionOverlay:hover .extensionTooltip {
41
- visibility: visible;
42
- opacity: 1;
43
- }
44
-
45
- .extensionTooltip {
46
- visibility: hidden;
47
- width: auto;
48
- background-color: rgb(255, 255, 255, 0.85);
49
- text-align: center;
50
- padding: 0.5em 0.5em 0.5em 0.5em;
51
- border: 1px solid rgba(43, 43, 185, 0.4);
52
-
53
- position: absolute;
54
- top: 0;
55
- left: 0;
56
- }
57
-
58
- .exitButton {
59
- position: fixed !important;
60
- bottom: 0;
61
- right: 0;
62
- z-index: 999999;
63
- }