@colixsystems/widget-sdk 0.315.1 → 0.315.3
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/README.md +11 -3
- package/dist/contract.cjs +7 -5
- package/dist/contract.js +7 -5
- package/dist/modal.native.js +5 -2
- package/package.json +6 -1
- package/src/contract.js +7 -5
package/README.md
CHANGED
|
@@ -90,7 +90,15 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
90
90
|
|
|
91
91
|
## Status
|
|
92
92
|
|
|
93
|
-
`v0.315.
|
|
93
|
+
`v0.315.3` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
|
|
94
|
+
|
|
95
|
+
### What's new in 0.315.3 (contract 1.255.1)
|
|
96
|
+
|
|
97
|
+
**`useAction()` is no longer refused with `ACTION_PAUSED`.** No plan caps how many Actions a workspace runs, so an Action is never paused: a switched-on Action runs, and `enqueue` is refused only when the Action is switched off (`ACTION_DISABLED`) or the workspace already has 10 queued runs (`RATE_LIMITED`). Code that still handles `ACTION_PAUSED` keeps working; it is simply never reached.
|
|
98
|
+
|
|
99
|
+
### What's new in 0.315.2 (contract 1.255.0)
|
|
100
|
+
|
|
101
|
+
**A `<Modal>` with a form stays usable on Android while the keyboard is up.** The native dialog used to shrink to its title, the focused field and its footer. It now keeps the whole space above the keyboard, and its body scrolls there as it does on iOS. The widget contract is unchanged.
|
|
94
102
|
|
|
95
103
|
### What's new in 0.315.1 (contract 1.255.0)
|
|
96
104
|
|
|
@@ -170,7 +178,7 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
170
178
|
|
|
171
179
|
### What's new in 0.299.0 (contract 1.246.0)
|
|
172
180
|
|
|
173
|
-
**`useAction()` can queue a run instead of waiting for it.** The hook now returns `enqueue(input)` beside `run(input)`. `run` still waits for the Action and hands back its `respond()` value, and must finish within 500 ms of the press. `enqueue` resolves as soon as the server has queued the run, with the same refusals as `run` (`ACTION_NOT_APP_INVOKABLE`, `ACTION_NOT_FOUND`, `INVALID_ACTION_INPUT`, `RATE_LIMITED`, a signed-out caller). The Action then runs away from the request with its normal time limits, the way a scheduled run does, and a pod restart does not lose it. Nothing comes back: `running`, `result` and `error` stay as they were. Use it to start work the widget needs no answer from (a batch, a sync, a long send), and tell the user it has started, not that it is done. It is also refused, rather than queued, when the Action is switched off (`ACTION_DISABLED`)
|
|
181
|
+
**`useAction()` can queue a run instead of waiting for it.** The hook now returns `enqueue(input)` beside `run(input)`. `run` still waits for the Action and hands back its `respond()` value, and must finish within 500 ms of the press. `enqueue` resolves as soon as the server has queued the run, with the same refusals as `run` (`ACTION_NOT_APP_INVOKABLE`, `ACTION_NOT_FOUND`, `INVALID_ACTION_INPUT`, `RATE_LIMITED`, a signed-out caller). The Action then runs away from the request with its normal time limits, the way a scheduled run does, and a pod restart does not lose it. Nothing comes back: `running`, `result` and `error` stay as they were. Use it to start work the widget needs no answer from (a batch, a sync, a long send), and tell the user it has started, not that it is done. It is also refused, rather than queued, when the Action is switched off (`ACTION_DISABLED`), and with `RATE_LIMITED` when the workspace already has 10 queued runs waiting or running. It can run twice: a scheduler restarted mid-run starts it again, so write the Action to be safe to repeat. On a host whose actions client cannot queue, `enqueue` rejects `UNAVAILABLE`. The injected client is `@colixsystems/actions-client` 0.4.0.
|
|
174
182
|
|
|
175
183
|
```jsx
|
|
176
184
|
const { available, enqueue } = useAction(props.actionId);
|
|
@@ -353,7 +361,7 @@ const fresh = seen ? data.length - shown.length : 0;
|
|
|
353
361
|
|
|
354
362
|
### What's new in 0.268.0 (contract 1.218.0)
|
|
355
363
|
|
|
356
|
-
**`useAction().available` tells the truth about the Action.** It used to be true whenever an Action was bound, so a widget offered a run that could never happen. It now turns false once the server says a run would not reach the script: the Action is switched off
|
|
364
|
+
**`useAction().available` tells the truth about the Action.** It used to be true whenever an Action was bound, so a widget offered a run that could never happen. It now turns false once the server says a run would not reach the script: the Action is switched off, not allowed from the app, gone, or the viewer is not a signed-in app user (signed-out visitors and anonymous accounts can't run Actions). It is asked again when the binding or the signed-in user changes, and stays true while no answer has come. The actions client (`@colixsystems/actions-client` 0.2.0) gains `status(actionId)` for it.
|
|
357
365
|
|
|
358
366
|
### What's new in 0.267.1 (contract 1.217.0)
|
|
359
367
|
|
package/dist/contract.cjs
CHANGED
|
@@ -2299,7 +2299,7 @@ const HOOKS = [
|
|
|
2299
2299
|
"`available` is false and run() rejects UNAVAILABLE; render a visible " +
|
|
2300
2300
|
"'pick an action' state, NEVER a blank box. sc-14224: `available` also " +
|
|
2301
2301
|
"turns false once the server says a run would not reach the script — " +
|
|
2302
|
-
"the Action is switched off
|
|
2302
|
+
"the Action is switched off, not allowed from the app, gone, " +
|
|
2303
2303
|
"or the viewer is not a signed-in app user (signed-out visitors and " +
|
|
2304
2304
|
"anonymous accounts can't run Actions) — so render an 'isn't available' " +
|
|
2305
2305
|
"state then too. It stays true while no answer has come. A changed binding clears " +
|
|
@@ -2324,15 +2324,15 @@ const HOOKS = [
|
|
|
2324
2324
|
"respond() value, and running/result/error are untouched — so use it to " +
|
|
2325
2325
|
"start work the widget needs no answer from (a batch, a sync, a long " +
|
|
2326
2326
|
"send) and tell the user it has started, never that it is done. " +
|
|
2327
|
-
"It is also refused when the Action is switched off (ACTION_DISABLED) " +
|
|
2328
|
-
"
|
|
2327
|
+
"It is also refused when the Action is switched off (ACTION_DISABLED), " +
|
|
2328
|
+
"and with RATE_LIMITED when the workspace " +
|
|
2329
2329
|
"already has 10 queued runs waiting. A queued run can run twice (a " +
|
|
2330
2330
|
"restart mid-run starts it again), so its Action must be safe to repeat. " +
|
|
2331
2331
|
"Reads ctx.actions.",
|
|
2332
2332
|
returnShape: {
|
|
2333
2333
|
available: "boolean // false when no Action is bound, the host brokers none, or the server says a run would not reach the script",
|
|
2334
2334
|
run: "(input) => Promise<unknown> // input is optional; resolves with the Action's respond() value, or null; rejects with ActionError",
|
|
2335
|
-
enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED
|
|
2335
|
+
enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED)",
|
|
2336
2336
|
running: "boolean // true while any run is in flight",
|
|
2337
2337
|
result: "unknown // the last successful run's result; null before the first run",
|
|
2338
2338
|
error: "ActionError | null",
|
|
@@ -6965,7 +6965,9 @@ const CONTRACT = deepFreeze({
|
|
|
6965
6965
|
// 1.255.0: fix (sc-16654) — `minFontPx` (12) publishes the smallest page text
|
|
6966
6966
|
// the render check accepts. The theme's six text tiers and its Buttons and
|
|
6967
6967
|
// Text component sizes now clamp up to it instead of to 8.
|
|
6968
|
-
|
|
6968
|
+
// 1.255.1: fix (sc-16882) — `ACTION_PAUSED` is gone from useAction's
|
|
6969
|
+
// refusals: no plan caps how many Actions run, so none is paused.
|
|
6970
|
+
version: "1.255.1",
|
|
6969
6971
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6970
6972
|
hooks: HOOKS,
|
|
6971
6973
|
primitives: PRIMITIVES,
|
package/dist/contract.js
CHANGED
|
@@ -2294,7 +2294,7 @@ const HOOKS = [
|
|
|
2294
2294
|
"`available` is false and run() rejects UNAVAILABLE; render a visible " +
|
|
2295
2295
|
"'pick an action' state, NEVER a blank box. sc-14224: `available` also " +
|
|
2296
2296
|
"turns false once the server says a run would not reach the script — " +
|
|
2297
|
-
"the Action is switched off
|
|
2297
|
+
"the Action is switched off, not allowed from the app, gone, " +
|
|
2298
2298
|
"or the viewer is not a signed-in app user (signed-out visitors and " +
|
|
2299
2299
|
"anonymous accounts can't run Actions) — so render an 'isn't available' " +
|
|
2300
2300
|
"state then too. It stays true while no answer has come. A changed binding clears " +
|
|
@@ -2319,15 +2319,15 @@ const HOOKS = [
|
|
|
2319
2319
|
"respond() value, and running/result/error are untouched — so use it to " +
|
|
2320
2320
|
"start work the widget needs no answer from (a batch, a sync, a long " +
|
|
2321
2321
|
"send) and tell the user it has started, never that it is done. " +
|
|
2322
|
-
"It is also refused when the Action is switched off (ACTION_DISABLED) " +
|
|
2323
|
-
"
|
|
2322
|
+
"It is also refused when the Action is switched off (ACTION_DISABLED), " +
|
|
2323
|
+
"and with RATE_LIMITED when the workspace " +
|
|
2324
2324
|
"already has 10 queued runs waiting. A queued run can run twice (a " +
|
|
2325
2325
|
"restart mid-run starts it again), so its Action must be safe to repeat. " +
|
|
2326
2326
|
"Reads ctx.actions.",
|
|
2327
2327
|
returnShape: {
|
|
2328
2328
|
available: "boolean // false when no Action is bound, the host brokers none, or the server says a run would not reach the script",
|
|
2329
2329
|
run: "(input) => Promise<unknown> // input is optional; resolves with the Action's respond() value, or null; rejects with ActionError",
|
|
2330
|
-
enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED
|
|
2330
|
+
enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED)",
|
|
2331
2331
|
running: "boolean // true while any run is in flight",
|
|
2332
2332
|
result: "unknown // the last successful run's result; null before the first run",
|
|
2333
2333
|
error: "ActionError | null",
|
|
@@ -6960,7 +6960,9 @@ const CONTRACT = deepFreeze({
|
|
|
6960
6960
|
// 1.255.0: fix (sc-16654) — `minFontPx` (12) publishes the smallest page text
|
|
6961
6961
|
// the render check accepts. The theme's six text tiers and its Buttons and
|
|
6962
6962
|
// Text component sizes now clamp up to it instead of to 8.
|
|
6963
|
-
|
|
6963
|
+
// 1.255.1: fix (sc-16882) — `ACTION_PAUSED` is gone from useAction's
|
|
6964
|
+
// refusals: no plan caps how many Actions run, so none is paused.
|
|
6965
|
+
version: "1.255.1",
|
|
6964
6966
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6965
6967
|
hooks: HOOKS,
|
|
6966
6968
|
primitives: PRIMITIVES,
|
package/dist/modal.native.js
CHANGED
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
Pressable,
|
|
10
10
|
ScrollView,
|
|
11
11
|
KeyboardAvoidingView,
|
|
12
|
-
Platform,
|
|
13
12
|
} from "react-native";
|
|
14
13
|
import { Text } from "./bounded-text.native.js";
|
|
15
14
|
// Host-provided: the exported app pins it and mounts its provider at the root.
|
|
@@ -21,11 +20,15 @@ import { Overlay } from "./overlay.native.js";
|
|
|
21
20
|
const useSafeAreaInsets = () => React.useContext(SafeAreaInsetsContext);
|
|
22
21
|
|
|
23
22
|
// Wraps the panel only, so the scrim still covers the strip under a raised one.
|
|
23
|
+
// "padding" on both platforms: "height" sets a fixed height the backdrop
|
|
24
|
+
// re-centres, which shrinks a dialog to one field on Android.
|
|
25
|
+
const MODAL_KEYBOARD_BEHAVIOR = "padding";
|
|
26
|
+
|
|
24
27
|
function KeyboardAvoider({ verticalAlign, children }) {
|
|
25
28
|
return React.createElement(
|
|
26
29
|
KeyboardAvoidingView,
|
|
27
30
|
{
|
|
28
|
-
behavior:
|
|
31
|
+
behavior: MODAL_KEYBOARD_BEHAVIOR,
|
|
29
32
|
// Lets a press beside the panel reach the backdrop behind this frame.
|
|
30
33
|
pointerEvents: "box-none",
|
|
31
34
|
style: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colixsystems/widget-sdk",
|
|
3
|
-
"version": "0.315.
|
|
3
|
+
"version": "0.315.3",
|
|
4
4
|
"description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Colix-AB/AppStudio.git",
|
|
8
|
+
"directory": "packages/widget-sdk"
|
|
9
|
+
},
|
|
5
10
|
"homepage": "https://github.com/Colix-AB/AppStudio",
|
|
6
11
|
"type": "module",
|
|
7
12
|
"main": "./dist/index.js",
|
package/src/contract.js
CHANGED
|
@@ -2294,7 +2294,7 @@ const HOOKS = [
|
|
|
2294
2294
|
"`available` is false and run() rejects UNAVAILABLE; render a visible " +
|
|
2295
2295
|
"'pick an action' state, NEVER a blank box. sc-14224: `available` also " +
|
|
2296
2296
|
"turns false once the server says a run would not reach the script — " +
|
|
2297
|
-
"the Action is switched off
|
|
2297
|
+
"the Action is switched off, not allowed from the app, gone, " +
|
|
2298
2298
|
"or the viewer is not a signed-in app user (signed-out visitors and " +
|
|
2299
2299
|
"anonymous accounts can't run Actions) — so render an 'isn't available' " +
|
|
2300
2300
|
"state then too. It stays true while no answer has come. A changed binding clears " +
|
|
@@ -2319,15 +2319,15 @@ const HOOKS = [
|
|
|
2319
2319
|
"respond() value, and running/result/error are untouched — so use it to " +
|
|
2320
2320
|
"start work the widget needs no answer from (a batch, a sync, a long " +
|
|
2321
2321
|
"send) and tell the user it has started, never that it is done. " +
|
|
2322
|
-
"It is also refused when the Action is switched off (ACTION_DISABLED) " +
|
|
2323
|
-
"
|
|
2322
|
+
"It is also refused when the Action is switched off (ACTION_DISABLED), " +
|
|
2323
|
+
"and with RATE_LIMITED when the workspace " +
|
|
2324
2324
|
"already has 10 queued runs waiting. A queued run can run twice (a " +
|
|
2325
2325
|
"restart mid-run starts it again), so its Action must be safe to repeat. " +
|
|
2326
2326
|
"Reads ctx.actions.",
|
|
2327
2327
|
returnShape: {
|
|
2328
2328
|
available: "boolean // false when no Action is bound, the host brokers none, or the server says a run would not reach the script",
|
|
2329
2329
|
run: "(input) => Promise<unknown> // input is optional; resolves with the Action's respond() value, or null; rejects with ActionError",
|
|
2330
|
-
enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED
|
|
2330
|
+
enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED)",
|
|
2331
2331
|
running: "boolean // true while any run is in flight",
|
|
2332
2332
|
result: "unknown // the last successful run's result; null before the first run",
|
|
2333
2333
|
error: "ActionError | null",
|
|
@@ -6960,7 +6960,9 @@ const CONTRACT = deepFreeze({
|
|
|
6960
6960
|
// 1.255.0: fix (sc-16654) — `minFontPx` (12) publishes the smallest page text
|
|
6961
6961
|
// the render check accepts. The theme's six text tiers and its Buttons and
|
|
6962
6962
|
// Text component sizes now clamp up to it instead of to 8.
|
|
6963
|
-
|
|
6963
|
+
// 1.255.1: fix (sc-16882) — `ACTION_PAUSED` is gone from useAction's
|
|
6964
|
+
// refusals: no plan caps how many Actions run, so none is paused.
|
|
6965
|
+
version: "1.255.1",
|
|
6964
6966
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6965
6967
|
hooks: HOOKS,
|
|
6966
6968
|
primitives: PRIMITIVES,
|