siam-ui-utils 2.2.14 → 2.2.15
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/eslint.config.mjs +45 -45
- package/package.json +1 -1
- package/src/App.jsx +2 -2
- package/src/view-layout/constants.js +1 -1
- package/src/view-layout/index.tsx +6 -3
package/eslint.config.mjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import js from '@eslint/js';
|
|
2
|
-
import globals from 'globals';
|
|
3
|
-
import pluginReact from 'eslint-plugin-react';
|
|
4
|
-
import pluginReactHooks from 'eslint-plugin-react-hooks';
|
|
5
|
-
import pluginReactRefresh from 'eslint-plugin-react-refresh';
|
|
6
|
-
import { defineConfig } from 'eslint/config';
|
|
7
|
-
|
|
8
|
-
export default defineConfig([
|
|
9
|
-
{ ignores: ['build', '**/*.d.ts'] },
|
|
10
|
-
{
|
|
11
|
-
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
12
|
-
languageOptions: {
|
|
13
|
-
ecmaVersion: 'latest',
|
|
14
|
-
sourceType: 'module',
|
|
15
|
-
globals: globals.browser,
|
|
16
|
-
parserOptions: {
|
|
17
|
-
ecmaFeatures: { jsx: true },
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
parser: '@typescript-eslint/parser',
|
|
21
|
-
parserOptions: {
|
|
22
|
-
ecmaVersion: 'latest',
|
|
23
|
-
},
|
|
24
|
-
plugins: {
|
|
25
|
-
react: pluginReact,
|
|
26
|
-
'react-hooks': pluginReactHooks,
|
|
27
|
-
'react-refresh': pluginReactRefresh,
|
|
28
|
-
},
|
|
29
|
-
rules: {
|
|
30
|
-
...js.configs.recommended.rules,
|
|
31
|
-
...pluginReact.configs.recommended.rules,
|
|
32
|
-
...pluginReact.configs['jsx-runtime'].rules,
|
|
33
|
-
...pluginReactHooks.configs.recommended.rules,
|
|
34
|
-
'react/jsx-no-target-blank': 'off',
|
|
35
|
-
'react-refresh/only-export-components': [
|
|
36
|
-
'off',
|
|
37
|
-
{ allowConstantExport: true },
|
|
38
|
-
],
|
|
39
|
-
'react/prop-types': 'off',
|
|
40
|
-
'@/no-default-export': 'off',
|
|
41
|
-
'no-unused-vars': 'warn',
|
|
42
|
-
},
|
|
43
|
-
settings: { react: { version: 'detect' } },
|
|
44
|
-
},
|
|
45
|
-
]);
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
import pluginReact from 'eslint-plugin-react';
|
|
4
|
+
import pluginReactHooks from 'eslint-plugin-react-hooks';
|
|
5
|
+
import pluginReactRefresh from 'eslint-plugin-react-refresh';
|
|
6
|
+
import { defineConfig } from 'eslint/config';
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
{ ignores: ['build', '**/*.d.ts'] },
|
|
10
|
+
{
|
|
11
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
12
|
+
languageOptions: {
|
|
13
|
+
ecmaVersion: 'latest',
|
|
14
|
+
sourceType: 'module',
|
|
15
|
+
globals: globals.browser,
|
|
16
|
+
parserOptions: {
|
|
17
|
+
ecmaFeatures: { jsx: true },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
parser: '@typescript-eslint/parser',
|
|
21
|
+
parserOptions: {
|
|
22
|
+
ecmaVersion: 'latest',
|
|
23
|
+
},
|
|
24
|
+
plugins: {
|
|
25
|
+
react: pluginReact,
|
|
26
|
+
'react-hooks': pluginReactHooks,
|
|
27
|
+
'react-refresh': pluginReactRefresh,
|
|
28
|
+
},
|
|
29
|
+
rules: {
|
|
30
|
+
...js.configs.recommended.rules,
|
|
31
|
+
...pluginReact.configs.recommended.rules,
|
|
32
|
+
...pluginReact.configs['jsx-runtime'].rules,
|
|
33
|
+
...pluginReactHooks.configs.recommended.rules,
|
|
34
|
+
'react/jsx-no-target-blank': 'off',
|
|
35
|
+
'react-refresh/only-export-components': [
|
|
36
|
+
'off',
|
|
37
|
+
{ allowConstantExport: true },
|
|
38
|
+
],
|
|
39
|
+
'react/prop-types': 'off',
|
|
40
|
+
'@/no-default-export': 'off',
|
|
41
|
+
'no-unused-vars': 'warn',
|
|
42
|
+
},
|
|
43
|
+
settings: { react: { version: 'detect' } },
|
|
44
|
+
},
|
|
45
|
+
]);
|
package/package.json
CHANGED
package/src/App.jsx
CHANGED
|
@@ -11,8 +11,8 @@ import './index.css';
|
|
|
11
11
|
import './App.css';
|
|
12
12
|
import './assets/css/vendor/bootstrap.min.css';
|
|
13
13
|
import { WhereByRoom } from './where-by-room';
|
|
14
|
-
import ViewLayout from './view-layout';
|
|
15
|
-
import CopyLink from './copy-link';
|
|
14
|
+
import { ViewLayout } from './view-layout';
|
|
15
|
+
import { CopyLink } from './copy-link';
|
|
16
16
|
|
|
17
17
|
const slots = [
|
|
18
18
|
{
|
|
@@ -2,7 +2,7 @@ import React, { FC, useState } from 'react';
|
|
|
2
2
|
import SlotWrapper from './slot-wrapper';
|
|
3
3
|
import { ItemSlot } from './item-slot';
|
|
4
4
|
import EditorLayer from './editor-layer.jsx';
|
|
5
|
-
import { GRID_SIZES,
|
|
5
|
+
import { GRID_SIZES, LOCALHOST } from './constants';
|
|
6
6
|
import ButtonEditor from './button-editor.jsx';
|
|
7
7
|
import './styles.scss';
|
|
8
8
|
|
|
@@ -19,15 +19,18 @@ const ViewLayout: FC<LayoutProps> = ({
|
|
|
19
19
|
size = 'md',
|
|
20
20
|
alto = 80,
|
|
21
21
|
ancho = 90,
|
|
22
|
+
server = window?.location?.hostname,
|
|
22
23
|
...props
|
|
23
24
|
}) => {
|
|
24
|
-
|
|
25
|
+
|
|
26
|
+
const isLocalhost=LOCALHOST.includes(server);
|
|
27
|
+
|
|
25
28
|
const [isEditorActivo, setEditorActivo] = useState(false);
|
|
26
29
|
const gridCols = GRID_SIZES[size].cols;
|
|
27
30
|
const gridRows = GRID_SIZES[size].rows;
|
|
28
31
|
return (
|
|
29
32
|
<div className="visualizador-container">
|
|
30
|
-
{
|
|
33
|
+
{isLocalhost && (
|
|
31
34
|
<ButtonEditor
|
|
32
35
|
activo={isEditorActivo}
|
|
33
36
|
onClick={() => setEditorActivo((prev) => !prev)}
|