FastAPI backend (Python 3.11, MSSQL ODBC for SambaPOS, Azure DI OCR),
kitchen_db on central PG. React/TS/Vite frontend with navy sidebar layout.
Backend: auth.py (APP_SLUG=kitchen, SimpleNamespace — archive routes use
.kitchen_id/.is_admin without modification), main.py (51 migrations, scheduler,
internal router for KDS bookings feed), api/internal.py, full archive API
(31 routers: invoices, recipes, menus, sambapos, resos, newbook, disputes,
purchase_orders, etc.), models, migrations, OCR pipeline.
kitchen_id pinned to 1 (B1 — single hotel).
Frontend: AuthGate (app=kitchen, token shim for archive compat — B5b pending),
Layout (navy sidebar, 6 sections, Lucide icons, teal --app-primary),
App.tsx (Outlet pattern, UploadApp outside Layout), index.css (full :root block).
strict: false — archive components have type issues; build clean.
Note: 45 archive components call fetch('/api/...') without /kitchen/ prefix
(B5b). Runtime 404s; deferred until after initial testing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
88 lines
4.5 KiB
JavaScript
88 lines
4.5 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var utils_1 = require("./utils");
|
|
var Courier_Bold_compressed_json_1 = __importDefault(require("./Courier-Bold.compressed.json"));
|
|
var Courier_BoldOblique_compressed_json_1 = __importDefault(require("./Courier-BoldOblique.compressed.json"));
|
|
var Courier_Oblique_compressed_json_1 = __importDefault(require("./Courier-Oblique.compressed.json"));
|
|
var Courier_compressed_json_1 = __importDefault(require("./Courier.compressed.json"));
|
|
var Helvetica_Bold_compressed_json_1 = __importDefault(require("./Helvetica-Bold.compressed.json"));
|
|
var Helvetica_BoldOblique_compressed_json_1 = __importDefault(require("./Helvetica-BoldOblique.compressed.json"));
|
|
var Helvetica_Oblique_compressed_json_1 = __importDefault(require("./Helvetica-Oblique.compressed.json"));
|
|
var Helvetica_compressed_json_1 = __importDefault(require("./Helvetica.compressed.json"));
|
|
var Times_Bold_compressed_json_1 = __importDefault(require("./Times-Bold.compressed.json"));
|
|
var Times_BoldItalic_compressed_json_1 = __importDefault(require("./Times-BoldItalic.compressed.json"));
|
|
var Times_Italic_compressed_json_1 = __importDefault(require("./Times-Italic.compressed.json"));
|
|
var Times_Roman_compressed_json_1 = __importDefault(require("./Times-Roman.compressed.json"));
|
|
var Symbol_compressed_json_1 = __importDefault(require("./Symbol.compressed.json"));
|
|
var ZapfDingbats_compressed_json_1 = __importDefault(require("./ZapfDingbats.compressed.json"));
|
|
// prettier-ignore
|
|
var compressedJsonForFontName = {
|
|
'Courier': Courier_compressed_json_1.default,
|
|
'Courier-Bold': Courier_Bold_compressed_json_1.default,
|
|
'Courier-Oblique': Courier_Oblique_compressed_json_1.default,
|
|
'Courier-BoldOblique': Courier_BoldOblique_compressed_json_1.default,
|
|
'Helvetica': Helvetica_compressed_json_1.default,
|
|
'Helvetica-Bold': Helvetica_Bold_compressed_json_1.default,
|
|
'Helvetica-Oblique': Helvetica_Oblique_compressed_json_1.default,
|
|
'Helvetica-BoldOblique': Helvetica_BoldOblique_compressed_json_1.default,
|
|
'Times-Roman': Times_Roman_compressed_json_1.default,
|
|
'Times-Bold': Times_Bold_compressed_json_1.default,
|
|
'Times-Italic': Times_Italic_compressed_json_1.default,
|
|
'Times-BoldItalic': Times_BoldItalic_compressed_json_1.default,
|
|
'Symbol': Symbol_compressed_json_1.default,
|
|
'ZapfDingbats': ZapfDingbats_compressed_json_1.default,
|
|
};
|
|
var FontNames;
|
|
(function (FontNames) {
|
|
FontNames["Courier"] = "Courier";
|
|
FontNames["CourierBold"] = "Courier-Bold";
|
|
FontNames["CourierOblique"] = "Courier-Oblique";
|
|
FontNames["CourierBoldOblique"] = "Courier-BoldOblique";
|
|
FontNames["Helvetica"] = "Helvetica";
|
|
FontNames["HelveticaBold"] = "Helvetica-Bold";
|
|
FontNames["HelveticaOblique"] = "Helvetica-Oblique";
|
|
FontNames["HelveticaBoldOblique"] = "Helvetica-BoldOblique";
|
|
FontNames["TimesRoman"] = "Times-Roman";
|
|
FontNames["TimesRomanBold"] = "Times-Bold";
|
|
FontNames["TimesRomanItalic"] = "Times-Italic";
|
|
FontNames["TimesRomanBoldItalic"] = "Times-BoldItalic";
|
|
FontNames["Symbol"] = "Symbol";
|
|
FontNames["ZapfDingbats"] = "ZapfDingbats";
|
|
})(FontNames = exports.FontNames || (exports.FontNames = {}));
|
|
var fontCache = {};
|
|
var Font = /** @class */ (function () {
|
|
function Font() {
|
|
var _this = this;
|
|
this.getWidthOfGlyph = function (glyphName) {
|
|
return _this.CharWidths[glyphName];
|
|
};
|
|
this.getXAxisKerningForPair = function (leftGlyphName, rightGlyphName) {
|
|
return (_this.KernPairXAmounts[leftGlyphName] || {})[rightGlyphName];
|
|
};
|
|
}
|
|
Font.load = function (fontName) {
|
|
var cachedFont = fontCache[fontName];
|
|
if (cachedFont)
|
|
return cachedFont;
|
|
var json = utils_1.decompressJson(compressedJsonForFontName[fontName]);
|
|
var font = Object.assign(new Font(), JSON.parse(json));
|
|
font.CharWidths = font.CharMetrics.reduce(function (acc, metric) {
|
|
acc[metric.N] = metric.WX;
|
|
return acc;
|
|
}, {});
|
|
font.KernPairXAmounts = font.KernPairs.reduce(function (acc, _a) {
|
|
var name1 = _a[0], name2 = _a[1], width = _a[2];
|
|
if (!acc[name1])
|
|
acc[name1] = {};
|
|
acc[name1][name2] = width;
|
|
return acc;
|
|
}, {});
|
|
fontCache[fontName] = font;
|
|
return font;
|
|
};
|
|
return Font;
|
|
}());
|
|
exports.Font = Font;
|