bitboss-ui 3.0.0-beta.63 → 3.0.0-beta.64
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/README.md +25 -20
- package/bin/bitboss-ui.mjs +73 -7
- package/dist/ai/BbAlert.md +10 -1
- package/dist/ai/BbBadge.md +35 -3
- package/dist/ai/BbBadgeButton.md +4 -2
- package/dist/ai/BbBaseButton.md +9 -3
- package/dist/ai/BbBreadcrumbs.md +2 -2
- package/dist/ai/BbButton.md +113 -8
- package/dist/ai/BbCheckbox.md +1 -1
- package/dist/ai/BbCheckboxGroup.md +94 -6
- package/dist/ai/BbColorInput.md +4 -1
- package/dist/ai/BbColorPalette.md +2 -1
- package/dist/ai/BbConfirm.md +7 -3
- package/dist/ai/BbDatePicker.md +2 -1
- package/dist/ai/BbDatePickerInput.md +4 -1
- package/dist/ai/BbDialog.md +12 -11
- package/dist/ai/BbDropdown.md +189 -38
- package/dist/ai/BbDropdownButton.md +27 -7
- package/dist/ai/BbForm.md +55 -22
- package/dist/ai/BbHost.md +2 -2
- package/dist/ai/BbHoverCard.md +7 -3
- package/dist/ai/BbIcon.md +12 -6
- package/dist/ai/BbIndicator.md +11 -1
- package/dist/ai/BbNumberInput.md +4 -1
- package/dist/ai/BbOffCanvas.md +37 -3
- package/dist/ai/BbPopover.md +2 -1
- package/dist/ai/BbRadio.md +1 -1
- package/dist/ai/BbRadioGroup.md +102 -10
- package/dist/ai/BbSelect.md +52 -17
- package/dist/ai/BbSelectPopover.md +93 -26
- package/dist/ai/BbSwitch.md +1 -1
- package/dist/ai/BbSwitchGroup.md +30 -3
- package/dist/ai/BbTable.md +17 -10
- package/dist/ai/BbTabs.md +8 -3
- package/dist/ai/BbTabsList.md +4 -1
- package/dist/ai/BbTag.md +5 -2
- package/dist/ai/BbTextInput.md +4 -1
- package/dist/ai/BbTextarea.md +4 -1
- package/dist/ai/BbTimePicker.md +2 -1
- package/dist/ai/BbTimePickerInput.md +4 -1
- package/dist/ai/BbToast.md +9 -3
- package/dist/ai/BbTooltip.md +71 -9
- package/dist/ai/ChipsBox.md +1 -1
- package/dist/ai/CommonField.md +1 -1
- package/dist/ai/OptionsContainer.md +42 -0
- package/dist/ai/changelog.json +416 -6
- package/dist/ai/components.json +50 -48
- package/dist/ai/composables/useConfirm.md +39 -1
- package/dist/ai/design-tokens.json +6 -6
- package/dist/ai/guides/agent-contract.md +2 -2
- package/dist/ai/guides/ai-router.md +24 -23
- package/dist/ai/guides/app-layout.md +5 -0
- package/dist/ai/guides/component-picker.md +9 -2
- package/dist/ai/guides/design-language.md +24 -24
- package/dist/ai/guides/design-tokens.md +15 -8
- package/dist/ai/guides/icons-policy.md +9 -2
- package/dist/ai/guides/inertia-helpers.md +79 -49
- package/dist/ai/guides/installation-and-plugin-setup.md +12 -2
- package/dist/ai/guides/migration/adoption-checklist.md +235 -0
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +16 -15
- package/dist/ai/guides/migration/components/bb-dialog.md +9 -9
- package/dist/ai/guides/migration/components/bb-dropdown.md +7 -2
- package/dist/ai/guides/migration/components/bb-popover.md +4 -2
- package/dist/ai/guides/migration/components/bb-select.md +19 -0
- package/dist/ai/guides/migration/components/bb-table.md +1 -0
- package/dist/ai/guides/migration/components/bb-toast.md +4 -0
- package/dist/ai/guides/migration/components/bb-tooltip.md +15 -12
- package/dist/ai/guides/migration/components/use-confirm.md +25 -2
- package/dist/ai/guides/migration/v2-to-v3.md +163 -9
- package/dist/ai/guides/migration/v3-beta-css-classes.md +7 -3
- package/dist/ai/guides/options-items-playbook.md +2 -1
- package/dist/ai/guides/passthrough.md +147 -85
- package/dist/ai/guides/preset-components.md +140 -15
- package/dist/ai/helpers/definePreset.json +7 -0
- package/dist/ai/helpers/definePreset.ts +123 -11
- package/dist/ai/helpers/inertia/manifest.json +15 -9
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +4 -4
- package/dist/ai/helpers/inertia/usePaginatedResponseContext.ts +39 -24
- package/dist/ai/helpers/inertia/useRouteQuery.ts +10 -4
- package/dist/ai/index.md +1 -0
- package/dist/ai/manifest/common.json +0 -1
- package/dist/ai/manifest/components/BbAlert.json +7 -2
- package/dist/ai/manifest/components/BbBadge.json +13 -4
- package/dist/ai/manifest/components/BbBadge.tree.json +2 -0
- package/dist/ai/manifest/components/BbBadgeButton.json +4 -2
- package/dist/ai/manifest/components/BbBaseButton.json +4 -2
- package/dist/ai/manifest/components/BbBreadcrumbs.tree.json +1 -1
- package/dist/ai/manifest/components/BbButton.json +14 -3
- package/dist/ai/manifest/components/BbButton.tree.json +5 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.json +13 -8
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +11 -1
- package/dist/ai/manifest/components/BbColorInput.json +18 -15
- package/dist/ai/manifest/components/BbColorPalette.json +1 -1
- package/dist/ai/manifest/components/BbConfirm.json +4 -2
- package/dist/ai/manifest/components/BbConfirm.tree.json +1 -1
- package/dist/ai/manifest/components/BbDatePicker.json +1 -1
- package/dist/ai/manifest/components/BbDatePickerInput.json +17 -14
- package/dist/ai/manifest/components/BbDialog.tree.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.json +24 -19
- package/dist/ai/manifest/components/BbDropdown.tree.json +9 -2
- package/dist/ai/manifest/components/BbDropdownButton.json +33 -20
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -2
- package/dist/ai/manifest/components/BbForm.json +2 -2
- package/dist/ai/manifest/components/BbHost.tree.json +1 -1
- package/dist/ai/manifest/components/BbHoverCard.json +1 -1
- package/dist/ai/manifest/components/BbIndicator.json +8 -2
- package/dist/ai/manifest/components/BbNumberInput.json +5 -2
- package/dist/ai/manifest/components/BbOffCanvas.json +2 -2
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +1 -1
- package/dist/ai/manifest/components/BbPopover.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +17 -12
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +8 -1
- package/dist/ai/manifest/components/BbSelect.json +21 -18
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -2
- package/dist/ai/manifest/components/BbSelectPopover.json +10 -10
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +3 -2
- package/dist/ai/manifest/components/BbSwitchGroup.json +1 -1
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +3 -1
- package/dist/ai/manifest/components/BbTable.tree.json +14 -1
- package/dist/ai/manifest/components/BbTabs.json +9 -6
- package/dist/ai/manifest/components/BbTabs.tree.json +1 -1
- package/dist/ai/manifest/components/BbTabsList.json +6 -3
- package/dist/ai/manifest/components/BbTag.json +19 -16
- package/dist/ai/manifest/components/BbTag.tree.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.json +6 -3
- package/dist/ai/manifest/components/BbTextarea.json +6 -3
- package/dist/ai/manifest/components/BbTimePicker.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.json +10 -7
- package/dist/ai/manifest/components/BbToast.json +7 -2
- package/dist/ai/manifest/components/BbToast.tree.json +4 -2
- package/dist/ai/manifest/components/BbTooltip.json +6 -5
- package/dist/ai/manifest/components/ChipsBox.tree.json +1 -1
- package/dist/ai/manifest/components/CommonField.json +1 -1
- package/dist/ai/manifest/components/OptionsContainer.json +3 -1
- package/dist/ai/manifest/components/OptionsContainer.tree.json +38 -0
- package/dist/ai/manifest/index.json +3 -3
- package/dist/ai/manifest/meta.json +5 -3
- package/dist/ai/manifest/types.advanced.json +5 -2
- package/dist/ai/manifest/types.api.json +9 -7
- package/dist/ai/recipes/inertia/layout-scaffold.md +19 -6
- package/dist/ai/recipes/inertia/records-workspace.md +49 -13
- package/dist/ai/recipes/nuxt/layout-scaffold.md +19 -6
- package/dist/ai/recipes/nuxt/records-workspace.md +42 -12
- package/dist/ai/recipes/vue/layout-scaffold.md +19 -6
- package/dist/ai/recipes/vue/records-workspace.md +42 -12
- package/dist/ai/source/BbAlert.md +94 -76
- package/dist/ai/source/BbBadge.md +174 -72
- package/dist/ai/source/BbBadgeButton.md +130 -65
- package/dist/ai/source/BbBaseButton.md +46 -124
- package/dist/ai/source/BbBaseCheckboxIcon.md +38 -0
- package/dist/ai/source/BbBaseRadioIcon.md +18 -0
- package/dist/ai/source/BbBaseSwitchIcon.md +51 -0
- package/dist/ai/source/BbButton.md +153 -36
- package/dist/ai/source/BbCheckboxGroup.md +142 -18
- package/dist/ai/source/BbColorInput.md +240 -204
- package/dist/ai/source/BbColorPalette.md +7 -4
- package/dist/ai/source/BbConfirm.md +34 -11
- package/dist/ai/source/BbConfirmPortal.md +24 -9
- package/dist/ai/source/BbDatePicker.md +11 -7
- package/dist/ai/source/BbDatePickerInput.md +306 -269
- package/dist/ai/source/BbDialog.md +49 -14
- package/dist/ai/source/BbDropdown.md +314 -197
- package/dist/ai/source/BbDropdownButton.md +197 -31
- package/dist/ai/source/BbDropdownGroup.md +274 -176
- package/dist/ai/source/BbForm.md +50 -6
- package/dist/ai/source/BbHoverCard.md +12 -5
- package/dist/ai/source/BbIcon.md +4 -3
- package/dist/ai/source/BbIndicator.md +73 -52
- package/dist/ai/source/BbNumberInput.md +293 -257
- package/dist/ai/source/BbOffCanvas.md +55 -29
- package/dist/ai/source/BbPopover.md +14 -10
- package/dist/ai/source/BbRadioGroup.md +413 -297
- package/dist/ai/source/BbSelect.md +549 -435
- package/dist/ai/source/BbSelectPopover.md +128 -33
- package/dist/ai/source/BbSwitchGroup.md +70 -10
- package/dist/ai/source/BbTable.md +369 -37
- package/dist/ai/source/BbTabs.md +115 -39
- package/dist/ai/source/BbTabsList.md +106 -38
- package/dist/ai/source/BbTabsPanels.md +96 -36
- package/dist/ai/source/BbTabsRoot.md +96 -36
- package/dist/ai/source/BbTag.md +267 -233
- package/dist/ai/source/BbTextInput.md +261 -225
- package/dist/ai/source/BbTextarea.md +251 -215
- package/dist/ai/source/BbTimePicker.md +11 -7
- package/dist/ai/source/BbTimePickerInput.md +257 -220
- package/dist/ai/source/BbToast.md +73 -32
- package/dist/ai/source/BbToastPortal.md +65 -30
- package/dist/ai/source/BbTooltip.md +148 -113
- package/dist/ai/source/CommonPopover.md +6 -1
- package/dist/ai/source/FlatListBox.md +19 -9
- package/dist/ai/source/GroupedListBox.md +19 -9
- package/dist/ai/source/OptionsContainer.md +25 -9
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +61 -36
- package/dist/components/BbAlert/types.d.ts +9 -5
- package/dist/components/BbAlert/types.js +8 -3
- package/dist/components/BbBadge/BadgeBodyContent.vue.d.ts +3 -3
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +26 -17
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +103 -50
- package/dist/components/BbBadge/BbBadgeButton.vue_vue_type_script_setup_true_lang.js +20 -15
- package/dist/components/BbBadge/badgeButtonContext.d.ts +12 -1
- package/dist/components/BbBadge/types.d.ts +45 -15
- package/dist/components/BbBadge/types.js +12 -3
- package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +89 -126
- package/dist/components/BbBaseButton/types.d.ts +23 -4
- package/dist/components/BbBaseButton/types.js +7 -1
- package/dist/components/BbBaseButton/useLinkState.d.ts +41 -0
- package/dist/components/BbBaseButton/useLinkState.js +70 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +130 -74
- package/dist/components/BbButton/types.d.ts +50 -13
- package/dist/components/BbButton/types.js +10 -3
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +148 -95
- package/dist/components/BbCheckboxGroup/types.d.ts +34 -11
- package/dist/components/BbCheckboxGroup/types.js +9 -4
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +1 -1
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +134 -93
- package/dist/components/BbColorInput/types.d.ts +11 -4
- package/dist/components/BbColorInput/types.js +9 -3
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +82 -59
- package/dist/components/BbConfirm/types.d.ts +9 -4
- package/dist/components/BbConfirm/types.js +8 -3
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +68 -67
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +259 -215
- package/dist/components/BbDatePickerInput/types.d.ts +12 -5
- package/dist/components/BbDatePickerInput/types.js +9 -3
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +223 -219
- package/dist/components/BbDialog/useDialogStack.d.ts +1 -1
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +104 -89
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +1 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +323 -285
- package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +1 -0
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +411 -319
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +100 -98
- package/dist/components/BbDropdown/DropdownRow.vue.d.ts +4 -3
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +49 -28
- package/dist/components/BbDropdown/normalizeGroups.d.ts +6 -0
- package/dist/components/BbDropdown/normalizeGroups.js +21 -15
- package/dist/components/BbDropdown/types.d.ts +59 -12
- package/dist/components/BbDropdown/types.js +16 -3
- package/dist/components/BbDropdown/useDropdownContext.d.ts +6 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +2 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +179 -68
- package/dist/components/BbDropdownButton/types.d.ts +44 -16
- package/dist/components/BbDropdownButton/types.js +28 -3
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +111 -89
- package/dist/components/BbForm/formSchema.d.ts +13 -0
- package/dist/components/BbHoverCard/BbHoverCard.vue_vue_type_script_setup_true_lang.js +100 -100
- package/dist/components/BbIndicator/BbIndicator.vue_vue_type_script_setup_true_lang.js +40 -25
- package/dist/components/BbIndicator/types.d.ts +9 -5
- package/dist/components/BbIndicator/types.js +8 -3
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +243 -202
- package/dist/components/BbNumberInput/types.d.ts +12 -5
- package/dist/components/BbNumberInput/types.js +9 -3
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +1 -1
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +401 -399
- package/dist/components/BbOffCanvas/types.d.ts +6 -2
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +81 -80
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +158 -105
- package/dist/components/BbRadioGroup/types.d.ts +21 -7
- package/dist/components/BbRadioGroup/types.js +9 -4
- package/dist/components/BbSelect/BbSelect.vue.d.ts +4 -3
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +181 -137
- package/dist/components/BbSelect/types.d.ts +36 -22
- package/dist/components/BbSelect/types.js +22 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +4 -4
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +543 -532
- package/dist/components/BbSelectPopover/knownItems.d.ts +5 -0
- package/dist/components/BbSelectPopover/types.d.ts +46 -12
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbSwitchGroup/types.d.ts +14 -4
- package/dist/components/BbSwitchGroup/types.js +8 -3
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1102 -995
- package/dist/components/BbTable/estimatedFloors.golden.d.ts +25 -0
- package/dist/components/BbTable/measuredFloors.d.ts +46 -0
- package/dist/components/BbTable/measuredFloors.js +322 -0
- package/dist/components/BbTable/measuredFloorsTestKit.d.ts +27 -0
- package/dist/components/BbTable/textRuler.d.ts +71 -0
- package/dist/components/BbTable/textRuler.js +121 -0
- package/dist/components/BbTable/utils.d.ts +113 -6
- package/dist/components/BbTable/utils.js +118 -65
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +53 -35
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +62 -45
- package/dist/components/BbTabs/types.d.ts +26 -11
- package/dist/components/BbTabs/types.js +23 -8
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +205 -164
- package/dist/components/BbTag/types.d.ts +11 -4
- package/dist/components/BbTag/types.js +9 -3
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +98 -57
- package/dist/components/BbTextInput/types.d.ts +12 -5
- package/dist/components/BbTextInput/types.js +9 -3
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +137 -96
- package/dist/components/BbTextarea/types.d.ts +12 -5
- package/dist/components/BbTextarea/types.js +9 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +105 -104
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +241 -197
- package/dist/components/BbTimePickerInput/types.d.ts +12 -5
- package/dist/components/BbTimePickerInput/types.js +9 -3
- package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +74 -32
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +47 -47
- package/dist/components/BbToast/types.d.ts +10 -5
- package/dist/components/BbToast/types.js +18 -3
- package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +85 -71
- package/dist/components/BbTooltip/types.d.ts +13 -8
- package/dist/components/BbTooltip/types.js +8 -3
- package/dist/components/CommonField/CommonField.vue.d.ts +1 -1
- package/dist/components/CommonPopover/CommonPopover.vue.d.ts +1 -1
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +69 -69
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +53 -50
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +146 -143
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/OptionsContainer/types.d.ts +14 -3
- package/dist/composables/useBbFormContext.d.ts +4 -3
- package/dist/composables/useBbTabsContext.js +99 -85
- package/dist/composables/useChoiceIndicator.d.ts +58 -0
- package/dist/composables/useChoiceIndicator.js +197 -0
- package/dist/composables/useConfirm.d.ts +4 -4
- package/dist/composables/usePassthrough.d.ts +54 -1
- package/dist/composables/usePassthrough.js +100 -71
- package/dist/directives/bbTooltip.d.ts +12 -6
- package/dist/directives/createPopoverDirective.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/llms-full.txt +2300 -543
- package/dist/llms-medium.txt +71 -53
- package/dist/llms.txt +2 -1
- package/dist/passthrough-deduper.js +6 -3
- package/dist/project-dts.d.ts +24 -0
- package/dist/project-dts.js +43 -17
- package/dist/styles.css +2 -2
- package/dist/types/AlertVariant.d.ts +14 -0
- package/dist/types/AlertVariant.js +9 -0
- package/dist/types/BadgeVariant.d.ts +14 -0
- package/dist/types/BadgeVariant.js +9 -0
- package/dist/types/ButtonVariant.d.ts +16 -0
- package/dist/types/ButtonVariant.js +11 -0
- package/dist/types/CheckboxVariant.d.ts +38 -0
- package/dist/types/CheckboxVariant.js +4 -0
- package/dist/types/CommonProps.d.ts +4 -3
- package/dist/types/Config.d.ts +7 -0
- package/dist/types/ConfirmVariant.d.ts +12 -0
- package/dist/types/ConfirmVariant.js +4 -0
- package/dist/types/DropdownItemVariant.d.ts +12 -0
- package/dist/types/DropdownItemVariant.js +4 -0
- package/dist/types/IndicatorVariant.d.ts +15 -0
- package/dist/types/IndicatorVariant.js +10 -0
- package/dist/types/InputVariant.d.ts +13 -0
- package/dist/types/InputVariant.js +8 -0
- package/dist/types/RadioVariant.d.ts +38 -0
- package/dist/types/RadioVariant.js +4 -0
- package/dist/types/TabsVariant.d.ts +13 -0
- package/dist/types/TabsVariant.js +8 -0
- package/dist/types/ToastVariant.d.ts +15 -0
- package/dist/types/ToastVariant.js +10 -0
- package/dist/types/TooltipVariant.d.ts +12 -0
- package/dist/types/TooltipVariant.js +4 -0
- package/dist/types/passthrough.d.ts +83 -15
- package/dist/types/passthrough.js +2 -2
- package/dist/types/ptComponentMap.d.ts +35 -23
- package/dist/utilities/functions/extractDomContainer.d.ts +20 -1
- package/dist/utilities/functions/extractDomContainer.js +8 -3
- package/dist/utils/focusVisibility.d.ts +6 -0
- package/dist/utils/focusVisibility.js +4 -1
- package/dist/utils/passthroughDeduper.d.ts +14 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +64 -7
- package/dist/vite.js +385 -259
- package/llms.txt +2 -1
- package/package.json +3 -3
- package/scripts/lib/adoption-checklist.json +312 -0
- package/scripts/lib/eslint-plugin.d.ts +13 -0
- package/scripts/lib/eslint-plugin.mjs +75 -11
- package/scripts/lib/idiom-scan.mjs +65 -0
- package/scripts/lib/mcp-config.mjs +203 -9
- package/scripts/lib/migrate-fix.mjs +42 -1
- package/scripts/lib/project-variant-dts.mjs +18 -0
- package/scripts/lib/validate-bb-markup.mjs +99 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TrackEstimate, FittedFloors } from './utils';
|
|
2
|
+
type Entry = {
|
|
3
|
+
kind: string;
|
|
4
|
+
column: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
type Estimate = (values: string[], label: string, padEm?: number, headerExtraEm?: number, labelType?: {
|
|
8
|
+
scale: number;
|
|
9
|
+
spacingEm: number;
|
|
10
|
+
}, legacyPadEm?: number) => TrackEstimate;
|
|
11
|
+
type Fit = (estimates: Record<string, TrackEstimate>, available: number) => FittedFloors;
|
|
12
|
+
/** A small seeded generator (mulberry32): the same mixes on every run. */
|
|
13
|
+
export declare const seeded: (seed: number) => () => number;
|
|
14
|
+
export declare const goldenCases: (corpus: Entry[], estimate: Estimate, fit: Fit) => {
|
|
15
|
+
estimates: {
|
|
16
|
+
key: string;
|
|
17
|
+
e: TrackEstimate;
|
|
18
|
+
}[];
|
|
19
|
+
fits: {
|
|
20
|
+
keys: string[];
|
|
21
|
+
room: number;
|
|
22
|
+
fit: unknown;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { MeasureLookup, MeasuredLabel } from './utils';
|
|
2
|
+
/** What the table tells about one estimated column. */
|
|
3
|
+
export type MeasuredColumn = {
|
|
4
|
+
key: string;
|
|
5
|
+
/** Its data cell's index among a body row's children (structural cells
|
|
6
|
+
* first), the same index among the header row's cells. */
|
|
7
|
+
index: number;
|
|
8
|
+
/** The texts it shows (the sampled rows), as the cells render them. */
|
|
9
|
+
values: readonly string[];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
/** The profile says prose (`profileValues`): how its cells are held. */
|
|
12
|
+
prose: boolean;
|
|
13
|
+
/** Its own label, to measure; `undefined` when a slot or an affix renders
|
|
14
|
+
* the heading (the guard still reads the header as rendered). */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** `td-class` or `row-class` is a function: rendered cells may differ in
|
|
17
|
+
* typography from one row to the next. */
|
|
18
|
+
dynamic: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare const createMeasuredFloors: (options: {
|
|
21
|
+
table: () => HTMLElement | null | undefined;
|
|
22
|
+
container: () => HTMLElement | null | undefined;
|
|
23
|
+
columns: () => MeasuredColumn[];
|
|
24
|
+
/** The body text's px (`--bb-fs`): the em of every estimate. */
|
|
25
|
+
em: () => number;
|
|
26
|
+
/** The fit, as a string: what a guard round has to change to count. */
|
|
27
|
+
plan: () => string;
|
|
28
|
+
}) => {
|
|
29
|
+
version: import('vue').Ref<number, number>;
|
|
30
|
+
lookup: (key: string) => MeasureLookup | undefined;
|
|
31
|
+
labelOf: (key: string, extraEm: number) => MeasuredLabel | undefined;
|
|
32
|
+
extraPadOf: (key: string) => number;
|
|
33
|
+
measure: (mount?: boolean) => void;
|
|
34
|
+
checkTypography: () => void;
|
|
35
|
+
guard: (level: string, held: {
|
|
36
|
+
whole?: string;
|
|
37
|
+
word?: string;
|
|
38
|
+
}) => boolean;
|
|
39
|
+
/** The rows changed: measure their new texts on the next pass. */
|
|
40
|
+
rowsChanged: () => void;
|
|
41
|
+
/** How many widths this table keeps (tests: bounded by its rows). */
|
|
42
|
+
stored: () => number;
|
|
43
|
+
/** Called after a web font loads (the store is already cleared). */
|
|
44
|
+
onFontsChanged: (cb: () => void) => void;
|
|
45
|
+
dispose: () => void;
|
|
46
|
+
};
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { breakRuns as e, measureCandidates as t, reservePx as n, textEm as r } from "./utils.js";
|
|
2
|
+
import { measureTexts as i, onFontsChanged as a, typographySignature as o } from "./textRuler.js";
|
|
3
|
+
import { ref as s } from "vue";
|
|
4
|
+
//#region src/components/BbTable/measuredFloors.ts
|
|
5
|
+
var c = () => ({
|
|
6
|
+
whole: /* @__PURE__ */ new Map(),
|
|
7
|
+
runs: /* @__PURE__ */ new Map()
|
|
8
|
+
}), l = (e, t, r) => {
|
|
9
|
+
let i = e.get(t);
|
|
10
|
+
return i === void 0 || r > i ? (e.set(t, r), i === void 0 || n(r) > n(i)) : !1;
|
|
11
|
+
}, u = 1500, d = 8e3, f = 1200, p = 3, m = ":scope > .bb-table__body > [role=\"row\"].bb-table__row", h = ":scope > .bb-table__head > [role=\"row\"]", g = /^bb-table__(cell--(edge-start|edge-end|value|placeholder|line|token|word|outlier)|row--(highlighted|highlightable|expanded|disabled|drag-source|lifted))$/, _ = (e) => {
|
|
12
|
+
let t = getComputedStyle(e), n = parseFloat(t.width);
|
|
13
|
+
t.boxSizing !== "border-box" && (n += parseFloat(t.paddingLeft) + parseFloat(t.paddingRight) + parseFloat(t.borderLeftWidth) + parseFloat(t.borderRightWidth));
|
|
14
|
+
let r = e.getBoundingClientRect().width;
|
|
15
|
+
return n > 0 && r > 0 ? r / n : 1;
|
|
16
|
+
}, v = (e) => {
|
|
17
|
+
let t = [], n = (e) => {
|
|
18
|
+
for (let r of e.childNodes) {
|
|
19
|
+
if (r instanceof Text) {
|
|
20
|
+
r.data.trim() && t.push(r);
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (!(r instanceof Element) || r.classList.contains("bb-table-header__resizer")) continue;
|
|
24
|
+
let e = getComputedStyle(r).display;
|
|
25
|
+
if (e !== "none") {
|
|
26
|
+
if (e === "contents") {
|
|
27
|
+
if (!n(r)) return !1;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (!e.startsWith("inline")) return !1;
|
|
31
|
+
t.push(r);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return !0;
|
|
35
|
+
};
|
|
36
|
+
return n(e) ? t : void 0;
|
|
37
|
+
}, y = (y) => {
|
|
38
|
+
let b = s(0), x = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Set(), O = 0, k, A = () => {
|
|
39
|
+
D = /* @__PURE__ */ new Set(), O = 0, k = void 0;
|
|
40
|
+
}, j = !0, M = 0, N = () => {
|
|
41
|
+
M++, x = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), A(), j = !0;
|
|
42
|
+
}, P = (t) => {
|
|
43
|
+
let r = y.em(), i = x.get(t), a = S.get(t);
|
|
44
|
+
if (!r || !i && !a) return;
|
|
45
|
+
let o = (e, t) => Math.max(i?.[e].get(t) ?? 0, a?.[e].get(t) ?? 0);
|
|
46
|
+
return (t) => {
|
|
47
|
+
let i = o("whole", t), a = 0;
|
|
48
|
+
for (let n of e(t)) a = Math.max(a, o("runs", n));
|
|
49
|
+
if (!(!i && !a)) return {
|
|
50
|
+
whole: i ? n(i) / r : void 0,
|
|
51
|
+
word: a ? n(a) / r : void 0
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}, F = (e) => {
|
|
55
|
+
let t = y.em();
|
|
56
|
+
return t ? (E.get(e) ?? 0) / t : 0;
|
|
57
|
+
}, I = (e, t) => {
|
|
58
|
+
let r = y.em(), i = C.get(e), a = w.get(e);
|
|
59
|
+
if (!r || !i && a === void 0) return;
|
|
60
|
+
let o = a === void 0 ? 0 : a / r - t;
|
|
61
|
+
return {
|
|
62
|
+
one: Math.max(i ? n(i.one) / r : 0, o),
|
|
63
|
+
two: i ? n(i.two) / r : 0
|
|
64
|
+
};
|
|
65
|
+
}, L = (e) => [...e.querySelectorAll(m)], R = (e) => !e.matches(".bb-table__row--highlighted, .bb-table__row--expanded, [aria-selected=\"true\"], :hover, :focus-within"), z = (e, t, n = !1) => {
|
|
66
|
+
let r, i, a;
|
|
67
|
+
for (let o of e) {
|
|
68
|
+
let e = o.children[t];
|
|
69
|
+
if (e && (!r && e.classList.contains("bb-table__cell--value") ? (i ??= e, R(o) && (r = e)) : n && !a && e.classList.contains("bb-table__cell--placeholder") && (a = e), r && (a || !n))) break;
|
|
70
|
+
}
|
|
71
|
+
let o = r ?? i ?? a;
|
|
72
|
+
return {
|
|
73
|
+
value: o,
|
|
74
|
+
placeholder: a ?? o
|
|
75
|
+
};
|
|
76
|
+
}, B = (e, t) => e.querySelector(h)?.children[t]?.querySelector(".bb-table-header__content") ?? void 0, V = (e, t) => [
|
|
77
|
+
...e.classList,
|
|
78
|
+
"|",
|
|
79
|
+
...t.classList
|
|
80
|
+
].filter((e) => !g.test(e)).join(" "), H = (e) => {
|
|
81
|
+
let t = getComputedStyle(e);
|
|
82
|
+
return parseFloat(t.paddingLeft) + parseFloat(t.paddingRight);
|
|
83
|
+
}, U = (e, t) => {
|
|
84
|
+
let n = !1, r = e.querySelector(h);
|
|
85
|
+
for (let e of y.columns()) {
|
|
86
|
+
let i = z(t, e.index).value, a = r?.children[e.index], o = i && a ? Math.max(0, H(i) - H(a)) : 0;
|
|
87
|
+
Math.abs(o - (E.get(e.key) ?? 0)) > .01 && (E.set(e.key, o), n = !0);
|
|
88
|
+
}
|
|
89
|
+
return n;
|
|
90
|
+
}, W = (n) => {
|
|
91
|
+
let r = L(n);
|
|
92
|
+
U(n, r) && b.value++;
|
|
93
|
+
let i = [];
|
|
94
|
+
for (let a of y.columns()) {
|
|
95
|
+
let s = z(r, a.index, !!a.placeholder);
|
|
96
|
+
s.value && T.set(a.key, o(s.value));
|
|
97
|
+
let { whole: c, runs: l } = t(a.placeholder ? a.values.filter((e) => e !== a.placeholder) : a.values, a.prose);
|
|
98
|
+
if (s.value && (i.push({
|
|
99
|
+
key: a.key,
|
|
100
|
+
kind: "whole",
|
|
101
|
+
group: {
|
|
102
|
+
host: s.value,
|
|
103
|
+
texts: c
|
|
104
|
+
}
|
|
105
|
+
}), i.push({
|
|
106
|
+
key: a.key,
|
|
107
|
+
kind: "runs",
|
|
108
|
+
group: {
|
|
109
|
+
host: s.value,
|
|
110
|
+
texts: l
|
|
111
|
+
}
|
|
112
|
+
})), a.placeholder && s.placeholder) {
|
|
113
|
+
let t = a.placeholder.trim();
|
|
114
|
+
i.push({
|
|
115
|
+
key: a.key,
|
|
116
|
+
kind: "whole",
|
|
117
|
+
group: {
|
|
118
|
+
host: s.placeholder,
|
|
119
|
+
texts: [t]
|
|
120
|
+
}
|
|
121
|
+
}), i.push({
|
|
122
|
+
key: a.key,
|
|
123
|
+
kind: "runs",
|
|
124
|
+
group: {
|
|
125
|
+
host: s.placeholder,
|
|
126
|
+
texts: e(t)
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (a.dynamic) {
|
|
131
|
+
let t = /* @__PURE__ */ new Map();
|
|
132
|
+
for (let e of r) {
|
|
133
|
+
let n = e.children[a.index];
|
|
134
|
+
if (!n?.classList.contains("bb-table__cell--fluid")) continue;
|
|
135
|
+
let r = V(n, e), i = t.get(r);
|
|
136
|
+
i || t.set(r, i = {
|
|
137
|
+
host: n,
|
|
138
|
+
texts: /* @__PURE__ */ new Set()
|
|
139
|
+
});
|
|
140
|
+
let o = n.textContent?.trim();
|
|
141
|
+
o && i.texts.add(o);
|
|
142
|
+
}
|
|
143
|
+
for (let { host: n, texts: r } of t.values()) i.push({
|
|
144
|
+
key: a.key,
|
|
145
|
+
kind: "whole",
|
|
146
|
+
group: {
|
|
147
|
+
host: n,
|
|
148
|
+
texts: r
|
|
149
|
+
}
|
|
150
|
+
}), i.push({
|
|
151
|
+
key: a.key,
|
|
152
|
+
kind: "runs",
|
|
153
|
+
group: {
|
|
154
|
+
host: n,
|
|
155
|
+
texts: [...r].flatMap(e)
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
let u = a.label ? B(n, a.index) : void 0;
|
|
160
|
+
if (a.label && u) {
|
|
161
|
+
let t = e(a.label), n = [a.label];
|
|
162
|
+
for (let e = 1; e < t.length; e++) n.push(t.slice(0, e).join(" "), t.slice(e).join(" "));
|
|
163
|
+
i.push({
|
|
164
|
+
key: a.key,
|
|
165
|
+
kind: "label",
|
|
166
|
+
group: {
|
|
167
|
+
host: u,
|
|
168
|
+
texts: n
|
|
169
|
+
},
|
|
170
|
+
label: a.label
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return i;
|
|
175
|
+
}, G = (t, r, i) => {
|
|
176
|
+
let a = !1, o = i ? /* @__PURE__ */ new Map() : x;
|
|
177
|
+
return t.forEach((t, i) => {
|
|
178
|
+
let s = r[i];
|
|
179
|
+
if (t.kind === "label") {
|
|
180
|
+
let r = t.label, i = e(r), o = s.get(r) ?? 0, c = o;
|
|
181
|
+
for (let e = 1; e < i.length; e++) {
|
|
182
|
+
let t = s.get(i.slice(0, e).join(" ")) ?? 0, n = s.get(i.slice(e).join(" ")) ?? 0;
|
|
183
|
+
c = Math.min(c, Math.max(t, n));
|
|
184
|
+
}
|
|
185
|
+
let l = C.get(t.key);
|
|
186
|
+
(!l || n(o) > n(l.one) || n(c) > n(l.two)) && (C.set(t.key, {
|
|
187
|
+
one: Math.max(o, l?.one ?? 0),
|
|
188
|
+
two: Math.max(c, l?.two ?? 0)
|
|
189
|
+
}), a = !0);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
let u = o.get(t.key);
|
|
193
|
+
u || o.set(t.key, u = c());
|
|
194
|
+
for (let [e, r] of s) {
|
|
195
|
+
let i = x.get(t.key)?.[t.kind].get(e);
|
|
196
|
+
l(u[t.kind], e, r), (i === void 0 || n(r) > n(i)) && (a = !0);
|
|
197
|
+
}
|
|
198
|
+
}), x = o, a;
|
|
199
|
+
}, K = () => {
|
|
200
|
+
let t = new Map(y.columns().map((e) => [e.key, e.values]));
|
|
201
|
+
for (let [n, r] of S) {
|
|
202
|
+
let i = t.get(n);
|
|
203
|
+
if (!i) {
|
|
204
|
+
S.delete(n);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
let a = new Set(i.map((e) => e.trim())), o = new Set([...a].flatMap(e));
|
|
208
|
+
for (let e of r.whole.keys()) a.has(e) || r.whole.delete(e);
|
|
209
|
+
for (let e of r.runs.keys()) o.has(e) || r.runs.delete(e);
|
|
210
|
+
}
|
|
211
|
+
}, q = (e, t) => {
|
|
212
|
+
let n = e.some((e, n) => {
|
|
213
|
+
for (let r of e.group.texts) if (r && !t[n].has(r)) return !0;
|
|
214
|
+
return !1;
|
|
215
|
+
});
|
|
216
|
+
return n && (j = !0), !n;
|
|
217
|
+
}, J = 0, Y = (e = !1) => {
|
|
218
|
+
let t = y.table();
|
|
219
|
+
if (!t?.isConnected || !j) return;
|
|
220
|
+
j = !1, A();
|
|
221
|
+
let n = W(t), r = i(n.map((e) => e.group), e ? d : u);
|
|
222
|
+
if (K(), r) {
|
|
223
|
+
G(n, r, q(n, r)) && b.value++;
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
let a = n.map(() => /* @__PURE__ */ new Map()), o = n.flatMap((e, t) => [...e.group.texts].map((e) => ({
|
|
227
|
+
i: t,
|
|
228
|
+
text: e
|
|
229
|
+
}))), s = ++M;
|
|
230
|
+
cancelAnimationFrame(J);
|
|
231
|
+
let c = () => {
|
|
232
|
+
if (s !== M || !t.isConnected) return;
|
|
233
|
+
let e = o.splice(0, f), r = /* @__PURE__ */ new Map();
|
|
234
|
+
for (let { i: t, text: n } of e) {
|
|
235
|
+
let e = r.get(t);
|
|
236
|
+
e || r.set(t, e = []), e.push(n);
|
|
237
|
+
}
|
|
238
|
+
let l = [...r.keys()], u = i(l.map((e) => ({
|
|
239
|
+
host: n[e].group.host,
|
|
240
|
+
texts: r.get(e)
|
|
241
|
+
})));
|
|
242
|
+
l.forEach((e, t) => {
|
|
243
|
+
for (let [n, r] of u[t]) a[e].set(n, r);
|
|
244
|
+
}), o.length ? J = requestAnimationFrame(c) : G(n, a, q(n, a)) && b.value++;
|
|
245
|
+
};
|
|
246
|
+
J = requestAnimationFrame(c);
|
|
247
|
+
}, X = () => {
|
|
248
|
+
let e = y.table();
|
|
249
|
+
if (!e?.isConnected || !T.size) return;
|
|
250
|
+
let t = L(e);
|
|
251
|
+
U(e, t) && b.value++;
|
|
252
|
+
for (let e of y.columns()) {
|
|
253
|
+
let n = T.get(e.key), r = z(t, e.index).value;
|
|
254
|
+
if (n && r && o(r) !== n) {
|
|
255
|
+
N();
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}, Z = (t, i) => {
|
|
260
|
+
let a = y.table(), o = y.container();
|
|
261
|
+
if (!a?.isConnected || !o || k === t || o.scrollWidth <= o.clientWidth || O >= p) return !1;
|
|
262
|
+
let s = y.plan(), u = document.createRange(), d = 0, f = (e) => (d ||= _(e), u.getBoundingClientRect().width / d), m = !1, g = L(a);
|
|
263
|
+
for (let t of y.columns()) {
|
|
264
|
+
let o = S.get(t.key);
|
|
265
|
+
for (let n of g) {
|
|
266
|
+
let a = n.children[t.index];
|
|
267
|
+
if (!a) continue;
|
|
268
|
+
let s = !!i.whole && a.matches(i.whole), d = !s && !!i.word && a.matches(i.word);
|
|
269
|
+
if (!s && !d) continue;
|
|
270
|
+
let p = a.textContent?.trim() ?? "", h = `${t.key}\u0001${p}\u0001${a.className}\u0001${s ? "whole" : "word"}`;
|
|
271
|
+
if (!p || D.has(h)) continue;
|
|
272
|
+
if (D.add(h), o || S.set(t.key, o = c()), s) {
|
|
273
|
+
u.selectNodeContents(a), l(o.whole, p, f(a)) && (m = !0);
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
let g = "";
|
|
277
|
+
for (let t of e(p)) r(t) > r(g) && (g = t);
|
|
278
|
+
let _ = [...a.childNodes].find((e) => e instanceof Text && e.data.includes(g));
|
|
279
|
+
if (!g || !_) continue;
|
|
280
|
+
let v = _.data.indexOf(g);
|
|
281
|
+
u.setStart(_, v), u.setEnd(_, v + g.length), l(o.runs, g, f(a)) && (m = !0);
|
|
282
|
+
}
|
|
283
|
+
let s = a.querySelector(h)?.children[t.index];
|
|
284
|
+
if (s && !s.classList.contains("bb-table__cell-column-header--wrap")) {
|
|
285
|
+
let e = v(s), r = `${t.key}\u0001header\u0001${s.textContent}`;
|
|
286
|
+
if (e?.length && !D.has(r)) {
|
|
287
|
+
D.add(r), u.setStartBefore(e[0]), u.setEndAfter(e.at(-1));
|
|
288
|
+
let i = f(s), a = w.get(t.key);
|
|
289
|
+
(a === void 0 || n(i) > n(a)) && (w.set(t.key, Math.max(i, a ?? 0)), m = !0);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return m && (b.value++, y.plan() !== s) ? (O++, !0) : (k = t, !1);
|
|
294
|
+
}, Q = a(() => {
|
|
295
|
+
N(), $?.();
|
|
296
|
+
}), $;
|
|
297
|
+
return {
|
|
298
|
+
version: b,
|
|
299
|
+
lookup: P,
|
|
300
|
+
labelOf: I,
|
|
301
|
+
extraPadOf: F,
|
|
302
|
+
measure: Y,
|
|
303
|
+
checkTypography: X,
|
|
304
|
+
guard: Z,
|
|
305
|
+
rowsChanged: () => {
|
|
306
|
+
j = !0, A();
|
|
307
|
+
},
|
|
308
|
+
stored: () => {
|
|
309
|
+
let e = 0;
|
|
310
|
+
for (let t of [x, S]) for (let n of t.values()) e += n.whole.size + n.runs.size;
|
|
311
|
+
return e;
|
|
312
|
+
},
|
|
313
|
+
onFontsChanged: (e) => {
|
|
314
|
+
$ = e;
|
|
315
|
+
},
|
|
316
|
+
dispose: () => {
|
|
317
|
+
Q(), M++, cancelAnimationFrame(J);
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
//#endregion
|
|
322
|
+
export { y as createMeasuredFloors };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for the measured content floors suites (Q9.1b, measured floors).
|
|
3
|
+
* Not part of the package: imported by `*.test.ts` files only.
|
|
4
|
+
*/
|
|
5
|
+
/** Three frames: the floors' rAF, the re-render, and the layout after it. */
|
|
6
|
+
export declare const settle: (frames?: number) => Promise<void>;
|
|
7
|
+
/** How many lines a cell's text takes (distinct line tops of its text). */
|
|
8
|
+
export declare const linesOf: (cell: Element) => number;
|
|
9
|
+
/** The table's sideways overflow, in px (0 when it fits). */
|
|
10
|
+
export declare const overflowOf: (root: Element) => number;
|
|
11
|
+
/** The body cells of the column whose heading reads `label`. */
|
|
12
|
+
export declare const columnCells: (root: Element, label: string) => HTMLElement[];
|
|
13
|
+
/** The texts of a column's cells that take more than one line. */
|
|
14
|
+
export declare const brokenIn: (root: Element, label: string) => string[];
|
|
15
|
+
/** The table's hold level (`units`, `core`, `words`), or `none`. */
|
|
16
|
+
export declare const holdOf: (root: Element) => string;
|
|
17
|
+
export declare const heldCells: (root: Element) => {
|
|
18
|
+
whole: HTMLElement[];
|
|
19
|
+
word: HTMLElement[];
|
|
20
|
+
};
|
|
21
|
+
/** Held WHOLE cells that take more than one line. */
|
|
22
|
+
export declare const brokenHeld: (root: Element) => string[];
|
|
23
|
+
/** Counts "ResizeObserver loop" errors until `stop()`. */
|
|
24
|
+
export declare const watchResizeObserverErrors: () => {
|
|
25
|
+
readonly count: number;
|
|
26
|
+
stop: () => void;
|
|
27
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE TEXT RULER (measured content floors). BbTable estimates its content
|
|
3
|
+
* floors from a character table close to Arial; a wider UI font (Geist,
|
|
4
|
+
* Inter…) draws a date or an amount wider than that, and a floor short by
|
|
5
|
+
* two pixels breaks "20/10/2026" in two. After mount the table measures the
|
|
6
|
+
* values it holds, here, in the font they render in.
|
|
7
|
+
*
|
|
8
|
+
* - MIRROR, not cascade: each group of texts is measured under a wrapper that
|
|
9
|
+
* carries a rendered cell's own computed text properties (font-*, letter-
|
|
10
|
+
* and word-spacing, text-transform, numeric and feature settings, writing
|
|
11
|
+
* mode, direction, lang), copied with `!important`. So container queries,
|
|
12
|
+
* `:has()`, a row's `:nth-child`, a consumer's `td-class` all reach the
|
|
13
|
+
* ruler as their RESULT, and a consumer rule cannot reach it at all. The
|
|
14
|
+
* transform is applied by CSS, never re-implemented in JS (`capitalize`
|
|
15
|
+
* capitalises after a hyphen too).
|
|
16
|
+
* - OUTSIDE the table: on `document.body` (or the ShadowRoot the table lives
|
|
17
|
+
* in, where the library CSS is). Any node added under the table's root, a
|
|
18
|
+
* `display: grid` scroller, re-lays out every row (243-404ms at 2000x10);
|
|
19
|
+
* an isolated `contain: strict` box at the top of the document costs
|
|
20
|
+
* 0-0.4ms.
|
|
21
|
+
* - No `innerHTML`, no style attribute: the DOM is built with
|
|
22
|
+
* `createElement`, `cloneNode` and `textContent`, and styled through the
|
|
23
|
+
* CSSOM only, so it works under Trusted Types and a strict `style-src`.
|
|
24
|
+
* - One 100px reference block gives the scale of the page (a CSS `zoom` on
|
|
25
|
+
* `html` or `body`): every width is divided by it.
|
|
26
|
+
* - The widths are cached per typography (`typographySignature`), across
|
|
27
|
+
* tables and remounts; a font that finishes loading clears the cache
|
|
28
|
+
* (`onFontsChanged`).
|
|
29
|
+
*
|
|
30
|
+
* The node lives for one synchronous read, `aria-hidden` and `inert`; a
|
|
31
|
+
* consumer's MutationObserver on `body` sees it come and go. The class
|
|
32
|
+
* `bb-table-ruler` is internal, not public API.
|
|
33
|
+
*/
|
|
34
|
+
/** What sets one rendered text's width apart from another's, as a string:
|
|
35
|
+
* the same signature measures the same. */
|
|
36
|
+
export declare const typographySignature: (host: Element) => string;
|
|
37
|
+
/** Forgets every width (a font loaded, or a test starts clean). */
|
|
38
|
+
export declare const clearRulerCache: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Calls `callback` after any web font finishes loading (or fails), with the
|
|
41
|
+
* cache already cleared: the widths measured before were the fallback's.
|
|
42
|
+
* Not every font change fires this (a `FontFace` built from a buffer, or a
|
|
43
|
+
* `local()` face in WebKit, fire nothing): the table's overflow guard covers
|
|
44
|
+
* those. Returns the unsubscribe.
|
|
45
|
+
*/
|
|
46
|
+
export declare const onFontsChanged: (callback: () => void) => (() => void);
|
|
47
|
+
/** What the ruler did (tests: a resize must not touch it, new rows measure
|
|
48
|
+
* only their new texts): DOM builds, texts measured, time spent (ms). */
|
|
49
|
+
export declare const rulerStats: {
|
|
50
|
+
builds: number;
|
|
51
|
+
texts: number;
|
|
52
|
+
ms: number;
|
|
53
|
+
};
|
|
54
|
+
export type RulerGroup = {
|
|
55
|
+
/** A rendered element whose text the group's texts are drawn like. */
|
|
56
|
+
host: Element;
|
|
57
|
+
texts: Iterable<string>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Measure each group's texts on one line, under its host's typography, in
|
|
61
|
+
* one layout. Returns, per group (same order), each text's width in CSS px
|
|
62
|
+
* of the host's own coordinates (a zoomed page's scale divided out).
|
|
63
|
+
* Cached texts cost no DOM work. A text the ruler could not lay out (its
|
|
64
|
+
* root not rendered) is missing from its map, and nothing is cached.
|
|
65
|
+
*
|
|
66
|
+
* With `maxMisses`: more new texts than that measure nothing and return
|
|
67
|
+
* `undefined` (the caller measures them in frames instead), so a call that
|
|
68
|
+
* finds most texts cached stays one synchronous read.
|
|
69
|
+
*/
|
|
70
|
+
export declare function measureTexts(groups: readonly RulerGroup[]): Array<Map<string, number>>;
|
|
71
|
+
export declare function measureTexts(groups: readonly RulerGroup[], maxMisses: number): Array<Map<string, number>> | undefined;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
//#region src/components/BbTable/textRuler.ts
|
|
2
|
+
var e = /^(font|letter-spacing|word-spacing|text-transform|text-rendering|text-autospace|text-spacing-trim|text-orientation|writing-mode|direction|unicode-bidi|tab-size|-webkit-locale)/, t = /* @__PURE__ */ new Set([
|
|
3
|
+
"font",
|
|
4
|
+
"font-variant",
|
|
5
|
+
"font-synthesis"
|
|
6
|
+
]), n, r = (r) => {
|
|
7
|
+
if (!n) {
|
|
8
|
+
let i = [];
|
|
9
|
+
for (let n of Array.from(r)) e.test(n) && !t.has(n) && i.push(n);
|
|
10
|
+
n = i.sort();
|
|
11
|
+
}
|
|
12
|
+
return n;
|
|
13
|
+
}, i = (e) => {
|
|
14
|
+
let t = getComputedStyle(e), n = r(t).map((e) => [e, t.getPropertyValue(e)]), i = e.closest("[lang]")?.getAttribute("lang") ?? "", a = Math.round((globalThis.devicePixelRatio || 1) * 100) / 100;
|
|
15
|
+
return {
|
|
16
|
+
signature: `${n.map(([, e]) => e).join("|")}|${i}|${a}`,
|
|
17
|
+
properties: n,
|
|
18
|
+
lang: i
|
|
19
|
+
};
|
|
20
|
+
}, a = (e) => i(e).signature, o = /* @__PURE__ */ new Map(), s = 0, c = 5e4, l = () => {
|
|
21
|
+
o.clear(), s = 0;
|
|
22
|
+
}, u = /* @__PURE__ */ new Set(), d = !1, f = (e) => {
|
|
23
|
+
let t = typeof document < "u" ? document.fonts : void 0;
|
|
24
|
+
if (!t?.addEventListener) return () => {};
|
|
25
|
+
if (!d) {
|
|
26
|
+
d = !0;
|
|
27
|
+
let e = () => {
|
|
28
|
+
l();
|
|
29
|
+
for (let e of [...u]) e();
|
|
30
|
+
};
|
|
31
|
+
t.addEventListener("loadingdone", e), t.addEventListener("loadingerror", e);
|
|
32
|
+
}
|
|
33
|
+
return u.add(e), () => u.delete(e);
|
|
34
|
+
}, p = {
|
|
35
|
+
builds: 0,
|
|
36
|
+
texts: 0,
|
|
37
|
+
ms: 0
|
|
38
|
+
}, m = (e, t, n) => e.style.setProperty(t, n, "important"), h = (e) => {
|
|
39
|
+
let t = e.getRootNode();
|
|
40
|
+
return typeof ShadowRoot < "u" && t instanceof ShadowRoot ? t : e.ownerDocument?.body ?? null;
|
|
41
|
+
};
|
|
42
|
+
function g(e, t = Infinity) {
|
|
43
|
+
s > c && l();
|
|
44
|
+
let n = e.map((e) => ({
|
|
45
|
+
group: e,
|
|
46
|
+
typography: i(e.host),
|
|
47
|
+
texts: [...new Set(e.texts)]
|
|
48
|
+
})), r = /* @__PURE__ */ new Map();
|
|
49
|
+
for (let { group: e, typography: t, texts: i } of n) {
|
|
50
|
+
let n = o.get(t.signature);
|
|
51
|
+
for (let a of i) {
|
|
52
|
+
if (!a || n?.has(a)) continue;
|
|
53
|
+
let i = r.get(t.signature);
|
|
54
|
+
i || r.set(t.signature, i = {
|
|
55
|
+
typography: t,
|
|
56
|
+
host: e.host,
|
|
57
|
+
texts: /* @__PURE__ */ new Set()
|
|
58
|
+
}), i.texts.add(a);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
let a = 0;
|
|
62
|
+
for (let e of r.values()) a += e.texts.size;
|
|
63
|
+
if (!(a > t)) return r.size && _([...r.values()]), n.map(({ typography: e, texts: t }) => {
|
|
64
|
+
let n = o.get(e.signature), r = /* @__PURE__ */ new Map();
|
|
65
|
+
for (let e of t) {
|
|
66
|
+
let t = n?.get(e);
|
|
67
|
+
t !== void 0 && r.set(e, t);
|
|
68
|
+
}
|
|
69
|
+
return r;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
var _ = (e) => {
|
|
73
|
+
let t = h(e[0].host), n = e[0].host.ownerDocument;
|
|
74
|
+
if (!t || !n) return;
|
|
75
|
+
p.builds++;
|
|
76
|
+
let r = performance.now(), i = n.createElement("div");
|
|
77
|
+
i.className = "bb-table-ruler", i.setAttribute("aria-hidden", "true"), i.setAttribute("inert", "");
|
|
78
|
+
for (let [e, t] of [
|
|
79
|
+
["position", "absolute"],
|
|
80
|
+
["top", "0"],
|
|
81
|
+
["left", "0"],
|
|
82
|
+
["width", "0"],
|
|
83
|
+
["height", "0"],
|
|
84
|
+
["overflow", "hidden"],
|
|
85
|
+
["contain", "strict"],
|
|
86
|
+
["visibility", "hidden"],
|
|
87
|
+
["pointer-events", "none"]
|
|
88
|
+
]) m(i, e, t);
|
|
89
|
+
let a = n.createElement("div");
|
|
90
|
+
m(a, "width", "100px"), m(a, "height", "0"), i.append(a);
|
|
91
|
+
let c = n.createElement("bb-ruler-line"), l = [];
|
|
92
|
+
for (let { typography: t, texts: r } of e) {
|
|
93
|
+
let e = n.createElement("div");
|
|
94
|
+
for (let [n, r] of t.properties) r && m(e, n, r);
|
|
95
|
+
m(e, "white-space", "nowrap"), t.lang && e.setAttribute("lang", t.lang);
|
|
96
|
+
for (let n of r) {
|
|
97
|
+
let r = c.cloneNode();
|
|
98
|
+
r.textContent = n, e.append(r), l.push({
|
|
99
|
+
signature: t.signature,
|
|
100
|
+
text: n,
|
|
101
|
+
node: r.firstChild
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
i.append(e);
|
|
105
|
+
}
|
|
106
|
+
t.append(i);
|
|
107
|
+
try {
|
|
108
|
+
let e = a.getBoundingClientRect().width / 100;
|
|
109
|
+
if (!e) return;
|
|
110
|
+
let t = n.createRange();
|
|
111
|
+
for (let { signature: n, text: r, node: i } of l) {
|
|
112
|
+
t.selectNodeContents(i);
|
|
113
|
+
let a = o.get(n);
|
|
114
|
+
a || o.set(n, a = /* @__PURE__ */ new Map()), a.set(r, t.getBoundingClientRect().width / e), s++;
|
|
115
|
+
}
|
|
116
|
+
} finally {
|
|
117
|
+
i.remove(), p.texts += l.length, p.ms += performance.now() - r;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
export { l as clearRulerCache, g as measureTexts, f as onFontsChanged, p as rulerStats, a as typographySignature };
|