@revolist/ui 4.0.4-rc → 4.0.4
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/MIGRATION.md +36 -0
- package/OWNERSHIP.md +36 -36
- package/README.md +65 -392
- package/_button.scss +6 -2
- package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
- package/_chunks/calculator-CDWOuAcp.js +4 -0
- package/_chunks/{calendar-xpZ0v3xf.js → calendar-BQYQLu8Q.js} +23 -23
- package/_chunks/{cell-visuals-E-2oEKHg.js → cell-visuals-r6DOOhGh.js} +7 -7
- package/_chunks/chart-frame-GprenwEg.js +145 -0
- package/_chunks/{chevron-right-sxHQMSkq.js → check-BwI7iCAm.js} +2 -2
- package/_chunks/{chevron-left-D0nc4Z5S.js → chevron-right-CM3ljziP.js} +2 -2
- package/_chunks/choice-chips-C5OxD0GV.js +126 -0
- package/_chunks/{color-palette-D8vyPfld.js → color-palette-7siNch__.js} +22 -24
- package/_chunks/color-picker-Cfc9eqZb.js +143 -0
- package/_chunks/{component-C_T2VN5u.js → component-C3k_8uIq.js} +290 -275
- package/_chunks/{component-metadata-BMOOmqx5.js → component-metadata-DlVkpW3h.js} +1 -9
- package/_chunks/configurator-actions-vRnI54mO.js +155 -0
- package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
- package/_chunks/control-BRfF5DWQ.js +118 -0
- package/_chunks/{controller-hRBm_Lfz.js → controller-BbiQuRt-.js} +5 -5
- package/_chunks/controls-B3EgM_DS.js +650 -0
- package/_chunks/{date-control-DrVFX13g.js → date-control-87dcA5br.js} +5 -5
- package/_chunks/{date-time-qIhp5vaX.js → date-time-CfiFYodx.js} +332 -293
- package/_chunks/{delete-button-CW9vjLnk.js → delete-button-jneO24wa.js} +1 -1
- package/_chunks/dialog.parts-NqEEVc9P.js +131 -0
- package/_chunks/{duration-CL68Em0o.js → duration-BGZ_qJ99.js} +10 -10
- package/_chunks/{editor-commit-Bq3wSgvr.js → editor-commit-Dyo-FMgD.js} +1 -1
- package/_chunks/editor-popup-NNP9Fh9U.js +82 -0
- package/_chunks/field-configurator-DPulsY3l.js +288 -0
- package/_chunks/{field-context-D57PnBbH.js → field-context-C4_WrO2z.js} +1 -1
- package/_chunks/{framework-mount--RTLIqE-.js → framework-mount-D4I8HpVp.js} +2 -2
- package/_chunks/icon-toolbar-BAAdEvr9.js +134 -0
- package/_chunks/{icons-Ci5mADVc.js → icons-B4qN13Yj.js} +1 -1
- package/_chunks/{iso-B0YHBK7m.js → iso-CJQl2kmq.js} +1 -1
- package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
- package/_chunks/minus-BOAR3A1C.js +4 -0
- package/_chunks/{model-mPO2tG2f.js → model-CFrBgRHm.js} +3 -3
- package/_chunks/mount-C8CnIW9k.js +267 -0
- package/_chunks/{native.view-ByyZ1CT5.js → native-CJm3eq3-.js} +1 -1
- package/_chunks/native-control-um1L1wgZ.js +649 -0
- package/_chunks/{number-input-BKwA5FnM.js → number-input-CKiA4d1N.js} +9 -9
- package/_chunks/{picker-h1P5RUgp.js → picker-igNshTRC.js} +5 -5
- package/_chunks/plus-CbGRkIGl.js +4 -0
- package/_chunks/{popup-CT2uD3go.js → popup-DECYM9FI.js} +116 -105
- package/_chunks/{rating-choice-DZgmaic0.js → rating-choice-CepVfGUq.js} +2 -2
- package/_chunks/{render-m5eMMwFR.js → render-bTk3curw.js} +2 -2
- package/_chunks/{reorder-list-CSlqAGHw.js → reorder-list-B4w3aARt.js} +2 -2
- package/_chunks/request-trail-B1zVRPEf.js +762 -0
- package/_chunks/rich-text-Ci4d6dHn.js +842 -0
- package/_chunks/rotate-left-BF6G883o.js +4 -0
- package/_chunks/selection-list-tooltips-m00U3L6z.js +42 -0
- package/_chunks/title-tooltip-ncldbUwS.js +11 -0
- package/_chunks/tooltip-h-Z8yFBY.js +54 -0
- package/_chunks/tooltip-owner-BYho-vJl.js +19 -0
- package/_chunks/tooltip-session-CBtRMBPr.js +110 -0
- package/_chunks/tooltip-text-BN5WdGHn.js +12 -0
- package/_chunks/top-layer-popup-CKJ7VJOF.js +59 -0
- package/_dialog.scss +57 -22
- package/_form.scss +71 -21
- package/_legend.scss +25 -7
- package/_variables.scss +34 -32
- package/_view-switcher.scss +6 -0
- package/activity-message.d.ts +1 -1
- package/activity-message.js +1 -1
- package/ai/_chat.scss +35 -3
- package/ai/_style.scss +76 -16
- package/ai/chat.d.ts +3 -1
- package/ai/components.d.ts +16 -3
- package/ai/index.d.ts +1 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +30 -6
- package/ai/request-trail.d.ts +9 -3
- package/ai/results/_style.scss +83 -0
- package/ai/results/index.d.ts +11 -0
- package/ai/results/metrics.d.ts +5 -0
- package/ai/results/table.d.ts +5 -0
- package/ai/results/text.d.ts +5 -0
- package/ai/results/types.d.ts +29 -0
- package/ai/transcript.d.ts +2 -0
- package/ai/translations.d.ts +1 -1
- package/angular/angular.d.ts +1 -1
- package/angular/angular.js +13 -7
- package/assignee/assignee.scss +28 -6
- package/assignee/index.js +6 -6
- package/avatar/avatar.style.scss +23 -6
- package/avatar/index.d.ts +25 -2
- package/avatar/index.js +33 -32
- package/badge.d.ts +1 -1
- package/badge.js +1 -1
- package/badge.view.d.ts +8 -0
- package/brush-range/_brush-range.scss +55 -49
- package/brush-range/component.d.ts +1 -3
- package/brush-range/component.js +28 -28
- package/buttons/delete-button.js +1 -1
- package/buttons/delete-button.style.scss +6 -2
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.js +2 -2
- package/buttons/remove-button.style.scss +1 -1
- package/buttons/svg-button.d.ts +1 -1
- package/buttons/svg-button.js +17 -17
- package/calendar/_calendar.scss +21 -25
- package/calendar/calendar.js +1 -1
- package/calendar/day.js +2 -2
- package/calendar/header.js +2 -3
- package/calendar/index.js +3 -3
- package/calendar/model.js +1 -1
- package/calendar/month-grid.js +2 -2
- package/calendar/translations.js +1 -1
- package/calendar/year-grid.js +2 -2
- package/cell-input.js +1 -1
- package/cell-input.scss +3 -7
- package/cell-visuals/badge.style.scss +6 -3
- package/cell-visuals/bar-chart.style.scss +2 -1
- package/cell-visuals/column-type.style.css +12 -0
- package/cell-visuals/index.js +1 -1
- package/cell-visuals/progress-line-value.renderer.style.scss +4 -2
- package/cell-visuals/progress-line.style.scss +1 -4
- package/cell-visuals/sparkline.style.scss +2 -1
- package/cell-visuals/timeline.style.css +4 -2
- package/checkbox/checkbox.scss +6 -24
- package/checkbox/index.js +1 -1
- package/choice-chips/index.d.ts +3 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/built-in-palettes.js +1 -1
- package/color-palette/chart-palettes.js +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-palette.style.scss +88 -25
- package/color-palette/color-picker.constants.js +1 -1
- package/color-palette/color-picker.js +2 -2
- package/color-palette/color-picker.style.scss +23 -10
- package/color-palette/common-palettes.d.ts +1 -1
- package/color-palette/common-palettes.js +2 -2
- package/color-palette/gantt-palettes.js +1 -1
- package/color-palette/native.d.ts +15 -2
- package/color-palette/palette.js +1 -1
- package/color-palette/pivot-palettes.js +1 -1
- package/color-palette/platform-palettes.js +1 -1
- package/color-palette/pro-palettes.js +1 -1
- package/color-palette/scheduler-palettes.js +1 -1
- package/component-catalog.d.ts +9 -7
- package/configurator-actions.d.ts +67 -0
- package/configurator-actions.js +1 -0
- package/configurator-aggregation-list.d.ts +14 -0
- package/configurator-aggregation-list.js +63 -0
- package/configurator-drop-zone.d.ts +39 -0
- package/configurator-drop-zone.js +66 -0
- package/configurator-field-icon.d.ts +10 -0
- package/configurator-field-icon.js +1 -0
- package/configurator-focus.d.ts +4 -0
- package/configurator-focus.js +39 -0
- package/configurator-sections.d.ts +42 -0
- package/configurator-sections.js +71 -0
- package/control-attributes.js +1 -1
- package/control-presentation.d.ts +8 -2
- package/control-presentation.js +25 -20
- package/controls.d.ts +12 -2
- package/controls.js +4 -3
- package/core/anchored-popover.js +1 -1
- package/core/control-id.js +1 -1
- package/core/editor-popup-position.d.ts +6 -2
- package/core/editor-popup.d.ts +4 -0
- package/core/editor-popup.js +1 -1
- package/core/motion.js +1 -1
- package/core/popover-controller.d.ts +35 -0
- package/core/popover-controller.js +102 -0
- package/core/popup-ownership.d.ts +2 -0
- package/core/selection-list-tooltips.d.ts +2 -0
- package/core/title-tooltip.d.ts +2 -0
- package/core/tooltip-session.d.ts +29 -0
- package/core/tooltip-surface.d.ts +13 -0
- package/core/tooltip-text.d.ts +6 -0
- package/core/tooltip.d.ts +35 -0
- package/core/top-layer-popup.d.ts +4 -0
- package/core/top-layer-popup.js +1 -23
- package/date-time/attach.d.ts +1 -1
- package/date-time/date-control.d.ts +1 -1
- package/date-time/field.d.ts +4 -2
- package/date-time/index.js +1 -1
- package/date-time/style.scss +239 -36
- package/date-time/time-selection.d.ts +3 -1
- package/date-time/types.d.ts +5 -1
- package/dialog/dialog-action-footer.d.ts +17 -2
- package/dialog/dialog.dom.d.ts +15 -2
- package/dialog/dialog.dom.js +9 -9
- package/dialog/dialog.drag.js +1 -1
- package/dialog/dialog.parts.d.ts +1 -1
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.js +1 -1
- package/distribution-chart/_distribution-chart.scss +113 -77
- package/distribution-chart/area-chart.js +2 -2
- package/distribution-chart/bar-chart.js +2 -2
- package/distribution-chart/chart-frame.d.ts +1 -1
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/index.js +1 -1
- package/distribution-chart/line-chart.js +2 -2
- package/dropdown/content.js +1 -1
- package/dropdown/control.js +1 -1
- package/dropdown/dropdown.service.js +1 -1
- package/dropdown/dropdown.types.d.ts +1 -1
- package/dropdown/editor-dropdown.style.scss +19 -9
- package/dropdown/index.js +2 -2
- package/dropdown/lookup-field.d.ts +5 -0
- package/dropdown/lookup-field.js +4 -3
- package/dropdown/popup.d.ts +2 -2
- package/dropdown/popup.js +1 -1
- package/duration/index.js +1 -1
- package/editor-actions.js +2 -2
- package/editor-layout/index.d.ts +4 -4
- package/editor-layout/index.js +40 -35
- package/editor-layout/style.scss +82 -18
- package/favicon.svg +9 -0
- package/field-configurator.d.ts +39 -1
- package/field-configurator.js +4 -170
- package/field-expansion.d.ts +9 -0
- package/field-reorder.hook.js +1 -1
- package/field-reorder.js +1 -1
- package/filter/filters/slider/_single-slider.scss +57 -38
- package/filter/filters/slider/_slider.scss +41 -33
- package/filter/filters/slider/component.js +1 -1
- package/filter/filters/slider/control.js +3 -1
- package/filter/filters/slider/inputs.js +1 -1
- package/filter/filters/slider/logic.js +1 -1
- package/filter/filters/slider/preact.js +1 -1
- package/filter/filters/slider/runtime.js +50 -23
- package/filter/filters/slider/single.js +2 -2
- package/filter-badge.js +2 -2
- package/filter-controls.d.ts +0 -1
- package/filter-controls.js +6 -7
- package/form-controls/index.d.ts +10 -2
- package/form-controls/index.js +7 -7
- package/form-controls/presentation.d.ts +1 -1
- package/form-controls/presentation.js +13 -13
- package/formatting/index.d.ts +1 -1
- package/formatting/index.js +26 -25
- package/formatting/styles.scss +14 -57
- package/framework.js +228 -225
- package/history-controls.js +27 -1
- package/html-controls.js +1 -1
- package/icon-toolbar.d.ts +62 -0
- package/icon-toolbar.js +1 -0
- package/icons/icon.d.ts +1 -1
- package/icons/icon.js +1 -1
- package/legend.d.ts +1 -1
- package/legend.js +1 -1
- package/masked-input/index.js +4 -4
- package/native-control.d.ts +1 -2
- package/native-control.js +1 -1
- package/native-controls.d.ts +54 -2
- package/native-styles.css +1 -1
- package/native-styles.scss +6 -2
- package/native.d.ts +3 -3
- package/native.js +48 -45
- package/number-input/index.d.ts +1 -1
- package/number-input/index.js +1 -1
- package/package.json +84 -1
- package/pagination.js +12 -12
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +1 -1
- package/pdf-viewer/index.d.ts +2 -2
- package/pdf-viewer/index.js +3 -3
- package/pdf-viewer/search-bar.d.ts +1 -1
- package/pdf-viewer/status.d.ts +1 -1
- package/pdf-viewer/style.scss +203 -42
- package/pickers.d.ts +5 -1
- package/preact-mount.js +1 -1
- package/preact.d.ts +13 -10
- package/preact.js +109 -64
- package/progress/_bar.scss +9 -3
- package/progress/_circular.scss +2 -1
- package/progress/bar.js +1 -1
- package/progress/circular.js +1 -1
- package/progress/range.js +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +4 -2
- package/react-control.d.ts +2 -0
- package/react-control.js +3 -3
- package/react.d.ts +7 -8
- package/react.js +69 -68
- package/reorder-list.d.ts +1 -1
- package/reorder-list.js +1 -1
- package/reorder-list.scss +59 -17
- package/resource-picker/resource-picker-avatar.js +1 -1
- package/resource-picker/resource-picker-option.js +1 -1
- package/resource-picker/resource-picker-popup.js +2 -2
- package/resource-picker/resource-picker.js +75 -73
- package/resource-picker/resource-picker.scss +62 -34
- package/resource-picker/resource-picker.utils.js +1 -1
- package/rich-text/engine.d.ts +1 -0
- package/rich-text/format-html.d.ts +2 -0
- package/rich-text/index.d.ts +4 -0
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +2 -0
- package/rich-text/style.scss +293 -44
- package/rich-text/syntax.d.ts +5 -0
- package/rich-text/toolbar.d.ts +1 -1
- package/rich-text/translations.d.ts +2 -0
- package/robots.txt +4 -0
- package/search-input/index.js +2 -2
- package/search-input/native.d.ts +21 -2
- package/segmented-switch/index.js +1 -1
- package/select.d.ts +3 -1
- package/select.js +1 -1
- package/selection-list.d.ts +1 -0
- package/selection-list.js +3 -1
- package/status-feedback/badge.js +2 -2
- package/status-feedback/exit-snapshot.js +5 -5
- package/status-feedback/header.js +2 -2
- package/status-feedback/icons.js +1 -1
- package/status-feedback/index.js +1 -1
- package/status-feedback/item.js +2 -2
- package/status-feedback/motion.js +1 -1
- package/status-feedback/placement.js +1 -1
- package/status-feedback/popover.js +5 -5
- package/status-feedback/render.js +1 -1
- package/status-feedback/status-feedback.scss +124 -35
- package/styles/_activity-message.scss +24 -7
- package/styles/_alert.scss +78 -17
- package/styles/_cell-editor-frame.scss +11 -0
- package/styles/_compositions.scss +400 -80
- package/styles/_control.scss +30 -8
- package/styles/_disclosure.scss +15 -5
- package/styles/_editor-counter.scss +16 -6
- package/styles/_editor-slider.scss +8 -4
- package/styles/_field-configurator.scss +321 -23
- package/styles/_fields-grid.scss +49 -0
- package/styles/_filter-controls.scss +10 -2
- package/styles/_icon-action.scss +48 -15
- package/styles/_loading.scss +12 -3
- package/styles/_motion.scss +32 -9
- package/styles/_palette.scss +0 -24
- package/styles/_primitives.scss +369 -110
- package/styles/_theme.scss +130 -86
- package/styles/_thresholds.scss +28 -25
- package/styles/_time-grid.scss +8 -3
- package/styles/_tokens.scss +6 -1
- package/styles/color-roles.js +1 -1
- package/styles/configurator-actions.scss +241 -0
- package/styles/pagination.css +213 -0
- package/styles/{legacy-rating.css → rating.css} +8 -3
- package/styles.css +1 -1
- package/styles.scss +3 -5
- package/surfaces.d.ts +38 -2
- package/surfaces.js +37 -134
- package/svelte/UiComponent.svelte +44 -11
- package/svelte-control.js +1 -1
- package/svelte.d.ts +1 -1
- package/svelte.js +5 -5
- package/switch/index.js +16 -15
- package/time-grid.d.ts +0 -1
- package/time-grid.js +39 -38
- package/timeline-track/_style.scss +96 -24
- package/timeline-track/index.js +3 -3
- package/timeline-track/model.js +1 -1
- package/ui.css +1 -1
- package/view-switcher.d.ts +23 -0
- package/vue-badge.js +1 -1
- package/vue-control.js +1 -1
- package/vue-segmented-switch.js +1 -1
- package/vue.d.ts +29 -32
- package/vue.js +118 -123
- package/_chunks/chart-frame-Cmc7xU1i.js +0 -130
- package/_chunks/choice-chips-CHQTUdLs.js +0 -110
- package/_chunks/color-picker-CudqPYZo.js +0 -138
- package/_chunks/control-AHKXD5Eu.js +0 -93
- package/_chunks/control-tooltip-uscKfAnV.js +0 -100
- package/_chunks/controls-DsNi8V8I.js +0 -630
- package/_chunks/dialog.parts-CKGkC5zP.js +0 -134
- package/_chunks/editor-popup-WDdtVDNA.js +0 -81
- package/_chunks/history-controls-B3u3INEK.js +0 -27
- package/_chunks/mount-DQ1cpppK.js +0 -257
- package/_chunks/native-control-C_yok8_-.js +0 -605
- package/_chunks/request-trail-DSlFix6i.js +0 -618
- package/_chunks/rich-text-CH7gIqOS.js +0 -636
- package/_shared/data-query/binding.d.ts +0 -30
- package/_shared/data-query/blocks.d.ts +0 -30
- package/_shared/data-query/commands.d.ts +0 -47
- package/_shared/data-query/contracts.d.ts +0 -106
- package/_shared/data-query/cursor-reader.d.ts +0 -25
- package/_shared/data-query/direct-binding.d.ts +0 -3
- package/_shared/data-query/index.d.ts +0 -23
- package/_shared/data-query/infinite-binding.d.ts +0 -18
- package/_shared/data-query/keys.d.ts +0 -9
- package/_shared/data-query/limiter.d.ts +0 -12
- package/_shared/data-query/load-options.d.ts +0 -25
- package/_shared/data-query/materialize.d.ts +0 -2
- package/_shared/data-query/policy.d.ts +0 -14
- package/_shared/data-query/provider-queries.d.ts +0 -22
- package/_shared/data-query/reader.d.ts +0 -23
- package/_shared/data-query/remote-load.d.ts +0 -7
- package/_shared/data-query/source.d.ts +0 -40
- package/avatar/index.view.d.ts +0 -25
- package/color-palette/native.view.d.ts +0 -15
- package/control-presentation.view.d.ts +0 -8
- package/dialog/dialog-action-footer.view.d.ts +0 -20
- package/dialog/dialog.dom.view.d.ts +0 -15
- package/form-controls/index.view.d.ts +0 -10
- package/formatting/control-tooltip.d.ts +0 -27
- package/native-controls.view.d.ts +0 -54
- package/search-input/native.view.d.ts +0 -21
- package/styles/legacy-pagination.css +0 -112
- package/surfaces.view.d.ts +0 -63
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ConfiguratorFieldMetadata {
|
|
2
|
+
columnType?: string;
|
|
3
|
+
dataType?: 'string' | 'number' | 'date' | 'boolean';
|
|
4
|
+
}
|
|
5
|
+
/** Shared descriptive field identity; never infers or formats source values. */
|
|
6
|
+
export declare function resolveConfiguratorFieldIcon(dimension?: ConfiguratorFieldMetadata): {
|
|
7
|
+
kind: string;
|
|
8
|
+
svg: string;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as resolveConfiguratorFieldIcon } from "./_chunks/configurator-field-icon-CmcM_sPs.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Return focus only from this editor. Release a temporary tab stop on blur or disposal. */
|
|
2
|
+
export declare function focusConfiguratorOrigin(origin: HTMLElement, root: HTMLElement | null): () => void;
|
|
3
|
+
/** A single mounted owner's lease; synchronous focus callbacks cannot revive a disposed lease. */
|
|
4
|
+
export declare function useConfiguratorOriginFocus(): (origin: HTMLElement, root: HTMLElement | null) => void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { r as e, t } from "./_chunks/hooks.module-CG3gN83z.js";
|
|
2
|
+
//#region package/configurator-focus.ts
|
|
3
|
+
var n = () => {};
|
|
4
|
+
function r(e, t) {
|
|
5
|
+
if (!e.isConnected || !t?.isConnected || e.ownerDocument !== t.ownerDocument) return !1;
|
|
6
|
+
let n = e.ownerDocument.activeElement;
|
|
7
|
+
return !n || n === e.ownerDocument.body || n === e || t.contains(n);
|
|
8
|
+
}
|
|
9
|
+
function i(e, t) {
|
|
10
|
+
if (!r(e, t)) return n;
|
|
11
|
+
let i = e.ownerDocument, a = i.activeElement;
|
|
12
|
+
if (e.focus({ preventScroll: !0 }), i.activeElement === e || e.hasAttribute("tabindex") || !e.isConnected || !t.isConnected || i.activeElement !== a && i.activeElement !== i.body) return n;
|
|
13
|
+
let o = !0, s = () => {
|
|
14
|
+
o && (o = !1, e.removeEventListener("blur", s), e.getAttribute("tabindex") === "-1" && e.removeAttribute("tabindex"));
|
|
15
|
+
};
|
|
16
|
+
e.setAttribute("tabindex", "-1"), e.addEventListener("blur", s);
|
|
17
|
+
try {
|
|
18
|
+
e.focus({ preventScroll: !0 }), (i.activeElement !== e || !e.isConnected || !t.isConnected) && s();
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw s(), e;
|
|
21
|
+
}
|
|
22
|
+
return s;
|
|
23
|
+
}
|
|
24
|
+
function a() {
|
|
25
|
+
let a = t(n), o = t(0), s = t(!0);
|
|
26
|
+
return e(() => (s.current = !0, () => {
|
|
27
|
+
s.current = !1, o.current++;
|
|
28
|
+
let e = a.current;
|
|
29
|
+
a.current = n, e();
|
|
30
|
+
}), []), (e, t) => {
|
|
31
|
+
if (!s.current || !r(e, t)) return;
|
|
32
|
+
let c = ++o.current, l = a.current;
|
|
33
|
+
if (a.current = n, l(), !s.current || c !== o.current) return;
|
|
34
|
+
let u = i(e, t);
|
|
35
|
+
!s.current || c !== o.current ? u() : a.current = u;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { i as focusConfiguratorOrigin, a as useConfiguratorOriginFocus };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { h, ComponentChildren } from './_vendor/preact/src/index';
|
|
2
|
+
/** Application-owned content. Return cleanup when mounting another framework or UI. */
|
|
3
|
+
export interface ConfiguratorSection {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
hidden?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
render?: () => ComponentChildren;
|
|
9
|
+
mount?: (host: HTMLElement) => void | (() => void);
|
|
10
|
+
}
|
|
11
|
+
export interface ConfiguratorSectionsConfig {
|
|
12
|
+
/** Custom tabs appended after the built-in tabs. IDs must be unique and cannot replace built-ins. */
|
|
13
|
+
sections?: readonly ConfiguratorSection[];
|
|
14
|
+
initialSection?: string;
|
|
15
|
+
onSectionChange?: (id: string) => void;
|
|
16
|
+
}
|
|
17
|
+
/** Selection follows current availability, without discarding mounted editor drafts. */
|
|
18
|
+
export declare function useConfiguratorSections(config: ConfiguratorSectionsConfig, builtins: readonly ConfiguratorSection[], disabled?: boolean): {
|
|
19
|
+
sections: ConfiguratorSection[];
|
|
20
|
+
custom: ConfiguratorSection[];
|
|
21
|
+
active: string | undefined;
|
|
22
|
+
select: (id: string) => void;
|
|
23
|
+
};
|
|
24
|
+
/** Shared switch spacing and opaque sticky backdrop for every configurator. */
|
|
25
|
+
export declare function ConfiguratorHeader({ children, className, }: {
|
|
26
|
+
children?: ComponentChildren;
|
|
27
|
+
className?: string;
|
|
28
|
+
}): h.JSX.Element;
|
|
29
|
+
export declare function ConfiguratorSectionTabs({ sections, active, onChange, prefix, label, className, }: {
|
|
30
|
+
sections: readonly ConfiguratorSection[];
|
|
31
|
+
active?: string;
|
|
32
|
+
onChange: (id: string) => void;
|
|
33
|
+
prefix: string;
|
|
34
|
+
label: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
}): h.JSX.Element;
|
|
37
|
+
/** Inactive sections retain chat transcripts and host drafts until removed. */
|
|
38
|
+
export declare function ConfiguratorSectionPanels({ sections, active, prefix, }: {
|
|
39
|
+
sections: readonly ConfiguratorSection[];
|
|
40
|
+
active?: string;
|
|
41
|
+
prefix: string;
|
|
42
|
+
}): h.JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { i as e } from "./_chunks/preact.module-BBM36DnO.js";
|
|
2
|
+
import { i as t, r as n, t as r } from "./_chunks/hooks.module-CG3gN83z.js";
|
|
3
|
+
import { t as i } from "./_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
4
|
+
import { SegmentedSwitch as a } from "./segmented-switch/index.js";
|
|
5
|
+
//#region package/configurator-sections.tsx
|
|
6
|
+
function o(e, n, r = !1) {
|
|
7
|
+
let i = new Set(n.map((e) => e.id)), a = (e.sections ?? []).filter((e) => !e.id || i.has(e.id) ? !1 : (i.add(e.id), !0)), o = [...n, ...a].filter((e) => !e.hidden).map((e) => r ? {
|
|
8
|
+
...e,
|
|
9
|
+
disabled: !0
|
|
10
|
+
} : e), [s, c] = t(e.initialSection ?? n[0]?.id), l = o.find((e) => e.id === s && (r || !e.disabled))?.id ?? o.find((e) => !e.disabled)?.id ?? (r ? o[0]?.id : void 0);
|
|
11
|
+
return {
|
|
12
|
+
sections: o,
|
|
13
|
+
custom: o.filter((e) => !n.some((t) => t.id === e.id)),
|
|
14
|
+
active: l,
|
|
15
|
+
select: (t) => {
|
|
16
|
+
t !== l && o.some((e) => e.id === t && !e.disabled) && (c(t), e.onSectionChange?.(t));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function s({ children: e, className: t = "" }) {
|
|
21
|
+
return /* @__PURE__ */ i("header", {
|
|
22
|
+
className: `rv-configurator-header ${t}`,
|
|
23
|
+
children: e
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function c({ sections: e, active: t, onChange: n, prefix: r, label: o, className: s = "" }) {
|
|
27
|
+
return /* @__PURE__ */ i(a, {
|
|
28
|
+
value: t ?? "",
|
|
29
|
+
ariaLabel: o,
|
|
30
|
+
role: "tablist",
|
|
31
|
+
className: `rv-configurator-section-tabs ${s}`,
|
|
32
|
+
options: e.map((e) => ({
|
|
33
|
+
value: e.id,
|
|
34
|
+
label: e.label,
|
|
35
|
+
disabled: e.disabled,
|
|
36
|
+
id: `${r}-tab-${e.id}`,
|
|
37
|
+
ariaControls: `${r}-panel-${e.id}`
|
|
38
|
+
})),
|
|
39
|
+
onChange: n
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function l({ section: e }) {
|
|
43
|
+
let t = r(null);
|
|
44
|
+
return n(() => {
|
|
45
|
+
if (t.current && e.mount) return e.mount(t.current);
|
|
46
|
+
}, [e.mount]), /* @__PURE__ */ i("div", {
|
|
47
|
+
ref: t,
|
|
48
|
+
class: "rv-configurator-section-content",
|
|
49
|
+
children: e.render?.()
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function u({ sections: t, active: n, prefix: r }) {
|
|
53
|
+
return /* @__PURE__ */ i(e, { children: t.map((e) => /* @__PURE__ */ i(d, {
|
|
54
|
+
section: e,
|
|
55
|
+
active: n === e.id,
|
|
56
|
+
prefix: r
|
|
57
|
+
}, e.id)) });
|
|
58
|
+
}
|
|
59
|
+
function d({ section: e, active: t, prefix: n }) {
|
|
60
|
+
let a = r(!1);
|
|
61
|
+
return t && (a.current = !0), /* @__PURE__ */ i("section", {
|
|
62
|
+
hidden: !t,
|
|
63
|
+
role: "tabpanel",
|
|
64
|
+
id: `${n}-panel-${e.id}`,
|
|
65
|
+
"aria-labelledby": `${n}-tab-${e.id}`,
|
|
66
|
+
class: "rv-configurator-custom-section",
|
|
67
|
+
children: a.current && /* @__PURE__ */ i(l, { section: e })
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { s as ConfiguratorHeader, u as ConfiguratorSectionPanels, c as ConfiguratorSectionTabs, o as useConfiguratorSections };
|
package/control-attributes.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region package/control-attributes.ts
|
|
2
2
|
function e(...e) {
|
|
3
3
|
e = e.map((e) => e && typeof e == "object" && "value" in e && "subscribe" in e ? e.value : e);
|
|
4
4
|
let t = e.flatMap((e) => typeof e == "string" ? e.split(/\s+/) : e && typeof e == "object" ? Object.entries(e).filter(([, e]) => e).map(([e]) => e) : []);
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './control-
|
|
1
|
+
import { ControlTag, ControlAttributes } from './control-attributes';
|
|
2
|
+
export * from './control-attributes';
|
|
3
|
+
export declare function renderControl<H extends (...args: any[]) => any>(h: H, tag: ControlTag, attributes?: ControlAttributes | null, ...children: any[]): ReturnType<H>;
|
|
4
|
+
export declare function createControl<K extends ControlTag>(document: Document, tag: K, attributes?: ControlAttributes): HTMLElementTagNameMap[K];
|
|
5
|
+
export declare function registerControl<T extends object>(component: T, tag: ControlTag): T;
|
|
6
|
+
export declare function nativeControlTag(type: unknown): string | undefined;
|
|
7
|
+
/** Decorate a native icon control after installing its trusted bundled SVG. */
|
|
8
|
+
export declare function decorateIconAction(element: HTMLElement, label: string): void;
|
package/control-presentation.js
CHANGED
|
@@ -1,36 +1,41 @@
|
|
|
1
1
|
import { c as e } from "./_chunks/preact.module-BBM36DnO.js";
|
|
2
2
|
import { t } from "./_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
3
|
import { createPreactElement as n } from "./preact-mount.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { TooltipController as r } from "./core/popover-controller.js";
|
|
5
|
+
import { controlAttributes as i, controlClassName as a } from "./control-attributes.js";
|
|
6
|
+
//#region package/control-presentation.tsx
|
|
7
|
+
function o(e, t, n, ...r) {
|
|
7
8
|
let a = n ?? {};
|
|
8
9
|
if (t === "button" && a.busy === !0) {
|
|
9
|
-
let n =
|
|
10
|
-
return e(t,
|
|
10
|
+
let n = r.length ? r : [a.children];
|
|
11
|
+
return e(t, i(t, a), e("span", {
|
|
11
12
|
class: "rv-button-spinner",
|
|
12
13
|
"aria-hidden": "true"
|
|
13
14
|
}), ...n);
|
|
14
15
|
}
|
|
15
|
-
return e(t,
|
|
16
|
+
return e(t, i(t, a), ...r);
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
return i.onChange && !(r === "button" && i.busy) && Object.assign(
|
|
18
|
+
function s(t, r, i = {}) {
|
|
19
|
+
let a = o(e, r, i);
|
|
20
|
+
return i.onChange && !(r === "button" && i.busy) && Object.assign(a.props, { onChange: i.onChange }), n(t, a);
|
|
20
21
|
}
|
|
21
|
-
var
|
|
22
|
-
function
|
|
23
|
-
return
|
|
22
|
+
var c = /* @__PURE__ */ new WeakMap();
|
|
23
|
+
function l(e, t) {
|
|
24
|
+
return c.set(e, t), e;
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
return typeof e == "string" ? e : e && (typeof e == "function" || typeof e == "object") ?
|
|
26
|
+
function u(e) {
|
|
27
|
+
return typeof e == "string" ? e : e && (typeof e == "function" || typeof e == "object") ? c.get(e) : void 0;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
var d = /* @__PURE__ */ new WeakMap();
|
|
30
|
+
function f(e, i) {
|
|
31
|
+
e.classList.add("rv-btn", "rv-btn-ghost", "rv-btn-icon"), e.setAttribute("aria-label", i), d.get(e)?.(), e.removeAttribute("title"), e.querySelector(".rv-control-tooltip")?.remove();
|
|
32
|
+
let a = n(e.ownerDocument, /* @__PURE__ */ t("span", {
|
|
30
33
|
class: "rv-control-tooltip",
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
role: "tooltip",
|
|
35
|
+
hidden: !0,
|
|
36
|
+
children: i
|
|
37
|
+
}));
|
|
38
|
+
e.append(a), d.set(e, new r().bind(e, i, { surface: a }));
|
|
34
39
|
}
|
|
35
40
|
//#endregion
|
|
36
|
-
export {
|
|
41
|
+
export { i as controlAttributes, a as controlClassName, s as createControl, f as decorateIconAction, u as nativeControlTag, l as registerControl, o as renderControl };
|
package/controls.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BadgeOptions } from './badge';
|
|
2
1
|
import { h, ComponentChildren, JSX } from './_vendor/preact/src/index';
|
|
3
2
|
import { SegmentedSwitchProps, SegmentedSwitchValue } from './segmented-switch';
|
|
4
3
|
import { EditorPane, EditorSplitLayout } from './editor-layout';
|
|
@@ -106,7 +105,7 @@ export declare function Panel({ children, className, label }: ShellProps): h.JSX
|
|
|
106
105
|
export declare function Toolbar({ children, className, label }: ShellProps): h.JSX.Element;
|
|
107
106
|
export declare function ToolbarGroup({ children, className, label }: ShellProps): h.JSX.Element;
|
|
108
107
|
export declare function ToolbarSeparator(): h.JSX.Element;
|
|
109
|
-
export
|
|
108
|
+
export { Badge } from './badge.view';
|
|
110
109
|
export declare function CountBadge({ count, label }: {
|
|
111
110
|
count: number;
|
|
112
111
|
label: string;
|
|
@@ -134,6 +133,17 @@ export declare function Submenu({ label, children }: ShellProps & {
|
|
|
134
133
|
label: string;
|
|
135
134
|
}): h.JSX.Element;
|
|
136
135
|
export declare function ResizeHandle(props: ResizeOptions): h.JSX.Element;
|
|
136
|
+
export interface PanelResizeHandleProps extends Omit<ResizeOptions, 'value' | 'direction'> {
|
|
137
|
+
edge: 'left' | 'right';
|
|
138
|
+
initialWidth: number;
|
|
139
|
+
anchorRef?: {
|
|
140
|
+
current: HTMLDivElement | null;
|
|
141
|
+
};
|
|
142
|
+
/** Measure the outer host when it owns the resized width. */
|
|
143
|
+
resizeParent?: boolean;
|
|
144
|
+
}
|
|
145
|
+
/** Measures the containing panel and places a width control on its physical edge. */
|
|
146
|
+
export declare function PanelResizeHandle({ edge, initialWidth, anchorRef, resizeParent, max, ...props }: PanelResizeHandleProps): h.JSX.Element;
|
|
137
147
|
export type PaginationDirection = 'first' | 'previous' | 'next' | 'last';
|
|
138
148
|
export type PaginationButtonOptions = Pick<ButtonProps, 'disabled' | 'variant' | 'className' | 'title'>;
|
|
139
149
|
export interface PaginationProps {
|
package/controls.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { t as e } from "./_chunks/selection-list-tooltips-m00U3L6z.js";
|
|
2
|
+
import { A as t, B as n, C as r, D as i, E as a, F as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, _ as g, a as _, b as v, c as y, d as b, f as x, g as S, h as C, i as w, j as T, k as E, l as D, m as O, n as k, o as A, p as j, r as M, s as N, t as P, u as F, v as I, w as L, x as R, y as z } from "./_chunks/controls-B3EgM_DS.js";
|
|
3
|
+
import { EditorList as B, EditorListGroup as V, EditorListItem as H, EditorListItemContent as U, EditorPane as W, EditorSplitLayout as G } from "./editor-layout/index.js";
|
|
4
|
+
export { p as Alert, n as Badge, P as Button, k as ButtonGroup, M as Chip, w as CircularProgress, _ as CountBadge, A as DateInput, N as DateTimeInput, y as Disclosure, D as EmptyState, F as FieldError, b as FieldHint, x as FormSection, j as IconButton, B as Listbox, V as ListboxGroup, H as ListboxOption, U as ListboxOptionContent, O as LoadingOverlay, C as Menu, S as MenuItem, g as MenuSeparator, I as NumberInput, z as NumberStepper, v as Pagination, W as Pane, R as Panel, m as PanelResizeHandle, r as RadioGroup, L as Rating, h as ResizeHandle, a as SegmentedControl, i as Spinner, G as SplitLayout, d as Submenu, E as TabPanel, t as Tabs, T as TextInput, l as Textarea, u as TimeInput, f as ToggleButton, o as Toolbar, s as ToolbarGroup, c as ToolbarSeparator, e as useSelectionListTooltips };
|
package/core/anchored-popover.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region package/core/anchored-popover.ts
|
|
2
2
|
function e(e, t, n, r = 4, i = 8) {
|
|
3
3
|
let a = e.bottom + r, o = e.top - t.height - r, s = a + t.height <= n.height - i || o < i ? "below" : "above", c = e.left, l = e.right - t.width, u = c + t.width <= n.width - i || l < i ? "left" : "right";
|
|
4
4
|
return {
|
package/core/control-id.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Prefer keeping the field visible, with an optional viewport fit for larger editors. */
|
|
2
2
|
export declare function calculateEditorPopupPosition(anchor: Pick<DOMRect, 'left' | 'right' | 'top' | 'bottom'>, popup: Pick<DOMRect, 'width' | 'height'>, viewport: {
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
5
|
-
}, gap
|
|
5
|
+
}, { gap, inset, fitViewport }?: {
|
|
6
|
+
gap?: number | undefined;
|
|
7
|
+
inset?: number | undefined;
|
|
8
|
+
fitViewport?: boolean | undefined;
|
|
9
|
+
}): {
|
|
6
10
|
placementY: string;
|
|
7
11
|
maxHeight: number;
|
|
8
12
|
top: number;
|
package/core/editor-popup.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ export interface EditorPopupHandle {
|
|
|
6
6
|
export interface EditorPopupOptions {
|
|
7
7
|
label: string;
|
|
8
8
|
className?: string;
|
|
9
|
+
/** Allow overlap with the anchor when the popup needs more vertical room. */
|
|
10
|
+
fitViewport?: boolean;
|
|
11
|
+
/** A separate trigger can toggle the popup without applying the draft. */
|
|
12
|
+
trigger?: HTMLElement;
|
|
9
13
|
onClose?: () => void;
|
|
10
14
|
isAvailable?: () => boolean;
|
|
11
15
|
}
|
package/core/editor-popup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as mountEditorPopup } from "../_chunks/editor-popup-
|
|
1
|
+
export { t as mountEditorPopup } from "../_chunks/editor-popup-NNP9Fh9U.js";
|
package/core/motion.js
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface PopoverOptions {
|
|
2
|
+
anchor: HTMLElement | SVGElement;
|
|
3
|
+
placement?: 'above';
|
|
4
|
+
content: HTMLElement;
|
|
5
|
+
/** Defaults to the document body. */
|
|
6
|
+
appendTo?: HTMLElement;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
restoreFocus?: boolean;
|
|
9
|
+
closeOnOutside?: boolean;
|
|
10
|
+
closeOnEscape?: boolean;
|
|
11
|
+
display?: string;
|
|
12
|
+
}
|
|
13
|
+
/** One owner for native top-layer promotion, viewport positioning and disposal. */
|
|
14
|
+
export declare class PopoverController {
|
|
15
|
+
private active?;
|
|
16
|
+
get isOpen(): boolean;
|
|
17
|
+
open(options: PopoverOptions): {
|
|
18
|
+
close: (restoreFocus?: boolean) => void;
|
|
19
|
+
refresh: () => void;
|
|
20
|
+
};
|
|
21
|
+
refresh(): void;
|
|
22
|
+
close(restoreFocus?: boolean): void;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
}
|
|
25
|
+
export declare function createTooltipElement(document: Document, className?: string): HTMLDivElement;
|
|
26
|
+
/** Imperative binding adapter over the same session used by useTooltip. */
|
|
27
|
+
export declare class TooltipController {
|
|
28
|
+
private release?;
|
|
29
|
+
bind(anchor: HTMLElement | SVGElement, text: string, options?: {
|
|
30
|
+
trigger?: 'hover' | 'click';
|
|
31
|
+
surface?: HTMLElement;
|
|
32
|
+
onEscape?: () => void;
|
|
33
|
+
}): () => void;
|
|
34
|
+
destroy(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { calculateAnchoredPopoverPosition as e } from "./anchored-popover.js";
|
|
2
|
+
import { t } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { createPreactElement as n, releasePreactElement as r } from "../preact-mount.js";
|
|
4
|
+
import { o as i, r as a, t as o } from "../_chunks/top-layer-popup-CKJ7VJOF.js";
|
|
5
|
+
import { t as s } from "../_chunks/tooltip-session-CBtRMBPr.js";
|
|
6
|
+
import { createControlId as c } from "./control-id.js";
|
|
7
|
+
import { inheritUiMotion as l } from "./motion.js";
|
|
8
|
+
//#region package/core/popover-controller.tsx
|
|
9
|
+
var u = /* @__PURE__ */ new WeakMap(), d = class {
|
|
10
|
+
active;
|
|
11
|
+
get isOpen() {
|
|
12
|
+
return !!this.active;
|
|
13
|
+
}
|
|
14
|
+
open(t) {
|
|
15
|
+
this.close(!1);
|
|
16
|
+
let { anchor: n, content: r } = t, s = n.ownerDocument, c = s.defaultView, d = u.get(s) ?? [];
|
|
17
|
+
u.set(s, d);
|
|
18
|
+
let f = r.parentNode, p = r.nextSibling, m = r.hidden, h = r.getAttribute("style"), g = r.getAttribute("popover"), _ = l(n, r), v = () => {
|
|
19
|
+
if (!n.isConnected) {
|
|
20
|
+
x(!1);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let a = (t.placement === "above" ? i : e)(n.getBoundingClientRect(), r.getBoundingClientRect(), {
|
|
24
|
+
width: s.documentElement.clientWidth || c?.innerWidth || 0,
|
|
25
|
+
height: s.documentElement.clientHeight || c?.innerHeight || 0
|
|
26
|
+
});
|
|
27
|
+
Object.assign(r.style, {
|
|
28
|
+
left: `${a.left}px`,
|
|
29
|
+
top: `${a.top}px`
|
|
30
|
+
});
|
|
31
|
+
}, y, b = !1, x = (e = t.restoreFocus !== !1) => {
|
|
32
|
+
if (b) return;
|
|
33
|
+
b = !0, s.removeEventListener("pointerdown", S, !0), r.removeEventListener("keydown", C), s.removeEventListener("keydown", C), c?.removeEventListener("resize", v), s.removeEventListener("scroll", v, !0), w?.disconnect();
|
|
34
|
+
let i = d.indexOf(r);
|
|
35
|
+
i !== -1 && d.splice(i, 1), o(r, y), _(), f?.isConnected ? f.insertBefore(r, p?.parentNode === f ? p : null) : r.remove(), h === null ? r.removeAttribute("style") : r.setAttribute("style", h), r.hidden = m, g === null ? r.removeAttribute("popover") : r.setAttribute("popover", g), this.active?.content === r && (this.active = void 0), e && n.isConnected && n.focus({ preventScroll: !0 }), t.onClose?.();
|
|
36
|
+
}, S = (e) => {
|
|
37
|
+
if (d.at(-1) !== r) return;
|
|
38
|
+
let i = e.composedPath();
|
|
39
|
+
t.closeOnOutside !== !1 && !i.includes(n) && !i.includes(r) && x(!1);
|
|
40
|
+
}, C = (e) => {
|
|
41
|
+
d.at(-1) === r && e.key === "Escape" && t.closeOnEscape !== !1 && !e.defaultPrevented && (e.preventDefault(), e.stopPropagation(), x());
|
|
42
|
+
};
|
|
43
|
+
(t.appendTo ?? s.body).append(r), r.hidden = !1, Object.assign(r.style, {
|
|
44
|
+
position: "fixed",
|
|
45
|
+
inset: "auto",
|
|
46
|
+
margin: "0"
|
|
47
|
+
}), y = a(r, t.display ?? "block");
|
|
48
|
+
let w = c?.ResizeObserver ? new c.ResizeObserver(v) : void 0;
|
|
49
|
+
return w?.observe(n), w?.observe(r), this.active = {
|
|
50
|
+
content: r,
|
|
51
|
+
close: x,
|
|
52
|
+
position: v
|
|
53
|
+
}, d.push(r), s.addEventListener("pointerdown", S, !0), r.addEventListener("keydown", C), s.addEventListener("keydown", C), c?.addEventListener("resize", v), s.addEventListener("scroll", v, !0), v(), {
|
|
54
|
+
close: x,
|
|
55
|
+
refresh: v
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
refresh() {
|
|
59
|
+
this.active?.position();
|
|
60
|
+
}
|
|
61
|
+
close(e) {
|
|
62
|
+
this.active?.close(e);
|
|
63
|
+
}
|
|
64
|
+
destroy() {
|
|
65
|
+
this.close(!1);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
function f(e, r = "grid-tooltip") {
|
|
69
|
+
return n(e, /* @__PURE__ */ t("div", {
|
|
70
|
+
id: c("rv-tooltip"),
|
|
71
|
+
class: r,
|
|
72
|
+
role: "tooltip",
|
|
73
|
+
hidden: !0
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
var p = class {
|
|
77
|
+
release;
|
|
78
|
+
bind(e, t, n = {}) {
|
|
79
|
+
this.destroy();
|
|
80
|
+
let i = n.surface ?? f(e.ownerDocument, "rv-tooltip");
|
|
81
|
+
i.textContent = t;
|
|
82
|
+
let a = new s();
|
|
83
|
+
a.setSurface(i), a.onEscape = n.onEscape;
|
|
84
|
+
let o = n.trigger === "click", c = e.getAttribute("aria-expanded");
|
|
85
|
+
o && e.setAttribute("aria-expanded", "false"), a.onHide = () => {
|
|
86
|
+
o && e.setAttribute("aria-expanded", "false");
|
|
87
|
+
};
|
|
88
|
+
let l = () => {
|
|
89
|
+
a.show(e), o && e.setAttribute("aria-expanded", String(a.isOpen));
|
|
90
|
+
}, u = () => a.isOpen ? a.hide() : l(), d = () => a.focus(e), p = () => a.blur(), m = () => a.leave(e), h = () => {
|
|
91
|
+
a.pointerDown(), a.hide();
|
|
92
|
+
}, g = (e) => a.keyDown(e);
|
|
93
|
+
return o ? e.addEventListener("click", u) : (e.addEventListener("pointerenter", l), e.addEventListener("pointerleave", m), e.addEventListener("focus", d), e.addEventListener("blur", p), e.addEventListener("pointerdown", h), e.addEventListener("keydown", g)), this.release = () => {
|
|
94
|
+
a.destroy(), e.removeEventListener("click", u), e.removeEventListener("pointerenter", l), e.removeEventListener("pointerleave", m), e.removeEventListener("focus", d), e.removeEventListener("blur", p), e.removeEventListener("pointerdown", h), e.removeEventListener("keydown", g), o && (c === null ? e.removeAttribute("aria-expanded") : e.setAttribute("aria-expanded", c)), n.surface || r(i);
|
|
95
|
+
}, () => this.destroy();
|
|
96
|
+
}
|
|
97
|
+
destroy() {
|
|
98
|
+
this.release?.(), this.release = void 0;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
export { d as PopoverController, p as TooltipController, f as createTooltipElement };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type TooltipAnchor = HTMLElement | SVGElement;
|
|
2
|
+
/** One lifecycle for declarative and imperative tooltip adapters. */
|
|
3
|
+
export declare class TooltipSession {
|
|
4
|
+
private anchor?;
|
|
5
|
+
private surface?;
|
|
6
|
+
private timer?;
|
|
7
|
+
private mode?;
|
|
8
|
+
private cleanup?;
|
|
9
|
+
private mounted;
|
|
10
|
+
private pointerFocus;
|
|
11
|
+
private open;
|
|
12
|
+
private addedDescription;
|
|
13
|
+
onHide?: () => void;
|
|
14
|
+
onEscape?: () => void;
|
|
15
|
+
delay: number;
|
|
16
|
+
get isOpen(): boolean;
|
|
17
|
+
get isPending(): boolean;
|
|
18
|
+
setSurface(surface: HTMLElement | null): void;
|
|
19
|
+
show(anchor: TooltipAnchor): void;
|
|
20
|
+
private present;
|
|
21
|
+
hide(): void;
|
|
22
|
+
focus(anchor: TooltipAnchor): void;
|
|
23
|
+
blur(): void;
|
|
24
|
+
pointerDown(): void;
|
|
25
|
+
leave(anchor?: TooltipAnchor): void;
|
|
26
|
+
keyDown(event: KeyboardEvent): void;
|
|
27
|
+
destroy(): void;
|
|
28
|
+
private listen;
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Shared presentation for text hints and rich product/chart tooltip content. */
|
|
2
|
+
export declare const TOOLTIP_STYLES = "\n.rv-tooltip.rv-tooltip {\n box-sizing: border-box;\n position: fixed;\n z-index: 100000;\n margin: 0;\n inset: auto;\n transform: none;\n opacity: 1;\n visibility: visible;\n padding: 6px 10px;\n border: 0;\n border-radius: 6px;\n background: var(--rv-tooltip-bg, #191919);\n color: var(--rv-tooltip-fg, #fff);\n box-shadow: 0 4px 14px var(--rv-ui-shadow, rgb(0 0 0 / 18%));\n font: 12px/1.4 var(--rv-ui-font-family, Inter, ui-sans-serif, system-ui, sans-serif);\n font-weight: 400;\n text-align: start;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n max-width: min(360px, calc(100vw - 16px));\n max-height: calc(100dvh - 16px);\n overflow: auto;\n pointer-events: none;\n}\n.rv-tooltip[hidden], .rv-tooltip[data-visible=\"false\"] { display: none; }\n.rv-tooltip[data-overflow] { pointer-events: auto; }\n@media (forced-colors: active) {\n .rv-tooltip.rv-tooltip { color: CanvasText; background: Canvas; border: 1px solid CanvasText; }\n}\n";
|
|
3
|
+
/** Also installs into shadow roots/fullscreen roots used by standalone charts. */
|
|
4
|
+
export declare function ensureTooltipStyles(root: Document | ShadowRoot): void;
|
|
5
|
+
export declare function prepareTooltipSurface(element: HTMLElement): void;
|
|
6
|
+
/** Shared hint placement: centered above the trigger, with a bounded below fallback. */
|
|
7
|
+
export declare function calculateTooltipPosition(anchor: DOMRect, popup: DOMRect, viewport: {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}): import('./anchored-popover').AnchoredPopoverPosition | {
|
|
11
|
+
left: number;
|
|
12
|
+
top: number;
|
|
13
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { JSX } from '../_vendor/preact/src/index';
|
|
2
|
+
/** Wrapper-free shared hint for otherwise native text and label elements. */
|
|
3
|
+
export declare function TooltipText({ as, title, children, ...attributes }: Omit<JSX.HTMLAttributes<HTMLElement>, 'title'> & {
|
|
4
|
+
as?: 'span' | 'label' | 'div';
|
|
5
|
+
title?: string;
|
|
6
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { h, ComponentChildren, TargetedEvent } from '../_vendor/preact/src/index';
|
|
2
|
+
type TooltipPresentation = {
|
|
3
|
+
className?: string;
|
|
4
|
+
placement?: 'above';
|
|
5
|
+
delay?: number;
|
|
6
|
+
content?: ComponentChildren;
|
|
7
|
+
};
|
|
8
|
+
/** Preact adapter; the session owns all tooltip behavior and DOM lifecycle. */
|
|
9
|
+
export declare function useControlTooltip(text: string, _floating?: boolean, presentation?: TooltipPresentation): {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly hide: () => void;
|
|
12
|
+
readonly triggerProps: {
|
|
13
|
+
readonly 'aria-describedby': string;
|
|
14
|
+
readonly onFocus: (event: TargetedEvent<HTMLElement>) => void;
|
|
15
|
+
readonly onBlur: () => void;
|
|
16
|
+
readonly onMouseEnter: (event: TargetedEvent<HTMLElement>) => void;
|
|
17
|
+
readonly onMouseLeave: (event?: TargetedEvent<HTMLElement>) => void;
|
|
18
|
+
readonly onPointerDown: (_event: TargetedEvent<HTMLElement>) => void;
|
|
19
|
+
readonly onPointerCancel: () => void;
|
|
20
|
+
readonly onKeyDown: (event: KeyboardEvent) => void;
|
|
21
|
+
};
|
|
22
|
+
readonly tooltip: h.JSX.Element;
|
|
23
|
+
};
|
|
24
|
+
/** Controlled surface adapter retained for existing consumers. */
|
|
25
|
+
export declare function ControlTooltip({ id, text, content, visible, anchor, className, }: {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly text: string;
|
|
28
|
+
readonly content?: ComponentChildren;
|
|
29
|
+
readonly visible: boolean;
|
|
30
|
+
readonly anchor?: HTMLElement | null;
|
|
31
|
+
readonly className?: string;
|
|
32
|
+
readonly placement?: 'above';
|
|
33
|
+
}): h.JSX.Element;
|
|
34
|
+
export declare const useTooltip: typeof useControlTooltip;
|
|
35
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { ensureTooltipStyles, prepareTooltipSurface, TOOLTIP_STYLES, } from './tooltip-surface';
|
|
2
|
+
export { ownsPopupTarget } from './popup-ownership';
|
|
1
3
|
export type TopLayerPopupMode = 'popover' | 'fallback';
|
|
2
4
|
export type TopLayerPopupElement = HTMLElement & {
|
|
3
5
|
showPopover?: () => void;
|
|
@@ -7,3 +9,5 @@ export type TopLayerPopupElement = HTMLElement & {
|
|
|
7
9
|
export declare function showTopLayerPopup(element: TopLayerPopupElement, visibleDisplay?: string): TopLayerPopupMode;
|
|
8
10
|
/** Hides an overlay opened by `showTopLayerPopup`; safe to call repeatedly. */
|
|
9
11
|
export declare function hideTopLayerPopup(element: TopLayerPopupElement, mode?: TopLayerPopupMode): void;
|
|
12
|
+
/** Includes portalled popup content linked by descendant aria-controls triggers. */
|
|
13
|
+
export declare function popupOwnsTarget(panel: HTMLElement, target: Node | null): boolean;
|
package/core/top-layer-popup.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var e = /* @__PURE__ */ new WeakMap();
|
|
3
|
-
function t(t, n = "flex") {
|
|
4
|
-
if (e.has(t) || e.set(t, t.getAttribute("data-rv-ui-surface")), t.setAttribute("data-rv-ui-surface", ""), t.style.display = n, typeof t.showPopover == "function") {
|
|
5
|
-
t.setAttribute("popover", "manual");
|
|
6
|
-
try {
|
|
7
|
-
return t.showPopover(), "popover";
|
|
8
|
-
} catch {
|
|
9
|
-
t.removeAttribute("popover");
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return t.style.display = n, "fallback";
|
|
13
|
-
}
|
|
14
|
-
function n(t, n) {
|
|
15
|
-
let r = e.get(t);
|
|
16
|
-
if (r !== void 0 && (r === null ? t.removeAttribute("data-rv-ui-surface") : t.setAttribute("data-rv-ui-surface", r), e.delete(t)), n === "popover" && typeof t.hidePopover == "function") try {
|
|
17
|
-
t.hidePopover(), t.style.removeProperty("display");
|
|
18
|
-
return;
|
|
19
|
-
} catch {}
|
|
20
|
-
t.style.display = "none";
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { n as hideTopLayerPopup, t as showTopLayerPopup };
|
|
1
|
+
export { a as TOOLTIP_STYLES, s as ensureTooltipStyles, t as hideTopLayerPopup, i as ownsPopupTarget, n as popupOwnsTarget, c as prepareTooltipSurface, r as showTopLayerPopup } from "../_chunks/top-layer-popup-CKJ7VJOF.js";
|