@gramlot/gramlot 0.3.40 → 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.
Files changed (279) hide show
  1. package/assets/icons/applications.svg +4 -0
  2. package/assets/icons/archive.svg +4 -0
  3. package/assets/icons/attachment.svg +4 -0
  4. package/assets/icons/book.svg +4 -0
  5. package/assets/icons/bookmark.svg +4 -0
  6. package/assets/icons/calendar.svg +4 -0
  7. package/assets/icons/cancel.svg +4 -0
  8. package/assets/icons/chart.svg +4 -1
  9. package/assets/icons/chat.svg +4 -0
  10. package/assets/icons/clock.svg +4 -0
  11. package/assets/icons/code.svg +4 -0
  12. package/assets/icons/collapse.svg +4 -0
  13. package/assets/icons/columns.svg +4 -0
  14. package/assets/icons/confirm.svg +4 -0
  15. package/assets/icons/copy.svg +4 -0
  16. package/assets/icons/cut.svg +4 -0
  17. package/assets/icons/database.svg +4 -0
  18. package/assets/icons/delete.svg +4 -0
  19. package/assets/icons/detach.svg +4 -0
  20. package/assets/icons/document.svg +4 -0
  21. package/assets/icons/download.svg +4 -0
  22. package/assets/icons/duplicate.svg +4 -0
  23. package/assets/icons/edit.svg +4 -0
  24. package/assets/icons/expand.svg +4 -0
  25. package/assets/icons/export.svg +4 -0
  26. package/assets/icons/eye.svg +4 -0
  27. package/assets/icons/filter.svg +4 -0
  28. package/assets/icons/first.svg +4 -0
  29. package/assets/icons/folder.svg +4 -0
  30. package/assets/icons/group.svg +4 -0
  31. package/assets/icons/help.svg +4 -0
  32. package/assets/icons/home.svg +4 -0
  33. package/assets/icons/import.svg +4 -0
  34. package/assets/icons/info.svg +4 -0
  35. package/assets/icons/inspector.svg +4 -0
  36. package/assets/icons/last.svg +4 -0
  37. package/assets/icons/layers.svg +4 -0
  38. package/assets/icons/link.svg +4 -0
  39. package/assets/icons/list.svg +4 -0
  40. package/assets/icons/lock.svg +4 -0
  41. package/assets/icons/logout.svg +4 -0
  42. package/assets/icons/navigation.svg +4 -0
  43. package/assets/icons/new.svg +4 -0
  44. package/assets/icons/next.svg +4 -0
  45. package/assets/icons/open.svg +4 -0
  46. package/assets/icons/palette.svg +4 -0
  47. package/assets/icons/panel-bottom.svg +4 -0
  48. package/assets/icons/panel-left.svg +4 -0
  49. package/assets/icons/panel-right.svg +4 -0
  50. package/assets/icons/panel-top.svg +4 -0
  51. package/assets/icons/paste.svg +4 -0
  52. package/assets/icons/pause.svg +4 -0
  53. package/assets/icons/pin.svg +4 -0
  54. package/assets/icons/play.svg +4 -0
  55. package/assets/icons/previous.svg +4 -0
  56. package/assets/icons/print.svg +4 -0
  57. package/assets/icons/redo.svg +4 -0
  58. package/assets/icons/refresh.svg +4 -0
  59. package/assets/icons/save.svg +4 -0
  60. package/assets/icons/search.svg +4 -0
  61. package/assets/icons/send.svg +4 -0
  62. package/assets/icons/settings.svg +4 -0
  63. package/assets/icons/sort-ascending.svg +4 -0
  64. package/assets/icons/sort-descending.svg +4 -0
  65. package/assets/icons/stop.svg +4 -0
  66. package/assets/icons/table.svg +4 -0
  67. package/assets/icons/tree.svg +4 -0
  68. package/assets/icons/undo.svg +4 -0
  69. package/assets/icons/unlock.svg +4 -0
  70. package/assets/icons/upload.svg +4 -0
  71. package/assets/icons/user.svg +4 -0
  72. package/assets/icons/warning.svg +4 -0
  73. package/assets/icons/zoom-in.svg +4 -0
  74. package/assets/icons/zoom-out.svg +4 -0
  75. package/dist/components/charts/__init__.py +1 -1
  76. package/dist/components/charts/assets/index.js +1 -1
  77. package/dist/components/charts/assets/libraries/vega.js +11 -11
  78. package/dist/components/editors/__init__.py +1 -1
  79. package/dist/components/editors/assets/index.js +1 -1
  80. package/dist/components/editors/assets/libraries/codemirror.js +30 -31
  81. package/dist/components/editors/assets/libraries/jodit.js +3 -1
  82. package/dist/components/editors/assets/libraries/prosemirror.js +1 -1
  83. package/dist/components/editors/grammar.json +6 -1
  84. package/dist/components/grid/__init__.py +1 -1
  85. package/dist/components/grid/assets/index.js +1 -1
  86. package/dist/components/grid/commands.json +4 -6
  87. package/dist/components/grid/grammar.json +51 -0
  88. package/dist/components/inputs/__init__.py +1 -1
  89. package/dist/components/inputs/assets/index.js +1 -1
  90. package/dist/components/inputs/grammar.json +4987 -216
  91. package/dist/components/layout/__init__.py +1 -1
  92. package/dist/components/layout/assets/index.js +1 -1
  93. package/dist/components/layout/grammar.json +69 -4
  94. package/dist/components/tree/__init__.py +1 -1
  95. package/dist/components/tree/assets/index.js +1 -1
  96. package/dist/components/tree/grammar.json +16 -0
  97. package/dist/components/typst/__init__.py +1 -1
  98. package/dist/components/typst/assets/collection.js +6 -6
  99. package/dist/components/typst/assets/index.js +1 -1
  100. package/dist/components/uploads/__init__.py +1 -1
  101. package/dist/components/uploads/assets/index.js +1 -1
  102. package/dist/components/uploads/grammar.json +66 -0
  103. package/dist/declared-collections.js +1 -1
  104. package/dist/gramlot.js +4007 -1256
  105. package/dist/gramlot.min.js +329 -131
  106. package/dist/libraries.json +1 -0
  107. package/dist/standard-collections.js +1 -1
  108. package/dist/standard-grammar.js +1 -1
  109. package/package.json +3 -1
  110. package/src/binding/ask-dialog.js +17 -3
  111. package/src/binding/data-binder.js +5 -0
  112. package/src/binding/providers.js +1 -1
  113. package/src/binding/runtime.js +6 -3
  114. package/src/builder/chart-icon.js +2 -0
  115. package/src/builder/gramlot-builder.d.ts +3 -1
  116. package/src/builder/gramlot-builder.js +26 -9
  117. package/src/builder/source.js +12 -3
  118. package/src/builder/xml-recipe.js +144 -0
  119. package/src/chat-file-types.js +13 -0
  120. package/src/chat.js +23 -25
  121. package/src/commands.d.ts +1 -1
  122. package/src/commands.js +1 -1
  123. package/src/components/border-container.js +64 -6
  124. package/src/components/buttons.js +26 -31
  125. package/src/components/chart-geographic-options.js +1 -1
  126. package/src/components/chart-pane.js +5 -5
  127. package/src/components/chart-spatial-options.js +5 -1
  128. package/src/components/check-box-text-editor.js +1 -0
  129. package/src/components/check-box-text.js +2 -0
  130. package/src/components/choice-editor.js +3 -2
  131. package/src/components/choice-field-styles.js +9 -1
  132. package/src/components/code-mirror-engine.js +18 -5
  133. package/src/components/code-mirror-gramlot.js +85 -0
  134. package/src/components/code-mirror.js +3 -2
  135. package/src/components/drawing.js +43 -14
  136. package/src/components/editor-options.js +1 -1
  137. package/src/components/graphical-ranges.js +177 -0
  138. package/src/components/grid-footer.js +6 -1
  139. package/src/components/grid-styles.js +11 -2
  140. package/src/components/grid-tools.js +15 -7
  141. package/src/components/grid.js +69 -8
  142. package/src/components/inputs.js +93 -23
  143. package/src/components/jodit-engine.js +3 -1
  144. package/src/components/menus.js +83 -25
  145. package/src/components/numeric-range.js +39 -0
  146. package/src/components/selected-container.js +109 -63
  147. package/src/components/tab-bar.js +371 -0
  148. package/src/components/toolbar-icon-style.js +22 -0
  149. package/src/components/toolbar-overflow.js +74 -12
  150. package/src/components/tree.js +12 -3
  151. package/src/components/typst-preview.js +3 -3
  152. package/src/components/upload-blocks.js +88 -0
  153. package/src/components/upload-engine.js +21 -31
  154. package/src/components/uploader.js +168 -47
  155. package/src/gramlot.js +6 -3
  156. package/src/handlers/dom-handler.d.ts +2 -0
  157. package/src/handlers/dom-handler.js +9 -0
  158. package/src/handlers/rpc-handler.d.ts +1 -1
  159. package/src/handlers/rpc-handler.js +2 -0
  160. package/src/handlers/source-handler.d.ts +5 -3
  161. package/src/handlers/source-handler.js +31 -13
  162. package/src/icons.js +84 -0
  163. package/src/index-page-runtime.js +9 -2
  164. package/src/index-page-styles.js +1 -1
  165. package/src/index-theme.js +210 -3
  166. package/src/index.d.ts +5 -1
  167. package/src/index.js +5 -1
  168. package/src/libraries.js +1 -1
  169. package/src/page-store-connection.js +44 -7
  170. package/src/renderer/gramlot-renderer.js +4 -1
  171. package/src/server/chat-attachments.js +139 -0
  172. package/src/server/chat.d.ts +31 -0
  173. package/src/server/chat.js +157 -0
  174. package/src/server/database-selectors.d.ts +6 -0
  175. package/src/server/database-selectors.js +13 -0
  176. package/src/server/gramlot-file-server.js +6 -1
  177. package/src/server/gramlot-server.d.ts +19 -3
  178. package/src/server/gramlot-server.js +144 -18
  179. package/src/server/index-page.d.ts +10 -0
  180. package/src/server/index-page.js +73 -8
  181. package/src/server/index.d.ts +1 -1
  182. package/src/server/index.js +1 -1
  183. package/src/server/page-base.js +4 -0
  184. package/src/server/page-store.d.ts +21 -0
  185. package/src/server/page-store.js +219 -0
  186. package/src/server/page.d.ts +6 -1
  187. package/src/server/page.js +5 -1
  188. package/src/server/store-recipe.js +102 -0
  189. package/src/server/toolbar-icon-name.d.ts +76 -0
  190. package/src/server/upload.d.ts +2 -0
  191. package/src/server/upload.js +36 -18
  192. package/src/server/visual-editor.js +4 -2
  193. package/src/tree-store.d.ts +5 -1
  194. package/src/tree-store.js +11 -2
  195. package/src/view/choice-focus.js +17 -0
  196. package/src/view/html.js +21 -1
  197. package/src/view/menu.js +9 -3
  198. package/src/visual-editor.js +6 -2
  199. package/themes/gramlot-base/theme.css +53 -28
  200. package/themes/gramlot-compact/theme.css +2 -0
  201. package/themes/gramlot-index/icons/applications.svg +4 -0
  202. package/themes/gramlot-index/icons/archive.svg +4 -0
  203. package/themes/gramlot-index/icons/attachment.svg +4 -0
  204. package/themes/gramlot-index/icons/book.svg +4 -0
  205. package/themes/gramlot-index/icons/bookmark.svg +4 -0
  206. package/themes/gramlot-index/icons/calendar.svg +4 -0
  207. package/themes/gramlot-index/icons/cancel.svg +4 -0
  208. package/themes/gramlot-index/icons/chart.svg +4 -0
  209. package/themes/gramlot-index/icons/chat.svg +4 -0
  210. package/themes/gramlot-index/icons/clock.svg +4 -0
  211. package/themes/gramlot-index/icons/code.svg +4 -0
  212. package/themes/gramlot-index/icons/collapse.svg +4 -0
  213. package/themes/gramlot-index/icons/columns.svg +4 -0
  214. package/themes/gramlot-index/icons/confirm.svg +4 -0
  215. package/themes/gramlot-index/icons/copy.svg +4 -0
  216. package/themes/gramlot-index/icons/cut.svg +4 -0
  217. package/themes/gramlot-index/icons/database.svg +4 -0
  218. package/themes/gramlot-index/icons/delete.svg +4 -0
  219. package/themes/gramlot-index/icons/detach.svg +4 -0
  220. package/themes/gramlot-index/icons/document.svg +4 -0
  221. package/themes/gramlot-index/icons/download.svg +4 -0
  222. package/themes/gramlot-index/icons/duplicate.svg +4 -0
  223. package/themes/gramlot-index/icons/edit.svg +4 -0
  224. package/themes/gramlot-index/icons/expand.svg +4 -0
  225. package/themes/gramlot-index/icons/export.svg +4 -0
  226. package/themes/gramlot-index/icons/eye.svg +4 -0
  227. package/themes/gramlot-index/icons/filter.svg +4 -0
  228. package/themes/gramlot-index/icons/first.svg +4 -0
  229. package/themes/gramlot-index/icons/folder.svg +4 -0
  230. package/themes/gramlot-index/icons/group.svg +4 -0
  231. package/themes/gramlot-index/icons/help.svg +4 -0
  232. package/themes/gramlot-index/icons/home.svg +4 -0
  233. package/themes/gramlot-index/icons/import.svg +4 -0
  234. package/themes/gramlot-index/icons/info.svg +4 -0
  235. package/themes/gramlot-index/icons/inspector.svg +4 -0
  236. package/themes/gramlot-index/icons/last.svg +4 -0
  237. package/themes/gramlot-index/icons/layers.svg +4 -0
  238. package/themes/gramlot-index/icons/link.svg +4 -0
  239. package/themes/gramlot-index/icons/list.svg +4 -0
  240. package/themes/gramlot-index/icons/lock.svg +4 -0
  241. package/themes/gramlot-index/icons/logout.svg +4 -0
  242. package/themes/gramlot-index/icons/navigation.svg +4 -0
  243. package/themes/gramlot-index/icons/new.svg +4 -0
  244. package/themes/gramlot-index/icons/next.svg +4 -0
  245. package/themes/gramlot-index/icons/open.svg +4 -0
  246. package/themes/gramlot-index/icons/palette.svg +4 -0
  247. package/themes/gramlot-index/icons/panel-bottom.svg +4 -0
  248. package/themes/gramlot-index/icons/panel-left.svg +4 -0
  249. package/themes/gramlot-index/icons/panel-right.svg +4 -0
  250. package/themes/gramlot-index/icons/panel-top.svg +4 -0
  251. package/themes/gramlot-index/icons/paste.svg +4 -0
  252. package/themes/gramlot-index/icons/pause.svg +4 -0
  253. package/themes/gramlot-index/icons/pin.svg +4 -0
  254. package/themes/gramlot-index/icons/play.svg +4 -0
  255. package/themes/gramlot-index/icons/previous.svg +4 -0
  256. package/themes/gramlot-index/icons/print.svg +4 -0
  257. package/themes/gramlot-index/icons/redo.svg +4 -0
  258. package/themes/gramlot-index/icons/refresh.svg +4 -0
  259. package/themes/gramlot-index/icons/save.svg +4 -0
  260. package/themes/gramlot-index/icons/search.svg +4 -0
  261. package/themes/gramlot-index/icons/send.svg +4 -0
  262. package/themes/gramlot-index/icons/settings.svg +4 -0
  263. package/themes/gramlot-index/icons/sort-ascending.svg +4 -0
  264. package/themes/gramlot-index/icons/sort-descending.svg +4 -0
  265. package/themes/gramlot-index/icons/stop.svg +4 -0
  266. package/themes/gramlot-index/icons/table.svg +4 -0
  267. package/themes/gramlot-index/icons/tree.svg +4 -0
  268. package/themes/gramlot-index/icons/undo.svg +4 -0
  269. package/themes/gramlot-index/icons/unlock.svg +4 -0
  270. package/themes/gramlot-index/icons/upload.svg +4 -0
  271. package/themes/gramlot-index/icons/user.svg +4 -0
  272. package/themes/gramlot-index/icons/warning.svg +4 -0
  273. package/themes/gramlot-index/icons/zoom-in.svg +4 -0
  274. package/themes/gramlot-index/icons/zoom-out.svg +4 -0
  275. package/themes/gramlot-index/icons.json +76 -0
  276. package/themes/gramlot-index/theme.css +21 -0
  277. package/themes/joanna/theme.css +2 -0
  278. package/themes/mela/theme.css +2 -0
  279. 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:fc6c7e941438b2dc70fc3c770d30bd1bd9b73d06daaa5dea653c8c9a65a14569",
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:fc6c7e941438b2dc70fc3c770d30bd1bd9b73d06daaa5dea653c8c9a65a14569";
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:0b854e86108d986de53e341fd239f8fe7e33ad40ce10c66c863b708ed37c8642",
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:0b854e86108d986de53e341fd239f8fe7e33ad40ce10c66c863b708ed37c8642";
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:208796220cf159dbb00d9c6b10bcc05e914c6b3b2a039cfe547b8f77ec4afd26",
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 w=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var v=(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 w(e))!b.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={};v(r,{defineCollection:()=>d});l(r,U);import*as U from"@gramlot/gramlot/components";import{defineCollection as x}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 x({...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 j(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)}
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-brand-blue,LinkText);border-radius:var(--gramlot-radius-sm,4px);padding:4px 8px;text-decoration:none;white-space:nowrap}
5
- a:hover{background:var(--gramlot-selected-background,Highlight)}
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"})),c=a.createObjectURL(new o([i.pdf],{type:"application/pdf"}));this.#a=[n,c],this.image.src=n,this.image.hidden=!1,this.download.href=c,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 h=(0,r.defineComponent)({name:"typstPreview",tag:"gramlot-typst-preview",base:j,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:[h]});export{h as TypstPreview,G as default};
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:208796220cf159dbb00d9c6b10bcc05e914c6b3b2a039cfe547b8f77ec4afd26";
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:0adc07087b0ce4fbff9b072214a47a964fec7755c893d779cea37ad02828ce25",
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:0adc07087b0ce4fbff9b072214a47a964fec7755c893d779cea37ad02828ce25";
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:208796220cf159dbb00d9c6b10bcc05e914c6b3b2a039cfe547b8f77ec4afd26","module":"/gramlot/collections/typst/208796220cf159dbb00d9c6b10bcc05e914c6b3b2a039cfe547b8f77ec4afd26/assets/index.js","dependencies":[],"css":[],"libraries":{"typst":"/gramlot/collections/typst/208796220cf159dbb00d9c6b10bcc05e914c6b3b2a039cfe547b8f77ec4afd26/assets/libraries/typst.js"}}];
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"}}];