@vev/silke 1.0.14 → 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 +17 -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 +100 -103
- 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-color-picker/silke-color-info.tsx +2 -2
- 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 +2 -2
- package/src/components/silke-form-schema/fields/event-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/icon-field.tsx +2 -2
- package/src/components/silke-form-schema/fields/image-field.tsx +3 -2
- package/src/components/silke-form-schema/fields/layout-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/link-field.tsx +3 -2
- package/src/components/silke-form-schema/fields/number-field.tsx +3 -2
- package/src/components/silke-form-schema/fields/object-field.tsx +3 -2
- package/src/components/silke-form-schema/fields/select-field.tsx +7 -8
- package/src/components/silke-form-schema/fields/string-field.tsx +2 -6
- package/src/components/silke-form-schema/fields/toggle-field.tsx +15 -11
- 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/fields/utils/schema-util.ts +6 -0
- 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
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { BooleanField, SchemaFieldProps } from '@vev/
|
|
1
|
+
import { BooleanField, SchemaFieldProps } from '@vev/utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SilkeBox } from '../../silke-box';
|
|
4
4
|
import { SilkeToggle } from '../../silke-toggle';
|
|
5
5
|
import { SilkeTextSmall } from '../../silke-text';
|
|
6
|
+
import { getTitle } from './utils/schema-util';
|
|
6
7
|
|
|
7
|
-
const Toggle = (
|
|
8
|
+
const Toggle = ({ schema, value, onChange }: SchemaFieldProps<BooleanField>) => {
|
|
8
9
|
return (
|
|
9
|
-
<SilkeBox
|
|
10
|
-
<SilkeBox
|
|
11
|
-
<SilkeBox
|
|
12
|
-
<
|
|
13
|
-
{
|
|
14
|
-
</
|
|
10
|
+
<SilkeBox column>
|
|
11
|
+
<SilkeBox flex>
|
|
12
|
+
<SilkeBox align="center" style={{ width: '80px' }}>
|
|
13
|
+
<SilkeBox vAlign="center" flex>
|
|
14
|
+
<SilkeTextSmall weight="strong">{getTitle(schema)}</SilkeTextSmall>
|
|
15
|
+
</SilkeBox>
|
|
16
|
+
</SilkeBox>
|
|
17
|
+
<SilkeBox flex pad="xs">
|
|
18
|
+
<SilkeToggle value={value || false} onChange={onChange} small />
|
|
15
19
|
</SilkeBox>
|
|
16
20
|
</SilkeBox>
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
21
|
+
{schema.description && (
|
|
22
|
+
<SilkeTextSmall color="neutral-80">{schema.description}</SilkeTextSmall>
|
|
23
|
+
)}
|
|
20
24
|
</SilkeBox>
|
|
21
25
|
);
|
|
22
26
|
};
|
|
@@ -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
|
-
*/
|