@wix/himalaya-cli 0.1723.0 → 0.1725.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.
Files changed (84) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-config.d.ts +1 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +2 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/godot/src/index.d.ts +3 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/attendance-classifier.d.ts +1 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +9 -43
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/location/src/index.d.ts +5 -3
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/on-device-ai/src/index.d.ts +19 -7
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +10 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/index.d.ts +2 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/preview-surfaces.d.ts +24 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-web-sdk.d.ts +37 -0
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-web-sdk.generated.d.ts +1 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/wrapped-app-link.d.ts +13 -0
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/checkout-source.d.ts +5 -3
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +0 -2
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance.d.ts +2 -8
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/index.d.ts +4 -13
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/videos.d.ts +31 -1
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/index.d.ts +1 -1
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
  22. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -1
  23. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
  24. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
  25. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +175 -1
  26. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +127 -509
  27. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +5 -26
  28. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
  29. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -1
  30. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/on-device-ai.mjs +49 -3
  31. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
  32. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +150 -644
  33. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
  34. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -0
  35. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
  36. package/dist/browser-plane/assets.json +7 -7
  37. package/dist/browser-plane/package-reader.js +4 -4
  38. package/dist/browser-plane/preview-deferred/{74e5b76ecf38392d7eb3f9a9512d60a0675de85d411c9c56293e123152b3f70b.bin → 49dfd582c5a8fb38ceabd1c544343d87fd478063c04f90c4e7a4ed5ee774f1eb.bin} +1 -1
  39. package/dist/browser-plane/sw.js +9 -9
  40. package/dist/browser-plane/t5-frame.html +16 -0
  41. package/dist/browser-plane/t5-worker-frame.html +16 -0
  42. package/dist/cli.mjs +3039 -1831
  43. package/dist/preview-assets.generated.bin +0 -0
  44. package/guides/capabilities.md +2 -2
  45. package/guides/headless-loop.md +2 -1
  46. package/guides/himi-json-output.md +6 -2
  47. package/guides/iap-products.md +2 -2
  48. package/guides/iap-screen-adoption.md +5 -5
  49. package/guides/sdk-reference.json +47 -82
  50. package/guides/skill.md +1 -1
  51. package/guides/testing-himi-apps.md +4 -3
  52. package/guides/web-page-sdk-reference.md +1 -1
  53. package/guides/webview-page-sdk.md +14 -0
  54. package/guides/wix-business-context.md +24 -0
  55. package/guides/wix-site-to-himi-app.md +2 -1
  56. package/package.json +2 -2
  57. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +2 -2
  58. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +5 -8
  59. package/templates/branded-lite/dev/index.ts +35 -0
  60. package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +82 -12
  61. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +2 -2
  62. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +5 -8
  63. package/templates/brandy/README.md +13 -0
  64. package/templates/brandy/config.ts +15 -1
  65. package/templates/brandy/dev/index.ts +10 -7
  66. package/templates/community-club/tier5-src/himi-store-account/index.ts +2 -2
  67. package/templates/conference/tier5-src/himi-store-account/index.ts +2 -2
  68. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +2 -2
  69. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +2 -2
  70. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +5 -8
  71. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +2 -2
  72. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +2 -2
  73. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +2 -2
  74. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +5 -8
  75. package/templates/restaurant/tier5-src/himi-store-account/index.ts +2 -2
  76. package/templates/retail-store/tier5-src/himi-store-account/index.ts +2 -2
  77. package/templates/retail-store/tier5-src/himi-store-product/index.ts +5 -8
  78. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +2 -2
  79. package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +2 -2
  80. package/templates/wholesale-store/tier5-src/himi-store-product/index.ts +5 -8
  81. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +2 -2
  82. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance-orders.d.ts +0 -10
  83. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs-orders.d.ts +0 -2
  84. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans-orders.d.ts +0 -2
@@ -7851,6 +7851,49 @@ var KV_DEFAULT_MAX_VALUE_BYTES = 64 * 1024;
7851
7851
  var KV_MAX_VALUE_BYTES = 256 * 1024;
7852
7852
  var KV_MAX_TTL_SECONDS = 365 * 24 * 60 * 60;
7853
7853
 
7854
+ // ../../core/ts/src/wrapped-app-link.ts
7855
+ var ABSOLUTE = /^[a-z][a-z0-9+.-]*:\/\//i;
7856
+ function encodeRoute(route) {
7857
+ return route.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@/?]/gu, (c) => encodeURIComponent(c));
7858
+ }
7859
+ function unwrapAppLink(url, wrappers, scheme) {
7860
+ if (wrappers.length === 0 || !scheme) return null;
7861
+ let parsed;
7862
+ try {
7863
+ parsed = new URL(url);
7864
+ } catch {
7865
+ return null;
7866
+ }
7867
+ if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return null;
7868
+ const wrapper = wrappers.find(
7869
+ (w) => parsed.host === w.host.toLowerCase() && (parsed.pathname === w.path || parsed.pathname.startsWith(`${w.path}/`))
7870
+ );
7871
+ if (!wrapper) return null;
7872
+ const link = parsed.searchParams.get(wrapper.param);
7873
+ if (!link) return null;
7874
+ const target = encodeRoute(ABSOLUTE.test(link) ? link : `${scheme}://${link.replace(/^\/+/, "")}`);
7875
+ const rest = [...parsed.searchParams].filter(([k]) => k !== wrapper.param);
7876
+ if (rest.length === 0) return target;
7877
+ const sep = target.includes("?") ? "&" : "?";
7878
+ return target + sep + rest.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join("&");
7879
+ }
7880
+ function wrappedAppLinksProblems(value, appLinkHosts = []) {
7881
+ if (value === void 0) return [];
7882
+ if (!Array.isArray(value)) return ["wrappedAppLinks must be an array"];
7883
+ const problems = [];
7884
+ value.forEach((w, i) => {
7885
+ const at = `wrappedAppLinks[${i}]`;
7886
+ if (!w || typeof w !== "object") return void problems.push(`${at} must be an object`);
7887
+ if (typeof w.host !== "string" || !/^[a-z0-9.-]+$/.test(w.host)) problems.push(`${at}.host must be a lower-case host name`);
7888
+ else if (appLinkHosts.includes(w.host)) problems.push(`${at}.host "${w.host}" is also an appLinkHosts host: a host the app owns needs no wrapper`);
7889
+ if (typeof w.path !== "string" || !/^\/[^/?#\\]+(\/[^/?#\\]+)*$/.test(w.path) || /(^|\/)\.\.?(\/|$)/.test(w.path)) {
7890
+ problems.push(`${at}.path must start with "/", end without one, and hold no "." or ".." segment`);
7891
+ }
7892
+ if (typeof w.param !== "string" || w.param.length === 0) problems.push(`${at}.param must be a non-empty string`);
7893
+ });
7894
+ return problems;
7895
+ }
7896
+
7854
7897
  // ../../core/sdk/functions/src/index.ts
7855
7898
  var HTTP_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"];
7856
7899
  var FUNCTION_AUTHS = ["public", "visitor", "member", "user"];
@@ -8351,6 +8394,8 @@ function validateConfigShape(config) {
8351
8394
  throw new Error("defineApp: environments.prod requires a non-empty serve URL.");
8352
8395
  }
8353
8396
  }
8397
+ const wrappedProblems = wrappedAppLinksProblems(config.wrappedAppLinks, config.appLinkHosts ?? []);
8398
+ if (wrappedProblems.length) throw new Error(`defineApp: ${wrappedProblems.join("; ")}.`);
8354
8399
  if (config.navigation) {
8355
8400
  const nav = config.navigation;
8356
8401
  if (nav.linkableScreens !== void 0 && nav.linkableScreens !== null && !Array.isArray(nav.linkableScreens)) {
@@ -10480,6 +10525,20 @@ function resolveSizeClass(width) {
10480
10525
  if (width >= SIZE_CLASS_BREAKPOINTS.medium) return "medium";
10481
10526
  return "compact";
10482
10527
  }
10528
+ var DEFAULT_CONTENT_MAX = { base: 480, medium: 600, expanded: 920 };
10529
+ var SIDEBAR_RAIL_WIDTH = 240;
10530
+ function resolveContentMax(cmw, width) {
10531
+ if (width >= SIZE_CLASS_BREAKPOINTS.expanded) return cmw.expanded ?? cmw.medium ?? cmw.base;
10532
+ if (width >= SIZE_CLASS_BREAKPOINTS.medium) return cmw.medium ?? cmw.base;
10533
+ return cmw.base;
10534
+ }
10535
+ function shellContentMeasures(surfaceId, width, contentMaxWidth) {
10536
+ const cmw = contentMaxWidth ?? DEFAULT_CONTENT_MAX;
10537
+ const surfaceWidth = (surfaceId ? surfaceById(surfaceId)?.viewport.width : void 0) ?? 0;
10538
+ const nativePreview = surfaceId !== "desktop" && surfaceWidth >= SIZE_CLASS_BREAKPOINTS.medium;
10539
+ const contentMax = nativePreview && width < SIZE_CLASS_BREAKPOINTS.expanded ? "100%" : resolveContentMax(cmw, width);
10540
+ return { nativePreview, contentMax, shellMax: nativePreview ? contentMax : cmw.base };
10541
+ }
10483
10542
  var CHASSIS_GEOMETRY = {
10484
10543
  // The phone numbers are the pre-existing HostFrame/DeviceFrame constants —
10485
10544
  // preserved exactly so parameterizing the frames is not a visual change.
@@ -15369,6 +15428,110 @@ function assertSiteShellConfig(site, opts) {
15369
15428
  }
15370
15429
  }
15371
15430
 
15431
+ // ../../core/ts/src/site-web-sdk.generated.ts
15432
+ var PAGE_CAPABILITY_DISPATCHES = {
15433
+ "app_info": [],
15434
+ "audio_record": [],
15435
+ "base44": [],
15436
+ "biometrics": [],
15437
+ "browser_auth": [],
15438
+ "calendar": [],
15439
+ "calls": [],
15440
+ "camera": [],
15441
+ "clipboard": [],
15442
+ "contacts": [],
15443
+ "file_picker": [],
15444
+ "files": [],
15445
+ "godot": [],
15446
+ "haptic": [],
15447
+ "health": [],
15448
+ "himi_apps": [],
15449
+ "iap": ["wix_api"],
15450
+ "keyboard": [],
15451
+ "legacy_import": [],
15452
+ "live_activity": [],
15453
+ "local_database": [],
15454
+ "location": [],
15455
+ "media_playback": [],
15456
+ "motion": [],
15457
+ "network": [],
15458
+ "on_device_ai": [],
15459
+ "open_url": [],
15460
+ "pdf": [],
15461
+ "photos": [],
15462
+ "presigned_upload": [],
15463
+ "push": [],
15464
+ "release_control": [],
15465
+ "secure_storage": [],
15466
+ "share": [],
15467
+ "speaker_diarization": [],
15468
+ "speech": [],
15469
+ "system_intents": [],
15470
+ "tasks": [],
15471
+ "theme": [],
15472
+ "torch": [],
15473
+ "ui": [],
15474
+ "wix_cashier": [],
15475
+ "wix_chat": [],
15476
+ "wix_platform": ["wix_api"]
15477
+ };
15478
+
15479
+ // ../../core/ts/src/site-web-sdk.ts
15480
+ var SITE_WEB_SDK_GENERATED_PREFIX = "himi-webview-page-";
15481
+ var SITE_WEB_SDK_HEALTH_BUNDLE = "himi-webview-health";
15482
+ function siteWebSdkBundleName(capabilities) {
15483
+ const ids = [...new Set(capabilities)].sort();
15484
+ return `${SITE_WEB_SDK_GENERATED_PREFIX}${workerSubtreeSha256(ids.join(",")).slice(0, 10)}`;
15485
+ }
15486
+ function capabilityIds(value) {
15487
+ if (value == null) return [];
15488
+ if (!Array.isArray(value)) throw new Error("webSdk.capabilities must be an array of capability ids");
15489
+ const ids = value.map((id) => {
15490
+ if (typeof id !== "string" || !id.trim()) throw new Error("webSdk.capabilities must be an array of capability ids");
15491
+ return id.trim();
15492
+ });
15493
+ return [...new Set(ids)];
15494
+ }
15495
+ function siteWebSdkCompanion(webSdk) {
15496
+ if (webSdk == null) return null;
15497
+ if (typeof webSdk !== "object" || Array.isArray(webSdk)) throw new Error("webSdk must be an object");
15498
+ const capabilities = capabilityIds(webSdk.capabilities);
15499
+ if (capabilities.length === 0) return null;
15500
+ if (webSdk.bundle != null && typeof webSdk.bundle !== "string") throw new Error("webSdk.bundle must be a string");
15501
+ const generated = siteWebSdkBundleName(capabilities);
15502
+ const named = webSdk.bundle?.trim() || void 0;
15503
+ if (named && named.startsWith(SITE_WEB_SDK_GENERATED_PREFIX) && named !== generated) {
15504
+ throw new Error(`webSdk.bundle must not start with "${SITE_WEB_SDK_GENERATED_PREFIX}": that name is reserved for the generated companion \u2014 omit bundle to use it`);
15505
+ }
15506
+ const bundle = named ?? (capabilities.length === 1 && capabilities[0] === "health" ? SITE_WEB_SDK_HEALTH_BUNDLE : generated);
15507
+ const declared = ["webview", ...capabilities];
15508
+ if (bundle !== generated) return { bundle, declaredCapabilities: declared };
15509
+ const extra = /* @__PURE__ */ new Set();
15510
+ for (const id of capabilities) {
15511
+ const dispatches = PAGE_CAPABILITY_DISPATCHES[id];
15512
+ if (!dispatches) throw new Error(`webSdk.capabilities: a page cannot call ${JSON.stringify(id)}`);
15513
+ for (const other of dispatches) if (!declared.includes(other)) extra.add(other);
15514
+ }
15515
+ return { bundle, declaredCapabilities: [...declared, ...[...extra].sort()] };
15516
+ }
15517
+ function withSiteWebSdk(descriptor, ctx, webSdk) {
15518
+ const out = JSON.parse(JSON.stringify(descriptor));
15519
+ const companion = siteWebSdkCompanion(webSdk);
15520
+ if (!companion) return out;
15521
+ const integrity = ctx.bundleIntegrity(companion.bundle);
15522
+ if (!integrity) return null;
15523
+ delete out.payload;
15524
+ out.logicBundle = {
15525
+ url: `${ctx.serverBaseUrl}/v1/bundles/${companion.bundle}?integrity=${encodeURIComponent(integrity)}`,
15526
+ integrity,
15527
+ contentType: "application/javascript+ts-bundle",
15528
+ declaredCapabilities: companion.declaredCapabilities,
15529
+ minBinaryVersion: "0.2.0",
15530
+ bundleVersion: "0.0.1"
15531
+ };
15532
+ return out;
15533
+ }
15534
+
15372
15535
  // ../../core/ts/src/site-menu-script.generated.ts
15373
15536
  var SITE_MENU_MESSAGE_NAME = "himalayaSiteMenu";
15374
15537
  var SITE_NAV_LINKS_JS = '(function(){var q=document.querySelectorAll("nav a, header a, [role=navigation] a"),o=[],i,a,t,h;for(i=0;i<q.length&&o.length<24;i++){a=q[i];t=String(a.textContent||"").replace(/\\s+/g," ").trim();h=String(a.href||"");if(t&&/^https?:/.test(h))o.push({label:t,href:h})}return o})()';
@@ -15597,6 +15760,7 @@ export {
15597
15760
  BUTTON_VARIANTS,
15598
15761
  CHASSIS_GEOMETRY,
15599
15762
  CORE_COMPONENTS,
15763
+ DEFAULT_CONTENT_MAX,
15600
15764
  DEFAULT_DISTRIBUTION,
15601
15765
  DEFAULT_ICON_ACCENT_TOKEN,
15602
15766
  DEFAULT_ICON_GLYPH_SCALE,
@@ -15632,6 +15796,7 @@ export {
15632
15796
  PROJECTION_SNAPSHOT_SIZE,
15633
15797
  RICH_CONTENT_EDITOR_TOOLS,
15634
15798
  RTL_LOCALES,
15799
+ SIDEBAR_RAIL_WIDTH,
15635
15800
  SITE_LAYOUTS,
15636
15801
  SITE_MENU_DEFAULT_ICON,
15637
15802
  SITE_MENU_DRAWER_ID_PREFIX,
@@ -15654,6 +15819,8 @@ export {
15654
15819
  SITE_SCREEN_FORMS,
15655
15820
  SITE_SCREEN_PREFIX,
15656
15821
  SITE_SHELL_MAX_TABS,
15822
+ SITE_WEB_SDK_GENERATED_PREFIX,
15823
+ SITE_WEB_SDK_HEALTH_BUNDLE,
15657
15824
  SIZE_CLASS_BREAKPOINTS,
15658
15825
  SPLASH_MAX_HOLD_MS_MAX,
15659
15826
  SPLASH_MIN_VISIBLE_MS_MAX,
@@ -15758,6 +15925,7 @@ export {
15758
15925
  resolveAppLocale,
15759
15926
  resolveButtonTokens,
15760
15927
  resolveColor,
15928
+ resolveContentMax,
15761
15929
  resolveIcon,
15762
15930
  resolveIdiom,
15763
15931
  resolveKeyboard,
@@ -15776,6 +15944,7 @@ export {
15776
15944
  sameCapabilityScope,
15777
15945
  screenDescriptorSchema,
15778
15946
  selectIdiomOverlay,
15947
+ shellContentMeasures,
15779
15948
  shipsLocale,
15780
15949
  shouldRevealError,
15781
15950
  siteAllowedOrigins,
@@ -15794,6 +15963,8 @@ export {
15794
15963
  siteScreenId,
15795
15964
  siteScreens,
15796
15965
  siteSidebar,
15966
+ siteWebSdkBundleName,
15967
+ siteWebSdkCompanion,
15797
15968
  siteWebViewPreset,
15798
15969
  stripOriginParams,
15799
15970
  summarize,
@@ -15802,6 +15973,7 @@ export {
15802
15973
  surfaceRenderMode,
15803
15974
  surfacesForApp,
15804
15975
  tonalElevationAlpha,
15976
+ unwrapAppLink,
15805
15977
  validate,
15806
15978
  validateAll,
15807
15979
  validateAuthGateScreen,
@@ -15820,7 +15992,9 @@ export {
15820
15992
  webViewOriginAllowed,
15821
15993
  webViewSiteTrustAppFindings,
15822
15994
  widgetSnapshotSchema,
15995
+ withSiteWebSdk,
15823
15996
  workerSubtreePolicyErrors,
15824
- workerSubtreeSha256
15997
+ workerSubtreeSha256,
15998
+ wrappedAppLinksProblems
15825
15999
  };
15826
16000
  //# sourceMappingURL=core.mjs.map