@fayz-ai/plugin-tables 0.14.25 → 0.15.0-canary.20261027164140
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-supabase.d.ts","sourceRoot":"","sources":["../../src/data/core-supabase.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AA2FjD,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;IACzC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE;QACV,YAAY,EAAE,MAAM,CAAA;QACpB,uEAAuE;QACvE,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,mDAAmD;QACnD,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,yCAAyC;QACzC,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;CACF;AAED,MAAM,WAAW,yBAAyB;IACxC,8EAA8E;IAC9E,MAAM,CAAC,EAAE,sBAAsB,CAAA;CAChC;AAID,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"core-supabase.d.ts","sourceRoot":"","sources":["../../src/data/core-supabase.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AA2FjD,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;IACzC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE;QACV,YAAY,EAAE,MAAM,CAAA;QACpB,uEAAuE;QACvE,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,mDAAmD;QACnD,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,yCAAyC;QACzC,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;CACF;AAED,MAAM,WAAW,yBAAyB;IACxC,8EAA8E;IAC9E,MAAM,CAAC,EAAE,sBAAsB,CAAA;CAChC;AAID,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,kBAAkB,CAojGhG"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAqB3C,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,MAAM,CAAA;CACvB;AAaD,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,OAAO,CAAA;QACtB,cAAc,CAAC,EAAE,OAAO,CAAA;KACzB,CAAA;IACD,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACpC,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACtD,8EAA8E;IAC9E,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAAA;IAC9C,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACtE,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACzD;AA4BD,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,sBAAsB,CAAA;AAG1D,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,cAAc,CA4LhF;AAED,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAG1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,YAAY,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7F,YAAY,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACrD,YAAY,EACV,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,sBAAsB,EACjE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,GAC9E,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TablesContextProvider } from './chunk-XHRPH676.js';
|
|
2
|
-
import { tl, cancelReplayResults, fixedDiscountShares, legacyKindOfChannel, openingServiceCharge, registerComponent, resolveDataProvider, getSupabaseClientOptional, describeError, lineAddOns, getActiveTenantId, getActiveUnitId } from '@fayz-ai/core';
|
|
2
|
+
import { tl, cancelReplayResults, fixedDiscountShares, legacyKindOfChannel, openingServiceCharge, registerComponent, resolveDataProvider, getSupabaseClientOptional, describeError, lineAddOns, getActiveTenantId, getActiveUnitId, isKnownMissing, rememberIfMissing } from '@fayz-ai/core';
|
|
3
3
|
import { defineSettingsTab, PluginSettingsPanel, dedup } from '@fayz-ai/admin';
|
|
4
4
|
import React3, { forwardRef } from 'react';
|
|
5
5
|
import { createStore } from 'zustand/vanilla';
|
|
@@ -133,6 +133,71 @@ var tablesV1SettingsTabs = [
|
|
|
133
133
|
}]
|
|
134
134
|
})
|
|
135
135
|
];
|
|
136
|
+
var PRINTERS_TABLE = "plg_print_printers";
|
|
137
|
+
async function printerConfigured() {
|
|
138
|
+
if (isKnownMissing(PRINTERS_TABLE)) return false;
|
|
139
|
+
const db = getSupabaseClientOptional();
|
|
140
|
+
const tenantId = getActiveTenantId();
|
|
141
|
+
if (!db || !tenantId) return false;
|
|
142
|
+
const { count, error } = await db.from(PRINTERS_TABLE).select("id", { count: "exact", head: true }).eq("tenant_id", tenantId);
|
|
143
|
+
if (error) {
|
|
144
|
+
rememberIfMissing(PRINTERS_TABLE, error);
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
return (count ?? 0) > 0;
|
|
148
|
+
}
|
|
149
|
+
function buildTablesOnboarding() {
|
|
150
|
+
return {
|
|
151
|
+
id: "tables",
|
|
152
|
+
title: tl("Your floor", "Seu sal\xE3o"),
|
|
153
|
+
order: 75,
|
|
154
|
+
instructions: tl(
|
|
155
|
+
`You are setting up the kitchen printer. It is a "when you want" step: nothing in the operation waits for it, and the POS works without it.
|
|
156
|
+
- Ask whether the printer is on the network or USB and lead the person to Configura\xE7\xF5es \u203A Impressoras; the rest is on that screen.
|
|
157
|
+
- Never make it sound like a blocker. Offer it once; if the person has no printer, say the ticket shows on the screen and move on.
|
|
158
|
+
- Every step has a guide (readSetupGuide). Read it before leading.`,
|
|
159
|
+
`Voc\xEA est\xE1 configurando a impressora da cozinha. \xC9 um passo "quando quiser": nada da opera\xE7\xE3o espera por ele e o PDV funciona sem.
|
|
160
|
+
- Pergunte se a impressora \xE9 de rede ou USB e leve a pessoa a Configura\xE7\xF5es \u203A Impressoras; o resto est\xE1 na tela.
|
|
161
|
+
- Nunca soe como bloqueio. Ofere\xE7a uma vez; se a casa n\xE3o tem impressora, diga que a comanda aparece na tela e siga.
|
|
162
|
+
- Cada passo tem um guia (readSetupGuide). Leia antes de conduzir.`
|
|
163
|
+
),
|
|
164
|
+
steps: [
|
|
165
|
+
{
|
|
166
|
+
key: "printer",
|
|
167
|
+
title: tl("Kitchen printer", "Impressora da cozinha"),
|
|
168
|
+
description: tl(
|
|
169
|
+
"The ticket prints in the kitchen on its own. Works with a network or USB printer.",
|
|
170
|
+
"Comanda sai sozinha na cozinha. Funciona com impressora de rede ou USB."
|
|
171
|
+
),
|
|
172
|
+
icon: "Printer",
|
|
173
|
+
route: "/settings/tables-printers",
|
|
174
|
+
priority: "low",
|
|
175
|
+
// Part of the store-live journey, below the "quando quiser" line.
|
|
176
|
+
journey: { group: "later" },
|
|
177
|
+
agentHint: tl(
|
|
178
|
+
"Offer it once, without urgency. Network or USB, then the Printers screen; the POS works without it.",
|
|
179
|
+
"Ofere\xE7a uma vez, sem urg\xEAncia. Rede ou USB, depois a tela de Impressoras; o PDV funciona sem."
|
|
180
|
+
),
|
|
181
|
+
howTo: tl(
|
|
182
|
+
"Configura\xE7\xF5es \u203A Impressoras. Turn printing on for the unit, add the printer (network: its IP; USB: the computer it is plugged into) and pick which documents go to the kitchen. Send a test ticket from the POS.",
|
|
183
|
+
"Configura\xE7\xF5es \u203A Impressoras. Ative a impress\xE3o na unidade, cadastre a impressora (rede: o IP dela; USB: o computador onde est\xE1 ligada) e escolha quais documentos v\xE3o para a cozinha. Mande uma comanda de teste pelo PDV."
|
|
184
|
+
),
|
|
185
|
+
celebrate: tl("Printer ready.", "Impressora pronta."),
|
|
186
|
+
script: [
|
|
187
|
+
{ kind: "goto", route: "/settings/tables-printers" },
|
|
188
|
+
{
|
|
189
|
+
kind: "await",
|
|
190
|
+
text: tl(
|
|
191
|
+
"Turn printing on and add your printer here. I will see it from here when it is saved.",
|
|
192
|
+
"Ative a impress\xE3o e cadastre a sua impressora aqui. Eu vejo daqui quando salvar."
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
check: printerConfigured
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
};
|
|
200
|
+
}
|
|
136
201
|
|
|
137
202
|
// src/data/mock.ts
|
|
138
203
|
var uid = 0;
|
|
@@ -2308,7 +2373,7 @@ function createCoreTablesProvider(options) {
|
|
|
2308
2373
|
const { data: corte } = await db().rpc("comanda_next_day_cutoff");
|
|
2309
2374
|
const inicio = corte ? new Date(new Date(corte).getTime() - 24 * 36e5).toISOString() : new Date(Date.now() - 24 * 36e5).toISOString();
|
|
2310
2375
|
let q = db().from("orders").select(`id, total, completed_at, updated_at, channel, kind,
|
|
2311
|
-
${ORDER_EXT}(table_id, ${TABLES}(number, name)), people:party_id(name)`).eq("status", "completed").gte("updated_at", inicio).order("updated_at", { ascending: false }).limit(60);
|
|
2376
|
+
${ORDER_EXT}(table_id, ${TABLES}(number, name)), people:party_id(name)`).eq("status", "completed").or("metadata->>test.is.null,metadata->>test.neq.true").gte("updated_at", inicio).order("updated_at", { ascending: false }).limit(60);
|
|
2312
2377
|
if (channel) q = q.eq("channel", channel);
|
|
2313
2378
|
const { data, error } = await q;
|
|
2314
2379
|
if (error) throw new Error(error.message);
|
|
@@ -4556,6 +4621,7 @@ function createTablesPlugin(options) {
|
|
|
4556
4621
|
}
|
|
4557
4622
|
],
|
|
4558
4623
|
registries: tablesRegistries,
|
|
4624
|
+
onboarding: { program: buildTablesOnboarding() },
|
|
4559
4625
|
facets: [
|
|
4560
4626
|
{ id: "waitlist", label: "Fila de espera", description: "Lista de espera com aviso por mensagem." },
|
|
4561
4627
|
{ id: "tablets", label: "Tablets de mesa", description: "O cliente pede sozinho pelo tablet da mesa." }
|