bitboss-ui 3.0.0-beta.72 → 3.0.0-beta.74

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 (185) hide show
  1. package/README.md +4 -2
  2. package/bin/bitboss-ui-mcp.mjs +101 -3
  3. package/bin/bitboss-ui.mjs +6 -1
  4. package/bin/cli.mjs +34 -7
  5. package/dist/ai/BbBadge.md +4 -4
  6. package/dist/ai/BbCalendar.md +4 -3
  7. package/dist/ai/BbColorPalette.md +8 -9
  8. package/dist/ai/BbConfirmPortal.md +1 -1
  9. package/dist/ai/BbDatePicker.md +4 -3
  10. package/dist/ai/BbDialog.md +17 -4
  11. package/dist/ai/BbDropdown.md +23 -10
  12. package/dist/ai/BbDropdownButton.md +2 -2
  13. package/dist/ai/BbForm.md +11 -7
  14. package/dist/ai/BbHoverCardPortal.md +1 -1
  15. package/dist/ai/BbNumberInput.md +5 -3
  16. package/dist/ai/BbPopoverPortal.md +1 -1
  17. package/dist/ai/BbTable.md +43 -19
  18. package/dist/ai/BbTimePicker.md +4 -3
  19. package/dist/ai/BbToastPortal.md +1 -1
  20. package/dist/ai/changelog.json +60 -4
  21. package/dist/ai/components.json +56 -20
  22. package/dist/ai/guides/design-tokens.md +20 -0
  23. package/dist/ai/guides/eslint-rules.md +1 -1
  24. package/dist/ai/guides/inertia-helpers.md +613 -53
  25. package/dist/ai/guides/migration/adoption-checklist.md +5 -5
  26. package/dist/ai/guides/migration/components/use-confirm.md +4 -1
  27. package/dist/ai/guides/migration/v2-to-v3.md +24 -0
  28. package/dist/ai/guides/migration/v3-beta-tooling.md +3 -0
  29. package/dist/ai/guides/preset-components.md +15 -2
  30. package/dist/ai/guides/reporting.md +49 -0
  31. package/dist/ai/helpers/inertia/manifest.json +33 -38
  32. package/dist/ai/helpers/inertia/useHasChanged.ts +25 -37
  33. package/dist/ai/helpers/inertia/useQuery.ts +24 -6
  34. package/dist/ai/helpers/inertia/utils.ts +552 -3
  35. package/dist/ai/index.md +1 -0
  36. package/dist/ai/manifest/components/BbAlert.tree.json +1 -1
  37. package/dist/ai/manifest/components/BbCalendar.json +2 -2
  38. package/dist/ai/manifest/components/BbColorPalette.json +3 -3
  39. package/dist/ai/manifest/components/BbConfirm.removed.json +4 -4
  40. package/dist/ai/manifest/components/BbConfirmPortal.json +1 -1
  41. package/dist/ai/manifest/components/BbConfirmPortal.removed.json +2 -2
  42. package/dist/ai/manifest/components/BbDatePicker.json +3 -3
  43. package/dist/ai/manifest/components/BbDialog.tree.json +5 -1
  44. package/dist/ai/manifest/components/BbDropdown.json +3 -3
  45. package/dist/ai/manifest/components/BbDropdown.tree.json +3 -2
  46. package/dist/ai/manifest/components/BbDropdownButton.json +2 -2
  47. package/dist/ai/manifest/components/BbForm.json +1 -1
  48. package/dist/ai/manifest/components/BbHoverCard.json +1 -1
  49. package/dist/ai/manifest/components/BbHoverCardPortal.json +1 -1
  50. package/dist/ai/manifest/components/BbNumberInput.json +1 -1
  51. package/dist/ai/manifest/components/BbPopover.json +1 -1
  52. package/dist/ai/manifest/components/BbPopoverPortal.json +1 -1
  53. package/dist/ai/manifest/components/BbSelectPopover.json +1 -1
  54. package/dist/ai/manifest/components/BbTable.tree.json +12 -6
  55. package/dist/ai/manifest/components/BbTimePicker.json +3 -3
  56. package/dist/ai/manifest/components/BbToast.removed.json +1 -1
  57. package/dist/ai/manifest/components/BbToastPortal.json +1 -1
  58. package/dist/ai/manifest/components/CommonPopover.json +1 -1
  59. package/dist/ai/manifest/index.json +2 -2
  60. package/dist/ai/manifest/meta.json +36 -0
  61. package/dist/ai/manifest/types.advanced.json +81 -80
  62. package/dist/ai/manifest/types.api.json +66 -65
  63. package/dist/ai/manifest/types.wrapper.json +155 -118
  64. package/dist/ai/recipes/inertia/layout-scaffold.md +3 -1
  65. package/dist/ai/recipes/nuxt/layout-scaffold.md +3 -1
  66. package/dist/ai/recipes/vue/layout-scaffold.md +3 -1
  67. package/dist/ai/source/BbAlert.md +16 -4
  68. package/dist/ai/source/BbAvatar.md +2 -0
  69. package/dist/ai/source/BbBreadcrumbs.md +4 -1
  70. package/dist/ai/source/BbCalendar.md +22 -12
  71. package/dist/ai/source/BbColorPalette.md +41 -12
  72. package/dist/ai/source/BbConfirm.md +7 -0
  73. package/dist/ai/source/BbConfirmPortal.md +9 -4
  74. package/dist/ai/source/BbDatePicker.md +53 -22
  75. package/dist/ai/source/BbDatePickerInput.md +32 -8
  76. package/dist/ai/source/BbDialog.md +31 -1
  77. package/dist/ai/source/BbDropdown.md +52 -24
  78. package/dist/ai/source/BbDropdownGroup.md +17 -21
  79. package/dist/ai/source/BbForm.md +80 -6
  80. package/dist/ai/source/BbHoverCard.md +7 -0
  81. package/dist/ai/source/BbHoverCardPortal.md +9 -5
  82. package/dist/ai/source/BbNumberInput.md +5 -6
  83. package/dist/ai/source/BbOffCanvas.md +34 -1
  84. package/dist/ai/source/BbPopover.md +7 -0
  85. package/dist/ai/source/BbPopoverPortal.md +9 -5
  86. package/dist/ai/source/BbRadio.md +4 -3
  87. package/dist/ai/source/BbRadioGroup.md +7 -5
  88. package/dist/ai/source/BbTable.md +54 -6
  89. package/dist/ai/source/BbTag.md +10 -3
  90. package/dist/ai/source/BbTimePicker.md +50 -15
  91. package/dist/ai/source/BbTimePickerInput.md +30 -7
  92. package/dist/ai/source/BbToast.md +14 -0
  93. package/dist/ai/source/BbToastPortal.md +16 -4
  94. package/dist/ai/source/CommonFieldInput.md +11 -5
  95. package/dist/ai/source/CommonPopover.md +4 -1
  96. package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +31 -26
  97. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +1 -1
  98. package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
  99. package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +235 -234
  100. package/dist/components/BbCalendar/types.d.ts +2 -2
  101. package/dist/components/BbCalendar/useDayjsLocale.js +11 -8
  102. package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +197 -192
  103. package/dist/components/BbColorPalette/types.d.ts +1 -1
  104. package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +2 -4
  105. package/dist/components/BbConfirm/types.d.ts +5 -0
  106. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
  107. package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +145 -139
  108. package/dist/components/BbDatePicker/types.d.ts +2 -2
  109. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +337 -335
  110. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +253 -245
  111. package/dist/components/BbDialog/leaveGhost.js +33 -0
  112. package/dist/components/BbDialog/overlayActions.js +34 -20
  113. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +11 -3
  114. package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +4 -4
  115. package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +119 -120
  116. package/dist/components/BbDropdown/types.d.ts +8 -17
  117. package/dist/components/BbForm/BbForm.vue.d.ts +2 -21
  118. package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +229 -227
  119. package/dist/components/BbForm/types.d.ts +31 -0
  120. package/dist/components/BbHoverCard/BbHoverCardPortal.vue.d.ts +2 -5
  121. package/dist/components/BbHoverCard/types.d.ts +5 -0
  122. package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +1 -1
  123. package/dist/components/BbNumberInput/numberDisplay.js +102 -106
  124. package/dist/components/BbNumberInput/types.d.ts +4 -3
  125. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +385 -377
  126. package/dist/components/BbPopover/BbPopoverPortal.vue.d.ts +2 -5
  127. package/dist/components/BbPopover/types.d.ts +5 -0
  128. package/dist/components/BbRadio/types.d.ts +4 -3
  129. package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +10 -12
  130. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +231 -231
  131. package/dist/components/BbTable/BbTableDataRow.js +96 -96
  132. package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +9 -3
  133. package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +1 -1
  134. package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +106 -100
  135. package/dist/components/BbTimePicker/types.d.ts +2 -2
  136. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +214 -213
  137. package/dist/components/BbToast/BbToastPortal.vue.d.ts +2 -4
  138. package/dist/components/BbToast/types.d.ts +5 -0
  139. package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +36 -36
  140. package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +1 -1
  141. package/dist/components/CommonTimeSelector/useMeridiem.js +6 -6
  142. package/dist/composables/formSubmitLock.js +2 -1
  143. package/dist/composables/overlayRegistry.js +52 -42
  144. package/dist/composables/useActiveInactiveState.js +8 -4
  145. package/dist/composables/useBbDialog.js +5 -5
  146. package/dist/composables/useOwnModel.js +16 -0
  147. package/dist/composables/useSegmentedFields.js +31 -20
  148. package/dist/deprecation/ai-deprecations.json.js +1 -1
  149. package/dist/i18n/currencyDigits.js +58 -0
  150. package/dist/i18n/regionDates.js +250 -0
  151. package/dist/i18n/regionHints.js +30 -41
  152. package/dist/index.d.ts +34 -30
  153. package/dist/llms-full.txt +874 -136
  154. package/dist/llms.txt +3 -1
  155. package/dist/styles.css +2 -2
  156. package/dist/types/ActionButton.d.ts +3 -1
  157. package/dist/types/CommonProps.d.ts +8 -0
  158. package/dist/utilities/functions/hash.js +123 -3
  159. package/dist/utilities/functions/isEqual.js +69 -3
  160. package/dist/utils/versionCheck.js +1 -1
  161. package/dist/vite-plugin.d.ts +2 -1
  162. package/dist/vite.js +8 -5
  163. package/llms.txt +3 -1
  164. package/package.json +2 -3
  165. package/scripts/README.md +43 -43
  166. package/scripts/lib/adoption-checklist.json +6 -5
  167. package/scripts/lib/agent-manifest.mjs +33 -6
  168. package/scripts/lib/agent-setup.mjs +54 -6
  169. package/scripts/lib/cldr-pins.ts +182 -0
  170. package/scripts/lib/engines-include.d.mts +5 -0
  171. package/scripts/lib/engines-include.mjs +40 -0
  172. package/scripts/lib/eslint-plugin.mjs +8 -2
  173. package/scripts/lib/helpers-add.mjs +21 -2
  174. package/scripts/lib/hidden-label-placeholder.mjs +25 -5
  175. package/scripts/lib/idiom-scan.mjs +30 -3
  176. package/scripts/lib/legacy-agent-files.json +152 -0
  177. package/scripts/lib/mcp-config.mjs +74 -7
  178. package/scripts/lib/portal-names.mjs +78 -8
  179. package/scripts/lib/release-results.mjs +153 -6
  180. package/scripts/lib/report.mjs +340 -0
  181. package/scripts/lib/run-beat.mjs +14 -0
  182. package/scripts/lib/run-records.mjs +313 -0
  183. package/scripts/lib/selector-log.mjs +98 -0
  184. package/scripts/lib/ticket-beat.mjs +30 -0
  185. package/scripts/lib/validate-bb-markup.mjs +17 -2
@@ -90,9 +90,9 @@ Each row: what you will find, how to find it, and what to write instead.
90
90
  - Find: `rg -n -g '*.vue' 'role=.tab(list)?[^a-z]'`
91
91
  - Write: `<BbTabs v-model="view" :items="views" />`
92
92
  - `pill` is the default look; `line` for page sections; `navigation` puts the tab in the URL.
93
- 4. **A segmented control or tag group: a `v-for` of buttons that carry `aria-pressed`, or an app component named like one (`SegmentedControl`, `TagGroup`, `ChipGroup`, `ToggleGroup`, `RadioCards`)** → BbTabs (switch views) / BbRadioGroup (pick a value) / BbCheckboxGroup (pick several) `[toggle-group]`
94
- - Find: `rg -n -g '*.vue' 'aria-pressed'` (in files that also match `v-for`)
95
- - Find: `rg -n -g '*.vue' '<(Segmented[A-Za-z]*|Tags?Group|ChipGroup|ToggleGroup|RadioCards?[A-Za-z]*)[\s/>]'`
93
+ 4. **A segmented control or tag group: a `v-for` of buttons whose `aria-pressed` compares to one shared value (`o === v`, `picked.includes(o)`), or an app component named like one (`SegmentedControl`, `TagGroup`, `ChipGroup`, `ToggleGroup`, `RadioCards`) that does not already render the library's group** → BbTabs (switch views) / BbRadioGroup (pick a value) / BbCheckboxGroup (pick several) `[toggle-group]`
94
+ - Find: `rg -n -g '*.vue' '(^|\s)(:|v-bind:)?aria-pressed="[^"]*(==|!=|\.includes\(|\.has\()'` (in files that also match `v-for`)
95
+ - Find: `rg -n -g '*.vue' '<(Segmented[A-Za-z]*|Tags?Group|ChipGroup|ToggleGroup|RadioCards?[A-Za-z]*)[\s/>]'` (skip a tag whose own `.vue` file renders `BbRadioGroup`, `BbCheckboxGroup` or `BbTabs`)
96
96
  - Write: `<BbTabs v-model="view" :items="views" />`
97
97
  - Decide by the job, not the look: switching what the page shows is BbTabs (`pill`); choosing a value a form or a filter submits is BbRadioGroup `variant="pill"` (several values: BbCheckboxGroup `variant="pill"`). See "Switch views or pick a value" above. On/off toggles that are not one choice are `BbButton` with `v-model` (it owns `aria-pressed`; `group` fuses them).
98
98
  5. **Hand-built sortable headers: your own `aria-sort`, sort arrows and click handlers on `<th>`** → BbTable `sortable` columns + `v-model:sort` `[sort-header]`
@@ -145,9 +145,9 @@ Each row: what you will find, how to find it, and what to write instead.
145
145
  - Write: `const ok = await confirm({ title: 'Delete invoice?', variant: 'destructive' });`
146
146
  - The OK button takes the variant too. A row menu's delete item takes `variant: 'destructive'` on the item.
147
147
 
148
- 14. **Your own mobile check: a `useIsMobile`, `window.matchMedia(…)` or an `innerWidth` comparison deciding layout** → `useMobile()` from bitboss-ui `[media-query]`
148
+ 14. **Your own mobile check: a `useIsMobile`, a `window.matchMedia(…)` width or pointer query, or an `innerWidth` comparison deciding layout** → `useMobile()` from bitboss-ui `[media-query]`
149
149
 
150
- - Find: `rg -n -g '*.{vue,ts,js}' '\buseIsMobile\b|window\.matchMedia\(|innerWidth\s*[<>]'`
150
+ - Find: `rg -n -g '*.{vue,ts,js}' '\buseIsMobile\b|window\.matchMedia\(\s*[\x27"\x60][^\x27"\x60]*\b(?:(?:min-|max-)?width|(?:any-)?pointer)\b|innerWidth\s*[<>]'`
151
151
  - Write: `const { isMobile } = useMobile();`
152
152
  - It is the same breakpoint the adaptive overlays switch at (`mobileMaxWidth`), so the app and the library never disagree.
153
153
 
@@ -159,5 +159,8 @@ buttons (`text`, `variant`, `size`, icons, `iconOnly`, `block`).
159
159
 
160
160
  The Inertia helpers' `usePromiseRouter` / `usePromiseForm` reject with a
161
161
  `BbValidationError` on a validation error (the bag under `.errors`) instead of
162
- the bare bag; a `.catch` that read the bag reads `error.errors`. Their
162
+ the bare bag; a `.catch` that read the bag reads `error.errors`.
163
+ `BbValidationError` extends `Error`, so a `.catch` that took
164
+ `error instanceof Error` to mean "not a validation error" now catches 422s
165
+ too: test `error instanceof BbValidationError` first. Their
163
166
  `useConfirmOnRouteLeave` takes `ok` / `cancel` too.
@@ -2940,6 +2940,30 @@ nullValue }, BbTextarea: { nullValue } }`, same values (`'null'` /
2940
2940
  ignored and the default buttons show
2941
2941
  ([use-confirm](./components/use-confirm.md)).
2942
2942
 
2943
+ 166. **BbAlert has no empty title or icon containers** (after
2944
+ 3.0.0-beta.73). With no `title` (prop or slot) the alert renders no
2945
+ `.bb-alert__title`, and with no icon no `.bb-alert__icon-container`.
2946
+ A selector that matched them empty (`:has(.bb-alert__title:empty)`)
2947
+ silently stops matching: write `:not(:has(.bb-alert__title))` for a
2948
+ body-only alert, `:not(:has(.bb-alert__icon-container))` for one with
2949
+ no icon. Drop `pt:title="hidden"` and
2950
+ `[&_.bb-alert__icon-container]:hidden` workarounds.
2951
+
2952
+ 167. **BbTable paints its own surface** (after 3.0.0-beta.73). A table
2953
+ paints `--bg` (default `--bb-panel`) at rest, so on a surface of
2954
+ another colour it now shows the panel colour instead of the surface.
2955
+ Set `--bg` once on the table to blend in; pinned cells and the stuck
2956
+ header follow:
2957
+
2958
+ ```css
2959
+ .my-card .bb-table {
2960
+ --bg: var(--card-bg);
2961
+ }
2962
+ ```
2963
+
2964
+ A nested table still paints nothing. A `background: var(--bg)` on a
2965
+ `.bb-table.card` class is now redundant.
2966
+
2943
2967
  ## 7. Class overrides → variants
2944
2968
 
2945
2969
  ### The v2 pattern to hunt down
@@ -99,6 +99,8 @@ it):
99
99
  Since 3.0.0-beta.58 the index rows carry no `file` (it is
100
100
  `files.component` with the name) and `tree` only when `false`; the
101
101
  `types.<usage>.json` files write `usedBy` as `"BbTable.prop.columns"` strings.
102
+ Since 3.0.0-beta.74 each `types.<usage>.json` says its `usage` once, at the
103
+ top, and its rows leave it out.
102
104
  In `components.json` itself, a type whose resolved `fields` say everything
103
105
  drops its `definition` (a generic, an index signature or a top-level union
104
106
  keeps it), and `BbOffCanvasProps` points at its component instead of copying
@@ -286,4 +288,5 @@ What changed in the install and build-plugin setup during the 3.0 betas, for an
286
288
  | `mcp` plugin option | `mcp: true` registered the MCP server on dev start | Removed in 3.0.0-beta.69: the build stops on it as an unknown option. `ai` (default `true`) sets up the agent files and the server, from installs and the dev server | Delete `mcp`. For none of it: `ai: false`, or `BITBOSS_UI_AI=0` on one machine |
287
289
  | `ai-init` (and `--no-mcp`) | Wrote the agent files, `--no-mcp` without the MCP server | Removed in 3.0.0-beta.69: exits 1 and names `update --no-install`. Files and server are one setting | `npx bitboss-ui update --no-install`; for none of it, `ai: false` in the build plugin, or `BITBOSS_UI_AI=0` on one machine |
288
290
  | `allowComponents` for `check` | `package.json` `"bitboss-ui": { "allowComponents": [...] }` or `bitboss-ui.check.json` | Read only from the build plugin, as a literal (3.0.0-beta.69); the old places are ignored, so those tags are reported again | Move the list into `bitbossUi({ allowComponents: [...] })` (Nuxt: `bitboss`). `registeredRules` and `dialogIdsWhitelist` stay in `bitboss-ui.check.json` |
291
+ | Reporting opt-out | None: an app could not turn reporting off | `"bitboss-ui": { "report": false }` in `package.json` (3.0.0-beta.74): no `report` command, no MCP `report_issue`, no reporting section in the agent files | Add it to opt out; on by default |
289
292
  | Cursor, Windsurf and Copilot rule files | `ai-init` wrote `.cursor/rules/bitboss-ui.mdc`, `.windsurf/rules/bitboss-ui.md` and a block in `.github/copilot-instructions.md` | Removed by `setup` and `update` (3.0.0-beta.69): those harnesses read `AGENTS.md`, and Zed read the Copilot file instead of it | Commit the deletions |
@@ -40,6 +40,7 @@ customer's `id`.
40
40
  | has its own logic: state, computed props it derives, extra props it reads, markup around the control | an SFC: [options-items-playbook](./options-items-playbook.md) § Wrapping BbSelect in your own component |
41
41
  | is used on one page | neither: write the props on `BbSelect` there |
42
42
  | only restyles parts, everywhere or in one area | neither: `pt` in the plugin config, or a named scope ([passthrough](./passthrough.md)) |
43
+ | is a second look of one component, picked per instance (a dialog with a lined header) | a **preset** whose `pt` holds the look (step 2, `SeparatedDialog`) |
43
44
 
44
45
  ## 1. Copy the helper
45
46
 
@@ -517,7 +518,7 @@ One `.ts` file per domain, next to the data they read:
517
518
  ```ts no-check
518
519
  // src/components/customers.ts
519
520
  import { h } from 'vue';
520
- import { BbBadge, BbSelect, BbTextInput } from 'bitboss-ui';
521
+ import { BbBadge, BbDialog, BbSelect, BbTextInput } from 'bitboss-ui';
521
522
  import { definePreset } from '@/lib/definePreset';
522
523
  import { getCustomers, type Customer } from '@/api/customers';
523
524
 
@@ -547,6 +548,14 @@ export const CustomerMultiSelect = definePreset(BbSelect<Customer>, {
547
548
  multiple: true,
548
549
  });
549
550
 
551
+ // A second look of one component, picked per instance: no SFC wrapper, so
552
+ // every BbDialog prop, event and slot stays typed for the caller.
553
+ export const SeparatedDialog = definePreset(
554
+ BbDialog,
555
+ { pt: { header: 'border-b', footer: 'border-t' } },
556
+ { name: 'SeparatedDialog' }
557
+ );
558
+
550
559
  // Any component, not only selects.
551
560
  export const SearchInput = definePreset(
552
561
  BbTextInput,
@@ -616,7 +625,11 @@ is a `.ts` module, not an `.vue` file.
616
625
  `:pt`; a default, the caller's `:pt` replaces it whole. Either way an
617
626
  instance still adds its own look with the attribute form
618
627
  (`<CustomerSelect pt:option="font-medium" />`), which merges over the
619
- preset's, so a one-off look needs no second preset.
628
+ preset's, so a one-off look needs no second preset. The merge is the
629
+ passthrough rule ([passthrough](./passthrough.md) § What merging means):
630
+ the preset's `pt` object first, then the caller's `pt:<part>`; a class
631
+ appends, and a conflicting utility from the caller replaces the preset's
632
+ (`<SeparatedDialog pt:header="border-b-2">` drops `border-b`).
620
633
 
621
634
  ## Limits
622
635
 
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: Reporting to the maintainers
3
+ summary: When you work around bitboss-ui or hit a bug, friction, glue, smell, missing feature or docs gap, report it and keep your workaround — the six kinds, `npx bitboss-ui report`, the MCP `report_issue` tool, and a curl one-liner.
4
+ ---
5
+
6
+ # Reporting to the maintainers
7
+
8
+ Whenever you work around the library, or hit one of these, report it to the
9
+ maintainers, then keep your workaround in place: a report never waits on a fix.
10
+
11
+ - `bug`: The library does the wrong thing.
12
+ - `friction`: It works, but getting there took trial and error, or the docs or types misled you.
13
+ - `glue`: Code you had to write around the library for a common need (a wrapper, an adapter, wiring you repeat across screens). Put the glue in `snippet`.
14
+ - `smell`: It works, but something feels wrong: an inconsistent API, an odd name, a surprising default.
15
+ - `feature`: Something the library doesn't do and should.
16
+ - `docs`: Docs that are wrong, missing or unfindable.
17
+
18
+ With the MCP server connected, call `report_issue`. Otherwise
19
+ `npx bitboss-ui report --kind friction --component BbSelect --expected "…" --actual "…"`
20
+ (it fills in the installed version and prints the report id and a status URL),
21
+ or, with nothing installed:
22
+
23
+ ```sh
24
+ curl -sS https://ui-components.bitboss.it/api/report -H 'content-type: application/json' -d '{"kind":"bug","component":"BbSelect","version":"<installed bitboss-ui version>","expected":"…","actual":"…"}'
25
+ ```
26
+
27
+ `component` is the `Bb*` name or the surface (`cli`, `mcp`, `vite-plugin`,
28
+ `nuxt-module`, `docs`, `other`); `workaround` and `snippet` are optional.
29
+ Send a minimal repro only: never app data, customer data, secrets or
30
+ proprietary code.
31
+
32
+ Each report gets an id and a status URL that says when it is fixed and in
33
+ which version. The human-facing guide: https://ui-components.bitboss.it/en/guides/reporting
34
+
35
+ ## Turning reporting off
36
+
37
+ Reporting is on by default. An app turns it off in its `package.json`:
38
+
39
+ ```json
40
+ {
41
+ "bitboss-ui": { "report": false }
42
+ }
43
+ ```
44
+
45
+ Then `npx bitboss-ui report` refuses ("reporting is off in this project:
46
+ package.json bitboss-ui.report"), the MCP server does not offer
47
+ `report_issue`, and the next `npx bitboss-ui update` (or install) drops the
48
+ reporting section from the agent files (`AGENTS.md`, the skill). Remove the
49
+ key, or set it to `true`, to turn it back on.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": 1,
3
- "version": "3.0.0-beta.72",
3
+ "version": "3.0.0-beta.74",
4
4
  "canon": "bb-canon/2",
5
5
  "folder": "inertia-helpers",
6
6
  "helpers": {
@@ -11,9 +11,7 @@
11
11
  "useAsyncFn.ts",
12
12
  "utils.ts"
13
13
  ],
14
- "packages": [
15
- "object-code"
16
- ],
14
+ "packages": [],
17
15
  "typePackages": []
18
16
  },
19
17
  "useConfirmOnRouteLeave": {
@@ -44,9 +42,7 @@
44
42
  "useHasChanged.ts",
45
43
  "utils.ts"
46
44
  ],
47
- "packages": [
48
- "object-code"
49
- ],
45
+ "packages": [],
50
46
  "typePackages": []
51
47
  },
52
48
  "useIndexById": {
@@ -65,9 +61,7 @@
65
61
  "useLazyProp.ts",
66
62
  "utils.ts"
67
63
  ],
68
- "packages": [
69
- "object-code"
70
- ],
64
+ "packages": [],
71
65
  "typePackages": [
72
66
  "@inertiajs/core"
73
67
  ]
@@ -80,9 +74,7 @@
80
74
  "useLazyPropGetter.ts",
81
75
  "utils.ts"
82
76
  ],
83
- "packages": [
84
- "object-code"
85
- ],
77
+ "packages": [],
86
78
  "typePackages": [
87
79
  "@inertiajs/core"
88
80
  ]
@@ -107,7 +99,6 @@
107
99
  ],
108
100
  "packages": [
109
101
  "@vueuse/core",
110
- "object-code",
111
102
  "query-string"
112
103
  ],
113
104
  "typePackages": [
@@ -183,9 +174,7 @@
183
174
  "useResourceContext.ts",
184
175
  "utils.ts"
185
176
  ],
186
- "packages": [
187
- "object-code"
188
- ],
177
+ "packages": [],
189
178
  "typePackages": []
190
179
  },
191
180
  "useRouteQuery": {
@@ -226,7 +215,6 @@
226
215
  ],
227
216
  "packages": [
228
217
  "@vueuse/core",
229
- "object-code",
230
218
  "query-string"
231
219
  ],
232
220
  "typePackages": [
@@ -241,8 +229,7 @@
241
229
  "utils.ts"
242
230
  ],
243
231
  "packages": [
244
- "@vueuse/core",
245
- "object-code"
232
+ "@vueuse/core"
246
233
  ],
247
234
  "typePackages": []
248
235
  },
@@ -253,9 +240,7 @@
253
240
  "useUntil.ts",
254
241
  "utils.ts"
255
242
  ],
256
- "packages": [
257
- "object-code"
258
- ],
243
+ "packages": [],
259
244
  "typePackages": []
260
245
  }
261
246
  },
@@ -407,12 +392,11 @@
407
392
  }
408
393
  },
409
394
  "useHasChanged.ts": {
410
- "sha256": "166cb83201b372f3ee700295be475cc2b2529451571dd2c71ae81c81253dc19a",
395
+ "sha256": "8a85e5b1bdfa23cdafaba1f91b50b6a8b07132cf0a74785f64e6ac0dceaa1ccd",
411
396
  "local": [
412
397
  "utils.ts"
413
398
  ],
414
399
  "packages": [
415
- "object-code",
416
400
  "vue"
417
401
  ],
418
402
  "typePackages": [],
@@ -420,17 +404,20 @@
420
404
  "bytes": [
421
405
  "3de762ee9ba9bc2afe1f78b130b2ccce0143e2d48e97a0bc72587d55e4f795b8",
422
406
  "98b59218f44200ea303363e2b4c9271bd3708facaa7e146bb42f826cc3e4b67c",
423
- "166cb83201b372f3ee700295be475cc2b2529451571dd2c71ae81c81253dc19a"
407
+ "166cb83201b372f3ee700295be475cc2b2529451571dd2c71ae81c81253dc19a",
408
+ "8a85e5b1bdfa23cdafaba1f91b50b6a8b07132cf0a74785f64e6ac0dceaa1ccd"
424
409
  ],
425
410
  "babel7": [
426
411
  "936e9e61ba7ff6864324aefab715bf90082beffd8c865af21fa5a76470723738",
427
412
  "fa29993412de2d139343920d3a64b3e01e3ddb55c2f51fcef091db343844550c",
428
- "36163aff97a032db1694675df758422c05c704cb410c051a2bdd5a100dcd6196"
413
+ "36163aff97a032db1694675df758422c05c704cb410c051a2bdd5a100dcd6196",
414
+ "9578ab8c911f879a4ac98b271ab62cc187dec3e1b0d3b56b77f997458f8ba916"
429
415
  ],
430
416
  "comments": [
431
417
  "bf8fce3cdc5bac55",
432
418
  "d8e8442a1fbe5eb7",
433
- "43353dc420f29bc9"
419
+ "43353dc420f29bc9",
420
+ "888973bbdfc22b94"
434
421
  ]
435
422
  }
436
423
  },
@@ -657,7 +644,7 @@
657
644
  }
658
645
  },
659
646
  "useQuery.ts": {
660
- "sha256": "56f220a470acfb24ad949b312a3e77d0e79549a04b198ab1c8e9324227b8565a",
647
+ "sha256": "38e4452460583e07821fdec4c762be2080bad6fea1df631c15bd9efabe2a98a9",
661
648
  "local": [],
662
649
  "packages": [
663
650
  "@inertiajs/vue3",
@@ -671,17 +658,20 @@
671
658
  "bytes": [
672
659
  "979ff258297d99c2362eacceb0cc3be78d66a96c63028e513758226cd1e801b7",
673
660
  "9e50ce2bcbddd5fd0c0da520857bafe6d1ed9670d409681b3dbf447add7c0068",
674
- "56f220a470acfb24ad949b312a3e77d0e79549a04b198ab1c8e9324227b8565a"
661
+ "56f220a470acfb24ad949b312a3e77d0e79549a04b198ab1c8e9324227b8565a",
662
+ "38e4452460583e07821fdec4c762be2080bad6fea1df631c15bd9efabe2a98a9"
675
663
  ],
676
664
  "babel7": [
677
665
  "94978e291f630de7f0a749ce8f4d0128ac84704e373185a59d8b2cd4516c2fd1",
678
666
  "784a79779948e54fb76b5eaad269710ae8329b6c0e9a459cb51001d871be450e",
679
- "ca5413cc782d6897d125be1957224f6199d4bba400b39e489372b6401d4d9475"
667
+ "ca5413cc782d6897d125be1957224f6199d4bba400b39e489372b6401d4d9475",
668
+ "23a014ac5b9077b85dcb100fb52f09c43b3de7211daad78bde94d030d625c9f5"
680
669
  ],
681
670
  "comments": [
682
671
  "f6596b3db376d3a1",
683
672
  "a06980f30178d158",
684
- "45c09dab9b363541"
673
+ "45c09dab9b363541",
674
+ "8ddde8d98fe25041"
685
675
  ]
686
676
  }
687
677
  },
@@ -885,27 +875,33 @@
885
875
  }
886
876
  },
887
877
  "utils.ts": {
888
- "sha256": "0c873528be9b6ad02ab3db1dd7ac862e0a7cf2e783998b599a3ad977670ded3d",
878
+ "sha256": "5d0e5f4cf62ca9ffb3501afe261189950a6311f941afd52ef2cc333dfb97b197",
889
879
  "local": [],
890
880
  "packages": [
891
- "object-code"
881
+ "vue"
892
882
  ],
893
883
  "typePackages": [],
894
884
  "published": {
895
885
  "bytes": [
896
886
  "061f0964ce81782184b22349d2c82d0e39f312f33dd306aa2f66a9b50a0d060c",
897
887
  "f1cb5dd057c1bf36c3ea3583b311f9006405d453897c3e6d4ced4dd3bad1770d",
898
- "0c873528be9b6ad02ab3db1dd7ac862e0a7cf2e783998b599a3ad977670ded3d"
888
+ "0c873528be9b6ad02ab3db1dd7ac862e0a7cf2e783998b599a3ad977670ded3d",
889
+ "c7d5e7a351f56aefa81bf2aa08faed1d85ccdfb87310e97fa7e55be7ee68ac70",
890
+ "5d0e5f4cf62ca9ffb3501afe261189950a6311f941afd52ef2cc333dfb97b197"
899
891
  ],
900
892
  "babel7": [
901
893
  "4c2e265aa720610891b245c075f10a098730a793122c6a4d3a49f3c6ce61dad7",
902
894
  "402ddf2de96eaa8aa1eb67c0e6b99c02703cdad6537f211772229638c30bc63e",
903
- "676f33bbd5a3de4ecd2a134822e20d9a0461d79686ba93bcb988a119e9742d7f"
895
+ "676f33bbd5a3de4ecd2a134822e20d9a0461d79686ba93bcb988a119e9742d7f",
896
+ "f9d7198a52975adaaa73e337083653ae50bbdffea61149aec6529010a77c018a",
897
+ "da4bcb272fdfd80687cb5e31e94d128dbf7edf193c38f4d84429ff3ccab40b58"
904
898
  ],
905
899
  "comments": [
906
900
  "22b5b487044541f3",
907
901
  "eb874b2879385d97",
908
- "30494930fc5e32c5"
902
+ "30494930fc5e32c5",
903
+ "b468d4e41b38d9b6",
904
+ "2d1705a27e87a212"
909
905
  ]
910
906
  }
911
907
  }
@@ -914,7 +910,6 @@
914
910
  "@inertiajs/core": "3.1.1",
915
911
  "@inertiajs/vue3": "3.1.1",
916
912
  "@vueuse/core": "14.3.0",
917
- "object-code": "2.0.0",
918
913
  "query-string": "9.4.1",
919
914
  "vue": "3.5.44"
920
915
  }
@@ -1,54 +1,42 @@
1
1
  // inertia-helpers/useHasChanged.ts
2
- import { isPlainObject } from './utils';
3
- import { hash } from 'object-code';
4
- import { computed, ref, toValue, type WatchSource } from 'vue';
2
+ import { hash } from './utils';
3
+ import { computed, ref, toValue, watch, type WatchSource } from 'vue';
5
4
 
6
5
  export function useHasChanged<T extends WatchSource<unknown>[]>(
7
6
  dependencies: T
8
7
  ) {
9
8
  /*
10
- * The baseline is a structural HASH, not a copy. A copy has to survive the
11
- * values a form holds: a JSON round-trip turns a Date into a string, a File,
12
- * Set or Map into `{}`, drops `undefined` (and throws on a bare one), so
13
- * an untouched form read as changed; `structuredClone` throws on Vue proxies.
14
- * `object-code` hashes straight through a proxy and keeps Dates (by time),
15
- * Sets / Maps (by entries), `undefined` and NaN apart, and a number is all
16
- * the baseline needs to hold. It hashes every File alike (no own keys), so
17
- * a File is read by name, size, type and date first: picking another file
18
- * over a picked one counts as a change.
9
+ * The baseline is an exact KEY (`hash`), not a copy. A copy has to survive
10
+ * the values a form holds: a JSON round-trip turns a Date into a string, a
11
+ * File, Set or Map into `{}`, drops `undefined` (and throws on a bare one),
12
+ * so an untouched form read as changed; `structuredClone` throws on Vue
13
+ * proxies. `hash` reads straight through a proxy and encodes every value
14
+ * exactly: numbers to the last bit (2400 is not 2400.5), Dates by time,
15
+ * Sets / Maps by content, Files by name, size, type and date, `undefined`
16
+ * and NaN apart.
19
17
  */
20
- const snapshot = (dep: WatchSource<unknown>) =>
21
- hash(withFileFingerprints(toValue(dep)));
18
+ const snapshot = (dep: WatchSource<unknown>) => hash(toValue(dep));
22
19
 
23
- const baselines = ref<number[]>(dependencies.map(snapshot));
20
+ const baselines = ref<string[]>(dependencies.map(snapshot));
24
21
 
25
22
  /** Re-baseline (call after a successful save). */
26
23
  const takeSnapshot = (): void => {
27
24
  baselines.value = dependencies.map(snapshot);
28
25
  };
29
26
 
30
- const hasChanged = computed(() =>
31
- dependencies.some((dep, index) => snapshot(dep) !== baselines.value[index])
32
- );
27
+ /*
28
+ * `hash` reads values raw, so it subscribes to nothing: a deep watch
29
+ * bumps `edits` on every change, and that is what re-runs `hasChanged`.
30
+ */
31
+ const edits = ref(0);
32
+ watch(dependencies, () => edits.value++, { deep: true, flush: 'sync' });
33
+
34
+ const hasChanged = computed(() => {
35
+ void edits.value;
36
+ return dependencies.some(
37
+ (dep, index) => snapshot(dep) !== baselines.value[index]
38
+ );
39
+ });
33
40
 
34
41
  return { hasChanged, takeSnapshot };
35
42
  }
36
-
37
- const withFileFingerprints = (value: unknown): unknown =>
38
- value instanceof Blob
39
- ? [
40
- value.size,
41
- value.type,
42
- (value as Partial<File>).name,
43
- (value as Partial<File>).lastModified,
44
- ]
45
- : Array.isArray(value)
46
- ? value.map(withFileFingerprints)
47
- : isPlainObject(value)
48
- ? Object.fromEntries(
49
- Object.entries(value).map(([key, item]) => [
50
- key,
51
- withFileFingerprints(item),
52
- ])
53
- )
54
- : value;
@@ -8,10 +8,16 @@ import { shallowRef } from 'vue';
8
8
  /**
9
9
  * How arrays sit in the query string, for every helper that reads or writes
10
10
  * it: `tags=a,b`, what Spatie QueryBuilder parses. Change it here, once —
11
- * a reader and a writer that disagree turn an array into a string.
11
+ * a reader and a writer that disagree turn an array into a string. Under
12
+ * `'bracket'` (`tags[]=a&tags[]=b`, what Laravel's `array` rule validates),
13
+ * Laravel's own indexed `tags[0]=a&tags[1]=b` (in `page.url` and pager
14
+ * links) reads as the same array, and a write to `tags` replaces either form.
12
15
  */
13
16
  export const QUERY_ARRAY_FORMAT = 'comma';
14
17
 
18
+ /** A `[]` or `[0]` suffix, raw or percent-encoded: `tags[]`, `tags%5B0%5D`. */
19
+ const ARRAY_SUFFIX = /(?:\[|%5B)\d*(?:\]|%5D)$/i;
20
+
15
21
  /** A URL's parts. The first `?` starts the query; a `#` ends it. */
16
22
  export const splitUrl = (url: string) => {
17
23
  const hashAt = url.indexOf('#');
@@ -68,7 +74,10 @@ export const withQuery = (
68
74
  .split('&')
69
75
  .filter(Boolean)
70
76
  .flatMap((part) => {
71
- const key = decodeKey(part.split('=')[0] ?? '');
77
+ // `tags[]` and `tags[0]` are `tags`: a write owns every part of its key.
78
+ const key = decodeKey(
79
+ (part.split('=')[0] ?? '').replace(ARRAY_SUFFIX, '')
80
+ );
72
81
  if (!(key in changes)) return [part];
73
82
  if (written.has(key)) return [];
74
83
  written.add(key);
@@ -127,10 +136,19 @@ export const parseQuery = (
127
136
  if (!query) return {};
128
137
  // `qs.parse` decodes once. An encoded comma separates too: Laravel's pager
129
138
  // links write `a%2Cb`, which PHP decodes to `a,b` before Spatie splits it.
130
- return qs.parse(
131
- arrayFormat === 'comma' ? query.replace(/%2C/gi, ',') : query,
132
- { arrayFormat }
133
- );
139
+ if (arrayFormat === 'comma')
140
+ return qs.parse(query.replace(/%2C/gi, ','), { arrayFormat });
141
+ if (arrayFormat !== 'bracket') return qs.parse(query, { arrayFormat });
142
+ // Laravel's indexed `tags[0]=a&tags[1]=b` reads as `tags[]=a&tags[]=b`.
143
+ const unindexed = query
144
+ .split('&')
145
+ .map((part) => {
146
+ const at = part.indexOf('=');
147
+ const key = at < 0 ? part : part.slice(0, at);
148
+ return key.replace(ARRAY_SUFFIX, '[]') + (at < 0 ? '' : part.slice(at));
149
+ })
150
+ .join('&');
151
+ return qs.parse(unindexed, { arrayFormat });
134
152
  };
135
153
 
136
154
  export const useQuery = ({