@novely/dynamic-character 0.5.0 → 0.7.0
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/README.md +137 -137
- package/dist/index.d.ts +133 -2
- package/dist/index.js +434 -0
- package/dist/index.js.map +1 -0
- package/dist/{index.css → style.css} +58 -27
- package/license +15 -15
- package/package.json +33 -30
- package/dist/actions.d.ts +0 -7
- package/dist/components/Picker.d.ts +0 -19
- package/dist/components/Slider.d.ts +0 -12
- package/dist/emotions.d.ts +0 -3
- package/dist/index.jsx +0 -449
- package/dist/picker.d.ts +0 -4
- package/dist/show.d.ts +0 -4
- package/dist/types.d.ts +0 -164
- package/dist/utils.d.ts +0 -16
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* src/index.css */
|
|
2
1
|
.ndc-picker-root {
|
|
3
2
|
--picker-width: 40vw;
|
|
4
3
|
z-index: 4;
|
|
5
|
-
|
|
4
|
+
inline-size: var(--picker-width);
|
|
6
5
|
background-color: var(--appearance-picker-background-color, #f092b4d8);
|
|
7
|
-
background-image: var(--appearance-picker-background-image, radial-gradient(#d6608998 20%, transparent 20%),
|
|
6
|
+
background-image: var(--appearance-picker-background-image, radial-gradient(#d6608998 20%, transparent 20%),
|
|
7
|
+
radial-gradient(#d6608998 20%, transparent 20%));
|
|
8
8
|
color: var(--appearance-picker-color, #000);
|
|
9
9
|
bottom: 0;
|
|
10
10
|
left: calc(calc(100% - var(--picker-width)) / 2);
|
|
@@ -21,9 +21,11 @@
|
|
|
21
21
|
transition: transform .3s ease-in-out;
|
|
22
22
|
position: fixed;
|
|
23
23
|
}
|
|
24
|
+
|
|
24
25
|
.ndc-picker-root-collapsed {
|
|
25
26
|
transform: translateY(calc(100% - 2rem));
|
|
26
27
|
}
|
|
28
|
+
|
|
27
29
|
.ndc-collapse-button {
|
|
28
30
|
cursor: pointer;
|
|
29
31
|
filter: drop-shadow(0 0 calc(var(--novely-px) * 8) #000);
|
|
@@ -33,66 +35,78 @@
|
|
|
33
35
|
position: absolute;
|
|
34
36
|
top: -5.05rem;
|
|
35
37
|
left: 50%;
|
|
36
|
-
transform: rotate(0)translateX(-50%);
|
|
38
|
+
transform: rotate(0) translateX(-50%);
|
|
37
39
|
}
|
|
40
|
+
|
|
38
41
|
.ndc-collapse-button-icon-collapsed {
|
|
39
42
|
transform: rotate(180deg);
|
|
40
43
|
}
|
|
44
|
+
|
|
41
45
|
.ndc-tabpanel-hidden {
|
|
42
46
|
display: none;
|
|
43
47
|
}
|
|
48
|
+
|
|
44
49
|
.ndc-heading {
|
|
45
50
|
margin-top: -2rem;
|
|
46
|
-
|
|
47
|
-
box-shadow: 0 0 0 .15rem var(--appearance-picker-tablist-border-color, #ffa6cd),
|
|
51
|
+
inline-size: 40%;
|
|
52
|
+
box-shadow: 0 0 0 .15rem var(--appearance-picker-tablist-border-color, #ffa6cd),
|
|
53
|
+
var(--novely-px) var(--novely-px) .25rem var(--appearance-picker-box-shadow-color, #00000072);
|
|
48
54
|
text-align: center;
|
|
49
55
|
background-color: #ffc7df;
|
|
50
56
|
border-radius: .875rem;
|
|
51
57
|
gap: .5rem;
|
|
52
|
-
margin-
|
|
53
|
-
margin-right: auto;
|
|
58
|
+
margin-inline: auto;
|
|
54
59
|
padding: .75rem;
|
|
55
60
|
transition: opacity .15s ease-in-out;
|
|
56
61
|
}
|
|
62
|
+
|
|
57
63
|
.ndc-heading-picker-collapsed {
|
|
58
64
|
opacity: 0;
|
|
59
65
|
pointer-events: none;
|
|
60
66
|
}
|
|
67
|
+
|
|
61
68
|
.ndc-slider {
|
|
62
69
|
flex-direction: column;
|
|
63
70
|
align-items: center;
|
|
64
|
-
|
|
71
|
+
inline-size: 100%;
|
|
65
72
|
transition: opacity .15s ease-in-out;
|
|
66
73
|
display: flex;
|
|
67
74
|
position: relative;
|
|
68
75
|
}
|
|
76
|
+
|
|
69
77
|
.ndc-slider-picker-collapsed {
|
|
70
78
|
opacity: 0;
|
|
71
79
|
pointer-events: none;
|
|
72
80
|
}
|
|
81
|
+
|
|
73
82
|
.ndc-slides {
|
|
74
|
-
|
|
83
|
+
inline-size: 100%;
|
|
75
84
|
padding-bottom: 4.8rem;
|
|
76
85
|
}
|
|
86
|
+
|
|
77
87
|
.ndc-slide {
|
|
78
88
|
padding-inline: calc(calc(.75rem * 2) + 2.4rem + calc(var(--button-box-shadow-spread-radius, .25rem) * 2));
|
|
79
89
|
display: none;
|
|
80
90
|
}
|
|
91
|
+
|
|
81
92
|
.ndc-control-buttons {
|
|
82
93
|
justify-content: center;
|
|
83
94
|
align-items: center;
|
|
84
95
|
gap: .4rem;
|
|
85
|
-
|
|
96
|
+
inline-size: 100%;
|
|
86
97
|
display: flex;
|
|
87
98
|
}
|
|
99
|
+
|
|
88
100
|
.ndc-slide-active {
|
|
89
101
|
flex-direction: column;
|
|
90
102
|
gap: .15rem;
|
|
91
103
|
display: flex;
|
|
92
104
|
}
|
|
105
|
+
|
|
93
106
|
.ndc-controls {
|
|
94
107
|
margin-top: 1.5rem;
|
|
95
108
|
}
|
|
109
|
+
|
|
96
110
|
.ndc-button-nav {
|
|
97
111
|
--button-box-shadow-spread-radius: .1rem;
|
|
98
112
|
cursor: pointer;
|
|
@@ -104,19 +118,23 @@
|
|
|
104
118
|
align-items: center;
|
|
105
119
|
display: flex;
|
|
106
120
|
position: absolute;
|
|
107
|
-
|
|
121
|
+
inset-block-start: 3rem;
|
|
108
122
|
transform: translateY(-50%);
|
|
109
123
|
}
|
|
124
|
+
|
|
110
125
|
.ndc-button-nav svg {
|
|
111
|
-
|
|
112
|
-
|
|
126
|
+
block-size: 2.4rem;
|
|
127
|
+
inline-size: 2.4rem;
|
|
113
128
|
}
|
|
129
|
+
|
|
114
130
|
.ndc-button-nav-prev {
|
|
115
131
|
left: .75rem;
|
|
116
132
|
}
|
|
133
|
+
|
|
117
134
|
.ndc-button-nav-next {
|
|
118
135
|
right: .75rem;
|
|
119
136
|
}
|
|
137
|
+
|
|
120
138
|
.ndc-variant-name {
|
|
121
139
|
color: #fff;
|
|
122
140
|
text-align: center;
|
|
@@ -126,75 +144,88 @@
|
|
|
126
144
|
font-size: 2rem;
|
|
127
145
|
line-height: 1;
|
|
128
146
|
}
|
|
147
|
+
|
|
129
148
|
.ndc-control-buttons {
|
|
130
149
|
justify-content: center;
|
|
131
150
|
align-items: center;
|
|
132
151
|
display: flex;
|
|
133
152
|
}
|
|
134
|
-
|
|
153
|
+
|
|
154
|
+
@media (aspect-ratio <= .8) {
|
|
135
155
|
.ndc-picker-root {
|
|
136
156
|
width: calc(100% - .5rem);
|
|
137
157
|
margin-bottom: 2.8rem;
|
|
138
158
|
left: .25rem;
|
|
139
159
|
right: .25rem;
|
|
140
160
|
}
|
|
161
|
+
|
|
141
162
|
.ndc-picker-root-collapsed {
|
|
142
163
|
transform: translateY(calc(100% - 1.2rem));
|
|
143
164
|
}
|
|
165
|
+
|
|
144
166
|
.ndc-heading {
|
|
145
167
|
box-shadow: 0 0 0 .1rem var(--appearance-picker-tablist-border-color, #ffa6cd);
|
|
146
168
|
}
|
|
147
|
-
|
|
148
|
-
.ndc-slides {
|
|
169
|
+
|
|
170
|
+
.ndc-slider, .ndc-slides {
|
|
149
171
|
padding-bottom: .2rem;
|
|
150
172
|
}
|
|
173
|
+
|
|
151
174
|
.ndc-button-nav svg {
|
|
152
|
-
|
|
153
|
-
|
|
175
|
+
block-size: 2rem;
|
|
176
|
+
inline-size: 2rem;
|
|
154
177
|
}
|
|
178
|
+
|
|
155
179
|
.ndc-variant-name {
|
|
156
180
|
margin-top: .6rem;
|
|
157
181
|
font-size: 1.35rem;
|
|
158
182
|
}
|
|
159
183
|
}
|
|
160
|
-
|
|
184
|
+
|
|
185
|
+
@media (aspect-ratio <= .26) {
|
|
161
186
|
.ndc-picker-root {
|
|
162
187
|
box-shadow: none;
|
|
163
188
|
border: none;
|
|
164
189
|
border-radius: .5rem;
|
|
165
|
-
|
|
190
|
+
inline-size: 100%;
|
|
166
191
|
left: 0;
|
|
167
192
|
right: 0;
|
|
168
193
|
}
|
|
194
|
+
|
|
169
195
|
.ndc-slide {
|
|
170
|
-
padding-
|
|
171
|
-
padding-right: 0;
|
|
196
|
+
padding-inline: 0;
|
|
172
197
|
}
|
|
198
|
+
|
|
173
199
|
.ndc-slider {
|
|
174
200
|
padding-top: 3.5rem;
|
|
175
201
|
}
|
|
176
202
|
}
|
|
177
|
-
|
|
203
|
+
|
|
204
|
+
@media only screen and (aspect-ratio >= .8) and (pointer: coarse) {
|
|
178
205
|
.ndc-picker-root {
|
|
179
206
|
--picker-width: 100vw;
|
|
180
207
|
border-bottom-right-radius: 0;
|
|
181
208
|
border-bottom-left-radius: 0;
|
|
182
209
|
}
|
|
183
|
-
|
|
184
|
-
.ndc-slider-picker-collapsed {
|
|
210
|
+
|
|
211
|
+
.ndc-heading-picker-collapsed, .ndc-slider-picker-collapsed {
|
|
185
212
|
opacity: 0;
|
|
186
213
|
pointer-events: none;
|
|
187
214
|
}
|
|
215
|
+
|
|
188
216
|
.ndc-slides {
|
|
189
217
|
padding-bottom: .8rem;
|
|
190
218
|
}
|
|
219
|
+
|
|
191
220
|
.ndc-control-buttons {
|
|
192
221
|
gap: .4rem;
|
|
193
|
-
|
|
222
|
+
inline-size: 100%;
|
|
194
223
|
}
|
|
224
|
+
|
|
195
225
|
.ndc-slider {
|
|
196
226
|
padding-bottom: 2rem;
|
|
197
227
|
}
|
|
228
|
+
|
|
198
229
|
.ndc-variant-name {
|
|
199
230
|
font-size: 1.35rem;
|
|
200
231
|
top: .6rem;
|
package/license
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
ISC License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024, Artem Schukin
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
copyright notice and this permission notice appear in all copies.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
-
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, Artem Schukin
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,36 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novely/dynamic-character",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public"
|
|
7
|
-
},
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"main": "./dist/index.jsx",
|
|
10
|
-
"module": "./dist/index.jsx",
|
|
11
|
-
"sideEffects": false,
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"esbuild": "^0.25.5",
|
|
14
|
-
"esbuild-plugin-solid": "^0.6.0",
|
|
15
|
-
"typescript": "^5.8.3"
|
|
16
|
-
},
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"p-limit": "^6.2.0",
|
|
19
|
-
"solid-js": "~1.9.7",
|
|
20
|
-
"@novely/core": "0.52.0"
|
|
21
|
-
},
|
|
22
|
-
"peerDependencies": {
|
|
23
|
-
"@novely/core": "*",
|
|
24
|
-
"solid-js": "*"
|
|
25
|
-
},
|
|
26
|
-
"license": "ISC",
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/yhdgms1/novely/issues"
|
|
29
|
-
},
|
|
30
|
-
"homepage": "https://github.com/yhdgms1/novely/tree/main/packages/dynamic-character",
|
|
3
|
+
"version": "0.7.0",
|
|
31
4
|
"keywords": [
|
|
32
5
|
"novely"
|
|
33
6
|
],
|
|
7
|
+
"homepage": "https://github.com/yhdgms1/novely/tree/main/packages/dynamic-character",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/yhdgms1/novely/issues"
|
|
10
|
+
},
|
|
11
|
+
"license": "ISC",
|
|
34
12
|
"author": {
|
|
35
13
|
"name": "Artemiy Schukin",
|
|
36
14
|
"url": "https://github.com/yhdgms1"
|
|
@@ -43,8 +21,33 @@
|
|
|
43
21
|
"files": [
|
|
44
22
|
"dist/*"
|
|
45
23
|
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"module": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@novely/core": "0.56.0",
|
|
34
|
+
"@solidjs/web": "~2.0.4",
|
|
35
|
+
"p-limit": "^6.2.0",
|
|
36
|
+
"solid-js": "~2.0.4"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@tsdown/css": "^0.21.4",
|
|
40
|
+
"rolldown-plugin-solid-compiler": "^1.0.0",
|
|
41
|
+
"tsdown": "^0.21.4",
|
|
42
|
+
"typescript": "^5.9.3"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@novely/core": "*",
|
|
46
|
+
"@solidjs/web": "^2.0.0",
|
|
47
|
+
"solid-js": "^2.0.0"
|
|
48
|
+
},
|
|
46
49
|
"scripts": {
|
|
47
|
-
"dev": "
|
|
48
|
-
"build": "
|
|
50
|
+
"dev": "tsdown --watch",
|
|
51
|
+
"build": "tsdown"
|
|
49
52
|
}
|
|
50
53
|
}
|
package/dist/actions.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { EngineInstance, Attributes, ClothingData, AllOptions, ShowPickerOptionsAttribute, ShowPickerOptionsBase, DefaultEngineTypes } from './types';
|
|
2
|
-
declare const createActions: (this: ClothingData<string, Attributes>, engine: EngineInstance, options: AllOptions<DefaultEngineTypes, string, Attributes>) => {
|
|
3
|
-
showBasePicker: (options?: ShowPickerOptionsBase) => import("@novely/core").ValidAction;
|
|
4
|
-
showAttributePicker: (options: ShowPickerOptionsAttribute<Attributes>) => import("@novely/core").ValidAction;
|
|
5
|
-
showCharacter: () => import("@novely/core").ValidAction;
|
|
6
|
-
};
|
|
7
|
-
export { createActions };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Component, Setter } from 'solid-js';
|
|
2
|
-
import type { AllThis, EmotionObject } from '../types';
|
|
3
|
-
type PickerProps = {
|
|
4
|
-
title: string;
|
|
5
|
-
initialExpanded: boolean;
|
|
6
|
-
initialEmotion: EmotionObject;
|
|
7
|
-
slides: string[];
|
|
8
|
-
pricing: number[];
|
|
9
|
-
translationGroup: Record<string, string>;
|
|
10
|
-
translation: AllThis['options']['translation'][string];
|
|
11
|
-
getInitialSlideIndex: (appearance: EmotionObject) => number;
|
|
12
|
-
onIndexChange: (appearance: EmotionObject, setAppearance: Setter<EmotionObject>, slide: number) => void;
|
|
13
|
-
saveEmotion: (appearance: EmotionObject) => void;
|
|
14
|
-
sumbit: () => void;
|
|
15
|
-
buy: (variant: string) => Promise<boolean>;
|
|
16
|
-
isBought: (variant: string) => boolean;
|
|
17
|
-
};
|
|
18
|
-
declare const Picker: Component<PickerProps>;
|
|
19
|
-
export { Picker };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Accessor, Component, JSX } from 'solid-js';
|
|
2
|
-
import type { AllThis } from '../types';
|
|
3
|
-
type SliderProps = {
|
|
4
|
-
initialSlideIndex: number;
|
|
5
|
-
slides: string[];
|
|
6
|
-
expanded: boolean;
|
|
7
|
-
translation: AllThis['options']['translation'][string];
|
|
8
|
-
children: (slide: string, i: Accessor<number>) => JSX.Element;
|
|
9
|
-
onIndexChange: (currentIndex: number) => void;
|
|
10
|
-
};
|
|
11
|
-
declare const Slider: Component<SliderProps>;
|
|
12
|
-
export { Slider };
|
package/dist/emotions.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Attributes, EmotionsDefinition, EmotionsResult } from './types';
|
|
2
|
-
declare const generateEmotions: <BaseKeys extends string, Attribs extends Attributes<BaseKeys>>({ base, attributes, pricing, }: EmotionsDefinition<BaseKeys, Attribs>) => EmotionsResult<BaseKeys, Attribs>;
|
|
3
|
-
export { generateEmotions };
|