@jskit-ai/rewarded-web 0.2.11 → 0.2.13
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 +4 -0
- package/package.json +5 -5
- package/src/client/components/RewardedGateHost.vue +30 -127
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- The rewarded gate is a Material 3 basic dialog (Vuetify `v-dialog` and `v-card`, theme colour roles and type, text buttons) instead of hand-coloured HTML; it still waits for the person's choice.
|
|
6
|
+
|
|
3
7
|
## 0.2.0 - 2026-10-29
|
|
4
8
|
|
|
5
9
|
- Translation ready: every user-visible text is a message key with its English in `locales/en.json`, so an app translates it by supplying translation files only. With no translations, texts and behaviour are unchanged. See the guide "Translating a JSKIT app".
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/rewarded-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test --test-concurrency=1"
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@jskit-ai/rewarded-core": "0.2.
|
|
63
|
+
"@jskit-ai/rewarded-core": "0.2.12"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@jskit-ai/http-runtime": "0.2.
|
|
67
|
-
"@jskit-ai/kernel": "0.2.
|
|
68
|
-
"@jskit-ai/shell-web": "0.2.
|
|
66
|
+
"@jskit-ai/http-runtime": "0.2.10",
|
|
67
|
+
"@jskit-ai/kernel": "0.2.10",
|
|
68
|
+
"@jskit-ai/shell-web": "0.2.11",
|
|
69
69
|
"vue": "^3.5.13"
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -32,149 +32,52 @@ function handleDismissError() {
|
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<template>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
<div class="rewarded-gate__eyebrow">{{ t("jskit.rewarded.gate.eyebrow") }}</div>
|
|
40
|
-
<h2 class="rewarded-gate__title">{{ titleText }}</h2>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<p
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
>
|
|
35
|
+
<!-- A Material 3 basic dialog: the gate waits for the person's choice, so the scrim does not dismiss it. -->
|
|
36
|
+
<v-dialog :model-value="isVisible" class="rewarded-gate" persistent max-width="560">
|
|
37
|
+
<v-card>
|
|
38
|
+
<v-card-item>
|
|
39
|
+
<div class="rewarded-gate__eyebrow text-label-large">{{ t("jskit.rewarded.gate.eyebrow") }}</div>
|
|
40
|
+
<h2 class="rewarded-gate__title text-headline-small">{{ titleText }}</h2>
|
|
41
|
+
</v-card-item>
|
|
42
|
+
<v-card-text>
|
|
43
|
+
<p class="text-body-medium on-surface-variant mb-0">{{ descriptionText }}</p>
|
|
44
|
+
|
|
45
|
+
<p v-if="state.phase === 'loading'" class="rewarded-gate__status text-body-medium">
|
|
47
46
|
{{ t("jskit.rewarded.gate.loading") }}
|
|
48
47
|
</p>
|
|
49
48
|
|
|
50
|
-
<p
|
|
51
|
-
v-else-if="state.phase === 'error'"
|
|
52
|
-
class="rewarded-gate__status rewarded-gate__status--error"
|
|
53
|
-
>
|
|
49
|
+
<p v-else-if="state.phase === 'error'" class="rewarded-gate__status text-body-medium text-error">
|
|
54
50
|
{{ state.errorMessage || t("jskit.rewarded.gate.startFailed") }}
|
|
55
51
|
</p>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
>
|
|
73
|
-
{{ t("jskit.rewarded.gate.notNow") }}
|
|
74
|
-
</button>
|
|
75
|
-
|
|
76
|
-
<button
|
|
77
|
-
v-if="state.phase === 'error'"
|
|
78
|
-
type="button"
|
|
79
|
-
class="rewarded-gate__button rewarded-gate__button--primary"
|
|
80
|
-
@click="handleDismissError"
|
|
81
|
-
>
|
|
82
|
-
{{ t("jskit.rewarded.gate.close") }}
|
|
83
|
-
</button>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
</Teleport>
|
|
52
|
+
</v-card-text>
|
|
53
|
+
|
|
54
|
+
<v-card-actions v-if="state.phase === 'prompt' || state.phase === 'error'">
|
|
55
|
+
<v-spacer />
|
|
56
|
+
<v-btn v-if="state.phase === 'prompt'" variant="text" @click="handleCancelClick">
|
|
57
|
+
{{ t("jskit.rewarded.gate.notNow") }}
|
|
58
|
+
</v-btn>
|
|
59
|
+
<v-btn v-if="state.phase === 'prompt'" variant="text" @click="handleWatchClick">
|
|
60
|
+
{{ t("jskit.rewarded.gate.watch") }}
|
|
61
|
+
</v-btn>
|
|
62
|
+
<v-btn v-if="state.phase === 'error'" variant="text" @click="handleDismissError">
|
|
63
|
+
{{ t("jskit.rewarded.gate.close") }}
|
|
64
|
+
</v-btn>
|
|
65
|
+
</v-card-actions>
|
|
66
|
+
</v-card>
|
|
67
|
+
</v-dialog>
|
|
88
68
|
</template>
|
|
89
69
|
|
|
90
70
|
<style scoped>
|
|
91
|
-
.rewarded-gate {
|
|
92
|
-
position: fixed;
|
|
93
|
-
inset: 0;
|
|
94
|
-
z-index: 2147483000;
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: center;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.rewarded-gate__scrim {
|
|
101
|
-
position: absolute;
|
|
102
|
-
inset: 0;
|
|
103
|
-
background:
|
|
104
|
-
linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.94));
|
|
105
|
-
backdrop-filter: blur(4px);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.rewarded-gate__panel {
|
|
109
|
-
position: relative;
|
|
110
|
-
width: min(32rem, calc(100vw - 2rem));
|
|
111
|
-
border-radius: 1.5rem;
|
|
112
|
-
padding: 1.5rem;
|
|
113
|
-
background: #fffaf0;
|
|
114
|
-
color: #201510;
|
|
115
|
-
box-shadow: 0 2rem 5rem rgba(15, 23, 42, 0.35);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
71
|
.rewarded-gate__eyebrow {
|
|
119
|
-
|
|
120
|
-
font-weight: 700;
|
|
121
|
-
letter-spacing: 0.12em;
|
|
122
|
-
text-transform: uppercase;
|
|
123
|
-
color: #9a3412;
|
|
72
|
+
color: rgb(var(--v-theme-primary));
|
|
124
73
|
}
|
|
125
74
|
|
|
126
75
|
.rewarded-gate__title {
|
|
127
76
|
margin: 0.5rem 0 0;
|
|
128
|
-
|
|
129
|
-
line-height: 1.2;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.rewarded-gate__description {
|
|
133
|
-
margin: 0.75rem 0 0;
|
|
134
|
-
line-height: 1.5;
|
|
135
|
-
color: #5b4636;
|
|
77
|
+
white-space: normal;
|
|
136
78
|
}
|
|
137
79
|
|
|
138
80
|
.rewarded-gate__status {
|
|
139
81
|
margin: 1rem 0 0;
|
|
140
|
-
font-size: 0.95rem;
|
|
141
|
-
color: #854d0e;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.rewarded-gate__status--error {
|
|
145
|
-
color: #991b1b;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.rewarded-gate__actions {
|
|
149
|
-
display: flex;
|
|
150
|
-
gap: 0.75rem;
|
|
151
|
-
margin-top: 1.25rem;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.rewarded-gate__button {
|
|
155
|
-
appearance: none;
|
|
156
|
-
border: 1px solid #d6d3d1;
|
|
157
|
-
border-radius: 999px;
|
|
158
|
-
padding: 0.8rem 1.2rem;
|
|
159
|
-
background: #fff;
|
|
160
|
-
color: inherit;
|
|
161
|
-
font: inherit;
|
|
162
|
-
cursor: pointer;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.rewarded-gate__button--primary {
|
|
166
|
-
border-color: transparent;
|
|
167
|
-
background: #ea580c;
|
|
168
|
-
color: #fff;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
@media (max-width: 640px) {
|
|
172
|
-
.rewarded-gate__actions {
|
|
173
|
-
flex-direction: column;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.rewarded-gate__button {
|
|
177
|
-
width: 100%;
|
|
178
|
-
}
|
|
179
82
|
}
|
|
180
83
|
</style>
|