@quario/editor 0.1.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/CHANGELOG.md +39 -0
- package/LICENSE +219 -0
- package/README.md +89 -0
- package/lib/chrome.js +431 -0
- package/lib/document.js +674 -0
- package/lib/history.js +57 -0
- package/lib/index.d.ts +119 -0
- package/lib/index.js +820 -0
- package/lib/rail.js +506 -0
- package/lib/register.d.ts +9 -0
- package/lib/register.js +10 -0
- package/lib/stage.js +654 -0
- package/lib/style.js +85 -0
- package/package.json +77 -0
package/lib/style.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The canonical `q-*` report stylesheet the editor adopts into its shadow
|
|
3
|
+
* root: how a quario HTML fragment looks on the sheet, the same selector
|
|
4
|
+
* contract the html target's stable markup states (SCHEMA.md, "The HTML
|
|
5
|
+
* target").
|
|
6
|
+
*
|
|
7
|
+
* The editor cannot import `@quario/html/style.css` — it depends on no target
|
|
8
|
+
* package at runtime, exactly as the viewer cannot — so the block between the
|
|
9
|
+
* `shared:` markers is byte-identical to the one there and to the viewer's,
|
|
10
|
+
* and `test/stylesheet.test.js` at the repo root fails when any copy drifts.
|
|
11
|
+
* Edit one, edit them all.
|
|
12
|
+
*
|
|
13
|
+
* Unlike the viewer, nothing sits outside the block: the unlicensed marking
|
|
14
|
+
* is left exactly as the fragment carries it (ADR 0002 is satisfied
|
|
15
|
+
* trivially — the wording is in the fragment, depends on no grant, and the
|
|
16
|
+
* editor adds none of its own), and watermarks across a document someone is
|
|
17
|
+
* clicking into would fight the primary task, so ADR 0017 stays the viewer's.
|
|
18
|
+
*/
|
|
19
|
+
import { css } from "lit";
|
|
20
|
+
|
|
21
|
+
export let REPORT = css`
|
|
22
|
+
/* shared:start */
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* The baseline face hangs off the report root rather than off .q-item and
|
|
26
|
+
* .q-table: a direct rule beats an inherited one, so a rule on the items
|
|
27
|
+
* themselves would override the report default an author writes on the
|
|
28
|
+
* document, which the root carries as an inline font-family. The marking is
|
|
29
|
+
* outside the root and keeps its own rule for that reason.
|
|
30
|
+
*/
|
|
31
|
+
.q-report,
|
|
32
|
+
.q-unlicensed {
|
|
33
|
+
font-family: sans-serif;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.q-table {
|
|
37
|
+
width: 100%;
|
|
38
|
+
border-collapse: collapse;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.q-table th,
|
|
42
|
+
.q-table td {
|
|
43
|
+
padding: 2pt 6pt;
|
|
44
|
+
text-align: left;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.q-table thead th {
|
|
48
|
+
border-bottom: 0.5pt solid #000;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.q-table tfoot td {
|
|
52
|
+
border-top: 0.5pt solid #000;
|
|
53
|
+
font-weight: bold;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.q-item.q-report-header {
|
|
57
|
+
font-size: 14pt;
|
|
58
|
+
font-weight: bold;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.q-item.q-group-header {
|
|
62
|
+
margin-top: 8pt;
|
|
63
|
+
font-weight: bold;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.q-item.q-group-footer {
|
|
67
|
+
margin-bottom: 8pt;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.q-item.q-report-footer {
|
|
71
|
+
margin-top: 10pt;
|
|
72
|
+
border-top: 1pt solid #000;
|
|
73
|
+
padding-top: 4pt;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* A columned container is a fragmentation context on screen, not only in
|
|
77
|
+
print, so this is what keeps a label whole in one page column -- the rule
|
|
78
|
+
SCHEMA.md's "Page columns" leans on. Scoped to a columned region, so an
|
|
79
|
+
uncolumned report pays nothing. Inside the shared block because both sheets
|
|
80
|
+
need it: a sheet has no pages, but it can have columns. */
|
|
81
|
+
.q-columns .q-group {
|
|
82
|
+
break-inside: avoid;
|
|
83
|
+
}
|
|
84
|
+
/* shared:end */
|
|
85
|
+
`;
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@quario/editor",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The embeddable banded document designer for quario — in the makings, not yet released",
|
|
5
|
+
"homepage": "https://getquario.com",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/getquario/quario.git",
|
|
10
|
+
"directory": "packages/editor"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"CHANGELOG.md",
|
|
14
|
+
"lib"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"./lib/register.js"
|
|
19
|
+
],
|
|
20
|
+
"types": "lib/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./lib/index.d.ts",
|
|
24
|
+
"default": "./lib/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./register": {
|
|
27
|
+
"types": "./lib/register.d.ts",
|
|
28
|
+
"default": "./lib/register.js"
|
|
29
|
+
},
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"check": "npm run size && npm test && npm run test:browser",
|
|
37
|
+
"size": "size-limit",
|
|
38
|
+
"test": "npm run test:unit && npm run test:types",
|
|
39
|
+
"test:browser": "node test/browser/setup.js",
|
|
40
|
+
"test:types": "tsc && attw --pack . --profile esm-only",
|
|
41
|
+
"test:unit": "node --disallow-code-generation-from-strings --test --test-concurrency=1 test/*.test.js",
|
|
42
|
+
"prepack": "node -e \"require('fs').copyFileSync('../../LICENSE','LICENSE')\"",
|
|
43
|
+
"postpack": "node -e \"require('fs').rmSync('LICENSE',{force:true})\""
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@lit/task": "^1.0.3",
|
|
47
|
+
"lit": "^3.3.3",
|
|
48
|
+
"tinykeys": "^4.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@arethetypeswrong/cli": "^0.18.3",
|
|
52
|
+
"@quario/html": "^0.2.0",
|
|
53
|
+
"@size-limit/preset-small-lib": "^13.0.3",
|
|
54
|
+
"esbuild": "^0.28.2",
|
|
55
|
+
"quario": "^0.2.0",
|
|
56
|
+
"size-limit": "^13.0.3",
|
|
57
|
+
"typescript": "^7.0.2"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"quario": "^0.2.0"
|
|
61
|
+
},
|
|
62
|
+
"size-limit": [
|
|
63
|
+
{
|
|
64
|
+
"path": "lib/index.js",
|
|
65
|
+
"ignore": [
|
|
66
|
+
"quario",
|
|
67
|
+
"lit",
|
|
68
|
+
"@lit/task",
|
|
69
|
+
"tinykeys"
|
|
70
|
+
],
|
|
71
|
+
"limit": "14 kB"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"engines": {
|
|
75
|
+
"node": ">=22.0.0"
|
|
76
|
+
}
|
|
77
|
+
}
|