@gramlot/gramlot 0.3.41 → 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/assets/icons/applications.svg +4 -0
- package/assets/icons/archive.svg +4 -0
- package/assets/icons/attachment.svg +4 -0
- package/assets/icons/book.svg +4 -0
- package/assets/icons/bookmark.svg +4 -0
- package/assets/icons/calendar.svg +4 -0
- package/assets/icons/cancel.svg +4 -0
- package/assets/icons/chart.svg +4 -1
- package/assets/icons/chat.svg +4 -0
- package/assets/icons/clock.svg +4 -0
- package/assets/icons/code.svg +4 -0
- package/assets/icons/collapse.svg +4 -0
- package/assets/icons/columns.svg +4 -0
- package/assets/icons/confirm.svg +4 -0
- package/assets/icons/copy.svg +4 -0
- package/assets/icons/cut.svg +4 -0
- package/assets/icons/database.svg +4 -0
- package/assets/icons/delete.svg +4 -0
- package/assets/icons/detach.svg +4 -0
- package/assets/icons/document.svg +4 -0
- package/assets/icons/download.svg +4 -0
- package/assets/icons/duplicate.svg +4 -0
- package/assets/icons/edit.svg +4 -0
- package/assets/icons/expand.svg +4 -0
- package/assets/icons/export.svg +4 -0
- package/assets/icons/eye.svg +4 -0
- package/assets/icons/filter.svg +4 -0
- package/assets/icons/first.svg +4 -0
- package/assets/icons/folder.svg +4 -0
- package/assets/icons/group.svg +4 -0
- package/assets/icons/help.svg +4 -0
- package/assets/icons/home.svg +4 -0
- package/assets/icons/import.svg +4 -0
- package/assets/icons/info.svg +4 -0
- package/assets/icons/inspector.svg +4 -0
- package/assets/icons/last.svg +4 -0
- package/assets/icons/layers.svg +4 -0
- package/assets/icons/link.svg +4 -0
- package/assets/icons/list.svg +4 -0
- package/assets/icons/lock.svg +4 -0
- package/assets/icons/logout.svg +4 -0
- package/assets/icons/navigation.svg +4 -0
- package/assets/icons/new.svg +4 -0
- package/assets/icons/next.svg +4 -0
- package/assets/icons/open.svg +4 -0
- package/assets/icons/palette.svg +4 -0
- package/assets/icons/panel-bottom.svg +4 -0
- package/assets/icons/panel-left.svg +4 -0
- package/assets/icons/panel-right.svg +4 -0
- package/assets/icons/panel-top.svg +4 -0
- package/assets/icons/paste.svg +4 -0
- package/assets/icons/pause.svg +4 -0
- package/assets/icons/pin.svg +4 -0
- package/assets/icons/play.svg +4 -0
- package/assets/icons/previous.svg +4 -0
- package/assets/icons/print.svg +4 -0
- package/assets/icons/redo.svg +4 -0
- package/assets/icons/refresh.svg +4 -0
- package/assets/icons/save.svg +4 -0
- package/assets/icons/search.svg +4 -0
- package/assets/icons/send.svg +4 -0
- package/assets/icons/settings.svg +4 -0
- package/assets/icons/sort-ascending.svg +4 -0
- package/assets/icons/sort-descending.svg +4 -0
- package/assets/icons/stop.svg +4 -0
- package/assets/icons/table.svg +4 -0
- package/assets/icons/tree.svg +4 -0
- package/assets/icons/undo.svg +4 -0
- package/assets/icons/unlock.svg +4 -0
- package/assets/icons/upload.svg +4 -0
- package/assets/icons/user.svg +4 -0
- package/assets/icons/warning.svg +4 -0
- package/assets/icons/zoom-in.svg +4 -0
- package/assets/icons/zoom-out.svg +4 -0
- package/dist/components/charts/__init__.py +1 -1
- package/dist/components/charts/assets/index.js +1 -1
- package/dist/components/charts/assets/libraries/vega.js +11 -11
- package/dist/components/editors/__init__.py +1 -1
- package/dist/components/editors/assets/index.js +1 -1
- package/dist/components/editors/assets/libraries/codemirror.js +30 -31
- package/dist/components/editors/assets/libraries/jodit.js +3 -1
- package/dist/components/editors/grammar.json +6 -1
- package/dist/components/grid/__init__.py +1 -1
- package/dist/components/grid/assets/index.js +1 -1
- package/dist/components/grid/commands.json +4 -6
- package/dist/components/grid/grammar.json +51 -0
- package/dist/components/inputs/__init__.py +1 -1
- package/dist/components/inputs/assets/index.js +1 -1
- package/dist/components/inputs/grammar.json +4987 -216
- package/dist/components/layout/__init__.py +1 -1
- package/dist/components/layout/assets/index.js +1 -1
- package/dist/components/layout/grammar.json +69 -4
- package/dist/components/tree/__init__.py +1 -1
- package/dist/components/tree/assets/index.js +1 -1
- package/dist/components/tree/grammar.json +16 -0
- package/dist/components/typst/__init__.py +1 -1
- package/dist/components/typst/assets/collection.js +6 -6
- package/dist/components/typst/assets/index.js +1 -1
- package/dist/components/uploads/__init__.py +1 -1
- package/dist/components/uploads/assets/index.js +1 -1
- package/dist/components/uploads/grammar.json +66 -0
- package/dist/declared-collections.js +1 -1
- package/dist/gramlot.js +3961 -1249
- package/dist/gramlot.min.js +329 -131
- package/dist/libraries.json +1 -0
- package/dist/standard-collections.js +1 -1
- package/dist/standard-grammar.js +1 -1
- package/package.json +3 -1
- package/src/binding/ask-dialog.js +17 -3
- package/src/binding/providers.js +1 -1
- package/src/binding/runtime.js +6 -3
- package/src/builder/chart-icon.js +2 -0
- package/src/builder/gramlot-builder.d.ts +3 -1
- package/src/builder/gramlot-builder.js +26 -9
- package/src/builder/source.js +12 -3
- package/src/builder/xml-recipe.js +144 -0
- package/src/chat-file-types.js +13 -0
- package/src/chat.js +23 -25
- package/src/commands.d.ts +1 -1
- package/src/commands.js +1 -1
- package/src/components/border-container.js +64 -6
- package/src/components/buttons.js +26 -31
- package/src/components/chart-geographic-options.js +1 -1
- package/src/components/chart-pane.js +5 -5
- package/src/components/chart-spatial-options.js +5 -1
- package/src/components/check-box-text-editor.js +1 -0
- package/src/components/check-box-text.js +2 -0
- package/src/components/choice-editor.js +3 -2
- package/src/components/choice-field-styles.js +9 -1
- package/src/components/code-mirror-engine.js +18 -5
- package/src/components/code-mirror-gramlot.js +85 -0
- package/src/components/code-mirror.js +3 -2
- package/src/components/drawing.js +43 -14
- package/src/components/editor-options.js +1 -1
- package/src/components/graphical-ranges.js +177 -0
- package/src/components/grid-footer.js +6 -1
- package/src/components/grid-styles.js +11 -2
- package/src/components/grid-tools.js +15 -7
- package/src/components/grid.js +69 -8
- package/src/components/inputs.js +93 -23
- package/src/components/jodit-engine.js +3 -1
- package/src/components/menus.js +83 -25
- package/src/components/numeric-range.js +39 -0
- package/src/components/selected-container.js +109 -63
- package/src/components/tab-bar.js +371 -0
- package/src/components/toolbar-icon-style.js +22 -0
- package/src/components/toolbar-overflow.js +74 -12
- package/src/components/tree.js +12 -3
- package/src/components/typst-preview.js +3 -3
- package/src/components/upload-blocks.js +88 -0
- package/src/components/upload-engine.js +21 -31
- package/src/components/uploader.js +168 -47
- package/src/gramlot.js +6 -3
- package/src/handlers/dom-handler.d.ts +2 -0
- package/src/handlers/dom-handler.js +9 -0
- package/src/handlers/rpc-handler.d.ts +1 -1
- package/src/handlers/rpc-handler.js +2 -0
- package/src/handlers/source-handler.d.ts +5 -3
- package/src/handlers/source-handler.js +31 -13
- package/src/icons.js +84 -0
- package/src/index-page-runtime.js +9 -2
- package/src/index-page-styles.js +1 -1
- package/src/index-theme.js +210 -3
- package/src/index.d.ts +5 -1
- package/src/index.js +5 -1
- package/src/libraries.js +1 -1
- package/src/renderer/gramlot-renderer.js +4 -1
- package/src/server/chat-attachments.js +139 -0
- package/src/server/chat.d.ts +31 -0
- package/src/server/chat.js +157 -0
- package/src/server/database-selectors.d.ts +6 -0
- package/src/server/database-selectors.js +13 -0
- package/src/server/gramlot-file-server.js +6 -1
- package/src/server/gramlot-server.d.ts +19 -3
- package/src/server/gramlot-server.js +144 -18
- package/src/server/index-page.d.ts +10 -0
- package/src/server/index-page.js +73 -8
- package/src/server/index.d.ts +1 -1
- package/src/server/index.js +1 -1
- package/src/server/page-base.js +4 -0
- package/src/server/page-store.d.ts +21 -0
- package/src/server/page-store.js +219 -0
- package/src/server/page.d.ts +6 -1
- package/src/server/page.js +5 -1
- package/src/server/store-recipe.js +102 -0
- package/src/server/toolbar-icon-name.d.ts +76 -0
- package/src/server/upload.d.ts +2 -0
- package/src/server/upload.js +36 -18
- package/src/server/visual-editor.js +4 -2
- package/src/tree-store.d.ts +5 -1
- package/src/tree-store.js +11 -2
- package/src/view/choice-focus.js +17 -0
- package/src/view/html.js +21 -1
- package/src/view/menu.js +9 -3
- package/src/visual-editor.js +6 -2
- package/themes/gramlot-base/theme.css +53 -28
- package/themes/gramlot-compact/theme.css +2 -0
- package/themes/gramlot-index/icons/applications.svg +4 -0
- package/themes/gramlot-index/icons/archive.svg +4 -0
- package/themes/gramlot-index/icons/attachment.svg +4 -0
- package/themes/gramlot-index/icons/book.svg +4 -0
- package/themes/gramlot-index/icons/bookmark.svg +4 -0
- package/themes/gramlot-index/icons/calendar.svg +4 -0
- package/themes/gramlot-index/icons/cancel.svg +4 -0
- package/themes/gramlot-index/icons/chart.svg +4 -0
- package/themes/gramlot-index/icons/chat.svg +4 -0
- package/themes/gramlot-index/icons/clock.svg +4 -0
- package/themes/gramlot-index/icons/code.svg +4 -0
- package/themes/gramlot-index/icons/collapse.svg +4 -0
- package/themes/gramlot-index/icons/columns.svg +4 -0
- package/themes/gramlot-index/icons/confirm.svg +4 -0
- package/themes/gramlot-index/icons/copy.svg +4 -0
- package/themes/gramlot-index/icons/cut.svg +4 -0
- package/themes/gramlot-index/icons/database.svg +4 -0
- package/themes/gramlot-index/icons/delete.svg +4 -0
- package/themes/gramlot-index/icons/detach.svg +4 -0
- package/themes/gramlot-index/icons/document.svg +4 -0
- package/themes/gramlot-index/icons/download.svg +4 -0
- package/themes/gramlot-index/icons/duplicate.svg +4 -0
- package/themes/gramlot-index/icons/edit.svg +4 -0
- package/themes/gramlot-index/icons/expand.svg +4 -0
- package/themes/gramlot-index/icons/export.svg +4 -0
- package/themes/gramlot-index/icons/eye.svg +4 -0
- package/themes/gramlot-index/icons/filter.svg +4 -0
- package/themes/gramlot-index/icons/first.svg +4 -0
- package/themes/gramlot-index/icons/folder.svg +4 -0
- package/themes/gramlot-index/icons/group.svg +4 -0
- package/themes/gramlot-index/icons/help.svg +4 -0
- package/themes/gramlot-index/icons/home.svg +4 -0
- package/themes/gramlot-index/icons/import.svg +4 -0
- package/themes/gramlot-index/icons/info.svg +4 -0
- package/themes/gramlot-index/icons/inspector.svg +4 -0
- package/themes/gramlot-index/icons/last.svg +4 -0
- package/themes/gramlot-index/icons/layers.svg +4 -0
- package/themes/gramlot-index/icons/link.svg +4 -0
- package/themes/gramlot-index/icons/list.svg +4 -0
- package/themes/gramlot-index/icons/lock.svg +4 -0
- package/themes/gramlot-index/icons/logout.svg +4 -0
- package/themes/gramlot-index/icons/navigation.svg +4 -0
- package/themes/gramlot-index/icons/new.svg +4 -0
- package/themes/gramlot-index/icons/next.svg +4 -0
- package/themes/gramlot-index/icons/open.svg +4 -0
- package/themes/gramlot-index/icons/palette.svg +4 -0
- package/themes/gramlot-index/icons/panel-bottom.svg +4 -0
- package/themes/gramlot-index/icons/panel-left.svg +4 -0
- package/themes/gramlot-index/icons/panel-right.svg +4 -0
- package/themes/gramlot-index/icons/panel-top.svg +4 -0
- package/themes/gramlot-index/icons/paste.svg +4 -0
- package/themes/gramlot-index/icons/pause.svg +4 -0
- package/themes/gramlot-index/icons/pin.svg +4 -0
- package/themes/gramlot-index/icons/play.svg +4 -0
- package/themes/gramlot-index/icons/previous.svg +4 -0
- package/themes/gramlot-index/icons/print.svg +4 -0
- package/themes/gramlot-index/icons/redo.svg +4 -0
- package/themes/gramlot-index/icons/refresh.svg +4 -0
- package/themes/gramlot-index/icons/save.svg +4 -0
- package/themes/gramlot-index/icons/search.svg +4 -0
- package/themes/gramlot-index/icons/send.svg +4 -0
- package/themes/gramlot-index/icons/settings.svg +4 -0
- package/themes/gramlot-index/icons/sort-ascending.svg +4 -0
- package/themes/gramlot-index/icons/sort-descending.svg +4 -0
- package/themes/gramlot-index/icons/stop.svg +4 -0
- package/themes/gramlot-index/icons/table.svg +4 -0
- package/themes/gramlot-index/icons/tree.svg +4 -0
- package/themes/gramlot-index/icons/undo.svg +4 -0
- package/themes/gramlot-index/icons/unlock.svg +4 -0
- package/themes/gramlot-index/icons/upload.svg +4 -0
- package/themes/gramlot-index/icons/user.svg +4 -0
- package/themes/gramlot-index/icons/warning.svg +4 -0
- package/themes/gramlot-index/icons/zoom-in.svg +4 -0
- package/themes/gramlot-index/icons/zoom-out.svg +4 -0
- package/themes/gramlot-index/icons.json +76 -0
- package/themes/gramlot-index/theme.css +21 -0
- package/themes/joanna/theme.css +2 -0
- package/themes/mela/theme.css +2 -0
- package/themes/mimi/theme.css +2 -0
package/src/view/html.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {bindIcons, renderIcon, projectIconAttributes} from '../icons.js';
|
|
1
2
|
import {createLabelbox, projectLabelbox, labelboxStyle} from './labelbox.js';
|
|
2
3
|
import {commandFrame, frameRecipient} from './menu-command.js';
|
|
3
4
|
import {randomId} from '../random-id.js';
|
|
@@ -39,7 +40,8 @@ function domPropertyName(name) {
|
|
|
39
40
|
* names and style arrive adapted by the renderers (GramlotHtmlRenderer, GramlotSvgRenderer).
|
|
40
41
|
*/
|
|
41
42
|
export class HtmlElement {
|
|
42
|
-
constructor({format, metadataAttributes = [], invokeScript = null, callLogic = null, reportError = null, uploadContext = null} = {}) {
|
|
43
|
+
constructor({icons, format, metadataAttributes = [], invokeScript = null, callLogic = null, reportError = null, uploadContext = null} = {}) {
|
|
44
|
+
this.icons = icons;
|
|
43
45
|
this.format = format;
|
|
44
46
|
this.uploadContext = uploadContext;
|
|
45
47
|
this.invokeScript = invokeScript;
|
|
@@ -115,6 +117,7 @@ export class HtmlElement {
|
|
|
115
117
|
tag ??= defaultTag;
|
|
116
118
|
const element = namespace === XHTML_NS
|
|
117
119
|
? document.createElement(tag) : document.createElementNS(namespace, tag);
|
|
120
|
+
bindIcons(element, this.icons);
|
|
118
121
|
if (meta.gramlot_component && element.constructor.gramlotComponent?.tag !== tag) {
|
|
119
122
|
throw new Error(`Component collection must be activated before rendering ${tag}`);
|
|
120
123
|
}
|
|
@@ -280,10 +283,26 @@ export class HtmlElement {
|
|
|
280
283
|
if (attrs.lbl_variant === 'card' && attrs.lbl_position == null) delete defaults.lbl_position;
|
|
281
284
|
projectLabelbox(record.labelbox, {...defaults, ...attrs}, adapt);
|
|
282
285
|
}
|
|
286
|
+
const iconAttributes = attrs;
|
|
283
287
|
if (this.definition(node).meta.gramlot_component) {
|
|
284
288
|
// A component reads its data and structure by address when it draws; the path of the
|
|
285
289
|
// Data change that asked for the projection (null otherwise) tells it what changed.
|
|
286
290
|
attrs = element.projectAttributes(attrs, adapt, change?.path ?? null);
|
|
291
|
+
const slot = element.shadowRoot?.querySelector('[iconslot=""]');
|
|
292
|
+
if (slot && Object.hasOwn(iconAttributes, 'icon')) {
|
|
293
|
+
renderIcon(element, slot, element.entryIcon ?? iconAttributes.icon);
|
|
294
|
+
attrs = {...attrs}; delete attrs.icon;
|
|
295
|
+
}
|
|
296
|
+
} else if (isHtml && !this.definition(node).meta.void && (attrs.icon != null || record.icon)) {
|
|
297
|
+
if (!record.icon) {
|
|
298
|
+
record.icon = element.ownerDocument.createElement("span");
|
|
299
|
+
record.icon.setAttribute("aria-hidden", "true");
|
|
300
|
+
record.icon.style.cssText = "display:inline-flex;vertical-align:middle;margin-inline-end:.35em";
|
|
301
|
+
element.prepend(record.icon);
|
|
302
|
+
}
|
|
303
|
+
renderIcon(element, record.icon, attrs.icon);
|
|
304
|
+
record.icon.hidden = !attrs.icon;
|
|
305
|
+
attrs = {...attrs}; delete attrs.icon;
|
|
287
306
|
}
|
|
288
307
|
if (record.labelbox) {
|
|
289
308
|
attrs = Object.fromEntries(Object.entries(attrs).filter(([name]) =>
|
|
@@ -293,6 +312,7 @@ export class HtmlElement {
|
|
|
293
312
|
record.presentationSlot = attrs.slot;
|
|
294
313
|
delete attrs.slot;
|
|
295
314
|
}
|
|
315
|
+
attrs = projectIconAttributes(iconAttributes, attrs, element.ownerDocument);
|
|
296
316
|
attrs = Object.fromEntries(sourceAttributeItems({...attrs, ...renderAttributes}));
|
|
297
317
|
const controlled = ControlAdapter.classFor(element, attrs) !== null;
|
|
298
318
|
if (textValue === DEFAULT_TEXT) textValue = this.text(node);
|
package/src/view/menu.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import {Bag} from '@genrojs/bag';
|
|
3
3
|
import {SourceBag, sourceTarget} from '@genrojs/builders';
|
|
4
4
|
import {toTytx} from '@genrojs/tytx';
|
|
5
|
+
import {resolverMenuLines} from '../builder/source.js';
|
|
5
6
|
import {RpcResolver} from '../binding/rpc-resolver.js';
|
|
6
7
|
|
|
7
|
-
const ENTRY_FIELDS=new Set(['kind','command','caption','icon','
|
|
8
|
+
const ENTRY_FIELDS=new Set(['kind','command','caption','icon','tooltip','disabled','hidden','checked','favorite','parameters','resolver','cacheTime','sync']);
|
|
8
9
|
function entries(bag,ancestors=new Set()) {
|
|
9
10
|
if (!(bag instanceof Bag) || ancestors.has(bag)) throw new TypeError('Menu resolver must return an acyclic Bag');
|
|
10
11
|
const parents=new Set([...ancestors,bag]);
|
|
@@ -36,8 +37,13 @@ function project(menu,records) {
|
|
|
36
37
|
let node=menu.value instanceof SourceBag?menu.value.getNodes().find(node=>node.label===item.label):null;
|
|
37
38
|
const wasSubmenu=node?.value instanceof SourceBag;
|
|
38
39
|
if(node && (wasSubmenu!==(kind==='submenu') || (node.value==='-')!==(kind==='separator'))){menu.value.popNode(node.label);node=null;}
|
|
39
|
-
if(!node)
|
|
40
|
-
|
|
40
|
+
if(!node) {
|
|
41
|
+
const {caption, ...fields} = attrs;
|
|
42
|
+
node = sourceTarget(handle.menuline(value, {...fields, node_label:item.label}));
|
|
43
|
+
resolverMenuLines.add(node);
|
|
44
|
+
if (caption != null) node.setAttr({caption});
|
|
45
|
+
} else {
|
|
46
|
+
resolverMenuLines.add(node);
|
|
41
47
|
const previous=Object.keys(node.attr).filter(key=>ENTRY_FIELDS.has(key)&&!Object.hasOwn(attrs,key));
|
|
42
48
|
node.setAttr({...Object.fromEntries(previous.map(key=>[key,null])),...attrs});
|
|
43
49
|
}
|
package/src/visual-editor.js
CHANGED
|
@@ -33,7 +33,7 @@ const catalogueSections = [
|
|
|
33
33
|
['components.layout.composition', 'Composition', 'formlet groupBox trayPane transformPane'],
|
|
34
34
|
['components.inputs.text', 'Text', 'textbox textBoxArea passwordbox'],
|
|
35
35
|
['components.inputs.choices', 'Choices', 'checkbox radioButton radioButtonText checkBoxText filteringSelect comboBox callbackSelect dbSelect dbComboBox'],
|
|
36
|
-
['components.inputs.numbers', 'Numbers and colors', 'numberTextBox horizontalSlider verticalSlider colorpicker'],
|
|
36
|
+
['components.inputs.numbers', 'Numbers and colors', 'numberTextBox horizontalSlider verticalSlider knob starRating colorpicker'],
|
|
37
37
|
['components.inputs.dates', 'Dates and times', 'dateTextBox timeTextBox dateCalendar'],
|
|
38
38
|
['components.commands', 'Buttons and menus', 'button toggleButton dropDownButton menu menuline spacer'],
|
|
39
39
|
['components.data', 'Trees and grids', 'tree grid searchBox'],
|
|
@@ -601,6 +601,10 @@ export class VisualEditorLogic {
|
|
|
601
601
|
node.rootBuilder.binding.renderer.destination.ownerDocument.documentElement.setAttribute('data-theme', mode);
|
|
602
602
|
}
|
|
603
603
|
initializeEditor(node, {dataRoot}) {
|
|
604
|
+
const editor = visualEditorScope(node);
|
|
605
|
+
const main = node.rootBuilder.source.getItem('main');
|
|
606
|
+
const tree = editor.value.getNodeByAttr('id', editor.getAttr('visualEditorId') + '-source-tree');
|
|
607
|
+
tree.setAttr({storepath:'*S.' + main.relativePath(editor) + '.layout.center.design'});
|
|
604
608
|
const scope = node.GET('.catalogueScope');
|
|
605
609
|
validateCatalogue(scope);
|
|
606
610
|
if (Array.isArray(scope)) for (const tag of scope) {
|
|
@@ -917,7 +921,7 @@ export class VisualEditorLogic {
|
|
|
917
921
|
if (prefix === 'lbl') this.parameterField(node, heading, current.nodeTag, 'lbl', entries.lbl,
|
|
918
922
|
'properties', current.getAttr('lbl'));
|
|
919
923
|
else heading.span(title, {class:'visual-labelbox-title'});
|
|
920
|
-
heading.button({
|
|
924
|
+
heading.button({icon:toolIcons.properties, title:`Edit ${title.toLowerCase()} attributes`,
|
|
921
925
|
'aria-label':`Edit ${title.toLowerCase()} attributes`, class:'button--quiet',
|
|
922
926
|
action:'toggleLabelboxAttributes', prefix});
|
|
923
927
|
const choices = Object.entries(entries).filter(([name]) => name.startsWith(prefix + '_'));
|
|
@@ -36,12 +36,18 @@
|
|
|
36
36
|
--gramlot-error: #b13d48;
|
|
37
37
|
--gramlot-error-background: #fceef0;
|
|
38
38
|
|
|
39
|
+
--gramlot-button-height: 24px;
|
|
40
|
+
--gramlot-button-padding: 2px 8px;
|
|
41
|
+
--gramlot-button-background: color-mix(in srgb, var(--gramlot-surface) 84%, var(--gramlot-ink));
|
|
42
|
+
--gramlot-button-hover: color-mix(in srgb, var(--gramlot-surface) 74%, var(--gramlot-ink));
|
|
39
43
|
--gramlot-button-icon-size: 24px;
|
|
40
44
|
--gramlot-button-icon-padding: 5px;
|
|
41
45
|
--gramlot-field-height: 2.75rem;
|
|
42
46
|
--gramlot-field-padding: .55rem .75rem;
|
|
43
47
|
--gramlot-field-font-size: .875rem;
|
|
44
48
|
--gramlot-field-background: var(--gramlot-surface);
|
|
49
|
+
--gramlot-choice-background: color-mix(in srgb, var(--gramlot-surface) 89%, var(--gramlot-ink));
|
|
50
|
+
--gramlot-choice-border-width: 0px;
|
|
45
51
|
--gramlot-field-readonly-background: var(--gramlot-surface-subtle);
|
|
46
52
|
--gramlot-label-size: 1em;
|
|
47
53
|
--gramlot-font-ui: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
|
|
@@ -61,7 +67,7 @@
|
|
|
61
67
|
--gramlot-radius: 0.5rem;
|
|
62
68
|
--gramlot-radius-lg: 0.75rem;
|
|
63
69
|
--gramlot-shadow: 0 1px 2px rgb(24 35 51 / 5%), 0 8px 24px rgb(24 35 51 / 5%);
|
|
64
|
-
--gramlot-focus-ring:
|
|
70
|
+
--gramlot-focus-ring: var(--gramlot-action);
|
|
65
71
|
--gramlot-page-width: 72rem;
|
|
66
72
|
}
|
|
67
73
|
|
|
@@ -88,7 +94,6 @@
|
|
|
88
94
|
--gramlot-warning-background: #483718;
|
|
89
95
|
--gramlot-error: #ffb3bb;
|
|
90
96
|
--gramlot-error-background: #4d2630;
|
|
91
|
-
--gramlot-focus-ring: #ffc400;
|
|
92
97
|
--gramlot-shadow: 0 1px 2px rgb(0 0 0 / 15%), 0 8px 24px rgb(0 0 0 / 12%);
|
|
93
98
|
}
|
|
94
99
|
}
|
|
@@ -162,40 +167,39 @@
|
|
|
162
167
|
display: inline-flex;
|
|
163
168
|
align-items: center;
|
|
164
169
|
justify-content: center;
|
|
165
|
-
gap: var(--gramlot-
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
gap: var(--gramlot-button-gap, .35em);
|
|
171
|
+
box-sizing: border-box;
|
|
172
|
+
min-block-size: max(var(--gramlot-button-height), var(--gramlot-touch-target, 0px));
|
|
173
|
+
min-inline-size: var(--gramlot-touch-target, 0px);
|
|
174
|
+
border: 0;
|
|
168
175
|
border-radius: var(--gramlot-radius-sm);
|
|
169
|
-
background: var(--gramlot-
|
|
170
|
-
color: var(--gramlot-
|
|
171
|
-
padding:
|
|
172
|
-
font
|
|
173
|
-
font-
|
|
174
|
-
line-height: 1.
|
|
176
|
+
background: var(--gramlot-button-background);
|
|
177
|
+
color: var(--gramlot-button-color, var(--gramlot-ink));
|
|
178
|
+
padding: var(--gramlot-button-padding);
|
|
179
|
+
font: inherit;
|
|
180
|
+
font-size: var(--gramlot-field-font-size);
|
|
181
|
+
line-height: 1.25;
|
|
175
182
|
text-align: center;
|
|
176
183
|
text-decoration: none;
|
|
177
184
|
cursor: pointer;
|
|
178
|
-
transition: background-color 150ms ease
|
|
185
|
+
transition: background-color 150ms ease;
|
|
179
186
|
}
|
|
180
187
|
:where(button, input[type="button"], input[type="submit"], input[type="reset"], .button):hover:not(:disabled) {
|
|
181
|
-
background: var(--gramlot-
|
|
182
|
-
border-color: var(--gramlot-action-hover);
|
|
183
|
-
color: var(--gramlot-surface);
|
|
188
|
+
background: var(--gramlot-button-hover);
|
|
184
189
|
}
|
|
185
|
-
:where(button, input[type="button"], input[type="submit"], input[type="reset"], .button):active:not(:disabled) {
|
|
186
|
-
:where(button, input[type="button"], input[type="submit"], input[type="reset"], .button):
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
color: var(--gramlot-action);
|
|
190
|
-
border-color: var(--gramlot-border-control);
|
|
190
|
+
:where(button, input[type="button"], input[type="submit"], input[type="reset"], .button):active:not(:disabled) { filter: brightness(.9); }
|
|
191
|
+
:where(button, input[type="button"], input[type="submit"], input[type="reset"], .button):focus-visible {
|
|
192
|
+
outline: 1px solid var(--gramlot-focus-ring);
|
|
193
|
+
outline-offset: -1px;
|
|
191
194
|
}
|
|
192
|
-
:where(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
:where(button, input[type="button"], input[type="submit"], input[type="reset"], .button):disabled { opacity: .55; cursor: not-allowed; }
|
|
196
|
+
:where(.button--secondary, button.secondary) { background: var(--gramlot-selected); color: var(--gramlot-action); }
|
|
197
|
+
:where(.button--secondary, button.secondary):hover:not(:disabled) { background: var(--gramlot-selected); color: var(--gramlot-action-hover); }
|
|
198
|
+
:where(.button--quiet, button.quiet) { background: transparent; color: var(--gramlot-action); }
|
|
199
|
+
:where(.button--quiet, button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); color: var(--gramlot-action-hover); }
|
|
200
|
+
@media (forced-colors: active) {
|
|
201
|
+
:where(button, input[type="button"], input[type="submit"], input[type="reset"], .button) { border: 1px solid ButtonText; }
|
|
196
202
|
}
|
|
197
|
-
:where(.button--quiet, button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }
|
|
198
|
-
:where(.button--quiet, button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: transparent; }
|
|
199
203
|
|
|
200
204
|
:where(label) { display: inline-block; margin-block-end: var(--gramlot-space-1); font-size: 0.875rem; font-weight: 600; }
|
|
201
205
|
:where(label:has(input:disabled)) { color: var(--gramlot-text-secondary); }
|
|
@@ -212,6 +216,14 @@
|
|
|
212
216
|
font-size: var(--gramlot-field-font-size);
|
|
213
217
|
line-height: var(--gramlot-field-line-height,1.5);
|
|
214
218
|
}
|
|
219
|
+
:where(select) {
|
|
220
|
+
background-color: var(--gramlot-choice-background);
|
|
221
|
+
border-width: var(--gramlot-choice-border-width);
|
|
222
|
+
}
|
|
223
|
+
:where(select):focus-visible { outline: 1px solid var(--gramlot-focus-ring); outline-offset: -1px; }
|
|
224
|
+
:where(select).pointer-focus:focus { outline: none; }
|
|
225
|
+
:where(select)[aria-invalid="true"], :where(select):user-invalid { background-color: var(--gramlot-error-background); }
|
|
226
|
+
@media (forced-colors: active) { :where(select) { border: 1px solid ButtonText; } }
|
|
215
227
|
:where(textarea) { min-block-size: 7rem; resize: vertical; }
|
|
216
228
|
:where(input, textarea)::placeholder { color: var(--gramlot-text-secondary); opacity: 1; }
|
|
217
229
|
:where(input, select, textarea):disabled { opacity: 0.6; cursor: not-allowed; }
|
|
@@ -475,8 +487,21 @@
|
|
|
475
487
|
.visual-clipboard-title { font-weight:600; }
|
|
476
488
|
.visual-clipboard .visual-editor-hint { font-size:11px; }
|
|
477
489
|
|
|
490
|
+
/* Graphite command strips carry their own ink and popup surfaces in either page mode. */
|
|
491
|
+
.gramlot-toolbar-graphite {
|
|
492
|
+
color-scheme:dark;
|
|
493
|
+
--gramlot-ink:#e4e4e6;
|
|
494
|
+
--gramlot-field-background:#303033;
|
|
495
|
+
--gramlot-border-control:#555559;
|
|
496
|
+
--gramlot-selected:#49494e;
|
|
497
|
+
--gramlot-action:#f4f4f5;
|
|
498
|
+
--gramlot-action-hover:#fff;
|
|
499
|
+
--gramlot-focus-ring:#c4c4c9;
|
|
500
|
+
color:var(--gramlot-ink);
|
|
501
|
+
background:#28282b;
|
|
502
|
+
}
|
|
478
503
|
/* FrameGrid owns its single command/search toolbar. */
|
|
479
|
-
.gramlot-grid-toolbar { padding:2px 6px; min-height:40px; background:var(--gramlot-surface-subtle); }
|
|
504
|
+
.gramlot-grid-toolbar { box-sizing:border-box; padding:2px 6px; min-height:40px; background:var(--gramlot-surface-subtle); border-bottom:1px solid var(--gramlot-border-control); }
|
|
480
505
|
/* A toolbar with no tools and no authored items takes no space (it may hold an empty text node). */
|
|
481
506
|
.gramlot-grid-toolbar:not(:has(> *)) { display:none; }
|
|
482
507
|
.gramlot-grid-toolbar > .gramlot-grid-search { margin-inline-start:auto; }
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* gramlot-compact: professional density profile; load after Base. */
|
|
2
2
|
@layer gramlot.tokens {
|
|
3
3
|
:root {
|
|
4
|
+
--gramlot-choice-background: var(--gramlot-field-background);
|
|
5
|
+
--gramlot-choice-border-width: 1px;
|
|
4
6
|
color-scheme: light;
|
|
5
7
|
--gramlot-background: #f3f5f7;
|
|
6
8
|
--gramlot-surface: #ffffff;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<path d="M8 13l7-7a3 3 0 0 1 4 4L9 20a4.5 4.5 0 0 1-6-6l11-11m-8 13a1.4 1.4 0 0 0 2 2l8-8"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<path d="M12 6c-3-2-6-2.5-10-2v14c4-.5 7 0 10 2 3-2 6-2.5 10-2V4c-4-.5-7 0-10 2Zm0 0v14"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<rect x="3" y="5" width="18" height="16" rx="2"/><path d="M7 3v4m10-4v4M3 10h18M7 14h2m3 0h2"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 4v16m6-16v16"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<circle cx="6" cy="17" r="3"/><circle cx="18" cy="17" r="3"/><path d="M8 15L18 3M16 15L6 3"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<ellipse cx="12" cy="5.5" rx="8" ry="3"/><path d="M4 5.5v13c0 4 16 4 16 0v-13M4 12c0 4 16 4 16 0"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<circle cx="12" cy="12" r="9"/><path d="M9 9a3 3 0 0 1 6 0c0 2-3 2.5-3 5m0 3h.01"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="5.5"/><circle cx="12" cy="12" r="2"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<path d="M9 14l6-6M8 10l-3 3a4 4 0 0 0 6 6l3-3m2-2 3-3a4 4 0 0 0-6-6l-3 3"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<rect x="5" y="10" width="14" height="11" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3m-4 5v2"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<path d="M10 4H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h5M9 12h12m-5-5 5 5-5 5"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 4v16M5.5 8h1M5.5 12h1M5.5 16h1"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<path d="M20 14c-1 2-5 0-6 2s2 4 0 5C7 23 2 17 3 11A9 9 0 0 1 21 10q1 3-1 4Z"/><circle cx="7.5" cy="11" r=".8"/><circle cx="10" cy="7" r=".8"/><circle cx="14.5" cy="7" r=".8"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 14h18M7 17h1M11.5 17h1M16 17h1"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 4v16M5.5 8h1M5.5 12h1M5.5 16h1"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M15 4v16M17.5 8h1M17.5 12h1M17.5 16h1"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 10h18M7 7h1M11.5 7h1M16 7h1"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="color-scheme:light dark"
|
|
2
|
+
fill="none" stroke="ButtonText" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<rect x="5" y="5" width="14" height="16" rx="2"/><rect x="9" y="3" width="6" height="4" rx="1"/><path d="M9 12h6m-6 4h5"/>
|
|
4
|
+
</svg>
|