@wix/himalaya-cli 0.1260.0 → 0.1262.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 +36 -22
- package/dist/preview-assets.generated.bin +0 -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 +45 -7
- package/templates/beauty-salon-owner/tier5-src/_shared/home-service.ts +18 -5
- 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 +45 -7
- package/templates/community-club-owner/tier5-src/_shared/home-service.ts +18 -5
- 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 +45 -7
- package/templates/events-meetups-owner/tier5-src/_shared/home-service.ts +18 -5
- 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 +45 -7
- package/templates/gym-fitness-owner/tier5-src/_shared/home-service.ts +18 -5
- 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 +45 -7
- package/templates/nonprofit-cause-owner/tier5-src/_shared/home-service.ts +18 -5
- 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 +45 -7
- package/templates/owner-lite/tier5-src/_shared/home-service.ts +18 -5
- 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 +45 -7
- package/templates/podcast-creator-owner/tier5-src/_shared/home-service.ts +18 -5
- 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 +45 -7
- package/templates/portfolio-creative-owner/tier5-src/_shared/home-service.ts +18 -5
- 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 +45 -7
- package/templates/restaurant-owner/tier5-src/_shared/home-service.ts +18 -5
- 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 +45 -7
- package/templates/retail-store-owner/tier5-src/_shared/home-service.ts +18 -5
- 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 +45 -7
- package/templates/yoga-studio-owner/tier5-src/_shared/home-service.ts +18 -5
- 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
package/dist/cli.mjs
CHANGED
|
@@ -6927,6 +6927,7 @@ function resolveTranslation(value, catalog, sourceCatalog) {
|
|
|
6927
6927
|
var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
|
|
6928
6928
|
var init_bindings = __esm({
|
|
6929
6929
|
"../../core/ts/src/bindings.ts"() {
|
|
6930
|
+
"use strict";
|
|
6930
6931
|
BINDING_SIGILS = ["service", "flag", "item", "t"];
|
|
6931
6932
|
BINDING_SIGIL_RE = new RegExp(
|
|
6932
6933
|
`^\\$(?:${BINDING_SIGILS.filter((s2) => s2 !== "t").join("|")})\\b|^\\$t:`
|
|
@@ -116690,9 +116691,12 @@ function hasInteractiveDescendant(node) {
|
|
|
116690
116691
|
if (nested.type === "ListItem" && nested.props?.onTap) return true;
|
|
116691
116692
|
if (nested.type === "Chip" && !nested.props?.disabled && (nested.props?.onTap || nested.props?.onRemove)) return true;
|
|
116692
116693
|
if (nested.type === "Rating" && nested.props?.interactive === true) return true;
|
|
116693
|
-
if (
|
|
116694
|
+
if (nested.type === "MonthCalendar" && (nested.props?.onSelectDate || nested.props?.onMonthChange || nested.props?.onSelectRange)) return true;
|
|
116695
|
+
const tappableCalendarEvents = Boolean(nested.props?.eventsPath) || Array.isArray(nested.props?.events) && nested.props.events.some((event) => Boolean(event?.onTap));
|
|
116696
|
+
if (nested.type === "TimeGrid" && (nested.props?.onSelectEvent || nested.props?.onRangeChange || nested.props?.onEventChange || nested.props?.onCreate || tappableCalendarEvents)) return true;
|
|
116697
|
+
if (nested.type === "Agenda" && (nested.props?.onSelectEvent || tappableCalendarEvents)) return true;
|
|
116694
116698
|
if (nested.type === "ColorPicker" && nested.props?.onChange) return true;
|
|
116695
|
-
if (nested.type === "Fab" && nested.props?.
|
|
116699
|
+
if (nested.type === "Fab" && nested.props?.action) return true;
|
|
116696
116700
|
const nestedModifierTap = nested.modifiers?.onTap ?? nested.modifiers?.on_tap ?? nested.modifiers?.onDoubleTap ?? nested.modifiers?.on_double_tap;
|
|
116697
116701
|
const nestedTapDisabled = nested.props?.disabled === true || nested.props?.loading === true || nested.modifiers?.disabled === true || nested.modifiers?.hitTestable === false || nested.modifiers?.hit_testable === false;
|
|
116698
116702
|
if (nestedModifierTap && !nestedTapDisabled) return true;
|
|
@@ -117733,6 +117737,9 @@ function renderNodeInner(node, ctx) {
|
|
|
117733
117737
|
const prevOnClick = el2.props.onClick;
|
|
117734
117738
|
extra.onClick = (e2) => {
|
|
117735
117739
|
e2.stopPropagation();
|
|
117740
|
+
const target = e2.target;
|
|
117741
|
+
const nestedControl = tapActivator && typeof target.closest === "function" ? target.closest(NESTED_CONTROL_SELECTOR) : null;
|
|
117742
|
+
if (nestedControl && nestedControl !== e2.currentTarget && !nestedControl.hasAttribute(TAP_ACTIVATOR_ATTR)) return;
|
|
117736
117743
|
prevOnClick?.(e2);
|
|
117737
117744
|
ctx.onAction(resolveItemDeep2(tap, ctx));
|
|
117738
117745
|
};
|
|
@@ -118361,11 +118368,17 @@ function renderInner(node, ctx) {
|
|
|
118361
118368
|
const dim = props.size === "small" ? 40 : props.size === "large" ? 64 : 56;
|
|
118362
118369
|
const isz = props.size === "small" ? 18 : props.size === "large" ? 28 : 24;
|
|
118363
118370
|
const extended = props.label != null && props.label !== "";
|
|
118364
|
-
const
|
|
118365
|
-
|
|
118371
|
+
const actionable = Boolean(props.action);
|
|
118372
|
+
const style = { display: "inline-flex", alignItems: "center", justifyContent: "center", gap: extended ? 10 : 0, height: dim, width: extended ? void 0 : dim, padding: extended ? "0 20px" : 0, borderRadius: extended ? dim / 2 : "50%", background: bg, color: fg, boxShadow: "0 4px 12px rgba(0,0,0,.22)", cursor: actionable ? "pointer" : "default", ...wrap };
|
|
118373
|
+
const content = /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
118366
118374
|
props.icon && /* @__PURE__ */ jsx9("span", { style: { display: "inline-grid", placeItems: "center", width: isz, height: isz }, children: iconSvg(props.icon, { size: isz, color: fg }) }),
|
|
118367
118375
|
extended && /* @__PURE__ */ jsx9("span", { style: { fontFamily: bodyFont(ctx), fontWeight: 600, fontSize: pxToRem(15) }, children: txt(props.label, ctx) })
|
|
118368
118376
|
] });
|
|
118377
|
+
if (!actionable) return /* @__PURE__ */ jsx9("div", { style, children: content });
|
|
118378
|
+
return /* @__PURE__ */ jsx9("button", { type: "button", "aria-label": extended ? void 0 : props.icon || "Action", onClick: ctx.onAction ? (e2) => {
|
|
118379
|
+
e2.stopPropagation();
|
|
118380
|
+
ctx.onAction(resolveItemDeep2(props.action, ctx));
|
|
118381
|
+
} : void 0, style: { ...style, appearance: "none", border: 0, font: "inherit" }, children: content });
|
|
118369
118382
|
}
|
|
118370
118383
|
case "Map":
|
|
118371
118384
|
return /* @__PURE__ */ jsx9(MapNode, { props, ctx, wrap });
|
|
@@ -118547,7 +118560,7 @@ function renderInner(node, ctx) {
|
|
|
118547
118560
|
}
|
|
118548
118561
|
}
|
|
118549
118562
|
}
|
|
118550
|
-
var useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, appearKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, HiddenGate, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MenuNode, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, TAP_ACTIVATOR_ATTR, TAP_GROUP_ATTR, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, REVEAL_RELEASE_MS, REVEAL_FADE_MS, REVEAL_BUFFER, revealProgress, countWords, RevealText, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ButtonNode, OtpInputNode, ProgressBarNode, ACTIVITY_DEFAULT_NAME, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, PRESENTED_OVERLAY_ATTR, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, WheelPickerNode, ColorPickerNode, FilterChipsNode, TILE_PX, MAX_MERCATOR_LAT, DEFAULT_TILE_MAX_ZOOM, CIRCLE_SEGMENTS, METRES_PER_DEG_LAT, MARKER_HIT_RADIUS, SHAPE_HIT_RADIUS, MapNode, CAROUSEL_SETTLE_MS, scrollCarouselTo, CarouselNode, BannerNode, CollapsingHeaderNode, UnsupportedOnSurface, CALENDAR_DATE_ONLY_RE, CAL_DEFAULT_MAX_DOTS, CAL_AGENDA_INITIAL_DAYS, CAL_AGENDA_PAGE_DAYS, CAL_DEFAULT_SNAP_MINUTES, CAL_UNASSIGNED_LANE_ID, MonthCalendarNode, TimeGridNode, AgendaNode, ARIA_ROLE, initialFocusScheduled, PRESENTED_SCOPE, focusRoots, A11yHintDescription, WebRenderer;
|
|
118563
|
+
var useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, appearKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, HiddenGate, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MenuNode, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, TAP_ACTIVATOR_ATTR, TAP_GROUP_ATTR, NESTED_CONTROL_SELECTOR, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, REVEAL_RELEASE_MS, REVEAL_FADE_MS, REVEAL_BUFFER, revealProgress, countWords, RevealText, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ButtonNode, OtpInputNode, ProgressBarNode, ACTIVITY_DEFAULT_NAME, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, PRESENTED_OVERLAY_ATTR, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, WheelPickerNode, ColorPickerNode, FilterChipsNode, TILE_PX, MAX_MERCATOR_LAT, DEFAULT_TILE_MAX_ZOOM, CIRCLE_SEGMENTS, METRES_PER_DEG_LAT, MARKER_HIT_RADIUS, SHAPE_HIT_RADIUS, MapNode, CAROUSEL_SETTLE_MS, scrollCarouselTo, CarouselNode, BannerNode, CollapsingHeaderNode, UnsupportedOnSurface, CALENDAR_DATE_ONLY_RE, CAL_DEFAULT_MAX_DOTS, CAL_AGENDA_INITIAL_DAYS, CAL_AGENDA_PAGE_DAYS, CAL_DEFAULT_SNAP_MINUTES, CAL_UNASSIGNED_LANE_ID, MonthCalendarNode, TimeGridNode, AgendaNode, ARIA_ROLE, initialFocusScheduled, PRESENTED_SCOPE, focusRoots, A11yHintDescription, WebRenderer;
|
|
118551
118564
|
var init_renderNode = __esm({
|
|
118552
118565
|
"../../core/web-renderer/src/renderNode.tsx"() {
|
|
118553
118566
|
"use strict";
|
|
@@ -120438,6 +120451,7 @@ var init_renderNode = __esm({
|
|
|
120438
120451
|
]);
|
|
120439
120452
|
TAP_ACTIVATOR_ATTR = "data-himalaya-tap-activator";
|
|
120440
120453
|
TAP_GROUP_ATTR = "data-himalaya-tap-group";
|
|
120454
|
+
NESTED_CONTROL_SELECTOR = "button,a[href],input,select,textarea,[role=button],[role=link],[role=tab],[tabindex]:not([tabindex='-1'])";
|
|
120441
120455
|
VISUALLY_HIDDEN = {
|
|
120442
120456
|
position: "absolute",
|
|
120443
120457
|
width: 1,
|
|
@@ -144518,23 +144532,23 @@ var init_preview_assets_generated = __esm({
|
|
|
144518
144532
|
"../../packages/serve/src/preview-assets.generated.ts"() {
|
|
144519
144533
|
init_preview_assets_format();
|
|
144520
144534
|
PREVIEW_ASSET_MANIFEST = [
|
|
144521
|
-
{ key: "assets/index-
|
|
144522
|
-
{ key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/octet-stream", offset:
|
|
144523
|
-
{ key: "assets/pdfDocument-
|
|
144524
|
-
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset:
|
|
144525
|
-
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset:
|
|
144526
|
-
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset:
|
|
144527
|
-
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset:
|
|
144528
|
-
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset:
|
|
144529
|
-
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset:
|
|
144530
|
-
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset:
|
|
144531
|
-
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset:
|
|
144532
|
-
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset:
|
|
144533
|
-
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset:
|
|
144534
|
-
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset:
|
|
144535
|
-
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset:
|
|
144536
|
-
{ key: "index.html", contentType: "text/html; charset=utf-8", offset:
|
|
144537
|
-
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset:
|
|
144535
|
+
{ key: "assets/index-XnF2Yd7q.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1214546, sha256: "510ce325dc2eebd1170556d2f4e037dd99d7aacbb980684852c358649d137183" },
|
|
144536
|
+
{ key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/octet-stream", offset: 1214554, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
|
|
144537
|
+
{ key: "assets/pdfDocument-D55HNmZh.js", contentType: "application/javascript; charset=utf-8", offset: 2531588, length: 489166, sha256: "9099f7588448089413dc5a2f8dc68920deb800d0563193097cc58ad8f931a9f6" },
|
|
144538
|
+
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3020754, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
|
|
144539
|
+
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3025364, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
|
|
144540
|
+
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3513948, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
|
|
144541
|
+
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 3604872, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
|
|
144542
|
+
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 3695856, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
|
|
144543
|
+
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 3786836, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
|
|
144544
|
+
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 3877708, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
|
|
144545
|
+
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 3968688, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
|
|
144546
|
+
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4077324, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
|
|
144547
|
+
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4186408, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
|
|
144548
|
+
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4295456, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
|
|
144549
|
+
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4403156, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
|
|
144550
|
+
{ key: "index.html", contentType: "text/html; charset=utf-8", offset: 4491264, length: 4947, sha256: "84664e32e23c937cd72f471f5ad2309d03c6ec218011056d30d30d029e7871b4" },
|
|
144551
|
+
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4496211, length: 17344, sha256: "d057298d75e7373e5e2c4d11b7d1bcbea88e03af555ba63d97641c78509c58e4" }
|
|
144538
144552
|
];
|
|
144539
144553
|
}
|
|
144540
144554
|
});
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1262.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"artifactId": "himalaya-cli"
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
"falconPackageHash": "
|
|
70
|
+
"falconPackageHash": "a8e9ac447ebf6fa7dbaf60ff93254cb6ece0338789d32712f2436a06"
|
|
71
71
|
}
|
|
@@ -2103,6 +2103,9 @@ const SCREENS = runtimeSetting({
|
|
|
2103
2103
|
"type": "BottomSheet",
|
|
2104
2104
|
"props": {
|
|
2105
2105
|
"presentedPath": "$service:himiBrandedHome.homeModules.presented",
|
|
2106
|
+
"detents": [
|
|
2107
|
+
0.95
|
|
2108
|
+
],
|
|
2106
2109
|
"dismissible": true,
|
|
2107
2110
|
"showGrabber": true,
|
|
2108
2111
|
"onDismiss": {
|
|
@@ -2204,6 +2207,9 @@ const SCREENS = runtimeSetting({
|
|
|
2204
2207
|
}
|
|
2205
2208
|
}
|
|
2206
2209
|
}
|
|
2210
|
+
},
|
|
2211
|
+
"modifiers": {
|
|
2212
|
+
"accessibilityLabel": "$item.pinA11yLabel"
|
|
2207
2213
|
}
|
|
2208
2214
|
},
|
|
2209
2215
|
{
|
|
@@ -2221,31 +2227,63 @@ const SCREENS = runtimeSetting({
|
|
|
2221
2227
|
}
|
|
2222
2228
|
}
|
|
2223
2229
|
}
|
|
2230
|
+
},
|
|
2231
|
+
"modifiers": {
|
|
2232
|
+
"accessibilityLabel": "$item.visibilityA11yLabel"
|
|
2224
2233
|
}
|
|
2225
|
-
}
|
|
2234
|
+
}
|
|
2235
|
+
]
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
},
|
|
2239
|
+
{
|
|
2240
|
+
"id": "",
|
|
2241
|
+
"body": {
|
|
2242
|
+
"package": "himalaya",
|
|
2243
|
+
"type": "HStack",
|
|
2244
|
+
"props": {
|
|
2245
|
+
"spacing": 8,
|
|
2246
|
+
"children": [
|
|
2226
2247
|
{
|
|
2227
|
-
"id": "",
|
|
2248
|
+
"id": "btn_tier5_himibrandedhome_homemoveup",
|
|
2228
2249
|
"body": {
|
|
2229
2250
|
"package": "himalaya",
|
|
2230
|
-
"type": "
|
|
2231
|
-
"props": {
|
|
2251
|
+
"type": "Button",
|
|
2252
|
+
"props": {
|
|
2253
|
+
"title": "Move up",
|
|
2254
|
+
"style": "plain",
|
|
2255
|
+
"action": {
|
|
2256
|
+
"actionId": "tier5.himiBrandedHome.homeMoveUp",
|
|
2257
|
+
"params": {
|
|
2258
|
+
"id": "$item.id"
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
},
|
|
2263
|
+
"modifiers": {
|
|
2264
|
+
"accessibilityLabel": "$item.moveUpA11yLabel",
|
|
2265
|
+
"hiddenPath": "$item.isFirst"
|
|
2232
2266
|
}
|
|
2233
2267
|
},
|
|
2234
2268
|
{
|
|
2235
|
-
"id": "
|
|
2269
|
+
"id": "btn_tier5_himibrandedhome_homemovedown",
|
|
2236
2270
|
"body": {
|
|
2237
2271
|
"package": "himalaya",
|
|
2238
2272
|
"type": "Button",
|
|
2239
2273
|
"props": {
|
|
2240
|
-
"title": "Move
|
|
2274
|
+
"title": "Move down",
|
|
2241
2275
|
"style": "plain",
|
|
2242
2276
|
"action": {
|
|
2243
|
-
"actionId": "tier5.himiBrandedHome.
|
|
2277
|
+
"actionId": "tier5.himiBrandedHome.homeMoveDown",
|
|
2244
2278
|
"params": {
|
|
2245
2279
|
"id": "$item.id"
|
|
2246
2280
|
}
|
|
2247
2281
|
}
|
|
2248
2282
|
}
|
|
2283
|
+
},
|
|
2284
|
+
"modifiers": {
|
|
2285
|
+
"accessibilityLabel": "$item.moveDownA11yLabel",
|
|
2286
|
+
"hiddenPath": "$item.isLast"
|
|
2249
2287
|
}
|
|
2250
2288
|
}
|
|
2251
2289
|
]
|
|
@@ -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;
|
|
@@ -50465,6 +50465,9 @@ const SCREENS = runtimeSetting({
|
|
|
50465
50465
|
"type": "BottomSheet",
|
|
50466
50466
|
"props": {
|
|
50467
50467
|
"presentedPath": "$service:himiOwnerLiteHome.homeModules.presented",
|
|
50468
|
+
"detents": [
|
|
50469
|
+
0.95
|
|
50470
|
+
],
|
|
50468
50471
|
"dismissible": true,
|
|
50469
50472
|
"showGrabber": true,
|
|
50470
50473
|
"onDismiss": {
|
|
@@ -50566,6 +50569,9 @@ const SCREENS = runtimeSetting({
|
|
|
50566
50569
|
}
|
|
50567
50570
|
}
|
|
50568
50571
|
}
|
|
50572
|
+
},
|
|
50573
|
+
"modifiers": {
|
|
50574
|
+
"accessibilityLabel": "$item.pinA11yLabel"
|
|
50569
50575
|
}
|
|
50570
50576
|
},
|
|
50571
50577
|
{
|
|
@@ -50583,31 +50589,63 @@ const SCREENS = runtimeSetting({
|
|
|
50583
50589
|
}
|
|
50584
50590
|
}
|
|
50585
50591
|
}
|
|
50592
|
+
},
|
|
50593
|
+
"modifiers": {
|
|
50594
|
+
"accessibilityLabel": "$item.visibilityA11yLabel"
|
|
50586
50595
|
}
|
|
50587
|
-
}
|
|
50596
|
+
}
|
|
50597
|
+
]
|
|
50598
|
+
}
|
|
50599
|
+
}
|
|
50600
|
+
},
|
|
50601
|
+
{
|
|
50602
|
+
"id": "",
|
|
50603
|
+
"body": {
|
|
50604
|
+
"package": "himalaya",
|
|
50605
|
+
"type": "HStack",
|
|
50606
|
+
"props": {
|
|
50607
|
+
"spacing": 8,
|
|
50608
|
+
"children": [
|
|
50588
50609
|
{
|
|
50589
|
-
"id": "",
|
|
50610
|
+
"id": "btn_tier5_himiownerlitehome_homemoveup",
|
|
50590
50611
|
"body": {
|
|
50591
50612
|
"package": "himalaya",
|
|
50592
|
-
"type": "
|
|
50593
|
-
"props": {
|
|
50613
|
+
"type": "Button",
|
|
50614
|
+
"props": {
|
|
50615
|
+
"title": "Move up",
|
|
50616
|
+
"style": "plain",
|
|
50617
|
+
"action": {
|
|
50618
|
+
"actionId": "tier5.himiOwnerLiteHome.homeMoveUp",
|
|
50619
|
+
"params": {
|
|
50620
|
+
"id": "$item.id"
|
|
50621
|
+
}
|
|
50622
|
+
}
|
|
50623
|
+
}
|
|
50624
|
+
},
|
|
50625
|
+
"modifiers": {
|
|
50626
|
+
"accessibilityLabel": "$item.moveUpA11yLabel",
|
|
50627
|
+
"hiddenPath": "$item.isFirst"
|
|
50594
50628
|
}
|
|
50595
50629
|
},
|
|
50596
50630
|
{
|
|
50597
|
-
"id": "
|
|
50631
|
+
"id": "btn_tier5_himiownerlitehome_homemovedown",
|
|
50598
50632
|
"body": {
|
|
50599
50633
|
"package": "himalaya",
|
|
50600
50634
|
"type": "Button",
|
|
50601
50635
|
"props": {
|
|
50602
|
-
"title": "Move
|
|
50636
|
+
"title": "Move down",
|
|
50603
50637
|
"style": "plain",
|
|
50604
50638
|
"action": {
|
|
50605
|
-
"actionId": "tier5.himiOwnerLiteHome.
|
|
50639
|
+
"actionId": "tier5.himiOwnerLiteHome.homeMoveDown",
|
|
50606
50640
|
"params": {
|
|
50607
50641
|
"id": "$item.id"
|
|
50608
50642
|
}
|
|
50609
50643
|
}
|
|
50610
50644
|
}
|
|
50645
|
+
},
|
|
50646
|
+
"modifiers": {
|
|
50647
|
+
"accessibilityLabel": "$item.moveDownA11yLabel",
|
|
50648
|
+
"hiddenPath": "$item.isLast"
|
|
50611
50649
|
}
|
|
50612
50650
|
}
|
|
50613
50651
|
]
|
|
@@ -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;
|
|
@@ -289,6 +289,10 @@ const svc = defineService<ProductFormState, {
|
|
|
289
289
|
submit: async (s, values): Promise<ProductFormState> => settleOverLive(svc, s, await (async (): Promise<ProductFormState> => {
|
|
290
290
|
if (isOwnerPreviewDemo() || s.demoNote) return demoRefusal(s);
|
|
291
291
|
const v = values ?? {};
|
|
292
|
+
// Queue replay boots a fresh worker without navigation input. Keep a live form's
|
|
293
|
+
// target authoritative, and use the queued mode only for a queued target.
|
|
294
|
+
const targetId = s.id || (typeof v.id === "string" ? v.id : "");
|
|
295
|
+
const mode: Mode = !s.id && targetId && v.mode === "edit" ? "edit" : s.mode;
|
|
292
296
|
const name = String(v.name ?? s.name).trim();
|
|
293
297
|
const rawPrice = String(v.price ?? s.price).trim();
|
|
294
298
|
// "12,50" (comma-decimal keypad) is accepted and written as 12.50.
|
|
@@ -340,7 +344,7 @@ const svc = defineService<ProductFormState, {
|
|
|
340
344
|
...(sku ? { sku } : {}),
|
|
341
345
|
...(descriptionEdited ? { description } : {}),
|
|
342
346
|
...(richDescription ? { richDescription } : {}),
|
|
343
|
-
...(
|
|
347
|
+
...(mode === "edit" && targetId ? {} : { productType: "physical" }),
|
|
344
348
|
};
|
|
345
349
|
// The document the record now holds, when known: an offline reopen seeds the editor with it.
|
|
346
350
|
const loadedJson = s.descriptionMode === "editor" && !s.descriptionPending ? s.descriptionJson : "";
|
|
@@ -353,7 +357,17 @@ const svc = defineService<ProductFormState, {
|
|
|
353
357
|
const descriptionProtected = cachedRichVerdict(heldDoc as never, knownPlain);
|
|
354
358
|
|
|
355
359
|
// Optimistic local write — the list repaints from cache immediately (offline or not).
|
|
356
|
-
|
|
360
|
+
// Replay starts with default worker state. An untouched description was omitted from the
|
|
361
|
+
// queued PATCH, so retain its cached mirror/document/verdict when replacing the local row.
|
|
362
|
+
const cached = replay && targetId ? await cacheGet(targetId) : null;
|
|
363
|
+
const keepCachedDescription = cached !== null && !descriptionEdited && richDescription === null;
|
|
364
|
+
const localRow = (id: string): DbEntity => ({
|
|
365
|
+
...(cached ?? {}), id, name, price, sku,
|
|
366
|
+
description: keepCachedDescription ? String(cached.description ?? "") : description,
|
|
367
|
+
descriptionProtected: keepCachedDescription ? String(cached.descriptionProtected ?? descriptionProtected) : descriptionProtected,
|
|
368
|
+
...(heldJson ? { descriptionJson: heldJson } : descriptionEdited ? { descriptionJson: "" } : {}),
|
|
369
|
+
visible: visible ? "true" : "false", statusLabel: visible ? "Visible" : "Hidden",
|
|
370
|
+
});
|
|
357
371
|
const wrote = richDescription !== null;
|
|
358
372
|
const savedDescription = {
|
|
359
373
|
description, originalDescription: descriptionEdited || wrote ? description : s.originalDescription,
|
|
@@ -365,12 +379,12 @@ const svc = defineService<ProductFormState, {
|
|
|
365
379
|
const a = editorAfterSave("description", s as never, liveState(svc), wrote);
|
|
366
380
|
return { descriptionDirty: a.dirty, descriptionEdits: a.edits, ...(a.editedDuringSave ? { status: "idle" as const, savedMessage: "" } : {}) };
|
|
367
381
|
};
|
|
368
|
-
const localId =
|
|
382
|
+
const localId = mode === "edit" && targetId ? targetId : `local-${Date.now()}`;
|
|
369
383
|
await cachePut(localRow(localId));
|
|
370
384
|
try {
|
|
371
|
-
let id =
|
|
372
|
-
if (
|
|
373
|
-
await updateProduct(
|
|
385
|
+
let id = targetId;
|
|
386
|
+
if (mode === "edit" && targetId) {
|
|
387
|
+
await updateProduct(targetId, write as WixProductWrite);
|
|
374
388
|
} else {
|
|
375
389
|
const r = await createProduct(write);
|
|
376
390
|
id = r.product?.id || localId;
|
|
@@ -402,7 +416,7 @@ const svc = defineService<ProductFormState, {
|
|
|
402
416
|
// write to replay (WriteQueue, idempotent) when connectivity returns.
|
|
403
417
|
// A document rides as `descriptionJson` with descriptionEdited "false", so a bundle rolled back
|
|
404
418
|
// past this change leaves the description rather than flattening it to text.
|
|
405
|
-
await queueWrite("tier5.himiOwnerLiteProductForm.submit", { id:
|
|
419
|
+
await queueWrite("tier5.himiOwnerLiteProductForm.submit", { id: targetId, name, price, sku, description, visible: String(visible), mode,
|
|
406
420
|
...(docRaw ? { descriptionJson: docRaw, descriptionEdited: "false" } : { descriptionEdited: String(descriptionEdited) }) });
|
|
407
421
|
return shape({
|
|
408
422
|
...s, mode: "edit", id: localId, name, price, sku, ...savedDescription,
|
|
@@ -172,13 +172,15 @@ const svc = defineService<ServiceFormState, {
|
|
|
172
172
|
submit: async (s, values) => {
|
|
173
173
|
if (isOwnerPreviewDemo() || s.demoNote) return demoRefusal(s);
|
|
174
174
|
const v = values ?? {};
|
|
175
|
+
const targetId = s.id || (typeof v.id === "string" ? v.id : "");
|
|
175
176
|
const name = String(v.name ?? s.name).trim();
|
|
176
177
|
const description = String(v.description ?? s.description).trim();
|
|
177
178
|
if (!name) return shape({ ...s, status: "error", error: copyParam("ownerServiceForm.nameRequired", "Name is required"), savedMessage: "" });
|
|
178
|
-
if (!
|
|
179
|
+
if (!targetId) return shape({ ...s, status: "error", error: copyParam("ownerServiceForm.errorNoService", "No service to edit."), savedMessage: "" });
|
|
179
180
|
|
|
180
181
|
// Optimistic local write — the detail/list repaint from cache immediately (offline or not).
|
|
181
|
-
const
|
|
182
|
+
const cached = !s.id ? await cacheGet(targetId) : null;
|
|
183
|
+
const localRow: DbEntity = { ...(cached ?? {}), id: targetId, name, title: name, description, category: s.category || String(cached?.category ?? "") };
|
|
182
184
|
await cachePut(localRow);
|
|
183
185
|
try {
|
|
184
186
|
// v2 PATCH is a masked update requiring the current `revision` (optimistic
|
|
@@ -186,13 +188,13 @@ const svc = defineService<ServiceFormState, {
|
|
|
186
188
|
// the UPDATED entity ({ service }) with its bumped revision — carry it
|
|
187
189
|
// into state, or the SECOND consecutive save would send the stale
|
|
188
190
|
// load-time revision and reject.
|
|
189
|
-
const res = await updateService(
|
|
191
|
+
const res = await updateService(targetId, { name, ...(description ? { description } : {}), ...(s.revision ? { revision: s.revision } : {}) });
|
|
190
192
|
const bumped = String((res?.service as { revision?: unknown } | undefined)?.revision ?? "");
|
|
191
193
|
return shape({
|
|
192
|
-
...s, name, description,
|
|
194
|
+
...s, id: targetId, name, description,
|
|
193
195
|
revision: bumped || s.revision,
|
|
194
196
|
status: "saved", error: "", savedMessage: copyParam("ownerServiceForm.savedMessage", "Service saved."),
|
|
195
|
-
savedId:
|
|
197
|
+
savedId: targetId,
|
|
196
198
|
});
|
|
197
199
|
} catch (e) {
|
|
198
200
|
if (shouldQueueOwnerWrite(e)) {
|
|
@@ -202,12 +204,12 @@ const svc = defineService<ServiceFormState, {
|
|
|
202
204
|
if (s.demoNote) return demoRefusal(s);
|
|
203
205
|
// Real device offline: the optimistic cache row already shows; queue the
|
|
204
206
|
// write to replay (WriteQueue, idempotent) when connectivity returns.
|
|
205
|
-
await queueWrite("tier5.himiOwnerLiteServiceForm.submit", { id:
|
|
207
|
+
await queueWrite("tier5.himiOwnerLiteServiceForm.submit", { id: targetId, name, description });
|
|
206
208
|
return shape({
|
|
207
|
-
...s, name, description,
|
|
209
|
+
...s, id: targetId, name, description,
|
|
208
210
|
status: "saved", error: "",
|
|
209
211
|
savedMessage: copyParam("ownerServiceForm.savedOffline", "Saved offline — will sync when you reconnect."),
|
|
210
|
-
savedId:
|
|
212
|
+
savedId: targetId,
|
|
211
213
|
});
|
|
212
214
|
}
|
|
213
215
|
return shape({ ...s, status: "error", error: ownerLoadError(e), savedMessage: "" });
|