@owlmeans/common-inquiry 0.1.18-rc.0 → 0.1.18-rc.2
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 +2 -2
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/common-inquiry/SKILL.md +23 -3
- package/build/types.d.ts +26 -2
- package/build/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ No React, no DOM, no runtime dependencies: constants, types, JSON schemas and on
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
bun add @owlmeans/common-inquiry@^0.1.18-rc.
|
|
14
|
+
bun add @owlmeans/common-inquiry@^0.1.18-rc.2
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
`ajv` is an optional peer: the schemas are typed with its `JSONSchemaType`, and a server that
|
|
@@ -65,7 +65,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
65
65
|
your project's skill store (`.agents/skills/`):
|
|
66
66
|
|
|
67
67
|
```sh
|
|
68
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
68
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.56
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/common-inquiry",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.2",
|
|
5
|
+
"generatedAt": "2026-10-20T09:43:15.733Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/common-inquiry
|
|
9
9
|
|
|
10
10
|
**Layer:** Cross-cutting domain (no `@owlmeans/*` dependencies; optional `ajv` peer for schema types)
|
|
11
|
-
**Install:** `"@owlmeans/common-inquiry": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/common-inquiry": "^0.1.18-rc.2"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
The one place the three parties of the inquiry widget agree: the browser SDK
|
|
14
14
|
(`@owlmeans/web-inquiry`), the widget bundle that renders the dialog, and the CRM API that accepts
|
|
@@ -66,8 +66,8 @@ The bundle installs an `InquiryRuntime` at `window[INQUIRY_GLOBAL]` (`window.__o
|
|
|
66
66
|
|---|---|
|
|
67
67
|
| `version` | `INQUIRY_RUNTIME_VERSION`; a client refuses another. Bump it only for an incompatible change |
|
|
68
68
|
| `configure(options)` | page-wide `{ url, language?, onOpen? }`, last call wins; `language` may be a function read at every open |
|
|
69
|
-
| `open(config, opts?)` | mount the widget's dialog on first use, open it on `opts.tab` or the default tab |
|
|
70
|
-
| `button(config, opts?)` | mount a floating button (`position`, `offset`, `label`, `source` — default `fab`); returns an `InquiryHandle` (`open`, `update`, `unmount`); a second call for the same id updates it |
|
|
69
|
+
| `open(config, opts?)` | mount the widget's dialog on first use, open it on `opts.tab` or the default tab; apply `opts.email` when supplied |
|
|
70
|
+
| `button(config, opts?)` | mount a floating button (`position`, `offset`, `label`, `source` — default `fab`, `email`); returns an `InquiryHandle` (`open`, `update`, `unmount`); a second call for the same id updates it |
|
|
71
71
|
| `unmount(id?)` | remove one widget, or all |
|
|
72
72
|
|
|
73
73
|
**`onOpen` is called exactly once per dialog open**, whatever opened it — `open`, a handle's
|
|
@@ -75,6 +75,26 @@ The bundle installs an `InquiryRuntime` at `window[INQUIRY_GLOBAL]` (`window.__o
|
|
|
75
75
|
does not call it again. The SDK reports analytics from this callback only, so a runtime that also
|
|
76
76
|
reported from elsewhere would double-count.
|
|
77
77
|
|
|
78
|
+
`InquiryOpenOptions.message` is an optional `InquiryMessagePreset`: an `InquiryMessage`
|
|
79
|
+
(`{ subject?, body? }`) or a sync provider returning one (or null/undefined), read once on each
|
|
80
|
+
closed-to-open transition. The runtime replaces only the draft fields it names; an empty result or a
|
|
81
|
+
throwing provider presets nothing, and omitting it keeps the draft. A runtime that predates it
|
|
82
|
+
ignores it, so `INQUIRY_RUNTIME_VERSION` is unchanged.
|
|
83
|
+
|
|
84
|
+
`InquiryEmailOptions.email` is an optional `InquiryEmailPreset`: a string or a lazy function
|
|
85
|
+
returning `InquiryEmailValue` (`string | null | undefined`), synchronously or in a Promise. The
|
|
86
|
+
runtime resolves it on each closed-to-open transition and replaces any manually edited address;
|
|
87
|
+
calling `open` on an already open dialog does not resolve it again. A null/undefined result or a
|
|
88
|
+
provider failure clears the address for manual entry. Omitting the option preserves the manual
|
|
89
|
+
draft. A button's provider also applies to its floating trigger and handle's `open`; an explicit
|
|
90
|
+
open option overrides it.
|
|
91
|
+
|
|
92
|
+
While a Promise is pending, the address is empty, its field and Send are disabled, and a spinner
|
|
93
|
+
beside the field announces loading. Other fields remain editable. Closing, reopening or unmounting
|
|
94
|
+
invalidates earlier pending results. A synchronous result needs no spinner. The host owns caching;
|
|
95
|
+
the runtime does not fetch identity or persist addresses. These optional options keep runtime
|
|
96
|
+
version 1 compatible with clients that omit them.
|
|
97
|
+
|
|
78
98
|
## The submission
|
|
79
99
|
|
|
80
100
|
One multipart POST. A multipart parser with `attachFieldsToBody: 'keyValues'` hands every text
|
package/build/types.d.ts
CHANGED
|
@@ -43,13 +43,37 @@ export interface InquiryWidgetConfig {
|
|
|
43
43
|
/** The interface language; default: the runtime's configured language, then the document's. */
|
|
44
44
|
language?: string;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
/** A preset reply address, resolved when the dialog opens. A missing result clears the email. */
|
|
47
|
+
export type InquiryEmailValue = string | null | undefined;
|
|
48
|
+
/** A reply address or a lazy provider; a pending provider shows the widget's email spinner. */
|
|
49
|
+
export type InquiryEmailPreset = string | (() => InquiryEmailValue | Promise<InquiryEmailValue>);
|
|
50
|
+
export interface InquiryEmailOptions {
|
|
51
|
+
/** Applied on every dialog open, replacing any previously edited email. Omit to keep manual entry. */
|
|
52
|
+
email?: InquiryEmailPreset;
|
|
53
|
+
}
|
|
54
|
+
/** A subject and message the dialog's form opens with — the inquirer can still edit both. */
|
|
55
|
+
export interface InquiryMessage {
|
|
56
|
+
subject?: string;
|
|
57
|
+
body?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A preset message, or a provider read once when the dialog opens (so a trigger whose context
|
|
61
|
+
* changes — an estimate the visitor is still adjusting — hands over what it shows at the click).
|
|
62
|
+
* A missing result, or a provider that throws, leaves the form as it is.
|
|
63
|
+
*/
|
|
64
|
+
export type InquiryMessagePreset = InquiryMessage | (() => InquiryMessage | null | undefined);
|
|
65
|
+
export interface InquiryOpenOptions extends InquiryEmailOptions {
|
|
47
66
|
/** The alias of the tab to select; an unknown alias selects the default tab. */
|
|
48
67
|
tab?: string;
|
|
49
68
|
/** Which trigger opened the dialog (`fab`, `menu`, `pricing-card` …), reported in analytics. */
|
|
50
69
|
source?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Applied on this open: each field it names replaces the draft's subject or body. Omit it to keep
|
|
72
|
+
* whatever the inquirer typed before. A runtime that predates it ignores it.
|
|
73
|
+
*/
|
|
74
|
+
message?: InquiryMessagePreset;
|
|
51
75
|
}
|
|
52
|
-
export interface InquiryButtonOptions {
|
|
76
|
+
export interface InquiryButtonOptions extends InquiryEmailOptions {
|
|
53
77
|
/** Default: `bottom-right`. */
|
|
54
78
|
position?: InquiryButtonPosition;
|
|
55
79
|
/** Distance from the viewport edges in CSS pixels. */
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEvD;;;;GAI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C,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAC7C,wCAAwC;IACxC,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,8FAA8F;IAC9F,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,SAAS,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAA;IACnD,4FAA4F;IAC5F,IAAI,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAA;IACtE,6FAA6F;IAC7F,MAAM,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,oBAAoB,KAAK,aAAa,CAAA;IACnF,wEAAwE;IACxE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAED,8CAA8C;AAC9C,MAAM,WAAW,aAAa;IAC5B,iBAAiB,CAAC,EAAE,cAAc,CAAA;CACnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/common-inquiry",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Runtime-free contract of the OwlMeans customer inquiry widget — the window runtime, the widget config, the multipart submission and its limits, schemas and the config helper.",
|
|
6
6
|
"type": "module",
|