SGApps.IO products · Spreadsheet · Writer · Packer
Three SGApps.IO products, written in-house from scratch -- an Excel-like Spreadsheet with its own formula engine, a Word-like Writer with its own DOCX reader and writer, and a Packer with its own ZIP, TAR, 7z and LZMA implementations -- about 34,000 lines of original JavaScript (plus 8,700 of CSS) with no third-party editor, parser or archive library inside. Around them, for the application-prototype framework: an iframe sandbox of our own, a CodeMirror-based code editor, and thin Application.require() wrappers for 24 vendored open-source libraries. Plain ES5, no build step, no bundler.
Three SGApps.IO products for the application-prototype framework, and the modules and wrappers around them -- three tiers, and every card below carries a badge saying which is which. SGApps.IO products -- the Spreadsheet, the Writer and the Packer -- are original software developed in-house by SGApps.IO: their formula engine, document model, pagination, OOXML / ODF readers and writers, ZIP / TAR / 7z containers and LZMA codec are all our own code (proprietary, source-available). SGApps.IO modules are Apache-2.0 infrastructure we wrote: the iframe sandbox, and our integration code around CodeMirror and JSZip. Third-party wrappers are thin Application.require() adapters that make 24 open-source libraries (amCharts 4, PDF.js, Tesseract.js, OpenCV.js, SQL.js, Xterm.js, CKEditor 4 / 5, SVG-Edit, JsBarcode, ZXing, ...) load lazily and behave like every other module; each is labelled with its upstream project and licence.
Spreadsheet (~13,000 JS + 2,900 CSS), Writer (~19,400 JS + 5,800 CSS) and Packer (1,642) -- counted with wc -l; a grep for require( over the product folders shows they load only the framework and the Packer: no third-party editor, parser, chart, formula or archive library.
A formula tokenizer / parser / evaluator with 130+ functions and dependency-ordered recalculation; a paginated document engine with its own DOCX reader and writer; a ZIP / ustar / 7z writer whose output the reference tools accept, and an LZMA range coder that 7-Zip accepts.
Packer's output passes unzip -t, GNU tar, gzip -t and 7z t; the Spreadsheet's XLSX / ODS exports and the Writer's DOCX export open in LibreOffice (headless conversion, recorded in the fix trackers).
modules/lib.js registers 36 names; products and wrappers alike return ApplicationPrototype instances with on(), bind(), whenLoaded(), and a playground page each.
Original software developed from scratch by SGApps.IO. No third-party runtime code: the only things they load are the application-prototype framework (also ours) and, for packing exports, the Packer. Proprietary, source-available -- the source is published for evaluation; using them in a product needs an agreement with SGApps.IO.
An Excel-like editor with its own formula engine -- tokenizer, recursive-descent parser and AST evaluator with 130+ functions (SUM..SUMIFS, VLOOKUP / INDEX / MATCH, IFS, STDEV, PMT / NPV / IRR, dates), dependency-ordered recalculation with #CIRC! detection -- a virtual-scroll grid with freeze panes, own SVG charts (no chart library), conditional formatting, validation, named ranges, undo/redo with batching, and own XLSX / ODS readers and writers over its own ZIP parser and the native DecompressionStream. editor, viewer and minimal modes.
A Word-class document editor: paginated A4 / Letter pages with headers, footers, sections and rulers, or a fluid inline layout; WYSIWYG, Markdown and HTML source modes; styles, themes, presets, slash commands, find & replace. Its own OOXML reader (paragraphs, run formatting resolved against styles.xml, tables, embedded images) and writer (document, styles, header / footer parts, relationships, inline pictures, hyperlinks), its own HTML ↔ JSON and Markdown parsers, a paste cleaner, an image crop tool and a 6,600-line JSON document-model engine with snapshot undo/redo. Imports DOCX, ODT, HTML, Markdown; exports DOCX, HTML, Markdown, text, JSON and PDF via print.
A browser-side archive engine: creates and extracts ZIP, TAR (ustar), GZIP, TAR.GZ and 7z (7z reader: LZMA1 / Copy codecs, uncompressed headers), lists RAR v4 / v5 archives and extracts their stored entries, detects formats by magic bytes. Every container is hand-written -- local headers, central directory and EOCD; ustar checksums and long-name prefixes; the 7z property-block header -- plus a complete LZMA range-coder encoder and decoder whose archives pass 7z t and extract byte-identical. CRC-32 in-house too; UTF-8 through the native TextEncoder / TextDecoder, DEFLATE through the browser's native CompressionStream. Also what Writer and Spreadsheet use to pack their exports.
36 module names registered by modules/lib.js -- 31 modules, CKEditor 5 contributing six names -- each module with a documentation page and at least one playground example (35 in all). The badge on every card says who wrote what.
Described above.
Excel-like editor with its own formula engine (130+ functions), virtual-scroll grid, SVG charts, conditional formatting, and own XLSX / ODS / CSV import and export.
Word-class document editor: paginated or inline layout, WYSIWYG / Markdown / HTML source modes, own DOCX reader and writer, PDF via print.
ZIP, TAR, GZIP, TAR.GZ and 7z creation and extraction, RAR v4 / v5 reading, own LZMA codec -- one dependency-free file.
Infrastructure we wrote for the framework. The Wrapper is entirely ours; the Code Editor and <code-pretty> are our integration layer around CodeMirror, and ZIP is a small facade over JSZip -- credited as such.
Same-origin Blob-URL iframe sandbox written from scratch: node(), container(), document(), window(), whenLoaded(). The isolation host that keeps PDF.js, SVG-Edit and CodeMirror globals and CSS out of your page.
Our loader, lifecycle and API (value(), theme(), syntax(), height(), event:change) around the vendored CodeMirror: sandboxed in a Wrapper iframe, 31 addons booted in order, 70 syntax modes and 23 themes loaded lazily. The editing engine itself is CodeMirror, by Marijn Haverbeke.
A custom element that turns 14 plain attributes (language, theme, readonly, ...) into a syntax-highlighted block rendered by the Code Editor, with progressive enhancement and a dedent normaliser.
A 68-line ApplicationPrototype facade over the vendored JSZip: addFile(), folder(), getFile(), generate('blob'). For an archive engine written by us, use the Packer.
Thin loaders -- typically a few dozen lines each, Apache-2.0 like the rest of our infrastructure code -- that fetch a vendored open-source library on first use and hand it back as a module. The libraries are not our work; each keeps its upstream licence (listed on the card and in the documentation).
The raw JSZip 3.5 constructor, for code that wants the library rather than the archiver/zip facade.
String compression to UTF-16, Base64 or URI-safe output for localStorage and URL parameters (lz-string 1.4).
Loads the vendored amCharts 4.10 core.js, charts.js and the animated theme, resolves with { am4core, am4charts, am4themes_animated }.
QR codes from text or URLs as <img>, SVG, table or data URL (qrcode-generator).
1D barcodes -- CODE128, EAN / UPC, CODE39 / 93, ITF-14, MSI, Pharmacode, Codabar -- rendered into an <svg>, a <canvas> or an <img>, with input validation per symbology.
Multi-format reader: 1D (EAN, UPC, Code 39 / 93 / 128, ITF, Codabar, RSS) and 2D (QR, Data Matrix, PDF417, Aztec) from an image, a canvas, a video element or the camera; format hints, continuous scanning.
Decodes QR codes from images, canvases and camera frames (jsQR 1.3).
Text recognition in the browser, 100+ languages, progress events (Tesseract.js 3.0).
Camera model, GPS and orientation metadata from JPEG / TIFF files (exif.js 2.3).
Resize, crop, rotate, filter and compose images entirely in memory (Jimp 0.22).
Bitmap to vector: black-and-white tracing to SVG paths (potrace 2.1).
Colour raster to SVG tracing with palette control (imagetracerjs 1.2).
Parse, normalise, transform and optimise SVG path data strings (svg-path-commander 2.0).
Render pages to canvas and extract text from PDF documents inside a wrapper iframe (PDF.js 2.7).
Compile LESS stylesheets to CSS in the browser (less 3.11).
Screenshot DOM elements to a canvas for previews, exports and PDF generation (html2canvas 1.4).
Terminal emulator with the attach (WebSocket), fit, fullscreen, linkify and terminado addons loaded (xterm 2.2).
Computer vision compiled to JavaScript (asm.js build): filters, contours, feature matching, object detection.
A complete SQLite engine compiled to JavaScript (asm.js build): in-memory databases, prepared statements, export to a file (sql.js 1.8).
Lightweight parameter panels for demos, creative coding and prototypes (dat.gui 0.7).
The Animate.css 3.7 stylesheet plus its animation catalogue for programmatic use.
The SVG-Edit vector drawing application inside a wrapper iframe: svgSource(), zoom(), getSelectedElement().
The classic CKEditor 4.14 WYSIWYG editor, CKEDITOR.replace() ready.
The five CKEditor 5 builds, one module each: /classic, /inline, /balloon, /balloon-block, /document.
A selection of the playground pages, embedded in preview mode -- the three SGApps.IO products first, then the Code Editor and a few of the wrappers. They load the framework from the SGApps CDN (https://cdn.sgapps.io/components/application-prototype) and the modules and vendored libraries from ../modules and ../thirdparty -- serve the repository root (npm start) and every example runs on your checkout; on a docs-only site they fall back to the CDN copy of this repository. Each frame has an Edit in the playground button that opens the same page with its source in an editor.
editors/spreadsheetA workbook pre-filled with quarterly figures and SUM formulas per row and column: type in cells, use the toolbar for styles and number formats, insert a chart, and export from the toolbar. Docs · Open in the playground
editors/writerA feature showcase document in the paginated layout with the ruler shown: formatting, headings, lists, tables, images and code blocks; switch to the Inline layout, the Markdown or HTML source mode, and export to DOCX or PDF from the toolbar. Docs · Open in the playground
archiver/packerCreate a ZIP from three in-memory files, list its entries and read them back, then run the format-detection demo on ZIP, TAR and GZIP headers. Docs · Open in the playground
gadgets/code-editorA CodeMirror editor pre-filled with HTML in the Monokai theme: read its value, and switch the syntax mode to JavaScript or CSS with new content. Docs · Open in the playground
thirdparty/charts/amcharts4The vendored amCharts 4: a column chart built from am4core / am4charts with the animated theme and tooltips. Docs · Open in the playground
thirdparty/convert/image/qrcode/generatorType a text or a URL and get the QR code rendered as inline SVG with createSvgTag(). Docs · Open in the playground
thirdparty/convert/image/barcode/reader · Generator thirdparty/convert/image/barcode/generatorTwo barcodes generated with JsBarcode (CODE128 and EAN-13), decoded back with ZXing at the click of a button; drop in a photo of your own or start the camera for live scanning. Docs · Open in the playground
thirdparty/emulators/terminal/xtermAn 80x20 terminal with a small local shell (help, date, echo, colors, clear) and ANSI colours rendered. Docs · Open in the playground
thirdparty/emulators/databases/sql.jsAn in-memory SQLite database created, filled and queried from a textarea; edit the SQL and run it again. Docs · Open in the playground
thirdparty/gui/wysiwyg/html/ckeditor5The classic build of CKEditor 5 with a custom toolbar attached to an element through the module wrapper; read the HTML back with getData(). Docs · Open in the playground
npm install once: the postinstall step fetches the 20 vendored libraries into thirdparty/ from bower-config.json. The framework itself comes from your application-prototype checkout (or the SGApps CDN).ApplicationPrototype.js and ApplicationBuilder.js, register the framework modules, then the thirdparty modules through modules/lib.js.<script src="/application-prototype/ApplicationPrototype.js"></script>
<script src="/application-prototype/ApplicationBuilder.js"></script>
<script>
var App = new ApplicationBuilder({
onready: function () {
var App = this;
App.modulePath('/application-prototype/constructors');
App.debugEnabled(true);
App.require(['extensions/prototype', 'lib'], function (libs) {
libs.lib(); // framework modules by name
App.require('/application-prototype-thirdparty/modules/lib.js').then(function (loader) {
loader(); // the 34 thirdparty modules by name
App.require('editors/spreadsheet').then(function (Spreadsheet) {
var sheet = Spreadsheet({ container: document.getElementById('mount'), rows: 100, cols: 26 });
sheet.whenLoaded().then(function () {
sheet.value('A1', 'Total');
sheet.value('B1', '=SUM(B2:B10)');
});
});
});
});
}
});
</script>
The Getting Started page explains every step, the two ways of resolving module names and how the wrappers load their libraries; each module page has a Use Cases section with copy-paste snippets.
npm start # this page + the docs at http://localhost:3000/ and /docs/
npm run docs-site-published # serve docs/ alone, the layout of a published docs-only site
npm test # lint the documentation (links, sidebar, playground registry, this page)
npm run docs # regenerate the JSDoc API reference into documentation/