@wix/himalaya-cli 0.1338.0 → 0.1339.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 -1
- package/guides/web-page-native-sdk.md +21 -6
- package/guides/webview-page-sdk.md +9 -7
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -16630,7 +16630,6 @@ function resolveIdiom(tokens2, ctx = {}) {
|
|
|
16630
16630
|
var IDIOM_CONTEXTS, UNSAFE_KEYS;
|
|
16631
16631
|
var init_idiom = __esm({
|
|
16632
16632
|
"../../core/ts/src/idiom.ts"() {
|
|
16633
|
-
"use strict";
|
|
16634
16633
|
IDIOM_CONTEXTS = {
|
|
16635
16634
|
ios: { native: ["ios"] },
|
|
16636
16635
|
android: { native: ["material"] },
|
|
@@ -39,6 +39,12 @@ Your page can only use capabilities the **app owner** turned on for your site. I
|
|
|
39
39
|
`capabilities`, allowing **every** method the capability's page lists — except
|
|
40
40
|
`presigned_upload.putFile`, which reads a device file and is allowed only when `files` is enabled
|
|
41
41
|
too. So enabling a capability is enough; the owner does not list methods.
|
|
42
|
+
- **What a Brandy app cannot enable:** `app_info`, `calls`, `godot`, `himi_apps`, `live_activity`,
|
|
43
|
+
`local_database`, `release_control`, `system_intents`, `ui` and `wix_platform` — most need wiring
|
|
44
|
+
a website app's shell does not have, and `calls` waits on a third-party sign-off for its WebRTC
|
|
45
|
+
engine, so plan your page without them. `base44` works only when the
|
|
46
|
+
app also has a Base44 binding. Every other capability in the reference can be enabled; other Himi
|
|
47
|
+
apps (not Brandy) may offer these too.
|
|
42
48
|
- Enabling a capability changes the app's native permissions, so the owner ships a **new app
|
|
43
49
|
build** with it before your page can call it. Until then the call times out.
|
|
44
50
|
|
|
@@ -394,7 +400,7 @@ Codes other than the first three come from the capability itself; its reference
|
|
|
394
400
|
// What the app answers when the page asks which capabilities it may call.
|
|
395
401
|
"himalaya.capabilities": { v: 1, capabilities: { health: ["availability", "query", "requestPermission"], haptic: ["play"] } },
|
|
396
402
|
"health.availability": { available: true },
|
|
397
|
-
"health.requestPermission":
|
|
403
|
+
"health.requestPermission": { granted: ["steps"] },
|
|
398
404
|
"health.query": { samples: [{ value: 4200 }] },
|
|
399
405
|
"haptic.play": undefined,
|
|
400
406
|
};
|
|
@@ -417,11 +423,20 @@ Codes other than the first three come from the capability itself; its reference
|
|
|
417
423
|
Each uses the client from Step 1. The exact types are on each capability's page (see *Reference*).
|
|
418
424
|
|
|
419
425
|
```ts
|
|
420
|
-
import { call, himalaya } from "./lib/himalaya";
|
|
421
|
-
|
|
422
|
-
// Share a link
|
|
423
|
-
//
|
|
424
|
-
const
|
|
426
|
+
import { call, himalaya, isEnabled } from "./lib/himalaya";
|
|
427
|
+
|
|
428
|
+
// Share a link (from a tap): the phone's share sheet inside the app, the browser's own share outside
|
|
429
|
+
// it, and a copied link where neither exists. The sheet waits for the user: allow two minutes.
|
|
430
|
+
const link = { text: "Join me on Friday", url: "https://example.com/e/42" };
|
|
431
|
+
if (await isEnabled("share", "share")) {
|
|
432
|
+
await call<{ completed: boolean }>("share", "share", [link], 120_000); // completed: false when cancelled
|
|
433
|
+
} else if (navigator.share) {
|
|
434
|
+
await navigator.share(link).catch(() => {}); // rejects with AbortError when the user closes the sheet
|
|
435
|
+
} else {
|
|
436
|
+
// The clipboard can be missing or refused (e.g. on plain http): then show the link to copy by hand.
|
|
437
|
+
const copied = await navigator.clipboard?.writeText(link.url).then(() => true, () => false);
|
|
438
|
+
if (!copied) window.prompt("Copy this link", link.url);
|
|
439
|
+
}
|
|
425
440
|
|
|
426
441
|
// Where am I? Ask first, then read once. getCurrent answers null when no fix arrives in time.
|
|
427
442
|
const status = await call("location", "requestPermission", [], 120_000);
|
|
@@ -87,8 +87,8 @@ binary. One app-specific worker imports exactly the app’s selected subset.
|
|
|
87
87
|
|
|
88
88
|
## Brandy
|
|
89
89
|
|
|
90
|
-
Name the capabilities; Brandy supplies the companion worker
|
|
91
|
-
|
|
90
|
+
Name the capabilities; Brandy supplies the companion worker, so neither the page author nor the
|
|
91
|
+
app owner writes one. Health's is ready-made:
|
|
92
92
|
|
|
93
93
|
```json
|
|
94
94
|
{
|
|
@@ -116,13 +116,15 @@ and allowlists every method a page can call on them (the methods each `web-sdk/<
|
|
|
116
116
|
}
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
The app's customer build writes and builds it. (Inside the Himi repository that is
|
|
120
|
+
`npm run prepare:customer -w @apps/himi-brandy`; for a local preview,
|
|
121
|
+
`npm run web-sdk:companion -w @apps/himi-brandy` first.) To expose
|
|
122
|
+
fewer methods, write your own companion and name it in `bundle` — a named bundle is used as is.
|
|
122
123
|
|
|
123
124
|
Brandy accepts capabilities `himi dist` can add to an extensible shell. Capabilities requiring
|
|
124
|
-
app-specific boot wiring remain refused until that shell supplies the wiring
|
|
125
|
-
|
|
125
|
+
app-specific boot wiring remain refused until that shell supplies the wiring — the list is in
|
|
126
|
+
[the web page guide](https://apps.wix.com/_api/himi-serve/docs/web-page-native-sdk.md#before-you-start-what-the-app-owner-must-enable).
|
|
127
|
+
Base44 is accepted only when the same Brandy contract contains a Base44 binding.
|
|
126
128
|
|
|
127
129
|
## Security and current transport boundary
|
|
128
130
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1339.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": [
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"artifactId": "himalaya-cli"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"falconPackageHash": "
|
|
74
|
+
"falconPackageHash": "bcfe44cf5aea10286d209c5f29feefad31023f7e7984e176976925d3"
|
|
75
75
|
}
|