flexdesk 0.4.7 → 0.6.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 (76) hide show
  1. package/README.md +1036 -301
  2. package/css/base.css +2958 -2
  3. package/css/flexdesk.css +2962 -4
  4. package/css/overrides.css +4 -2
  5. package/css/tokens.css +86 -0
  6. package/dist/canvas.js +390 -0
  7. package/dist/canvas.js.map +7 -0
  8. package/dist/charts.js +782 -782
  9. package/dist/{chunk-LH5TSOZW.js → chunk-6JSOVNID.js} +42 -2
  10. package/dist/{chunk-LH5TSOZW.js.map → chunk-6JSOVNID.js.map} +3 -3
  11. package/dist/{chunk-ELXVW542.js → chunk-6NG7YVBG.js} +3 -471
  12. package/dist/chunk-6NG7YVBG.js.map +7 -0
  13. package/dist/{chunk-F5FYDCOA.js → chunk-CNXP3SIN.js} +2373 -2373
  14. package/dist/{chunk-F5FYDCOA.js.map → chunk-CNXP3SIN.js.map} +7 -7
  15. package/dist/chunk-H4LT43RS.js +475 -0
  16. package/dist/chunk-H4LT43RS.js.map +7 -0
  17. package/dist/{chunk-WMGOJ3I6.js → chunk-KH2GJTKR.js} +3702 -2628
  18. package/dist/chunk-KH2GJTKR.js.map +7 -0
  19. package/dist/chunk-SN4LSOAR.js +532 -0
  20. package/dist/chunk-SN4LSOAR.js.map +7 -0
  21. package/dist/flexdesk.css +2962 -4
  22. package/dist/flow.js +10030 -0
  23. package/dist/flow.js.map +7 -0
  24. package/dist/tiles.js +2195 -2195
  25. package/dist/tokens.css +86 -0
  26. package/dist/widgets.js +5824 -5796
  27. package/dist/widgets.js.map +1 -1
  28. package/dist/wm.js +8077 -8074
  29. package/dist/wm.js.map +7 -7
  30. package/package.json +89 -81
  31. package/src/canvas/canvas_adapter.js +523 -0
  32. package/src/canvas/edge_router.js +392 -0
  33. package/src/canvas/graph/connector_router.js +189 -0
  34. package/src/canvas/graph/history_service.js +170 -0
  35. package/src/canvas/graph/node_platform.js +116 -0
  36. package/src/canvas/index.js +16 -0
  37. package/src/flow/canvas_editor/editor.js +1081 -0
  38. package/src/flow/canvas_editor/index.js +16 -0
  39. package/src/flow/canvas_editor/layout.js +118 -0
  40. package/src/flow/canvas_editor/strings.js +37 -0
  41. package/src/flow/kit/always_before.js +325 -0
  42. package/src/flow/kit/catalogue.js +170 -0
  43. package/src/flow/kit/chip_input.js +461 -0
  44. package/src/flow/kit/dom.js +205 -0
  45. package/src/flow/kit/findings.js +129 -0
  46. package/src/flow/kit/history.js +173 -0
  47. package/src/flow/kit/index.js +38 -0
  48. package/src/flow/kit/keys.js +127 -0
  49. package/src/flow/kit/logic_graph.js +210 -0
  50. package/src/flow/kit/references.js +199 -0
  51. package/src/flow/kit/settings_panel.js +357 -0
  52. package/src/flow/kit/settings_schema.js +175 -0
  53. package/src/flow/kit/step_picker.js +209 -0
  54. package/src/flow/kit/strings.js +102 -0
  55. package/src/flow/kit/value_picker.js +238 -0
  56. package/src/flow/kit/widgets.js +763 -0
  57. package/src/flow/lanes/editor.js +1469 -0
  58. package/src/flow/lanes/index.js +26 -0
  59. package/src/flow/lanes/layout.js +525 -0
  60. package/src/flow/lanes/pipeline.js +327 -0
  61. package/src/flow/lanes/preview.js +109 -0
  62. package/src/flow/lanes/strings.js +98 -0
  63. package/src/flow/outline/editor.js +1511 -0
  64. package/src/flow/outline/index.js +20 -0
  65. package/src/flow/outline/mapping.js +286 -0
  66. package/src/flow/outline/menu.js +154 -0
  67. package/src/flow/outline/operations.js +738 -0
  68. package/src/flow/outline/recognise.js +755 -0
  69. package/src/flow/outline/strings.js +135 -0
  70. package/src/tiling/landing_table.js +13 -5
  71. package/src/tiling/wm.js +3916 -3916
  72. package/src/ui/components/data_table.js +4205 -3294
  73. package/src/ui/components/row_activation.js +70 -0
  74. package/src/ui/components/table_values.js +423 -0
  75. package/dist/chunk-ELXVW542.js.map +0 -7
  76. package/dist/chunk-WMGOJ3I6.js.map +0 -7
@@ -0,0 +1,135 @@
1
+ /**
2
+ * EVERY WORD THE OUTLINE EDITOR DRAWS, over the kit's (36 §3.13, §6).
3
+ *
4
+ * English, and naming no domain. What a consumer calls a block's parts — what
5
+ * an error port means, what a loop's foot says, what the flow row is called —
6
+ * comes from the BLOCK MAPPING (`mapping.js`), and the consumer's `strings`
7
+ * are laid over these:
8
+ *
9
+ * const S = createStrings(OUTLINE_STRINGS, options.strings);
10
+ *
11
+ * Names are quoted ‘like this’ in a sentence. A function string takes the
12
+ * names it quotes, already resolved to what the reader sees (a step's label,
13
+ * else its type's label, else its id).
14
+ */
15
+
16
+ const plural = (n, one, many) => (n === 1 ? one : many.replace('{n}', String(n)));
17
+
18
+ export const OUTLINE_STRINGS = Object.freeze({
19
+ // ── why a flow cannot be drawn as an outline (36 §6.3) ──────────────
20
+ outline_no_start: 'This flow has no Start step.',
21
+ outline_two_starts: 'This flow has two Start steps.',
22
+ outline_unknown_type: (type) => `‘${type}’ is a step type this editor does not know, so the flow cannot be `
23
+ + 'drawn as an outline.',
24
+ outline_unreachable: (x) => `Nothing leads to ‘${x}’ from Start.`,
25
+ outline_shared_step: (x) => `‘${x}’ is reached from two places that are not one block.`,
26
+ outline_jump_out: (x, y) => `A line from ‘${x}’ leaves its block for ‘${y}’.`,
27
+ outline_two_continuations: (x) => `‘${x}’ continues to two steps; a Parallel step runs branches side by side.`,
28
+ outline_parallel_unjoined: (p) => `The branches of ‘${p}’ do not meet at one Merge.`,
29
+ outline_merge_unpaired: (j) => `‘${j}’ closes no Parallel step.`,
30
+ outline_loop_shape: (l) => `The body of ‘${l}’ does not end at its Next.`,
31
+ loopNextOutside: (x, l) => `‘${x}’ is not inside the body of ‘${l}’, so it cannot go on to its next item.`,
32
+ loopLeaks: (l, y) => `The body of ‘${l}’ reaches ‘${y}’, which runs after the loop.`,
33
+ loopEnteredByNext: (l) => `‘${l}’ is entered by its Next from outside its body.`,
34
+ outline_cycle: (x, y) => `‘${x}’ leads back to ‘${y}’, and only a loop's Next may.`,
35
+ selfLine: (x) => `A line leaves ‘${x}’ and comes straight back into it; a step cannot connect to itself.`,
36
+ outline_unknown_port: (x, port) => `‘${x}’ has no port called ${port}.`,
37
+ outline_broken_line: (id) => `A line names ‘${id}’, which is not a step in this flow.`,
38
+ outline_after_end: (x, y) => `‘${x}’ ends the run, and a line leaves it for ‘${y}’.`,
39
+ readOnlyBecause: (reason) => `This flow is shown as a list in the order it runs, and cannot be edited here: ${reason}`,
40
+
41
+ // ── the list ───────────────────────────────────────────────────────
42
+ stepsHeading: 'Steps',
43
+ stepsCount: (n) => plural(n, '1 step', '{n} steps'),
44
+ findStep: 'Find a step',
45
+ findNothing: (q) => `No step matches “${q}”.`,
46
+ statusKeys: 'Alt+↑ ↓ moves a step · Ctrl+D duplicates · Del removes · Ctrl+Z undoes',
47
+ fold: (x) => `Fold ${x}`,
48
+ unfold: (x) => `Unfold ${x}`,
49
+ menuFor: (x) => `Menu for ${x}`,
50
+ dragToMove: 'Drag to move',
51
+ addStepHere: (where) => `Add a step here — ${where}`,
52
+ removeBranch: (arm) => `Remove ${arm}`,
53
+ armStops: 'Stops here',
54
+ flowStart: 'Start',
55
+ startType: 'Flow',
56
+
57
+ // ── where a step is, and where one would go ────────────────────────
58
+ topLevel: 'Top level',
59
+ topLevelFirst: 'Top level · the first step',
60
+ topLevelLast: 'Top level · the last step',
61
+ insidePath: (path) => `Inside ${path}`,
62
+ pathJoin: ' › ',
63
+ gapTop: 'at the top level',
64
+ gapInside: (path) => `inside ${path}`,
65
+ gapAfter: (where, x) => `${where}, after ${x}`,
66
+ gapBefore: (where, x) => `${where}, before ${x}`,
67
+ gapFirst: (where) => `${where}, as the first step`,
68
+ dropInto: (path) => `Into ${path}`,
69
+ dropTop: 'Top level',
70
+ dropBefore: (x) => `before ${x}`,
71
+ dropAfter: (x) => `after ${x}`,
72
+ dropFirst: 'as the first step',
73
+ dropLabel: (where, at) => `${where} · ${at}`,
74
+ dropNowhere: 'Drop it between two steps to move it there.',
75
+
76
+ // ── the step menu ──────────────────────────────────────────────────
77
+ moveUp: 'Move up',
78
+ moveDown: 'Move down',
79
+ moveOut: (x) => `Move out of ${x}`,
80
+ moveOutTop: 'Move out',
81
+ wrapIn: 'Wrap in',
82
+ copy: 'Copy',
83
+ cut: 'Cut',
84
+ pasteAfter: 'Paste after',
85
+ renameKey: 'F2',
86
+ keyMoveUp: 'Alt+↑',
87
+ keyMoveDown: 'Alt+↓',
88
+ keyMoveOut: 'Alt+←',
89
+ keyDuplicate: 'Ctrl+D',
90
+ keyCopy: 'Ctrl+C',
91
+ keyCut: 'Ctrl+X',
92
+ keyPaste: 'Ctrl+V',
93
+ keyRemove: 'Del',
94
+ refusedLine: (what, why) => `${what} — ${why}`,
95
+ alreadyFirst: (where) => `already first in ${where}`,
96
+ alreadyLast: (where) => `already last in ${where}`,
97
+ alreadyTop: 'already at the top level',
98
+ theTopLevel: 'the top level',
99
+ nothingCopied: 'nothing is copied',
100
+ readOnlyRefusal: 'the flow is read only',
101
+
102
+ // ── why an edit is refused ─────────────────────────────────────────
103
+ endNotLast: (end) => `‘${end}’ ends the run, so it can only be the last step here.`,
104
+ nothingAfterEnd: (end) => `Nothing runs after ‘${end}’.`,
105
+ endsNotLast: (x) => `Every way through ‘${x}’ ends, so it can only be the last step here.`,
106
+ endInLoop: (end, loop) => `‘${end}’ ends the run, and a loop's body cannot: the steps inside ‘${loop}’ end at its next item.`,
107
+ wrapLoopNeverReturns: (x) => `‘${x}’ never goes on, so a loop around it would never reach its next item.`,
108
+ wouldOrphan: (y) => `Nothing would lead to ‘${y}’ any more.`,
109
+ branchToJoinNeeded: (p, j) => `‘${p}’ needs a branch that goes on to ‘${j}’.`,
110
+ unreachableHere: (x) => `Every way through ‘${x}’ ends, so nothing would reach a step after it.`,
111
+ nextOutsideLoop: (x) => `‘${x}’ goes on with the next item of a loop, so it can only go inside one.`,
112
+ intoItself: (x) => `‘${x}’ cannot go inside itself.`,
113
+ lastBranch: (p) => `‘${p}’ needs at least one branch.`,
114
+ armNoContinuation: (x) => `Nothing comes after ‘${x}’ yet, so there is nowhere for those steps to carry on `
115
+ + 'to — add a step after it first.',
116
+ notBlockShaped: (why) => `That would leave a flow the outline cannot draw: ${why}`,
117
+ noJoinType: 'There is no step type that closes a Parallel step.',
118
+
119
+ // ── ports drawn as settings (36 §6.5) ──────────────────────────────
120
+ armExitLabel: 'After those steps',
121
+ armExitRejoin: (x) => `Carry on with “${x}”`,
122
+ armExitRejoinEnd: 'Carry on after this step',
123
+ joinSettingLabel: 'When the branches finish',
124
+ joinAll: 'Wait for every branch',
125
+ joinAny: 'Go on when the first one finishes',
126
+
127
+ // ── the run overlay (36 §6.7) ──────────────────────────────────────
128
+ runTaken: 'taken',
129
+ runNotTaken: 'not taken',
130
+ runCount: (n) => `×${n}`,
131
+ runState: (state) => ({
132
+ completed: 'completed', failed: 'failed', skipped: 'skipped', running: 'running',
133
+ cancelled: 'cancelled', 'not-reached': 'not reached',
134
+ }[state] ?? String(state ?? '')),
135
+ });
@@ -3,7 +3,10 @@
3
3
  * pattern used by SFC / Markets / Scenarios / KPIs landings (and the
4
4
  * market-archetype instances table). Three responsibilities:
5
5
  *
6
- * 1. Single-click row → open the entity (handled by callers).
6
+ * 1. Single-click row → open the entity (handled by callers). Since 0.5.0
7
+ * the click is judged by the same rule as `DataTable`'s `onRowActivate`
8
+ * (`ui/components/row_activation.js`); a table that owns its rows can
9
+ * use that option directly instead of this helper.
7
10
  * 2. Right-click row → custom context menu with Open / Edit / Delete
8
11
  * (replaces DataTable's default copy-as-TSV menu for these tables;
9
12
  * the default still applies to data tables outside this helper).
@@ -16,6 +19,7 @@
16
19
  */
17
20
 
18
21
  import { showContextMenu } from '../ui/components/context_menu.js';
22
+ import { isRowActivation } from '../ui/components/row_activation.js';
19
23
  import { registerPanelKeys } from './panel_keys.js';
20
24
 
21
25
  /** Attach the navigation-table interactions to a host element that
@@ -85,10 +89,14 @@ export function attachLandingTableBehavior(host, getRow, entityActions, options
85
89
  dispatch(actionBtn.dataset.twmAction, tr ? getRow(tr.__rowIndex) : null);
86
90
  return;
87
91
  }
88
- // Plain row click → open. Ignore clicks on interactive controls
89
- // (buttons, filter inputs, links) and anything outside a body row
90
- // (pagination strip, header, empty space).
91
- if (ev.target.closest('button, a, input, select, textarea')) return;
92
+ // Plain row click → open — by THE row-activation rule DataTable's own
93
+ // `onRowActivate` uses (0.5.0, `ui/components/row_activation.js`), so
94
+ // the two cannot drift: not on a control (a button, a field, a link),
95
+ // not on the click that ends a drag selecting a cell's text, and not on
96
+ // the second click of a double-click, which used to open the row twice.
97
+ // Anything outside a body row (pagination strip, header, empty space)
98
+ // is not a row either.
99
+ if (!isRowActivation(ev, 'click', { scope: host })) return;
92
100
  const tr = bodyRowFor(ev);
93
101
  if (tr) dispatch('open', getRow(tr.__rowIndex));
94
102
  };