tinywidgets 1.1.3 → 1.1.5
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/.prettierignore +1 -0
- package/bun.lockb +0 -0
- package/eslint.config.js +186 -0
- package/package.json +14 -14
- package/src/common/functions.tsx +1 -1
- package/src/components/App/index.css.ts +3 -3
- package/src/components/App/index.tsx +7 -8
- package/src/components/Button/index.tsx +3 -3
- package/src/components/Card/index.css.ts +1 -1
- package/src/components/Card/index.tsx +1 -2
- package/src/components/Code/index.tsx +0 -3
- package/src/components/Collapsible/index.css.ts +1 -1
- package/src/components/Collapsible/index.tsx +8 -8
- package/src/components/Detail/index.css.ts +1 -1
- package/src/components/Detail/index.tsx +1 -2
- package/src/components/Hr/index.css.ts +1 -1
- package/src/components/Hr/index.tsx +1 -4
- package/src/components/Image/index.tsx +2 -2
- package/src/components/Metric/index.tsx +1 -2
- package/src/components/Row/index.css.ts +1 -1
- package/src/components/Row/index.tsx +1 -2
- package/src/components/Summary/index.css.ts +2 -2
- package/src/components/Summary/index.tsx +2 -3
- package/src/components/Tag/index.tsx +0 -1
- package/src/components/TasksProvider/index.tsx +7 -10
- package/src/css/code.css.ts +0 -1
- package/src/index.css.ts +1 -1
- package/src/index.ts +2 -2
- package/src/stores/LocalStore.tsx +3 -3
- package/src/stores/RouteStore.tsx +1 -1
- package/src/stores/SessionStore.tsx +2 -2
- package/tsconfig.json +1 -1
- package/.eslintrc.json +0 -92
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
package.json
|
package/bun.lockb
CHANGED
|
Binary file
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import jsLint from '@eslint/js';
|
|
2
|
+
import importLint from 'eslint-plugin-import';
|
|
3
|
+
import reactLint from 'eslint-plugin-react';
|
|
4
|
+
import hooksLint from 'eslint-plugin-react-hooks';
|
|
5
|
+
import {globalIgnores} from 'eslint/config';
|
|
6
|
+
import globals from 'globals';
|
|
7
|
+
import tsLint from 'typescript-eslint';
|
|
8
|
+
|
|
9
|
+
export default tsLint.config(
|
|
10
|
+
globalIgnores([
|
|
11
|
+
'eslint.config.js',
|
|
12
|
+
'docs/**/*',
|
|
13
|
+
'dist/**/*',
|
|
14
|
+
'tmp/**/*',
|
|
15
|
+
'site/extras/*',
|
|
16
|
+
'**/node_modules/**/*',
|
|
17
|
+
]),
|
|
18
|
+
|
|
19
|
+
jsLint.configs.recommended,
|
|
20
|
+
importLint.flatConfigs.recommended,
|
|
21
|
+
reactLint.configs.flat.recommended,
|
|
22
|
+
reactLint.configs.flat['jsx-runtime'],
|
|
23
|
+
hooksLint.configs['recommended-latest'],
|
|
24
|
+
tsLint.configs.recommended,
|
|
25
|
+
|
|
26
|
+
{
|
|
27
|
+
settings: {
|
|
28
|
+
react: {version: 'detect'},
|
|
29
|
+
'import/resolver': {node: {extensions: ['.js', '.jsx', '.ts', '.tsx']}},
|
|
30
|
+
'import/core-modules': ['expo-sqlite'],
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
languageOptions: {globals: {...globals.node, ...globals.browser}},
|
|
34
|
+
|
|
35
|
+
rules: {
|
|
36
|
+
'no-var': 2,
|
|
37
|
+
'no-console': 2,
|
|
38
|
+
'object-curly-spacing': [2, 'never'],
|
|
39
|
+
indent: 0,
|
|
40
|
+
'no-empty': [2, {allowEmptyCatch: true}],
|
|
41
|
+
'linebreak-style': [2, 'unix'],
|
|
42
|
+
'space-infix-ops': 2,
|
|
43
|
+
quotes: [2, 'single', {allowTemplateLiterals: true}],
|
|
44
|
+
semi: [2, 'always'],
|
|
45
|
+
'sort-keys': 0,
|
|
46
|
+
'no-multiple-empty-lines': [2, {max: 1}],
|
|
47
|
+
'sort-imports': 0,
|
|
48
|
+
'max-len': [
|
|
49
|
+
2,
|
|
50
|
+
{
|
|
51
|
+
code: 80,
|
|
52
|
+
ignorePattern:
|
|
53
|
+
'^(\\s+\\* )?(imports?|exports?|\\} from|(.+ as .+))\\W.*',
|
|
54
|
+
ignoreUrls: true,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
'comma-dangle': [
|
|
58
|
+
2,
|
|
59
|
+
{
|
|
60
|
+
arrays: 'always-multiline',
|
|
61
|
+
objects: 'always-multiline',
|
|
62
|
+
imports: 'always-multiline',
|
|
63
|
+
exports: 'always-multiline',
|
|
64
|
+
functions: 'always-multiline',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
'import/no-unresolved': [
|
|
68
|
+
2,
|
|
69
|
+
{
|
|
70
|
+
ignore: [
|
|
71
|
+
'^\\./generated/client$',
|
|
72
|
+
'^custom-remote-handlers$',
|
|
73
|
+
'^electric-sql/(client/model|notifiers|wa-sqlite)$',
|
|
74
|
+
'^cloudflare:workers$',
|
|
75
|
+
'eslint/config',
|
|
76
|
+
'typescript-eslint',
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
|
|
81
|
+
// --
|
|
82
|
+
|
|
83
|
+
'@typescript-eslint/unified-signatures': 0,
|
|
84
|
+
'@typescript-eslint/no-invalid-void-type': 0,
|
|
85
|
+
'@typescript-eslint/no-dynamic-delete': 0,
|
|
86
|
+
'@typescript-eslint/no-var-requires': 0,
|
|
87
|
+
'@typescript-eslint/no-explicit-any': 0,
|
|
88
|
+
'@typescript-eslint/no-unused-vars': [
|
|
89
|
+
2,
|
|
90
|
+
{argsIgnorePattern: '^_.*', varsIgnorePattern: '^(_.*|React)'},
|
|
91
|
+
],
|
|
92
|
+
|
|
93
|
+
// --
|
|
94
|
+
|
|
95
|
+
'jsx-quotes': [2, 'prefer-double'],
|
|
96
|
+
|
|
97
|
+
'react/button-has-type': 0,
|
|
98
|
+
'react/destructuring-assignment': 0,
|
|
99
|
+
'react/display-name': 0,
|
|
100
|
+
'react/forbid-component-props': 0,
|
|
101
|
+
'react/jsx-boolean-value': 0,
|
|
102
|
+
'react/jsx-filename-extension': 0,
|
|
103
|
+
'react/jsx-first-prop-new-line': [2, 'multiline'],
|
|
104
|
+
'react/jsx-indent-props': [2, 2],
|
|
105
|
+
'react/jsx-indent': 0,
|
|
106
|
+
'react/jsx-max-depth': [2, {max: 5}],
|
|
107
|
+
'react/jsx-max-props-per-line': [2, {maximum: 1, when: 'multiline'}],
|
|
108
|
+
'react/jsx-newline': 0,
|
|
109
|
+
'react/jsx-no-literals': 0,
|
|
110
|
+
'react/jsx-one-expression-per-line': 0,
|
|
111
|
+
'react/jsx-props-no-spreading': 0,
|
|
112
|
+
'react/jsx-sort-props': 0,
|
|
113
|
+
'react/no-arrow-function-lifecycle': 2,
|
|
114
|
+
'react/no-find-dom-node': 0,
|
|
115
|
+
'react/no-multi-comp': [2, {ignoreStateless: true}],
|
|
116
|
+
'react/no-set-state': 0,
|
|
117
|
+
'react/no-unsafe': 2,
|
|
118
|
+
'react/prop-types': 2,
|
|
119
|
+
'react/require-default-props': 0,
|
|
120
|
+
'react/sort-comp': 0,
|
|
121
|
+
'react/jsx-handler-names': [
|
|
122
|
+
2,
|
|
123
|
+
{eventHandlerPrefix: '_handle', eventHandlerPropPrefix: 'on'},
|
|
124
|
+
],
|
|
125
|
+
'react/function-component-definition': [
|
|
126
|
+
2,
|
|
127
|
+
{
|
|
128
|
+
namedComponents: 'arrow-function',
|
|
129
|
+
unnamedComponents: 'arrow-function',
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
'react/jsx-no-useless-fragment': 2,
|
|
133
|
+
|
|
134
|
+
// --
|
|
135
|
+
|
|
136
|
+
'react-hooks/exhaustive-deps': 2,
|
|
137
|
+
'react-hooks/rules-of-hooks': 2,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
{
|
|
142
|
+
files: ['src/@types/**/*.js'],
|
|
143
|
+
settings: {jsdoc: {mode: 'typescript', contexts: ['any']}},
|
|
144
|
+
rules: {
|
|
145
|
+
'jsdoc/check-tag-names': [
|
|
146
|
+
2,
|
|
147
|
+
{definedTags: ['category', 'packageDocumentation']},
|
|
148
|
+
],
|
|
149
|
+
'jsdoc/no-restricted-syntax': [
|
|
150
|
+
2,
|
|
151
|
+
{
|
|
152
|
+
contexts: [
|
|
153
|
+
{
|
|
154
|
+
comment:
|
|
155
|
+
// eslint-disable-next-line max-len
|
|
156
|
+
'JsdocBlock:not(:has(JsdocTag[tag=/category|packageDocumentation/]))',
|
|
157
|
+
message: 'Every non-module block requires a @category tag',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
comment: 'JsdocBlock:not(:has(JsdocTag[tag=since]))',
|
|
161
|
+
message: 'Every block requires a @since tag',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
comment:
|
|
165
|
+
'JsdocBlock:has(JsdocTag[tag=since] ~ JsdocTag[tag=since])',
|
|
166
|
+
message: 'Every block must have only one @since tag',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
'jsdoc/require-jsdoc': 2,
|
|
172
|
+
'jsdoc/require-description': 2,
|
|
173
|
+
'jsdoc/require-description-complete-sentence': 2,
|
|
174
|
+
'jsdoc/require-returns-description': 2,
|
|
175
|
+
'jsdoc/no-blank-blocks': 2,
|
|
176
|
+
'jsdoc/require-param-type': 0,
|
|
177
|
+
'jsdoc/require-returns-type': 0,
|
|
178
|
+
'jsdoc/check-param-names': 0,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
{
|
|
183
|
+
files: ['eslint.config.js'],
|
|
184
|
+
extends: [tsLint.configs.disableTypeChecked],
|
|
185
|
+
},
|
|
186
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinywidgets",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinywidgets",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,20 +16,16 @@
|
|
|
16
16
|
],
|
|
17
17
|
"type": "module",
|
|
18
18
|
"scripts": {
|
|
19
|
-
"prePublishPackage": "eslint . && cspell --quiet . && tsc && cp ../README.md ./README.md"
|
|
19
|
+
"prePublishPackage": "prettier --check . && eslint . && cspell --quiet . && tsc && cp ../README.md ./README.md"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@types/react": "^
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"@typescript-eslint/parser": "^8.26.1",
|
|
26
|
-
"cspell": "^8.17.5",
|
|
27
|
-
"eslint": "^8.57.0",
|
|
28
|
-
"eslint-config-prettier": "^10.1.1",
|
|
22
|
+
"@types/react": "^19.0.12",
|
|
23
|
+
"cspell": "^8.18.1",
|
|
24
|
+
"eslint": "^9.23.0",
|
|
29
25
|
"eslint-plugin-react": "^7.37.4",
|
|
30
26
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
31
|
-
"eslint-plugin-react-refresh": "^0.4.19",
|
|
32
27
|
"prettier": "^3.5.3",
|
|
28
|
+
"prettier-plugin-organize-imports": "^4.1.0",
|
|
33
29
|
"typescript": "^5.8.2"
|
|
34
30
|
},
|
|
35
31
|
"exports": {
|
|
@@ -37,10 +33,14 @@
|
|
|
37
33
|
"./css": "./src/index.css.ts"
|
|
38
34
|
},
|
|
39
35
|
"dependencies": {
|
|
36
|
+
"@eslint/js": "^9.23.0",
|
|
40
37
|
"@vanilla-extract/css": "^1.17.1",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"react
|
|
44
|
-
"
|
|
38
|
+
"eslint-plugin-import": "^2.31.0",
|
|
39
|
+
"globals": "^16.0.0",
|
|
40
|
+
"lucide-react": "^0.485.0",
|
|
41
|
+
"react": "^19.1.0",
|
|
42
|
+
"react-dom": "^19.1.0",
|
|
43
|
+
"tinybase": "^6.0.0",
|
|
44
|
+
"typescript-eslint": "^8.28.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/src/common/functions.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {dimensions, dimensionsClass} from '../../css/dimensions.css.ts';
|
|
2
|
-
import {colors} from '../../css/colors.css.ts';
|
|
3
|
-
import {large} from '../../common/functions.tsx';
|
|
4
1
|
import {style} from '@vanilla-extract/css';
|
|
2
|
+
import {large} from '../../common/functions.tsx';
|
|
3
|
+
import {colors} from '../../css/colors.css.ts';
|
|
4
|
+
import {dimensions, dimensionsClass} from '../../css/dimensions.css.ts';
|
|
5
5
|
|
|
6
6
|
export const app = style([dimensionsClass, {color: colors.foreground}]);
|
|
7
7
|
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {Menu, Moon, Sun, SunMoon, X} from 'lucide-react';
|
|
2
2
|
import type {ComponentType, ReactNode} from 'react';
|
|
3
|
+
import * as UiReact from 'tinybase/ui-react/with-schemas';
|
|
4
|
+
import type {OptionalSchemas} from 'tinybase/with-schemas';
|
|
5
|
+
import {classNames, renderComponentOrNode} from '../../common/functions.tsx';
|
|
6
|
+
import {codeDark, codeLight} from '../../css/code.css.ts';
|
|
7
|
+
import {colorsDark, colorsLight} from '../../css/colors.css.ts';
|
|
3
8
|
import {
|
|
4
9
|
LocalStore,
|
|
5
10
|
useDark,
|
|
@@ -7,7 +12,6 @@ import {
|
|
|
7
12
|
useLocalStoreIsReady,
|
|
8
13
|
useToggleDarkChoiceCallback,
|
|
9
14
|
} from '../../stores/LocalStore.tsx';
|
|
10
|
-
import {Menu, Moon, Sun, SunMoon, X} from 'lucide-react';
|
|
11
15
|
import {RouteStore, useRouteStoreIsReady} from '../../stores/RouteStore.tsx';
|
|
12
16
|
import {
|
|
13
17
|
SessionStore,
|
|
@@ -15,6 +19,7 @@ import {
|
|
|
15
19
|
useSideNavIsOpen,
|
|
16
20
|
useToggleSideNavIsOpenCallback,
|
|
17
21
|
} from '../../stores/SessionStore.tsx';
|
|
22
|
+
import {Button} from '../Button/index.tsx';
|
|
18
23
|
import {
|
|
19
24
|
app,
|
|
20
25
|
appLayout,
|
|
@@ -27,12 +32,6 @@ import {
|
|
|
27
32
|
title,
|
|
28
33
|
topNav,
|
|
29
34
|
} from './index.css.ts';
|
|
30
|
-
import {classNames, renderComponentOrNode} from '../../common/functions.tsx';
|
|
31
|
-
import {codeDark, codeLight} from '../../css/code.css.ts';
|
|
32
|
-
import {colorsDark, colorsLight} from '../../css/colors.css.ts';
|
|
33
|
-
import {Button} from '../Button/index.tsx';
|
|
34
|
-
import {OptionalSchemas} from 'tinybase/with-schemas';
|
|
35
|
-
import React from 'react';
|
|
36
35
|
|
|
37
36
|
const {Provider} = UiReact as UiReact.WithSchemas<OptionalSchemas>;
|
|
38
37
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type {ComponentType, ReactNode, Ref} from 'react';
|
|
2
|
-
import
|
|
2
|
+
import {forwardRef, useCallback} from 'react';
|
|
3
|
+
import {classNames, renderComponentOrNode} from '../../common/functions.tsx';
|
|
4
|
+
import {iconSize} from '../../css/dimensions.css.ts';
|
|
3
5
|
import {
|
|
4
6
|
button,
|
|
5
7
|
buttonVariants,
|
|
@@ -7,8 +9,6 @@ import {
|
|
|
7
9
|
titleStyle,
|
|
8
10
|
titleStyleRight,
|
|
9
11
|
} from './index.css.ts';
|
|
10
|
-
import {classNames, renderComponentOrNode} from '../../common/functions.tsx';
|
|
11
|
-
import {iconSize} from '../../css/dimensions.css.ts';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* The `Button` component displays an button, with a number of common variants.
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
import React from 'react';
|
|
3
1
|
import {classNames} from '../../common/functions.tsx';
|
|
4
2
|
import {pre} from './index.css.ts';
|
|
5
3
|
|
|
@@ -85,7 +83,6 @@ export const Code = ({
|
|
|
85
83
|
return (
|
|
86
84
|
<pre className={classNames(pre, className)}>
|
|
87
85
|
<code
|
|
88
|
-
// eslint-disable-next-line react/no-danger
|
|
89
86
|
dangerouslySetInnerHTML={{
|
|
90
87
|
__html: (prism
|
|
91
88
|
? prism.highlight(code, prism.languages?.[language], language)
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import {ChevronDown, ChevronRight} from 'lucide-react';
|
|
2
2
|
import type {ComponentType, ReactNode} from 'react';
|
|
3
|
-
import
|
|
3
|
+
import {useCallback, useRef, useState} from 'react';
|
|
4
|
+
import {classNames} from '../../common/functions.tsx';
|
|
5
|
+
import {
|
|
6
|
+
useCollapsibleIsOpen,
|
|
7
|
+
useSetCollapsibleIsOpenCallback,
|
|
8
|
+
} from '../../stores/SessionStore.tsx';
|
|
9
|
+
import {Button} from '../Button/index.tsx';
|
|
4
10
|
import {
|
|
5
11
|
button,
|
|
6
12
|
buttonOpen,
|
|
@@ -8,12 +14,6 @@ import {
|
|
|
8
14
|
collapsibleOpen,
|
|
9
15
|
content,
|
|
10
16
|
} from './index.css.ts';
|
|
11
|
-
import {
|
|
12
|
-
useCollapsibleIsOpen,
|
|
13
|
-
useSetCollapsibleIsOpenCallback,
|
|
14
|
-
} from '../../stores/SessionStore.tsx';
|
|
15
|
-
import {Button} from '../Button/index.tsx';
|
|
16
|
-
import {classNames} from '../../common/functions.tsx';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The `Collapsible` component displays a titled box that can be expanded or
|
|
@@ -105,7 +105,7 @@ export const Collapsible = ({
|
|
|
105
105
|
const setIsOpen = id ? setStoredIsOpen : setStateIsOpen;
|
|
106
106
|
|
|
107
107
|
const [render, setRender] = useState(isOpen);
|
|
108
|
-
const timer = useRef<ReturnType<typeof setTimeout
|
|
108
|
+
const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
|
|
109
109
|
|
|
110
110
|
const toggle = useCallback(() => {
|
|
111
111
|
setIsOpen(!isOpen);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {detailCell, detailRow, detailTable} from './index.css';
|
|
2
|
-
import React from 'react';
|
|
3
1
|
import type {ReactNode} from 'react';
|
|
4
2
|
import {classNames} from '../../common/functions';
|
|
3
|
+
import {detailCell, detailRow, detailTable} from './index.css';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* The `Detail` component displays a set of key-value pairs in a two-column
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {classNames} from '../../common/functions';
|
|
3
2
|
import {hr} from './index.css';
|
|
4
3
|
|
|
@@ -21,6 +20,4 @@ export const Hr = ({
|
|
|
21
20
|
* An extra CSS class name for the component.
|
|
22
21
|
*/
|
|
23
22
|
readonly className?: string;
|
|
24
|
-
}) => {
|
|
25
|
-
return <hr className={classNames(hr, className)} />;
|
|
26
|
-
};
|
|
23
|
+
}) => <hr className={classNames(hr, className)} />;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {clickable, image, imageVariants} from './index.css.ts';
|
|
1
|
+
import {useCallback} from 'react';
|
|
3
2
|
import {classNames} from '../../common/functions.tsx';
|
|
3
|
+
import {clickable, image, imageVariants} from './index.css.ts';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The `Image` component displays an image, with a number of common variants.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type {ComponentType, ReactNode} from 'react';
|
|
2
2
|
import {classNames, renderComponentOrNode} from '../../common/functions';
|
|
3
|
-
import {metric, metricLabel, metricNumber} from './index.css';
|
|
4
|
-
import React from 'react';
|
|
5
3
|
import {iconSize} from '../../css/dimensions.css';
|
|
4
|
+
import {metric, metricLabel, metricNumber} from './index.css';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* The `Metric` component displays a metric as a prominent numerical value with
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {style, styleVariants} from '@vanilla-extract/css';
|
|
2
|
-
import {dimensions} from '../../css/dimensions.css.ts';
|
|
3
2
|
import {notLarge} from '../../common/functions.tsx';
|
|
3
|
+
import {dimensions} from '../../css/dimensions.css.ts';
|
|
4
4
|
|
|
5
5
|
export const row = style({
|
|
6
6
|
display: 'grid',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {row, rowVariants} from './index.css';
|
|
2
|
-
import React from 'react';
|
|
3
1
|
import type {ReactNode} from 'react';
|
|
4
2
|
import {classNames} from '../../common/functions';
|
|
3
|
+
import {row, rowVariants} from './index.css';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* The `Row` component displays a row of 'cell' components, with a number of
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {dimensions} from '../../css/dimensions.css.ts';
|
|
2
|
-
import {notLarge} from '../../common/functions.tsx';
|
|
3
1
|
import {style} from '@vanilla-extract/css';
|
|
2
|
+
import {notLarge} from '../../common/functions.tsx';
|
|
3
|
+
import {dimensions} from '../../css/dimensions.css.ts';
|
|
4
4
|
|
|
5
5
|
export const summary = style({
|
|
6
6
|
display: 'grid',
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type {ComponentType, ReactNode} from 'react';
|
|
2
|
-
import {image, summary} from './index.css';
|
|
3
|
-
import {Image} from '../Image';
|
|
4
|
-
import React from 'react';
|
|
5
2
|
import {classNames} from '../../common/functions';
|
|
3
|
+
import {Image} from '../Image';
|
|
4
|
+
import {image, summary} from './index.css';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* The `Summary` component displays an image on the left, and other content
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type {ComponentType, ReactNode} from 'react';
|
|
2
2
|
import {classNames, renderComponentOrNode} from '../../common/functions';
|
|
3
3
|
import {tag, tagIcon, tagVariants} from './index.css';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* The `Tag` component displays a small rectangular tag, suitable for minimal
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import * as UiReact from 'tinybase/ui-react/with-schemas';
|
|
2
1
|
import {
|
|
3
|
-
Id,
|
|
4
|
-
Store as StoreWithSchemas,
|
|
5
|
-
createStore,
|
|
6
|
-
} from 'tinybase/with-schemas';
|
|
7
|
-
import React, {
|
|
8
2
|
ReactNode,
|
|
9
3
|
createContext,
|
|
10
4
|
useCallback,
|
|
@@ -12,14 +6,17 @@ import React, {
|
|
|
12
6
|
useEffect,
|
|
13
7
|
useRef,
|
|
14
8
|
} from 'react';
|
|
9
|
+
import type {Store} from 'tinybase';
|
|
10
|
+
import {createLocalPersister} from 'tinybase/persisters/persister-browser/with-schemas';
|
|
11
|
+
import type {Persister} from 'tinybase/persisters/with-schemas';
|
|
15
12
|
import {
|
|
16
13
|
Provider as UiReactProvider,
|
|
17
14
|
useStore,
|
|
18
15
|
useStores,
|
|
19
16
|
} from 'tinybase/ui-react';
|
|
20
|
-
import
|
|
21
|
-
import {Store} from 'tinybase';
|
|
22
|
-
import {
|
|
17
|
+
import * as UiReact from 'tinybase/ui-react/with-schemas';
|
|
18
|
+
import type {Id, Store as StoreWithSchemas} from 'tinybase/with-schemas';
|
|
19
|
+
import {createStore} from 'tinybase/with-schemas';
|
|
23
20
|
|
|
24
21
|
export type Task =
|
|
25
22
|
| ((
|
|
@@ -261,7 +258,7 @@ export const TasksProvider = ({
|
|
|
261
258
|
const pendingAddedJobs = useRef<
|
|
262
259
|
[taskId: string, arg?: string, storeId?: string][]
|
|
263
260
|
>([]);
|
|
264
|
-
const activePersister = useRef<Persister<Schemas> | undefined>();
|
|
261
|
+
const activePersister = useRef<Persister<Schemas> | undefined>(undefined);
|
|
265
262
|
|
|
266
263
|
const tasksStore = useCreateStore(() =>
|
|
267
264
|
createStore().setSchema(TABLES_SCHEMA, VALUES_SCHEMA),
|
package/src/css/code.css.ts
CHANGED
package/src/index.css.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -15,8 +15,8 @@ export {
|
|
|
15
15
|
useScheduleTask,
|
|
16
16
|
} from './components/TasksProvider/index.tsx';
|
|
17
17
|
|
|
18
|
-
export {useRoute, useSetRouteCallback} from './stores/RouteStore.tsx';
|
|
19
|
-
export {useDark} from './stores/LocalStore.tsx';
|
|
20
18
|
export {classNames} from './common/functions.tsx';
|
|
19
|
+
export {useDark} from './stores/LocalStore.tsx';
|
|
20
|
+
export {useRoute, useSetRouteCallback} from './stores/RouteStore.tsx';
|
|
21
21
|
|
|
22
22
|
export type {ScheduleTask} from './components/TasksProvider/index.tsx';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as UiReact from 'tinybase/ui-react/with-schemas';
|
|
2
|
-
import {CHANGE, READY, READY_SCHEMA} from './common';
|
|
3
|
-
import {type NoTablesSchema, createStore} from 'tinybase/with-schemas';
|
|
4
1
|
import {useCallback, useEffect} from 'react';
|
|
5
2
|
import {createLocalPersister} from 'tinybase/persisters/persister-browser/with-schemas';
|
|
3
|
+
import * as UiReact from 'tinybase/ui-react/with-schemas';
|
|
4
|
+
import {type NoTablesSchema, createStore} from 'tinybase/with-schemas';
|
|
5
|
+
import {CHANGE, READY, READY_SCHEMA} from './common';
|
|
6
6
|
|
|
7
7
|
const PREFERS_DARK = matchMedia?.('(prefers-color-scheme: dark)');
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import {createCustomPersister} from 'tinybase/persisters/with-schemas';
|
|
1
2
|
import * as UiReact from 'tinybase/ui-react/with-schemas';
|
|
2
3
|
import {type NoTablesSchema, createStore} from 'tinybase/with-schemas';
|
|
3
4
|
import {READY, READY_SCHEMA} from './common';
|
|
4
|
-
import {createCustomPersister} from 'tinybase/persisters/with-schemas';
|
|
5
5
|
|
|
6
6
|
const ROUTE_STORE = 'tinywidgets/Route';
|
|
7
7
|
const ROUTE = 'route';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as UiReact from 'tinybase/ui-react/with-schemas';
|
|
2
|
-
import {READY, READY_SCHEMA} from './common';
|
|
3
1
|
import {createSessionPersister} from 'tinybase/persisters/persister-browser/with-schemas';
|
|
2
|
+
import * as UiReact from 'tinybase/ui-react/with-schemas';
|
|
4
3
|
import {createStore} from 'tinybase/with-schemas';
|
|
4
|
+
import {READY, READY_SCHEMA} from './common';
|
|
5
5
|
|
|
6
6
|
const SESSION_STORE = 'tinywidgets/Session';
|
|
7
7
|
const COLLAPSIBLE = 'collapsible';
|
package/tsconfig.json
CHANGED
package/.eslintrc.json
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"parser": "@typescript-eslint/parser",
|
|
3
|
-
"plugins": ["@typescript-eslint", "react", "react-hooks", "react-refresh"],
|
|
4
|
-
"extends": [
|
|
5
|
-
"eslint:recommended",
|
|
6
|
-
"plugin:react/all",
|
|
7
|
-
"plugin:react-hooks/recommended",
|
|
8
|
-
"plugin:@typescript-eslint/eslint-recommended",
|
|
9
|
-
"plugin:@typescript-eslint/recommended",
|
|
10
|
-
"prettier"
|
|
11
|
-
],
|
|
12
|
-
"env": {"browser": true, "es6": true, "node": true},
|
|
13
|
-
"globals": {"page": true, "browser": true, "context": true},
|
|
14
|
-
"parserOptions": {
|
|
15
|
-
"ecmaVersion": 7,
|
|
16
|
-
"ecmaFeatures": {
|
|
17
|
-
"experimentalObjectRestSpread": true,
|
|
18
|
-
"globalReturn": true,
|
|
19
|
-
"jsx": true
|
|
20
|
-
},
|
|
21
|
-
"sourceType": "module"
|
|
22
|
-
},
|
|
23
|
-
"settings": {"react": {"version": "18.3.0"}},
|
|
24
|
-
"rules": {
|
|
25
|
-
"@typescript-eslint/no-explicit-any": 0,
|
|
26
|
-
"@typescript-eslint/no-var-requires": 0,
|
|
27
|
-
"@typescript-eslint/no-unused-vars": [
|
|
28
|
-
2,
|
|
29
|
-
{"argsIgnorePattern": "^_.*", "varsIgnorePattern": "^_.*"}
|
|
30
|
-
],
|
|
31
|
-
"max-len": [2, {"code": 80, "ignorePattern": "^(im|ex)ports?\\W.*"}],
|
|
32
|
-
"no-var": 2,
|
|
33
|
-
"no-console": 2,
|
|
34
|
-
"object-curly-spacing": [2, "never"],
|
|
35
|
-
"comma-dangle": [
|
|
36
|
-
2,
|
|
37
|
-
{
|
|
38
|
-
"arrays": "always-multiline",
|
|
39
|
-
"objects": "always-multiline",
|
|
40
|
-
"imports": "always-multiline",
|
|
41
|
-
"exports": "always-multiline",
|
|
42
|
-
"functions": "always-multiline"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"indent": 0,
|
|
46
|
-
"no-empty": [2, {"allowEmptyCatch": true}],
|
|
47
|
-
"linebreak-style": [2, "unix"],
|
|
48
|
-
"space-infix-ops": 2,
|
|
49
|
-
"quotes": [2, "single", {"allowTemplateLiterals": true}],
|
|
50
|
-
"semi": [2, "always"],
|
|
51
|
-
"sort-keys": 0,
|
|
52
|
-
"sort-imports": 2,
|
|
53
|
-
"no-multiple-empty-lines": [2, {"max": 1}],
|
|
54
|
-
"react/function-component-definition": [
|
|
55
|
-
2,
|
|
56
|
-
{
|
|
57
|
-
"namedComponents": "arrow-function",
|
|
58
|
-
"unnamedComponents": "arrow-function"
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
"react/no-multi-comp": [2, {"ignoreStateless": true}],
|
|
62
|
-
"react/no-find-dom-node": 0,
|
|
63
|
-
"react/no-set-state": 0,
|
|
64
|
-
"react/no-unsafe": 2,
|
|
65
|
-
"jsx-quotes": [2, "prefer-double"],
|
|
66
|
-
"react-hooks/exhaustive-deps": 2,
|
|
67
|
-
"react-hooks/rules-of-hooks": 2,
|
|
68
|
-
"react/destructuring-assignment": 0,
|
|
69
|
-
"react/display-name": 0,
|
|
70
|
-
"react/jsx-boolean-value": 0,
|
|
71
|
-
"react/jsx-filename-extension": 0,
|
|
72
|
-
"react/jsx-first-prop-new-line": [2, "multiline"],
|
|
73
|
-
"react/jsx-handler-names": [
|
|
74
|
-
2,
|
|
75
|
-
{"eventHandlerPrefix": "_handle", "eventHandlerPropPrefix": "on"}
|
|
76
|
-
],
|
|
77
|
-
"react/jsx-indent": 0,
|
|
78
|
-
"react/jsx-indent-props": [2, 2],
|
|
79
|
-
"react/jsx-max-depth": [2, {"max": 5}],
|
|
80
|
-
"react/jsx-max-props-per-line": [2, {"maximum": 1, "when": "multiline"}],
|
|
81
|
-
"react/jsx-newline": 0,
|
|
82
|
-
"react/jsx-no-literals": 0,
|
|
83
|
-
"react/jsx-one-expression-per-line": 0,
|
|
84
|
-
"react/jsx-props-no-spreading": 0,
|
|
85
|
-
"react/jsx-sort-props": 0,
|
|
86
|
-
"react/require-default-props": 0,
|
|
87
|
-
"react/sort-comp": 0,
|
|
88
|
-
"react/forbid-component-props": 0,
|
|
89
|
-
"react/button-has-type": 0,
|
|
90
|
-
"react/no-array-index-key": 0
|
|
91
|
-
}
|
|
92
|
-
}
|