@trebco/treb 23.6.5 → 25.0.0-rc1

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 (217) hide show
  1. package/.eslintignore +8 -0
  2. package/.eslintrc.js +164 -0
  3. package/README-shadow-DOM.md +88 -0
  4. package/README.md +37 -130
  5. package/api-config.json +29 -0
  6. package/api-generator/api-generator-types.ts +82 -0
  7. package/api-generator/api-generator.ts +1172 -0
  8. package/api-generator/package.json +3 -0
  9. package/build/treb-spreadsheet.mjs +14 -0
  10. package/{treb.d.ts → build/treb.d.ts} +285 -269
  11. package/esbuild-custom-element.mjs +336 -0
  12. package/esbuild.js +305 -0
  13. package/package.json +43 -14
  14. package/treb-base-types/package.json +5 -0
  15. package/treb-base-types/src/api_types.ts +36 -0
  16. package/treb-base-types/src/area.ts +583 -0
  17. package/treb-base-types/src/basic_types.ts +45 -0
  18. package/treb-base-types/src/cell.ts +612 -0
  19. package/treb-base-types/src/cells.ts +1066 -0
  20. package/treb-base-types/src/color.ts +124 -0
  21. package/treb-base-types/src/import.ts +71 -0
  22. package/treb-base-types/src/index-standalone.ts +29 -0
  23. package/treb-base-types/src/index.ts +42 -0
  24. package/treb-base-types/src/layout.ts +47 -0
  25. package/treb-base-types/src/localization.ts +187 -0
  26. package/treb-base-types/src/rectangle.ts +145 -0
  27. package/treb-base-types/src/render_text.ts +72 -0
  28. package/treb-base-types/src/style.ts +545 -0
  29. package/treb-base-types/src/table.ts +109 -0
  30. package/treb-base-types/src/text_part.ts +54 -0
  31. package/treb-base-types/src/theme.ts +608 -0
  32. package/treb-base-types/src/union.ts +152 -0
  33. package/treb-base-types/src/value-type.ts +164 -0
  34. package/treb-base-types/style/resizable.css +59 -0
  35. package/treb-calculator/modern.tsconfig.json +11 -0
  36. package/treb-calculator/package.json +5 -0
  37. package/treb-calculator/src/calculator.ts +2546 -0
  38. package/treb-calculator/src/complex-math.ts +558 -0
  39. package/treb-calculator/src/dag/array-vertex.ts +198 -0
  40. package/treb-calculator/src/dag/graph.ts +951 -0
  41. package/treb-calculator/src/dag/leaf_vertex.ts +118 -0
  42. package/treb-calculator/src/dag/spreadsheet_vertex.ts +327 -0
  43. package/treb-calculator/src/dag/spreadsheet_vertex_base.ts +44 -0
  44. package/treb-calculator/src/dag/vertex.ts +352 -0
  45. package/treb-calculator/src/descriptors.ts +162 -0
  46. package/treb-calculator/src/expression-calculator.ts +1069 -0
  47. package/treb-calculator/src/function-error.ts +103 -0
  48. package/treb-calculator/src/function-library.ts +103 -0
  49. package/treb-calculator/src/functions/base-functions.ts +1214 -0
  50. package/treb-calculator/src/functions/checkbox.ts +164 -0
  51. package/treb-calculator/src/functions/complex-functions.ts +253 -0
  52. package/treb-calculator/src/functions/finance-functions.ts +399 -0
  53. package/treb-calculator/src/functions/information-functions.ts +102 -0
  54. package/treb-calculator/src/functions/matrix-functions.ts +182 -0
  55. package/treb-calculator/src/functions/sparkline.ts +335 -0
  56. package/treb-calculator/src/functions/statistics-functions.ts +350 -0
  57. package/treb-calculator/src/functions/text-functions.ts +298 -0
  58. package/treb-calculator/src/index.ts +27 -0
  59. package/treb-calculator/src/notifier-types.ts +59 -0
  60. package/treb-calculator/src/primitives.ts +428 -0
  61. package/treb-calculator/src/utilities.ts +305 -0
  62. package/treb-charts/package.json +5 -0
  63. package/treb-charts/src/chart-functions.ts +156 -0
  64. package/treb-charts/src/chart-types.ts +230 -0
  65. package/treb-charts/src/chart.ts +1288 -0
  66. package/treb-charts/src/index.ts +24 -0
  67. package/treb-charts/src/main.ts +37 -0
  68. package/treb-charts/src/rectangle.ts +52 -0
  69. package/treb-charts/src/renderer.ts +1841 -0
  70. package/treb-charts/src/util.ts +122 -0
  71. package/treb-charts/style/charts.scss +221 -0
  72. package/treb-charts/style/old-charts.scss +250 -0
  73. package/treb-embed/markup/layout.html +137 -0
  74. package/treb-embed/markup/toolbar.html +175 -0
  75. package/treb-embed/modern.tsconfig.json +25 -0
  76. package/treb-embed/src/custom-element/content-types.d.ts +18 -0
  77. package/treb-embed/src/custom-element/global.d.ts +11 -0
  78. package/treb-embed/src/custom-element/spreadsheet-constructor.ts +1227 -0
  79. package/treb-embed/src/custom-element/treb-global.ts +44 -0
  80. package/treb-embed/src/custom-element/treb-spreadsheet-element.ts +52 -0
  81. package/treb-embed/src/embedded-spreadsheet.ts +5362 -0
  82. package/treb-embed/src/index.ts +16 -0
  83. package/treb-embed/src/language-model.ts +41 -0
  84. package/treb-embed/src/options.ts +320 -0
  85. package/treb-embed/src/progress-dialog.ts +228 -0
  86. package/treb-embed/src/selection-state.ts +16 -0
  87. package/treb-embed/src/spinner.ts +42 -0
  88. package/treb-embed/src/toolbar-message.ts +96 -0
  89. package/treb-embed/src/types.ts +167 -0
  90. package/treb-embed/style/autocomplete.scss +103 -0
  91. package/treb-embed/style/dark-theme.scss +114 -0
  92. package/treb-embed/style/defaults.scss +36 -0
  93. package/treb-embed/style/dialog.scss +181 -0
  94. package/treb-embed/style/dropdown-select.scss +101 -0
  95. package/treb-embed/style/formula-bar.scss +193 -0
  96. package/treb-embed/style/grid.scss +374 -0
  97. package/treb-embed/style/layout.scss +424 -0
  98. package/treb-embed/style/mouse-mask.scss +67 -0
  99. package/treb-embed/style/note.scss +92 -0
  100. package/treb-embed/style/overlay-editor.scss +102 -0
  101. package/treb-embed/style/spinner.scss +92 -0
  102. package/treb-embed/style/tab-bar.scss +228 -0
  103. package/treb-embed/style/table.scss +80 -0
  104. package/treb-embed/style/theme-defaults.scss +444 -0
  105. package/treb-embed/style/toolbar.scss +416 -0
  106. package/treb-embed/style/tooltip.scss +68 -0
  107. package/treb-embed/style/treb-icons.scss +130 -0
  108. package/treb-embed/style/treb-spreadsheet-element.scss +20 -0
  109. package/treb-embed/style/z-index.scss +43 -0
  110. package/treb-export/docs/charts.md +68 -0
  111. package/treb-export/modern.tsconfig.json +19 -0
  112. package/treb-export/package.json +4 -0
  113. package/treb-export/src/address-type.ts +77 -0
  114. package/treb-export/src/base-template.ts +22 -0
  115. package/treb-export/src/column-width.ts +85 -0
  116. package/treb-export/src/drawing2/chart-template-components2.ts +389 -0
  117. package/treb-export/src/drawing2/chart2.ts +282 -0
  118. package/treb-export/src/drawing2/column-chart-template2.ts +521 -0
  119. package/treb-export/src/drawing2/donut-chart-template2.ts +296 -0
  120. package/treb-export/src/drawing2/drawing2.ts +355 -0
  121. package/treb-export/src/drawing2/embedded-image.ts +71 -0
  122. package/treb-export/src/drawing2/scatter-chart-template2.ts +555 -0
  123. package/treb-export/src/export-worker/export-worker.ts +99 -0
  124. package/treb-export/src/export-worker/index-modern.ts +22 -0
  125. package/treb-export/src/export2.ts +2204 -0
  126. package/treb-export/src/import2.ts +882 -0
  127. package/treb-export/src/relationship.ts +36 -0
  128. package/treb-export/src/shared-strings2.ts +128 -0
  129. package/treb-export/src/template-2.ts +22 -0
  130. package/treb-export/src/unescape_xml.ts +47 -0
  131. package/treb-export/src/workbook-sheet2.ts +182 -0
  132. package/treb-export/src/workbook-style2.ts +1285 -0
  133. package/treb-export/src/workbook-theme2.ts +88 -0
  134. package/treb-export/src/workbook2.ts +491 -0
  135. package/treb-export/src/xml-utils.ts +201 -0
  136. package/treb-export/template/base/[Content_Types].xml +2 -0
  137. package/treb-export/template/base/_rels/.rels +2 -0
  138. package/treb-export/template/base/docProps/app.xml +2 -0
  139. package/treb-export/template/base/docProps/core.xml +12 -0
  140. package/treb-export/template/base/xl/_rels/workbook.xml.rels +2 -0
  141. package/treb-export/template/base/xl/sharedStrings.xml +2 -0
  142. package/treb-export/template/base/xl/styles.xml +2 -0
  143. package/treb-export/template/base/xl/theme/theme1.xml +2 -0
  144. package/treb-export/template/base/xl/workbook.xml +2 -0
  145. package/treb-export/template/base/xl/worksheets/sheet1.xml +2 -0
  146. package/treb-export/template/base.xlsx +0 -0
  147. package/treb-format/package.json +8 -0
  148. package/treb-format/src/format.test.ts +213 -0
  149. package/treb-format/src/format.ts +942 -0
  150. package/treb-format/src/format_cache.ts +199 -0
  151. package/treb-format/src/format_parser.ts +723 -0
  152. package/treb-format/src/index.ts +25 -0
  153. package/treb-format/src/number_format_section.ts +100 -0
  154. package/treb-format/src/value_parser.ts +337 -0
  155. package/treb-grid/package.json +5 -0
  156. package/treb-grid/src/editors/autocomplete.ts +394 -0
  157. package/treb-grid/src/editors/autocomplete_matcher.ts +260 -0
  158. package/treb-grid/src/editors/formula_bar.ts +473 -0
  159. package/treb-grid/src/editors/formula_editor_base.ts +910 -0
  160. package/treb-grid/src/editors/overlay_editor.ts +511 -0
  161. package/treb-grid/src/index.ts +37 -0
  162. package/treb-grid/src/layout/base_layout.ts +2618 -0
  163. package/treb-grid/src/layout/grid_layout.ts +299 -0
  164. package/treb-grid/src/layout/rectangle_cache.ts +86 -0
  165. package/treb-grid/src/render/selection-renderer.ts +414 -0
  166. package/treb-grid/src/render/svg_header_overlay.ts +93 -0
  167. package/treb-grid/src/render/svg_selection_block.ts +187 -0
  168. package/treb-grid/src/render/tile_renderer.ts +2122 -0
  169. package/treb-grid/src/types/annotation.ts +216 -0
  170. package/treb-grid/src/types/border_constants.ts +34 -0
  171. package/treb-grid/src/types/clipboard_data.ts +31 -0
  172. package/treb-grid/src/types/data_model.ts +334 -0
  173. package/treb-grid/src/types/drag_mask.ts +81 -0
  174. package/treb-grid/src/types/grid.ts +7743 -0
  175. package/treb-grid/src/types/grid_base.ts +3644 -0
  176. package/treb-grid/src/types/grid_command.ts +470 -0
  177. package/treb-grid/src/types/grid_events.ts +124 -0
  178. package/treb-grid/src/types/grid_options.ts +97 -0
  179. package/treb-grid/src/types/grid_selection.ts +60 -0
  180. package/treb-grid/src/types/named_range.ts +369 -0
  181. package/treb-grid/src/types/scale-control.ts +202 -0
  182. package/treb-grid/src/types/serialize_options.ts +72 -0
  183. package/treb-grid/src/types/set_range_options.ts +52 -0
  184. package/treb-grid/src/types/sheet.ts +3099 -0
  185. package/treb-grid/src/types/sheet_types.ts +95 -0
  186. package/treb-grid/src/types/tab_bar.ts +464 -0
  187. package/treb-grid/src/types/tile.ts +59 -0
  188. package/treb-grid/src/types/update_flags.ts +75 -0
  189. package/treb-grid/src/util/dom_utilities.ts +44 -0
  190. package/treb-grid/src/util/fontmetrics2.ts +179 -0
  191. package/treb-grid/src/util/ua.ts +104 -0
  192. package/treb-logo.svg +18 -0
  193. package/treb-parser/package.json +5 -0
  194. package/treb-parser/src/csv-parser.ts +122 -0
  195. package/treb-parser/src/index.ts +25 -0
  196. package/treb-parser/src/md-parser.ts +526 -0
  197. package/treb-parser/src/parser-types.ts +397 -0
  198. package/treb-parser/src/parser.test.ts +298 -0
  199. package/treb-parser/src/parser.ts +2673 -0
  200. package/treb-utils/package.json +5 -0
  201. package/treb-utils/src/dispatch.ts +57 -0
  202. package/treb-utils/src/event_source.ts +147 -0
  203. package/treb-utils/src/ievent_source.ts +33 -0
  204. package/treb-utils/src/index.ts +31 -0
  205. package/treb-utils/src/measurement.ts +174 -0
  206. package/treb-utils/src/resizable.ts +160 -0
  207. package/treb-utils/src/scale.ts +137 -0
  208. package/treb-utils/src/serialize_html.ts +124 -0
  209. package/treb-utils/src/template.ts +70 -0
  210. package/treb-utils/src/validate_uri.ts +61 -0
  211. package/tsconfig.json +10 -0
  212. package/tsproject.json +30 -0
  213. package/util/license-plugin-esbuild.js +86 -0
  214. package/util/list-css-vars.sh +46 -0
  215. package/README-esm.md +0 -37
  216. package/treb-bundle.css +0 -2
  217. package/treb-bundle.mjs +0 -15
@@ -0,0 +1,424 @@
1
+
2
+ // legacy
3
+
4
+ @import './grid.scss';
5
+ @import './theme-defaults.scss';
6
+ @import './dark-theme.scss';
7
+
8
+ // not scoped to treb-layout, but has its own scope; also,
9
+ // no imports & relatively clean
10
+
11
+ @import 'treb-charts/style/charts.scss';
12
+
13
+ // relatively clean, also no imports
14
+
15
+ @import './dialog.scss';
16
+ @import './spinner.scss';
17
+
18
+ // local, new (or scrubbed)
19
+
20
+ @import './treb-icons.scss';
21
+ @import './toolbar.scss';
22
+
23
+ .treb-layout {
24
+
25
+ /*============================================================================
26
+ *
27
+ * Reset
28
+ *
29
+ * Since we cannot use a shadow DOM, we're using this reset to start from
30
+ * a blank-ish slate. Using `revert` should reset styles back to the browser
31
+ * stylesheet (or user stylesheet, if anyone actually does that).
32
+ *
33
+ * Per MDN, "revert is just a value" -- so it can still be overridden by
34
+ * specificity. So it is possible for styles to leak in. We're encapsulating
35
+ * everything so there's not a lot of concern about leaking out. Once we are
36
+ * three-four levels deep in specificity we probably don't need to worry too
37
+ * much above stuff leaking in, so the first couple of layers should use
38
+ * prefixed names just to be sure, and wrap up all the styles.
39
+ *
40
+ * Known issues (WIP)
41
+ *
42
+ * this reset breaks contenteditable on chrome, because it unsets the
43
+ * css property "-webkit-user-modify", which should be "read-write".
44
+ *
45
+ * that's a nonstandard property which is no longer in use (?) but gets
46
+ * set by the contenteditable attribute. chrome/webkit is probably using
47
+ * this internally to manage editability.
48
+ *
49
+ * it seems like the attribute should take priority over our reset. not sure
50
+ * why it does not. in any event the fix _seems_ to be setting that property
51
+ * on contenteditable elements. I say _seems_ because it is working, but we
52
+ * should keep an eye out for stability issues.
53
+ *
54
+ * it looks like there might be something similar happening on firefox
55
+ * because we lost the cursor (again -- what do they have against cursors?)
56
+ * needs some investigating.
57
+ *
58
+ *===========================================================================*/
59
+
60
+ all: revert;
61
+ box-sizing: border-box;
62
+
63
+ div, button, input, ul, ol, li, a, textarea {
64
+
65
+ // maybe this is being too aggressive. we could be a little
66
+ // more specific about what we unset in order to avoid any
67
+ // unexpected side effects.
68
+
69
+ all: revert;
70
+ box-sizing: border-box;
71
+
72
+ }
73
+
74
+ /**
75
+ * this is kind of a global property but we don't actually want
76
+ * to inherit from the page, so we should set a font explicitly
77
+ * here (in fact that should be the treb UI font).
78
+ */
79
+ button, input {
80
+ font: inherit;
81
+ color: inherit;
82
+ }
83
+
84
+ * {
85
+ box-sizing: border-box;
86
+ }
87
+
88
+ /**
89
+ * fix for chrome (webkit?)
90
+ */
91
+ [contenteditable] {
92
+ -webkit-user-modify: read-write;
93
+ }
94
+
95
+ // ---------------------------------------------------------------------------
96
+
97
+ color-scheme: var(--treb-color-scheme, unset);
98
+
99
+ font-family: $font-stack;
100
+
101
+ font-style: normal;
102
+ font-weight: normal;
103
+ // color: #333;
104
+ color: inherit;
105
+ font-size: 12pt;
106
+
107
+ // FIXME: use stack, var
108
+ // font: 14px sans-serif;
109
+ // color: #333;
110
+
111
+ height: 100%;
112
+ width: 100%;
113
+
114
+ position: relative;
115
+ display: grid;
116
+ grid-template-rows: auto minmax(0, 1fr);
117
+ grid-template-columns: minmax(0, 1fr) auto;
118
+ // gap: 1em;
119
+
120
+ &[animate] {
121
+ .treb-layout-header {
122
+ transition: height var(--treb-sidebar-transition, .2s ease),
123
+ opacity var(--treb-sidebar-transition, .2s ease);
124
+ }
125
+ }
126
+
127
+ .treb-layout-header {
128
+ grid-row: 1;
129
+ grid-column: 1/3;
130
+ height: 1px;
131
+ opacity: 0;
132
+ }
133
+
134
+ /**
135
+ * toolbar is visible when attribute is set
136
+ */
137
+ &[toolbar] {
138
+ .treb-layout-header {
139
+ height: 42px;
140
+ opacity: 1;
141
+ }
142
+ }
143
+
144
+ /**
145
+ * dialog is visible when attribute is set. when dialog
146
+ * is visible, we want to fade all content -- including
147
+ * toolbar, which also uses opacity (above) so we need
148
+ * to out-specify
149
+ */
150
+ &[dialog] {
151
+
152
+ & > *, .treb-layout-header {
153
+ opacity: .6;
154
+ }
155
+
156
+ .treb-dialog-mask {
157
+ pointer-events: auto;
158
+ opacity: 1;
159
+ }
160
+
161
+ }
162
+
163
+ .treb-layout-spreadsheet {
164
+
165
+ grid-row: 2;
166
+ grid-column: 1;
167
+ position: relative;
168
+ z-index: 5;
169
+ display: flex;
170
+ flex-direction: row;
171
+ gap: 1em;
172
+ overflow: hidden;
173
+ transition: opacity .2s ease;
174
+
175
+ // FIXME: move up (or not needed?)
176
+ // line-height: normal;
177
+ // text-align: left;
178
+
179
+ }
180
+
181
+ .treb-view {
182
+
183
+ position: relative;
184
+ display: grid;
185
+ grid-template-columns: minmax(0, 1fr);
186
+ grid-template-rows: auto minmax(0, 1fr) auto;
187
+ overflow: hidden;
188
+ flex: 1 1 0px;
189
+
190
+ .treb-spreadsheet-body {
191
+ box-shadow: 0 4px 6px -4px rgba(0, 0, 0, .4);
192
+ }
193
+
194
+ .treb-layout-resize-handle {
195
+ display: none;
196
+ }
197
+
198
+ &:last-of-type {
199
+
200
+ .treb-layout-resize-handle {
201
+
202
+ display: block;
203
+ grid-area: 2/1/3/2; // overlap the grid body
204
+ justify-self: end;
205
+ align-self: end;
206
+
207
+ border: .5rem solid var(--treb-resize-handle-color, blue);
208
+ border-top-color: transparent;
209
+ border-left-color: transparent;
210
+
211
+ z-index: 20; // FIXME: use stack
212
+
213
+ width: 1rem;
214
+ height: 1rem;
215
+
216
+ cursor: nw-resize;
217
+
218
+ }
219
+ }
220
+
221
+ }
222
+
223
+ /*
224
+ .treb-layout-resize-container {
225
+ overflow: hidden;
226
+ position: relative;
227
+ display: flex;
228
+ box-shadow: 0 4px 6px -4px rgba(0, 0, 0, .4);
229
+ flex-grow: 1;
230
+ }
231
+ */
232
+
233
+ &[animate] {
234
+ .treb-layout-sidebar {
235
+ transition: width var(--treb-sidebar-transition, .2s ease),
236
+ opacity var(--treb-sidebar-transition, .2s ease);
237
+ }
238
+ }
239
+
240
+ .treb-layout-sidebar {
241
+
242
+ grid-row: 2;
243
+ grid-column: 2;
244
+
245
+ padding-top: 1em;
246
+ grid-row: 2;
247
+ grid-column: 2;
248
+ display: flex;
249
+ flex-direction: column;
250
+ gap: .75em;
251
+ justify-content: flex-start;
252
+ overflow: hidden;
253
+ width: 2.5rem;
254
+
255
+ padding-top: 3em;
256
+ width: 3em;
257
+
258
+ align-items: center;
259
+
260
+ }
261
+
262
+ &[collapsed] {
263
+ .treb-layout-sidebar {
264
+ width: 0px;
265
+ opacity: 0;
266
+ }
267
+
268
+ .treb-toggle-sidebar-button {
269
+
270
+ border-color: var(--treb-toolbar-border-color, var(--treb-ui-border-color, rgb(209, 213, 219)));
271
+ border-right-color: var(--treb-toolbar-button-background, transparent);
272
+ right: 0px;
273
+ border-top-right-radius: 0px;
274
+ border-bottom-right-radius: 0px;
275
+ &::after {
276
+ mask-image: var(--treb-sidebar-icon-chevron-left);
277
+ -webkit-mask-image: var(--treb-sidebar-icon-chevron-left);
278
+ }
279
+ background: var(--treb-toolbar-button-background, #fff);
280
+
281
+ }
282
+ }
283
+
284
+ .treb-layout-sidebar > button, .treb-toggle-sidebar-button {
285
+
286
+ all: initial;
287
+ padding: 0;
288
+ margin: 0;
289
+ border: 0;
290
+ background: transparent;
291
+
292
+ &::after {
293
+ display: block;
294
+ height: 24px;
295
+ width: 24px;
296
+ content: '';
297
+ background: #ccc; // FIXME
298
+ mask-position: center;
299
+ -webkit-mask-position: center;
300
+ mask-repeat: no-repeat;
301
+ -webkit-mask-repeat: no-repeat;
302
+ transition: background-color 0.1s ease;
303
+ mask-image: var(--treb-mask-image);
304
+ -webkit-mask-image: var(--treb-mask-image);
305
+ }
306
+
307
+ &:hover::after {
308
+ background: #666;
309
+ }
310
+
311
+ &[data-command=recalculate] {
312
+ --treb-mask-image: var(--treb-sidebar-icon-reset);
313
+ }
314
+
315
+ &[data-command=toggle-toolbar] {
316
+ --treb-mask-image: var(--treb-sidebar-icon-toolbar);
317
+ }
318
+
319
+ &[data-command=revert] {
320
+ --treb-mask-image: var(--treb-sidebar-icon-revert);
321
+ }
322
+
323
+ &[data-command=export-xlsx] {
324
+ --treb-mask-image: var(--treb-sidebar-icon-export);
325
+ }
326
+
327
+ &[data-command=about] {
328
+ --treb-mask-image: var(--treb-sidebar-icon-about);
329
+ }
330
+
331
+ }
332
+
333
+ .treb-toggle-sidebar-button {
334
+
335
+ position: absolute;
336
+ right: .5rem;
337
+ bottom: 6rem;
338
+ background: transparent;
339
+ border: 0;
340
+ border: 1px solid transparent;
341
+ height: 24px;
342
+ width: 24px;
343
+
344
+ right: calc(1.5rem - 12px);
345
+
346
+ border-radius: 12px;
347
+ display: flex;
348
+ align-items: center;
349
+ justify-content: center;
350
+ padding: 0;
351
+ margin: 0;
352
+
353
+ z-index: $z-index-note;
354
+
355
+ &::after {
356
+ height: 12px;
357
+ width: 12px;
358
+ mask-image: var(--treb-sidebar-icon-chevron-right);
359
+ -webkit-mask-image: var(--treb-sidebar-icon-chevron-right);
360
+ }
361
+
362
+ }
363
+
364
+ /*
365
+ .treb-resize-handle {
366
+
367
+ // FIXME: use the stack, but (at least firefox) needs a z-index on this
368
+ z-index: 20;
369
+
370
+ border: .5rem solid var(--treb-resize-handle-color, blue);
371
+ border-top-color: transparent;
372
+ border-left-color: transparent;
373
+ position: absolute;
374
+ bottom: 0px;
375
+ right: 0px;
376
+ cursor: nw-resize;
377
+
378
+ // the opacity change is just annoying, don't bother
379
+ / *
380
+ opacity: .35;
381
+ transition: opacity var(--treb-resize-transition, .1s ease-in-out);
382
+ &:hover, &.retain-opacity {
383
+ opacity: 1;
384
+ }
385
+ * /
386
+
387
+ &.disabled {
388
+ display: none;
389
+ }
390
+
391
+ }
392
+ */
393
+
394
+ }
395
+
396
+ // these are (atm) outside of the container because we want them
397
+ // to be able to float over any outside content as well... what's the
398
+ // rule with that? something about stacking contexts? of course we're
399
+ // always goint to be fighting z-indexes.
400
+ //
401
+ // ...possible to use a dialog element? TODO: investigate...
402
+ //
403
+
404
+ .treb-resize-rect {
405
+ all: initial;
406
+ z-index: 9998; // ugh
407
+ position: absolute;
408
+ top: 0px;
409
+ left: 0px;
410
+ border: 1px dotted var(--treb-resize-frame-color, blue);
411
+ width: 100%;
412
+ height: 100%;
413
+ display: block;
414
+ }
415
+
416
+ .treb-resize-mask {
417
+ all: initial;
418
+ z-index: 9999; // ugh
419
+ position: fixed;
420
+ top: 0px;
421
+ left: 0px;
422
+ width: 100vw;
423
+ height: 100vh;
424
+ }
@@ -0,0 +1,67 @@
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2023 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+
22
+ .treb-layout {
23
+
24
+ /**
25
+ * event mask for mouse drag. currently this is added _within_ node
26
+ * structure, although it covers the whole viewport. we should share
27
+ * with the mouse mask we are using for resize.
28
+ */
29
+ .treb-mouse-mask {
30
+ position: fixed;
31
+ top: 0px;
32
+ left: 0px;
33
+ right: 0px;
34
+ bottom: 0px;
35
+ background: transparent;
36
+ z-index: $z-index-mask;
37
+ display: none;
38
+
39
+ /** style is attached when drag operation is a resize */
40
+ &.column-resize {
41
+ cursor: col-resize;
42
+ }
43
+
44
+ /** style is attached when drag operation is a resize */
45
+ &.row-resize {
46
+ cursor: row-resize;
47
+ }
48
+
49
+ /** when resizing a grid selection via the nub */
50
+ &.nub-select {
51
+ cursor: crosshair;
52
+ }
53
+
54
+ /** for moving annotations */
55
+ &.move {
56
+ cursor: move;
57
+ }
58
+
59
+ /** for resizing annotations */
60
+ &.nw-resize {
61
+ cursor: nw-resize;
62
+ }
63
+
64
+ }
65
+
66
+ }
67
+
@@ -0,0 +1,92 @@
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2023 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+
22
+ .treb-layout {
23
+
24
+ // are these exactly the same? clearly we copied-and-pasted
25
+ // at first. seems like we could consolidate.
26
+
27
+ .treb-note {
28
+
29
+ position: fixed;
30
+ padding: 7px 10px;
31
+ border-radius: 2px;
32
+ box-shadow: $default-box-shadow;
33
+ z-index: $z-index-note;
34
+ line-height: normal;
35
+
36
+ top: 100px;
37
+ left: 100px;
38
+
39
+ max-width: 15em; /* which em? seems to be way too large */
40
+ min-width: 15em;
41
+
42
+ opacity: 0;
43
+ transition: opacity .2s;
44
+
45
+ /* themeable properties */
46
+
47
+ font-family: $font-stack;
48
+
49
+ border: 1px solid var(--treb-note-border-color, var(--treb-ui-border-color, #ddd));
50
+ color: var(--treb-note-color, #333);
51
+ background: var(--treb-note-background, #fff);
52
+ font-size: 10.5pt;
53
+
54
+ white-space: pre-line;
55
+
56
+ }
57
+
58
+ .treb-hover-title {
59
+
60
+ position: fixed;
61
+ padding: 7px 10px;
62
+ border-radius: 2px;
63
+ box-shadow: $default-box-shadow;
64
+ z-index: $z-index-note;
65
+ line-height: normal;
66
+
67
+ top: 100px;
68
+ left: 100px;
69
+
70
+ /* max-width: 15em; / * which em? seems to be way too large */
71
+ min-width: 10em;
72
+
73
+ opacity: 0;
74
+ transition: opacity .2s;
75
+
76
+ /* themeable properties */
77
+
78
+ font-family: $font-stack; /* can't we inherit? ... */
79
+
80
+ border: 1px solid var(--treb-note-border-color, var(--treb-ui-border-color, #ddd));
81
+ color: var(--treb-note-color, #333);
82
+ background: var(--treb-note-background, #fff);
83
+
84
+ font-size: 10.5pt;
85
+
86
+ white-space: pre-line;
87
+
88
+ pointer-events: none;
89
+
90
+ }
91
+
92
+ }
@@ -0,0 +1,102 @@
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2023 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+
22
+ .treb-layout {
23
+
24
+ .treb-grid {
25
+
26
+ // rewrite of the overlay structure. much simpler.
27
+ //
28
+ // the aim is to bottom-justify the editor in a cell, and then
29
+ // left/right/center justify based on cell style. all that seems
30
+ // to work with this new structure, and we were able to drop the
31
+ // extra node.
32
+ //
33
+ // there is one layout issue in firefox having to do with the caret
34
+ // in an empty contenteditable cell. we're adding a zero-width space
35
+ // in a ::before pseudoelement, which seems to fix. this should only
36
+ // be necessary when the edit node is empty, but I can't get firefox
37
+ // to do :empty::before (could be I have the syntax wrong).
38
+
39
+ // going to bring back the extra node, so we can have a background
40
+ // that crosses the selection box...
41
+
42
+ .treb-overlay-container {
43
+
44
+ padding: 0;
45
+ margin: 0;
46
+
47
+ /* gets positioned to the rect */
48
+ position: absolute;
49
+
50
+ /* gets set on edit, along with pointer-events */
51
+ opacity: 0;
52
+
53
+ /* probably unecessary */
54
+ outline: none;
55
+
56
+ z-index: $z-index-cell-editor;
57
+
58
+ &.align-right .treb-overlay-inset {
59
+ right: 0px;
60
+ text-align: right;
61
+ padding-right: 3px;
62
+ }
63
+
64
+ &.align-center .treb-overlay-inset {
65
+ text-align: center;
66
+ left: 50%;
67
+ transform: translateX(-50%);
68
+ }
69
+
70
+
71
+ }
72
+
73
+ .treb-overlay-inset {
74
+
75
+ padding: 0;
76
+ margin: 0;
77
+ padding: 0 4px;
78
+
79
+ position: absolute;
80
+ height: 100%;
81
+ min-width: 100%;
82
+
83
+ display: flex;
84
+ flex-direction: column;
85
+ justify-content: flex-end;
86
+ }
87
+
88
+ .treb-overlay-editor {
89
+ outline: none;
90
+ white-space: nowrap;
91
+ position: relative;
92
+ // -webkit-user-modify: read-write;
93
+ }
94
+
95
+ /** fix for firefox layout bug */
96
+ .treb-overlay-editor.firefox::before {
97
+ content: '\200B';
98
+ }
99
+
100
+ }
101
+
102
+ }