@quario/viewer 0.2.0 → 0.4.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quario/viewer",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "The embeddable report viewer shell for quario — in the makings, not yet released",
5
5
  "homepage": "https://getquario.com",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -44,30 +44,28 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@lit/task": "^1.0.3",
47
+ "@quario/layout": "^0.1.0",
47
48
  "lit": "^3.3.3"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@arethetypeswrong/cli": "^0.18.3",
51
- "@quario/csv": "^0.2.0",
52
- "@quario/html": "^0.2.0",
53
- "@quario/pdf": "^0.2.0",
54
- "@quario/xlsx": "^0.2.0",
55
52
  "@size-limit/preset-small-lib": "^13.0.3",
56
53
  "esbuild": "^0.28.2",
57
54
  "exceljs": "^4.4.0",
58
55
  "pdf-lib": "^1.17.1",
59
- "quario": "^0.2.0",
56
+ "quario": "^0.4.0",
60
57
  "size-limit": "^13.0.3",
61
58
  "typescript": "^7.0.2"
62
59
  },
63
60
  "peerDependencies": {
64
- "quario": "^0.2.0"
61
+ "quario": "^0.4.0"
65
62
  },
66
63
  "size-limit": [
67
64
  {
68
65
  "path": "lib/index.js",
69
66
  "ignore": [
70
67
  "quario",
68
+ "@quario/layout",
71
69
  "lit",
72
70
  "@lit/task"
73
71
  ],
package/lib/mark.js DELETED
@@ -1,40 +0,0 @@
1
- /**
2
- * Unlicensed watermark layout for the continuous sheet: stamp centres along
3
- * the sheet height, and PDF-like face geometry from the full page box (same
4
- * atan2 / 75%-diagonal / size-at-54pt proportions as the PDF stamp). Pure
5
- * numbers — the stage owns the DOM. Appearance is best-effort (ADR 0017).
6
- */
7
-
8
- /** Reference face size in points — matches the PDF target's stamp probe. */
9
- export let FACE = 54;
10
-
11
- /**
12
- * Centre Y of each stamp band covering `[0, sheetHeight)`. Bands are
13
- * `pageHeight` tall; the last may be short. A short sheet still gets one stamp.
14
- *
15
- * @param {number} sheetHeight
16
- * @param {number} pageHeight
17
- * @returns {number[]}
18
- */
19
- export let centres = (sheetHeight, pageHeight) => {
20
- if (!(sheetHeight > 0) || !(pageHeight > 0)) return [];
21
- let n = Math.max(1, Math.ceil(sheetHeight / pageHeight));
22
- /** @type {number[]} */
23
- let out = [];
24
- for (let i = 0; i < n; i++) {
25
- let top = i * pageHeight;
26
- let bottom = Math.min((i + 1) * pageHeight, sheetHeight);
27
- out.push((top + bottom) / 2);
28
- }
29
- return out;
30
- };
31
-
32
- /** @type {(width: number, height: number) => number} */
33
- export let angle = (width, height) => (Math.atan2(height, width) * 180) / Math.PI;
34
-
35
- /** @type {(width: number, height: number) => number} */
36
- export let span = (width, height) => Math.hypot(width, height) * 0.75;
37
-
38
- /** @type {(spanLength: number, textWidth: number, at?: number) => number} */
39
- export let size = (spanLength, textWidth, at = FACE) =>
40
- textWidth > 0 ? (at * spanLength) / textWidth : at;
package/lib/style.js DELETED
@@ -1,107 +0,0 @@
1
- /**
2
- * The canonical `q-*` report stylesheet the viewer adopts into its shadow
3
- * root: how a quario HTML fragment looks on the sheet. The selector contract
4
- * is the html target's stable markup (SCHEMA.md, "The HTML target"): every
5
- * item is `.q-item.q-<role>`, every group instance `.q-group[data-group]`,
6
- * every table `.q-table`, and a keyless render opens with `.q-unlicensed`.
7
- *
8
- * `@quario/html` ships the same look as a real stylesheet its consumers can
9
- * link (`@quario/html/style.css`, and see ADR 0016). This file cannot import
10
- * it -- the viewer depends on no target package at runtime, and Lit wants a
11
- * `css` template rather than a file -- so the block between the `shared:`
12
- * markers below is byte-identical to the one there, and
13
- * `test/stylesheet.test.js` at the repo root fails when they drift. Edit one,
14
- * edit the other.
15
- *
16
- * Two things stay outside that block, in each direction. The html sheet adds
17
- * pagination rules a sheet has no use for: it can be printed, this cannot.
18
- * And the marking diverges on mechanism rather than on result -- a plain host
19
- * document scales nothing, so there `.q-unlicensed` can carry a watermark
20
- * itself; here it cannot, and `stage.js` says why.
21
- */
22
- import { css } from "lit";
23
-
24
- export let REPORT = css`
25
- /* shared:start */
26
-
27
- /*
28
- * The baseline face hangs off the report root rather than off .q-item and
29
- * .q-table: a direct rule beats an inherited one, so a rule on the items
30
- * themselves would override the report default an author writes on the
31
- * document, which the root carries as an inline font-family. The marking is
32
- * outside the root and keeps its own rule for that reason.
33
- */
34
- .q-report,
35
- .q-unlicensed {
36
- font-family: sans-serif;
37
- }
38
-
39
- .q-table {
40
- width: 100%;
41
- border-collapse: collapse;
42
- }
43
-
44
- .q-table th,
45
- .q-table td {
46
- padding: 2pt 6pt;
47
- text-align: left;
48
- }
49
-
50
- .q-table thead th {
51
- border-bottom: 0.5pt solid #000;
52
- }
53
-
54
- .q-table tfoot td {
55
- border-top: 0.5pt solid #000;
56
- font-weight: bold;
57
- }
58
-
59
- .q-item.q-report-header {
60
- font-size: 14pt;
61
- font-weight: bold;
62
- }
63
-
64
- .q-item.q-group-header {
65
- margin-top: 8pt;
66
- font-weight: bold;
67
- }
68
-
69
- .q-item.q-group-footer {
70
- margin-bottom: 8pt;
71
- }
72
-
73
- .q-item.q-report-footer {
74
- margin-top: 10pt;
75
- border-top: 1pt solid #000;
76
- padding-top: 4pt;
77
- }
78
-
79
- /* A columned container is a fragmentation context on screen, not only in
80
- print, so this is what keeps a label whole in one page column -- the rule
81
- SCHEMA.md's "Page columns" leans on. Scoped to a columned region, so an
82
- uncolumned report pays nothing. Inside the shared block because both sheets
83
- need it: a sheet has no pages, but it can have columns. */
84
- .q-columns .q-group {
85
- break-inside: avoid;
86
- }
87
- /* shared:end */
88
-
89
- /* The unlicensed-evaluation badge (LICENSE section 6). The viewer presents the
90
- marking as on-sheet watermark stamps instead -- \`.qv-mark\`, in stage.js
91
- (ADR 0017) -- so the badge itself is hidden from sight but kept in the
92
- accessibility tree: the document is what states the marking, and the
93
- watermark is decoration announcing nothing. Hiding it with \`display: none\`
94
- would take the statement away from the readers least able to see the
95
- watermark. */
96
- .q-unlicensed {
97
- position: absolute;
98
- width: 1px;
99
- height: 1px;
100
- margin: -1px;
101
- padding: 0;
102
- border: 0;
103
- overflow: hidden;
104
- clip-path: inset(50%);
105
- white-space: nowrap;
106
- }
107
- `;