@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
|
@@ -8,6 +8,6 @@ mygramlot = GramlotCollection(
|
|
|
8
8
|
module="assets/index.js",
|
|
9
9
|
css=(),
|
|
10
10
|
dependencies=(),
|
|
11
|
-
build_id="sha256:
|
|
11
|
+
build_id="sha256:2a19bf7e819bc820bed577d2767ab041714e42764ad270404514fa6192ecc74a",
|
|
12
12
|
files=("assets/collection.js", "assets/index.js", "commands.json", "grammar.json",),
|
|
13
13
|
)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export {default} from "./collection.js";
|
|
2
2
|
export * from "./collection.js";
|
|
3
|
-
export const buildId = "sha256:
|
|
3
|
+
export const buildId = "sha256:2a19bf7e819bc820bed577d2767ab041714e42764ad270404514fa6192ecc74a";
|
|
@@ -1391,6 +1391,7 @@
|
|
|
1391
1391
|
},
|
|
1392
1392
|
"height": {},
|
|
1393
1393
|
"region": {
|
|
1394
|
+
"binding": "read",
|
|
1394
1395
|
"enum": [
|
|
1395
1396
|
"top",
|
|
1396
1397
|
"bottom",
|
|
@@ -1398,8 +1399,7 @@
|
|
|
1398
1399
|
"right",
|
|
1399
1400
|
"center"
|
|
1400
1401
|
],
|
|
1401
|
-
"required": true
|
|
1402
|
-
"unique": true
|
|
1402
|
+
"required": true
|
|
1403
1403
|
},
|
|
1404
1404
|
"title": {
|
|
1405
1405
|
"default": "",
|
|
@@ -1419,6 +1419,16 @@
|
|
|
1419
1419
|
"sidebar"
|
|
1420
1420
|
]
|
|
1421
1421
|
},
|
|
1422
|
+
"icon_color": {
|
|
1423
|
+
"binding": "read",
|
|
1424
|
+
"dtype": "T",
|
|
1425
|
+
"nullable": true
|
|
1426
|
+
},
|
|
1427
|
+
"icon_opacity": {
|
|
1428
|
+
"binding": "read",
|
|
1429
|
+
"dtype": "R",
|
|
1430
|
+
"nullable": true
|
|
1431
|
+
},
|
|
1422
1432
|
"persist": {
|
|
1423
1433
|
"binding": "read",
|
|
1424
1434
|
"default": false,
|
|
@@ -1474,6 +1484,60 @@
|
|
|
1474
1484
|
"name": "persist",
|
|
1475
1485
|
"role": "attribute"
|
|
1476
1486
|
},
|
|
1487
|
+
{
|
|
1488
|
+
"annotation": {
|
|
1489
|
+
"items": [
|
|
1490
|
+
{
|
|
1491
|
+
"dtype": "T",
|
|
1492
|
+
"kind": "dtype"
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
"dtype": "NN",
|
|
1496
|
+
"kind": "dtype"
|
|
1497
|
+
}
|
|
1498
|
+
],
|
|
1499
|
+
"kind": "union"
|
|
1500
|
+
},
|
|
1501
|
+
"default": null,
|
|
1502
|
+
"has_default": true,
|
|
1503
|
+
"kind": "keyword_only",
|
|
1504
|
+
"name": "icon_color",
|
|
1505
|
+
"role": "attribute"
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
"annotation": {
|
|
1509
|
+
"items": [
|
|
1510
|
+
{
|
|
1511
|
+
"dtype": "R",
|
|
1512
|
+
"kind": "dtype"
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
"dtype": "NN",
|
|
1516
|
+
"kind": "dtype"
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
"base": {
|
|
1520
|
+
"dtype": "T",
|
|
1521
|
+
"kind": "dtype"
|
|
1522
|
+
},
|
|
1523
|
+
"kind": "annotated",
|
|
1524
|
+
"metadata": [
|
|
1525
|
+
{
|
|
1526
|
+
"flags": 0,
|
|
1527
|
+
"kind": "regex",
|
|
1528
|
+
"pattern": "^[\\^=].+"
|
|
1529
|
+
}
|
|
1530
|
+
]
|
|
1531
|
+
}
|
|
1532
|
+
],
|
|
1533
|
+
"kind": "union"
|
|
1534
|
+
},
|
|
1535
|
+
"default": null,
|
|
1536
|
+
"has_default": true,
|
|
1537
|
+
"kind": "keyword_only",
|
|
1538
|
+
"name": "icon_opacity",
|
|
1539
|
+
"role": "attribute"
|
|
1540
|
+
},
|
|
1477
1541
|
{
|
|
1478
1542
|
"annotation": {
|
|
1479
1543
|
"kind": "any"
|
|
@@ -1491,7 +1555,7 @@
|
|
|
1491
1555
|
"node_label": null,
|
|
1492
1556
|
"ns": null,
|
|
1493
1557
|
"parent_tags": null,
|
|
1494
|
-
"sub_tags": "contentPane"
|
|
1558
|
+
"sub_tags": "contentPane,menu"
|
|
1495
1559
|
},
|
|
1496
1560
|
"groupBox": {
|
|
1497
1561
|
"_meta": {
|
|
@@ -1853,7 +1917,8 @@
|
|
|
1853
1917
|
"dtype": "T",
|
|
1854
1918
|
"enum": [
|
|
1855
1919
|
"tabs",
|
|
1856
|
-
"underline"
|
|
1920
|
+
"underline",
|
|
1921
|
+
"tabBar"
|
|
1857
1922
|
]
|
|
1858
1923
|
},
|
|
1859
1924
|
"tabPosition": {
|
|
@@ -8,6 +8,6 @@ mygramlot = GramlotCollection(
|
|
|
8
8
|
module="assets/index.js",
|
|
9
9
|
css=(),
|
|
10
10
|
dependencies=(),
|
|
11
|
-
build_id="sha256:
|
|
11
|
+
build_id="sha256:9d46e94d4c5b753bac291c82e897edaf311eaed570d4767a9cf59778848347b4",
|
|
12
12
|
files=("assets/collection.js", "assets/index.js", "commands.json", "grammar.json",),
|
|
13
13
|
)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export {default} from "./collection.js";
|
|
2
2
|
export * from "./collection.js";
|
|
3
|
-
export const buildId = "sha256:
|
|
3
|
+
export const buildId = "sha256:9d46e94d4c5b753bac291c82e897edaf311eaed570d4767a9cf59778848347b4";
|
|
@@ -189,6 +189,11 @@
|
|
|
189
189
|
"default": false,
|
|
190
190
|
"dtype": "B"
|
|
191
191
|
},
|
|
192
|
+
"icon": {
|
|
193
|
+
"binding": "read",
|
|
194
|
+
"default": "",
|
|
195
|
+
"dtype": "T"
|
|
196
|
+
},
|
|
192
197
|
"internalNames": {
|
|
193
198
|
"binding": "read",
|
|
194
199
|
"default": false,
|
|
@@ -498,6 +503,17 @@
|
|
|
498
503
|
"name": "getLabelClass",
|
|
499
504
|
"role": "attribute"
|
|
500
505
|
},
|
|
506
|
+
{
|
|
507
|
+
"annotation": {
|
|
508
|
+
"dtype": "T",
|
|
509
|
+
"kind": "dtype"
|
|
510
|
+
},
|
|
511
|
+
"default": "",
|
|
512
|
+
"has_default": true,
|
|
513
|
+
"kind": "keyword_only",
|
|
514
|
+
"name": "icon",
|
|
515
|
+
"role": "attribute"
|
|
516
|
+
},
|
|
501
517
|
{
|
|
502
518
|
"annotation": {
|
|
503
519
|
"items": [
|
|
@@ -8,6 +8,6 @@ mygramlot = GramlotCollection(
|
|
|
8
8
|
module="assets/index.js",
|
|
9
9
|
css=(),
|
|
10
10
|
dependencies=(),
|
|
11
|
-
build_id="sha256:
|
|
11
|
+
build_id="sha256:9c05d1b4385a181deb6112617bb62fa8d667dfaa95b4317d5a3184f27852617b",
|
|
12
12
|
files=("assets/collection.js", "assets/index.js", "assets/libraries/typst.js", "commands.json", "grammar.json",),
|
|
13
13
|
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var x=(s,e)=>{for(var t in e)m(s,t,{get:e[t],enumerable:!0})},p=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!w.call(s,a)&&a!==t&&m(s,a,{get:()=>e[a],enumerable:!(i=g(e,a))||i.enumerable});return s},l=(s,e,t)=>(p(s,e,"default"),t&&p(t,e,"default"));var r={};x(r,{defineCollection:()=>d});l(r,U);import*as U from"@gramlot/gramlot/components";import{defineCollection as b}from"@gramlot/gramlot/components";function d(s){if(s.name!=="typst")throw new Error("Unexpected bundled collection");let e=[],t={};s.css?.forEach((i,a)=>{i.href=e[a].href});for(let[i,a]of Object.entries(s.assets??{}))a.href=t[i].href;return b({...s,css:e,assets:t})}import{sharedModules as y}from"@gramlot/gramlot";var C=s=>y["./libraries.js"][s];var u=C("loadLibrary");import{sharedModules as k}from"@gramlot/gramlot";var P=s=>k["./components/parameters.js"][s];var f=P("projectParameters");function T(s){return class extends s{#e=0;#s;#t;#n;#i=!1;#a=[];constructor(){super();let e=this.attachShadow({mode:"open"}),t=this.ownerDocument,i=t.createElement("style");i.textContent=`:host{display:block;height:100%;min-height:0;color:var(--gramlot-ink,CanvasText)}
|
|
2
2
|
.preview{display:flex;flex-direction:column;height:100%;background:var(--gramlot-surface-subtle,Canvas)}
|
|
3
|
-
.tools{display:flex;gap:16px;align-items:center;padding:8px 12px;font:inherit}
|
|
4
|
-
a{color:var(--gramlot-
|
|
5
|
-
a:hover{background:var(--gramlot-selected
|
|
3
|
+
.tools{display:flex;gap:16px;align-items:center;padding:8px 12px;font:inherit;background:var(--gramlot-surface,Canvas)}
|
|
4
|
+
a{color:var(--gramlot-action,LinkText);border-radius:var(--gramlot-radius-sm,4px);padding:4px 8px;text-decoration:underline;white-space:nowrap}
|
|
5
|
+
a[href]:hover{color:var(--gramlot-action-hover,LinkText);background:var(--gramlot-selected,Canvas)}
|
|
6
6
|
a:focus-visible{outline:2px solid var(--gramlot-focus-ring,Highlight)}
|
|
7
7
|
a[aria-disabled=true]{opacity:.45;pointer-events:none}
|
|
8
8
|
.status{white-space:pre-wrap;font-size:.9em;overflow:auto;max-height:8em}
|
|
9
9
|
.pages{flex:1;min-height:0;overflow:auto;padding:16px}
|
|
10
10
|
img{display:block;width:100%;height:auto;background:white;box-shadow:0 2px 10px #0002}
|
|
11
|
-
img[hidden]{display:none}`;let a=t.createElement("div");a.className="preview";let o=t.createElement("div");o.className="tools",this.download=t.createElement("a"),this.download.textContent="Download PDF",this.status=t.createElement("span"),this.status.className="status",this.status.setAttribute("role","status");let n=t.createElement("div");n.className="pages",this.image=t.createElement("img"),this.image.alt="Typst document preview",this.image.hidden=!0,n.append(this.image),o.append(this.download,this.status),a.append(o,n),e.append(i,a),this.#r()}#r(){this.download.removeAttribute("href"),this.download.setAttribute("aria-disabled","true"),this.download.tabIndex=-1,this.image.hidden=!0,this.image.removeAttribute("src");for(let e of this.#a)this.ownerDocument.defaultView.URL.revokeObjectURL(e);this.#a=[]}connectedCallback(){this.#o()}disconnectedCallback(){++this.#e,clearTimeout(this.#s),this.#t?.release(),this.#t=null,this.#r()}projectAttributes(e){let t=this.parameters?.value,i=f(this,e);return this.download.download=this.parameters.filename,t!==this.parameters.value&&(++this.#e,this.#r(),this.#o()),i}#o(){clearTimeout(this.#s),!(!this.isConnected||!this.parameters)&&(this.status.textContent="Preparing preview\u2026",this.#s=setTimeout(()=>{this.ready=this.#l()},350))}async#l(){if(this.#i)return;let e=this.#e;this.#i=!0;try{this.#n??=u("typst",this.ownerDocument,()=>import("@gramlot/libraries/typst"));let t=await this.#n;if(!this.isConnected||e!==this.#e)return;this.#t??=t.acquireCompiler(),this.status.textContent="Compiling\u2026";let i=await this.#t.compile(this.parameters.value);if(!this.isConnected||e!==this.#e)return;let{URL:a,Blob:o}=this.ownerDocument.defaultView,n=a.createObjectURL(new o([i.svg],{type:"image/svg+xml"})),
|
|
12
|
-
`):"Preview and PDF are up to date"}catch(t){this.isConnected&&e===this.#e&&(this.status.textContent=t.message)}finally{this.#i=!1,this.isConnected&&e!==this.#e&&this.#o()}}}}var
|
|
11
|
+
img[hidden]{display:none}`;let a=t.createElement("div");a.className="preview";let o=t.createElement("div");o.className="tools",this.download=t.createElement("a"),this.download.textContent="Download PDF",this.status=t.createElement("span"),this.status.className="status",this.status.setAttribute("role","status");let n=t.createElement("div");n.className="pages",this.image=t.createElement("img"),this.image.alt="Typst document preview",this.image.hidden=!0,n.append(this.image),o.append(this.download,this.status),a.append(o,n),e.append(i,a),this.#r()}#r(){this.download.removeAttribute("href"),this.download.setAttribute("aria-disabled","true"),this.download.tabIndex=-1,this.image.hidden=!0,this.image.removeAttribute("src");for(let e of this.#a)this.ownerDocument.defaultView.URL.revokeObjectURL(e);this.#a=[]}connectedCallback(){this.#o()}disconnectedCallback(){++this.#e,clearTimeout(this.#s),this.#t?.release(),this.#t=null,this.#r()}projectAttributes(e){let t=this.parameters?.value,i=f(this,e);return this.download.download=this.parameters.filename,t!==this.parameters.value&&(++this.#e,this.#r(),this.#o()),i}#o(){clearTimeout(this.#s),!(!this.isConnected||!this.parameters)&&(this.status.textContent="Preparing preview\u2026",this.#s=setTimeout(()=>{this.ready=this.#l()},350))}async#l(){if(this.#i)return;let e=this.#e;this.#i=!0;try{this.#n??=u("typst",this.ownerDocument,()=>import("@gramlot/libraries/typst"));let t=await this.#n;if(!this.isConnected||e!==this.#e)return;this.#t??=t.acquireCompiler(),this.status.textContent="Compiling\u2026";let i=await this.#t.compile(this.parameters.value);if(!this.isConnected||e!==this.#e)return;let{URL:a,Blob:o}=this.ownerDocument.defaultView,n=a.createObjectURL(new o([i.svg],{type:"image/svg+xml"})),h=a.createObjectURL(new o([i.pdf],{type:"application/pdf"}));this.#a=[n,h],this.image.src=n,this.image.hidden=!1,this.download.href=h,this.download.setAttribute("aria-disabled","false"),this.download.tabIndex=0,this.status.textContent=i.diagnostics.length?i.diagnostics.join(`
|
|
12
|
+
`):"Preview and PDF are up to date"}catch(t){this.isConnected&&e===this.#e&&(this.status.textContent=t.message)}finally{this.#i=!1,this.isConnected&&e!==this.#e&&this.#o()}}}}var c=(0,r.defineComponent)({name:"typstPreview",tag:"gramlot-typst-preview",base:T,parameters:{value:{dtype:"T",default:"",binding:"read"},filename:{dtype:"T",default:"document.pdf",binding:"read"}},implementation:s=>class extends s{}});var G=d({name:"typst",components:[c]});export{c as TypstPreview,G as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export {default} from "./collection.js";
|
|
2
2
|
export * from "./collection.js";
|
|
3
|
-
export const buildId = "sha256:
|
|
3
|
+
export const buildId = "sha256:9c05d1b4385a181deb6112617bb62fa8d667dfaa95b4317d5a3184f27852617b";
|
|
@@ -8,6 +8,6 @@ mygramlot = GramlotCollection(
|
|
|
8
8
|
module="assets/index.js",
|
|
9
9
|
css=(),
|
|
10
10
|
dependencies=(),
|
|
11
|
-
build_id="sha256:
|
|
11
|
+
build_id="sha256:de7ac7dd67fae01d46063764b3b9729277a131004f153f31471b5cc5c70802d6",
|
|
12
12
|
files=("assets/collection.js", "assets/index.js", "commands.json", "grammar.json",),
|
|
13
13
|
)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export {default} from "./collection.js";
|
|
2
2
|
export * from "./collection.js";
|
|
3
|
-
export const buildId = "sha256:
|
|
3
|
+
export const buildId = "sha256:de7ac7dd67fae01d46063764b3b9729277a131004f153f31471b5cc5c70802d6";
|
|
@@ -512,6 +512,12 @@
|
|
|
512
512
|
"default": true,
|
|
513
513
|
"dtype": "B"
|
|
514
514
|
},
|
|
515
|
+
"caption": {
|
|
516
|
+
"binding": "read",
|
|
517
|
+
"default": null,
|
|
518
|
+
"dtype": "T",
|
|
519
|
+
"nullable": true
|
|
520
|
+
},
|
|
515
521
|
"contextPath": {
|
|
516
522
|
"default": null,
|
|
517
523
|
"dtype": "T",
|
|
@@ -527,6 +533,12 @@
|
|
|
527
533
|
"default": true,
|
|
528
534
|
"dtype": "B"
|
|
529
535
|
},
|
|
536
|
+
"maxBytes": {
|
|
537
|
+
"binding": "read",
|
|
538
|
+
"default": null,
|
|
539
|
+
"dtype": "L",
|
|
540
|
+
"nullable": true
|
|
541
|
+
},
|
|
530
542
|
"multiple": {
|
|
531
543
|
"binding": "read",
|
|
532
544
|
"default": false,
|
|
@@ -772,6 +784,60 @@
|
|
|
772
784
|
"name": "onComplete",
|
|
773
785
|
"role": "attribute"
|
|
774
786
|
},
|
|
787
|
+
{
|
|
788
|
+
"annotation": {
|
|
789
|
+
"items": [
|
|
790
|
+
{
|
|
791
|
+
"dtype": "T",
|
|
792
|
+
"kind": "dtype"
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
"dtype": "NN",
|
|
796
|
+
"kind": "dtype"
|
|
797
|
+
}
|
|
798
|
+
],
|
|
799
|
+
"kind": "union"
|
|
800
|
+
},
|
|
801
|
+
"default": null,
|
|
802
|
+
"has_default": true,
|
|
803
|
+
"kind": "keyword_only",
|
|
804
|
+
"name": "caption",
|
|
805
|
+
"role": "attribute"
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"annotation": {
|
|
809
|
+
"items": [
|
|
810
|
+
{
|
|
811
|
+
"dtype": "L",
|
|
812
|
+
"kind": "dtype"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"dtype": "NN",
|
|
816
|
+
"kind": "dtype"
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
"base": {
|
|
820
|
+
"dtype": "T",
|
|
821
|
+
"kind": "dtype"
|
|
822
|
+
},
|
|
823
|
+
"kind": "annotated",
|
|
824
|
+
"metadata": [
|
|
825
|
+
{
|
|
826
|
+
"flags": 0,
|
|
827
|
+
"kind": "regex",
|
|
828
|
+
"pattern": "^[\\^=].+"
|
|
829
|
+
}
|
|
830
|
+
]
|
|
831
|
+
}
|
|
832
|
+
],
|
|
833
|
+
"kind": "union"
|
|
834
|
+
},
|
|
835
|
+
"default": null,
|
|
836
|
+
"has_default": true,
|
|
837
|
+
"kind": "keyword_only",
|
|
838
|
+
"name": "maxBytes",
|
|
839
|
+
"role": "attribute"
|
|
840
|
+
},
|
|
775
841
|
{
|
|
776
842
|
"annotation": {
|
|
777
843
|
"kind": "any"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated from the shipped collection inventory; do not edit.
|
|
2
|
-
export const declaredCollections = [{"name":"typst","grammar":{"abstracts":{},"document_format":{"name":"builder_grammar","version":"1.1"},"elements":{"typstPreview":{"_meta":{"gramlot_component":{"command":false,"dataScope":false,"parameters":{"filename":{"binding":"read","default":"document.pdf","dtype":"T"},"value":{"binding":"read","default":"","dtype":"T"}},"presentationDefaults":[]},"render_tag":"gramlot-typst-preview"},"attributes":{"accepts_var_keyword":true,"accepts_var_positional":false,"parameters":[{"annotation":{"dtype":"T","kind":"dtype"},"default":"","has_default":true,"kind":"keyword_only","name":"value","role":"attribute"},{"annotation":{"dtype":"T","kind":"dtype"},"default":"document.pdf","has_default":true,"kind":"keyword_only","name":"filename","role":"attribute"},{"annotation":{"kind":"any"},"has_default":false,"kind":"var_keyword","name":"attr","role":"attribute"}]},"collection_key":null,"doc":null,"inherits_from":null,"node_label":null,"ns":null,"parent_tags":null,"sub_tags":""}},"grammar":{"description":null,"name":"typst","title":"typst","version":null}},"buildId":"sha256:
|
|
2
|
+
export const declaredCollections = [{"name":"typst","grammar":{"abstracts":{},"document_format":{"name":"builder_grammar","version":"1.1"},"elements":{"typstPreview":{"_meta":{"gramlot_component":{"command":false,"dataScope":false,"parameters":{"filename":{"binding":"read","default":"document.pdf","dtype":"T"},"value":{"binding":"read","default":"","dtype":"T"}},"presentationDefaults":[]},"render_tag":"gramlot-typst-preview"},"attributes":{"accepts_var_keyword":true,"accepts_var_positional":false,"parameters":[{"annotation":{"dtype":"T","kind":"dtype"},"default":"","has_default":true,"kind":"keyword_only","name":"value","role":"attribute"},{"annotation":{"dtype":"T","kind":"dtype"},"default":"document.pdf","has_default":true,"kind":"keyword_only","name":"filename","role":"attribute"},{"annotation":{"kind":"any"},"has_default":false,"kind":"var_keyword","name":"attr","role":"attribute"}]},"collection_key":null,"doc":null,"inherits_from":null,"node_label":null,"ns":null,"parent_tags":null,"sub_tags":""}},"grammar":{"description":null,"name":"typst","title":"typst","version":null}},"buildId":"sha256:9c05d1b4385a181deb6112617bb62fa8d667dfaa95b4317d5a3184f27852617b","module":"/gramlot/collections/typst/9c05d1b4385a181deb6112617bb62fa8d667dfaa95b4317d5a3184f27852617b/assets/index.js","dependencies":[],"css":[],"libraries":{"typst":"/gramlot/collections/typst/9c05d1b4385a181deb6112617bb62fa8d667dfaa95b4317d5a3184f27852617b/assets/libraries/typst.js"}}];
|