@wix/himalaya-cli 0.1261.0 → 0.1263.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/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/tokens.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +26 -0
- package/dist/cli.mjs +155 -38
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +2 -0
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +45 -7
- package/templates/beauty-salon/tier5-src/_shared/home-service.ts +18 -5
- package/templates/beauty-salon-owner/dev/index.ts +301 -94
- package/templates/beauty-salon-owner/tier5-src/_shared/home-service.ts +18 -5
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-product-form/index.ts +21 -7
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-service-form/index.ts +10 -8
- package/templates/branded-lite/dev/index.ts +45 -7
- package/templates/branded-lite/tier5-src/_shared/home-service.ts +18 -5
- package/templates/community-club/dev/index.ts +45 -7
- package/templates/community-club/tier5-src/_shared/home-service.ts +18 -5
- package/templates/community-club-owner/dev/index.ts +237 -78
- package/templates/community-club-owner/tier5-src/_shared/home-service.ts +18 -5
- package/templates/community-club-owner/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/community-club-owner/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/community-club-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -6
- package/templates/community-club-owner/tier5-src/himi-owner-lite-product-form/index.ts +21 -7
- package/templates/events-meetups/dev/index.ts +45 -7
- package/templates/events-meetups/tier5-src/_shared/home-service.ts +18 -5
- package/templates/events-meetups-owner/dev/index.ts +141 -54
- package/templates/events-meetups-owner/tier5-src/_shared/home-service.ts +18 -5
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -6
- package/templates/gym-fitness/dev/index.ts +45 -7
- package/templates/gym-fitness/tier5-src/_shared/home-service.ts +18 -5
- package/templates/gym-fitness-owner/dev/index.ts +333 -102
- package/templates/gym-fitness-owner/tier5-src/_shared/home-service.ts +18 -5
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -6
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-product-form/index.ts +21 -7
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-service-form/index.ts +10 -8
- package/templates/nonprofit-cause/dev/index.ts +45 -7
- package/templates/nonprofit-cause/tier5-src/_shared/home-service.ts +18 -5
- package/templates/nonprofit-cause-owner/dev/index.ts +237 -78
- package/templates/nonprofit-cause-owner/tier5-src/_shared/home-service.ts +18 -5
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -6
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-service-form/index.ts +10 -8
- package/templates/owner-lite/dev/index.ts +333 -102
- package/templates/owner-lite/tier5-src/_shared/home-service.ts +18 -5
- package/templates/owner-lite/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/owner-lite/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/owner-lite/tier5-src/himi-owner-lite-event-form/index.ts +16 -6
- package/templates/owner-lite/tier5-src/himi-owner-lite-product-form/index.ts +21 -7
- package/templates/owner-lite/tier5-src/himi-owner-lite-service-form/index.ts +10 -8
- package/templates/podcast-creator/dev/index.ts +45 -7
- package/templates/podcast-creator/tier5-src/_shared/home-service.ts +18 -5
- package/templates/podcast-creator-owner/dev/index.ts +237 -78
- package/templates/podcast-creator-owner/tier5-src/_shared/home-service.ts +18 -5
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -6
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-product-form/index.ts +21 -7
- package/templates/portfolio-creative/dev/index.ts +45 -7
- package/templates/portfolio-creative/tier5-src/_shared/home-service.ts +18 -5
- package/templates/portfolio-creative-owner/dev/index.ts +301 -94
- package/templates/portfolio-creative-owner/tier5-src/_shared/home-service.ts +18 -5
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-product-form/index.ts +21 -7
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-service-form/index.ts +10 -8
- package/templates/restaurant/dev/index.ts +45 -7
- package/templates/restaurant/tier5-src/_shared/home-service.ts +18 -5
- package/templates/restaurant-owner/dev/index.ts +333 -102
- package/templates/restaurant-owner/tier5-src/_shared/home-service.ts +18 -5
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -6
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-product-form/index.ts +21 -7
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-service-form/index.ts +10 -8
- package/templates/retail-store/dev/index.ts +45 -7
- package/templates/retail-store/tier5-src/_shared/home-service.ts +18 -5
- package/templates/retail-store-owner/dev/index.ts +205 -70
- package/templates/retail-store-owner/tier5-src/_shared/home-service.ts +18 -5
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-product-form/index.ts +21 -7
- package/templates/yoga-studio/dev/index.ts +45 -7
- package/templates/yoga-studio/tier5-src/_shared/home-service.ts +18 -5
- package/templates/yoga-studio-owner/dev/index.ts +237 -78
- package/templates/yoga-studio-owner/tier5-src/_shared/home-service.ts +18 -5
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-ask/index.ts +5 -0
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-drawer/logic.ts +3 -0
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -6
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-service-form/index.ts +10 -8
|
@@ -2191,6 +2191,9 @@ const SCREENS = runtimeSetting({
|
|
|
2191
2191
|
"type": "BottomSheet",
|
|
2192
2192
|
"props": {
|
|
2193
2193
|
"presentedPath": "$service:himiBrandedHome.homeModules.presented",
|
|
2194
|
+
"detents": [
|
|
2195
|
+
0.95
|
|
2196
|
+
],
|
|
2194
2197
|
"dismissible": true,
|
|
2195
2198
|
"showGrabber": true,
|
|
2196
2199
|
"onDismiss": {
|
|
@@ -2292,6 +2295,9 @@ const SCREENS = runtimeSetting({
|
|
|
2292
2295
|
}
|
|
2293
2296
|
}
|
|
2294
2297
|
}
|
|
2298
|
+
},
|
|
2299
|
+
"modifiers": {
|
|
2300
|
+
"accessibilityLabel": "$item.pinA11yLabel"
|
|
2295
2301
|
}
|
|
2296
2302
|
},
|
|
2297
2303
|
{
|
|
@@ -2309,31 +2315,63 @@ const SCREENS = runtimeSetting({
|
|
|
2309
2315
|
}
|
|
2310
2316
|
}
|
|
2311
2317
|
}
|
|
2318
|
+
},
|
|
2319
|
+
"modifiers": {
|
|
2320
|
+
"accessibilityLabel": "$item.visibilityA11yLabel"
|
|
2312
2321
|
}
|
|
2313
|
-
}
|
|
2322
|
+
}
|
|
2323
|
+
]
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
},
|
|
2327
|
+
{
|
|
2328
|
+
"id": "",
|
|
2329
|
+
"body": {
|
|
2330
|
+
"package": "himalaya",
|
|
2331
|
+
"type": "HStack",
|
|
2332
|
+
"props": {
|
|
2333
|
+
"spacing": 8,
|
|
2334
|
+
"children": [
|
|
2314
2335
|
{
|
|
2315
|
-
"id": "",
|
|
2336
|
+
"id": "btn_tier5_himibrandedhome_homemoveup",
|
|
2316
2337
|
"body": {
|
|
2317
2338
|
"package": "himalaya",
|
|
2318
|
-
"type": "
|
|
2319
|
-
"props": {
|
|
2339
|
+
"type": "Button",
|
|
2340
|
+
"props": {
|
|
2341
|
+
"title": "Move up",
|
|
2342
|
+
"style": "plain",
|
|
2343
|
+
"action": {
|
|
2344
|
+
"actionId": "tier5.himiBrandedHome.homeMoveUp",
|
|
2345
|
+
"params": {
|
|
2346
|
+
"id": "$item.id"
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
},
|
|
2351
|
+
"modifiers": {
|
|
2352
|
+
"accessibilityLabel": "$item.moveUpA11yLabel",
|
|
2353
|
+
"hiddenPath": "$item.isFirst"
|
|
2320
2354
|
}
|
|
2321
2355
|
},
|
|
2322
2356
|
{
|
|
2323
|
-
"id": "
|
|
2357
|
+
"id": "btn_tier5_himibrandedhome_homemovedown",
|
|
2324
2358
|
"body": {
|
|
2325
2359
|
"package": "himalaya",
|
|
2326
2360
|
"type": "Button",
|
|
2327
2361
|
"props": {
|
|
2328
|
-
"title": "Move
|
|
2362
|
+
"title": "Move down",
|
|
2329
2363
|
"style": "plain",
|
|
2330
2364
|
"action": {
|
|
2331
|
-
"actionId": "tier5.himiBrandedHome.
|
|
2365
|
+
"actionId": "tier5.himiBrandedHome.homeMoveDown",
|
|
2332
2366
|
"params": {
|
|
2333
2367
|
"id": "$item.id"
|
|
2334
2368
|
}
|
|
2335
2369
|
}
|
|
2336
2370
|
}
|
|
2371
|
+
},
|
|
2372
|
+
"modifiers": {
|
|
2373
|
+
"accessibilityLabel": "$item.moveDownA11yLabel",
|
|
2374
|
+
"hiddenPath": "$item.isLast"
|
|
2337
2375
|
}
|
|
2338
2376
|
}
|
|
2339
2377
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineService as register, type ServiceDefinition } from '@himalaya/state';
|
|
2
2
|
import { normalizeHome, visibleHome, moduleIsEmpty, type HomeModule, type HomePreferences } from './home-modules.js';
|
|
3
|
-
import { copyParam, stashCopy } from './himi-copy.js';
|
|
3
|
+
import { copyParam, copyTemplate, stashCopy } from './himi-copy.js';
|
|
4
4
|
import { localPreferences } from './local-preferences.js';
|
|
5
5
|
type State = Record<string, unknown>;
|
|
6
6
|
type Action = (s: State, ...args: unknown[]) => State | undefined | Promise<State | undefined>;
|
|
@@ -32,10 +32,22 @@ export function decorateHome(def: { state: State; actions?: Record<string, Actio
|
|
|
32
32
|
return { ...s, homeModules: { presented, visible: painted.map(id => ({ id })),
|
|
33
33
|
persistenceLabel: persisted.available ? copyParam('homeModules.onDevice', 'Saved on this device') : copyParam('homeModules.sessionOnly', 'Choices last for this session'),
|
|
34
34
|
slots: Object.fromEntries(modules.map((_, i) => [`slot${i}`, order[i] ?? 'empty'])),
|
|
35
|
-
choices: prefs.order.map(id =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
choices: prefs.order.map((id, index) => {
|
|
36
|
+
const module = modules.find(candidate => candidate.id === id);
|
|
37
|
+
const name = module?.label ?? id;
|
|
38
|
+
const isHidden = prefs.hidden.includes(id);
|
|
39
|
+
const isPinned = prefs.pinned.includes(id);
|
|
40
|
+
return { ...module,
|
|
41
|
+
isFirst: index === 0,
|
|
42
|
+
isLast: index === prefs.order.length - 1,
|
|
43
|
+
visibility: isHidden ? copyParam('homeModules.show', 'Show') : copyParam('homeModules.hide', 'Hide'),
|
|
44
|
+
pinLabel: isPinned ? copyParam('homeModules.unpin', 'Unpin') : copyParam('homeModules.pin', 'Pin'),
|
|
45
|
+
visibilityA11yLabel: copyTemplate(isHidden ? 'homeModules.showA11y' : 'homeModules.hideA11y', isHidden ? 'Show {module}' : 'Hide {module}', { module: name }),
|
|
46
|
+
pinA11yLabel: copyTemplate(isPinned ? 'homeModules.unpinA11y' : 'homeModules.pinA11y', isPinned ? 'Unpin {module}' : 'Pin {module}', { module: name }),
|
|
47
|
+
moveUpA11yLabel: copyTemplate('homeModules.moveUpA11y', 'Move {module} up', { module: name }),
|
|
48
|
+
moveDownA11yLabel: copyTemplate('homeModules.moveDownA11y', 'Move {module} down', { module: name }),
|
|
49
|
+
};
|
|
50
|
+
}) } };
|
|
39
51
|
};
|
|
40
52
|
const actions: Record<string, Action> = {};
|
|
41
53
|
for (const [name, action] of Object.entries(def.actions ?? {})) actions[name] = (s, ...args) => {
|
|
@@ -72,6 +84,7 @@ export function decorateHome(def: { state: State; actions?: Record<string, Actio
|
|
|
72
84
|
actions.homeToggle = change(id => { if (modules.some(m => m.id === id)) prefs.hidden = prefs.hidden.includes(id) ? prefs.hidden.filter(x => x !== id) : [...prefs.hidden, id]; });
|
|
73
85
|
actions.homePin = change(id => { if (modules.some(m => m.id === id)) { prefs.pinned = prefs.pinned.includes(id) ? prefs.pinned.filter(x => x !== id) : [...prefs.pinned, id]; prefs.hidden = prefs.hidden.filter(x => x !== id); } });
|
|
74
86
|
actions.homeMoveUp = change(id => { const index = prefs.order.indexOf(id); if (index > 0) [prefs.order[index - 1], prefs.order[index]] = [prefs.order[index], prefs.order[index - 1]]; });
|
|
87
|
+
actions.homeMoveDown = change(id => { const index = prefs.order.indexOf(id); if (index >= 0 && index < prefs.order.length - 1) [prefs.order[index], prefs.order[index + 1]] = [prefs.order[index + 1], prefs.order[index]]; });
|
|
75
88
|
return { state: derive(def.state), actions };
|
|
76
89
|
}
|
|
77
90
|
export const defineService: typeof register = ((name: string, def: ServiceDefinition<unknown>) => register(name, decorateHome(def as unknown as { state: State; actions?: Record<string, Action> }))) as typeof register;
|