god-button-action-button 0.1.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 ADDED
@@ -0,0 +1,53 @@
1
+ # god-button-action-button
2
+
3
+ Movable circular action button for mobile games (draggable) with an RTL menu of glass-style buttons built with MUI.
4
+
5
+ ## Install (after publishing)
6
+
7
+ ```bash
8
+ npm i god-button-action-button
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```tsx
14
+ import { ActionButton } from 'god-button-action-button'
15
+
16
+ export function GameUI() {
17
+ return (
18
+ <ActionButton
19
+ yourRoleName="پزشک"
20
+ onItemClick={(id) => {
21
+ console.log(id)
22
+ }}
23
+ />
24
+ )
25
+ }
26
+ ```
27
+
28
+ ## Menu items
29
+
30
+ Three standalone buttons (no outer panel), top to bottom:
31
+
32
+ - `پیام ها` (`messages`) — chat icon
33
+ - `اطلاعات بازی` (`gameInfo`) — game-controller icon
34
+ - `نقش شما {yourRoleName}` (`yourRole`) — person icon; default role is `پزشک` via `yourRoleName`
35
+
36
+ Override copy with the `labels` prop if needed.
37
+
38
+ With the **menu** open, the circle shows a **close** icon. With the **اطلاعات بازی** panel open, it shows a **back** icon; tapping returns to the main menu (the three buttons). Otherwise it shows the action (bolt) icon. Tapping «اطلاعات بازی» opens a **tall glass panel** in the **same position and width** as the menu stack (`menuWidth`), with **نام بازیکنان** and **نام نقش های بازی** inside (scrollable). Override headings with `gameInfoSectionLabels`, body with `playerNamesContent` / `gameRoleNamesContent`, and height cap with `gameInfoPanelMaxHeight` (default 340px).
39
+
40
+ The menu opens to the side opposite the circle position:
41
+
42
+ - Circle on the left => menu expands to the right
43
+ - Circle on the right => menu expands to the left
44
+
45
+ ## Development / playground
46
+
47
+ Run the local playground:
48
+
49
+ ```bash
50
+ npm run dev
51
+ ```
52
+
53
+ # god-button-ui
@@ -0,0 +1,2 @@
1
+ import { ActionButtonProps } from './types';
2
+ export declare function ActionButton(props: ActionButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { ActionButtonMenuItemId } from './types';
2
+ /**
3
+ * Inline SVGs (no @mui/icons-material) so the package stays dependency-light.
4
+ */
5
+ export declare function MenuItemIcon(props: {
6
+ id: ActionButtonMenuItemId;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,82 @@
1
+ import { default as React } from 'react';
2
+ export type ActionButtonMenuItemId = 'messages' | 'gameInfo' | 'yourRole';
3
+ export type ActionButtonMenuItem = {
4
+ id: ActionButtonMenuItemId;
5
+ label: string;
6
+ };
7
+ export type ActionButtonProps = {
8
+ /**
9
+ * Role name shown in the bottom item: `نقش شما {yourRoleName}`.
10
+ */
11
+ yourRoleName?: string;
12
+ /**
13
+ * Section headings inside the «اطلاعات بازی» panel (defaults: نام بازیکنان، نام نقش های بازی).
14
+ */
15
+ gameInfoSectionLabels?: {
16
+ playerNames?: string;
17
+ roleNames?: string;
18
+ };
19
+ /**
20
+ * Body under «نام بازیکنان» in the game-info panel.
21
+ */
22
+ playerNamesContent?: React.ReactNode;
23
+ /**
24
+ * Body under «نام نقش های بازی» in the game-info panel.
25
+ */
26
+ gameRoleNamesContent?: React.ReactNode;
27
+ /**
28
+ * Called when a user taps a menu button.
29
+ */
30
+ onItemClick?: (id: ActionButtonMenuItemId) => void;
31
+ /**
32
+ * Override default Persian labels.
33
+ */
34
+ labels?: Partial<Record<ActionButtonMenuItemId, string>>;
35
+ /**
36
+ * Initial center position (px from top-left of the viewport).
37
+ */
38
+ initialPosition?: {
39
+ x: number;
40
+ y: number;
41
+ };
42
+ /**
43
+ * “Home” center position used when long-pressing the circle to snap back.
44
+ * Defaults to the same value as `initialPosition`, or the built-in default (left side, ~30% from top).
45
+ */
46
+ homePosition?: {
47
+ x: number;
48
+ y: number;
49
+ };
50
+ /**
51
+ * Padding used when dragging to keep the circle inside the viewport.
52
+ */
53
+ dragBoundsPadding?: number;
54
+ /**
55
+ * Circle diameter in px.
56
+ */
57
+ circleSize?: number;
58
+ /**
59
+ * Menu button width in px.
60
+ */
61
+ menuWidth?: number;
62
+ /**
63
+ * Menu button height in px.
64
+ */
65
+ menuItemHeight?: number;
66
+ /**
67
+ * Vertical gap between menu buttons in px.
68
+ */
69
+ menuGap?: number;
70
+ /**
71
+ * Max height of the «اطلاعات بازی» panel (same width as the menu). Taller than the button stack; content scrolls inside.
72
+ */
73
+ gameInfoPanelMaxHeight?: number;
74
+ /**
75
+ * Optional CSS class applied to the root wrapper.
76
+ */
77
+ className?: string;
78
+ /**
79
+ * Optional inline styles applied to the root wrapper.
80
+ */
81
+ style?: React.CSSProperties;
82
+ };
package/dist/index.cjs ADDED
@@ -0,0 +1,16 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react`);l=c(l);let u=require(`@mui/material`);var d=o((e=>{var t=require(`react`),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),f=o((e=>{process.env.NODE_ENV!==`production`&&(function(){"use strict";var t=require(`react`),n=Symbol.for(`react.element`),r=Symbol.for(`react.portal`),i=Symbol.for(`react.fragment`),a=Symbol.for(`react.strict_mode`),o=Symbol.for(`react.profiler`),s=Symbol.for(`react.provider`),c=Symbol.for(`react.context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`),m=Symbol.for(`react.offscreen`),h=Symbol.iterator,g=`@@iterator`;function _(e){if(typeof e!=`object`||!e)return null;var t=h&&e[h]||e[g];return typeof t==`function`?t:null}var v=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){b(`error`,e,[...arguments].slice(1))}function b(e,t,n){var r=v.ReactDebugCurrentFrame.getStackAddendum();r!==``&&(t+=`%s`,n=n.concat([r]));var i=n.map(function(e){return String(e)});i.unshift(`Warning: `+t),Function.prototype.apply.call(console[e],console,i)}var ee=!1,te=!1,x=!1,S=!1,C=!1,w=Symbol.for(`react.module.reference`);function T(e){return!!(typeof e==`string`||typeof e==`function`||e===i||e===o||C||e===a||e===u||e===d||S||e===m||ee||te||x||typeof e==`object`&&e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===s||e.$$typeof===c||e.$$typeof===l||e.$$typeof===w||e.getModuleId!==void 0))}function E(e,t,n){var r=e.displayName;if(r)return r;var i=t.displayName||t.name||``;return i===``?n:n+`(`+i+`)`}function D(e){return e.displayName||`Context`}function O(e){if(e==null)return null;if(typeof e.tag==`number`&&y(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case i:return`Fragment`;case r:return`Portal`;case o:return`Profiler`;case a:return`StrictMode`;case u:return`Suspense`;case d:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case c:return D(e)+`.Consumer`;case s:return D(e._context)+`.Provider`;case l:return E(e,e.render,`ForwardRef`);case f:var t=e.displayName||null;return t===null?O(e.type)||`Memo`:t;case p:var n=e,m=n._payload,h=n._init;try{return O(h(m))}catch{return null}}return null}var k=Object.assign,A=0,j,M,N,P,F,I,L;function R(){}R.__reactDisabledLog=!0;function z(){if(A===0){j=console.log,M=console.info,N=console.warn,P=console.error,F=console.group,I=console.groupCollapsed,L=console.groupEnd;var e={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}A++}function ne(){if(A--,A===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:j}),info:k({},e,{value:M}),warn:k({},e,{value:N}),error:k({},e,{value:P}),group:k({},e,{value:F}),groupCollapsed:k({},e,{value:I}),groupEnd:k({},e,{value:L})})}A<0&&y(`disabledDepth fell below zero. This is a bug in React. Please file an issue.`)}var B=v.ReactCurrentDispatcher,V;function H(e,t,n){if(V===void 0)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);V=r&&r[1]||``}return`
2
+ `+V+e}var U=!1,W=new(typeof WeakMap==`function`?WeakMap:Map);function G(e,t){if(!e||U)return``;var n=W.get(e);if(n!==void 0)return n;var r;U=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var a=B.current;B.current=null,z();try{if(t){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(o,[])}catch(e){r=e}Reflect.construct(e,[],o)}else{try{o.call()}catch(e){r=e}e.call(o.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var s=t.stack.split(`
3
+ `),c=r.stack.split(`
4
+ `),l=s.length-1,u=c.length-1;l>=1&&u>=0&&s[l]!==c[u];)u--;for(;l>=1&&u>=0;l--,u--)if(s[l]!==c[u]){if(l!==1||u!==1)do if(l--,u--,u<0||s[l]!==c[u]){var d=`
5
+ `+s[l].replace(` at new `,` at `);return e.displayName&&d.includes(`<anonymous>`)&&(d=d.replace(`<anonymous>`,e.displayName)),typeof e==`function`&&W.set(e,d),d}while(l>=1&&u>=0);break}}}finally{U=!1,B.current=a,ne(),Error.prepareStackTrace=i}var f=e?e.displayName||e.name:``,p=f?H(f):``;return typeof e==`function`&&W.set(e,p),p}function re(e,t,n){return G(e,!1)}function ie(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function K(e,t,n){if(e==null)return``;if(typeof e==`function`)return G(e,ie(e));if(typeof e==`string`)return H(e);switch(e){case u:return H(`Suspense`);case d:return H(`SuspenseList`)}if(typeof e==`object`)switch(e.$$typeof){case l:return re(e.render);case f:return K(e.type,t,n);case p:var r=e,i=r._payload,a=r._init;try{return K(a(i),t,n)}catch{}}return``}var q=Object.prototype.hasOwnProperty,J={},Y=v.ReactDebugCurrentFrame;function X(e){if(e){var t=e._owner,n=K(e.type,e._source,t?t.type:null);Y.setExtraStackFrame(n)}else Y.setExtraStackFrame(null)}function ae(e,t,n,r,i){var a=Function.call.bind(q);for(var o in e)if(a(e,o)){var s=void 0;try{if(typeof e[o]!=`function`){var c=Error((r||`React class`)+`: `+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name=`Invariant Violation`,c}s=e[o](t,o,r,n,null,`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`)}catch(e){s=e}s&&!(s instanceof Error)&&(X(i),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||`React class`,n,o,typeof s),X(null)),s instanceof Error&&!(s.message in J)&&(J[s.message]=!0,X(i),y(`Failed %s type: %s`,n,s.message),X(null))}}var oe=Array.isArray;function Z(e){return oe(e)}function se(e){return typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`}function ce(e){try{return le(e),!1}catch{return!0}}function le(e){return``+e}function ue(e){if(ce(e))return y(`The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.`,se(e)),le(e)}var Q=v.ReactCurrentOwner,de={key:!0,ref:!0,__self:!0,__source:!0},fe,pe,me={};function he(e){if(q.call(e,`ref`)){var t=Object.getOwnPropertyDescriptor(e,`ref`).get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function ge(e){if(q.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function _e(e,t){if(typeof e.ref==`string`&&Q.current&&t&&Q.current.stateNode!==t){var n=O(Q.current.type);me[n]||(y(`Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref`,O(Q.current.type),e.ref),me[n]=!0)}}function ve(e,t){var n=function(){fe||(fe=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,`key`,{get:n,configurable:!0})}function ye(e,t){var n=function(){pe||(pe=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,`ref`,{get:n,configurable:!0})}var be=function(e,t,r,i,a,o,s){var c={$$typeof:n,type:e,key:t,ref:r,props:s,_owner:o};return c._store={},Object.defineProperty(c._store,`validated`,{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,`_self`,{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(c,`_source`,{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function xe(e,t,n,r,i){var a,o={},s=null,c=null;for(a in n!==void 0&&(ue(n),s=``+n),ge(t)&&(ue(t.key),s=``+t.key),he(t)&&(c=t.ref,_e(t,i)),t)q.call(t,a)&&!de.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps){var l=e.defaultProps;for(a in l)o[a]===void 0&&(o[a]=l[a])}if(s||c){var u=typeof e==`function`?e.displayName||e.name||`Unknown`:e;s&&ve(o,u),c&&ye(o,u)}return be(e,s,c,i,r,Q.current,o)}var Se=v.ReactCurrentOwner,Ce=v.ReactDebugCurrentFrame;function $(e){if(e){var t=e._owner,n=K(e.type,e._source,t?t.type:null);Ce.setExtraStackFrame(n)}else Ce.setExtraStackFrame(null)}var we=!1;function Te(e){return typeof e==`object`&&!!e&&e.$$typeof===n}function Ee(){if(Se.current){var e=O(Se.current.type);if(e)return`
6
+
7
+ Check the render method of \``+e+"`."}return``}function De(e){if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,``),n=e.lineNumber;return`
8
+
9
+ Check your code at `+t+`:`+n+`.`}return``}var Oe={};function ke(e){var t=Ee();if(!t){var n=typeof e==`string`?e:e.displayName||e.name;n&&(t=`
10
+
11
+ Check the top-level render call using <`+n+`>.`)}return t}function Ae(e,t){if(!(!e._store||e._store.validated||e.key!=null)){e._store.validated=!0;var n=ke(t);if(!Oe[n]){Oe[n]=!0;var r=``;e&&e._owner&&e._owner!==Se.current&&(r=` It was passed a child from `+O(e._owner.type)+`.`),$(e),y(`Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.`,n,r),$(null)}}}function je(e,t){if(typeof e==`object`){if(Z(e))for(var n=0;n<e.length;n++){var r=e[n];Te(r)&&Ae(r,t)}else if(Te(e))e._store&&(e._store.validated=!0);else if(e){var i=_(e);if(typeof i==`function`&&i!==e.entries)for(var a=i.call(e),o;!(o=a.next()).done;)Te(o.value)&&Ae(o.value,t)}}}function Me(e){var t=e.type;if(!(t==null||typeof t==`string`)){var n;if(typeof t==`function`)n=t.propTypes;else if(typeof t==`object`&&(t.$$typeof===l||t.$$typeof===f))n=t.propTypes;else return;if(n){var r=O(t);ae(n,e.props,`prop`,r,e)}else t.PropTypes!==void 0&&!we&&(we=!0,y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O(t)||`Unknown`));typeof t.getDefaultProps==`function`&&!t.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ne(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if(r!==`children`&&r!==`key`){$(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),$(null);break}}e.ref!==null&&($(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),$(null))}var Pe={};function Fe(e,t,r,a,o,s){var c=T(e);if(!c){var l=``;(e===void 0||typeof e==`object`&&e&&Object.keys(e).length===0)&&(l+=` You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.`);var u=De(o);u?l+=u:l+=Ee();var d;e===null?d=`null`:Z(e)?d=`array`:e!==void 0&&e.$$typeof===n?(d=`<`+(O(e.type)||`Unknown`)+` />`,l=` Did you accidentally export a JSX literal instead of a component?`):d=typeof e,y(`React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s`,d,l)}var f=xe(e,t,r,o,s);if(f==null)return f;if(c){var p=t.children;if(p!==void 0)if(a)if(Z(p)){for(var m=0;m<p.length;m++)je(p[m],e);Object.freeze&&Object.freeze(p)}else y(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`);else je(p,e)}if(q.call(t,`key`)){var h=O(e),g=Object.keys(t).filter(function(e){return e!==`key`}),_=g.length>0?`{key: someKey, `+g.join(`: ..., `)+`: ...}`:`{key: someKey}`;Pe[h+_]||(y(`A props object containing a "key" prop is being spread into JSX:
12
+ let props = %s;
13
+ <%s {...props} />
14
+ React keys must be passed directly to JSX without using spread:
15
+ let props = %s;
16
+ <%s key={someKey} {...props} />`,_,h,g.length>0?`{`+g.join(`: ..., `)+`: ...}`:`{}`,h),Pe[h+_]=!0)}return e===i?Ne(f):Me(f),f}function Ie(e,t,n){return Fe(e,t,n,!0)}function Le(e,t,n){return Fe(e,t,n,!1)}var Re=Le,ze=Ie;e.Fragment=i,e.jsx=Re,e.jsxs=ze})()})),p=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=d():t.exports=f()}))(),m={width:22,height:22,flexShrink:0,display:`block`,color:`rgba(255,255,255,0.95)`,opacity:.98};function h(e){let{id:t}=e;switch(t){case`messages`:return(0,p.jsx)(u.Box,{component:`svg`,viewBox:`0 0 24 24`,"aria-hidden":!0,sx:m,children:(0,p.jsx)(`path`,{fill:`currentColor`,d:`M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z`})});case`gameInfo`:return(0,p.jsx)(u.Box,{component:`svg`,viewBox:`0 0 24 24`,"aria-hidden":!0,sx:m,children:(0,p.jsx)(`path`,{fill:`currentColor`,d:`M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM9.5 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm5 8.5c0 2.49-2.01 4.5-4.5 4.5S5.5 18.99 5.5 16.5 7.51 12 10 12s4.5 2.01 4.5 4.5zm4.5-4.5c0 1.38-1.12 2.5-2.5 2.5S14 16.38 14 15s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5z`})});case`yourRole`:return(0,p.jsx)(u.Box,{component:`svg`,viewBox:`0 0 24 24`,"aria-hidden":!0,sx:m,children:(0,p.jsx)(`path`,{fill:`currentColor`,d:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z`})});default:return t}}var g=[`messages`,`gameInfo`,`yourRole`],_=`پزشک`;function v(e){let{yourRoleName:t=_,gameInfoSectionLabels:n,playerNamesContent:r,gameRoleNamesContent:i,onItemClick:a,labels:o,initialPosition:s,homePosition:c,dragBoundsPadding:d=12,circleSize:f=64,menuWidth:m=230,menuItemHeight:v=44,menuGap:y=10,gameInfoPanelMaxHeight:b=340,className:ee,style:te}=e,x=(0,l.useId)().replace(/:/g,``),S=(0,l.useRef)(null),C=(0,l.useRef)(!1),w=(0,l.useRef)(null),T=(0,l.useRef)({x:0,y:0}),E=(0,l.useRef)({x:0,y:0}),D=(0,l.useRef)({x:0,y:0,t:0}),O=(0,l.useRef)(null),k=(0,l.useRef)(!1),A=()=>typeof window>`u`?{x:d+f/2,y:0}:{x:d+f/2,y:window.innerHeight*.3},j=(0,l.useMemo)(()=>c?{...c}:s?{...s}:typeof window>`u`?{x:d+f/2,y:0}:{x:d+f/2,y:window.innerHeight*.3},[c,s,d,f]),[M,N]=(0,l.useState)(!1),[P,F]=(0,l.useState)(!1),[I,L]=(0,l.useState)(()=>s?{x:s.x,y:s.y}:c?{x:c.x,y:c.y}:A()),R=(0,l.useMemo)(()=>typeof window>`u`||I.x<window.innerWidth/2?`right`:`left`,[I.x]),z=(0,l.useMemo)(()=>{let e={messages:`پیام ها`,gameInfo:`اطلاعات بازی`,yourRole:`نقش شما ${t}`};return o?{...e,...o}:e},[o,t]),ne=(0,l.useMemo)(()=>({playerNames:n?.playerNames??`نام بازیکنان`,roleNames:n?.roleNames??`نام نقش های بازی`}),[n]),B=P?`back`:M?`close`:`action`,V=(0,u.useTheme)().direction===`rtl`||typeof document<`u`&&document.documentElement.getAttribute(`dir`)===`rtl`,[H,U]=(0,l.useState)(()=>typeof window<`u`?window.innerHeight:800);(0,l.useEffect)(()=>{let e=()=>U(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let W=(0,l.useMemo)(()=>Math.min(b,Math.max(120,H-d*2)),[b,H,d]),[G,re]=(0,l.useState)(()=>{let e=I.y-f/2;return{x:I.x-m/2,y:e,gap:10}}),ie=()=>{let e=I.y-f/2,t=R===`right`?I.x+f/2+10:I.x-f/2-10-m,n=v*g.length+y*(g.length-1),r=P?W:n,i=Math.min(Math.max(e,d),H-d-r);re({x:Math.min(Math.max(t,d),window.innerWidth-d-m),y:i,gap:10})};(0,l.useEffect)(()=>{ie()},[I.x,I.y,R,P,H,W]),(0,l.useEffect)(()=>{if(!M&&!P)return;let e=e=>{let t=S.current;if(!t)return;let n=e.target;n&&t.contains(n)||(N(!1),F(!1))};return window.addEventListener(`mousedown`,e),window.addEventListener(`touchstart`,e,{passive:!0}),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`touchstart`,e)}},[M,P]),(0,l.useEffect)(()=>()=>{O.current!=null&&(clearTimeout(O.current),O.current=null)},[]);let K=e=>{let t=f/2,n=d+t,r=window.innerWidth-d-t,i=d+t,a=window.innerHeight-d-t;return{x:Math.min(Math.max(e.x,n),r),y:Math.min(Math.max(e.y,i),a)}},q=()=>{O.current!=null&&(clearTimeout(O.current),O.current=null)},J=e=>{if(e.isPrimary){w.current=e.pointerId,C.current=!1,k.current=!1,T.current={x:e.clientX,y:e.clientY},E.current=I,D.current={x:e.clientX,y:e.clientY,t:Date.now()},q(),O.current=setTimeout(()=>{C.current||(k.current=!0,N(!1),F(!1),L(K({x:j.x,y:j.y})))},500);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}}},Y=e=>{if(w.current!==e.pointerId)return;let t=e.clientX-T.current.x,n=e.clientY-T.current.y;C.current||Math.hypot(t,n)>6&&(C.current=!0,q()),L(K({x:E.current.x+t,y:E.current.y+n}))},X=e=>{if(w.current!==e.pointerId)return;q();let{x:t,y:n,t:r}=D.current,i=Math.hypot(e.clientX-t,e.clientY-n),a=Date.now()-r,o=C.current;if(w.current=null,C.current=!1,k.current){k.current=!1;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}return}i<6&&a<400&&!o&&(P?(F(!1),N(!0)):N(e=>!e));try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},ae=e=>{if(q(),w.current===e.pointerId){w.current=null,C.current=!1,k.current=!1;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}}},oe=e=>{if(e===`gameInfo`){a?.(e),F(!0),N(!1);return}a?.(e),N(!1)};return(0,p.jsxs)(`div`,{ref:S,className:ee,style:{position:`fixed`,zIndex:1300,top:0,left:0,width:0,height:0,...te},children:[M?(0,p.jsx)(u.Box,{dir:`rtl`,onPointerDown:e=>{e.stopPropagation()},sx:{position:`fixed`,zIndex:1310,top:G.y,left:G.x,width:`${m}px`,display:`flex`,flexDirection:`column`,gap:`${y}px`,transformOrigin:R===`right`?`left top`:`right top`},children:g.map(e=>{let t=z[e];return(0,p.jsx)(u.ButtonBase,{onClick:()=>oe(e),sx:{height:`${v}px`,borderRadius:`18px`,paddingX:`12px`,justifyContent:`flex-start`,backdropFilter:`blur(12px)`,background:`rgba(255,255,255,0.10)`,border:`1px solid rgba(255,255,255,0.22)`,boxShadow:`0 12px 36px rgba(0,0,0,0.35)`,"&:hover":{background:`rgba(255,255,255,0.14)`}},children:(0,p.jsxs)(u.Box,{sx:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:`10px`,width:`100%`,flexDirection:`row`},children:[(0,p.jsx)(u.Typography,{sx:{fontSize:`0.95rem`,fontWeight:700,letterSpacing:`-0.01em`,flex:1,minWidth:0,textAlign:`start`},children:t}),(0,p.jsx)(h,{id:e})]})},e)})}):null,P?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u.Box,{"aria-hidden":!0,onClick:()=>F(!1),sx:{position:`fixed`,inset:0,zIndex:1320,background:`rgba(0,0,0,0.52)`,backdropFilter:`blur(4px)`}}),(0,p.jsxs)(u.Paper,{dir:`rtl`,elevation:0,onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),sx:{position:`fixed`,zIndex:1321,top:G.y,left:G.x,width:`${m}px`,height:`${W}px`,maxHeight:`${W}px`,display:`flex`,flexDirection:`column`,overflow:`hidden`,borderRadius:`22px`,padding:`14px 14px 16px`,backdropFilter:`blur(12px)`,background:`rgba(255,255,255,0.10)`,border:`1px solid rgba(255,255,255,0.22)`,boxShadow:`0 12px 36px rgba(0,0,0,0.35)`,transformOrigin:R===`right`?`left top`:`right top`},children:[(0,p.jsx)(u.Typography,{sx:{fontSize:`1.02rem`,fontWeight:800,letterSpacing:`-0.02em`,marginBottom:`12px`,flexShrink:0},children:z.gameInfo}),(0,p.jsxs)(u.Box,{sx:{display:`flex`,flexDirection:`column`,gap:2,minHeight:0,flex:1,overflow:`auto`,pr:`2px`},children:[(0,p.jsxs)(u.Box,{children:[(0,p.jsx)(u.Typography,{sx:{fontSize:`0.82rem`,fontWeight:700,opacity:.72,marginBottom:`6px`},children:ne.playerNames}),(0,p.jsx)(u.Typography,{sx:{fontSize:`0.95rem`,fontWeight:600,lineHeight:1.45},children:r??`—`})]}),(0,p.jsx)(u.Divider,{sx:{borderColor:`rgba(255,255,255,0.12)`}}),(0,p.jsxs)(u.Box,{children:[(0,p.jsx)(u.Typography,{sx:{fontSize:`0.82rem`,fontWeight:700,opacity:.72,marginBottom:`6px`},children:ne.roleNames}),(0,p.jsx)(u.Typography,{sx:{fontSize:`0.95rem`,fontWeight:600,lineHeight:1.45},children:i??`—`})]})]})]})]}):null,(0,p.jsx)(u.Box,{role:`button`,"aria-label":B===`back`?`بازگشت به منو`:B===`close`?`بستن منو`:`باز کردن منو`,onPointerDown:J,onPointerMove:Y,onPointerUp:X,onPointerCancel:ae,sx:{position:`fixed`,width:`${f}px`,height:`${f}px`,borderRadius:`50%`,top:I.y-f/2,left:I.x-f/2,zIndex:1330,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:C.current?`grabbing`:`pointer`,userSelect:`none`,touchAction:`none`,background:`linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06))`,border:`1px solid rgba(255,255,255,0.25)`,boxShadow:`0 18px 60px rgba(0,0,0,0.45)`},children:B===`back`?(0,p.jsx)(u.Box,{"aria-hidden":!0,component:`svg`,viewBox:`0 0 24 24`,sx:{width:`${f*.48}px`,height:`${f*.48}px`,flexShrink:0,display:`block`,color:`#fff`,opacity:.98,filter:`drop-shadow(0 2px 8px rgba(0,0,0,0.45))`,shapeRendering:`geometricPrecision`,transform:V?`scaleX(-1)`:`none`},children:(0,p.jsx)(`path`,{fill:`currentColor`,d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z`})}):B===`close`?(0,p.jsx)(u.Box,{"aria-hidden":!0,component:`svg`,viewBox:`0 0 24 24`,sx:{width:`${f*.46}px`,height:`${f*.46}px`,flexShrink:0,display:`block`,color:`#fff`,opacity:.98,filter:`drop-shadow(0 2px 8px rgba(0,0,0,0.45))`,shapeRendering:`geometricPrecision`},children:(0,p.jsx)(`path`,{fill:`currentColor`,d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z`})}):(0,p.jsxs)(u.Box,{"aria-hidden":!0,component:`svg`,viewBox:`0 0 24 24`,sx:{width:`${f*.5}px`,height:`${f*.5}px`,flexShrink:0,display:`block`,color:`#fff`,opacity:.96,filter:`drop-shadow(0 2px 8px rgba(0,0,0,0.45))`,shapeRendering:`geometricPrecision`},children:[(0,p.jsx)(`defs`,{children:(0,p.jsxs)(`linearGradient`,{id:x,x1:`0%`,y1:`0%`,x2:`100%`,y2:`100%`,children:[(0,p.jsx)(`stop`,{offset:`0%`,stopColor:`#ffffff`,stopOpacity:`1`}),(0,p.jsx)(`stop`,{offset:`100%`,stopColor:`#e8eef8`,stopOpacity:`0.95`})]})}),(0,p.jsx)(`path`,{fill:`url(#${x})`,d:`M11 21h-1l1-7H7.5c-.58 0-.57-.32-.38-.66.19-.34.05-.08.07-.12C8.48 10.94 10.42 7.54 13 3h1l-1 7h3.5c.49 0 .56.33.47.51l-.07.15C12.96 17.55 11 21 11 21z`})]})})]})}exports.ActionButton=v;
@@ -0,0 +1,2 @@
1
+ export { ActionButton } from './components/ActionButton/ActionButton';
2
+ export type { ActionButtonProps, ActionButtonMenuItemId } from './components/ActionButton/types';
package/dist/index.js ADDED
@@ -0,0 +1,944 @@
1
+ import { useEffect as e, useId as t, useMemo as n, useRef as r, useState as i } from "react";
2
+ import { Box as a, ButtonBase as o, Divider as s, Paper as c, Typography as l, useTheme as u } from "@mui/material";
3
+ //#region \0rolldown/runtime.js
4
+ var d = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), f = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
5
+ if (typeof require < "u") return require.apply(this, arguments);
6
+ throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
7
+ }), p = /* @__PURE__ */ d(((e) => {
8
+ var t = f("react"), n = Symbol.for("react.element"), r = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = {
9
+ key: !0,
10
+ ref: !0,
11
+ __self: !0,
12
+ __source: !0
13
+ };
14
+ function s(e, t, r) {
15
+ var s, c = {}, l = null, u = null;
16
+ for (s in r !== void 0 && (l = "" + r), t.key !== void 0 && (l = "" + t.key), t.ref !== void 0 && (u = t.ref), t) i.call(t, s) && !o.hasOwnProperty(s) && (c[s] = t[s]);
17
+ if (e && e.defaultProps) for (s in t = e.defaultProps, t) c[s] === void 0 && (c[s] = t[s]);
18
+ return {
19
+ $$typeof: n,
20
+ type: e,
21
+ key: l,
22
+ ref: u,
23
+ props: c,
24
+ _owner: a.current
25
+ };
26
+ }
27
+ e.Fragment = r, e.jsx = s, e.jsxs = s;
28
+ })), m = /* @__PURE__ */ d(((e) => {
29
+ process.env.NODE_ENV !== "production" && (function() {
30
+ var t = f("react"), n = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), g = Symbol.iterator, _ = "@@iterator";
31
+ function v(e) {
32
+ if (typeof e != "object" || !e) return null;
33
+ var t = g && e[g] || e[_];
34
+ return typeof t == "function" ? t : null;
35
+ }
36
+ var y = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
37
+ function b(e) {
38
+ x("error", e, [...arguments].slice(1));
39
+ }
40
+ function x(e, t, n) {
41
+ var r = y.ReactDebugCurrentFrame.getStackAddendum();
42
+ r !== "" && (t += "%s", n = n.concat([r]));
43
+ var i = n.map(function(e) {
44
+ return String(e);
45
+ });
46
+ i.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, i);
47
+ }
48
+ var S = !1, C = !1, w = !1, T = !1, E = !1, D = Symbol.for("react.module.reference");
49
+ function ee(e) {
50
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === o || E || e === a || e === u || e === d || T || e === h || S || C || w || typeof e == "object" && e && (e.$$typeof === m || e.$$typeof === p || e.$$typeof === s || e.$$typeof === c || e.$$typeof === l || e.$$typeof === D || e.getModuleId !== void 0));
51
+ }
52
+ function te(e, t, n) {
53
+ var r = e.displayName;
54
+ if (r) return r;
55
+ var i = t.displayName || t.name || "";
56
+ return i === "" ? n : n + "(" + i + ")";
57
+ }
58
+ function ne(e) {
59
+ return e.displayName || "Context";
60
+ }
61
+ function O(e) {
62
+ if (e == null) return null;
63
+ if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null;
64
+ if (typeof e == "string") return e;
65
+ switch (e) {
66
+ case i: return "Fragment";
67
+ case r: return "Portal";
68
+ case o: return "Profiler";
69
+ case a: return "StrictMode";
70
+ case u: return "Suspense";
71
+ case d: return "SuspenseList";
72
+ }
73
+ if (typeof e == "object") switch (e.$$typeof) {
74
+ case c: return ne(e) + ".Consumer";
75
+ case s: return ne(e._context) + ".Provider";
76
+ case l: return te(e, e.render, "ForwardRef");
77
+ case p:
78
+ var t = e.displayName || null;
79
+ return t === null ? O(e.type) || "Memo" : t;
80
+ case m:
81
+ var n = e, f = n._payload, h = n._init;
82
+ try {
83
+ return O(h(f));
84
+ } catch {
85
+ return null;
86
+ }
87
+ }
88
+ return null;
89
+ }
90
+ var k = Object.assign, A = 0, j, M, N, P, F, I, L;
91
+ function re() {}
92
+ re.__reactDisabledLog = !0;
93
+ function ie() {
94
+ if (A === 0) {
95
+ j = console.log, M = console.info, N = console.warn, P = console.error, F = console.group, I = console.groupCollapsed, L = console.groupEnd;
96
+ var e = {
97
+ configurable: !0,
98
+ enumerable: !0,
99
+ value: re,
100
+ writable: !0
101
+ };
102
+ Object.defineProperties(console, {
103
+ info: e,
104
+ log: e,
105
+ warn: e,
106
+ error: e,
107
+ group: e,
108
+ groupCollapsed: e,
109
+ groupEnd: e
110
+ });
111
+ }
112
+ A++;
113
+ }
114
+ function R() {
115
+ if (A--, A === 0) {
116
+ var e = {
117
+ configurable: !0,
118
+ enumerable: !0,
119
+ writable: !0
120
+ };
121
+ Object.defineProperties(console, {
122
+ log: k({}, e, { value: j }),
123
+ info: k({}, e, { value: M }),
124
+ warn: k({}, e, { value: N }),
125
+ error: k({}, e, { value: P }),
126
+ group: k({}, e, { value: F }),
127
+ groupCollapsed: k({}, e, { value: I }),
128
+ groupEnd: k({}, e, { value: L })
129
+ });
130
+ }
131
+ A < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
132
+ }
133
+ var z = y.ReactCurrentDispatcher, B;
134
+ function V(e, t, n) {
135
+ if (B === void 0) try {
136
+ throw Error();
137
+ } catch (e) {
138
+ var r = e.stack.trim().match(/\n( *(at )?)/);
139
+ B = r && r[1] || "";
140
+ }
141
+ return "\n" + B + e;
142
+ }
143
+ var H = !1, U = new (typeof WeakMap == "function" ? WeakMap : Map)();
144
+ function W(e, t) {
145
+ if (!e || H) return "";
146
+ var n = U.get(e);
147
+ if (n !== void 0) return n;
148
+ var r;
149
+ H = !0;
150
+ var i = Error.prepareStackTrace;
151
+ Error.prepareStackTrace = void 0;
152
+ var a = z.current;
153
+ z.current = null, ie();
154
+ try {
155
+ if (t) {
156
+ var o = function() {
157
+ throw Error();
158
+ };
159
+ if (Object.defineProperty(o.prototype, "props", { set: function() {
160
+ throw Error();
161
+ } }), typeof Reflect == "object" && Reflect.construct) {
162
+ try {
163
+ Reflect.construct(o, []);
164
+ } catch (e) {
165
+ r = e;
166
+ }
167
+ Reflect.construct(e, [], o);
168
+ } else {
169
+ try {
170
+ o.call();
171
+ } catch (e) {
172
+ r = e;
173
+ }
174
+ e.call(o.prototype);
175
+ }
176
+ } else {
177
+ try {
178
+ throw Error();
179
+ } catch (e) {
180
+ r = e;
181
+ }
182
+ e();
183
+ }
184
+ } catch (t) {
185
+ if (t && r && typeof t.stack == "string") {
186
+ for (var s = t.stack.split("\n"), c = r.stack.split("\n"), l = s.length - 1, u = c.length - 1; l >= 1 && u >= 0 && s[l] !== c[u];) u--;
187
+ for (; l >= 1 && u >= 0; l--, u--) if (s[l] !== c[u]) {
188
+ if (l !== 1 || u !== 1) do
189
+ if (l--, u--, u < 0 || s[l] !== c[u]) {
190
+ var d = "\n" + s[l].replace(" at new ", " at ");
191
+ return e.displayName && d.includes("<anonymous>") && (d = d.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, d), d;
192
+ }
193
+ while (l >= 1 && u >= 0);
194
+ break;
195
+ }
196
+ }
197
+ } finally {
198
+ H = !1, z.current = a, R(), Error.prepareStackTrace = i;
199
+ }
200
+ var f = e ? e.displayName || e.name : "", p = f ? V(f) : "";
201
+ return typeof e == "function" && U.set(e, p), p;
202
+ }
203
+ function ae(e, t, n) {
204
+ return W(e, !1);
205
+ }
206
+ function oe(e) {
207
+ var t = e.prototype;
208
+ return !!(t && t.isReactComponent);
209
+ }
210
+ function G(e, t, n) {
211
+ if (e == null) return "";
212
+ if (typeof e == "function") return W(e, oe(e));
213
+ if (typeof e == "string") return V(e);
214
+ switch (e) {
215
+ case u: return V("Suspense");
216
+ case d: return V("SuspenseList");
217
+ }
218
+ if (typeof e == "object") switch (e.$$typeof) {
219
+ case l: return ae(e.render);
220
+ case p: return G(e.type, t, n);
221
+ case m:
222
+ var r = e, i = r._payload, a = r._init;
223
+ try {
224
+ return G(a(i), t, n);
225
+ } catch {}
226
+ }
227
+ return "";
228
+ }
229
+ var K = Object.prototype.hasOwnProperty, q = {}, se = y.ReactDebugCurrentFrame;
230
+ function J(e) {
231
+ if (e) {
232
+ var t = e._owner, n = G(e.type, e._source, t ? t.type : null);
233
+ se.setExtraStackFrame(n);
234
+ } else se.setExtraStackFrame(null);
235
+ }
236
+ function Y(e, t, n, r, i) {
237
+ var a = Function.call.bind(K);
238
+ for (var o in e) if (a(e, o)) {
239
+ var s = void 0;
240
+ try {
241
+ if (typeof e[o] != "function") {
242
+ var c = Error((r || "React class") + ": " + n + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
243
+ throw c.name = "Invariant Violation", c;
244
+ }
245
+ s = e[o](t, o, r, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
246
+ } catch (e) {
247
+ s = e;
248
+ }
249
+ s && !(s instanceof Error) && (J(i), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", r || "React class", n, o, typeof s), J(null)), s instanceof Error && !(s.message in q) && (q[s.message] = !0, J(i), b("Failed %s type: %s", n, s.message), J(null));
250
+ }
251
+ }
252
+ var ce = Array.isArray;
253
+ function X(e) {
254
+ return ce(e);
255
+ }
256
+ function le(e) {
257
+ return typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
258
+ }
259
+ function Z(e) {
260
+ try {
261
+ return ue(e), !1;
262
+ } catch {
263
+ return !0;
264
+ }
265
+ }
266
+ function ue(e) {
267
+ return "" + e;
268
+ }
269
+ function de(e) {
270
+ if (Z(e)) return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", le(e)), ue(e);
271
+ }
272
+ var Q = y.ReactCurrentOwner, fe = {
273
+ key: !0,
274
+ ref: !0,
275
+ __self: !0,
276
+ __source: !0
277
+ }, pe, me, he = {};
278
+ function ge(e) {
279
+ if (K.call(e, "ref")) {
280
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
281
+ if (t && t.isReactWarning) return !1;
282
+ }
283
+ return e.ref !== void 0;
284
+ }
285
+ function _e(e) {
286
+ if (K.call(e, "key")) {
287
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
288
+ if (t && t.isReactWarning) return !1;
289
+ }
290
+ return e.key !== void 0;
291
+ }
292
+ function ve(e, t) {
293
+ if (typeof e.ref == "string" && Q.current && t && Q.current.stateNode !== t) {
294
+ var n = O(Q.current.type);
295
+ he[n] || (b("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", O(Q.current.type), e.ref), he[n] = !0);
296
+ }
297
+ }
298
+ function ye(e, t) {
299
+ var n = function() {
300
+ pe || (pe = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
301
+ };
302
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
303
+ get: n,
304
+ configurable: !0
305
+ });
306
+ }
307
+ function be(e, t) {
308
+ var n = function() {
309
+ me || (me = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
310
+ };
311
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
312
+ get: n,
313
+ configurable: !0
314
+ });
315
+ }
316
+ var xe = function(e, t, r, i, a, o, s) {
317
+ var c = {
318
+ $$typeof: n,
319
+ type: e,
320
+ key: t,
321
+ ref: r,
322
+ props: s,
323
+ _owner: o
324
+ };
325
+ return c._store = {}, Object.defineProperty(c._store, "validated", {
326
+ configurable: !1,
327
+ enumerable: !1,
328
+ writable: !0,
329
+ value: !1
330
+ }), Object.defineProperty(c, "_self", {
331
+ configurable: !1,
332
+ enumerable: !1,
333
+ writable: !1,
334
+ value: i
335
+ }), Object.defineProperty(c, "_source", {
336
+ configurable: !1,
337
+ enumerable: !1,
338
+ writable: !1,
339
+ value: a
340
+ }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
341
+ };
342
+ function Se(e, t, n, r, i) {
343
+ var a, o = {}, s = null, c = null;
344
+ for (a in n !== void 0 && (de(n), s = "" + n), _e(t) && (de(t.key), s = "" + t.key), ge(t) && (c = t.ref, ve(t, i)), t) K.call(t, a) && !fe.hasOwnProperty(a) && (o[a] = t[a]);
345
+ if (e && e.defaultProps) {
346
+ var l = e.defaultProps;
347
+ for (a in l) o[a] === void 0 && (o[a] = l[a]);
348
+ }
349
+ if (s || c) {
350
+ var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
351
+ s && ye(o, u), c && be(o, u);
352
+ }
353
+ return xe(e, s, c, i, r, Q.current, o);
354
+ }
355
+ var Ce = y.ReactCurrentOwner, we = y.ReactDebugCurrentFrame;
356
+ function $(e) {
357
+ if (e) {
358
+ var t = e._owner, n = G(e.type, e._source, t ? t.type : null);
359
+ we.setExtraStackFrame(n);
360
+ } else we.setExtraStackFrame(null);
361
+ }
362
+ var Te = !1;
363
+ function Ee(e) {
364
+ return typeof e == "object" && !!e && e.$$typeof === n;
365
+ }
366
+ function De() {
367
+ if (Ce.current) {
368
+ var e = O(Ce.current.type);
369
+ if (e) return "\n\nCheck the render method of `" + e + "`.";
370
+ }
371
+ return "";
372
+ }
373
+ function Oe(e) {
374
+ if (e !== void 0) {
375
+ var t = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
376
+ return "\n\nCheck your code at " + t + ":" + n + ".";
377
+ }
378
+ return "";
379
+ }
380
+ var ke = {};
381
+ function Ae(e) {
382
+ var t = De();
383
+ if (!t) {
384
+ var n = typeof e == "string" ? e : e.displayName || e.name;
385
+ n && (t = "\n\nCheck the top-level render call using <" + n + ">.");
386
+ }
387
+ return t;
388
+ }
389
+ function je(e, t) {
390
+ if (!(!e._store || e._store.validated || e.key != null)) {
391
+ e._store.validated = !0;
392
+ var n = Ae(t);
393
+ if (!ke[n]) {
394
+ ke[n] = !0;
395
+ var r = "";
396
+ e && e._owner && e._owner !== Ce.current && (r = " It was passed a child from " + O(e._owner.type) + "."), $(e), b("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.", n, r), $(null);
397
+ }
398
+ }
399
+ }
400
+ function Me(e, t) {
401
+ if (typeof e == "object") {
402
+ if (X(e)) for (var n = 0; n < e.length; n++) {
403
+ var r = e[n];
404
+ Ee(r) && je(r, t);
405
+ }
406
+ else if (Ee(e)) e._store && (e._store.validated = !0);
407
+ else if (e) {
408
+ var i = v(e);
409
+ if (typeof i == "function" && i !== e.entries) for (var a = i.call(e), o; !(o = a.next()).done;) Ee(o.value) && je(o.value, t);
410
+ }
411
+ }
412
+ }
413
+ function Ne(e) {
414
+ var t = e.type;
415
+ if (!(t == null || typeof t == "string")) {
416
+ var n;
417
+ if (typeof t == "function") n = t.propTypes;
418
+ else if (typeof t == "object" && (t.$$typeof === l || t.$$typeof === p)) n = t.propTypes;
419
+ else return;
420
+ if (n) {
421
+ var r = O(t);
422
+ Y(n, e.props, "prop", r, e);
423
+ } else t.PropTypes !== void 0 && !Te && (Te = !0, b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", O(t) || "Unknown"));
424
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
425
+ }
426
+ }
427
+ function Pe(e) {
428
+ for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
429
+ var r = t[n];
430
+ if (r !== "children" && r !== "key") {
431
+ $(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", r), $(null);
432
+ break;
433
+ }
434
+ }
435
+ e.ref !== null && ($(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
436
+ }
437
+ var Fe = {};
438
+ function Ie(e, t, r, a, o, s) {
439
+ var c = ee(e);
440
+ if (!c) {
441
+ var l = "";
442
+ (e === void 0 || typeof e == "object" && e && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
443
+ var u = Oe(o);
444
+ u ? l += u : l += De();
445
+ var d;
446
+ e === null ? d = "null" : X(e) ? d = "array" : e !== void 0 && e.$$typeof === n ? (d = "<" + (O(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, l);
447
+ }
448
+ var f = Se(e, t, r, o, s);
449
+ if (f == null) return f;
450
+ if (c) {
451
+ var p = t.children;
452
+ if (p !== void 0) if (a) if (X(p)) {
453
+ for (var m = 0; m < p.length; m++) Me(p[m], e);
454
+ Object.freeze && Object.freeze(p);
455
+ } else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
456
+ else Me(p, e);
457
+ }
458
+ if (K.call(t, "key")) {
459
+ var h = O(e), g = Object.keys(t).filter(function(e) {
460
+ return e !== "key";
461
+ }), _ = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
462
+ Fe[h + _] || (b("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", _, h, g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}", h), Fe[h + _] = !0);
463
+ }
464
+ return e === i ? Pe(f) : Ne(f), f;
465
+ }
466
+ function Le(e, t, n) {
467
+ return Ie(e, t, n, !0);
468
+ }
469
+ function Re(e, t, n) {
470
+ return Ie(e, t, n, !1);
471
+ }
472
+ var ze = Re, Be = Le;
473
+ e.Fragment = i, e.jsx = ze, e.jsxs = Be;
474
+ })();
475
+ })), h = (/* @__PURE__ */ d(((e, t) => {
476
+ process.env.NODE_ENV === "production" ? t.exports = p() : t.exports = m();
477
+ })))(), g = {
478
+ width: 22,
479
+ height: 22,
480
+ flexShrink: 0,
481
+ display: "block",
482
+ color: "rgba(255,255,255,0.95)",
483
+ opacity: .98
484
+ };
485
+ function _(e) {
486
+ let { id: t } = e;
487
+ switch (t) {
488
+ case "messages": return /* @__PURE__ */ (0, h.jsx)(a, {
489
+ component: "svg",
490
+ viewBox: "0 0 24 24",
491
+ "aria-hidden": !0,
492
+ sx: g,
493
+ children: /* @__PURE__ */ (0, h.jsx)("path", {
494
+ fill: "currentColor",
495
+ d: "M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z"
496
+ })
497
+ });
498
+ case "gameInfo": return /* @__PURE__ */ (0, h.jsx)(a, {
499
+ component: "svg",
500
+ viewBox: "0 0 24 24",
501
+ "aria-hidden": !0,
502
+ sx: g,
503
+ children: /* @__PURE__ */ (0, h.jsx)("path", {
504
+ fill: "currentColor",
505
+ d: "M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM9.5 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm5 8.5c0 2.49-2.01 4.5-4.5 4.5S5.5 18.99 5.5 16.5 7.51 12 10 12s4.5 2.01 4.5 4.5zm4.5-4.5c0 1.38-1.12 2.5-2.5 2.5S14 16.38 14 15s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5z"
506
+ })
507
+ });
508
+ case "yourRole": return /* @__PURE__ */ (0, h.jsx)(a, {
509
+ component: "svg",
510
+ viewBox: "0 0 24 24",
511
+ "aria-hidden": !0,
512
+ sx: g,
513
+ children: /* @__PURE__ */ (0, h.jsx)("path", {
514
+ fill: "currentColor",
515
+ d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
516
+ })
517
+ });
518
+ default: return t;
519
+ }
520
+ }
521
+ //#endregion
522
+ //#region src/components/ActionButton/ActionButton.tsx
523
+ var v = [
524
+ "messages",
525
+ "gameInfo",
526
+ "yourRole"
527
+ ], y = "پزشک";
528
+ function b(d) {
529
+ let { yourRoleName: f = y, gameInfoSectionLabels: p, playerNamesContent: m, gameRoleNamesContent: g, onItemClick: b, labels: x, initialPosition: S, homePosition: C, dragBoundsPadding: w = 12, circleSize: T = 64, menuWidth: E = 230, menuItemHeight: D = 44, menuGap: ee = 10, gameInfoPanelMaxHeight: te = 340, className: ne, style: O } = d, k = t().replace(/:/g, ""), A = r(null), j = r(!1), M = r(null), N = r({
530
+ x: 0,
531
+ y: 0
532
+ }), P = r({
533
+ x: 0,
534
+ y: 0
535
+ }), F = r({
536
+ x: 0,
537
+ y: 0,
538
+ t: 0
539
+ }), I = r(null), L = r(!1), re = () => typeof window > "u" ? {
540
+ x: w + T / 2,
541
+ y: 0
542
+ } : {
543
+ x: w + T / 2,
544
+ y: window.innerHeight * .3
545
+ }, ie = n(() => C ? { ...C } : S ? { ...S } : typeof window > "u" ? {
546
+ x: w + T / 2,
547
+ y: 0
548
+ } : {
549
+ x: w + T / 2,
550
+ y: window.innerHeight * .3
551
+ }, [
552
+ C,
553
+ S,
554
+ w,
555
+ T
556
+ ]), [R, z] = i(!1), [B, V] = i(!1), [H, U] = i(() => S ? {
557
+ x: S.x,
558
+ y: S.y
559
+ } : C ? {
560
+ x: C.x,
561
+ y: C.y
562
+ } : re()), W = n(() => typeof window > "u" || H.x < window.innerWidth / 2 ? "right" : "left", [H.x]), ae = n(() => {
563
+ let e = {
564
+ messages: "پیام ها",
565
+ gameInfo: "اطلاعات بازی",
566
+ yourRole: `نقش شما ${f}`
567
+ };
568
+ return x ? {
569
+ ...e,
570
+ ...x
571
+ } : e;
572
+ }, [x, f]), oe = n(() => ({
573
+ playerNames: p?.playerNames ?? "نام بازیکنان",
574
+ roleNames: p?.roleNames ?? "نام نقش های بازی"
575
+ }), [p]), G = B ? "back" : R ? "close" : "action", K = u().direction === "rtl" || typeof document < "u" && document.documentElement.getAttribute("dir") === "rtl", [q, se] = i(() => typeof window < "u" ? window.innerHeight : 800);
576
+ e(() => {
577
+ let e = () => se(window.innerHeight);
578
+ return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
579
+ }, []);
580
+ let J = n(() => Math.min(te, Math.max(120, q - w * 2)), [
581
+ te,
582
+ q,
583
+ w
584
+ ]), [Y, ce] = i(() => {
585
+ let e = H.y - T / 2;
586
+ return {
587
+ x: H.x - E / 2,
588
+ y: e,
589
+ gap: 10
590
+ };
591
+ }), X = () => {
592
+ let e = H.y - T / 2, t = W === "right" ? H.x + T / 2 + 10 : H.x - T / 2 - 10 - E, n = D * v.length + ee * (v.length - 1), r = B ? J : n, i = Math.min(Math.max(e, w), q - w - r);
593
+ ce({
594
+ x: Math.min(Math.max(t, w), window.innerWidth - w - E),
595
+ y: i,
596
+ gap: 10
597
+ });
598
+ };
599
+ e(() => {
600
+ X();
601
+ }, [
602
+ H.x,
603
+ H.y,
604
+ W,
605
+ B,
606
+ q,
607
+ J
608
+ ]), e(() => {
609
+ if (!R && !B) return;
610
+ let e = (e) => {
611
+ let t = A.current;
612
+ if (!t) return;
613
+ let n = e.target;
614
+ n && t.contains(n) || (z(!1), V(!1));
615
+ };
616
+ return window.addEventListener("mousedown", e), window.addEventListener("touchstart", e, { passive: !0 }), () => {
617
+ window.removeEventListener("mousedown", e), window.removeEventListener("touchstart", e);
618
+ };
619
+ }, [R, B]), e(() => () => {
620
+ I.current != null && (clearTimeout(I.current), I.current = null);
621
+ }, []);
622
+ let le = (e) => {
623
+ let t = T / 2, n = w + t, r = window.innerWidth - w - t, i = w + t, a = window.innerHeight - w - t;
624
+ return {
625
+ x: Math.min(Math.max(e.x, n), r),
626
+ y: Math.min(Math.max(e.y, i), a)
627
+ };
628
+ }, Z = () => {
629
+ I.current != null && (clearTimeout(I.current), I.current = null);
630
+ }, ue = (e) => {
631
+ if (e.isPrimary) {
632
+ M.current = e.pointerId, j.current = !1, L.current = !1, N.current = {
633
+ x: e.clientX,
634
+ y: e.clientY
635
+ }, P.current = H, F.current = {
636
+ x: e.clientX,
637
+ y: e.clientY,
638
+ t: Date.now()
639
+ }, Z(), I.current = setTimeout(() => {
640
+ j.current || (L.current = !0, z(!1), V(!1), U(le({
641
+ x: ie.x,
642
+ y: ie.y
643
+ })));
644
+ }, 500);
645
+ try {
646
+ e.currentTarget.setPointerCapture(e.pointerId);
647
+ } catch {}
648
+ }
649
+ }, de = (e) => {
650
+ if (M.current !== e.pointerId) return;
651
+ let t = e.clientX - N.current.x, n = e.clientY - N.current.y;
652
+ j.current || Math.hypot(t, n) > 6 && (j.current = !0, Z()), U(le({
653
+ x: P.current.x + t,
654
+ y: P.current.y + n
655
+ }));
656
+ }, Q = (e) => {
657
+ if (M.current !== e.pointerId) return;
658
+ Z();
659
+ let { x: t, y: n, t: r } = F.current, i = Math.hypot(e.clientX - t, e.clientY - n), a = Date.now() - r, o = j.current;
660
+ if (M.current = null, j.current = !1, L.current) {
661
+ L.current = !1;
662
+ try {
663
+ e.currentTarget.releasePointerCapture(e.pointerId);
664
+ } catch {}
665
+ return;
666
+ }
667
+ i < 6 && a < 400 && !o && (B ? (V(!1), z(!0)) : z((e) => !e));
668
+ try {
669
+ e.currentTarget.releasePointerCapture(e.pointerId);
670
+ } catch {}
671
+ }, fe = (e) => {
672
+ if (Z(), M.current === e.pointerId) {
673
+ M.current = null, j.current = !1, L.current = !1;
674
+ try {
675
+ e.currentTarget.releasePointerCapture(e.pointerId);
676
+ } catch {}
677
+ }
678
+ }, pe = (e) => {
679
+ if (e === "gameInfo") {
680
+ b?.(e), V(!0), z(!1);
681
+ return;
682
+ }
683
+ b?.(e), z(!1);
684
+ };
685
+ return /* @__PURE__ */ (0, h.jsxs)("div", {
686
+ ref: A,
687
+ className: ne,
688
+ style: {
689
+ position: "fixed",
690
+ zIndex: 1300,
691
+ top: 0,
692
+ left: 0,
693
+ width: 0,
694
+ height: 0,
695
+ ...O
696
+ },
697
+ children: [
698
+ R ? /* @__PURE__ */ (0, h.jsx)(a, {
699
+ dir: "rtl",
700
+ onPointerDown: (e) => {
701
+ e.stopPropagation();
702
+ },
703
+ sx: {
704
+ position: "fixed",
705
+ zIndex: 1310,
706
+ top: Y.y,
707
+ left: Y.x,
708
+ width: `${E}px`,
709
+ display: "flex",
710
+ flexDirection: "column",
711
+ gap: `${ee}px`,
712
+ transformOrigin: W === "right" ? "left top" : "right top"
713
+ },
714
+ children: v.map((e) => {
715
+ let t = ae[e];
716
+ return /* @__PURE__ */ (0, h.jsx)(o, {
717
+ onClick: () => pe(e),
718
+ sx: {
719
+ height: `${D}px`,
720
+ borderRadius: "18px",
721
+ paddingX: "12px",
722
+ justifyContent: "flex-start",
723
+ backdropFilter: "blur(12px)",
724
+ background: "rgba(255,255,255,0.10)",
725
+ border: "1px solid rgba(255,255,255,0.22)",
726
+ boxShadow: "0 12px 36px rgba(0,0,0,0.35)",
727
+ "&:hover": { background: "rgba(255,255,255,0.14)" }
728
+ },
729
+ children: /* @__PURE__ */ (0, h.jsxs)(a, {
730
+ sx: {
731
+ display: "flex",
732
+ alignItems: "center",
733
+ justifyContent: "flex-start",
734
+ gap: "10px",
735
+ width: "100%",
736
+ flexDirection: "row"
737
+ },
738
+ children: [/* @__PURE__ */ (0, h.jsx)(l, {
739
+ sx: {
740
+ fontSize: "0.95rem",
741
+ fontWeight: 700,
742
+ letterSpacing: "-0.01em",
743
+ flex: 1,
744
+ minWidth: 0,
745
+ textAlign: "start"
746
+ },
747
+ children: t
748
+ }), /* @__PURE__ */ (0, h.jsx)(_, { id: e })]
749
+ })
750
+ }, e);
751
+ })
752
+ }) : null,
753
+ B ? /* @__PURE__ */ (0, h.jsxs)(h.Fragment, { children: [/* @__PURE__ */ (0, h.jsx)(a, {
754
+ "aria-hidden": !0,
755
+ onClick: () => V(!1),
756
+ sx: {
757
+ position: "fixed",
758
+ inset: 0,
759
+ zIndex: 1320,
760
+ background: "rgba(0,0,0,0.52)",
761
+ backdropFilter: "blur(4px)"
762
+ }
763
+ }), /* @__PURE__ */ (0, h.jsxs)(c, {
764
+ dir: "rtl",
765
+ elevation: 0,
766
+ onPointerDown: (e) => e.stopPropagation(),
767
+ onClick: (e) => e.stopPropagation(),
768
+ sx: {
769
+ position: "fixed",
770
+ zIndex: 1321,
771
+ top: Y.y,
772
+ left: Y.x,
773
+ width: `${E}px`,
774
+ height: `${J}px`,
775
+ maxHeight: `${J}px`,
776
+ display: "flex",
777
+ flexDirection: "column",
778
+ overflow: "hidden",
779
+ borderRadius: "22px",
780
+ padding: "14px 14px 16px",
781
+ backdropFilter: "blur(12px)",
782
+ background: "rgba(255,255,255,0.10)",
783
+ border: "1px solid rgba(255,255,255,0.22)",
784
+ boxShadow: "0 12px 36px rgba(0,0,0,0.35)",
785
+ transformOrigin: W === "right" ? "left top" : "right top"
786
+ },
787
+ children: [/* @__PURE__ */ (0, h.jsx)(l, {
788
+ sx: {
789
+ fontSize: "1.02rem",
790
+ fontWeight: 800,
791
+ letterSpacing: "-0.02em",
792
+ marginBottom: "12px",
793
+ flexShrink: 0
794
+ },
795
+ children: ae.gameInfo
796
+ }), /* @__PURE__ */ (0, h.jsxs)(a, {
797
+ sx: {
798
+ display: "flex",
799
+ flexDirection: "column",
800
+ gap: 2,
801
+ minHeight: 0,
802
+ flex: 1,
803
+ overflow: "auto",
804
+ pr: "2px"
805
+ },
806
+ children: [
807
+ /* @__PURE__ */ (0, h.jsxs)(a, { children: [/* @__PURE__ */ (0, h.jsx)(l, {
808
+ sx: {
809
+ fontSize: "0.82rem",
810
+ fontWeight: 700,
811
+ opacity: .72,
812
+ marginBottom: "6px"
813
+ },
814
+ children: oe.playerNames
815
+ }), /* @__PURE__ */ (0, h.jsx)(l, {
816
+ sx: {
817
+ fontSize: "0.95rem",
818
+ fontWeight: 600,
819
+ lineHeight: 1.45
820
+ },
821
+ children: m ?? "—"
822
+ })] }),
823
+ /* @__PURE__ */ (0, h.jsx)(s, { sx: { borderColor: "rgba(255,255,255,0.12)" } }),
824
+ /* @__PURE__ */ (0, h.jsxs)(a, { children: [/* @__PURE__ */ (0, h.jsx)(l, {
825
+ sx: {
826
+ fontSize: "0.82rem",
827
+ fontWeight: 700,
828
+ opacity: .72,
829
+ marginBottom: "6px"
830
+ },
831
+ children: oe.roleNames
832
+ }), /* @__PURE__ */ (0, h.jsx)(l, {
833
+ sx: {
834
+ fontSize: "0.95rem",
835
+ fontWeight: 600,
836
+ lineHeight: 1.45
837
+ },
838
+ children: g ?? "—"
839
+ })] })
840
+ ]
841
+ })]
842
+ })] }) : null,
843
+ /* @__PURE__ */ (0, h.jsx)(a, {
844
+ role: "button",
845
+ "aria-label": G === "back" ? "بازگشت به منو" : G === "close" ? "بستن منو" : "باز کردن منو",
846
+ onPointerDown: ue,
847
+ onPointerMove: de,
848
+ onPointerUp: Q,
849
+ onPointerCancel: fe,
850
+ sx: {
851
+ position: "fixed",
852
+ width: `${T}px`,
853
+ height: `${T}px`,
854
+ borderRadius: "50%",
855
+ top: H.y - T / 2,
856
+ left: H.x - T / 2,
857
+ zIndex: 1330,
858
+ display: "flex",
859
+ alignItems: "center",
860
+ justifyContent: "center",
861
+ cursor: j.current ? "grabbing" : "pointer",
862
+ userSelect: "none",
863
+ touchAction: "none",
864
+ background: "linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06))",
865
+ border: "1px solid rgba(255,255,255,0.25)",
866
+ boxShadow: "0 18px 60px rgba(0,0,0,0.45)"
867
+ },
868
+ children: G === "back" ? /* @__PURE__ */ (0, h.jsx)(a, {
869
+ "aria-hidden": !0,
870
+ component: "svg",
871
+ viewBox: "0 0 24 24",
872
+ sx: {
873
+ width: `${T * .48}px`,
874
+ height: `${T * .48}px`,
875
+ flexShrink: 0,
876
+ display: "block",
877
+ color: "#fff",
878
+ opacity: .98,
879
+ filter: "drop-shadow(0 2px 8px rgba(0,0,0,0.45))",
880
+ shapeRendering: "geometricPrecision",
881
+ transform: K ? "scaleX(-1)" : "none"
882
+ },
883
+ children: /* @__PURE__ */ (0, h.jsx)("path", {
884
+ fill: "currentColor",
885
+ d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
886
+ })
887
+ }) : G === "close" ? /* @__PURE__ */ (0, h.jsx)(a, {
888
+ "aria-hidden": !0,
889
+ component: "svg",
890
+ viewBox: "0 0 24 24",
891
+ sx: {
892
+ width: `${T * .46}px`,
893
+ height: `${T * .46}px`,
894
+ flexShrink: 0,
895
+ display: "block",
896
+ color: "#fff",
897
+ opacity: .98,
898
+ filter: "drop-shadow(0 2px 8px rgba(0,0,0,0.45))",
899
+ shapeRendering: "geometricPrecision"
900
+ },
901
+ children: /* @__PURE__ */ (0, h.jsx)("path", {
902
+ fill: "currentColor",
903
+ d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
904
+ })
905
+ }) : /* @__PURE__ */ (0, h.jsxs)(a, {
906
+ "aria-hidden": !0,
907
+ component: "svg",
908
+ viewBox: "0 0 24 24",
909
+ sx: {
910
+ width: `${T * .5}px`,
911
+ height: `${T * .5}px`,
912
+ flexShrink: 0,
913
+ display: "block",
914
+ color: "#fff",
915
+ opacity: .96,
916
+ filter: "drop-shadow(0 2px 8px rgba(0,0,0,0.45))",
917
+ shapeRendering: "geometricPrecision"
918
+ },
919
+ children: [/* @__PURE__ */ (0, h.jsx)("defs", { children: /* @__PURE__ */ (0, h.jsxs)("linearGradient", {
920
+ id: k,
921
+ x1: "0%",
922
+ y1: "0%",
923
+ x2: "100%",
924
+ y2: "100%",
925
+ children: [/* @__PURE__ */ (0, h.jsx)("stop", {
926
+ offset: "0%",
927
+ stopColor: "#ffffff",
928
+ stopOpacity: "1"
929
+ }), /* @__PURE__ */ (0, h.jsx)("stop", {
930
+ offset: "100%",
931
+ stopColor: "#e8eef8",
932
+ stopOpacity: "0.95"
933
+ })]
934
+ }) }), /* @__PURE__ */ (0, h.jsx)("path", {
935
+ fill: `url(#${k})`,
936
+ d: "M11 21h-1l1-7H7.5c-.58 0-.57-.32-.38-.66.19-.34.05-.08.07-.12C8.48 10.94 10.42 7.54 13 3h1l-1 7h3.5c.49 0 .56.33.47.51l-.07.15C12.96 17.55 11 21 11 21z"
937
+ })]
938
+ })
939
+ })
940
+ ]
941
+ });
942
+ }
943
+ //#endregion
944
+ export { b as ActionButton };
package/dist/main.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "god-button-action-button",
3
+ "version": "0.1.0",
4
+ "description": "Movable action button with RTL glass menu for mobile games.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "dev": "vite",
22
+ "build": "vite build",
23
+ "preview": "vite preview",
24
+ "typecheck": "tsc -p tsconfig.json --noEmit"
25
+ },
26
+ "peerDependencies": {
27
+ "@emotion/react": ">=11",
28
+ "@emotion/styled": ">=11",
29
+ "@mui/material": ">=5",
30
+ "react": ">=18",
31
+ "react-dom": ">=18"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^25.5.0",
35
+ "@types/react": "^19.2.14",
36
+ "@types/react-dom": "^19.2.3",
37
+ "@vitejs/plugin-react": "^6.0.1",
38
+ "typescript": "^5.9.3",
39
+ "vite": "^8.0.1",
40
+ "vite-plugin-dts": "^4.5.4"
41
+ }
42
+ }