@gramlot/gramlot 0.3.10 → 0.3.15
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/dist/components/editors/__init__.py +13 -0
- package/dist/components/{editors.js → editors/assets/collection.js} +131 -246
- package/dist/components/editors/assets/index.js +2 -0
- package/dist/components/editors/commands.json +7 -0
- package/dist/components/editors/grammar.json +7045 -0
- package/dist/components/inputs/__init__.py +13 -0
- package/dist/components/{inputs.js → inputs/assets/collection.js} +287 -198
- package/dist/components/inputs/assets/index.js +2 -0
- package/dist/components/inputs/commands.json +7 -0
- package/dist/components/inputs/grammar.json +42881 -0
- package/dist/components/layout/__init__.py +13 -0
- package/dist/components/layout/assets/collection.js +25737 -0
- package/dist/components/layout/assets/index.js +2 -0
- package/dist/components/layout/commands.json +7 -0
- package/dist/components/layout/grammar.json +1798 -0
- package/dist/components/tree/__init__.py +13 -0
- package/dist/components/{tree.js → tree/assets/collection.js} +62 -175
- package/dist/components/tree/assets/index.js +2 -0
- package/dist/components/tree/commands.json +7 -0
- package/dist/components/tree/grammar.json +339 -0
- package/dist/components/typst/__init__.py +13 -0
- package/dist/components/typst/assets/collection.js +4 -0
- package/dist/components/typst/assets/index.js +2 -0
- package/dist/components/typst/commands.json +7 -0
- package/dist/components/typst/grammar.json +81 -0
- package/dist/gramlot.js +2491 -902
- package/dist/gramlot.min.js +109 -28
- package/dist/runtime-notices.json +0 -196
- package/package.json +1 -1
- package/src/binding/ask-dialog.js +1 -1
- package/src/binding/installation.js +5 -6
- package/src/binding/runtime.js +4 -2
- package/src/bootstrap.d.ts +1 -1
- package/src/bootstrap.js +52 -30
- package/src/builder/binding.json +25 -0
- package/src/builder/gramlot-builder.js +16 -3
- package/src/builder/source.js +33 -1
- package/src/collection-artifact.d.ts +11 -0
- package/src/collection-artifact.js +57 -0
- package/src/commands.d.ts +9 -0
- package/src/commands.js +36 -0
- package/src/components/bases.js +1 -1
- package/src/components/border-container.js +26 -1
- package/src/components/buttons.js +84 -161
- package/src/components/choice-editor.js +31 -10
- package/src/components/database-choices.js +110 -0
- package/src/components/inputs.js +15 -2
- package/src/components/layout.js +5 -3
- package/src/components/menus.js +346 -0
- package/src/components/popup.js +15 -2
- package/src/components/registry.js +18 -3
- package/src/components/toolbar-overflow.js +181 -0
- package/src/components/tree.js +14 -4
- package/src/components/windows.js +284 -0
- package/src/gramlot.d.ts +2 -0
- package/src/gramlot.js +4 -2
- package/src/handlers/rpc-handler.d.ts +6 -1
- package/src/handlers/rpc-handler.js +7 -2
- package/src/handlers/source-handler.d.ts +2 -1
- package/src/handlers/source-handler.js +10 -1
- package/src/index-page-styles.js +1 -1
- package/src/index-theme.js +1 -1
- package/src/index.d.ts +5 -0
- package/src/index.js +5 -0
- package/src/renderer/gramlot-html-renderer.js +1 -0
- package/src/renderer/gramlot-renderer.js +13 -3
- package/src/server/gramlot-file-server.d.ts +2 -0
- package/src/server/gramlot-file-server.js +45 -1
- package/src/server/gramlot-server.d.ts +20 -2
- package/src/server/gramlot-server.js +86 -6
- package/src/server/page-base.js +1 -0
- package/src/server/page.d.ts +3 -0
- package/src/view/button.js +47 -3
- package/src/view/controls.js +8 -0
- package/src/view/html.js +1 -0
- package/src/view/menu-command.js +45 -0
- package/src/view/menu.js +87 -0
- package/themes/gramlot-compact/README.md +19 -0
- package/themes/gramlot-compact/theme.css +138 -45
- package/themes/joanna/README.md +19 -0
- package/themes/joanna/theme.css +134 -78
- package/themes/mela/theme.css +184 -0
- package/themes/mimi/README.md +19 -0
- package/themes/mimi/theme.css +133 -77
- package/themes/palettes/README.md +3 -0
- package/themes/palettes/compact.css +86 -0
- package/themes/palettes/joanna.css +86 -0
- package/themes/palettes/mimi.css +86 -0
- package/tools/gramlot-tools-inspector.js +3 -3
- package/dist/components/layout.js +0 -3385
- package/dist/components/typst.js +0 -4
package/src/view/menu.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** Menu-owned RpcResolver and validated, keyed Bag-to-Source projection. */
|
|
2
|
+
import {Bag} from '@genrojs/bag';
|
|
3
|
+
import {SourceBag, sourceTarget} from '@genrojs/builders';
|
|
4
|
+
import {toTytx} from '@genrojs/tytx';
|
|
5
|
+
import {RpcResolver} from '../binding/rpc-resolver.js';
|
|
6
|
+
|
|
7
|
+
const ENTRY_FIELDS=new Set(['kind','command','caption','icon','iconSrc','tooltip','disabled','hidden','checked','favorite','parameters','resolver','cacheTime','sync']);
|
|
8
|
+
function entries(bag,ancestors=new Set()) {
|
|
9
|
+
if (!(bag instanceof Bag) || ancestors.has(bag)) throw new TypeError('Menu resolver must return an acyclic Bag');
|
|
10
|
+
const parents=new Set([...ancestors,bag]);
|
|
11
|
+
return bag.getNodes().map(node=>{
|
|
12
|
+
const a=node.attr,kind=a.kind,value=node.staticValue;
|
|
13
|
+
if(Object.keys(a).some(key=>!ENTRY_FIELDS.has(key)&&!key.startsWith('resolver_')))throw new TypeError(`Unsupported menu record field: ${node.label}`);
|
|
14
|
+
if(!['command','separator','submenu'].includes(kind))throw new TypeError(`Invalid menu kind: ${node.label}`);
|
|
15
|
+
for(const name of ['disabled','hidden','checked'])if(a[name]!=null && typeof a[name]!=='boolean' && !(typeof a[name]==='string'&&a[name].startsWith('^')))throw new TypeError(`Invalid menu ${name}`);
|
|
16
|
+
if(a.favorite!=null&&typeof a.favorite!=='boolean')throw new TypeError('favorite must be boolean');
|
|
17
|
+
if(a.caption!=null&&typeof a.caption!=='string')throw new TypeError('Menu caption must be text');
|
|
18
|
+
if(a.parameters!=null && (typeof a.parameters!=='object'||Array.isArray(a.parameters)))throw new TypeError('Menu parameters must be a mapping');
|
|
19
|
+
if(kind==='command' && (typeof a.command!=='string'||!a.command||value!=null||a.resolver!=null))throw new TypeError('Command record requires a command and no children/resolver');
|
|
20
|
+
if(kind==='separator' && (value!=null||Object.keys(a).length!==1))throw new TypeError('Separator record accepts kind only');
|
|
21
|
+
if(kind==='submenu' && (typeof a.caption!=='string'||a.command!=null||((value instanceof Bag)===(a.resolver!=null))||(!(value instanceof Bag)&&value!=null)))throw new TypeError('Submenu requires caption and exactly one content source');
|
|
22
|
+
const children=value instanceof Bag?entries(value,parents):null;
|
|
23
|
+
return {label:node.label,attrs:{...a},children};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function project(menu,records) {
|
|
27
|
+
const handle=menu.builder.wrapSource(menu);
|
|
28
|
+
const old=menu.value instanceof SourceBag?menu.value.getNodes():[];
|
|
29
|
+
const keys=new Set(records.map(item=>item.label));
|
|
30
|
+
for(const node of old)if(!keys.has(node.label))menu.value.popNode(node.label);
|
|
31
|
+
for(const [index,item] of records.entries()){
|
|
32
|
+
const {kind,...attrs}=item.attrs;
|
|
33
|
+
const resolver=Object.fromEntries(Object.entries(attrs).filter(([key])=>key==='resolver'||key==='cacheTime'||key==='sync'||key.startsWith('resolver_')));
|
|
34
|
+
for(const key of Object.keys(resolver))delete attrs[key];
|
|
35
|
+
const value=kind==='separator'?'-':null;
|
|
36
|
+
let node=menu.value instanceof SourceBag?menu.value.getNodes().find(node=>node.label===item.label):null;
|
|
37
|
+
const wasSubmenu=node?.value instanceof SourceBag;
|
|
38
|
+
if(node && (wasSubmenu!==(kind==='submenu') || (node.value==='-')!==(kind==='separator'))){menu.value.popNode(node.label);node=null;}
|
|
39
|
+
if(!node)node=sourceTarget(handle.menuline(value,{...attrs,node_label:item.label}));
|
|
40
|
+
else {
|
|
41
|
+
const previous=Object.keys(node.attr).filter(key=>ENTRY_FIELDS.has(key)&&!Object.hasOwn(attrs,key));
|
|
42
|
+
node.setAttr({...Object.fromEntries(previous.map(key=>[key,null])),...attrs});
|
|
43
|
+
}
|
|
44
|
+
if(kind==='submenu') {
|
|
45
|
+
let child=node.value instanceof SourceBag?node.value.getNodes().find(n=>n.nodeTag==='menu'):null;
|
|
46
|
+
if(!child)child=sourceTarget(node.builder.wrapSource(node).menu({...resolver,node_label:'menu'}));
|
|
47
|
+
else child.setAttr({...Object.fromEntries(Object.keys(child.attr).filter(key=>key==='resolver'||key==='cacheTime'||key==='sync'||key.startsWith('resolver_')).map(key=>[key,null])),...resolver});
|
|
48
|
+
if(item.children)project(child,item.children);
|
|
49
|
+
}
|
|
50
|
+
const order=menu.value.getNodes().indexOf(node);
|
|
51
|
+
if(order!==index)menu.value.move(order,index);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export class MenuBinding {
|
|
55
|
+
#key=null; #resolver=null; #generation=0; #closed=false; #projection=null;
|
|
56
|
+
constructor(binding,element){this.binding=binding;this.element=element;}
|
|
57
|
+
get node(){return this.binding.node;}
|
|
58
|
+
attach(){this.element.menuBinding=this;this.refresh();}
|
|
59
|
+
detach(){this.#closed=true;this.#generation++;this.node.requests.inflight?.cancel();delete this.element.menuBinding;this.element.close(false);}
|
|
60
|
+
refresh(){
|
|
61
|
+
const [,attrs]=this.node.rootBuilder.runtimeValues(this.node);
|
|
62
|
+
const params=Object.fromEntries(Object.entries(attrs).filter(([key])=>key.startsWith('resolver_')).map(([key,value])=>[key.slice(9),value]));
|
|
63
|
+
const key=toTytx([attrs.resolver,params,attrs.cacheTime,attrs.sync]);
|
|
64
|
+
if(key===this.#key)return;
|
|
65
|
+
this.#key=key;this.#generation++;this.#projection=null;
|
|
66
|
+
this.#resolver=attrs.resolver?new RpcResolver({binding:this.binding,method:attrs.resolver,params,cacheTime:attrs.cacheTime??-1,sync:attrs.sync??false,onError:()=>{}}):null;
|
|
67
|
+
if(this.#resolver){this.element.setStatus('loading');if(this.element.opened&&this.element.isConnected)this.load();}
|
|
68
|
+
else this.element.setStatus(null);
|
|
69
|
+
}
|
|
70
|
+
async load(force=false){
|
|
71
|
+
if(this.#closed||!this.#resolver)return;
|
|
72
|
+
const resolver=this.#resolver,generation=this.#generation;
|
|
73
|
+
try{
|
|
74
|
+
if(force)resolver.refresh();else resolver.resolve();
|
|
75
|
+
if(resolver.loading){this.element.setStatus('loading');await resolver.loading;}
|
|
76
|
+
if(this.#closed||generation!==this.#generation)return;
|
|
77
|
+
const result=resolver.cachedValue;
|
|
78
|
+
const records=entries(result);
|
|
79
|
+
const fingerprint=toTytx(result);
|
|
80
|
+
if(this.#projection!==fingerprint){project(this.node,records);this.#projection=fingerprint;}
|
|
81
|
+
this.element.setStatus(records.length?null:'empty');
|
|
82
|
+
}catch(error){
|
|
83
|
+
if(this.#closed||generation!==this.#generation)return;
|
|
84
|
+
this.element.setStatus('error');console.warn(`Menu '${this.node.label}' failed to load`,error);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# Compact
|
|
2
|
+
|
|
3
|
+
Professional desktop profile, revised at the owner's request on 2026-10-23.
|
|
4
|
+
Neutral blue-gray, compact daily work. Controls are 28px high; body and field text are 13px. Light and dark
|
|
5
|
+
palettes use the same semantic roles. Existing touch targets remain larger.
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
class Page(BasePage):
|
|
9
|
+
css = ("/themes/gramlot-compact/theme.css",)
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The server loads Base first. The gallery's existing appearance selector uses the
|
|
13
|
+
same canonical stylesheet. Inputs, command buttons, menus, tabs and window chrome
|
|
14
|
+
share existing field/button/spacing/radius tokens. Fixed Source dimensions still
|
|
15
|
+
win; use semantic spacing variables when a page should follow profile density.
|
|
16
|
+
These revised aesthetics are a development preview awaiting owner feedback.
|
|
17
|
+
|
|
18
|
+
## Historical record — before the 2026-10-23 aesthetic revision
|
|
19
|
+
|
|
1
20
|
# Gramlot Compact theme
|
|
2
21
|
|
|
3
22
|
Compact is the denser alternative to Gramlot Base. It reduces typography, spacing,
|
|
@@ -1,61 +1,154 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* gramlot-compact: professional density profile; load after Base. */
|
|
2
2
|
@layer gramlot.tokens {
|
|
3
3
|
:root {
|
|
4
|
+
color-scheme: light;
|
|
5
|
+
--gramlot-background: #f3f5f7;
|
|
6
|
+
--gramlot-surface: #ffffff;
|
|
7
|
+
--gramlot-surface-subtle: #e9edf2;
|
|
8
|
+
--gramlot-ink: #202936;
|
|
9
|
+
--gramlot-text-secondary: #526174;
|
|
10
|
+
--gramlot-border: #ccd3dc;
|
|
11
|
+
--gramlot-border-control: #7b899b;
|
|
12
|
+
--gramlot-action: #235db2;
|
|
13
|
+
--gramlot-action-hover: #194987;
|
|
14
|
+
--gramlot-selected: #e3edfb;
|
|
15
|
+
--gramlot-field-background: #ffffff;
|
|
16
|
+
--gramlot-field-readonly-background: #e9edf2;
|
|
17
|
+
--gramlot-label-color: #526174;
|
|
18
|
+
--gramlot-focus-ring: #235db2;
|
|
19
|
+
--gramlot-brand-blue: #235db2;
|
|
20
|
+
--gramlot-brand-yellow: #235db2;
|
|
21
|
+
--gramlot-navigation: #202936;
|
|
22
|
+
--gramlot-navigation-text: #f6f8fb;
|
|
23
|
+
--gramlot-error: #aa2637;
|
|
24
|
+
--gramlot-error-background: #fff0f1;
|
|
25
|
+
--gramlot-success: #236747;
|
|
26
|
+
--gramlot-success-background: #e9f4ec;
|
|
27
|
+
--gramlot-warning: #735313;
|
|
28
|
+
--gramlot-warning-background: #fff5da;
|
|
4
29
|
--gramlot-field-height: 28px;
|
|
5
|
-
--gramlot-field-
|
|
6
|
-
--gramlot-field-
|
|
30
|
+
--gramlot-field-padding: 2px 7px;
|
|
31
|
+
--gramlot-field-line-height: 1.3;
|
|
7
32
|
--gramlot-field-font-size: 1rem;
|
|
8
|
-
--gramlot-
|
|
9
|
-
--gramlot-
|
|
10
|
-
--gramlot-
|
|
11
|
-
--gramlot-
|
|
12
|
-
--gramlot-
|
|
13
|
-
--gramlot-
|
|
14
|
-
--gramlot-
|
|
15
|
-
--gramlot-radius
|
|
16
|
-
--gramlot-radius:
|
|
17
|
-
--gramlot-radius
|
|
33
|
+
--gramlot-button-padding: 2px 7px;
|
|
34
|
+
--gramlot-button-gap: 4px;
|
|
35
|
+
--gramlot-button-background: var(--gramlot-surface);
|
|
36
|
+
--gramlot-button-hover: var(--gramlot-selected);
|
|
37
|
+
--gramlot-label-size: 1em;
|
|
38
|
+
--gramlot-label-gap: 3px;
|
|
39
|
+
--gramlot-radius-sm: 4px;
|
|
40
|
+
--gramlot-radius: 4px;
|
|
41
|
+
--gramlot-radius-lg: 6px;
|
|
42
|
+
--gramlot-window-radius: 6px;
|
|
43
|
+
--gramlot-toolbar-gap: 2px;
|
|
44
|
+
--gramlot-tree-row-height: var(--gramlot-field-height);
|
|
45
|
+
--gramlot-space-1: 3px;
|
|
46
|
+
--gramlot-space-2: 4px;
|
|
47
|
+
--gramlot-space-3: 8px;
|
|
48
|
+
--gramlot-space-4: 8px;
|
|
49
|
+
--gramlot-space-6: 12px;
|
|
50
|
+
--gramlot-space-8: 16px;
|
|
51
|
+
--gramlot-space-12: 24px;
|
|
52
|
+
--gramlot-tab-height: 28px;
|
|
53
|
+
--gramlot-tab-padding: 2px 7px;
|
|
54
|
+
--gramlot-tab-radius: 4px;
|
|
55
|
+
--gramlot-tab-gap: 2px;
|
|
56
|
+
--gramlot-tab-strip-padding: 2px;
|
|
57
|
+
--gramlot-tab-background: var(--gramlot-surface-subtle);
|
|
58
|
+
--gramlot-tab-selected-background: var(--gramlot-surface);
|
|
59
|
+
--gramlot-tab-selected-color: var(--gramlot-action);
|
|
60
|
+
--gramlot-tab-border: var(--gramlot-border);
|
|
61
|
+
--gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);
|
|
62
|
+
}
|
|
63
|
+
@media (prefers-color-scheme: dark) {
|
|
64
|
+
:root:not([data-theme="light"]) {
|
|
65
|
+
color-scheme: dark;
|
|
66
|
+
--gramlot-background: #171c24;
|
|
67
|
+
--gramlot-surface: #222a35;
|
|
68
|
+
--gramlot-surface-subtle: #2b3543;
|
|
69
|
+
--gramlot-ink: #edf1f7;
|
|
70
|
+
--gramlot-text-secondary: #b8c4d4;
|
|
71
|
+
--gramlot-border: #435064;
|
|
72
|
+
--gramlot-border-control: #7f90a7;
|
|
73
|
+
--gramlot-action: #9dbff4;
|
|
74
|
+
--gramlot-action-hover: #c1d6ff;
|
|
75
|
+
--gramlot-selected: #314766;
|
|
76
|
+
--gramlot-field-background: #222a35;
|
|
77
|
+
--gramlot-field-readonly-background: #2b3543;
|
|
78
|
+
--gramlot-label-color: #b8c4d4;
|
|
79
|
+
--gramlot-focus-ring: #9dbff4;
|
|
80
|
+
--gramlot-brand-blue: #9dbff4;
|
|
81
|
+
--gramlot-brand-yellow: #9dbff4;
|
|
82
|
+
--gramlot-navigation: #171c24;
|
|
83
|
+
--gramlot-navigation-text: #f6f8fb;
|
|
84
|
+
--gramlot-error: #ffb4b4;
|
|
85
|
+
--gramlot-error-background: #48292f;
|
|
86
|
+
--gramlot-success: #98dfbd;
|
|
87
|
+
--gramlot-success-background: #243f32;
|
|
88
|
+
--gramlot-warning: #f3d58c;
|
|
89
|
+
--gramlot-warning-background: #413820;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
:root[data-theme="dark"] {
|
|
93
|
+
color-scheme: dark;
|
|
94
|
+
--gramlot-background: #171c24;
|
|
95
|
+
--gramlot-surface: #222a35;
|
|
96
|
+
--gramlot-surface-subtle: #2b3543;
|
|
97
|
+
--gramlot-ink: #edf1f7;
|
|
98
|
+
--gramlot-text-secondary: #b8c4d4;
|
|
99
|
+
--gramlot-border: #435064;
|
|
100
|
+
--gramlot-border-control: #7f90a7;
|
|
101
|
+
--gramlot-action: #9dbff4;
|
|
102
|
+
--gramlot-action-hover: #c1d6ff;
|
|
103
|
+
--gramlot-selected: #314766;
|
|
104
|
+
--gramlot-field-background: #222a35;
|
|
105
|
+
--gramlot-field-readonly-background: #2b3543;
|
|
106
|
+
--gramlot-label-color: #b8c4d4;
|
|
107
|
+
--gramlot-focus-ring: #9dbff4;
|
|
108
|
+
--gramlot-brand-blue: #9dbff4;
|
|
109
|
+
--gramlot-brand-yellow: #9dbff4;
|
|
110
|
+
--gramlot-navigation: #171c24;
|
|
111
|
+
--gramlot-navigation-text: #f6f8fb;
|
|
112
|
+
--gramlot-error: #ffb4b4;
|
|
113
|
+
--gramlot-error-background: #48292f;
|
|
114
|
+
--gramlot-success: #98dfbd;
|
|
115
|
+
--gramlot-success-background: #243f32;
|
|
116
|
+
--gramlot-warning: #f3d58c;
|
|
117
|
+
--gramlot-warning-background: #413820;
|
|
18
118
|
}
|
|
19
119
|
}
|
|
20
|
-
|
|
21
120
|
@layer gramlot.base {
|
|
22
121
|
html { font-size: 13px; }
|
|
23
|
-
body { line-height: 1.
|
|
24
|
-
:where(h1,
|
|
25
|
-
h1 { font-size: 1.
|
|
26
|
-
h2 {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
blockquote { padding-inline-start: .6rem; }
|
|
30
|
-
hr { margin-block: 1rem; }
|
|
122
|
+
body { line-height: 1.4; }
|
|
123
|
+
:where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }
|
|
124
|
+
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
|
|
125
|
+
:where(h1,h2,h3) { letter-spacing: -.015em; }
|
|
126
|
+
pre { padding: var(--gramlot-space-3); }
|
|
127
|
+
hr { margin-block: var(--gramlot-space-6); }
|
|
31
128
|
}
|
|
32
|
-
|
|
33
129
|
@layer gramlot.components {
|
|
34
|
-
:where(button,
|
|
35
|
-
min-block-size:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
line-height: 1.35;
|
|
130
|
+
:where(button,input[type="button"],input[type="submit"],input[type="reset"],.button) {
|
|
131
|
+
min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);
|
|
132
|
+
font-size: 1rem; line-height: 1.3; font-weight: 500;
|
|
133
|
+
background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);
|
|
39
134
|
}
|
|
40
|
-
:where(
|
|
41
|
-
|
|
42
|
-
min-block-size: var(--gramlot-field-height);
|
|
43
|
-
padding: var(--gramlot-field-padding);
|
|
44
|
-
font-size: var(--gramlot-field-font-size);
|
|
45
|
-
line-height: var(--gramlot-field-line-height);
|
|
135
|
+
:where(button,input[type="button"],input[type="submit"],input[type="reset"],.button):hover:not(:disabled) {
|
|
136
|
+
background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);
|
|
46
137
|
}
|
|
47
|
-
:where(
|
|
48
|
-
:where(input[
|
|
49
|
-
:where(
|
|
50
|
-
:where(
|
|
138
|
+
:where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }
|
|
139
|
+
:where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }
|
|
140
|
+
:where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }
|
|
141
|
+
:where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }
|
|
142
|
+
:where(textarea) { min-block-size: 4.5rem; }
|
|
143
|
+
:where(input[type="color"]) { min-block-size: var(--gramlot-field-height); }
|
|
144
|
+
:where(input[type="file"])::file-selector-button { padding: var(--gramlot-field-padding); }
|
|
145
|
+
:where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }
|
|
51
146
|
:where(table) { font-size: 1rem; }
|
|
52
|
-
:where(th,
|
|
53
|
-
:where(details) {
|
|
54
|
-
:where(
|
|
55
|
-
:where(dialog) { padding: .75rem; }
|
|
147
|
+
:where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }
|
|
148
|
+
:where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }
|
|
149
|
+
:where(dialog) { padding: var(--gramlot-space-4); }
|
|
56
150
|
}
|
|
57
|
-
|
|
58
151
|
@layer gramlot.utilities {
|
|
59
|
-
.example-page { inline-size: min(100% -
|
|
60
|
-
.card { padding:
|
|
152
|
+
.example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }
|
|
153
|
+
.card { padding: var(--gramlot-space-4); box-shadow: none; }
|
|
61
154
|
}
|
package/themes/joanna/README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# Joanna
|
|
2
|
+
|
|
3
|
+
Professional desktop profile, revised at the owner's request on 2026-10-23.
|
|
4
|
+
Balanced density, warm neutral surfaces and blue accent. Controls are 32px high; body and field text are 14px. Light and dark
|
|
5
|
+
palettes use the same semantic roles. Existing touch targets remain larger.
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
class Page(BasePage):
|
|
9
|
+
css = ("/themes/gramlot-compact/theme.css", "/themes/joanna/theme.css")
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The server loads Base first. The gallery's existing appearance selector uses the
|
|
13
|
+
same canonical stylesheet. Inputs, command buttons, menus, tabs and window chrome
|
|
14
|
+
share existing field/button/spacing/radius tokens. Fixed Source dimensions still
|
|
15
|
+
win; use semantic spacing variables when a page should follow profile density.
|
|
16
|
+
These revised aesthetics are a development preview awaiting owner feedback.
|
|
17
|
+
|
|
18
|
+
## Historical record — before the 2026-10-23 aesthetic revision
|
|
19
|
+
|
|
1
20
|
# joanna
|
|
2
21
|
|
|
3
22
|
A Gramlot interpretation of GenroPy's `joanna` theme. The light palette
|
package/themes/joanna/theme.css
CHANGED
|
@@ -1,98 +1,154 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* joanna: professional density profile; load after Base and Compact. */
|
|
2
2
|
@layer gramlot.tokens {
|
|
3
3
|
:root {
|
|
4
|
-
|
|
5
|
-
--gramlot-
|
|
4
|
+
color-scheme: light;
|
|
5
|
+
--gramlot-background: #f5f4f2;
|
|
6
|
+
--gramlot-surface: #ffffff;
|
|
7
|
+
--gramlot-surface-subtle: #eeece8;
|
|
8
|
+
--gramlot-ink: #292c31;
|
|
9
|
+
--gramlot-text-secondary: #5d636c;
|
|
10
|
+
--gramlot-border: #d5d2cc;
|
|
11
|
+
--gramlot-border-control: #858990;
|
|
12
|
+
--gramlot-action: #245fb4;
|
|
13
|
+
--gramlot-action-hover: #194880;
|
|
14
|
+
--gramlot-selected: #e6eef9;
|
|
15
|
+
--gramlot-field-background: #ffffff;
|
|
16
|
+
--gramlot-field-readonly-background: #eeece8;
|
|
17
|
+
--gramlot-label-color: #5d636c;
|
|
18
|
+
--gramlot-focus-ring: #245fb4;
|
|
19
|
+
--gramlot-brand-blue: #245fb4;
|
|
20
|
+
--gramlot-brand-yellow: #245fb4;
|
|
21
|
+
--gramlot-navigation: #292c31;
|
|
22
|
+
--gramlot-navigation-text: #f6f8fb;
|
|
23
|
+
--gramlot-error: #aa2637;
|
|
24
|
+
--gramlot-error-background: #fff0f1;
|
|
25
|
+
--gramlot-success: #236747;
|
|
26
|
+
--gramlot-success-background: #e9f4ec;
|
|
27
|
+
--gramlot-warning: #735313;
|
|
28
|
+
--gramlot-warning-background: #fff5da;
|
|
29
|
+
--gramlot-field-height: 32px;
|
|
30
|
+
--gramlot-field-padding: 3px 9px;
|
|
31
|
+
--gramlot-field-line-height: 1.3;
|
|
32
|
+
--gramlot-field-font-size: 1rem;
|
|
33
|
+
--gramlot-button-padding: 3px 9px;
|
|
34
|
+
--gramlot-button-gap: 4px;
|
|
35
|
+
--gramlot-button-background: var(--gramlot-surface);
|
|
36
|
+
--gramlot-button-hover: var(--gramlot-selected);
|
|
37
|
+
--gramlot-label-size: 1em;
|
|
38
|
+
--gramlot-label-gap: 3px;
|
|
39
|
+
--gramlot-radius-sm: 6px;
|
|
40
|
+
--gramlot-radius: 6px;
|
|
41
|
+
--gramlot-radius-lg: 8px;
|
|
42
|
+
--gramlot-window-radius: 8px;
|
|
43
|
+
--gramlot-toolbar-gap: 2px;
|
|
44
|
+
--gramlot-tree-row-height: var(--gramlot-field-height);
|
|
45
|
+
--gramlot-space-1: 3px;
|
|
46
|
+
--gramlot-space-2: 5px;
|
|
47
|
+
--gramlot-space-3: 10px;
|
|
48
|
+
--gramlot-space-4: 10px;
|
|
49
|
+
--gramlot-space-6: 15px;
|
|
50
|
+
--gramlot-space-8: 20px;
|
|
51
|
+
--gramlot-space-12: 30px;
|
|
52
|
+
--gramlot-tab-height: 32px;
|
|
53
|
+
--gramlot-tab-padding: 3px 9px;
|
|
6
54
|
--gramlot-tab-radius: 6px;
|
|
7
55
|
--gramlot-tab-gap: 2px;
|
|
8
|
-
--gramlot-tab-strip-padding:
|
|
9
|
-
--gramlot-tab-background: var(--gramlot-
|
|
56
|
+
--gramlot-tab-strip-padding: 2px;
|
|
57
|
+
--gramlot-tab-background: var(--gramlot-surface-subtle);
|
|
10
58
|
--gramlot-tab-selected-background: var(--gramlot-surface);
|
|
11
|
-
--gramlot-tab-selected-color: var(--gramlot-
|
|
59
|
+
--gramlot-tab-selected-color: var(--gramlot-action);
|
|
12
60
|
--gramlot-tab-border: var(--gramlot-border);
|
|
13
|
-
--gramlot-
|
|
14
|
-
--gramlot-surface: #FFFFFF;
|
|
15
|
-
--gramlot-surface-subtle: #F2F2F7;
|
|
16
|
-
--gramlot-ink: #3A3A3C;
|
|
17
|
-
--gramlot-text-secondary: #636366;
|
|
18
|
-
--gramlot-border: #D1D1D6;
|
|
19
|
-
--gramlot-border-control: #AEAEB2;
|
|
20
|
-
--gramlot-navigation: #3A3A3C;
|
|
21
|
-
--gramlot-navigation-text: #FFFFFF;
|
|
22
|
-
--gramlot-action: #007AFF;
|
|
23
|
-
--gramlot-action-hover: #0061CC;
|
|
24
|
-
--gramlot-brand-blue: #007AFF;
|
|
25
|
-
--gramlot-brand-yellow: #AEAEB2;
|
|
26
|
-
--gramlot-selected: #E0EFFF;
|
|
27
|
-
--gramlot-focus-ring: #007AFF;
|
|
28
|
-
--gramlot-field-background: #FFFFFF;
|
|
29
|
-
--gramlot-field-readonly-background: #F2F2F7;
|
|
30
|
-
--gramlot-error: #B3261E;
|
|
31
|
-
--gramlot-error-background: #FFF1F0;
|
|
32
|
-
--gramlot-shadow: 0 1px 4px rgb(0 0 0 / 6%);
|
|
33
|
-
--gramlot-radius-sm: 6px;
|
|
34
|
-
--gramlot-radius: 6px;
|
|
35
|
-
--gramlot-radius-lg: 6px;
|
|
36
|
-
--gramlot-field-height: 20px;
|
|
37
|
-
--gramlot-field-padding: 1px 3px;
|
|
38
|
-
--gramlot-field-line-height: 1.15;
|
|
39
|
-
--gramlot-field-font-size: 1rem;
|
|
40
|
-
--gramlot-label-size: .8em;
|
|
41
|
-
--gramlot-label-gap: 2px;
|
|
42
|
-
--gramlot-label-color: var(--gramlot-text-secondary);
|
|
43
|
-
--gramlot-space-4: 6px;
|
|
44
|
-
--gramlot-font-ui: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
|
|
61
|
+
--gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);
|
|
45
62
|
}
|
|
46
63
|
@media (prefers-color-scheme: dark) {
|
|
47
64
|
:root:not([data-theme="light"]) {
|
|
48
|
-
|
|
49
|
-
--gramlot-
|
|
50
|
-
--gramlot-surface
|
|
51
|
-
--gramlot-
|
|
52
|
-
--gramlot-
|
|
53
|
-
--gramlot-
|
|
54
|
-
--gramlot-border
|
|
55
|
-
--gramlot-
|
|
56
|
-
--gramlot-action: #
|
|
57
|
-
--gramlot-action-hover: #
|
|
58
|
-
--gramlot-
|
|
59
|
-
--gramlot-
|
|
60
|
-
--gramlot-
|
|
61
|
-
--gramlot-
|
|
62
|
-
--gramlot-
|
|
63
|
-
--gramlot-
|
|
64
|
-
--gramlot-
|
|
65
|
-
--gramlot-
|
|
65
|
+
color-scheme: dark;
|
|
66
|
+
--gramlot-background: #1b1c20;
|
|
67
|
+
--gramlot-surface: #25272c;
|
|
68
|
+
--gramlot-surface-subtle: #303239;
|
|
69
|
+
--gramlot-ink: #f3f2ef;
|
|
70
|
+
--gramlot-text-secondary: #c4c3c0;
|
|
71
|
+
--gramlot-border: #454951;
|
|
72
|
+
--gramlot-border-control: #858c99;
|
|
73
|
+
--gramlot-action: #abcbff;
|
|
74
|
+
--gramlot-action-hover: #cedfff;
|
|
75
|
+
--gramlot-selected: #324765;
|
|
76
|
+
--gramlot-field-background: #25272c;
|
|
77
|
+
--gramlot-field-readonly-background: #303239;
|
|
78
|
+
--gramlot-label-color: #c4c3c0;
|
|
79
|
+
--gramlot-focus-ring: #abcbff;
|
|
80
|
+
--gramlot-brand-blue: #abcbff;
|
|
81
|
+
--gramlot-brand-yellow: #abcbff;
|
|
82
|
+
--gramlot-navigation: #1b1c20;
|
|
83
|
+
--gramlot-navigation-text: #f6f8fb;
|
|
84
|
+
--gramlot-error: #ffb4b4;
|
|
85
|
+
--gramlot-error-background: #48292f;
|
|
86
|
+
--gramlot-success: #98dfbd;
|
|
87
|
+
--gramlot-success-background: #243f32;
|
|
88
|
+
--gramlot-warning: #f3d58c;
|
|
89
|
+
--gramlot-warning-background: #413820;
|
|
66
90
|
}
|
|
67
91
|
}
|
|
68
92
|
:root[data-theme="dark"] {
|
|
69
|
-
|
|
70
|
-
--gramlot-
|
|
71
|
-
--gramlot-surface
|
|
72
|
-
--gramlot-
|
|
73
|
-
--gramlot-
|
|
74
|
-
--gramlot-
|
|
75
|
-
--gramlot-border
|
|
76
|
-
--gramlot-
|
|
77
|
-
--gramlot-action: #
|
|
78
|
-
--gramlot-action-hover: #
|
|
79
|
-
--gramlot-
|
|
80
|
-
--gramlot-
|
|
81
|
-
--gramlot-
|
|
82
|
-
--gramlot-
|
|
83
|
-
--gramlot-
|
|
84
|
-
--gramlot-
|
|
85
|
-
--gramlot-
|
|
86
|
-
--gramlot-
|
|
93
|
+
color-scheme: dark;
|
|
94
|
+
--gramlot-background: #1b1c20;
|
|
95
|
+
--gramlot-surface: #25272c;
|
|
96
|
+
--gramlot-surface-subtle: #303239;
|
|
97
|
+
--gramlot-ink: #f3f2ef;
|
|
98
|
+
--gramlot-text-secondary: #c4c3c0;
|
|
99
|
+
--gramlot-border: #454951;
|
|
100
|
+
--gramlot-border-control: #858c99;
|
|
101
|
+
--gramlot-action: #abcbff;
|
|
102
|
+
--gramlot-action-hover: #cedfff;
|
|
103
|
+
--gramlot-selected: #324765;
|
|
104
|
+
--gramlot-field-background: #25272c;
|
|
105
|
+
--gramlot-field-readonly-background: #303239;
|
|
106
|
+
--gramlot-label-color: #c4c3c0;
|
|
107
|
+
--gramlot-focus-ring: #abcbff;
|
|
108
|
+
--gramlot-brand-blue: #abcbff;
|
|
109
|
+
--gramlot-brand-yellow: #abcbff;
|
|
110
|
+
--gramlot-navigation: #1b1c20;
|
|
111
|
+
--gramlot-navigation-text: #f6f8fb;
|
|
112
|
+
--gramlot-error: #ffb4b4;
|
|
113
|
+
--gramlot-error-background: #48292f;
|
|
114
|
+
--gramlot-success: #98dfbd;
|
|
115
|
+
--gramlot-success-background: #243f32;
|
|
116
|
+
--gramlot-warning: #f3d58c;
|
|
117
|
+
--gramlot-warning-background: #413820;
|
|
87
118
|
}
|
|
88
119
|
}
|
|
89
120
|
@layer gramlot.base {
|
|
90
|
-
html { font-size:
|
|
121
|
+
html { font-size: 14px; }
|
|
122
|
+
body { line-height: 1.4; }
|
|
123
|
+
:where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }
|
|
124
|
+
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
|
|
125
|
+
:where(h1,h2,h3) { letter-spacing: -.015em; }
|
|
126
|
+
pre { padding: var(--gramlot-space-3); }
|
|
127
|
+
hr { margin-block: var(--gramlot-space-6); }
|
|
91
128
|
}
|
|
92
129
|
@layer gramlot.components {
|
|
93
|
-
:where(
|
|
94
|
-
|
|
130
|
+
:where(button,input[type="button"],input[type="submit"],input[type="reset"],.button) {
|
|
131
|
+
min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);
|
|
132
|
+
font-size: 1rem; line-height: 1.3; font-weight: 500;
|
|
133
|
+
background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);
|
|
134
|
+
}
|
|
135
|
+
:where(button,input[type="button"],input[type="submit"],input[type="reset"],.button):hover:not(:disabled) {
|
|
136
|
+
background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);
|
|
137
|
+
}
|
|
138
|
+
:where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }
|
|
139
|
+
:where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }
|
|
140
|
+
:where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }
|
|
141
|
+
:where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }
|
|
142
|
+
:where(textarea) { min-block-size: 4.5rem; }
|
|
143
|
+
:where(input[type="color"]) { min-block-size: var(--gramlot-field-height); }
|
|
144
|
+
:where(input[type="file"])::file-selector-button { padding: var(--gramlot-field-padding); }
|
|
145
|
+
:where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }
|
|
146
|
+
:where(table) { font-size: 1rem; }
|
|
147
|
+
:where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }
|
|
148
|
+
:where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }
|
|
149
|
+
:where(dialog) { padding: var(--gramlot-space-4); }
|
|
95
150
|
}
|
|
96
151
|
@layer gramlot.utilities {
|
|
97
|
-
.
|
|
152
|
+
.example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }
|
|
153
|
+
.card { padding: var(--gramlot-space-4); box-shadow: none; }
|
|
98
154
|
}
|