@vev/silke 1.0.15 → 1.0.16
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/CHANGELOG.md +8 -0
- package/dist/{chunk-KMZFUBRE.js → chunk-LAB2YEXC.js} +4 -4
- package/dist/chunk-LAB2YEXC.js.LEGAL.txt +11 -0
- package/dist/{chunk-KMZFUBRE.js.map → chunk-LAB2YEXC.js.map} +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.LEGAL.txt +49 -21
- package/dist/index.js.map +4 -4
- package/dist/silke-code-editor-WEBZ7JXL.js +25 -0
- package/dist/silke-code-editor-WEBZ7JXL.js.LEGAL.txt +0 -0
- package/dist/silke-code-editor-WEBZ7JXL.js.map +7 -0
- package/dist/styles.css +80 -83
- package/esbuild.config.mjs +47 -43
- package/jest.config.js +1 -2
- package/package.json +3 -3
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.spec.tsx +0 -2
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +6 -4
- package/src/components/silke-form-schema/fields/array-field-inline.tsx +1 -1
- package/src/components/silke-form-schema/fields/array-field-modal.tsx +1 -1
- package/src/components/silke-form-schema/fields/array-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/event-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/icon-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/image-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/layout-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/link-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/number-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/object-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/select-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/string-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/toggle-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/upload-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/utils/generate-image.ts +1 -1
- package/src/components/silke-form-schema/fields/utils/generate-title.ts +1 -1
- package/src/components/silke-form-schema/schema-utils.ts +1 -1
- package/src/components/silke-form-schema/silke-form-schema.tsx +1 -1
- package/src/components/silke-form-schema/silke-schema-context.tsx +1 -1
- package/src/components/silke-form-schema/silke-schema-field.tsx +1 -1
- package/src/components/silke-form-schema/silke-schema-fields.tsx +1 -1
- package/src/components/silke-select-field/silke-select-field.spec.tsx +1 -2
- package/src/components/silke-tag/silke-tag.tsx +2 -2
- package/src/hooks/use-drop-zone.ts +0 -3
- package/src/icons.tsx +2 -0
- package/tsconfig.json +1 -1
- package/webpack.docs.ts +1 -1
- package/dist/chunk-KMZFUBRE.js.LEGAL.txt +0 -8
- package/dist/silke-code-editor-UX2ML2WG.js +0 -23
- package/dist/silke-code-editor-UX2ML2WG.js.map +0 -7
package/dist/styles.css
CHANGED
|
@@ -1312,8 +1312,7 @@ div[data-shadow=level4] {
|
|
|
1312
1312
|
align-items: start;
|
|
1313
1313
|
outline: none;
|
|
1314
1314
|
border: none;
|
|
1315
|
-
|
|
1316
|
-
backface-visibility: hidden;
|
|
1315
|
+
backface-visibility: hidden;
|
|
1317
1316
|
}
|
|
1318
1317
|
|
|
1319
1318
|
.silke-nested-sortable-list_selected_f167a380fd {
|
|
@@ -2228,6 +2227,83 @@ body {
|
|
|
2228
2227
|
* Get font size base on base font size
|
|
2229
2228
|
* scaling = round(size * 1.200) (Minor Third)
|
|
2230
2229
|
*/
|
|
2230
|
+
body {
|
|
2231
|
+
--tile-background: var(--color-neutral-5);
|
|
2232
|
+
--tile-background-hover: rgba(var(--color-neutral-5-rgb), 0.32);
|
|
2233
|
+
--tile-background-active: rgba(var(--color-neutral-5-rgb), 0.08);
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
.silke-tile_tile_47b57b749d {
|
|
2237
|
+
position: relative;
|
|
2238
|
+
background: var(--tile-background);
|
|
2239
|
+
}
|
|
2240
|
+
.silke-tile_tile_47b57b749d:focus {
|
|
2241
|
+
outline: none;
|
|
2242
|
+
}
|
|
2243
|
+
.silke-tile_tile_47b57b749d:focus-visible, .silke-tile_tile_47b57b749d.silke-tile_selected_47b57b749d {
|
|
2244
|
+
box-shadow: 0 0 0 1px var(--color-neutral-100);
|
|
2245
|
+
border-color: var(--color-neutral-100);
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
.silke-tile_clickable_47b57b749d {
|
|
2249
|
+
cursor: pointer;
|
|
2250
|
+
transition: background ease-in-out 100ms;
|
|
2251
|
+
}
|
|
2252
|
+
.silke-tile_clickable_47b57b749d:hover {
|
|
2253
|
+
background-color: var(--tile-background-hover);
|
|
2254
|
+
}
|
|
2255
|
+
.silke-tile_clickable_47b57b749d:active {
|
|
2256
|
+
background: var(--tile-background-active);
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
.silke-tile_icon_47b57b749d {
|
|
2260
|
+
font-size: 16px;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
.silke-tile_tags_47b57b749d {
|
|
2264
|
+
position: absolute;
|
|
2265
|
+
top: 0;
|
|
2266
|
+
right: 0;
|
|
2267
|
+
}
|
|
2268
|
+
.silke-tile_tags_47b57b749d > *:not(:last-child) {
|
|
2269
|
+
margin-right: 8px;
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
.silke-tile_tiny_47b57b749d {
|
|
2273
|
+
max-width: 256px;
|
|
2274
|
+
width: 100%;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
.silke-tile_small_47b57b749d {
|
|
2278
|
+
max-width: 512px;
|
|
2279
|
+
width: 100%;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
.silke-tile_medium_47b57b749d {
|
|
2283
|
+
max-width: 768px;
|
|
2284
|
+
width: 100%;
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
.silke-tile_large_47b57b749d {
|
|
2288
|
+
max-width: 1024px;
|
|
2289
|
+
width: 100%;
|
|
2290
|
+
}
|
|
2291
|
+
/**********************
|
|
2292
|
+
* SOME MATH
|
|
2293
|
+
************************/
|
|
2294
|
+
/**********************
|
|
2295
|
+
* FONT
|
|
2296
|
+
************************/
|
|
2297
|
+
/**********************
|
|
2298
|
+
* SPACING
|
|
2299
|
+
************************/
|
|
2300
|
+
/**********************
|
|
2301
|
+
* SIZES
|
|
2302
|
+
************************/
|
|
2303
|
+
/**
|
|
2304
|
+
* Get font size base on base font size
|
|
2305
|
+
* scaling = round(size * 1.200) (Minor Third)
|
|
2306
|
+
*/
|
|
2231
2307
|
.silke-table_toolbar_b5946502de {
|
|
2232
2308
|
border-radius: var(--border-radius-medium);
|
|
2233
2309
|
border-bottom-left-radius: var(--border-radius-tiny);
|
|
@@ -2307,83 +2383,6 @@ body {
|
|
|
2307
2383
|
* Get font size base on base font size
|
|
2308
2384
|
* scaling = round(size * 1.200) (Minor Third)
|
|
2309
2385
|
*/
|
|
2310
|
-
body {
|
|
2311
|
-
--tile-background: var(--color-neutral-5);
|
|
2312
|
-
--tile-background-hover: rgba(var(--color-neutral-5-rgb), 0.32);
|
|
2313
|
-
--tile-background-active: rgba(var(--color-neutral-5-rgb), 0.08);
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
|
-
.silke-tile_tile_47b57b749d {
|
|
2317
|
-
position: relative;
|
|
2318
|
-
background: var(--tile-background);
|
|
2319
|
-
}
|
|
2320
|
-
.silke-tile_tile_47b57b749d:focus {
|
|
2321
|
-
outline: none;
|
|
2322
|
-
}
|
|
2323
|
-
.silke-tile_tile_47b57b749d:focus-visible, .silke-tile_tile_47b57b749d.silke-tile_selected_47b57b749d {
|
|
2324
|
-
box-shadow: 0 0 0 1px var(--color-neutral-100);
|
|
2325
|
-
border-color: var(--color-neutral-100);
|
|
2326
|
-
}
|
|
2327
|
-
|
|
2328
|
-
.silke-tile_clickable_47b57b749d {
|
|
2329
|
-
cursor: pointer;
|
|
2330
|
-
transition: background ease-in-out 100ms;
|
|
2331
|
-
}
|
|
2332
|
-
.silke-tile_clickable_47b57b749d:hover {
|
|
2333
|
-
background-color: var(--tile-background-hover);
|
|
2334
|
-
}
|
|
2335
|
-
.silke-tile_clickable_47b57b749d:active {
|
|
2336
|
-
background: var(--tile-background-active);
|
|
2337
|
-
}
|
|
2338
|
-
|
|
2339
|
-
.silke-tile_icon_47b57b749d {
|
|
2340
|
-
font-size: 16px;
|
|
2341
|
-
}
|
|
2342
|
-
|
|
2343
|
-
.silke-tile_tags_47b57b749d {
|
|
2344
|
-
position: absolute;
|
|
2345
|
-
top: 0;
|
|
2346
|
-
right: 0;
|
|
2347
|
-
}
|
|
2348
|
-
.silke-tile_tags_47b57b749d > *:not(:last-child) {
|
|
2349
|
-
margin-right: 8px;
|
|
2350
|
-
}
|
|
2351
|
-
|
|
2352
|
-
.silke-tile_tiny_47b57b749d {
|
|
2353
|
-
max-width: 256px;
|
|
2354
|
-
width: 100%;
|
|
2355
|
-
}
|
|
2356
|
-
|
|
2357
|
-
.silke-tile_small_47b57b749d {
|
|
2358
|
-
max-width: 512px;
|
|
2359
|
-
width: 100%;
|
|
2360
|
-
}
|
|
2361
|
-
|
|
2362
|
-
.silke-tile_medium_47b57b749d {
|
|
2363
|
-
max-width: 768px;
|
|
2364
|
-
width: 100%;
|
|
2365
|
-
}
|
|
2366
|
-
|
|
2367
|
-
.silke-tile_large_47b57b749d {
|
|
2368
|
-
max-width: 1024px;
|
|
2369
|
-
width: 100%;
|
|
2370
|
-
}
|
|
2371
|
-
/**********************
|
|
2372
|
-
* SOME MATH
|
|
2373
|
-
************************/
|
|
2374
|
-
/**********************
|
|
2375
|
-
* FONT
|
|
2376
|
-
************************/
|
|
2377
|
-
/**********************
|
|
2378
|
-
* SPACING
|
|
2379
|
-
************************/
|
|
2380
|
-
/**********************
|
|
2381
|
-
* SIZES
|
|
2382
|
-
************************/
|
|
2383
|
-
/**
|
|
2384
|
-
* Get font size base on base font size
|
|
2385
|
-
* scaling = round(size * 1.200) (Minor Third)
|
|
2386
|
-
*/
|
|
2387
2386
|
.silke-toggle_container_5fdf33c914 {
|
|
2388
2387
|
position: relative;
|
|
2389
2388
|
cursor: pointer;
|
|
@@ -3592,8 +3591,7 @@ body {
|
|
|
3592
3591
|
position: relative;
|
|
3593
3592
|
display: flex;
|
|
3594
3593
|
flex-direction: column;
|
|
3595
|
-
|
|
3596
|
-
backface-visibility: hidden;
|
|
3594
|
+
backface-visibility: hidden;
|
|
3597
3595
|
}
|
|
3598
3596
|
.silke-card_card_651958c137:focus-visible::before {
|
|
3599
3597
|
border: 2px solid var(--color-neutral-0);
|
|
@@ -3791,8 +3789,7 @@ body {
|
|
|
3791
3789
|
white-space: nowrap;
|
|
3792
3790
|
min-width: -moz-fit-content;
|
|
3793
3791
|
min-width: fit-content;
|
|
3794
|
-
|
|
3795
|
-
backface-visibility: hidden;
|
|
3792
|
+
backface-visibility: hidden;
|
|
3796
3793
|
background: var(--silke-button-background);
|
|
3797
3794
|
color: var(--silke-button-color);
|
|
3798
3795
|
border: var(--silke-button-border);
|
package/esbuild.config.mjs
CHANGED
|
@@ -30,50 +30,54 @@ const cli = meow(
|
|
|
30
30
|
const watch = cli.flags.watch || cli.flags.serve || false;
|
|
31
31
|
buildSilke(watch);
|
|
32
32
|
|
|
33
|
-
function buildSilke(watch) {
|
|
33
|
+
async function buildSilke(watch) {
|
|
34
34
|
console.log(`🚧 @vev/silke building`);
|
|
35
35
|
const time = Date.now();
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
});
|
|
68
|
-
},
|
|
36
|
+
|
|
37
|
+
const config = {
|
|
38
|
+
entryPoints: [path.resolve(__dirname, './src/index.ts')],
|
|
39
|
+
outdir: path.resolve(__dirname, './dist'),
|
|
40
|
+
bundle: true,
|
|
41
|
+
minify: true,
|
|
42
|
+
sourcemap: true,
|
|
43
|
+
splitting: true,
|
|
44
|
+
format: 'esm',
|
|
45
|
+
legalComments: 'linked',
|
|
46
|
+
target: ['es2020'],
|
|
47
|
+
external: Object.keys(pkg.peerDependencies || {}),
|
|
48
|
+
allowOverwrite: true,
|
|
49
|
+
plugins: [
|
|
50
|
+
{
|
|
51
|
+
name: 'raw',
|
|
52
|
+
setup(build) {
|
|
53
|
+
build.onResolve({ filter: /\.raw\..+$/i }, (args) => {
|
|
54
|
+
return {
|
|
55
|
+
path: path.isAbsolute(args.path)
|
|
56
|
+
? args.path
|
|
57
|
+
: path.join(args.resolveDir, args.path),
|
|
58
|
+
namespace: 'raw-loader',
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
build.onLoad({ filter: /\.raw\..+$/i, namespace: 'raw-loader' }, async (args) => {
|
|
62
|
+
return {
|
|
63
|
+
contents: await fs.promises.readFile(args.path.replace(/\?raw$/, '')),
|
|
64
|
+
loader: 'text',
|
|
65
|
+
};
|
|
66
|
+
});
|
|
69
67
|
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
},
|
|
69
|
+
esbuildSassModulesPlugin(),
|
|
70
|
+
],
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (watch) {
|
|
74
|
+
// don't minify
|
|
75
|
+
const context = await esbuild.context({ ...config, minify: false });
|
|
76
|
+
|
|
77
|
+
await context.watch();
|
|
78
|
+
} else {
|
|
79
|
+
await esbuild.build(config);
|
|
80
|
+
|
|
81
|
+
console.log(`✅ @vev/silke done building, used ${Date.now() - time}ms`);
|
|
82
|
+
}
|
|
79
83
|
}
|
package/jest.config.js
CHANGED
|
@@ -6,12 +6,11 @@ const packageName = package.name.split('@vev/').pop();
|
|
|
6
6
|
|
|
7
7
|
module.exports = {
|
|
8
8
|
...base,
|
|
9
|
-
name: packageName,
|
|
10
9
|
displayName: packageName,
|
|
11
10
|
rootDir: '../..',
|
|
12
11
|
roots: [`<rootDir>/packages/${packageName}`],
|
|
13
12
|
testRegex: `(packages/${packageName}/.*/__tests__/.*|\\.(spec|test))\\.tsx?$`,
|
|
14
|
-
|
|
13
|
+
testEnvironmentOptions: { url: 'http://localhost/', },
|
|
15
14
|
moduleDirectories: ['node_modules', 'src'],
|
|
16
15
|
testEnvironment: 'jsdom',
|
|
17
16
|
setupFiles: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vev/silke",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@mdx-js/mdx": "^2.0.0-next.9",
|
|
31
31
|
"@mdx-js/react": "^2.1.2",
|
|
32
32
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
|
33
|
-
"@vev/react": "0.0
|
|
34
|
-
"@vev/utils": "1.0
|
|
33
|
+
"@vev/react": "0.1.0",
|
|
34
|
+
"@vev/utils": "1.1.0",
|
|
35
35
|
"@uiw/react-codemirror": "^4.12.3",
|
|
36
36
|
"@uiw/codemirror-theme-dracula": "^4.12.3",
|
|
37
37
|
"classnames": ">=2.2.0",
|
|
@@ -4,7 +4,6 @@ import { SilkeAutocompleteField, useMatchingItemsOnTop } from './silke-autocompl
|
|
|
4
4
|
import { ARROW_DOWN, ENTER, ESCAPE } from '../../../jest/keys';
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
6
|
import { renderHook } from '@testing-library/react-hooks';
|
|
7
|
-
import { getSearchReg } from '@vev/utils';
|
|
8
7
|
|
|
9
8
|
type Item = {
|
|
10
9
|
label: string;
|
|
@@ -161,7 +160,6 @@ describe('silke-autocomplete-field', () => {
|
|
|
161
160
|
await user.click(bearItem);
|
|
162
161
|
|
|
163
162
|
expect(onChange).toHaveBeenCalledWith('bear');
|
|
164
|
-
expect(input).toHaveFocus();
|
|
165
163
|
});
|
|
166
164
|
|
|
167
165
|
it('Is possible to select item by using keyboard only', async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getSearchReg } from '@vev/utils';
|
|
1
|
+
import { getSearchReg, Mouse } from '@vev/utils';
|
|
2
2
|
import { isEqual, isUndefined } from 'lodash';
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import { useFormField, useInterval, useParentScroll, useWindowResize } from '../../hooks';
|
|
@@ -456,9 +456,8 @@ export function SilkeAutocompleteField<T>(props: SilkeAutocompleteFieldProps<T>)
|
|
|
456
456
|
}}
|
|
457
457
|
onBlur={(e) => {
|
|
458
458
|
const inside = dropdownRef?.current?.contains(e?.relatedTarget as Node);
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}
|
|
459
|
+
|
|
460
|
+
if (!inside) setOpen(false);
|
|
462
461
|
}}
|
|
463
462
|
placeholder={isEmptyForm ? placeholder : ''}
|
|
464
463
|
value={searchText}
|
|
@@ -501,6 +500,9 @@ export function SilkeAutocompleteField<T>(props: SilkeAutocompleteFieldProps<T>)
|
|
|
501
500
|
|
|
502
501
|
{open && (
|
|
503
502
|
<SilkePopover
|
|
503
|
+
onRequestClose={(e) => {
|
|
504
|
+
if (e && inputRef.current && !Mouse.isInside(e, inputRef.current)) setOpen(false);
|
|
505
|
+
}}
|
|
504
506
|
hide={!open}
|
|
505
507
|
anchor={containerRef}
|
|
506
508
|
anchorOrigin={overridePopoverPlacement?.anchor || anchorOrigin || 'bottom-left'}
|
|
@@ -6,7 +6,7 @@ import { SilkeText } from '../../silke-text';
|
|
|
6
6
|
import { SilkeBox } from '../../silke-box';
|
|
7
7
|
import { SilkeButton } from '../../silke-button';
|
|
8
8
|
import { generateTitle } from './utils';
|
|
9
|
-
import { VevProps } from '@vev/
|
|
9
|
+
import { VevProps } from '@vev/utils';
|
|
10
10
|
|
|
11
11
|
type Props = {
|
|
12
12
|
selected: number;
|
|
@@ -7,7 +7,7 @@ import { SilkeText } from '../../silke-text';
|
|
|
7
7
|
import { SilkeBox } from '../../silke-box';
|
|
8
8
|
import { SilkeButton } from '../../silke-button';
|
|
9
9
|
import { generateTitle } from './utils';
|
|
10
|
-
import { VevProps } from '@vev/
|
|
10
|
+
import { VevProps } from '@vev/utils';
|
|
11
11
|
import styles from './styles.scss';
|
|
12
12
|
|
|
13
13
|
type Props = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayField as ArrayFieldType, SchemaFieldProps, VevProps } from '@vev/
|
|
1
|
+
import { ArrayField as ArrayFieldType, SchemaFieldProps, VevProps } from '@vev/utils';
|
|
2
2
|
import React, { useCallback, useRef, useState } from 'react';
|
|
3
3
|
import { SilkeBox } from '../../silke-box';
|
|
4
4
|
import { SilkeButton } from '../../silke-button';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { EventField as EventFieldType, SchemaFieldProps, VevContentEvent } from '@vev/
|
|
2
|
+
import { EventField as EventFieldType, SchemaFieldProps, VevContentEvent } from '@vev/utils';
|
|
3
3
|
import { SilkeBox } from '../../silke-box';
|
|
4
4
|
import { SilkeTextSmall } from '../../silke-text';
|
|
5
5
|
import { SilkeNotification } from '../../silke-notification';
|
|
@@ -3,7 +3,7 @@ import { SilkeBox } from '../../silke-box';
|
|
|
3
3
|
import { SilkeButton } from '../../silke-button';
|
|
4
4
|
import { SilkeIcon, SilkeIcons } from '../../silke-icon';
|
|
5
5
|
import { SilkeTextSmall } from '../../silke-text';
|
|
6
|
-
import { IconField as IconFieldType, SchemaFieldProps } from '@vev/
|
|
6
|
+
import { IconField as IconFieldType, SchemaFieldProps } from '@vev/utils';
|
|
7
7
|
import { useSchemaContext } from '../silke-schema-context';
|
|
8
8
|
import { EmojiType } from '@vev/utils';
|
|
9
9
|
import { getTitle } from './utils/schema-util';
|
|
@@ -3,7 +3,7 @@ import { SilkeBox } from '../../silke-box';
|
|
|
3
3
|
import { SilkeButton } from '../../silke-button';
|
|
4
4
|
import { SilkeImage } from '../../silke-image';
|
|
5
5
|
import { SilkeTextSmall } from '../../silke-text';
|
|
6
|
-
import { ImageField as ImageFieldType, SchemaFieldProps } from '@vev/
|
|
6
|
+
import { ImageField as ImageFieldType, SchemaFieldProps } from '@vev/utils';
|
|
7
7
|
import { useSchemaContext } from '../silke-schema-context';
|
|
8
8
|
import styles from './styles.scss';
|
|
9
9
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LayoutField as LayoutFieldType, SchemaFieldProps } from '@vev/
|
|
1
|
+
import { LayoutField as LayoutFieldType, SchemaFieldProps } from '@vev/utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SilkeBox } from '../../silke-box';
|
|
4
4
|
import { SilkeSchemaFields } from '../silke-schema-fields';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SchemaFieldProps, LinkField as LinkFieldType } from '@vev/
|
|
1
|
+
import { SchemaFieldProps, LinkField as LinkFieldType } from '@vev/utils';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { SilkeAutocompleteField } from '../../silke-autocomplete-field';
|
|
4
4
|
import { SilkeBox } from '../../silke-box';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NumberField as NumberFieldType, SchemaFieldProps } from '@vev/
|
|
1
|
+
import { NumberField as NumberFieldType, SchemaFieldProps } from '@vev/utils';
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { SilkeCssNumberField } from '../../silke-css-number-field';
|
|
4
4
|
import { SilkeBox } from '../../silke-box';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ObjectField as ObjectFieldType, SchemaFieldProps } from '@vev/
|
|
1
|
+
import { ObjectField as ObjectFieldType, SchemaFieldProps } from '@vev/utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SilkeBox } from '../../silke-box';
|
|
4
4
|
import { SilkeObjectField } from '../../silke-object-field';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SchemaFieldProps, SelectField as SelectFieldType, SelectFieldItem } from '@vev/
|
|
1
|
+
import { SchemaFieldProps, SelectField as SelectFieldType, SelectFieldItem } from '@vev/utils';
|
|
2
2
|
import { isArray, isFunction } from 'lodash';
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
4
|
import { SilkeText, SilkeTextSmall } from '../../silke-text';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SchemaFieldProps, StringField as StringFieldType } from '@vev/
|
|
1
|
+
import { SchemaFieldProps, StringField as StringFieldType } from '@vev/utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SilkeTextField } from '../../silke-text-field';
|
|
4
4
|
import { getTitle } from './utils/schema-util';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SchemaFieldProps, UploadField as UploadFieldType } from '@vev/
|
|
1
|
+
import { SchemaFieldProps, UploadField as UploadFieldType } from '@vev/utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SilkeBox } from '../../silke-box';
|
|
4
4
|
import { SilkeTextSmall } from '../../silke-text';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EvalCallback, Schema, SchemaContextModel } from '@vev/
|
|
1
|
+
import { EvalCallback, Schema, SchemaContextModel } from '@vev/utils';
|
|
2
2
|
import { isFunction } from 'lodash';
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { safeEvalFunction } from './safe-eval';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SchemaFieldComponents, VevProps } from '@vev/
|
|
1
|
+
import { SchemaFieldComponents, VevProps } from '@vev/utils';
|
|
2
2
|
import { isFunction } from 'lodash';
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
4
|
import { SilkeBox, useExtendedFields, useFormField } from '..';
|
|
@@ -3,7 +3,7 @@ import { fireEvent, render, screen } from '@testing-library/react';
|
|
|
3
3
|
import { SilkeSelectField } from './silke-select-field';
|
|
4
4
|
import userEvent from '@testing-library/user-event';
|
|
5
5
|
import { SilkeForm } from '../silke-form';
|
|
6
|
-
import { ARROW_DOWN, ARROW_UP, ENTER
|
|
6
|
+
import { ARROW_DOWN, ARROW_UP, ENTER } from '../../../jest/keys';
|
|
7
7
|
|
|
8
8
|
describe('silke-select-field', () => {
|
|
9
9
|
beforeAll(() => {
|
|
@@ -202,7 +202,6 @@ describe('silke-select-field', () => {
|
|
|
202
202
|
await user.click(option);
|
|
203
203
|
|
|
204
204
|
expect(dropdown).not.toBeInTheDocument();
|
|
205
|
-
expect(input).toHaveFocus();
|
|
206
205
|
});
|
|
207
206
|
|
|
208
207
|
it('Closes dropdown when input looses focus', async () => {
|
|
@@ -19,7 +19,7 @@ export type SilkeTagProps = {
|
|
|
19
19
|
* Will add a remove button to tag
|
|
20
20
|
*/
|
|
21
21
|
onRemove?: (e: React.MouseEvent) => void;
|
|
22
|
-
} & BoxProps
|
|
22
|
+
} & Omit<BoxProps, 'size'>;
|
|
23
23
|
|
|
24
24
|
function SilkeTagComp(
|
|
25
25
|
{
|
|
@@ -43,7 +43,7 @@ function SilkeTagComp(
|
|
|
43
43
|
if (rest?.onClick) cl.push(styles.selectable);
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
|
-
<SilkeBox {...rest} className={cl.join(' ')} hPad="xs" vAlign="center" ref={ref}>
|
|
46
|
+
<SilkeBox {...(rest as BoxProps)} className={cl.join(' ')} hPad="xs" vAlign="center" ref={ref}>
|
|
47
47
|
<SilkeText overflow flex className={styles.label}>
|
|
48
48
|
<SilkeBox gap={innerGap} align="center">
|
|
49
49
|
{icon && <SilkeIcon icon={icon} />}
|
|
@@ -34,21 +34,18 @@ export function useDropZone(
|
|
|
34
34
|
if (eventTarget === e.target) return null;
|
|
35
35
|
eventTarget = e.target;
|
|
36
36
|
|
|
37
|
-
e.stopPropagation();
|
|
38
37
|
e.preventDefault();
|
|
39
38
|
if (enterRef.current) enterRef.current(e);
|
|
40
39
|
};
|
|
41
40
|
const onLeave = (e: DragEvent) => {
|
|
42
41
|
if (leaveRef.current && e.target === eventTarget) {
|
|
43
42
|
eventTarget = null;
|
|
44
|
-
e.stopPropagation();
|
|
45
43
|
e.preventDefault();
|
|
46
44
|
leaveRef.current(e);
|
|
47
45
|
}
|
|
48
46
|
};
|
|
49
47
|
const onDrop = (e: DragEvent) => {
|
|
50
48
|
eventTarget = null;
|
|
51
|
-
e.stopPropagation();
|
|
52
49
|
e.preventDefault();
|
|
53
50
|
if (dropRef.current) dropRef.current(e);
|
|
54
51
|
};
|
package/src/icons.tsx
CHANGED
|
@@ -25,6 +25,7 @@ export const SilkeIconDefinitions = {
|
|
|
25
25
|
menuMore: 'fal fa-ellipsis-v',
|
|
26
26
|
menu: 'fal fa-bars',
|
|
27
27
|
drag: 'fal fa-grip-lines',
|
|
28
|
+
'drag.dots': 'fa-solid fa-grip-dots-vertical',
|
|
28
29
|
remove: 'fal fa-minus',
|
|
29
30
|
'error.circle': 'fal fa-exclamation-circle',
|
|
30
31
|
'warning.triangle': 'fal fa-triangle-exclamation',
|
|
@@ -353,6 +354,7 @@ export const SilkeIconDefinitions = {
|
|
|
353
354
|
'interaction.inactive': 'fa-thin fa-bolt',
|
|
354
355
|
'interaction.click': 'fa-light fa-hand-pointer',
|
|
355
356
|
'interaction.arrow': 'fa-regular fa-arrow-down',
|
|
357
|
+
'interaction.timer': 'fa-light fa-clock',
|
|
356
358
|
};
|
|
357
359
|
|
|
358
360
|
function CustomComponentIcon({ className }: { className?: string }) {
|
package/tsconfig.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../tsconfig.json",
|
|
3
|
-
"exclude": ["../../node_modules/**/*", "./src/docs/**/*"],
|
|
3
|
+
"exclude": ["../../node_modules/**/*", "./src/docs/**/*", "**/*.spec.ts", "**/*.spec.tsx"],
|
|
4
4
|
"include": ["src/**/*", "../../@types"],
|
|
5
5
|
"compilerOptions": {
|
|
6
6
|
"strict": true,
|
package/webpack.docs.ts
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Lodash <https://lodash.com/>
|
|
4
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
5
|
-
* Released under MIT license <https://lodash.com/license>
|
|
6
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
7
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
8
|
-
*/
|