@wix/himalaya-cli 0.1032.0 → 0.1034.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/cli.mjs +0 -2
- package/guides/getting-started.md +6 -2
- package/guides/wix-site-to-himi-app.md +9 -1
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +398 -1
- package/templates/beauty-salon/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/beauty-salon/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/beauty-salon/tier5-src/himi-store-saved/index.ts +3 -2
- package/templates/beauty-salon/tier5-src/wix-spaces-collections/index.ts +3 -2
- package/templates/beauty-salon/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/beauty-salon/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/beauty-salon-owner/dev/index.ts +1216 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/branded-lite/dev/index.ts +2239 -343
- package/templates/branded-lite/tier5-src/_shared/branded-load-state.ts +106 -0
- package/templates/branded-lite/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/branded-lite/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/branded-lite/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-badges/index.ts +20 -16
- package/templates/branded-lite/tier5-src/himi-branded-lite-coupons/index.ts +20 -20
- package/templates/branded-lite/tier5-src/himi-branded-lite-donations/index.ts +20 -16
- package/templates/branded-lite/tier5-src/himi-branded-lite-forms/index.ts +23 -31
- package/templates/branded-lite/tier5-src/himi-branded-lite-galleries/index.ts +19 -14
- package/templates/branded-lite/tier5-src/himi-branded-lite-giftcards/index.ts +20 -16
- package/templates/branded-lite/tier5-src/himi-branded-lite-inbox/index.ts +20 -15
- package/templates/branded-lite/tier5-src/himi-branded-lite-invoices/index.ts +20 -16
- package/templates/branded-lite/tier5-src/himi-branded-lite-loyalty/index.ts +20 -17
- package/templates/branded-lite/tier5-src/himi-branded-lite-notifications/index.ts +20 -18
- package/templates/branded-lite/tier5-src/himi-branded-lite-notifsettings/index.ts +23 -19
- package/templates/branded-lite/tier5-src/himi-branded-lite-podcasts/index.ts +1 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-reservations/index.ts +24 -20
- package/templates/branded-lite/tier5-src/himi-branded-lite-reviews/index.ts +20 -17
- package/templates/branded-lite/tier5-src/himi-branded-lite-videos/index.ts +19 -15
- package/templates/branded-lite/tier5-src/himi-store-saved/index.ts +3 -2
- package/templates/branded-lite/tier5-src/wix-spaces-collections/index.ts +3 -2
- package/templates/branded-lite/tier5-src/wix-spaces-forum/index.ts +3 -2
- package/templates/branded-lite/tier5-src/wix-spaces-members/index.ts +19 -6
- package/templates/branded-lite/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/branded-lite/tier5-src/wix-spaces-new-message/index.ts +3 -2
- package/templates/branded-lite/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/community-club/dev/index.ts +283 -2
- package/templates/community-club/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/community-club/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/community-club/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/community-club/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/community-club-owner/dev/index.ts +1216 -0
- package/templates/community-club-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/events-meetups/dev/index.ts +197 -1
- package/templates/events-meetups/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/events-meetups/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/events-meetups/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/events-meetups/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/events-meetups-owner/dev/index.ts +1088 -0
- package/templates/events-meetups-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/gym-fitness/dev/index.ts +462 -1
- package/templates/gym-fitness/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/gym-fitness/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/gym-fitness/tier5-src/himi-store-saved/index.ts +3 -2
- package/templates/gym-fitness/tier5-src/wix-spaces-collections/index.ts +3 -2
- package/templates/gym-fitness/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/gym-fitness/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/gym-fitness-owner/dev/index.ts +1280 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/nonprofit-cause/dev/index.ts +264 -1
- package/templates/nonprofit-cause/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/nonprofit-cause/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/nonprofit-cause/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/nonprofit-cause/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/nonprofit-cause-owner/dev/index.ts +1152 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/owner-lite/dev/index.ts +1280 -0
- package/templates/owner-lite/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/owner-lite/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/podcast-creator/dev/index.ts +286 -23
- package/templates/podcast-creator/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/podcast-creator/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/podcast-creator/tier5-src/himi-branded-lite-podcasts/index.ts +1 -1
- package/templates/podcast-creator/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/podcast-creator/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/podcast-creator-owner/dev/index.ts +1216 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/portfolio-creative/dev/index.ts +353 -23
- package/templates/portfolio-creative/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/portfolio-creative/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/portfolio-creative/tier5-src/himi-store-saved/index.ts +3 -2
- package/templates/portfolio-creative/tier5-src/wix-spaces-collections/index.ts +3 -2
- package/templates/portfolio-creative/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/portfolio-creative-owner/dev/index.ts +1216 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/restaurant/dev/index.ts +197 -1
- package/templates/restaurant/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/restaurant/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/restaurant/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/restaurant/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/restaurant-owner/dev/index.ts +1280 -0
- package/templates/restaurant-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/retail-store/dev/index.ts +203 -1
- package/templates/retail-store/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/retail-store/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/retail-store/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/retail-store/tier5-src/himi-store-saved/index.ts +3 -2
- package/templates/retail-store/tier5-src/wix-spaces-collections/index.ts +3 -2
- package/templates/retail-store/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/retail-store-owner/dev/index.ts +1152 -0
- package/templates/retail-store-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/yoga-studio/dev/index.ts +392 -1
- package/templates/yoga-studio/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +36 -5
- package/templates/yoga-studio/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/yoga-studio/tier5-src/wix-spaces-my-subscriptions/index.ts +11 -2
- package/templates/yoga-studio/tier5-src/wix-spaces-whats-new/index.ts +3 -2
- package/templates/yoga-studio-owner/dev/index.ts +1152 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +36 -5
|
@@ -30,6 +30,9 @@ export interface CollectionConfig {
|
|
|
30
30
|
* `screenId` opens that screen with the row id; without it the verb reuses the
|
|
31
31
|
* row's own tap action (the detail screen that owns the verb). */
|
|
32
32
|
primaryVerb?: { label: string; screenId?: string };
|
|
33
|
+
/** A state field the DOMAIN narrows `rows` by (e.g. a category picker). While it is set,
|
|
34
|
+
* zero rows is a filtered result, not an empty source. */
|
|
35
|
+
narrowedBy?: string;
|
|
33
36
|
}
|
|
34
37
|
/** At or below this many records, with no query/filter narrowing them and no further
|
|
35
38
|
* page, the list/grid toggle, Refine, chips, search and count are noise. */
|
|
@@ -41,7 +44,7 @@ export const COLLECTIONS: Record<string, CollectionConfig> = {
|
|
|
41
44
|
defaultFilter: 'value:Upcoming', searchPlaceholder: 'Exact booking ID', filterValues: ['Upcoming', 'Past', 'Cancelled'],
|
|
42
45
|
sortLabels: { default: 'Soonest', az: 'Oldest', za: 'Latest' } },
|
|
43
46
|
himiEvents: { rows: 'results', title: 'title', subtitle: 'dateLine', image: 'image', view: 'grid', backendQuery: true, searchPlaceholder: 'Exact event title', filterValues: ['Upcoming', 'Past'], sortLabels: { default: 'Date', az: 'Title A–Z', za: 'Title Z–A' }, primaryVerb: { label: 'Register' } },
|
|
44
|
-
himiBlogFeed: { rows: 'posts', title: 'title', subtitle: 'excerpt', image: 'image', filter: 'category', filterValuesFrom: 'categories', view: 'grid' },
|
|
47
|
+
himiBlogFeed: { rows: 'posts', title: 'title', subtitle: 'excerpt', image: 'image', filter: 'category', filterValuesFrom: 'categories', view: 'grid', narrowedBy: 'selectedCategoryId' },
|
|
45
48
|
himiOwnerLiteProducts: { rows: 'products', title: 'name', subtitle: 'price', image: 'image', view: 'grid', backendQuery: true },
|
|
46
49
|
himiOwnerModules: { instanceInput: 'module', rows: 'rows', title: 'title', subtitle: 'subtitle', image: 'image', filter: 'statusLabel', view: 'list', paged: true, reviewAction: 'prepareRecord', reviewSelectedAction: 'prepareSelected' },
|
|
47
50
|
himiOwnerLiteServices: { rows: 'services', title: 'name', subtitle: 'subtitle', view: 'list', backendQuery: true, searchPlaceholder: 'Service name starts with…' },
|
|
@@ -122,14 +122,38 @@ export function decorateCollection(name: string, def: { state: State; actions?:
|
|
|
122
122
|
const errored = s.status === 'error' || s.isErrored === true || s.errored === true || backendState?.status === 'error';
|
|
123
123
|
const domainError = typeof s.error === 'string' ? s.error.trim() : '';
|
|
124
124
|
const queryError = typeof backendState?.error === 'string' ? backendState.error.trim() : '';
|
|
125
|
-
|
|
125
|
+
// Some domains carry their failure sentence in `emptyText` (portfolio, podcasts);
|
|
126
|
+
// the screen folds that node into this block, so keep the domain's own words.
|
|
127
|
+
const domainEmptyError = errored && typeof s.emptyText === 'string' ? s.emptyText.trim() : '';
|
|
128
|
+
const errorMessage = queryError || domainError || domainEmptyError || copyParam('collection.loadError', 'This collection could not load. Try again.');
|
|
126
129
|
const canRetry = !!backend || typeof def.actions?.refresh === 'function' || typeof def.actions?.load === 'function' || typeof def.actions?.collectionRetry === 'function';
|
|
130
|
+
// Wix refused the visitor: retrying cannot help, signing in can.
|
|
131
|
+
const signInRequired = errored && s.signInRequired === true;
|
|
132
|
+
// "the source has nothing" and "your filter matched nothing" are
|
|
133
|
+
// different states. Only the second may offer "Clear filters", and the list chrome
|
|
134
|
+
// (view, refine, chips, counter, search) means nothing over a source with no rows.
|
|
135
|
+
// Loaded-row collections hold the whole source in `rows`, so zero rows IS an empty
|
|
136
|
+
// source. A backend query returns only matches, so zero rows is source-empty only
|
|
137
|
+
// when nothing narrowed it.
|
|
138
|
+
// Anything the customer (or the domain) narrowed the result by. While narrowed, zero rows
|
|
139
|
+
// is "your filter matched nothing" and the controls that got them here must stay.
|
|
140
|
+
// The DOMAIN's own filter (config.narrowedBy, e.g. blog category) narrowed the rows: the
|
|
141
|
+
// domain owns that empty state and its clear action. The shared "Clear filters" block
|
|
142
|
+
// cannot reset a domain filter, so it never shows for one.
|
|
143
|
+
const domainNarrowed = !!config.narrowedBy && !!s[config.narrowedBy];
|
|
127
144
|
// A default view is what the screen opens on; anything else is the member's own
|
|
128
145
|
// narrowing, which keeps the chrome (and the Clear that undoes it) on screen.
|
|
129
146
|
// "All" and the collection's own default (e.g. Upcoming) are both un-narrowed: Clear
|
|
130
147
|
// resets to "All", so showing it on either would offer a reset that changes nothing.
|
|
131
|
-
const narrowed = !!prefs.query.trim() || (prefs.filter !== 'all' && prefs.filter !== initialCollection(config).filter);
|
|
132
|
-
const
|
|
148
|
+
const narrowed = !!prefs.query.trim() || (prefs.filter !== 'all' && prefs.filter !== initialCollection(config).filter) || domainNarrowed;
|
|
149
|
+
const sourceEmpty = !loading && !errored && rows.length === 0 &&
|
|
150
|
+
(!(backend && config.backendQuery) || !narrowed) && !domainNarrowed;
|
|
151
|
+
const emptySourceText = (typeof s.emptyText === 'string' && s.emptyText.trim()) || copyParam('collection.emptySource', 'Nothing here yet');
|
|
152
|
+
// Chrome is noise over a small un-narrowed list (fewer than COLLECTION_CHROME_MIN_ITEMS
|
|
153
|
+
// records, no further page), over an empty source, and before the FIRST load or an
|
|
154
|
+
// un-narrowed failure. A re-query while typing keeps it (and the search field's focus).
|
|
155
|
+
const hideChrome = (!narrowed && !s.nextCursor && projected.loaded < COLLECTION_CHROME_MIN_ITEMS)
|
|
156
|
+
|| sourceEmpty || ((loading || errored) && rows.length === 0 && !narrowed);
|
|
133
157
|
return { ...s, collection: { ...prefs, ...projected,
|
|
134
158
|
hideChrome, noActiveCriteria: !narrowed,
|
|
135
159
|
viewName, viewMessage, saveMessage, noSavedViews: prefs.savedViews.length === 0,
|
|
@@ -138,8 +162,15 @@ export function decorateCollection(name: string, def: { state: State; actions?:
|
|
|
138
162
|
noPageError: s.pageError !== true,
|
|
139
163
|
noOffline: s.fromCache !== true,
|
|
140
164
|
noError: !errored,
|
|
141
|
-
noRetry: !canRetry,
|
|
165
|
+
noRetry: !canRetry || signInRequired,
|
|
166
|
+
noSignIn: !signInRequired,
|
|
167
|
+
errorTitle: signInRequired ? copyParam('collection.signInTitle', 'Sign in to see this') : copyParam('collection.loadErrorTitle', 'This collection could not load'),
|
|
142
168
|
errorMessage,
|
|
169
|
+
noLoading: !loading,
|
|
170
|
+
// De-dup against a domain that paints its OWN empty block (screen-kit emptyBlock is
|
|
171
|
+
// gated on the domain's top-level `noEmpty`): only one empty state ever shows.
|
|
172
|
+
noEmptySource: !sourceEmpty || s.noEmpty === false,
|
|
173
|
+
emptySourceText,
|
|
143
174
|
hideList: prefs.view !== 'list', hideGrid: prefs.view !== 'grid',
|
|
144
175
|
hideComfortable: prefs.density !== 'comfortable', hideCompact: prefs.density !== 'compact',
|
|
145
176
|
selectingLabel: prefs.selecting ? copyParam('collection.done', 'Done') : copyParam('collection.select', 'Select'),
|
|
@@ -147,7 +178,7 @@ export function decorateCollection(name: string, def: { state: State; actions?:
|
|
|
147
178
|
cannotSaveSelected: !prefs.selectedIds.length || prefs.selectedIds.some(id => !rows.some(row => collectionId(row) === id)),
|
|
148
179
|
filtersPresented, previewPresented: !!previewId, preview: projected.items.filter(row => row.collectionId === previewId),
|
|
149
180
|
persistenceLabel: persisted.available ? copyParam('collection.onDevice', 'Saved on this device') : copyParam('collection.sessionOnly', 'Choices last for this session'),
|
|
150
|
-
noEmpty: loading || errored || projected.items.length > 0,
|
|
181
|
+
noEmpty: loading || errored || sourceEmpty || domainNarrowed || projected.items.length > 0,
|
|
151
182
|
summary: backend && config.backendQuery
|
|
152
183
|
? (s.fromCache ? copyParam('collection.cached', 'Saved offline · may be outdated')
|
|
153
184
|
: typeof s.total === 'number' ? `${projected.items.length} / ${s.total} ${copyParam('collection.results', 'results')}`
|