@vev/silke 1.0.20 → 1.0.22
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 +19 -0
- package/dist/index.js +19 -19
- package/dist/index.js.map +3 -3
- package/dist/{silke-code-editor-4TSQ5KJ3.js → silke-code-editor-B2CVBA63.js} +12 -12
- package/dist/silke-code-editor-B2CVBA63.js.map +7 -0
- package/dist/styles.css +110 -124
- package/dist/utils/src/events/condition-parser/lexer.d.ts +1 -0
- package/dist/utils/src/types/interaction.d.ts +7 -4
- package/dist/utils/src/types/vev-plugin.d.ts +42 -34
- package/dist/utils/src/utils/index.d.ts +1 -0
- package/dist/utils/src/utils/main-components.d.ts +7 -0
- package/package.json +3 -3
- package/public/index.html +1 -1
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +10 -8
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +10 -8
- package/src/components/silke-select-field/silke-select-field.mdx +12 -0
- package/dist/silke-code-editor-4TSQ5KJ3.js.map +0 -7
- package/dist/utils/src/keyboard/key-list.d.ts +0 -4
- /package/dist/{silke-code-editor-4TSQ5KJ3.js.LEGAL.txt → silke-code-editor-B2CVBA63.js.LEGAL.txt} +0 -0
package/dist/styles.css
CHANGED
|
@@ -1106,6 +1106,60 @@ div[data-shadow=level4] {
|
|
|
1106
1106
|
content: "";
|
|
1107
1107
|
z-index: 1;
|
|
1108
1108
|
}
|
|
1109
|
+
.silke-autocomplete-field_root_bc5daf4479 {
|
|
1110
|
+
cursor: pointer;
|
|
1111
|
+
-webkit-user-select: none;
|
|
1112
|
+
-moz-user-select: none;
|
|
1113
|
+
user-select: none;
|
|
1114
|
+
}
|
|
1115
|
+
.silke-autocomplete-field_root_bc5daf4479:not(.silke-autocomplete-field_disabled_bc5daf4479):hover .silke-autocomplete-field_downIcon_bc5daf4479, .silke-autocomplete-field_root_bc5daf4479.silke-autocomplete-field_open_bc5daf4479 .silke-autocomplete-field_downIcon_bc5daf4479 {
|
|
1116
|
+
color: var(--color-neutral-100);
|
|
1117
|
+
}
|
|
1118
|
+
.silke-autocomplete-field_root_bc5daf4479:not(.silke-autocomplete-field_disabled_bc5daf4479):hover:not(.silke-autocomplete-field_open_bc5daf4479) .silke-autocomplete-field_arrow_bc5daf4479 {
|
|
1119
|
+
padding-top: 4px;
|
|
1120
|
+
}
|
|
1121
|
+
.silke-autocomplete-field_root_bc5daf4479.silke-autocomplete-field_open_bc5daf4479:not(.silke-autocomplete-field_ghost_bc5daf4479) {
|
|
1122
|
+
--text-field-bg: var(--color-neutral-20);
|
|
1123
|
+
--text-field-hover-bg: var(--color-neutral-20);
|
|
1124
|
+
--text-field-focus-border-color: transparent;
|
|
1125
|
+
}
|
|
1126
|
+
.silke-autocomplete-field_root_bc5daf4479 .silke-autocomplete-field_placeholder_bc5daf4479, .silke-autocomplete-field_root_bc5daf4479.silke-autocomplete-field_disabled_bc5daf4479 [data-input] {
|
|
1127
|
+
color: var(--text-field-disabled-placeholder-color);
|
|
1128
|
+
font-size: var(--text-field-font-size);
|
|
1129
|
+
}
|
|
1130
|
+
.silke-autocomplete-field_root_bc5daf4479.silke-autocomplete-field_disabled_bc5daf4479 * {
|
|
1131
|
+
cursor: not-allowed;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
.silke-autocomplete-field_autocompleteItem_bc5daf4479 {
|
|
1135
|
+
cursor: pointer;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
.silke-autocomplete-field_downIcon_bc5daf4479 {
|
|
1139
|
+
background: transparent;
|
|
1140
|
+
outline: none;
|
|
1141
|
+
border: none;
|
|
1142
|
+
font-size: 0.845em;
|
|
1143
|
+
color: var(--color-neutral-70);
|
|
1144
|
+
transform: translateY(0);
|
|
1145
|
+
transition: opacity 0.5s ease-in-out, transform 0.3s ease-out;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
.silke-autocomplete-field_hiddenSearch_bc5daf4479 {
|
|
1149
|
+
width: 0;
|
|
1150
|
+
height: 0;
|
|
1151
|
+
overflow: hidden;
|
|
1152
|
+
opacity: 0;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
.silke-autocomplete-field_arrow_bc5daf4479 {
|
|
1156
|
+
transition: padding-top 0.2s ease-out, color 0.2s ease-out;
|
|
1157
|
+
height: 100%;
|
|
1158
|
+
width: 16px;
|
|
1159
|
+
}
|
|
1160
|
+
.silke-autocomplete-field_arrow_bc5daf4479 i {
|
|
1161
|
+
font-size: 10px !important;
|
|
1162
|
+
}
|
|
1109
1163
|
.styles_image_11233b422c {
|
|
1110
1164
|
width: 24px;
|
|
1111
1165
|
height: 24px;
|
|
@@ -1885,62 +1939,6 @@ img.silke-icon_icon_84f9e9d6b3 {
|
|
|
1885
1939
|
.silke-icon_emoji_84f9e9d6b3 {
|
|
1886
1940
|
font-size: 1.1428571429em;
|
|
1887
1941
|
}
|
|
1888
|
-
/**********************
|
|
1889
|
-
* SOME MATH
|
|
1890
|
-
************************/
|
|
1891
|
-
/**********************
|
|
1892
|
-
* FONT
|
|
1893
|
-
************************/
|
|
1894
|
-
/**********************
|
|
1895
|
-
* SPACING
|
|
1896
|
-
************************/
|
|
1897
|
-
/**********************
|
|
1898
|
-
* SIZES
|
|
1899
|
-
************************/
|
|
1900
|
-
/**
|
|
1901
|
-
* Get font size base on base font size
|
|
1902
|
-
* scaling = round(size * 1.200) (Minor Third)
|
|
1903
|
-
*/
|
|
1904
|
-
.silke-toolbar_root_dde856ffa5 {
|
|
1905
|
-
position: relative;
|
|
1906
|
-
}
|
|
1907
|
-
.silke-toolbar_root_dde856ffa5:before {
|
|
1908
|
-
background-color: rgba(var(--color-neutral-100-rgb), var(--opacity-level-light));
|
|
1909
|
-
position: absolute;
|
|
1910
|
-
content: "";
|
|
1911
|
-
bottom: 0;
|
|
1912
|
-
left: 0;
|
|
1913
|
-
right: 0;
|
|
1914
|
-
height: 1px;
|
|
1915
|
-
}
|
|
1916
|
-
/**********************
|
|
1917
|
-
* SOME MATH
|
|
1918
|
-
************************/
|
|
1919
|
-
/**********************
|
|
1920
|
-
* FONT
|
|
1921
|
-
************************/
|
|
1922
|
-
/**********************
|
|
1923
|
-
* SPACING
|
|
1924
|
-
************************/
|
|
1925
|
-
/**********************
|
|
1926
|
-
* SIZES
|
|
1927
|
-
************************/
|
|
1928
|
-
/**
|
|
1929
|
-
* Get font size base on base font size
|
|
1930
|
-
* scaling = round(size * 1.200) (Minor Third)
|
|
1931
|
-
*/
|
|
1932
|
-
.silke-steps_number_e3e97b6c1a {
|
|
1933
|
-
width: 24px;
|
|
1934
|
-
height: 24px;
|
|
1935
|
-
outline: 1px solid #fff;
|
|
1936
|
-
border-radius: 50%;
|
|
1937
|
-
text-align: center;
|
|
1938
|
-
transition: 500ms outline;
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
.silke-steps_number_e3e97b6c1a.silke-steps_done_e3e97b6c1a {
|
|
1942
|
-
outline: 1px solid var(--color-success-30);
|
|
1943
|
-
}
|
|
1944
1942
|
body {
|
|
1945
1943
|
--silke-card-border-radius: 8px;
|
|
1946
1944
|
--silke-card-aspect-ratio: 16/10;
|
|
@@ -2134,6 +2132,62 @@ body {
|
|
|
2134
2132
|
* Get font size base on base font size
|
|
2135
2133
|
* scaling = round(size * 1.200) (Minor Third)
|
|
2136
2134
|
*/
|
|
2135
|
+
.silke-toolbar_root_dde856ffa5 {
|
|
2136
|
+
position: relative;
|
|
2137
|
+
}
|
|
2138
|
+
.silke-toolbar_root_dde856ffa5:before {
|
|
2139
|
+
background-color: rgba(var(--color-neutral-100-rgb), var(--opacity-level-light));
|
|
2140
|
+
position: absolute;
|
|
2141
|
+
content: "";
|
|
2142
|
+
bottom: 0;
|
|
2143
|
+
left: 0;
|
|
2144
|
+
right: 0;
|
|
2145
|
+
height: 1px;
|
|
2146
|
+
}
|
|
2147
|
+
/**********************
|
|
2148
|
+
* SOME MATH
|
|
2149
|
+
************************/
|
|
2150
|
+
/**********************
|
|
2151
|
+
* FONT
|
|
2152
|
+
************************/
|
|
2153
|
+
/**********************
|
|
2154
|
+
* SPACING
|
|
2155
|
+
************************/
|
|
2156
|
+
/**********************
|
|
2157
|
+
* SIZES
|
|
2158
|
+
************************/
|
|
2159
|
+
/**
|
|
2160
|
+
* Get font size base on base font size
|
|
2161
|
+
* scaling = round(size * 1.200) (Minor Third)
|
|
2162
|
+
*/
|
|
2163
|
+
.silke-steps_number_e3e97b6c1a {
|
|
2164
|
+
width: 24px;
|
|
2165
|
+
height: 24px;
|
|
2166
|
+
outline: 1px solid #fff;
|
|
2167
|
+
border-radius: 50%;
|
|
2168
|
+
text-align: center;
|
|
2169
|
+
transition: 500ms outline;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
.silke-steps_number_e3e97b6c1a.silke-steps_done_e3e97b6c1a {
|
|
2173
|
+
outline: 1px solid var(--color-success-30);
|
|
2174
|
+
}
|
|
2175
|
+
/**********************
|
|
2176
|
+
* SOME MATH
|
|
2177
|
+
************************/
|
|
2178
|
+
/**********************
|
|
2179
|
+
* FONT
|
|
2180
|
+
************************/
|
|
2181
|
+
/**********************
|
|
2182
|
+
* SPACING
|
|
2183
|
+
************************/
|
|
2184
|
+
/**********************
|
|
2185
|
+
* SIZES
|
|
2186
|
+
************************/
|
|
2187
|
+
/**
|
|
2188
|
+
* Get font size base on base font size
|
|
2189
|
+
* scaling = round(size * 1.200) (Minor Third)
|
|
2190
|
+
*/
|
|
2137
2191
|
.silke-breadcrumb_breadbrumbs_4495c248fa {
|
|
2138
2192
|
padding: 0;
|
|
2139
2193
|
}
|
|
@@ -2525,74 +2579,6 @@ body {
|
|
|
2525
2579
|
* Get font size base on base font size
|
|
2526
2580
|
* scaling = round(size * 1.200) (Minor Third)
|
|
2527
2581
|
*/
|
|
2528
|
-
.silke-autocomplete-field_root_bc5daf4479 {
|
|
2529
|
-
cursor: pointer;
|
|
2530
|
-
-webkit-user-select: none;
|
|
2531
|
-
-moz-user-select: none;
|
|
2532
|
-
user-select: none;
|
|
2533
|
-
}
|
|
2534
|
-
.silke-autocomplete-field_root_bc5daf4479:hover .silke-autocomplete-field_downIcon_bc5daf4479, .silke-autocomplete-field_root_bc5daf4479.silke-autocomplete-field_open_bc5daf4479 .silke-autocomplete-field_downIcon_bc5daf4479 {
|
|
2535
|
-
color: var(--color-neutral-100);
|
|
2536
|
-
}
|
|
2537
|
-
.silke-autocomplete-field_root_bc5daf4479:hover:not(.silke-autocomplete-field_open_bc5daf4479) .silke-autocomplete-field_arrow_bc5daf4479 {
|
|
2538
|
-
padding-top: 4px;
|
|
2539
|
-
}
|
|
2540
|
-
.silke-autocomplete-field_root_bc5daf4479.silke-autocomplete-field_open_bc5daf4479:not(.silke-autocomplete-field_ghost_bc5daf4479) {
|
|
2541
|
-
--text-field-bg: var(--color-neutral-20);
|
|
2542
|
-
--text-field-hover-bg: var(--color-neutral-20);
|
|
2543
|
-
--text-field-focus-border-color: transparent;
|
|
2544
|
-
}
|
|
2545
|
-
|
|
2546
|
-
.silke-autocomplete-field_autocompleteItem_bc5daf4479 {
|
|
2547
|
-
cursor: pointer;
|
|
2548
|
-
}
|
|
2549
|
-
|
|
2550
|
-
.silke-autocomplete-field_downIcon_bc5daf4479 {
|
|
2551
|
-
background: transparent;
|
|
2552
|
-
outline: none;
|
|
2553
|
-
border: none;
|
|
2554
|
-
font-size: 0.845em;
|
|
2555
|
-
color: var(--color-neutral-70);
|
|
2556
|
-
transform: translateY(0);
|
|
2557
|
-
transition: opacity 0.5s ease-in-out, transform 0.3s ease-out;
|
|
2558
|
-
}
|
|
2559
|
-
|
|
2560
|
-
.silke-autocomplete-field_placeholder_bc5daf4479 {
|
|
2561
|
-
color: var(--text-field-disabled-placeholder-color);
|
|
2562
|
-
font-size: var(--text-field-font-size);
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
|
-
.silke-autocomplete-field_hiddenSearch_bc5daf4479 {
|
|
2566
|
-
width: 0;
|
|
2567
|
-
height: 0;
|
|
2568
|
-
overflow: hidden;
|
|
2569
|
-
opacity: 0;
|
|
2570
|
-
}
|
|
2571
|
-
|
|
2572
|
-
.silke-autocomplete-field_arrow_bc5daf4479 {
|
|
2573
|
-
transition: padding-top 0.2s ease-out, color 0.2s ease-out;
|
|
2574
|
-
height: 100%;
|
|
2575
|
-
width: 16px;
|
|
2576
|
-
}
|
|
2577
|
-
.silke-autocomplete-field_arrow_bc5daf4479 i {
|
|
2578
|
-
font-size: 10px !important;
|
|
2579
|
-
}
|
|
2580
|
-
/**********************
|
|
2581
|
-
* SOME MATH
|
|
2582
|
-
************************/
|
|
2583
|
-
/**********************
|
|
2584
|
-
* FONT
|
|
2585
|
-
************************/
|
|
2586
|
-
/**********************
|
|
2587
|
-
* SPACING
|
|
2588
|
-
************************/
|
|
2589
|
-
/**********************
|
|
2590
|
-
* SIZES
|
|
2591
|
-
************************/
|
|
2592
|
-
/**
|
|
2593
|
-
* Get font size base on base font size
|
|
2594
|
-
* scaling = round(size * 1.200) (Minor Third)
|
|
2595
|
-
*/
|
|
2596
2582
|
.silke-table_toolbar_b5946502de {
|
|
2597
2583
|
border-radius: var(--border-radius-medium);
|
|
2598
2584
|
border-bottom-left-radius: var(--border-radius-tiny);
|
|
@@ -14,6 +14,7 @@ export declare enum EVENT_SCOPE {
|
|
|
14
14
|
export type VevDispatchEvent = {
|
|
15
15
|
type?: string;
|
|
16
16
|
contentKey?: string;
|
|
17
|
+
instanceKeyChain?: string;
|
|
17
18
|
args?: VevProps[];
|
|
18
19
|
};
|
|
19
20
|
export type TriggerItem = {
|
|
@@ -28,12 +29,15 @@ export declare enum NATIVE_TRIGGER_TYPES {
|
|
|
28
29
|
ON_MOUSE_LEAVE = "onMouseLeave",
|
|
29
30
|
ON_MOUSE_DOWN = "onMouseDown",
|
|
30
31
|
ON_MOUSE_UP = "onMouseUp",
|
|
31
|
-
ON_DOUBLE_CLICK = "onDoubleClick"
|
|
32
|
+
ON_DOUBLE_CLICK = "onDoubleClick",
|
|
33
|
+
ON_TOUCH_START = "onTouchStart",
|
|
34
|
+
ON_TOUCH_END = "onTouchEnd"
|
|
32
35
|
}
|
|
33
36
|
export declare const NATIVE_TRIGGERS: TriggerItem[];
|
|
34
37
|
export declare enum CUSTOM_TRIGGER_TYPES {
|
|
35
38
|
ON_VISIBLE = "onVisible",
|
|
36
|
-
ON_LEAVE = "onLeave"
|
|
39
|
+
ON_LEAVE = "onLeave",
|
|
40
|
+
ON_SWIPE = "onSwipe"
|
|
37
41
|
}
|
|
38
42
|
export declare const CUSTOM_TRIGGERS: TriggerItem[];
|
|
39
43
|
export declare enum GLOBAL_TRIGGER_TYPES {
|
|
@@ -43,7 +47,6 @@ export declare enum GLOBAL_TRIGGER_TYPES {
|
|
|
43
47
|
ON_KEY_UP = "onKeyUp"
|
|
44
48
|
}
|
|
45
49
|
export declare const GLOBAL_TRIGGERS: TriggerItem[];
|
|
46
|
-
export declare const GLOBAL_TRIGGER_ARGS: Record<GLOBAL_TRIGGER_TYPES, VevProps[]>;
|
|
47
50
|
export declare enum GLOBAL_EVENT_TYPES {
|
|
48
51
|
SHOW = "SHOW",
|
|
49
52
|
HIDE = "HIDE",
|
|
@@ -59,7 +62,6 @@ export declare enum GLOBAL_EVENT_TYPES {
|
|
|
59
62
|
SEND_SMS = "SEND_SMS"
|
|
60
63
|
}
|
|
61
64
|
export declare const GLOBAL_EVENTS: TriggerItem[];
|
|
62
|
-
export declare const GLOBAL_EVENTS_ARGS: Record<GLOBAL_EVENT_TYPES, VevProps[]>;
|
|
63
65
|
export type VevTriggerType = NATIVE_TRIGGER_TYPES | CUSTOM_TRIGGER_TYPES | string;
|
|
64
66
|
export type VevTrigger = {
|
|
65
67
|
type: VevTriggerType;
|
|
@@ -72,6 +74,7 @@ export type ProjectInteraction = {
|
|
|
72
74
|
key: string;
|
|
73
75
|
event?: VevDispatchEvent;
|
|
74
76
|
trigger?: VevTrigger;
|
|
77
|
+
disabled?: boolean;
|
|
75
78
|
updated?: number;
|
|
76
79
|
deleted?: number;
|
|
77
80
|
};
|
|
@@ -1,47 +1,54 @@
|
|
|
1
1
|
import { VevProps } from './vev-props';
|
|
2
2
|
import { OAuthConfig } from './oauth';
|
|
3
3
|
type KeyPart = string | number | bigint | boolean | symbol;
|
|
4
|
-
type
|
|
5
|
-
interface
|
|
4
|
+
export type EditorPluginKvKey = KeyPart[];
|
|
5
|
+
interface EditorPluginKvCommitResult {
|
|
6
6
|
ok: true;
|
|
7
7
|
versionstamp: string;
|
|
8
8
|
}
|
|
9
|
-
interface
|
|
10
|
-
key:
|
|
9
|
+
interface EditorPluginKvEntry<T> {
|
|
10
|
+
key: EditorPluginKvKey;
|
|
11
11
|
value: T;
|
|
12
12
|
versionstamp: string;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
15
|
-
set: (key:
|
|
16
|
-
get: <T>(key:
|
|
17
|
-
delete: (key:
|
|
14
|
+
export interface EditorPluginKv {
|
|
15
|
+
set: (key: EditorPluginKvKey, value: unknown) => Promise<EditorPluginKvCommitResult>;
|
|
16
|
+
get: <T>(key: EditorPluginKvKey) => Promise<EditorPluginKvEntry<T>>;
|
|
17
|
+
delete: (key: EditorPluginKvKey) => Promise<void>;
|
|
18
18
|
}
|
|
19
|
-
export interface
|
|
19
|
+
export interface EditorPluginSettings {
|
|
20
20
|
form: VevProps[];
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
key: string;
|
|
32
|
-
name: string;
|
|
33
|
-
url: string;
|
|
34
|
-
thumb: string;
|
|
35
|
-
metadata: Record<string, string>;
|
|
36
|
-
}[];
|
|
37
|
-
shapes?: {
|
|
38
|
-
key: string;
|
|
39
|
-
name: string;
|
|
40
|
-
url: string;
|
|
41
|
-
thumb: string;
|
|
42
|
-
metadata: Record<string, string>;
|
|
43
|
-
}[];
|
|
22
|
+
type ImageSizes = Record<number, string>;
|
|
23
|
+
type MetaData = Record<string, string>;
|
|
24
|
+
export interface BaseProjectAsset {
|
|
25
|
+
key: string;
|
|
26
|
+
mimeType: string;
|
|
27
|
+
url: string;
|
|
28
|
+
filename?: string;
|
|
29
|
+
metaData?: MetaData;
|
|
30
|
+
selfHosted?: boolean;
|
|
44
31
|
}
|
|
32
|
+
export interface ProjectImageAsset extends BaseProjectAsset {
|
|
33
|
+
dimension?: {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
};
|
|
37
|
+
thumb?: string;
|
|
38
|
+
imageSizes?: ImageSizes;
|
|
39
|
+
}
|
|
40
|
+
export interface ProjectVideoAsset extends BaseProjectAsset {
|
|
41
|
+
videoThumbnail?: string;
|
|
42
|
+
videoSample?: string;
|
|
43
|
+
dimension?: {
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
};
|
|
47
|
+
duration?: number;
|
|
48
|
+
state?: 'uploading' | 'encoding' | 'completed' | 'error' | 'preUpload';
|
|
49
|
+
additionalSources: Omit<ProjectVideoAsset, 'additionalSources'>[];
|
|
50
|
+
}
|
|
51
|
+
export type ProjectAsset = BaseProjectAsset | ProjectImageAsset | ProjectVideoAsset;
|
|
45
52
|
export declare enum EditorPluginType {
|
|
46
53
|
ASSET_SOURCE = "asset-source"
|
|
47
54
|
}
|
|
@@ -50,12 +57,13 @@ export interface EditorPlugin<T> {
|
|
|
50
57
|
name: string;
|
|
51
58
|
type: EditorPluginType;
|
|
52
59
|
form: VevProps[];
|
|
53
|
-
handler: (request: Request, env: Record<string, string>, kv:
|
|
60
|
+
handler: (request: Request, env: Record<string, string>, kv: EditorPluginKv) => Promise<T | EditorPluginSettings>;
|
|
54
61
|
icon?: string;
|
|
55
62
|
oauthConfig?: OAuthConfig;
|
|
56
63
|
}
|
|
57
|
-
export
|
|
64
|
+
export type EditorPluginAssetSourceFilterFields = Record<string, string[]>;
|
|
65
|
+
export interface EditorPluginAssetSource extends EditorPlugin<ProjectAsset[] | EditorPluginAssetSourceFilterFields> {
|
|
58
66
|
type: EditorPluginType.ASSET_SOURCE;
|
|
59
67
|
}
|
|
60
|
-
export type VevPluginType =
|
|
68
|
+
export type VevPluginType = EditorPluginAssetSource;
|
|
61
69
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get all inherited keys from a mocked key
|
|
3
|
+
* ie. 'model-instance-instance2' => ['model-instance', 'model']
|
|
4
|
+
* @param key mocked key
|
|
5
|
+
* @returns a array of all models that are inherited from the given key
|
|
6
|
+
*/
|
|
7
|
+
export declare function getInheritedKeysFromKey(key: string): string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vev/silke",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/silke/src/index.d.ts",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
|
33
33
|
"@uiw/codemirror-theme-dracula": "^4.12.3",
|
|
34
34
|
"@uiw/react-codemirror": "^4.12.3",
|
|
35
|
-
"@vev/react": "0.1.
|
|
36
|
-
"@vev/utils": "1.2.
|
|
35
|
+
"@vev/react": "0.1.6",
|
|
36
|
+
"@vev/utils": "1.2.3",
|
|
37
37
|
"classnames": ">=2.2.0",
|
|
38
38
|
"flux": "^4.0.4",
|
|
39
39
|
"lodash": "^4.17.21",
|
package/public/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
rel="stylesheet"
|
|
16
16
|
/>
|
|
17
17
|
<!-- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" /> -->
|
|
18
|
-
<link rel="stylesheet" href="https://cdn.vev.design/fontawesome/6.
|
|
18
|
+
<link rel="stylesheet" href="https://cdn.vev.design/fontawesome/6.5.1/css/all.min.css" >
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
21
21
|
<div id="root" style="width: 100%;height:100%;"></div>
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
@use '../../variables' as *;
|
|
2
1
|
.root {
|
|
3
2
|
cursor: pointer;
|
|
4
3
|
user-select: none;
|
|
5
4
|
|
|
6
|
-
&:hover,
|
|
5
|
+
&:not(.disabled):hover,
|
|
7
6
|
&.open {
|
|
8
7
|
.downIcon{
|
|
9
8
|
color: var(--color-neutral-100);
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
|
-
&:hover:not(.open){
|
|
11
|
+
&:not(.disabled):hover:not(.open){
|
|
13
12
|
.arrow{
|
|
14
13
|
padding-top: 4px;
|
|
15
14
|
}
|
|
@@ -21,6 +20,14 @@
|
|
|
21
20
|
--text-field-focus-border-color: transparent;
|
|
22
21
|
}
|
|
23
22
|
|
|
23
|
+
.placeholder, &.disabled [data-input] {
|
|
24
|
+
color: var(--text-field-disabled-placeholder-color);
|
|
25
|
+
font-size: var(--text-field-font-size);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.disabled *{
|
|
29
|
+
cursor: not-allowed;
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
|
|
26
33
|
.autocompleteItem {
|
|
@@ -39,11 +46,6 @@
|
|
|
39
46
|
transition: opacity 0.5s ease-in-out, transform 0.3s ease-out;
|
|
40
47
|
}
|
|
41
48
|
|
|
42
|
-
.placeholder {
|
|
43
|
-
color: var(--text-field-disabled-placeholder-color);
|
|
44
|
-
font-size: var(--text-field-font-size);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
49
|
.hiddenSearch{
|
|
48
50
|
width:0;height:0;
|
|
49
51
|
overflow: hidden;
|
|
@@ -256,8 +256,9 @@ export function SilkeAutocompleteField<T>(props: SilkeAutocompleteFieldProps<T>)
|
|
|
256
256
|
}, [items, form.multiple, resetSearchText, form.value]);
|
|
257
257
|
|
|
258
258
|
useEffect(() => {
|
|
259
|
-
if (autoFocus) setOpen(true);
|
|
260
|
-
|
|
259
|
+
if (autoFocus && !disabled) setOpen(true);
|
|
260
|
+
else if (disabled) setOpen(false);
|
|
261
|
+
}, [autoFocus, disabled]);
|
|
261
262
|
|
|
262
263
|
useEffect(() => {
|
|
263
264
|
if (open && highlight !== undefined) {
|
|
@@ -422,7 +423,7 @@ export function SilkeAutocompleteField<T>(props: SilkeAutocompleteFieldProps<T>)
|
|
|
422
423
|
case 'ArrowDown': {
|
|
423
424
|
e.preventDefault();
|
|
424
425
|
e.stopPropagation();
|
|
425
|
-
if (!open) {
|
|
426
|
+
if (!open && !disabled) {
|
|
426
427
|
setOpen(true);
|
|
427
428
|
} else {
|
|
428
429
|
const { key } = e;
|
|
@@ -451,6 +452,7 @@ export function SilkeAutocompleteField<T>(props: SilkeAutocompleteFieldProps<T>)
|
|
|
451
452
|
let cl = styles.root;
|
|
452
453
|
if (open) cl += ' ' + styles.open;
|
|
453
454
|
if (styles[kind]) cl += ' ' + styles[kind];
|
|
455
|
+
if (disabled) cl += ' ' + styles.disabled;
|
|
454
456
|
|
|
455
457
|
return (
|
|
456
458
|
<>
|
|
@@ -475,6 +477,7 @@ export function SilkeAutocompleteField<T>(props: SilkeAutocompleteFieldProps<T>)
|
|
|
475
477
|
e.preventDefault();
|
|
476
478
|
e.stopPropagation();
|
|
477
479
|
onMouseDown?.(e);
|
|
480
|
+
if (disabled) return;
|
|
478
481
|
!context.readOnly &&
|
|
479
482
|
setOpen((wasOpen) => {
|
|
480
483
|
return !wasOpen;
|
|
@@ -504,13 +507,13 @@ export function SilkeAutocompleteField<T>(props: SilkeAutocompleteFieldProps<T>)
|
|
|
504
507
|
ref={inputField}
|
|
505
508
|
data-placeholder={placeholder}
|
|
506
509
|
onKeyUp={(e: KeyboardEvent) => {
|
|
507
|
-
if ((e.key === 'Enter' || e.key === 'ArrowDown') && !open) {
|
|
510
|
+
if ((e.key === 'Enter' || e.key === 'ArrowDown') && !open && !disabled) {
|
|
508
511
|
e.preventDefault();
|
|
509
512
|
setOpen(true);
|
|
510
513
|
}
|
|
511
514
|
}}
|
|
512
515
|
onFocus={() => {
|
|
513
|
-
if (!open) setOpen(true);
|
|
516
|
+
if (!open && !disabled) setOpen(true);
|
|
514
517
|
}}
|
|
515
518
|
>
|
|
516
519
|
{form.multiple && form.value?.length > 0 ? (
|
|
@@ -525,13 +528,13 @@ export function SilkeAutocompleteField<T>(props: SilkeAutocompleteFieldProps<T>)
|
|
|
525
528
|
) : (
|
|
526
529
|
<>
|
|
527
530
|
{selectedImage && (
|
|
528
|
-
<SilkeBox
|
|
531
|
+
<SilkeBox width={dropDownSize} align="center" hPad="xs">
|
|
529
532
|
<SilkeIcon icon={{ type: EmojiType.upload, value: { url: selectedImage } }} />
|
|
530
533
|
</SilkeBox>
|
|
531
534
|
)}
|
|
532
535
|
|
|
533
536
|
{selectedIcon && (
|
|
534
|
-
<SilkeBox
|
|
537
|
+
<SilkeBox width={dropDownSize} align="center" hPad="xs">
|
|
535
538
|
<SilkeIcon icon={selectedIcon} />
|
|
536
539
|
</SilkeBox>
|
|
537
540
|
)}
|
|
@@ -600,7 +603,6 @@ export function SilkeAutocompleteField<T>(props: SilkeAutocompleteFieldProps<T>)
|
|
|
600
603
|
inline="label-inside"
|
|
601
604
|
label={<SilkeIcon icon="search" />}
|
|
602
605
|
aria-label={'Search for ' + label}
|
|
603
|
-
aria-role="searchbox"
|
|
604
606
|
autoFocus
|
|
605
607
|
size={size}
|
|
606
608
|
className={disableSearch ? styles.hiddenSearch : undefined}
|
|
@@ -40,6 +40,18 @@ const [value, setValue] = React.useState("");
|
|
|
40
40
|
value={value}
|
|
41
41
|
items={items}
|
|
42
42
|
/>
|
|
43
|
+
<SilkeSelectField
|
|
44
|
+
key={kind}
|
|
45
|
+
label="Default"
|
|
46
|
+
name="Foobar"
|
|
47
|
+
disabled
|
|
48
|
+
placeholder="Select an item"
|
|
49
|
+
kind={kind}
|
|
50
|
+
size="xs"
|
|
51
|
+
onChange={setValue}
|
|
52
|
+
value={value}
|
|
53
|
+
items={items}
|
|
54
|
+
/>
|
|
43
55
|
</SilkeBox>
|
|
44
56
|
))}
|
|
45
57
|
</SilkeBox>;
|