@coffer-org/plugin-webchat 2.2.5 → 2.2.7

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.
@@ -29520,9 +29520,10 @@ function ChatDropSurface({ children, onFiles, className }) {
29520
29520
  }
29521
29521
  /** What to do with the widget after following a link from a response. On desktop a 380px
29522
29522
  * panel does not obstruct the page (a darkened modal does, so it collapses into it);
29523
- * below the nav breakpoint the panel consumes nearly the whole screen. */
29523
+ * on narrow screens the chat remains expanded so the user does not lose the active
29524
+ * conversation after an in-app navigation. */
29524
29525
  function nextModeAfterNav(wideNav) {
29525
- return wideNav ? "panel" : "bubble";
29526
+ return wideNav ? "panel" : "modal";
29526
29527
  }
29527
29528
  function ChatWidget() {
29528
29529
  const { t } = useTranslation();
package/dist/schema.js CHANGED
@@ -6426,15 +6426,23 @@ function check(raw) {
6426
6426
  const required = o.required ?? false;
6427
6427
  const multiple = o.multiple ?? false;
6428
6428
  const slots = o.slots && o.slots.length > 0 ? o.slots : [""];
6429
+ const contentFields = o.fields?.length ? o.fields : [string({
6430
+ key: "text",
6431
+ label: "core.fields.text"
6432
+ })];
6433
+ const contentKeys = /* @__PURE__ */ new Set();
6434
+ for (const f of contentFields) {
6435
+ if (contentKeys.has(f.key)) throw new Error(`[field.check] duplicate content field '${f.key}'`);
6436
+ if (/^check\d+$/.test(f.key)) throw new Error(`[field.check] content field '${f.key}' is reserved for checkbox slots`);
6437
+ if (!multiple && (f.type.virtual || f.type.columns)) throw new Error(`[field.check] single content field '${f.key}' must be a scalar stored field`);
6438
+ contentKeys.add(f.key);
6439
+ }
6440
+ const checkFields = slots.map((label, i) => boolean({
6441
+ key: `check${i}`,
6442
+ label: label || "core.fields.check"
6443
+ }));
6429
6444
  if (multiple) {
6430
- const fields = slots.map((label, i) => boolean({
6431
- key: `check${i}`,
6432
- label: label || "core.fields.check"
6433
- }));
6434
- fields.push(string({
6435
- key: "text",
6436
- label: "core.fields.text"
6437
- }));
6445
+ const fields = [...checkFields, ...contentFields];
6438
6446
  return group({
6439
6447
  key: o.key,
6440
6448
  label: o.label ?? o.key,
@@ -6444,8 +6452,12 @@ function check(raw) {
6444
6452
  view: { kind: "checklist" }
6445
6453
  });
6446
6454
  }
6447
- const shape = { text: string$1() };
6448
- const columns = { text: "text" };
6455
+ const shape = {};
6456
+ const columns = {};
6457
+ for (const f of contentFields) {
6458
+ shape[f.key] = f.type.zod;
6459
+ columns[f.key] = f.type.column;
6460
+ }
6449
6461
  slots.forEach((_, i) => {
6450
6462
  shape[`check${i}`] = boolean$1();
6451
6463
  columns[`check${i}`] = "boolean";
@@ -6471,7 +6483,13 @@ function check(raw) {
6471
6483
  required,
6472
6484
  prim: "check",
6473
6485
  column: "text",
6474
- hints: { slots },
6486
+ hints: {
6487
+ slots,
6488
+ fields: contentFields.map((f) => ({
6489
+ key: f.key,
6490
+ ...toClient(f.type)
6491
+ }))
6492
+ },
6475
6493
  columns,
6476
6494
  zod: optionalize(s, required)
6477
6495
  });
package/dist/web.js CHANGED
@@ -11,7 +11,7 @@ import { definePluginUI } from "@coffer-org/web-sdk";
11
11
  var ui_default = definePluginUI({ slots: [{
12
12
  slot: "overlay",
13
13
  id: "webchat",
14
- load: () => import("./ChatWidget-By7bmS3U.js")
14
+ load: () => import("./ChatWidget-4U7nKidI.js")
15
15
  }] });
16
16
  //#endregion
17
17
  export { ui_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffer-org/plugin-webchat",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24"
@@ -26,9 +26,9 @@
26
26
  "test:ui": "vitest run --root ."
27
27
  },
28
28
  "dependencies": {
29
- "@coffer-org/plugin-orchestrator": "^2.3.2",
30
- "@coffer-org/sdk": "^2.1.2",
31
- "@coffer-org/server": "^2.5.0",
29
+ "@coffer-org/plugin-orchestrator": "^2.3.3",
30
+ "@coffer-org/sdk": "^2.1.3",
31
+ "@coffer-org/server": "^2.5.2",
32
32
  "react-markdown": "^10.1.0",
33
33
  "remark-gfm": "^4.0.1"
34
34
  },