@joewinke/jatui 0.1.21 → 0.1.23

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joewinke/jatui",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "private": false,
5
5
  "description": "Shared Svelte 5 component library for JAT projects",
6
6
  "type": "module",
@@ -121,9 +121,11 @@ export function collapse(node: HTMLElement, options: CollapseOptions = {}) {
121
121
  return {
122
122
  update(next: CollapseOptions = {}) {
123
123
  opts = { ...DEFAULTS, ...next };
124
- // expanded/threshold/fade may have changed — re-apply (and re-measure
125
- // in case threshold moved across the content height).
126
- applied = !applied; // force apply() to re-evaluate against new opts
124
+ // expanded/threshold/fade may have changed — re-measure and let
125
+ // apply() compare the freshly computed shouldCollapse against the
126
+ // real last-applied state. (Force-flipping `applied` here used to make
127
+ // that comparison spuriously match on a plain expand/collapse toggle,
128
+ // silently skipping the style update.)
127
129
  scheduleMeasure();
128
130
  },
129
131
  destroy() {
@@ -1,15 +1,7 @@
1
- <script lang="ts">
2
- /**
3
- * ChipInput - Generic contenteditable input with inline chips and autocomplete.
4
- *
5
- * Handles:
6
- * - Contenteditable div with placeholder
7
- * - Chip insertion/deletion (non-editable inline spans)
8
- * - Autocomplete dropdown with keyboard navigation
9
- * - Serialization (DOM -> text with chip markers)
10
- */
11
-
12
- // --- Types ---
1
+ <script module lang="ts">
2
+ // Public types — declared in the module script so that
3
+ // `import type { ChipSuggestion, SuggestionGroup, ChipInfo } from './ChipInput.svelte'`
4
+ // resolves. Types exported from the instance <script> are NOT module members.
13
5
  export interface ChipSuggestion {
14
6
  label: string;
15
7
  description?: string;
@@ -39,6 +31,21 @@
39
31
  /** If true, insert as plain text instead of a chip element */
40
32
  insertAsText?: boolean;
41
33
  }
34
+ </script>
35
+
36
+ <script lang="ts">
37
+ /**
38
+ * ChipInput - Generic contenteditable input with inline chips and autocomplete.
39
+ *
40
+ * Handles:
41
+ * - Contenteditable div with placeholder
42
+ * - Chip insertion/deletion (non-editable inline spans)
43
+ * - Autocomplete dropdown with keyboard navigation
44
+ * - Serialization (DOM -> text with chip markers)
45
+ */
46
+
47
+ // --- Types (ChipSuggestion, SuggestionGroup, ChipInfo) are declared in the
48
+ // module <script> above so they are importable as module members. ---
42
49
 
43
50
  // --- Props ---
44
51
  let {
@@ -1,3 +1,14 @@
1
+ <script module lang="ts">
2
+ // Declared in the module script so `import type { DisplaySegment } from
3
+ // './InlineEdit.svelte'` resolves (instance-script exports are not module members).
4
+ /** A display segment for formula-aware rendering */
5
+ export interface DisplaySegment {
6
+ type: 'text' | 'formula';
7
+ display: string;
8
+ tooltip?: string;
9
+ }
10
+ </script>
11
+
1
12
  <script lang="ts">
2
13
  /**
3
14
  * InlineEdit Component
@@ -14,13 +25,6 @@
14
25
  * - Optional formula-aware display: segments with type/display/tooltip
15
26
  */
16
27
 
17
- /** A display segment for formula-aware rendering */
18
- export interface DisplaySegment {
19
- type: 'text' | 'formula';
20
- display: string;
21
- tooltip?: string;
22
- }
23
-
24
28
  interface Props {
25
29
  /** Current value */
26
30
  value: string;
@@ -1,3 +1,17 @@
1
+ <script module lang="ts">
2
+ // Declared in the module script so `import type { ColumnLink } from
3
+ // './LinkedColumns.svelte'` resolves (instance-script exports are not module members).
4
+ /** Describes which left items a single right (anchor) item covers. */
5
+ export interface ColumnLink {
6
+ /** The right item's id this link belongs to. */
7
+ rightId: string | number;
8
+ /** First left item id in the covered range (inclusive). */
9
+ leftStartId: string | number;
10
+ /** Last left item id in the covered range (inclusive). */
11
+ leftEndId: string | number;
12
+ }
13
+ </script>
14
+
1
15
  <script lang="ts" generics="L extends { id: string | number }, R extends { id: string | number }">
2
16
  /**
3
17
  * LinkedColumns — generic two-column ink-up ribbon primitive.
@@ -51,15 +65,7 @@
51
65
 
52
66
  import type { Snippet } from 'svelte';
53
67
 
54
- /** Describes which left items a single right (anchor) item covers. */
55
- export interface ColumnLink {
56
- /** The right item's id this link belongs to. */
57
- rightId: string | number;
58
- /** First left item id in the covered range (inclusive). */
59
- leftStartId: string | number;
60
- /** Last left item id in the covered range (inclusive). */
61
- leftEndId: string | number;
62
- }
68
+ // ColumnLink is declared in the module <script> above so it's importable as a module member.
63
69
 
64
70
  let {
65
71
  leftItems,