flexdesk 0.17.0 → 0.17.2

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 (45) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +399 -3
  3. package/canvas.js +18 -0
  4. package/charts.js +21 -0
  5. package/core.js +14 -0
  6. package/css/base.css +23 -1
  7. package/css/flexdesk.css +61 -1
  8. package/dist/charts.js +3 -5
  9. package/dist/charts.js.map +1 -1
  10. package/dist/{chunk-Q36EPT2R.js → chunk-LWV23YVE.js} +1614 -138
  11. package/dist/chunk-LWV23YVE.js.map +7 -0
  12. package/dist/{chunk-MCIXFNVF.js → chunk-RMTRWWEO.js} +2 -2
  13. package/dist/flexdesk.css +61 -1
  14. package/dist/flow.js +2 -2
  15. package/dist/flow.js.map +2 -2
  16. package/dist/tiles.js +2 -2
  17. package/dist/widgets.js +186 -55
  18. package/dist/widgets.js.map +2 -2
  19. package/dist/wm.js +90 -10
  20. package/dist/wm.js.map +2 -2
  21. package/editor.js +20 -0
  22. package/flow.js +21 -0
  23. package/host.js +14 -0
  24. package/package.json +10 -1
  25. package/src/flow/canvas_editor/editor.js +1 -1
  26. package/src/tiling/command_palette.js +46 -7
  27. package/src/tiling/content_registry.js +3 -0
  28. package/src/tiling/entity_sources.js +10 -0
  29. package/src/tiling/wm.js +65 -3
  30. package/src/ui/components/cell_editor_host.js +100 -18
  31. package/src/ui/components/cell_editors.js +480 -0
  32. package/src/ui/components/cell_grid.js +121 -8
  33. package/src/ui/components/cell_paste.js +243 -0
  34. package/src/ui/components/data_table.js +96 -10
  35. package/src/ui/components/settings_view.js +192 -51
  36. package/src/ui/components/staged_edits.js +19 -1
  37. package/src/ui/components/tsv.js +74 -0
  38. package/src/ui/notification_center.js +5 -5
  39. package/tiles.js +27 -0
  40. package/widgets.js +69 -0
  41. package/wm.js +28 -0
  42. package/dist/chunk-Q36EPT2R.js.map +0 -7
  43. package/dist/chunk-QWQJUDPD.js +0 -610
  44. package/dist/chunk-QWQJUDPD.js.map +0 -7
  45. /package/dist/{chunk-MCIXFNVF.js.map → chunk-RMTRWWEO.js.map} +0 -0
@@ -0,0 +1,74 @@
1
+ /**
2
+ * tsv.js — STORY-0085 (writing), STORY-0090 (reading). Tab-separated text,
3
+ * the format Excel and Google Sheets put on the clipboard as `text/plain` and
4
+ * read back from it. DataTable's cell mode copies a range with `toTSV` and
5
+ * pastes a block read with `fromTSV`.
6
+ *
7
+ * QUOTING. Excel quotes a cell that holds a tab, a newline (LF or CR) or a
8
+ * double quote, and doubles every quote inside it: `say "hi"` is written
9
+ * `"say ""hi"""`. Any other cell is written as it is, so a plain grid stays
10
+ * plain text. A writer that does not quote turns a cell holding a tab into two
11
+ * cells, and every column after it lands one to the right when pasted.
12
+ *
13
+ * LINES. Rows are joined with `\n` and there is no newline after the last
14
+ * row: one cell copied is that cell's text alone.
15
+ *
16
+ * READING. Character by character, never by splitting: a quoted cell may hold
17
+ * tabs and newlines, and a split that cannot know it shifts every column after
18
+ * such a cell into the wrong place, silently. A quote opens a quoted cell only
19
+ * at the start of a cell; inside one a doubled quote is a quote. A CR outside
20
+ * a quoted cell is dropped, so CRLF lines read as LF ones. Excel ends its text
21
+ * with a newline: the empty line that leaves (and any further empty lines at
22
+ * the end) is dropped, so a paste never carries a row nobody copied.
23
+ */
24
+
25
+ /** One cell's text: `null` and `undefined` are empty, anything else is
26
+ * `String(value)`, quoted the way Excel quotes it when it has to be. */
27
+ export function tsvCell(value) {
28
+ const text = value === null || value === undefined ? '' : String(value);
29
+ if (/[\t\n\r"]/.test(text)) return `"${text.replace(/"/g, '""')}"`;
30
+ return text;
31
+ }
32
+
33
+ /** A matrix (an array of rows, each an array of cells) as TSV. */
34
+ export function toTSV(matrix) {
35
+ if (!Array.isArray(matrix)) return '';
36
+ return matrix
37
+ .map((row) => (Array.isArray(row) ? row : [row]).map(tsvCell).join('\t'))
38
+ .join('\n');
39
+ }
40
+
41
+ /**
42
+ * Tab-separated text as a matrix of strings, one array per line. Empty text
43
+ * is `[]`; a line with no tab is one cell; empty cells are kept (`'a\t\tb'`
44
+ * is three cells). Lines may differ in length: each is as long as it is.
45
+ */
46
+ export function fromTSV(text) {
47
+ if (text === null || text === undefined || text === '') return [];
48
+ const src = String(text);
49
+ const rows = [];
50
+ let row = [];
51
+ let cell = '';
52
+ let quoted = false;
53
+ for (let i = 0; i < src.length; i++) {
54
+ const ch = src[i];
55
+ if (quoted) {
56
+ if (ch === '"' && src[i + 1] === '"') { cell += '"'; i++; }
57
+ else if (ch === '"') quoted = false;
58
+ else cell += ch;
59
+ } else if (ch === '"' && cell === '') quoted = true;
60
+ else if (ch === '\t') { row.push(cell); cell = ''; }
61
+ else if (ch === '\r') { /* CRLF reads as LF */ }
62
+ else if (ch === '\n') { row.push(cell); rows.push(row); row = []; cell = ''; }
63
+ else cell += ch;
64
+ }
65
+ row.push(cell);
66
+ rows.push(row);
67
+ // Excel's closing newline leaves an empty line behind: it is no row.
68
+ while (rows.length > 1) {
69
+ const last = rows[rows.length - 1];
70
+ if (last.length === 1 && last[0] === '') rows.pop();
71
+ else break;
72
+ }
73
+ return rows;
74
+ }
@@ -105,7 +105,7 @@ export class NotificationCenter extends ComponentBase {
105
105
  this.container = existingContainer;
106
106
  this.rootEl = existingContainer.querySelector('.twm-notification-center');
107
107
  this.listEl = existingContainer.querySelector('.twm-notification-center__list');
108
- this.liveRegionEl = existingContainer.querySelector('.notification-center__live-region');
108
+ this.liveRegionEl = existingContainer.querySelector('.twm-notification-center__live-region');
109
109
  this._mounted = true;
110
110
  this.#subscribeEvents();
111
111
  this.#claimToastBus();
@@ -124,7 +124,7 @@ export class NotificationCenter extends ComponentBase {
124
124
  this.listEl.className = 'twm-notification-center__list';
125
125
 
126
126
  this.liveRegionEl = document.createElement('div');
127
- this.liveRegionEl.className = 'notification-center__live-region';
127
+ this.liveRegionEl.className = 'twm-notification-center__live-region';
128
128
  this.liveRegionEl.setAttribute('aria-live', 'polite');
129
129
  this.liveRegionEl.setAttribute('aria-atomic', 'true');
130
130
  this.liveRegionEl.style.position = 'absolute';
@@ -599,7 +599,7 @@ export class NotificationCenter extends ComponentBase {
599
599
  if (!this.#summaryEl) {
600
600
  const more = document.createElement('button');
601
601
  more.type = 'button';
602
- more.className = 'notification twm-notification--summary';
602
+ more.className = 'twm-notification twm-notification--summary';
603
603
  more.addEventListener('click', () => {
604
604
  const held = [...this.held];
605
605
  try { this.summaryAction?.(held); } catch (err) { this.logger?.warn?.('summaryAction failed', err); }
@@ -729,8 +729,8 @@ export class NotificationCenter extends ComponentBase {
729
729
  #patchItem(entry, notification) {
730
730
  const item = entry.el;
731
731
  if (entry.severity !== notification.severity) {
732
- if (entry.severity) item.classList.remove(`notification--${entry.severity}`);
733
- item.classList.add('notification', `notification--${notification.severity}`);
732
+ if (entry.severity) item.classList.remove(`twm-notification--${entry.severity}`);
733
+ item.classList.add('twm-notification', `twm-notification--${notification.severity}`);
734
734
  entry.severity = notification.severity;
735
735
  }
736
736
  if (entry.titleEl) NotificationCenter.#setText(entry.titleEl, notification.title);
package/tiles.js ADDED
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @flexdesk/tiles — A draggable, resizable widget grid: the tile base class, the grid, the
3
+ * widget registry, layout persistence, a chart and a KPI tile (0.13.0), a list and a
4
+ * people tile and a board-wide scope picker (0.16.1), the figure tile every
5
+ * Plotly tile draws through and the config form (0.17.0).
6
+ *
7
+ * It stores layouts under keys YOU choose and resolves starting templates
8
+ * through a callback YOU supply. It has no opinion about what a layout is
9
+ * keyed by.
10
+ *
11
+ * GENERATED by scripts/gen_barrels.py. Do not hand-edit. (0.13.0: hand-edited to
12
+ * add chart_tiles.js — the generator is not in this repository; 0.16.1: list_tiles.js
13
+ * and scope_picker.js, the same way; 0.17.0: figure_tile.js and tile_config_form.js.)
14
+ *
15
+ * 10 modules.
16
+ */
17
+
18
+ export * from './src/tiles/chart_tiles.js';
19
+ export * from './src/tiles/config_schema.js';
20
+ export * from './src/tiles/figure_tile.js';
21
+ export * from './src/tiles/layout_persistence.js';
22
+ export * from './src/tiles/list_tiles.js';
23
+ export * from './src/tiles/scope_picker.js';
24
+ export * from './src/tiles/tile_base.js';
25
+ export * from './src/tiles/tile_config_form.js';
26
+ export * from './src/tiles/tile_grid.js';
27
+ export * from './src/tiles/tile_registry.js';
package/widgets.js ADDED
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @flexdesk/widgets — The widget set: DataTable, modals, managed windows, toasts, trees,
3
+ * context menus, menu bars, panels, section stacks, a step wizard, the help modal and the notification centre.
4
+ *
5
+ * GENERATED by scripts/gen_barrels.py. Do not hand-edit.
6
+ *
7
+ * 59 modules.
8
+ */
9
+
10
+ export * from './src/ui/base/component_base.js';
11
+ export * from './src/ui/base/controller_base.js';
12
+ export * from './src/ui/base/page_base.js';
13
+ export * from './src/ui/components/about_dialog.js';
14
+ export * from './src/ui/components/alert_log.js';
15
+ export * from './src/ui/components/alerts_pane.js';
16
+ export * from './src/ui/components/action_dropdown.js';
17
+ export * from './src/ui/components/attribute_list_editor.js';
18
+ export * from './src/ui/components/autocomplete_field.js';
19
+ export * from './src/ui/components/cell_editor_host.js';
20
+ export * from './src/ui/components/cell_editors.js';
21
+ export * from './src/ui/components/cell_selection.js';
22
+ export * from './src/ui/components/color_field.js';
23
+ export * from './src/ui/components/color_list_field.js';
24
+ export * from './src/ui/components/column_fit.js';
25
+ export * from './src/ui/components/computing_status_window.js';
26
+ export * from './src/ui/components/confirm_dialog.js';
27
+ export * from './src/ui/components/context_menu.js';
28
+ export * from './src/ui/components/conversation_view.js';
29
+ export * from './src/ui/components/data_table.js';
30
+ export * from './src/ui/components/detail_header.js';
31
+ export * from './src/ui/components/document_outline.js';
32
+ export * from './src/ui/components/drag_reorder.js';
33
+ export * from './src/ui/components/fact_table.js';
34
+ export * from './src/ui/components/gallery_picker.js';
35
+ export * from './src/ui/components/inline_renamer.js';
36
+ export * from './src/ui/components/managed_window.js';
37
+ export * from './src/ui/components/menu_bar.js';
38
+ export * from './src/ui/components/modal.js';
39
+ export * from './src/ui/components/notification_history.js';
40
+ export * from './src/ui/components/progress.js';
41
+ export * from './src/ui/components/record_list.js';
42
+ export * from './src/ui/components/section_stack.js';
43
+ export * from './src/ui/components/series.js';
44
+ export * from './src/ui/components/settings_view.js';
45
+ export * from './src/ui/components/slide_out_panel.js';
46
+ export * from './src/ui/components/slider_field.js';
47
+ export * from './src/ui/components/sortable_list.js';
48
+ export * from './src/ui/components/staged_history.js';
49
+ export * from './src/ui/components/table_state_store.js';
50
+ export * from './src/ui/components/tabs.js';
51
+ export * from './src/ui/components/tag_input.js';
52
+ export * from './src/ui/components/toast.js';
53
+ export * from './src/ui/components/toggle_field.js';
54
+ export * from './src/ui/components/tree_view.js';
55
+ export * from './src/ui/components/tsv.js';
56
+ export * from './src/ui/components/window_taskbar.js';
57
+ export * from './src/ui/components/wizard.js';
58
+ export * from './src/ui/controllers/window_chrome_controller.js';
59
+ export * from './src/ui/notification_center.js';
60
+ export * from './src/ui/utils/auto_scrollbars.js';
61
+ export * from './src/ui/utils/markdown.js';
62
+ export * from './src/ui/utils/native_context_menu.js';
63
+ export * from './src/ui/utils/overlay_scrollbar.js';
64
+ export * from './src/ui/utils/raf_resize_observer.js';
65
+ export * from './src/ui/utils/scroll_lock.js';
66
+ export * from './src/ui/utils/strip_scroll.js';
67
+ export * from './src/ui/utils/tooltip_service.js';
68
+ export * from './src/help/help_modal.js';
69
+ export * from './src/help/help_registry.js';
package/wm.js ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @flexdesk/wm — The tiling window manager: tiles, tabs, splits, desktops, the command
3
+ * palette, the taxonomy and entity registries, and createShell().
4
+ *
5
+ * GENERATED by scripts/gen_barrels.py. Do not hand-edit.
6
+ *
7
+ * 19 modules.
8
+ */
9
+
10
+ export * from './src/tiling/bottom_panel_tabs.js';
11
+ export * from './src/tiling/command_palette.js';
12
+ export * from './src/tiling/content_registry.js';
13
+ export * from './src/tiling/desktops.js';
14
+ export * from './src/tiling/entity_sources.js';
15
+ export * from './src/tiling/keymap.js';
16
+ export * from './src/tiling/kind_taxonomy.js';
17
+ export * from './src/tiling/landing_table.js';
18
+ export * from './src/tiling/loading_overlay.js';
19
+ export * from './src/tiling/nav_panel.js';
20
+ export * from './src/tiling/page_factory.js';
21
+ export * from './src/tiling/panel_keys.js';
22
+ export * from './src/tiling/shell.js';
23
+ export * from './src/tiling/tile_breadcrumb.js';
24
+ export * from './src/tiling/tile_renderer.js';
25
+ export * from './src/tiling/tile_tab_menu.js';
26
+ export * from './src/tiling/tile_tree.js';
27
+ export * from './src/tiling/wm.js';
28
+ export * from './src/tiling/zoom.js';