npm-pkg-hook 1.0.2 → 1.0.4

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.
Files changed (84) hide show
  1. package/.babelrc +13 -13
  2. package/.env +1 -0
  3. package/.eslintrc.js +132 -0
  4. package/.eslintrc.json +107 -107
  5. package/.github/pull_request_template.md +17 -17
  6. package/.github/workflows/pepeline.yaml +29 -29
  7. package/.vscode/extensions.json +6 -0
  8. package/.vscode/settings.json +12 -0
  9. package/README.md +1 -1
  10. package/jsconfig.json +27 -27
  11. package/next.config.js +128 -128
  12. package/package.json +8 -6
  13. package/script.txt +7 -0
  14. package/src/cookies/index.ts +3 -3
  15. package/src/hooks/index.js +46 -19
  16. package/src/hooks/updateExtProductFoodsOptional/index.js +38 -0
  17. package/src/hooks/useAcumulateDate/index.js +16 -16
  18. package/src/hooks/useAnimationText/index.jsx +31 -30
  19. package/src/hooks/useBanner/index.js +19 -0
  20. package/src/hooks/useCatWithProduct/index.js +42 -0
  21. package/src/hooks/useCatWithProduct/queries.js +172 -0
  22. package/src/hooks/useCategoryInStore/index.js +94 -0
  23. package/src/hooks/{useGetCategorieStore → useCategoryInStore}/queries.js +77 -77
  24. package/src/hooks/useCategoryStore/index.js +7 -7
  25. package/src/hooks/useCategoryStore/queries.js +16 -16
  26. package/src/hooks/useChartData/index.js +168 -0
  27. package/src/hooks/useCheckbox/index.js +114 -114
  28. package/src/hooks/useClients/index.js +13 -13
  29. package/src/hooks/useClients/queries.js +117 -117
  30. package/src/hooks/useConnection/index.js +23 -0
  31. package/src/hooks/useCreateProduct/helpers/useEditImageProduct/index.js +165 -0
  32. package/src/hooks/useCreateProduct/index.js +268 -0
  33. package/src/hooks/useDessert/index.js +141 -0
  34. package/src/hooks/useDrag/index.js +62 -57
  35. package/src/hooks/useEvent/index.js +33 -33
  36. package/src/hooks/useFetchJson/index.js +24 -24
  37. package/src/hooks/useFetchMoreInteractions/index.jsx +37 -34
  38. package/src/hooks/useFormTools/index.js +83 -70
  39. package/src/hooks/useFormatDate/index.js +34 -0
  40. package/src/hooks/useFullScreenMode/index.js +65 -65
  41. package/src/hooks/useHover/index.js +28 -28
  42. package/src/hooks/useImageOptimization/index.js +28 -0
  43. package/src/hooks/useImageWeight/index.js +52 -0
  44. package/src/hooks/useImagesStore/index.js +171 -0
  45. package/src/hooks/useImagesStore/queries.js +216 -0
  46. package/src/hooks/useInnerHtml/index.js +37 -37
  47. package/src/hooks/useIntersection/index.js +84 -31
  48. package/src/hooks/useKeypress/index.js +27 -27
  49. package/src/hooks/useLazyScript/index.js +72 -0
  50. package/src/hooks/useLocalSorage/index.js +35 -35
  51. package/src/hooks/useLocationNavigate/index.js +54 -54
  52. package/src/hooks/useMobile/index.js +37 -37
  53. package/src/hooks/useMutateHeight/index.js +37 -0
  54. package/src/hooks/useProductsFood/index.js +190 -0
  55. package/src/hooks/{useGetProductsFood → useProductsFood}/queriesStore.js +780 -765
  56. package/src/hooks/useProductsFood/usetagsProducts.js +57 -0
  57. package/src/hooks/useReport/index.js +35 -0
  58. package/src/hooks/useReport/queries.js +122 -0
  59. package/src/hooks/useRestaurant/index.js +19 -19
  60. package/src/hooks/useRestaurant/queries.js +79 -69
  61. package/src/hooks/useSales/index.js +589 -489
  62. package/src/hooks/useSales/queries.js +290 -229
  63. package/src/hooks/useSales/useGetSale.js +12 -0
  64. package/src/hooks/useSales/useTotalSales.js +17 -0
  65. package/src/hooks/useSaveAvailableProduct/helpers/index.js +30 -0
  66. package/src/hooks/useSaveAvailableProduct/index.js +26 -0
  67. package/src/hooks/useSaveAvailableProduct/queries.js +10 -0
  68. package/src/hooks/useSchedule/index.jsx +23 -0
  69. package/src/hooks/useSetState/index.js +24 -24
  70. package/src/hooks/useStore/index.js +17 -17
  71. package/src/hooks/useStore/queries.js +135 -135
  72. package/src/hooks/useStoreCalendar/index.js +7 -0
  73. package/src/hooks/useTimeAgo/useTimeAgo.js +39 -39
  74. package/src/hooks/useUpdateCart/index.js +124 -124
  75. package/src/hooks/useUpdateExtProductFoodsSubOptional/index.js +37 -0
  76. package/src/hooks/useUser/index.js +7 -3
  77. package/src/hooks/useUser/queries.js +69 -0
  78. package/src/hooks/useWindowSize/index.js +37 -37
  79. package/src/index.jsx +2 -1
  80. package/src/mock/dessert/index.js +16 -0
  81. package/src/mock/index.js +2 -0
  82. package/src/utils/index.js +106 -54
  83. package/src/hooks/useGetCategorieStore/index.js +0 -21
  84. package/src/hooks/useGetProductsFood/index.js +0 -46
package/.babelrc CHANGED
@@ -1,14 +1,14 @@
1
- {
2
- "presets": [
3
- [
4
- "@babel/preset-env",
5
- {
6
- "targets": {
7
- "node": "current"
8
- }
9
- }
10
- ],
11
- "@babel/preset-react",
12
- "@babel/preset-typescript"
13
- ]
1
+ {
2
+ "presets": [
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ "targets": {
7
+ "node": "current"
8
+ }
9
+ }
10
+ ],
11
+ "@babel/preset-react",
12
+ "@babel/preset-typescript"
13
+ ]
14
14
  }
package/.env ADDED
@@ -0,0 +1 @@
1
+ NPM_TOKEN = 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
package/.eslintrc.js ADDED
@@ -0,0 +1,132 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true,
5
+ node: true
6
+ },
7
+ extends: [
8
+ 'plugin:react/recommended',
9
+ 'standard'
10
+ ],
11
+ overrides: [
12
+ ],
13
+ parserOptions: {
14
+ ecmaVersion: 'latest',
15
+ sourceType: 'module'
16
+ },
17
+ plugins: [
18
+ 'react',
19
+ 'react-hooks',
20
+ '@typescript-eslint'
21
+ ],
22
+ rules: {
23
+ 'import/no-anonymous-default-export': ['error', {
24
+ allowArray: false,
25
+ allowArrowFunction: false,
26
+ allowAnonymousClass: false,
27
+ allowAnonymousFunction: false,
28
+ allowCallExpression: true, // The true value here is for backward compatibility
29
+ allowLiteral: false,
30
+ allowObject: true // anonymous-default-export
31
+ }],
32
+ // react hooks validations
33
+ 'react-hooks/exhaustive-deps': 'warn',
34
+ 'react-hooks/rules-of-hooks': 'error',
35
+ // allow jsx syntax in js files (for next.js project)
36
+ 'react/jsx-filename-extension': [
37
+ 1,
38
+ {
39
+ extensions: [
40
+ '.js',
41
+ '.jsx',
42
+ '.ts',
43
+ '.tsx'
44
+ ]
45
+ }
46
+ ],
47
+ quotes: [
48
+ 2,
49
+ 'single',
50
+ {
51
+ avoidEscape: true,
52
+ allowTemplateLiterals: true
53
+ }
54
+ ],
55
+ 'consistent-return': 2,
56
+ indent: [
57
+ 2,
58
+ 2,
59
+ {
60
+ SwitchCase: 1
61
+ }
62
+ ],
63
+ 'no-else-return': 1,
64
+ semi: [
65
+ 1,
66
+ 'never'
67
+ ],
68
+ 'space-unary-ops': 2,
69
+ 'comma-dangle': [
70
+ 'error',
71
+ {
72
+ arrays: 'never',
73
+ objects: 'never',
74
+ imports: 'never',
75
+ exports: 'never',
76
+ functions: 'never'
77
+ }
78
+ ],
79
+ 'one-var': [
80
+ 2,
81
+ 'never'
82
+ ],
83
+ 'no-var': 'error',
84
+ 'arrow-body-style': [
85
+ 'error',
86
+ 'always'
87
+ ],
88
+ 'no-console': 'error',
89
+ 'no-multi-spaces': [
90
+ 'error',
91
+ {
92
+ exceptions: {
93
+ BinaryExpression: true
94
+ }
95
+ }
96
+ ],
97
+ 'no-multiple-empty-lines': [
98
+ 'error',
99
+ {
100
+ max: 2,
101
+ maxBOF: 2
102
+ }
103
+ ],
104
+ 'jsx-quotes': [
105
+ 'error',
106
+ 'prefer-single'
107
+ ],
108
+ 'react/jsx-sort-props': [
109
+ 'error',
110
+ {
111
+ noSortAlphabetically: false
112
+ }
113
+ ],
114
+ 'react/jsx-first-prop-new-line': [
115
+ 'error',
116
+ 'multiline'
117
+ ],
118
+ 'react/jsx-max-props-per-line': [
119
+ 'error',
120
+ {
121
+ maximum: {
122
+ single: 2,
123
+ multi: 1
124
+ }
125
+ }
126
+ ],
127
+ 'react/jsx-closing-bracket-location': [
128
+ 'error',
129
+ 'line-aligned'
130
+ ]
131
+ }
132
+ }
package/.eslintrc.json CHANGED
@@ -1,108 +1,108 @@
1
- {
2
- "env": {
3
- "browser": true,
4
- "es2021": true
5
- },
6
- "extends": [
7
- "eslint:recommended",
8
- "plugin:react/recommended",
9
- "plugin:@typescript-eslint/recommended"
10
- ],
11
- "parser": "@typescript-eslint/parser",
12
- "parserOptions": {
13
- "ecmaFeatures": {
14
- "jsx": true
15
- },
16
- "ecmaVersion": 12,
17
- "sourceType": "module"
18
- },
19
- "plugins": [
20
- "react",
21
- "react-hooks",
22
- "@typescript-eslint"
23
- ],
24
- "settings": {
25
- "react": {
26
- "version": "detect"
27
- }
28
- },
29
- "rules": {
30
- // react hooks validations
31
- "react-hooks/rules-of-hooks": "error",
32
- // suppress errors for missing "import React" in files
33
- "react/react-in-jsx-scope": "off",
34
- // allow jsx syntax in js files (for next.js project)
35
- "react/jsx-filename-extension": [
36
- 1,
37
- {
38
- "extensions": [
39
- ".js",
40
- ".jsx",
41
- ".ts",
42
- ".tsx"
43
- ]
44
- }
45
- ],
46
- "quotes": [
47
- 2,
48
- "single",
49
- {
50
- "avoidEscape": true,
51
- "allowTemplateLiterals": true
52
- }
53
- ],
54
- "consistent-return": 2,
55
- "indent": [
56
- 2,
57
- 2,
58
- {
59
- "SwitchCase": 1
60
- }
61
- ],
62
- "no-else-return": 1,
63
- "semi": [
64
- 1,
65
- "never"
66
- ],
67
- "space-unary-ops": 2,
68
- "comma-dangle": [
69
- "error",
70
- {
71
- "arrays": "never",
72
- "objects": "never",
73
- "imports": "never",
74
- "exports": "never",
75
- "functions": "never"
76
- }
77
- ],
78
- "one-var": [
79
- 2,
80
- "never"
81
- ],
82
- "no-var": "error",
83
- "arrow-body-style": [
84
- "error",
85
- "always"
86
- ],
87
- "no-console": "error",
88
- "no-multi-spaces": [
89
- "error",
90
- {
91
- "exceptions": {
92
- "BinaryExpression": true
93
- }
94
- }
95
- ],
96
- "no-multiple-empty-lines": [
97
- "error",
98
- {
99
- "max": 1,
100
- "maxBOF": 1
101
- }
102
- ],
103
- "jsx-quotes": [
104
- "error",
105
- "prefer-single"
106
- ]
107
- }
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es2021": true
5
+ },
6
+ "extends": [
7
+ "eslint:recommended",
8
+ "plugin:react/recommended",
9
+ "plugin:@typescript-eslint/recommended"
10
+ ],
11
+ "parser": "@typescript-eslint/parser",
12
+ "parserOptions": {
13
+ "ecmaFeatures": {
14
+ "jsx": true
15
+ },
16
+ "ecmaVersion": 12,
17
+ "sourceType": "module"
18
+ },
19
+ "plugins": [
20
+ "react",
21
+ "react-hooks",
22
+ "@typescript-eslint"
23
+ ],
24
+ "settings": {
25
+ "react": {
26
+ "version": "detect"
27
+ }
28
+ },
29
+ "rules": {
30
+ // react hooks validations
31
+ "react-hooks/rules-of-hooks": "error",
32
+ // suppress errors for missing "import React" in files
33
+ "react/react-in-jsx-scope": "off",
34
+ // allow jsx syntax in js files (for next.js project)
35
+ "react/jsx-filename-extension": [
36
+ 1,
37
+ {
38
+ "extensions": [
39
+ ".js",
40
+ ".jsx",
41
+ ".ts",
42
+ ".tsx"
43
+ ]
44
+ }
45
+ ],
46
+ "quotes": [
47
+ 2,
48
+ "single",
49
+ {
50
+ "avoidEscape": true,
51
+ "allowTemplateLiterals": true
52
+ }
53
+ ],
54
+ "consistent-return": 2,
55
+ "indent": [
56
+ 2,
57
+ 2,
58
+ {
59
+ "SwitchCase": 1
60
+ }
61
+ ],
62
+ "no-else-return": 1,
63
+ "semi": [
64
+ 1,
65
+ "never"
66
+ ],
67
+ "space-unary-ops": 2,
68
+ "comma-dangle": [
69
+ "error",
70
+ {
71
+ "arrays": "never",
72
+ "objects": "never",
73
+ "imports": "never",
74
+ "exports": "never",
75
+ "functions": "never"
76
+ }
77
+ ],
78
+ "one-var": [
79
+ 2,
80
+ "never"
81
+ ],
82
+ "no-var": "error",
83
+ "arrow-body-style": [
84
+ "error",
85
+ "always"
86
+ ],
87
+ "no-console": "error",
88
+ "no-multi-spaces": [
89
+ "error",
90
+ {
91
+ "exceptions": {
92
+ "BinaryExpression": true
93
+ }
94
+ }
95
+ ],
96
+ "no-multiple-empty-lines": [
97
+ "error",
98
+ {
99
+ "max": 1,
100
+ "maxBOF": 1
101
+ }
102
+ ],
103
+ "jsx-quotes": [
104
+ "error",
105
+ "prefer-single"
106
+ ]
107
+ }
108
108
  }
@@ -1,18 +1,18 @@
1
- ## What problem is this solving?
2
-
3
- - [x] this is an example if you finish your work
4
-
5
- ## How should this be manually tested?
6
-
7
- ### Screenshots or example usage
8
-
9
- ## Types of changes
10
-
11
- * [ ] Bug fix (a non-breaking change which fixes an issue)
12
- * [ ] New feature (a non-breaking change which adds functionality)
13
- * [ ] Breaking change (fix or feature that would cause existing functionality to change)
14
- * [ ] Requires change to documentation, which has been updated accordingly.
15
-
16
- ## PR's related
17
-
1
+ ## What problem is this solving?
2
+
3
+ - [x] this is an example if you finish your work
4
+
5
+ ## How should this be manually tested?
6
+
7
+ ### Screenshots or example usage
8
+
9
+ ## Types of changes
10
+
11
+ * [ ] Bug fix (a non-breaking change which fixes an issue)
12
+ * [ ] New feature (a non-breaking change which adds functionality)
13
+ * [ ] Breaking change (fix or feature that would cause existing functionality to change)
14
+ * [ ] Requires change to documentation, which has been updated accordingly.
15
+
16
+ ## PR's related
17
+
18
18
  - [x] Add the relation between pull request
@@ -1,30 +1,30 @@
1
- name: Publish package to GitHub Packages
2
- on:
3
- push:
4
- branches: [main]
5
- pull_request:
6
- branches: [develop]
7
- types: [opened, synchronize]
8
- release:
9
- types: [created]
10
- jobs:
11
- build:
12
- runs-on: ubuntu-latest
13
- permissions:
14
- contents: read
15
- packages: write
16
- steps:
17
- - uses: actions/checkout@v3
18
- # Setup .npmrc file to publish to GitHub Packages
19
- - uses: actions/setup-node@v3
20
- with:
21
- node-version: '16.x'
22
- registry-url: 'https://npm.pkg.github.com'
23
- # Defaults to the user or organization that owns the workflow file
24
- - run: npm install
25
- - uses: JS-DevTools/npm-publish@v1
26
- with:
27
- token: ${{ secrets.NPM_TOKEN }}
28
- # - run: npm publish
29
- # env:
1
+ name: Publish package to GitHub Packages
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [develop]
7
+ types: [opened, synchronize]
8
+ release:
9
+ types: [created]
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ packages: write
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ # Setup .npmrc file to publish to GitHub Packages
19
+ - uses: actions/setup-node@v3
20
+ with:
21
+ node-version: '16.x'
22
+ registry-url: 'https://npm.pkg.github.com'
23
+ # Defaults to the user or organization that owns the workflow file
24
+ - run: npm install
25
+ - uses: JS-DevTools/npm-publish@v1
26
+ with:
27
+ token: ${{ secrets.NPM_TOKEN }}
28
+ # - run: npm publish
29
+ # env:
30
30
  # NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,6 @@
1
+ {
2
+ "recommendations": [
3
+ "github.copilot",
4
+ "github.copilot-nightly"
5
+ ]
6
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "cSpell.words": [
3
+ "Anauthorized",
4
+ "deepmerge",
5
+ "Eliminado",
6
+ "Pedido"
7
+ ],
8
+ "editor.codeActionsOnSave": {
9
+ "source.fixAll.eslint": true,
10
+ "source.organizeImports": true
11
+ }
12
+ }
package/README.md CHANGED
@@ -1 +1 @@
1
- # pkg-hook
1
+ # pkg-hook
package/jsconfig.json CHANGED
@@ -1,28 +1,28 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": [
5
- "dom",
6
- "dom.iterable"
7
- ],
8
- "allowJs": true,
9
- "skipLibCheck": true,
10
- "strict": false,
11
- "forceConsistentCasingInFileNames": true,
12
- "noEmit": true,
13
- "esModuleInterop": true,
14
- "module": "commonjs",
15
- "moduleResolution": "node",
16
- "resolveJsonModule": true,
17
- "isolatedModules": true,
18
- "jsx": "preserve",
19
- "incremental": true
20
- },
21
- "include": [
22
- "**/*.ts",
23
- "**/*.tsx"
24
- ],
25
- "exclude": [
26
- "node_modules"
27
- ]
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "lib": [
5
+ "dom",
6
+ "dom.iterable"
7
+ ],
8
+ "allowJs": true,
9
+ "skipLibCheck": true,
10
+ "strict": false,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "noEmit": true,
13
+ "esModuleInterop": true,
14
+ "module": "commonjs",
15
+ "moduleResolution": "node",
16
+ "resolveJsonModule": true,
17
+ "isolatedModules": true,
18
+ "jsx": "preserve",
19
+ "incremental": true
20
+ },
21
+ "include": [
22
+ "**/*.ts",
23
+ "**/*.tsx"
24
+ ],
25
+ "exclude": [
26
+ "node_modules"
27
+ ]
28
28
  }