pixelon 0.3.83 → 0.3.84

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.
@@ -6,6 +6,19 @@ export interface ChatCurrency {
6
6
  symbol?: string;
7
7
  }
8
8
  export interface ChatConfig {
9
+ /** SPEC-107 — esta conversación es de OTRO: se lee, no se opera.
10
+ *
11
+ * Las cards del chat llevan acciones que ejecutan de verdad —aceptar una cotización, confirmar
12
+ * un pago, asignar—. Estando dentro de la conversación de otro rol, pulsarlas es actuar en su
13
+ * nombre. `readOnly` no sirve para decidirlo: mezcla «cerrado», «del sistema» y «de otro», y los
14
+ * chats de servicio pertenecen a un usuario sintético, así que hasta el propio panel de la
15
+ * operadora sale como solo lectura.
16
+ *
17
+ * Viaja por config y no por evento porque el bus no guarda el último valor y estas cards nacen
18
+ * después de que se emita: no llegarían a oírlo. Por omisión, operable — una guarda que se cae
19
+ * sola es preferible a un panel que se apaga por una conexión mala; el backend sigue rechazando
20
+ * lo que no toca. */
21
+ chatIsForeign?: boolean;
9
22
  /** IANA timezone identifier (e.g. "America/Bogota") */
10
23
  timezone: string;
11
24
  /** BCP 47 locale string (e.g. "es-CO") */
package/dist/index.esm.js CHANGED
@@ -16167,7 +16167,7 @@ function readCreated(messageId) {
16167
16167
  }
16168
16168
  }
16169
16169
  function ReactiveCrudChat({ component, eventBus, assistantMessageId }) {
16170
- const { resolveModuleConfig } = useChatConfig();
16170
+ const { resolveModuleConfig, chatIsForeign } = useChatConfig();
16171
16171
  const [open, setOpen] = useState(false);
16172
16172
  const [created, setCreated] = useState(() => readCreated(assistantMessageId));
16173
16173
  const props = component.props ?? {};
@@ -16206,8 +16206,8 @@ function ReactiveCrudChat({ component, eventBus, assistantMessageId }) {
16206
16206
  type: "button",
16207
16207
  className: `px-chat-reactive-crud-trigger${done ? " px-chat-reactive-crud-trigger--done" : ""}`,
16208
16208
  onClick: () => setOpen(true),
16209
- disabled: done,
16210
- "aria-disabled": done,
16209
+ disabled: done || Boolean(chatIsForeign),
16210
+ "aria-disabled": done || Boolean(chatIsForeign),
16211
16211
  children: [
16212
16212
  /* @__PURE__ */ jsx("span", { className: "px-chat-reactive-crud-trigger__icon", children: done ? /* @__PURE__ */ jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
16213
16213
  /* @__PURE__ */ jsx("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
@@ -16326,6 +16326,7 @@ function ReactiveCrudItemChat({ component, eventBus }) {
16326
16326
  );
16327
16327
  }
16328
16328
  function ServiceActionsPanel({ config, recordId, recordLabel, allowed, eventBus }) {
16329
+ const { chatIsForeign } = useChatConfig();
16329
16330
  const crud = useReactiveCrud(config, eventBus);
16330
16331
  const [activeAction, setActiveAction] = useState(null);
16331
16332
  const [detailRow, setDetailRow] = useState(null);
@@ -16397,8 +16398,8 @@ function ServiceActionsPanel({ config, recordId, recordLabel, allowed, eventBus
16397
16398
  row && /* @__PURE__ */ jsxs("div", { className: "px-chat-crud-item__actions", children: [
16398
16399
  config.detail && /* @__PURE__ */ jsx("button", { type: "button", className: "px-chat-crud-item__action", onClick: () => setDetailRow(row), children: "Ver" }),
16399
16400
  actions.map((a) => {
16400
- const disabled = matchesDisabledWhen(a, row);
16401
- const motivo = disabledReasonFor(a, row);
16401
+ const disabled = Boolean(chatIsForeign) || matchesDisabledWhen(a, row);
16402
+ const motivo = chatIsForeign ? "Esta conversaci\xF3n es de otra persona" : disabledReasonFor(a, row);
16402
16403
  const done = matchesDoneWhen(a, row);
16403
16404
  return /* @__PURE__ */ jsxs(
16404
16405
  "button",
@@ -16464,6 +16465,7 @@ function PriceNegotiationChat({ component, eventBus }) {
16464
16465
  );
16465
16466
  }
16466
16467
  function NegotiationPanel({ config, recordId, recordLabel, allowed, eventBus }) {
16468
+ const { chatIsForeign } = useChatConfig();
16467
16469
  const crud = useReactiveCrud(config, eventBus);
16468
16470
  const [activeAction, setActiveAction] = useState(null);
16469
16471
  const row = useMemo(
@@ -16509,7 +16511,7 @@ function NegotiationPanel({ config, recordId, recordLabel, allowed, eventBus })
16509
16511
  actions.map((a) => {
16510
16512
  const gated = TURN_GATED.has(a.key) && !myTurn;
16511
16513
  const noOffer = a.key === "accept_price" && !hasOffer;
16512
- const disabled = gated || noOffer;
16514
+ const disabled = gated || noOffer || Boolean(chatIsForeign);
16513
16515
  return /* @__PURE__ */ jsx(
16514
16516
  "button",
16515
16517
  {
package/dist/index.js CHANGED
@@ -16188,7 +16188,7 @@ function readCreated(messageId) {
16188
16188
  }
16189
16189
  }
16190
16190
  function ReactiveCrudChat({ component, eventBus, assistantMessageId }) {
16191
- const { resolveModuleConfig } = useChatConfig();
16191
+ const { resolveModuleConfig, chatIsForeign } = useChatConfig();
16192
16192
  const [open, setOpen] = React.useState(false);
16193
16193
  const [created, setCreated] = React.useState(() => readCreated(assistantMessageId));
16194
16194
  const props = component.props ?? {};
@@ -16227,8 +16227,8 @@ function ReactiveCrudChat({ component, eventBus, assistantMessageId }) {
16227
16227
  type: "button",
16228
16228
  className: `px-chat-reactive-crud-trigger${done ? " px-chat-reactive-crud-trigger--done" : ""}`,
16229
16229
  onClick: () => setOpen(true),
16230
- disabled: done,
16231
- "aria-disabled": done,
16230
+ disabled: done || Boolean(chatIsForeign),
16231
+ "aria-disabled": done || Boolean(chatIsForeign),
16232
16232
  children: [
16233
16233
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-chat-reactive-crud-trigger__icon", children: done ? /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
16234
16234
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
@@ -16347,6 +16347,7 @@ function ReactiveCrudItemChat({ component, eventBus }) {
16347
16347
  );
16348
16348
  }
16349
16349
  function ServiceActionsPanel({ config, recordId, recordLabel, allowed, eventBus }) {
16350
+ const { chatIsForeign } = useChatConfig();
16350
16351
  const crud = useReactiveCrud(config, eventBus);
16351
16352
  const [activeAction, setActiveAction] = React.useState(null);
16352
16353
  const [detailRow, setDetailRow] = React.useState(null);
@@ -16418,8 +16419,8 @@ function ServiceActionsPanel({ config, recordId, recordLabel, allowed, eventBus
16418
16419
  row && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-chat-crud-item__actions", children: [
16419
16420
  config.detail && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "px-chat-crud-item__action", onClick: () => setDetailRow(row), children: "Ver" }),
16420
16421
  actions.map((a) => {
16421
- const disabled = matchesDisabledWhen(a, row);
16422
- const motivo = disabledReasonFor(a, row);
16422
+ const disabled = Boolean(chatIsForeign) || matchesDisabledWhen(a, row);
16423
+ const motivo = chatIsForeign ? "Esta conversaci\xF3n es de otra persona" : disabledReasonFor(a, row);
16423
16424
  const done = matchesDoneWhen(a, row);
16424
16425
  return /* @__PURE__ */ jsxRuntime.jsxs(
16425
16426
  "button",
@@ -16485,6 +16486,7 @@ function PriceNegotiationChat({ component, eventBus }) {
16485
16486
  );
16486
16487
  }
16487
16488
  function NegotiationPanel({ config, recordId, recordLabel, allowed, eventBus }) {
16489
+ const { chatIsForeign } = useChatConfig();
16488
16490
  const crud = useReactiveCrud(config, eventBus);
16489
16491
  const [activeAction, setActiveAction] = React.useState(null);
16490
16492
  const row = React.useMemo(
@@ -16530,7 +16532,7 @@ function NegotiationPanel({ config, recordId, recordLabel, allowed, eventBus })
16530
16532
  actions.map((a) => {
16531
16533
  const gated = TURN_GATED.has(a.key) && !myTurn;
16532
16534
  const noOffer = a.key === "accept_price" && !hasOffer;
16533
- const disabled = gated || noOffer;
16535
+ const disabled = gated || noOffer || Boolean(chatIsForeign);
16534
16536
  return /* @__PURE__ */ jsxRuntime.jsx(
16535
16537
  "button",
16536
16538
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelon",
3
- "version": "0.3.83",
3
+ "version": "0.3.84",
4
4
  "description": "Design system de la marca goluti",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",