@gramlot/gramlot 0.3.20 → 0.3.26

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 (172) hide show
  1. package/dist/components/chat/__init__.py +13 -0
  2. package/dist/components/chat/assets/collection.js +9 -0
  3. package/dist/components/chat/assets/index.js +3 -0
  4. package/dist/components/chat/commands.json +7 -0
  5. package/dist/components/chat/grammar.json +48 -0
  6. package/dist/components/editors/__init__.py +2 -2
  7. package/dist/components/editors/assets/collection.js +26 -120912
  8. package/dist/components/editors/assets/index.js +2 -1
  9. package/dist/components/editors/assets/modules/chunk-74O4WKIV.js +1 -0
  10. package/dist/components/editors/assets/modules/chunk-AU4HFPIY.js +1 -0
  11. package/dist/components/editors/assets/modules/chunk-YSGSC7KM.js +1 -0
  12. package/dist/components/editors/assets/modules/code-mirror-engine-RWQTR5G5.js +92 -0
  13. package/dist/components/editors/assets/modules/jodit-engine-MTSA4GZ3.js +1853 -0
  14. package/dist/components/editors/assets/modules/markdown-document-VFC23FAY.js +1 -0
  15. package/dist/components/editors/assets/modules/prose-mirror-engine-GMZPJPNN.js +24 -0
  16. package/dist/components/grid/__init__.py +14 -0
  17. package/dist/components/grid/assets/collection.js +262 -0
  18. package/dist/components/grid/assets/index.js +3 -0
  19. package/dist/components/grid/commands.json +7 -0
  20. package/dist/components/grid/grammar.json +770 -0
  21. package/dist/components/grouplets/__init__.py +13 -0
  22. package/dist/components/grouplets/assets/collection.js +185 -0
  23. package/dist/components/grouplets/assets/index.js +3 -0
  24. package/dist/components/grouplets/assets/modules/chunk-BLMUM44K.js +1 -0
  25. package/dist/components/grouplets/assets/modules/markdown-document-YWNZTOKK.js +1 -0
  26. package/dist/components/grouplets/commands.json +7 -0
  27. package/dist/components/grouplets/grammar.json +355 -0
  28. package/dist/components/inputs/__init__.py +1 -1
  29. package/dist/components/inputs/assets/collection.js +65 -24511
  30. package/dist/components/inputs/assets/index.js +2 -1
  31. package/dist/components/inputs/grammar.json +278 -6
  32. package/dist/components/layout/__init__.py +1 -1
  33. package/dist/components/layout/assets/collection.js +68 -26732
  34. package/dist/components/layout/assets/index.js +2 -1
  35. package/dist/components/layout/grammar.json +39 -0
  36. package/dist/components/selection_trial/__init__.py +13 -0
  37. package/dist/components/selection_trial/assets/collection.js +4 -0
  38. package/dist/components/selection_trial/assets/index.js +3 -0
  39. package/dist/components/selection_trial/commands.json +7 -0
  40. package/dist/components/selection_trial/grammar.json +587 -0
  41. package/dist/components/tree/__init__.py +1 -1
  42. package/dist/components/tree/assets/collection.js +27 -24612
  43. package/dist/components/tree/assets/index.js +2 -1
  44. package/dist/components/tree/grammar.json +341 -1
  45. package/dist/components/typst/__init__.py +2 -2
  46. package/dist/components/typst/assets/collection.js +12 -4
  47. package/dist/components/typst/assets/index.js +2 -1
  48. package/dist/components/typst/assets/modules/chunk-BLMUM44K.js +1 -0
  49. package/dist/components/typst/assets/modules/typst-client-JHC6UVYG.js +4 -0
  50. package/dist/components/uploads/__init__.py +13 -0
  51. package/dist/components/uploads/assets/collection.js +67 -0
  52. package/dist/components/uploads/assets/index.js +3 -0
  53. package/dist/components/uploads/commands.json +7 -0
  54. package/dist/components/uploads/grammar.json +789 -0
  55. package/dist/gramlot-markdown.js +16 -0
  56. package/dist/gramlot.js +6861 -1395
  57. package/dist/gramlot.min.js +1595 -46
  58. package/dist/runtime-notices.json +28 -0
  59. package/package.json +10 -3
  60. package/src/binding/grid-struct.js +63 -0
  61. package/src/binding/installation.js +5 -2
  62. package/src/binding/providers.js +4 -1
  63. package/src/binding/remote-resolver.js +1 -8
  64. package/src/binding/runtime.js +90 -6
  65. package/src/binding/validation-context.js +40 -0
  66. package/src/browser-camera-provider.d.ts +8 -0
  67. package/src/browser-camera-provider.js +104 -0
  68. package/src/builder/gramlot-builder.d.ts +5 -0
  69. package/src/builder/gramlot-builder.js +16 -0
  70. package/src/builder/source.js +34 -0
  71. package/src/chat.d.ts +12 -0
  72. package/src/chat.js +198 -0
  73. package/src/collection-artifact.js +1 -1
  74. package/src/components/attachment-manager.js +160 -0
  75. package/src/components/bases.js +19 -6
  76. package/src/components/border-container.js +86 -8
  77. package/src/components/buttons.js +11 -1
  78. package/src/components/chat.js +28 -0
  79. package/src/components/choice-editor.js +106 -38
  80. package/src/components/database-choices.js +133 -9
  81. package/src/components/editing-status-styles.js +26 -0
  82. package/src/components/editing-status.js +115 -0
  83. package/src/components/field-state.js +42 -54
  84. package/src/components/grid-cell-editor.js +181 -0
  85. package/src/components/grid-grammar.json +258 -0
  86. package/src/components/grid-header-interaction.js +196 -0
  87. package/src/components/grid-row-interaction.js +184 -0
  88. package/src/components/grid-row-layout.js +96 -0
  89. package/src/components/grid-rows.js +28 -0
  90. package/src/components/grid-search-box.js +142 -0
  91. package/src/components/grid-search-styles.js +42 -0
  92. package/src/components/grid-search.js +37 -0
  93. package/src/components/grid-structure.js +85 -0
  94. package/src/components/grid-styles.js +201 -0
  95. package/src/components/grid.js +666 -0
  96. package/src/components/grouplet-card.js +445 -0
  97. package/src/components/grouplets.js +17 -0
  98. package/src/components/html-preview.js +17 -4
  99. package/src/components/image-crop-dialog.js +272 -0
  100. package/src/components/image-crop.js +79 -0
  101. package/src/components/image-uploader.js +252 -0
  102. package/src/components/inputs.js +2 -1
  103. package/src/components/jodit-engine.js +1 -1
  104. package/src/components/markdown-document.js +2 -2
  105. package/src/components/menus.js +1 -0
  106. package/src/components/registry.js +4 -3
  107. package/src/components/screen-capture.js +43 -0
  108. package/src/components/selected-container.js +6 -2
  109. package/src/components/tray-pane.js +32 -4
  110. package/src/components/tree.js +416 -17
  111. package/src/components/typed-editor.js +23 -11
  112. package/src/components/upload-engine.js +156 -0
  113. package/src/components/uploader.js +208 -0
  114. package/src/components/uploads.js +7 -0
  115. package/src/editing-session.d.ts +25 -0
  116. package/src/editing-session.js +396 -0
  117. package/src/experiments/selection-transfer.js +78 -0
  118. package/src/experiments/selection-trial.js +64 -0
  119. package/src/experiments/window-selection.js +124 -0
  120. package/src/format.js +22 -7
  121. package/src/gramlot.d.ts +2 -0
  122. package/src/gramlot.js +2 -1
  123. package/src/handlers/device-handler.d.ts +2 -1
  124. package/src/handlers/rpc-handler.d.ts +3 -3
  125. package/src/index-page-styles.js +2 -1
  126. package/src/index.d.ts +16 -1
  127. package/src/index.js +16 -1
  128. package/src/inout.d.ts +2 -0
  129. package/src/inout.js +6 -0
  130. package/src/markdown-loader.d.ts +1 -0
  131. package/src/markdown-loader.js +4 -0
  132. package/src/markdown.d.ts +1 -0
  133. package/src/markdown.js +2 -0
  134. package/src/media-frame.js +9 -0
  135. package/src/renderer/attributes.js +7 -1
  136. package/src/renderer/gramlot-renderer.d.ts +2 -0
  137. package/src/renderer/gramlot-renderer.js +39 -3
  138. package/src/server/assets.d.ts +1 -1
  139. package/src/server/assets.js +1 -1
  140. package/src/server/gramlot-server.d.ts +10 -1
  141. package/src/server/gramlot-server.js +96 -8
  142. package/src/server/index.d.ts +2 -0
  143. package/src/server/index.js +2 -0
  144. package/src/server/page-base.js +17 -4
  145. package/src/server/page.d.ts +13 -1
  146. package/src/server/page.js +6 -0
  147. package/src/server/source-import.d.ts +2 -0
  148. package/src/server/source-import.js +31 -0
  149. package/src/server/upload.d.ts +20 -0
  150. package/src/server/upload.js +142 -0
  151. package/src/server/visual-editor.d.ts +11 -0
  152. package/src/server/visual-editor.js +149 -0
  153. package/src/source-picker.d.ts +9 -0
  154. package/src/source-picker.js +57 -0
  155. package/src/stores/bag-collection-store.js +51 -0
  156. package/src/stores/bag-collection-view.js +127 -0
  157. package/src/stores/collection-filter.js +77 -0
  158. package/src/tree-store.d.ts +24 -0
  159. package/src/tree-store.js +193 -0
  160. package/src/validation-run.js +50 -0
  161. package/src/view/button.js +8 -5
  162. package/src/view/controls.js +31 -32
  163. package/src/view/grouplet-card.js +54 -0
  164. package/src/view/html.js +29 -4
  165. package/src/view/labelbox.js +7 -3
  166. package/src/visual-editor-icons.js +10 -0
  167. package/src/visual-editor.d.ts +56 -0
  168. package/src/visual-editor.js +844 -0
  169. package/themes/gramlot-base/theme.css +127 -0
  170. package/themes/gramlot-compact/theme.css +8 -0
  171. package/themes/joanna/theme.css +8 -0
  172. package/themes/mimi/theme.css +8 -0
@@ -1,2 +1,3 @@
1
1
  export {default} from "./collection.js";
2
- export const buildId = "sha256:475ca03a85a344e18e41a311054edb9199919875ca1c6e76c2f50e4d52af9524";
2
+ export * from "./collection.js";
3
+ export const buildId = "sha256:f0d3eb9f6c744ceb6ddc005396cd3d3861f95d033bb3f01e98e9cb9d53df9b65";
@@ -5,6 +5,121 @@
5
5
  "version": "1.1"
6
6
  },
7
7
  "elements": {
8
+ "rowActions": {
9
+ "_meta": {
10
+ "gramlot_component": {
11
+ "command": false,
12
+ "dataScope": false,
13
+ "parameters": {
14
+ "actionState": {
15
+ "default": null,
16
+ "dtype": "T",
17
+ "nullable": true
18
+ },
19
+ "position": {
20
+ "default": "end",
21
+ "dtype": "T"
22
+ },
23
+ "state": {
24
+ "binding": "read",
25
+ "default": null,
26
+ "dtype": "X",
27
+ "nullable": true
28
+ }
29
+ },
30
+ "presentationDefaults": [],
31
+ "sourceContext": true
32
+ },
33
+ "render_tag": "gramlot-row-actions"
34
+ },
35
+ "attributes": {
36
+ "accepts_var_keyword": true,
37
+ "accepts_var_positional": false,
38
+ "parameters": [
39
+ {
40
+ "annotation": {
41
+ "dtype": "T",
42
+ "kind": "dtype"
43
+ },
44
+ "default": "end",
45
+ "has_default": true,
46
+ "kind": "keyword_only",
47
+ "name": "position",
48
+ "role": "attribute"
49
+ },
50
+ {
51
+ "annotation": {
52
+ "items": [
53
+ {
54
+ "dtype": "T",
55
+ "kind": "dtype"
56
+ },
57
+ {
58
+ "dtype": "NN",
59
+ "kind": "dtype"
60
+ }
61
+ ],
62
+ "kind": "union"
63
+ },
64
+ "default": null,
65
+ "has_default": true,
66
+ "kind": "keyword_only",
67
+ "name": "actionState",
68
+ "role": "attribute"
69
+ },
70
+ {
71
+ "annotation": {
72
+ "items": [
73
+ {
74
+ "dtype": "X",
75
+ "kind": "dtype"
76
+ },
77
+ {
78
+ "dtype": "NN",
79
+ "kind": "dtype"
80
+ },
81
+ {
82
+ "base": {
83
+ "dtype": "T",
84
+ "kind": "dtype"
85
+ },
86
+ "kind": "annotated",
87
+ "metadata": [
88
+ {
89
+ "flags": 0,
90
+ "kind": "regex",
91
+ "pattern": "^[\\^=].+"
92
+ }
93
+ ]
94
+ }
95
+ ],
96
+ "kind": "union"
97
+ },
98
+ "default": null,
99
+ "has_default": true,
100
+ "kind": "keyword_only",
101
+ "name": "state",
102
+ "role": "attribute"
103
+ },
104
+ {
105
+ "annotation": {
106
+ "kind": "any"
107
+ },
108
+ "has_default": false,
109
+ "kind": "var_keyword",
110
+ "name": "attr",
111
+ "role": "attribute"
112
+ }
113
+ ]
114
+ },
115
+ "collection_key": null,
116
+ "doc": null,
117
+ "inherits_from": null,
118
+ "node_label": null,
119
+ "ns": null,
120
+ "parent_tags": null,
121
+ "sub_tags": "button,dropDownButton"
122
+ },
8
123
  "tree": {
9
124
  "_meta": {
10
125
  "gramlot_component": {
@@ -18,11 +133,43 @@
18
133
  "default": false,
19
134
  "dtype": "B"
20
135
  },
136
+ "checkChildren": {
137
+ "binding": "read",
138
+ "default": true,
139
+ "dtype": "B"
140
+ },
141
+ "checkedPaths": {
142
+ "binding": "twoWay",
143
+ "default": null,
144
+ "dtype": "T",
145
+ "nullable": true
146
+ },
147
+ "checkedPaths_joiner": {
148
+ "default": ",",
149
+ "dtype": "T"
150
+ },
21
151
  "draggable": {
22
152
  "binding": "read",
23
153
  "default": false,
24
154
  "dtype": "B"
25
155
  },
156
+ "excludeRoot": {
157
+ "binding": "read",
158
+ "default": null,
159
+ "dtype": "T",
160
+ "nullable": true
161
+ },
162
+ "favorites": {
163
+ "binding": "read",
164
+ "default": null,
165
+ "dtype": "X",
166
+ "nullable": true
167
+ },
168
+ "favoritesLabel": {
169
+ "binding": "read",
170
+ "default": "Favorites",
171
+ "dtype": "T"
172
+ },
26
173
  "getIconClass": {
27
174
  "default": null,
28
175
  "dtype": "T",
@@ -43,6 +190,11 @@
43
190
  "default": false,
44
191
  "dtype": "B"
45
192
  },
193
+ "internalNames": {
194
+ "binding": "read",
195
+ "default": false,
196
+ "dtype": "B"
197
+ },
46
198
  "labelAttribute": {
47
199
  "binding": "read",
48
200
  "default": null,
@@ -54,6 +206,14 @@
54
206
  "dtype": "T",
55
207
  "nullable": true
56
208
  },
209
+ "onChecked": {
210
+ "default": null,
211
+ "dtype": [
212
+ "B",
213
+ "T"
214
+ ],
215
+ "nullable": true
216
+ },
57
217
  "searchText": {
58
218
  "binding": "read",
59
219
  "default": "",
@@ -144,6 +304,36 @@
144
304
  "name": "labelAttribute",
145
305
  "role": "attribute"
146
306
  },
307
+ {
308
+ "annotation": {
309
+ "items": [
310
+ {
311
+ "dtype": "B",
312
+ "kind": "dtype"
313
+ },
314
+ {
315
+ "base": {
316
+ "dtype": "T",
317
+ "kind": "dtype"
318
+ },
319
+ "kind": "annotated",
320
+ "metadata": [
321
+ {
322
+ "flags": 0,
323
+ "kind": "regex",
324
+ "pattern": "^[\\^=].+"
325
+ }
326
+ ]
327
+ }
328
+ ],
329
+ "kind": "union"
330
+ },
331
+ "default": false,
332
+ "has_default": true,
333
+ "kind": "keyword_only",
334
+ "name": "internalNames",
335
+ "role": "attribute"
336
+ },
147
337
  {
148
338
  "annotation": {
149
339
  "items": [
@@ -174,6 +364,26 @@
174
364
  "name": "hideValues",
175
365
  "role": "attribute"
176
366
  },
367
+ {
368
+ "annotation": {
369
+ "items": [
370
+ {
371
+ "dtype": "T",
372
+ "kind": "dtype"
373
+ },
374
+ {
375
+ "dtype": "NN",
376
+ "kind": "dtype"
377
+ }
378
+ ],
379
+ "kind": "union"
380
+ },
381
+ "default": null,
382
+ "has_default": true,
383
+ "kind": "keyword_only",
384
+ "name": "excludeRoot",
385
+ "role": "attribute"
386
+ },
177
387
  {
178
388
  "annotation": {
179
389
  "items": [
@@ -276,6 +486,51 @@
276
486
  "name": "searchText",
277
487
  "role": "attribute"
278
488
  },
489
+ {
490
+ "annotation": {
491
+ "items": [
492
+ {
493
+ "dtype": "X",
494
+ "kind": "dtype"
495
+ },
496
+ {
497
+ "dtype": "NN",
498
+ "kind": "dtype"
499
+ },
500
+ {
501
+ "base": {
502
+ "dtype": "T",
503
+ "kind": "dtype"
504
+ },
505
+ "kind": "annotated",
506
+ "metadata": [
507
+ {
508
+ "flags": 0,
509
+ "kind": "regex",
510
+ "pattern": "^[\\^=].+"
511
+ }
512
+ ]
513
+ }
514
+ ],
515
+ "kind": "union"
516
+ },
517
+ "default": null,
518
+ "has_default": true,
519
+ "kind": "keyword_only",
520
+ "name": "favorites",
521
+ "role": "attribute"
522
+ },
523
+ {
524
+ "annotation": {
525
+ "dtype": "T",
526
+ "kind": "dtype"
527
+ },
528
+ "default": "Favorites",
529
+ "has_default": true,
530
+ "kind": "keyword_only",
531
+ "name": "favoritesLabel",
532
+ "role": "attribute"
533
+ },
279
534
  {
280
535
  "annotation": {
281
536
  "items": [
@@ -326,6 +581,91 @@
326
581
  "name": "selectedPath",
327
582
  "role": "attribute"
328
583
  },
584
+ {
585
+ "annotation": {
586
+ "items": [
587
+ {
588
+ "dtype": "B",
589
+ "kind": "dtype"
590
+ },
591
+ {
592
+ "dtype": "T",
593
+ "kind": "dtype"
594
+ },
595
+ {
596
+ "dtype": "NN",
597
+ "kind": "dtype"
598
+ }
599
+ ],
600
+ "kind": "union"
601
+ },
602
+ "default": null,
603
+ "has_default": true,
604
+ "kind": "keyword_only",
605
+ "name": "onChecked",
606
+ "role": "attribute"
607
+ },
608
+ {
609
+ "annotation": {
610
+ "items": [
611
+ {
612
+ "dtype": "T",
613
+ "kind": "dtype"
614
+ },
615
+ {
616
+ "dtype": "NN",
617
+ "kind": "dtype"
618
+ }
619
+ ],
620
+ "kind": "union"
621
+ },
622
+ "default": null,
623
+ "has_default": true,
624
+ "kind": "keyword_only",
625
+ "name": "checkedPaths",
626
+ "role": "attribute"
627
+ },
628
+ {
629
+ "annotation": {
630
+ "dtype": "T",
631
+ "kind": "dtype"
632
+ },
633
+ "default": ",",
634
+ "has_default": true,
635
+ "kind": "keyword_only",
636
+ "name": "checkedPaths_joiner",
637
+ "role": "attribute"
638
+ },
639
+ {
640
+ "annotation": {
641
+ "items": [
642
+ {
643
+ "dtype": "B",
644
+ "kind": "dtype"
645
+ },
646
+ {
647
+ "base": {
648
+ "dtype": "T",
649
+ "kind": "dtype"
650
+ },
651
+ "kind": "annotated",
652
+ "metadata": [
653
+ {
654
+ "flags": 0,
655
+ "kind": "regex",
656
+ "pattern": "^[\\^=].+"
657
+ }
658
+ ]
659
+ }
660
+ ],
661
+ "kind": "union"
662
+ },
663
+ "default": true,
664
+ "has_default": true,
665
+ "kind": "keyword_only",
666
+ "name": "checkChildren",
667
+ "role": "attribute"
668
+ },
329
669
  {
330
670
  "annotation": {
331
671
  "kind": "any"
@@ -343,7 +683,7 @@
343
683
  "node_label": null,
344
684
  "ns": null,
345
685
  "parent_tags": null,
346
- "sub_tags": ""
686
+ "sub_tags": "rowActions[:1]"
347
687
  }
348
688
  },
349
689
  "grammar": {
@@ -8,6 +8,6 @@ mygramlot = GramlotCollection(
8
8
  module="assets/index.js",
9
9
  css=(),
10
10
  dependencies=(),
11
- build_id="sha256:10f3c4f83e2e8ccd287362ad87ca5d55a02ff911ed16cc03941e54ddf332cb7b",
12
- files=("assets/collection.js", "assets/index.js", "commands.json", "grammar.json",),
11
+ build_id="sha256:8c0da31937b915ab2c47cbc841151e8aa761db57e530d3c4f0e571814d5cbd72",
12
+ files=("assets/collection.js", "assets/index.js", "assets/modules/chunk-BLMUM44K.js", "assets/modules/typst-client-JHC6UVYG.js", "commands.json", "grammar.json",),
13
13
  )
@@ -1,4 +1,12 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/dist/components/typst/assets/collection.js
3
- size: 42749605 bytes
4
- sha256: 1770b0daf1e8a253792037316557d17b62a775f1b5ce639d9c76ab9ed7c29ea7
1
+ import{a as m,b as l}from"./modules/chunk-BLMUM44K.js";var r={};m(r,{defineCollection:()=>d});l(r,w);import*as w from"@gramlot/gramlot/components";import{defineCollection as u}from"@gramlot/gramlot/components";function d(i){if(i.name!=="typst")throw new Error("Unexpected bundled collection");let e=[],t={};i.css?.forEach((s,a)=>{s.href=e[a].href});for(let[s,a]of Object.entries(i.assets??{}))a.href=t[s].href;return u({...i,css:e,assets:t})}function p(i,e){return i.parameters=Object.fromEntries(Object.entries(i.constructor.gramlotComponent.parameters).map(([t,s])=>[t,Object.hasOwn(e,t)?e[t]:s.default])),Object.fromEntries(Object.entries(e).filter(([t])=>!Object.hasOwn(i.parameters,t)))}function f(i){return class extends i{#t=0;#s;#e;#n;#i=!1;#a=[];constructor(){super();let e=this.attachShadow({mode:"open"}),t=this.ownerDocument,s=t.createElement("style");s.textContent=`:host{display:block;height:100%;min-height:0;color:var(--gramlot-ink,CanvasText)}
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)}
6
+ a:focus-visible{outline:2px solid var(--gramlot-focus-ring,Highlight)}
7
+ a[aria-disabled=true]{opacity:.45;pointer-events:none}
8
+ .status{white-space:pre-wrap;font-size:.9em;overflow:auto;max-height:8em}
9
+ .pages{flex:1;min-height:0;overflow:auto;padding:16px}
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(s,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.#t,clearTimeout(this.#s),this.#e?.release(),this.#e=null,this.#r()}projectAttributes(e){let t=this.parameters?.value,s=p(this,e);return this.download.download=this.parameters.filename,t!==this.parameters.value&&(++this.#t,this.#r(),this.#o()),s}#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.#t;this.#i=!0;try{this.#n??=import("./modules/typst-client-JHC6UVYG.js");let t=await this.#n;if(!this.isConnected||e!==this.#t)return;this.#e??=t.acquireCompiler(),this.status.textContent="Compiling\u2026";let s=await this.#e.compile(this.parameters.value);if(!this.isConnected||e!==this.#t)return;let{URL:a,Blob:o}=this.ownerDocument.defaultView,n=a.createObjectURL(new o([s.svg],{type:"image/svg+xml"})),c=a.createObjectURL(new o([s.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=s.diagnostics.length?s.diagnostics.join(`
12
+ `):"Preview and PDF are up to date"}catch(t){this.isConnected&&e===this.#t&&(this.status.textContent=t.message)}finally{this.#i=!1,this.isConnected&&e!==this.#t&&this.#o()}}}}var h=(0,r.defineComponent)({name:"typstPreview",tag:"gramlot-typst-preview",base:f,parameters:{value:{dtype:"T",default:"",binding:"read"},filename:{dtype:"T",default:"document.pdf",binding:"read"}},implementation:i=>class extends i{}});var O=d({name:"typst",components:[h]});export{h as TypstPreview,O as default};
@@ -1,2 +1,3 @@
1
1
  export {default} from "./collection.js";
2
- export const buildId = "sha256:10f3c4f83e2e8ccd287362ad87ca5d55a02ff911ed16cc03941e54ddf332cb7b";
2
+ export * from "./collection.js";
3
+ export const buildId = "sha256:8c0da31937b915ab2c47cbc841151e8aa761db57e530d3c4f0e571814d5cbd72";
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var k=(b,a)=>{for(var c in a)g(b,c,{get:a[c],enumerable:!0})},f=(b,a,c,e)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!j.call(b,d)&&d!==c&&g(b,d,{get:()=>a[d],enumerable:!(e=h(a,d))||e.enumerable});return b},l=(b,a,c)=>(f(b,a,"default"),c&&f(c,a,"default"));export{k as a,l as b};
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: package/dist/components/typst/assets/modules/typst-client-JHC6UVYG.js
3
+ size: 42734789 bytes
4
+ sha256: 831ded75f9a8f6c8596c1a75100d934c92beba245d9047d6636cd8dc7d38cfed
@@ -0,0 +1,13 @@
1
+ from gramlot import GramlotCollection
2
+
3
+ mygramlot = GramlotCollection(
4
+ name="uploads",
5
+ package=__package__,
6
+ grammar="grammar.json",
7
+ commands="commands.json",
8
+ module="assets/index.js",
9
+ css=(),
10
+ dependencies=(),
11
+ build_id="sha256:72cabfa17ed3ef64a29380770fabde1fd23b6736f1bdd9be5d5f1781779e9641",
12
+ files=("assets/collection.js", "assets/index.js", "commands.json", "grammar.json",),
13
+ )