@ai-ecoverse/slicc-agent 3.10.0 → 3.11.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 +30 -1
- package/bin/agent +1 -1
- package/dist/client.js +9 -1
- package/dist/client.js.map +2 -2
- package/dist/control.js +11 -1
- package/dist/control.js.map +2 -2
- package/dist/host.js +5 -2
- package/dist/host.js.map +2 -2
- package/dist/main.js +15 -1
- package/dist/main.js.map +2 -2
- package/dist/scoops/cli.js +2 -0
- package/dist/scoops/cli.js.map +2 -2
- package/dist/scoops/index.js +3 -2
- package/dist/scoops/index.js.map +2 -2
- package/dist/scoops/requests.js +1 -1
- package/dist/scoops/requests.js.map +2 -2
- package/dist/services.js +3 -1
- package/dist/services.js.map +2 -2
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +2 -2
- package/dist/spectrum/index.js +5 -1
- package/dist/spectrum/index.js.map +3 -3
- package/dist/spectrum/messages.js +12 -0
- package/dist/spectrum/messages.js.map +2 -2
- package/dist/spectrum/sprinkle-port.js +37 -0
- package/dist/spectrum/sprinkle-port.js.map +7 -0
- package/dist/sprinkles/index.js +216 -0
- package/dist/sprinkles/index.js.map +7 -0
- package/dist/sprinkles/kind.js +5 -0
- package/dist/sprinkles/kind.js.map +7 -0
- package/dist/sprinkles/sprinkles.js +65 -0
- package/dist/sprinkles/sprinkles.js.map +7 -0
- package/dist/types/client.d.ts +2 -0
- package/dist/types/control.d.ts +2 -1
- package/dist/types/host.d.ts +2 -0
- package/dist/types/scoops/cli.d.ts +1 -0
- package/dist/types/scoops/index.d.ts +2 -0
- package/dist/types/scoops/requests.d.ts +1 -1
- package/dist/types/services.d.ts +11 -1
- package/dist/types/spectrum/index.d.ts +3 -0
- package/dist/types/spectrum/sprinkle-port.d.ts +10 -0
- package/dist/types/sprinkles/index.d.ts +38 -0
- package/dist/types/sprinkles/kind.d.ts +10 -0
- package/dist/types/sprinkles/sprinkles.d.ts +24 -0
- package/package.json +3 -3
- package/packages/vfs-root/skills/sprinkles/SKILL.md +58 -0
- package/packages/vfs-root/skills/welcome/SKILL.md +31 -0
- package/packages/vfs-root/sprinkles/suggestions.shtml +391 -0
- package/packages/vfs-root/sprinkles/welcome.shtml +552 -0
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Welcome</title>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<style>
|
|
8
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
9
|
+
|
|
10
|
+
body {
|
|
11
|
+
font-family: var(--s2-font-family, 'Adobe Clean', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);
|
|
12
|
+
background: transparent;
|
|
13
|
+
color: var(--s2-content-default, #e8e8e8);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.step { display: none; animation: fadeUp 0.18s ease both; }
|
|
17
|
+
.step.active { display: block; }
|
|
18
|
+
@keyframes fadeUp {
|
|
19
|
+
from { opacity: 0; transform: translateY(6px); }
|
|
20
|
+
to { opacity: 1; transform: translateY(0); }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.pills {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-wrap: wrap;
|
|
26
|
+
gap: 8px;
|
|
27
|
+
margin-top: 14px;
|
|
28
|
+
}
|
|
29
|
+
.pill {
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: 6px;
|
|
33
|
+
height: 34px;
|
|
34
|
+
padding: 0 14px;
|
|
35
|
+
border-radius: var(--s2-radius-pill, 9999px);
|
|
36
|
+
background: var(--s2-bg-elevated, #2c2c2c);
|
|
37
|
+
border: 1px solid var(--s2-border-subtle, #3a3a3a);
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
font-family: inherit;
|
|
40
|
+
font-size: 13px;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
color: var(--s2-content-default, #e8e8e8);
|
|
43
|
+
transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
|
|
44
|
+
user-select: none;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
}
|
|
47
|
+
.pill:hover {
|
|
48
|
+
background: var(--s2-bg-layer-2, #252525);
|
|
49
|
+
border-color: var(--s2-border-default, #4a4a4a);
|
|
50
|
+
}
|
|
51
|
+
.pill.selected {
|
|
52
|
+
border-color: var(--s2-accent, #3562ff);
|
|
53
|
+
box-shadow: 0 0 0 1px var(--s2-accent, #3562ff);
|
|
54
|
+
background: var(--s2-bg-layer-2, #252525);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.step-heading {
|
|
58
|
+
font-size: 15px;
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
color: var(--s2-content-default, #e8e8e8);
|
|
61
|
+
line-height: 1.3;
|
|
62
|
+
}
|
|
63
|
+
.step-sub {
|
|
64
|
+
font-size: 12px;
|
|
65
|
+
color: var(--s2-content-secondary, #a1a1a1);
|
|
66
|
+
margin-top: 3px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.input-row {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 8px;
|
|
73
|
+
margin-top: 14px;
|
|
74
|
+
background: var(--s2-bg-elevated, #2c2c2c);
|
|
75
|
+
border: 1px solid var(--s2-border-subtle, #3a3a3a);
|
|
76
|
+
border-radius: var(--s2-radius-pill, 9999px);
|
|
77
|
+
padding: 6px 6px 6px 14px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.input-row input {
|
|
81
|
+
flex: 1;
|
|
82
|
+
border: none;
|
|
83
|
+
outline: none;
|
|
84
|
+
background: transparent;
|
|
85
|
+
font-family: inherit;
|
|
86
|
+
font-size: 14px;
|
|
87
|
+
color: var(--s2-content-default, #e8e8e8);
|
|
88
|
+
}
|
|
89
|
+
.input-row input::placeholder { color: var(--s2-content-tertiary, #8a8a8a); }
|
|
90
|
+
.input-row button {
|
|
91
|
+
width: 30px;
|
|
92
|
+
height: 30px;
|
|
93
|
+
border-radius: 50%;
|
|
94
|
+
border: none;
|
|
95
|
+
background: var(--s2-accent, #3562ff);
|
|
96
|
+
color: var(--s2-gray-25, #f5f5f5);
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
flex-shrink: 0;
|
|
102
|
+
transition: background 0.15s;
|
|
103
|
+
}
|
|
104
|
+
.input-row button:hover { background: var(--s2-accent-hover, #4a75ff); }
|
|
105
|
+
|
|
106
|
+
.cta-row { margin-top: 14px; }
|
|
107
|
+
.cta {
|
|
108
|
+
display: inline-flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
padding: 8px 22px;
|
|
112
|
+
border-radius: var(--s2-radius-pill, 9999px);
|
|
113
|
+
background: var(--s2-accent, #3562ff);
|
|
114
|
+
color: var(--s2-gray-25, #f5f5f5);
|
|
115
|
+
border: none;
|
|
116
|
+
font-family: inherit;
|
|
117
|
+
font-size: 13px;
|
|
118
|
+
font-weight: 600;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
transition: background 0.15s;
|
|
121
|
+
}
|
|
122
|
+
.cta:hover { background: var(--s2-accent-hover, #4a75ff); }
|
|
123
|
+
|
|
124
|
+
.footer {
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
justify-content: space-between;
|
|
128
|
+
margin-top: 16px;
|
|
129
|
+
}
|
|
130
|
+
.dots { display: flex; gap: 5px; }
|
|
131
|
+
.dot {
|
|
132
|
+
width: 5px;
|
|
133
|
+
height: 5px;
|
|
134
|
+
border-radius: 50%;
|
|
135
|
+
background: var(--s2-gray-300, #4a4a4a);
|
|
136
|
+
transition: background 0.2s, transform 0.2s;
|
|
137
|
+
}
|
|
138
|
+
.dot.active { background: var(--s2-accent, #3562ff); transform: scale(1.3); }
|
|
139
|
+
.dot.done { background: var(--s2-accent, #3562ff); }
|
|
140
|
+
|
|
141
|
+
.skip-btn {
|
|
142
|
+
background: none;
|
|
143
|
+
border: none;
|
|
144
|
+
font-family: inherit;
|
|
145
|
+
font-size: 11px;
|
|
146
|
+
color: var(--s2-content-tertiary, #8a8a8a);
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
padding: 2px 4px;
|
|
149
|
+
}
|
|
150
|
+
.skip-btn:hover { color: var(--s2-content-secondary, #a1a1a1); }
|
|
151
|
+
|
|
152
|
+
.back-btn {
|
|
153
|
+
background: none;
|
|
154
|
+
border: none;
|
|
155
|
+
font-family: inherit;
|
|
156
|
+
font-size: 11px;
|
|
157
|
+
color: var(--s2-content-secondary, #a1a1a1);
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
display: inline-flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
gap: 3px;
|
|
162
|
+
padding: 2px 0;
|
|
163
|
+
margin-bottom: 10px;
|
|
164
|
+
}
|
|
165
|
+
.back-btn:hover { color: var(--s2-content-default, #e8e8e8); }
|
|
166
|
+
.back-btn[hidden] { display: none; }
|
|
167
|
+
|
|
168
|
+
.done-state {
|
|
169
|
+
text-align: center;
|
|
170
|
+
padding: 12px 0 4px;
|
|
171
|
+
font-size: 14px;
|
|
172
|
+
color: var(--s2-content-secondary, #a1a1a1);
|
|
173
|
+
}
|
|
174
|
+
</style>
|
|
175
|
+
</head>
|
|
176
|
+
<body>
|
|
177
|
+
<div class="sprinkle-action-card">
|
|
178
|
+
|
|
179
|
+
<div class="sprinkle-action-card__body" style="padding: 16px 24px 0">
|
|
180
|
+
<button class="back-btn" id="backBtn" hidden onclick="goBack()">
|
|
181
|
+
<i data-lucide="arrow-left" style="width:12px;height:12px"></i> Back
|
|
182
|
+
</button>
|
|
183
|
+
|
|
184
|
+
<div class="step active" id="s1">
|
|
185
|
+
<div class="step-heading">What brings you here?</div>
|
|
186
|
+
<div class="pills" id="purposePills"></div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<div class="step" id="s2">
|
|
190
|
+
<div class="step-heading" id="s2Heading">What do you do?</div>
|
|
191
|
+
<div class="pills" id="rolePills"></div>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
<div class="step" id="s3">
|
|
195
|
+
<div class="step-heading" id="s3Heading">What do you want to tackle?</div>
|
|
196
|
+
<div class="step-sub">Pick as many as you like</div>
|
|
197
|
+
<div class="pills" id="taskPills"></div>
|
|
198
|
+
<div class="cta-row">
|
|
199
|
+
<button class="cta" onclick="goStep(4)">Continue</button>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div class="step" id="s4">
|
|
204
|
+
<div class="step-heading">What should I call you?</div>
|
|
205
|
+
<div class="input-row">
|
|
206
|
+
<input type="text" id="nameIn" placeholder="Your name"
|
|
207
|
+
onkeydown="if(event.key==='Enter') advanceFrom(4)" />
|
|
208
|
+
<button onclick="advanceFrom(4)" aria-label="Continue">
|
|
209
|
+
<i data-lucide="arrow-right" style="width:14px;height:14px"></i>
|
|
210
|
+
</button>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
<div class="step" id="s5">
|
|
215
|
+
<div class="step-heading">Where do you work?</div>
|
|
216
|
+
<div class="input-row">
|
|
217
|
+
<input type="text" id="companyIn" placeholder="Company or organization"
|
|
218
|
+
onkeydown="if(event.key==='Enter') advanceFrom(5)" />
|
|
219
|
+
<button onclick="advanceFrom(5)" aria-label="Continue">
|
|
220
|
+
<i data-lucide="arrow-right" style="width:14px;height:14px"></i>
|
|
221
|
+
</button>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<div class="step" id="s6">
|
|
226
|
+
<div class="step-heading" id="s6Heading">What apps do you use most?</div>
|
|
227
|
+
<div class="step-sub">Pick any that apply</div>
|
|
228
|
+
<div class="pills" id="appPills"></div>
|
|
229
|
+
<div class="cta-row">
|
|
230
|
+
<button class="cta" onclick="finish()">Let's go</button>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<div class="step" id="sDone">
|
|
235
|
+
<div class="done-state" id="sDoneText">Setting things up…</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<div class="sprinkle-action-card__body" style="padding-top:0" id="footerArea">
|
|
240
|
+
<div class="footer">
|
|
241
|
+
<div class="dots" id="dots">
|
|
242
|
+
<div class="dot active"></div>
|
|
243
|
+
<div class="dot"></div>
|
|
244
|
+
<div class="dot"></div>
|
|
245
|
+
<div class="dot"></div>
|
|
246
|
+
<div class="dot"></div>
|
|
247
|
+
<div class="dot"></div>
|
|
248
|
+
</div>
|
|
249
|
+
<button class="skip-btn" id="skipBtn" onclick="skipStep()">skip</button>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
<script>
|
|
256
|
+
var cur = 1;
|
|
257
|
+
var profile = { purpose: '', role: '', tasks: [], name: '', company: '', apps: [] };
|
|
258
|
+
|
|
259
|
+
var ROLE_FONTS = {
|
|
260
|
+
'developer': 'monospace',
|
|
261
|
+
'designer': 'Papyrus, fantasy',
|
|
262
|
+
'product-pm': '"Comic Sans MS", "Comic Sans", cursive',
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
var TASK_HEADINGS_BY_ROLE = {
|
|
266
|
+
'developer': 'What are you hacking?',
|
|
267
|
+
'designer': 'What do you dream of?',
|
|
268
|
+
'product-pm': "What's your mission?",
|
|
269
|
+
'content-creator': "What's your story?",
|
|
270
|
+
'marketer': "What's your ambition?",
|
|
271
|
+
'founder': 'What do you want to create?',
|
|
272
|
+
'student': 'What are you learning?',
|
|
273
|
+
'researcher': 'What are you researching?',
|
|
274
|
+
};
|
|
275
|
+
var TASK_HEADING_DEFAULT = 'What do you want to tackle?';
|
|
276
|
+
|
|
277
|
+
var PURPOSES = [
|
|
278
|
+
{ id: 'work', label: 'Work', icon: 'briefcase' },
|
|
279
|
+
{ id: 'school', label: 'School', icon: 'graduation-cap' },
|
|
280
|
+
{ id: 'personal', label: 'Personal', icon: 'user' },
|
|
281
|
+
{ id: 'side-project',label: 'Side project', icon: 'lightbulb' },
|
|
282
|
+
{ id: 'exploring', label: 'Just exploring', icon: 'compass' },
|
|
283
|
+
];
|
|
284
|
+
|
|
285
|
+
var ROLES_BY_PURPOSE = {
|
|
286
|
+
work: {
|
|
287
|
+
heading: "What's your role?",
|
|
288
|
+
roles: [
|
|
289
|
+
{ id: 'developer', label: 'Developer', icon: 'code' },
|
|
290
|
+
{ id: 'designer', label: 'Designer', icon: 'palette' },
|
|
291
|
+
{ id: 'content-creator', label: 'Content creator', icon: 'pen-tool' },
|
|
292
|
+
{ id: 'marketer', label: 'Marketer', icon: 'megaphone' },
|
|
293
|
+
{ id: 'product-pm', label: 'Product / PM', icon: 'layout-dashboard' },
|
|
294
|
+
{ id: 'founder', label: 'Founder', icon: 'rocket' },
|
|
295
|
+
{ id: 'other', label: 'Something else', icon: 'help-circle' },
|
|
296
|
+
],
|
|
297
|
+
},
|
|
298
|
+
school: {
|
|
299
|
+
heading: "What are you studying?",
|
|
300
|
+
roles: [
|
|
301
|
+
{ id: 'student', label: 'Student', icon: 'book-open' },
|
|
302
|
+
{ id: 'researcher', label: 'Researcher', icon: 'microscope' },
|
|
303
|
+
{ id: 'developer', label: 'Developer', icon: 'code' },
|
|
304
|
+
{ id: 'designer', label: 'Designer', icon: 'palette' },
|
|
305
|
+
{ id: 'other', label: 'Something else', icon: 'help-circle' },
|
|
306
|
+
],
|
|
307
|
+
},
|
|
308
|
+
_default: {
|
|
309
|
+
heading: "What's your background?",
|
|
310
|
+
roles: [
|
|
311
|
+
{ id: 'developer', label: 'Developer', icon: 'code' },
|
|
312
|
+
{ id: 'designer', label: 'Designer', icon: 'palette' },
|
|
313
|
+
{ id: 'content-creator', label: 'Content creator', icon: 'pen-tool' },
|
|
314
|
+
{ id: 'marketer', label: 'Marketer', icon: 'megaphone' },
|
|
315
|
+
{ id: 'product-pm', label: 'Product / PM', icon: 'layout-dashboard' },
|
|
316
|
+
{ id: 'student', label: 'Student', icon: 'book-open' },
|
|
317
|
+
{ id: 'researcher', label: 'Researcher', icon: 'microscope' },
|
|
318
|
+
{ id: 'founder', label: 'Founder', icon: 'rocket' },
|
|
319
|
+
{ id: 'other', label: 'Something else', icon: 'help-circle' },
|
|
320
|
+
],
|
|
321
|
+
},
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
var TASKS = [
|
|
325
|
+
{ id: 'build-websites', label: 'Build websites', icon: 'globe' },
|
|
326
|
+
{ id: 'migrate-page-aem', label: 'Migrate a page to AEM', icon: 'book-up' },
|
|
327
|
+
{ id: 'automate', label: 'Automate tasks', icon: 'zap' },
|
|
328
|
+
{ id: 'research', label: 'Research & analyze', icon: 'search' },
|
|
329
|
+
{ id: 'write-content', label: 'Write content', icon: 'file-text' },
|
|
330
|
+
{ id: 'extract-data', label: 'Extract data', icon: 'database' },
|
|
331
|
+
{ id: 'monitor', label: 'Monitor sites', icon: 'activity' },
|
|
332
|
+
{ id: 'seo', label: 'SEO & audits', icon: 'bar-chart' },
|
|
333
|
+
{ id: 'manage-files', label: 'Manage files', icon: 'folder' },
|
|
334
|
+
{ id: 'browser-automation', label: 'Browser automation', icon: 'mouse-pointer' },
|
|
335
|
+
{ id: 'not-sure', label: 'Not sure yet', icon: 'circle-help' },
|
|
336
|
+
];
|
|
337
|
+
|
|
338
|
+
var APPS = [
|
|
339
|
+
{ id: 'aem', label: 'Adobe Experience Manager', icon: 'box',
|
|
340
|
+
relevance: ['build-websites','migrate-page-aem','write-content','seo','content-creator','marketer','designer'] },
|
|
341
|
+
{ id: 'imessage', label: 'iMessage', icon: 'message-circle',
|
|
342
|
+
relevance: ['personal','side-project','exploring'] },
|
|
343
|
+
{ id: 'teams', label: 'Microsoft Teams', icon: 'users',
|
|
344
|
+
relevance: ['work','school','developer','designer','marketer','product-pm','founder','student'] },
|
|
345
|
+
{ id: 'slack', label: 'Slack', icon: 'hash',
|
|
346
|
+
relevance: ['work','school','developer','designer','marketer','product-pm','founder','student'] },
|
|
347
|
+
];
|
|
348
|
+
|
|
349
|
+
function applyFontJoke(stepEl) {
|
|
350
|
+
var font = ROLE_FONTS[profile.role];
|
|
351
|
+
if (font) stepEl.style.fontFamily = font;
|
|
352
|
+
else stepEl.style.fontFamily = '';
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function makePill(item, multiSelect, onSelect, preselected) {
|
|
356
|
+
var btn = document.createElement('button');
|
|
357
|
+
btn.className = 'pill';
|
|
358
|
+
btn.dataset.id = item.id;
|
|
359
|
+
if (preselected) btn.classList.add('selected');
|
|
360
|
+
if (item.icon) {
|
|
361
|
+
var ic = document.createElement('i');
|
|
362
|
+
ic.setAttribute('data-lucide', item.icon);
|
|
363
|
+
ic.style.width = '14px';
|
|
364
|
+
ic.style.height = '14px';
|
|
365
|
+
btn.appendChild(ic);
|
|
366
|
+
}
|
|
367
|
+
btn.appendChild(document.createTextNode(item.label));
|
|
368
|
+
btn.onclick = function () {
|
|
369
|
+
if (multiSelect) {
|
|
370
|
+
btn.classList.toggle('selected');
|
|
371
|
+
} else {
|
|
372
|
+
btn.parentElement.querySelectorAll('.pill').forEach(function(p){ p.classList.remove('selected'); });
|
|
373
|
+
btn.classList.add('selected');
|
|
374
|
+
}
|
|
375
|
+
onSelect(item, btn);
|
|
376
|
+
};
|
|
377
|
+
return btn;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
function buildPills(containerId, items, multiSelect, onSelect, selectedIds) {
|
|
381
|
+
var el = document.getElementById(containerId);
|
|
382
|
+
el.innerHTML = '';
|
|
383
|
+
var pre = selectedIds || [];
|
|
384
|
+
items.forEach(function(item) {
|
|
385
|
+
el.appendChild(makePill(item, multiSelect, onSelect, pre.indexOf(item.id) >= 0));
|
|
386
|
+
});
|
|
387
|
+
if (window.LucideIcons) window.LucideIcons.render();
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function getRelevantApps() {
|
|
391
|
+
var ctx = profile.tasks.concat([profile.role, profile.purpose]);
|
|
392
|
+
return APPS.slice().sort(function(a, b) {
|
|
393
|
+
var sa = a.relevance.filter(function(t){ return ctx.indexOf(t) >= 0; }).length;
|
|
394
|
+
var sb = b.relevance.filter(function(t){ return ctx.indexOf(t) >= 0; }).length;
|
|
395
|
+
return sb - sa;
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function updateDots(step) {
|
|
400
|
+
|
|
401
|
+
var effective = step;
|
|
402
|
+
if (profile.purpose !== 'work' && step >= 5) effective = step - 1;
|
|
403
|
+
var dots = document.getElementById('dots').children;
|
|
404
|
+
for (var i = 0; i < dots.length; i++) {
|
|
405
|
+
dots[i].className = 'dot';
|
|
406
|
+
if (i + 1 === effective) dots[i].className = 'dot active';
|
|
407
|
+
else if (i + 1 < effective) dots[i].className = 'dot done';
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
dots[5].style.display = (profile.purpose !== 'work') ? 'none' : '';
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function goBack() {
|
|
414
|
+
var prev = cur - 1;
|
|
415
|
+
if (prev === 5 && profile.purpose !== 'work') prev = 4;
|
|
416
|
+
if (prev >= 1) goStep(prev);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function skipStep() {
|
|
420
|
+
if (cur === 4) {
|
|
421
|
+
profile.name = '';
|
|
422
|
+
var nameIn = document.getElementById('nameIn');
|
|
423
|
+
if (nameIn) nameIn.value = '';
|
|
424
|
+
goStep(nextStep(cur));
|
|
425
|
+
} else if (cur === 5) {
|
|
426
|
+
profile.company = '';
|
|
427
|
+
var companyIn = document.getElementById('companyIn');
|
|
428
|
+
if (companyIn) companyIn.value = '';
|
|
429
|
+
goStep(nextStep(cur));
|
|
430
|
+
} else if (cur < 6) {
|
|
431
|
+
goStep(nextStep(cur));
|
|
432
|
+
} else {
|
|
433
|
+
finish();
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
function nextStep(n) {
|
|
438
|
+
if (n === 4 && profile.purpose !== 'work') return 6;
|
|
439
|
+
return n + 1;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function advanceFrom(n) {
|
|
443
|
+
goStep(nextStep(n));
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
function goStep(n) {
|
|
447
|
+
|
|
448
|
+
if (cur === 4) profile.name = (document.getElementById('nameIn').value || '').trim();
|
|
449
|
+
if (cur === 5) profile.company = (document.getElementById('companyIn').value || '').trim();
|
|
450
|
+
|
|
451
|
+
if (n === 1) {
|
|
452
|
+
buildPills('purposePills', PURPOSES, false, function(item) {
|
|
453
|
+
profile.purpose = item.id;
|
|
454
|
+
setTimeout(function(){ goStep(2); }, 280);
|
|
455
|
+
}, profile.purpose ? [profile.purpose] : []);
|
|
456
|
+
}
|
|
457
|
+
if (n === 2) {
|
|
458
|
+
var cfg = ROLES_BY_PURPOSE[profile.purpose] || ROLES_BY_PURPOSE._default;
|
|
459
|
+
document.getElementById('s2Heading').textContent = cfg.heading;
|
|
460
|
+
buildPills('rolePills', cfg.roles, false, function(item) {
|
|
461
|
+
profile.role = item.id;
|
|
462
|
+
setTimeout(function(){ goStep(3); }, 280);
|
|
463
|
+
}, profile.role ? [profile.role] : []);
|
|
464
|
+
}
|
|
465
|
+
if (n === 3) {
|
|
466
|
+
var s3 = document.getElementById('s3');
|
|
467
|
+
applyFontJoke(s3);
|
|
468
|
+
var taskHeading = TASK_HEADINGS_BY_ROLE[profile.role] || TASK_HEADING_DEFAULT;
|
|
469
|
+
document.getElementById('s3Heading').textContent = taskHeading;
|
|
470
|
+
buildPills('taskPills', TASKS, true, function(item) {
|
|
471
|
+
profile.tasks = [];
|
|
472
|
+
document.querySelectorAll('#taskPills .pill.selected').forEach(function(p){
|
|
473
|
+
profile.tasks.push(p.dataset.id);
|
|
474
|
+
});
|
|
475
|
+
}, profile.tasks);
|
|
476
|
+
}
|
|
477
|
+
if (n === 6) {
|
|
478
|
+
var s6 = document.getElementById('s6');
|
|
479
|
+
applyFontJoke(s6);
|
|
480
|
+
buildPills('appPills', getRelevantApps(), true, function(item) {
|
|
481
|
+
profile.apps = [];
|
|
482
|
+
document.querySelectorAll('#appPills .pill.selected').forEach(function(p){
|
|
483
|
+
profile.apps.push(p.dataset.id);
|
|
484
|
+
});
|
|
485
|
+
}, profile.apps);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
document.getElementById('s' + cur).classList.remove('active');
|
|
489
|
+
document.getElementById('s' + n).classList.add('active');
|
|
490
|
+
cur = n;
|
|
491
|
+
updateDots(n);
|
|
492
|
+
|
|
493
|
+
document.getElementById('backBtn').hidden = (n <= 1 || n > 6);
|
|
494
|
+
document.getElementById('footerArea').style.display = (n > 6) ? 'none' : '';
|
|
495
|
+
|
|
496
|
+
if (n === 4) setTimeout(function(){ document.getElementById('nameIn').focus(); }, 80);
|
|
497
|
+
if (n === 5) setTimeout(function(){ document.getElementById('companyIn').focus(); }, 80);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function finish() {
|
|
501
|
+
if (!profile.name) profile.name = (document.getElementById('nameIn').value || '').trim();
|
|
502
|
+
if (!profile.company) profile.company = (document.getElementById('companyIn').value || '').trim();
|
|
503
|
+
|
|
504
|
+
document.getElementById('s' + cur).classList.remove('active');
|
|
505
|
+
document.getElementById('sDone').classList.add('active');
|
|
506
|
+
document.getElementById('footerArea').style.display = 'none';
|
|
507
|
+
document.getElementById('backBtn').hidden = true;
|
|
508
|
+
|
|
509
|
+
if (window.slicc) {
|
|
510
|
+
slicc.lick({ action: 'onboarding-complete', data: profile });
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
function startWizard() {
|
|
515
|
+
document.getElementById('sDone').classList.remove('active');
|
|
516
|
+
document.getElementById('s1').classList.add('active');
|
|
517
|
+
document.getElementById('footerArea').style.display = '';
|
|
518
|
+
|
|
519
|
+
buildPills('purposePills', PURPOSES, false, function(item) {
|
|
520
|
+
profile.purpose = item.id;
|
|
521
|
+
setTimeout(function(){ goStep(2); }, 280);
|
|
522
|
+
}, profile.purpose ? [profile.purpose] : []);
|
|
523
|
+
|
|
524
|
+
updateDots(1);
|
|
525
|
+
document.getElementById('backBtn').hidden = true;
|
|
526
|
+
document.getElementById('dots').children[5].style.display = 'none';
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
function showAlreadyComplete() {
|
|
530
|
+
var wizard = document.querySelector('.sprinkle-action-card');
|
|
531
|
+
if (wizard) wizard.remove();
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
['s1','s2','s3','s4','s5','s6','sDone'].forEach(function(id){
|
|
535
|
+
var el = document.getElementById(id);
|
|
536
|
+
if (el) el.classList.remove('active');
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
function bootByMarker() {
|
|
540
|
+
if (!window.slicc || typeof slicc.exists !== 'function') {
|
|
541
|
+
startWizard();
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
Promise.resolve(slicc.exists('/shared/.welcomed')).then(
|
|
545
|
+
function(welcomed) { welcomed ? showAlreadyComplete() : startWizard(); },
|
|
546
|
+
function() { startWizard(); }
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
bootByMarker();
|
|
550
|
+
</script>
|
|
551
|
+
</body>
|
|
552
|
+
</html>
|