impact-nova 2.6.0-alpha.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -27
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +3 -28
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.d.ts +3 -0
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +38 -31
- package/dist/components/data/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +65 -75
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +1 -1
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +54 -54
- package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +1 -1
- package/dist/components/data/ag-grid-react/headers/components/header-info.d.ts +9 -3
- package/dist/components/data/ag-grid-react/headers/components/header-info.js +69 -61
- package/dist/components/data/ag-grid-react/headers/components/info-modal.js +8 -8
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +119 -122
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.d.ts +1 -2
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +20 -25
- package/dist/components/data/ag-grid-react/headers/utils/filter-utils.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +254 -481
- package/dist/components/data/ag-grid-react/theme.js +2 -6
- package/dist/components/data/ag-grid-react/value-formatter.types.d.ts +0 -4
- package/dist/components/data/ag-grid-react/value-formatters.d.ts +19 -0
- package/dist/components/data/ag-grid-react/value-formatters.js +90 -88
- package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +2 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +64 -58
- package/dist/components/data/data-table/column-picker-authority.d.ts +35 -0
- package/dist/components/data/data-table/column-picker-authority.js +118 -0
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
- package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
- package/dist/components/data/data-table/column-savability.d.ts +3 -0
- package/dist/components/data/data-table/column-savability.js +10 -0
- package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
- package/dist/components/data/data-table/data-table-column-apply.js +84 -73
- package/dist/components/data/data-table/data-table-column-def-pin.js +31 -34
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
- package/dist/components/data/data-table/data-table-column-list.js +122 -64
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
- package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
- package/dist/components/data/data-table/data-table-context.js +5 -5
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +27 -0
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +196 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
- package/dist/components/data/data-table/data-table-sheet-context.js +1 -1
- package/dist/components/data/data-table/data-table-sheet.js +1 -2
- package/dist/components/data/data-table/index.d.ts +2 -0
- package/dist/components/data/data-table/index.js +32 -28
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -10
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
- package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
- package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
- package/dist/components/data/nested-list/components/SortableItem.js +62 -60
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
- package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
- package/dist/components/data/nested-list/nested-list-constants.js +10 -4
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
- package/dist/components/data/nested-list/nested-list.js +322 -336
- package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +6 -2
- package/dist/components/data-display/calendar/calendar-available-view.js +18 -19
- package/dist/components/data-display/calendar/calendar-config.js +21 -22
- package/dist/components/data-display/calendar/calendar-day-button.js +21 -21
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +35 -36
- package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +3 -3
- package/dist/components/data-display/calendar/calendar-fiscal-labels.js +62 -50
- package/dist/components/data-display/calendar/calendar-quarter-utils.js +12 -12
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-week-utils.js +33 -33
- package/dist/components/data-display/calendar/calendar-year-panes.js +68 -58
- package/dist/components/data-display/calendar/calendar-year-utils.d.ts +13 -0
- package/dist/components/data-display/calendar/calendar-year-utils.js +59 -50
- package/dist/components/data-display/calendar/calendar.js +156 -153
- package/dist/components/data-display/calendar/fiscal-period-caption-select.js +22 -23
- package/dist/components/data-display/calendar/use-calendar-i18n.d.ts +0 -1
- package/dist/components/data-display/calendar/use-calendar-i18n.js +9 -10
- package/dist/components/data-display/chart/chart.js +72 -72
- package/dist/components/data-display/chart/chart.utils.d.ts +1 -1
- package/dist/components/data-display/chart/chart.utils.js +31 -40
- package/dist/components/feedback/sheet/sheet.js +1 -1
- package/dist/components/feedback/toast/toast.d.ts +1 -1
- package/dist/components/feedback/toast/toast.variants.d.ts +1 -1
- package/dist/components/flows/filter-panel/filter-panel.d.ts +1 -1
- package/dist/components/flows/filter-panel/filter-panel.js +64 -65
- package/dist/components/flows/filter-panel/filter-panel.types.d.ts +0 -1
- package/dist/components/flows/guidance/guidance-layer.js +34 -31
- package/dist/components/flows/guidance/hooks/useGuidanceOverlayGeometry.js +29 -20
- package/dist/components/flows/guidance/renderers/announcement-renderer.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/announcement-renderer.js +74 -28
- package/dist/components/flows/guidance/renderers/guidance-action-tap-icon.d.ts +5 -0
- package/dist/components/flows/guidance/renderers/guidance-action-tap-icon.js +68 -0
- package/dist/components/flows/guidance/renderers/guidance-announcement-surface.d.ts +5 -0
- package/dist/components/flows/guidance/renderers/guidance-announcement-surface.js +76 -0
- package/dist/components/flows/guidance/renderers/guidance-card-shared.d.ts +43 -2
- package/dist/components/flows/guidance/renderers/guidance-card-shared.js +322 -99
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.d.ts +3 -0
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.js +189 -148
- package/dist/components/flows/guidance/renderers/guidance-shortcut-display.d.ts +9 -0
- package/dist/components/flows/guidance/renderers/guidance-shortcut-display.js +36 -0
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.d.ts +2 -1
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +152 -89
- package/dist/components/forms/date-picker/date-picker.js +126 -125
- package/dist/components/forms/date-picker/date-range-picker.js +192 -191
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +6 -6
- package/dist/components/forms/date-picker/fiscal-pass-through.js +7 -3
- package/dist/components/forms/date-picker/multi-date-picker.js +67 -66
- package/dist/components/forms/date-picker/multi-quarter-picker.js +87 -87
- package/dist/components/forms/date-picker/multi-week-picker.js +83 -82
- package/dist/components/forms/date-picker/multi-year-picker.js +81 -81
- package/dist/components/forms/date-picker/quarter-range-picker.js +84 -84
- package/dist/components/forms/date-picker/week-picker.js +175 -174
- package/dist/components/forms/date-picker/week-range-picker.js +214 -213
- package/dist/components/forms/date-picker/year-range-picker.js +79 -79
- package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +0 -1
- package/dist/components/ui/local-raster-icons/rasterIcons.js +25 -27
- package/dist/form-react/Fields/ChipsField.js +49 -48
- package/dist/form-react/Fields/DateRangeField.js +25 -25
- package/dist/form-react/Fields/MonthRangeField.js +57 -57
- package/dist/form-react/Fields/MultiMonthPickerField.js +28 -26
- package/dist/form-react/Fields/MultiWeekPickerField.js +41 -38
- package/dist/form-react/Fields/MultiYearPickerField.js +45 -45
- package/dist/form-react/Fields/SelectField.js +24 -26
- package/dist/form-react/Fields/TextFieldWithBackendValidation.js +27 -26
- package/dist/form-react/Fields/WeekRangePicker.js +18 -16
- package/dist/form-react/Fields/YearPickerField.js +27 -27
- package/dist/form-react/Fields/YearRangePickerField.js +29 -29
- package/dist/form-react/fields.d.ts +3 -0
- package/dist/form-react/fields.js +35 -29
- package/dist/form-react/types/fields.types.d.ts +39 -0
- package/dist/form-react/utils/date.utils.d.ts +52 -2
- package/dist/form-react/utils/date.utils.js +198 -62
- package/dist/i18n/defaultMessages.d.ts +5 -143
- package/dist/i18n/defaultMessages.js +25 -163
- package/dist/i18n/getDateFnsLocale.d.ts +4 -5
- package/dist/i18n/getDateFnsLocale.js +16 -46
- package/dist/i18n/i18n.types.d.ts +0 -13
- package/dist/i18n/impact-nova-i18n-context.d.ts +1 -1
- package/dist/i18n/impact-nova-i18n-context.js +25 -33
- package/dist/i18n/impact-nova-i18n-defaults.js +6 -8
- package/dist/i18n/index.d.ts +1 -4
- package/dist/i18n/index.js +16 -41
- package/dist/i18n/locales/de.js +3 -141
- package/dist/i18n/locales/es.js +3 -141
- package/dist/i18n/locales/hi.js +3 -141
- package/dist/i18n/locales/kn.js +3 -141
- package/dist/impact-nova-components.css +0 -249
- package/dist/impact-nova-tokens.scss +22 -6
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +603 -622
- package/dist/lib/fiscal-calendar/index.d.ts +2 -2
- package/dist/lib/fiscal-calendar/index.js +26 -24
- package/dist/lib/fiscal-calendar/week-selection.d.ts +5 -0
- package/dist/lib/fiscal-calendar/week-selection.js +56 -49
- package/dist/lib/guidance/engine/guidance-engine.d.ts +9 -0
- package/dist/lib/guidance/engine/guidance-engine.js +127 -65
- package/dist/lib/guidance/engine/manifest-validator.js +37 -30
- package/dist/lib/guidance/targets/target-resolver.d.ts +1 -1
- package/dist/lib/guidance/targets/target-resolver.js +32 -30
- package/dist/lib/guidance/types/guidance.types.d.ts +41 -0
- package/dist/lib/hash/fnv1a128.d.ts +16 -0
- package/dist/lib/hash/fnv1a128.js +21 -0
- package/dist/llms/index.js +2 -26
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/best-practices.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/migration.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/llms/rules/troubleshooting.js +1 -1
- package/dist/providers/app-providers.d.ts +1 -3
- package/dist/providers/app-providers.js +11 -22
- package/package.json +2 -13
- package/dist/components/data/ag-grid-react/chat/chat-capabilities.d.ts +0 -9
- package/dist/components/data/ag-grid-react/chat/chat-capabilities.js +0 -22
- package/dist/components/data/ag-grid-react/chat/chat-column.d.ts +0 -20
- package/dist/components/data/ag-grid-react/chat/chat-column.js +0 -81
- package/dist/components/data/ag-grid-react/chat/chat-composer.d.ts +0 -10
- package/dist/components/data/ag-grid-react/chat/chat-composer.js +0 -352
- package/dist/components/data/ag-grid-react/chat/chat-constants.d.ts +0 -17
- package/dist/components/data/ag-grid-react/chat/chat-constants.js +0 -22
- package/dist/components/data/ag-grid-react/chat/chat-format.d.ts +0 -41
- package/dist/components/data/ag-grid-react/chat/chat-format.js +0 -94
- package/dist/components/data/ag-grid-react/chat/chat-host.d.ts +0 -10
- package/dist/components/data/ag-grid-react/chat/chat-host.js +0 -651
- package/dist/components/data/ag-grid-react/chat/chat-host.types.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-html.d.ts +0 -2
- package/dist/components/data/ag-grid-react/chat/chat-html.js +0 -40
- package/dist/components/data/ag-grid-react/chat/chat-identity.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-identity.js +0 -24
- package/dist/components/data/ag-grid-react/chat/chat-menu.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-menu.js +0 -15
- package/dist/components/data/ag-grid-react/chat/chat-notify.d.ts +0 -17
- package/dist/components/data/ag-grid-react/chat/chat-notify.js +0 -124
- package/dist/components/data/ag-grid-react/chat/chat-persist.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-persist.js +0 -34
- package/dist/components/data/ag-grid-react/chat/chat-priority.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-priority.js +0 -79
- package/dist/components/data/ag-grid-react/chat/chat-summaries.d.ts +0 -2
- package/dist/components/data/ag-grid-react/chat/chat-summaries.js +0 -24
- package/dist/components/data/ag-grid-react/chat/chat-thread-ui.d.ts +0 -72
- package/dist/components/data/ag-grid-react/chat/chat-thread-ui.js +0 -713
- package/dist/components/data/ag-grid-react/chat/chat-toggle.d.ts +0 -6
- package/dist/components/data/ag-grid-react/chat/chat-toggle.js +0 -25
- package/dist/components/data/ag-grid-react/chat/chat-ui-actions.d.ts +0 -13
- package/dist/components/data/ag-grid-react/chat/chat-ui-actions.js +0 -26
- package/dist/components/data/ag-grid-react/chat/chat-window.d.ts +0 -14
- package/dist/components/data/ag-grid-react/chat/chat-window.js +0 -82
- package/dist/components/data/ag-grid-react/chat/chat-workspace.d.ts +0 -91
- package/dist/components/data/ag-grid-react/chat/chat-workspace.js +0 -555
- package/dist/components/data/ag-grid-react/chat/chat.types.d.ts +0 -319
- package/dist/components/data/ag-grid-react/chat/index.d.ts +0 -6
- package/dist/components/data/ag-grid-react/chat/index.js +0 -24
- package/dist/components/data/ag-grid-react/chat.story-data.d.ts +0 -34
- package/dist/components/data/ag-grid-react/chat.story-sources.d.ts +0 -4
- package/dist/components/data/ag-grid-react/comments/assets/comments-no-results.png.js +0 -4
- package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.d.ts +0 -6
- package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.js +0 -29
- package/dist/components/data/ag-grid-react/comments/comments-actions-menu.d.ts +0 -8
- package/dist/components/data/ag-grid-react/comments/comments-actions-menu.js +0 -18
- package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.d.ts +0 -18
- package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.js +0 -16
- package/dist/components/data/ag-grid-react/comments/comments-capabilities.d.ts +0 -11
- package/dist/components/data/ag-grid-react/comments/comments-capabilities.js +0 -26
- package/dist/components/data/ag-grid-react/comments/comments-constants.d.ts +0 -12
- package/dist/components/data/ag-grid-react/comments/comments-constants.js +0 -21
- package/dist/components/data/ag-grid-react/comments/comments-format.d.ts +0 -20
- package/dist/components/data/ag-grid-react/comments/comments-format.js +0 -49
- package/dist/components/data/ag-grid-react/comments/comments-generation.d.ts +0 -14
- package/dist/components/data/ag-grid-react/comments/comments-generation.js +0 -18
- package/dist/components/data/ag-grid-react/comments/comments-host.d.ts +0 -10
- package/dist/components/data/ag-grid-react/comments/comments-host.js +0 -343
- package/dist/components/data/ag-grid-react/comments/comments-host.types.d.ts +0 -18
- package/dist/components/data/ag-grid-react/comments/comments-identity.d.ts +0 -7
- package/dist/components/data/ag-grid-react/comments/comments-identity.js +0 -20
- package/dist/components/data/ag-grid-react/comments/comments-menu.d.ts +0 -29
- package/dist/components/data/ag-grid-react/comments/comments-menu.js +0 -35
- package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.d.ts +0 -22
- package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.js +0 -98
- package/dist/components/data/ag-grid-react/comments/comments-overlay.d.ts +0 -21
- package/dist/components/data/ag-grid-react/comments/comments-overlay.js +0 -406
- package/dist/components/data/ag-grid-react/comments/comments-panel.d.ts +0 -9
- package/dist/components/data/ag-grid-react/comments/comments-panel.js +0 -272
- package/dist/components/data/ag-grid-react/comments/comments-persist.d.ts +0 -11
- package/dist/components/data/ag-grid-react/comments/comments-persist.js +0 -19
- package/dist/components/data/ag-grid-react/comments/comments-reveal.d.ts +0 -11
- package/dist/components/data/ag-grid-react/comments/comments-reveal.js +0 -31
- package/dist/components/data/ag-grid-react/comments/comments-ui-actions.d.ts +0 -18
- package/dist/components/data/ag-grid-react/comments/comments-ui-actions.js +0 -22
- package/dist/components/data/ag-grid-react/comments/comments-window.d.ts +0 -10
- package/dist/components/data/ag-grid-react/comments/comments-window.js +0 -62
- package/dist/components/data/ag-grid-react/comments/comments.types.d.ts +0 -178
- package/dist/components/data/ag-grid-react/comments/index.d.ts +0 -5
- package/dist/components/data/ag-grid-react/comments/index.js +0 -15
- package/dist/components/data/ag-grid-react/comments-cell-renderers-showcase.d.ts +0 -25
- package/dist/components/data/ag-grid-react/comments.story-data.d.ts +0 -37
- package/dist/components/data/ag-grid-react/comments.story-sources.d.ts +0 -11
- package/dist/components/data/ag-grid-react/grid-cell-address.d.ts +0 -21
- package/dist/components/data/ag-grid-react/grid-cell-address.js +0 -21
- package/dist/components/data/ag-grid-react/grid-row-reveal.d.ts +0 -34
- package/dist/components/data/ag-grid-react/grid-row-reveal.js +0 -33
- package/dist/components/data/ag-grid-react/notes/index.d.ts +0 -2
- package/dist/components/data/ag-grid-react/notes/index.js +0 -1
- package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.d.ts +0 -25
- package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.js +0 -32
- package/dist/components/data/ag-grid-react/notes/notes-constants.d.ts +0 -2
- package/dist/components/data/ag-grid-react/notes/notes-constants.js +0 -4
- package/dist/components/data/ag-grid-react/notes/notes.types.d.ts +0 -12
- package/dist/components/data/ag-grid-react/notes.story-sources.d.ts +0 -7
- package/dist/components/data/ag-grid-react/nova-system-column.d.ts +0 -7
- package/dist/components/data/ag-grid-react/nova-system-column.js +0 -18
- package/dist/components/forms/date-picker/use-picker-i18n.d.ts +0 -6
- package/dist/components/forms/date-picker/use-picker-i18n.js +0 -11
- package/dist/components/ui/local-raster-icons/message3d.webp.js +0 -4
- package/dist/i18n/format/collator.d.ts +0 -1
- package/dist/i18n/format/collator.js +0 -7
- package/dist/i18n/format/date-pattern.d.ts +0 -5
- package/dist/i18n/format/date-pattern.js +0 -20
- package/dist/i18n/format/format-date.d.ts +0 -9
- package/dist/i18n/format/format-date.js +0 -56
- package/dist/i18n/format/format-number.d.ts +0 -20
- package/dist/i18n/format/format-number.js +0 -68
- package/dist/i18n/format/formatter-cache.d.ts +0 -9
- package/dist/i18n/format/formatter-cache.js +0 -66
- package/dist/i18n/format/index.d.ts +0 -6
- package/dist/i18n/format/parse-number.d.ts +0 -6
- package/dist/i18n/format/parse-number.js +0 -53
- package/dist/i18n/locale-config.d.ts +0 -28
- package/dist/i18n/locale-config.js +0 -32
- package/dist/i18n/week-start.d.ts +0 -6
- package/dist/i18n/week-start.js +0 -30
- package/dist/llms/rules/data-table-chat.js +0 -1
- package/dist/llms/rules/data-table-comments.js +0 -1
- package/dist/llms/rules/data-table-notes.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { CalendarInterval, CalendarKind, CalendarSelection, CalendarSelectionMode, CivilDate, DateCellMeta, FiscalCalendarConfig, FiscalMode, FiscalMonthPattern, FiscalPeriod, FiscalQuarter, FiscalWeek, FiscalYearModel, FyLabelStyle, Granularity, LeapWeekPolicy, RetailPatternId, WeekSelection, Weekday, } from './types';
|
|
1
|
+
export type { CalendarInterval, CalendarKind, CalendarSelection, CalendarSelectionMode, CivilDate, DateCellMeta, FiscalCalendarConfig, FiscalMode, FiscalMonthPattern, FiscalPeriod, FiscalQuarter, FiscalWeek, FiscalYearModel, FyAnchorRule, FyLabelStyle, Granularity, LeapWeekPolicy, RetailPatternId, WeekSelection, Weekday, } from './types';
|
|
2
2
|
export { DEFAULT_FY_LABEL, DEFAULT_LEAP_WEEK_POLICY, FISCAL_PATTERNS, } from './types';
|
|
3
3
|
export { addDays, civilFromLocalDate, compareCivil, diffDays, formatCivilRange, lastDayOfMonth, localDateFromCivil, parseCivilDate, toCivilDate, weekStart, weekday, } from './civil-date';
|
|
4
4
|
export { buildFiscalYear, clearFiscalYearCache, formatFyLabel, resolvePattern, shiftedFyForDate, } from './build-year';
|
|
@@ -6,5 +6,5 @@ export { getCellMeta, getFiscalYearForDate, clearFiscalLookupCache } from './loo
|
|
|
6
6
|
export { getFiscalPresets } from './presets';
|
|
7
7
|
export type { FiscalPreset } from './presets';
|
|
8
8
|
export { isSameInterval, nextIntervalSelection } from './selection';
|
|
9
|
-
export { getCalendarWeekSelection, getFiscalWeekSelection, resolveWeekSelection, toFiscalCalendarConfig, } from './week-selection';
|
|
9
|
+
export { getCalendarWeekSelection, getFiscalWeekSelection, resolveWeekSelection, resolveWeekStartsOn, toFiscalCalendarConfig, weekStartsOnFromFiscalConfig, } from './week-selection';
|
|
10
10
|
export type { ResolveWeekSelectionOptions } from './week-selection';
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
import { DEFAULT_FY_LABEL as t, DEFAULT_LEAP_WEEK_POLICY as r, FISCAL_PATTERNS as o } from "./types.js";
|
|
2
|
-
import { addDays as i, civilFromLocalDate as
|
|
3
|
-
import { buildFiscalYear as
|
|
2
|
+
import { addDays as i, civilFromLocalDate as s, compareCivil as c, diffDays as F, formatCivilRange as n, lastDayOfMonth as f, localDateFromCivil as m, parseCivilDate as C, toCivilDate as v, weekStart as D, weekday as p } from "./civil-date.js";
|
|
3
|
+
import { buildFiscalYear as S, clearFiscalYearCache as d, formatFyLabel as g, resolvePattern as k, shiftedFyForDate as x } from "./build-year.js";
|
|
4
4
|
import { clearFiscalLookupCache as y, getCellMeta as A, getFiscalYearForDate as _ } from "./lookup.js";
|
|
5
|
-
import { getFiscalPresets as
|
|
6
|
-
import { isSameInterval as
|
|
7
|
-
import { getCalendarWeekSelection as
|
|
5
|
+
import { getFiscalPresets as W } from "./presets.js";
|
|
6
|
+
import { isSameInterval as h, nextIntervalSelection as I } from "./selection.js";
|
|
7
|
+
import { getCalendarWeekSelection as T, getFiscalWeekSelection as w, resolveWeekSelection as b, resolveWeekStartsOn as u, toFiscalCalendarConfig as M, weekStartsOnFromFiscalConfig as R } from "./week-selection.js";
|
|
8
8
|
export {
|
|
9
9
|
t as DEFAULT_FY_LABEL,
|
|
10
10
|
r as DEFAULT_LEAP_WEEK_POLICY,
|
|
11
11
|
o as FISCAL_PATTERNS,
|
|
12
12
|
i as addDays,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
S as buildFiscalYear,
|
|
14
|
+
s as civilFromLocalDate,
|
|
15
15
|
y as clearFiscalLookupCache,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
d as clearFiscalYearCache,
|
|
17
|
+
c as compareCivil,
|
|
18
18
|
F as diffDays,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
n as formatCivilRange,
|
|
20
|
+
g as formatFyLabel,
|
|
21
|
+
T as getCalendarWeekSelection,
|
|
22
22
|
A as getCellMeta,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
W as getFiscalPresets,
|
|
24
|
+
w as getFiscalWeekSelection,
|
|
25
25
|
_ as getFiscalYearForDate,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
h as isSameInterval,
|
|
27
|
+
f as lastDayOfMonth,
|
|
28
|
+
m as localDateFromCivil,
|
|
29
|
+
I as nextIntervalSelection,
|
|
30
30
|
C as parseCivilDate,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
k as resolvePattern,
|
|
32
|
+
b as resolveWeekSelection,
|
|
33
|
+
u as resolveWeekStartsOn,
|
|
34
|
+
x as shiftedFyForDate,
|
|
35
|
+
v as toCivilDate,
|
|
35
36
|
M as toFiscalCalendarConfig,
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
D as weekStart,
|
|
38
|
+
R as weekStartsOnFromFiscalConfig,
|
|
39
|
+
p as weekday
|
|
38
40
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { CalendarKind, FiscalMode, FiscalMonthPattern, Granularity, WeekSelection, FiscalCalendarConfig, Weekday } from './types';
|
|
2
2
|
export type { FiscalMode, FiscalMonthPattern };
|
|
3
|
+
export declare function weekStartsOnFromFiscalConfig(fiscalConfig?: FiscalCalendarConfig): Weekday | undefined;
|
|
4
|
+
export declare function resolveWeekStartsOn(options: {
|
|
5
|
+
weekStartsOn?: Weekday;
|
|
6
|
+
fiscalConfig?: FiscalCalendarConfig;
|
|
7
|
+
}): Weekday;
|
|
3
8
|
export declare function getFiscalWeekSelection(date: Date, weekStartsOn: Weekday): WeekSelection;
|
|
4
9
|
export declare function getCalendarWeekSelection(date: Date, weekStartsOn: Weekday): WeekSelection;
|
|
5
10
|
export interface ResolveWeekSelectionOptions {
|
|
@@ -1,80 +1,87 @@
|
|
|
1
|
-
import { FISCAL_PATTERNS as
|
|
1
|
+
import { FISCAL_PATTERNS as M } from "./types.js";
|
|
2
2
|
import { buildFiscalYear as d } from "./build-year.js";
|
|
3
|
-
import { civilFromLocalDate as
|
|
4
|
-
import { getCellMeta as
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { civilFromLocalDate as k, parseCivilDate as w, localDateFromCivil as l } from "./civil-date.js";
|
|
4
|
+
import { getCellMeta as m } from "./lookup.js";
|
|
5
|
+
function O(t) {
|
|
6
|
+
if (t)
|
|
7
|
+
return t.kind === "retail", t.weekStartsOn;
|
|
8
|
+
}
|
|
9
|
+
function S(t) {
|
|
10
|
+
return t.weekStartsOn ?? O(t.fiscalConfig) ?? 1;
|
|
8
11
|
}
|
|
9
|
-
function
|
|
12
|
+
function u(t, n) {
|
|
13
|
+
const e = new Date(t), a = (e.getDay() + 7 - n) % 7;
|
|
14
|
+
return e.setDate(e.getDate() - a), e.setHours(0, 0, 0, 0), e;
|
|
15
|
+
}
|
|
16
|
+
function D(t, n) {
|
|
10
17
|
const e = new Date(t);
|
|
11
18
|
return e.setDate(e.getDate() + n), e;
|
|
12
19
|
}
|
|
13
|
-
function
|
|
14
|
-
const e =
|
|
20
|
+
function f(t, n) {
|
|
21
|
+
const e = u(t, n), r = D(e, 6), i = new Date(t.getFullYear(), t.getMonth(), 1).getDay(), o = e.getDate(), s = e.getMonth() === t.getMonth() ? o : 1, c = Math.ceil((s + i) / 7);
|
|
15
22
|
return {
|
|
16
23
|
year: t.getFullYear(),
|
|
17
24
|
month: t.getMonth(),
|
|
18
|
-
weekOfMonth: Math.max(1,
|
|
25
|
+
weekOfMonth: Math.max(1, c),
|
|
19
26
|
startDate: e,
|
|
20
|
-
endDate:
|
|
27
|
+
endDate: r
|
|
21
28
|
};
|
|
22
29
|
}
|
|
23
|
-
function
|
|
24
|
-
const e =
|
|
30
|
+
function F(t, n) {
|
|
31
|
+
const e = u(t, n), r = D(e, 6), a = new Date(t.getFullYear(), t.getMonth(), 1), i = new Date(t.getFullYear(), t.getMonth() + 1, 0), o = e < a ? new Date(a) : new Date(e), s = r > i ? new Date(i) : new Date(r), h = new Date(o.getFullYear(), o.getMonth(), 1).getDay(), g = o.getDate(), y = Math.ceil((g + h) / 7);
|
|
25
32
|
return {
|
|
26
|
-
year:
|
|
27
|
-
month:
|
|
28
|
-
weekOfMonth: Math.max(1,
|
|
29
|
-
startDate:
|
|
33
|
+
year: o.getFullYear(),
|
|
34
|
+
month: o.getMonth(),
|
|
35
|
+
weekOfMonth: Math.max(1, y),
|
|
36
|
+
startDate: o,
|
|
30
37
|
endDate: s
|
|
31
38
|
};
|
|
32
39
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
return
|
|
37
|
-
const
|
|
38
|
-
(
|
|
40
|
+
function p(t, n, e) {
|
|
41
|
+
const r = m(t, k(n));
|
|
42
|
+
if (r?.fy == null || r.fiscalPeriod == null)
|
|
43
|
+
return f(n, e);
|
|
44
|
+
const a = d(t, r.fy).periods.find(
|
|
45
|
+
(o) => o.period === r.fiscalPeriod
|
|
39
46
|
);
|
|
40
|
-
if (!
|
|
41
|
-
const
|
|
47
|
+
if (!a) return f(n, e);
|
|
48
|
+
const i = w(a.start);
|
|
42
49
|
return {
|
|
43
|
-
year:
|
|
44
|
-
month:
|
|
45
|
-
weekOfMonth:
|
|
46
|
-
startDate: l(
|
|
47
|
-
endDate: l(
|
|
50
|
+
year: i.y,
|
|
51
|
+
month: i.m - 1,
|
|
52
|
+
weekOfMonth: a.period,
|
|
53
|
+
startDate: l(a.start),
|
|
54
|
+
endDate: l(a.end)
|
|
48
55
|
};
|
|
49
56
|
}
|
|
50
|
-
function
|
|
57
|
+
function P(t, n = {}) {
|
|
51
58
|
const {
|
|
52
59
|
calendarKind: e = "gregorian",
|
|
53
|
-
fiscalMode:
|
|
54
|
-
granularity:
|
|
55
|
-
weekStartsOn:
|
|
56
|
-
fiscalConfig:
|
|
57
|
-
} = n
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const s = i ?? S(n);
|
|
63
|
-
return s ? F(s, t, o) : c(t, o);
|
|
60
|
+
fiscalMode: r = "basic",
|
|
61
|
+
granularity: a,
|
|
62
|
+
weekStartsOn: i,
|
|
63
|
+
fiscalConfig: o
|
|
64
|
+
} = n, s = o ?? W(n), c = S({
|
|
65
|
+
weekStartsOn: i,
|
|
66
|
+
fiscalConfig: s
|
|
67
|
+
});
|
|
68
|
+
return e !== "fiscal" ? F(t, c) : r === "basic" || a !== "period" || !s ? f(t, c) : p(s, t, c);
|
|
64
69
|
}
|
|
65
|
-
function
|
|
70
|
+
function W(t) {
|
|
66
71
|
if (t.calendarKind !== "fiscal") return;
|
|
67
72
|
const n = t.weekStartsOn ?? 1, e = t.fiscalYearStartMonth ?? 1;
|
|
68
73
|
return {
|
|
69
74
|
kind: "retail",
|
|
70
|
-
pattern: t.fiscalMonthPattern ??
|
|
75
|
+
pattern: t.fiscalMonthPattern ?? M["4-5-4"],
|
|
71
76
|
weekStartsOn: n,
|
|
72
|
-
fyAnchor: { month: e, day: 1, rule: "
|
|
77
|
+
fyAnchor: { month: e, day: 1, rule: "closest-weekday" }
|
|
73
78
|
};
|
|
74
79
|
}
|
|
75
80
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
S as
|
|
81
|
+
F as getCalendarWeekSelection,
|
|
82
|
+
f as getFiscalWeekSelection,
|
|
83
|
+
P as resolveWeekSelection,
|
|
84
|
+
S as resolveWeekStartsOn,
|
|
85
|
+
W as toFiscalCalendarConfig,
|
|
86
|
+
O as weekStartsOnFromFiscalConfig
|
|
80
87
|
};
|
|
@@ -6,6 +6,7 @@ import { GuidanceTargetRefRegistry } from '../targets/ref-registry';
|
|
|
6
6
|
type Listener = () => void;
|
|
7
7
|
export declare class GuidanceEngine {
|
|
8
8
|
private sessionState;
|
|
9
|
+
private activationToken;
|
|
9
10
|
private readonly listeners;
|
|
10
11
|
private readonly eventHandlers;
|
|
11
12
|
private readonly guideRegistry;
|
|
@@ -47,9 +48,17 @@ export declare class GuidanceEngine {
|
|
|
47
48
|
private resolveGuideStartStepIndex;
|
|
48
49
|
dismiss(dismissMode?: 'session' | 'forever' | 'snoozed'): Promise<void>;
|
|
49
50
|
snooze(guideId?: string): Promise<void>;
|
|
51
|
+
goToPreviousStep(): Promise<void>;
|
|
52
|
+
goToStep(stepId: string): Promise<void>;
|
|
50
53
|
advanceStep(): Promise<void>;
|
|
51
54
|
retryCurrentStep(): Promise<void>;
|
|
52
55
|
skipStep(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Leaves a step whose target will not appear, including while the engine is
|
|
58
|
+
* still waiting for that target.
|
|
59
|
+
*/
|
|
60
|
+
continuePastUnavailableStep(): Promise<void>;
|
|
61
|
+
private moveToFollowingStep;
|
|
53
62
|
getRenderInstruction(): RenderInstruction | null;
|
|
54
63
|
private syncRenderInstructionCache;
|
|
55
64
|
evaluateTriggers(routeScope?: string): Promise<void>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { GuideRegistry as
|
|
2
|
-
import { getStepIndex as u, getNextStepId as
|
|
1
|
+
import { GuideRegistry as S } from "./guide-registry.js";
|
|
2
|
+
import { getStepIndex as u, getNextStepId as c, getStepById as g, resolveLocalizedStepContent as f } from "./step-navigation.js";
|
|
3
3
|
import { TriggerPluginRegistry as v } from "../triggers/trigger-registry.js";
|
|
4
4
|
import { registerBuiltInTriggerPlugins as w } from "../triggers/built-in-triggers.js";
|
|
5
|
-
import { TargetResolver as m, resolveTargetSynchronously as
|
|
5
|
+
import { TargetResolver as m, resolveTargetSynchronously as I, waitForTargetResolved as y } from "../targets/target-resolver.js";
|
|
6
6
|
import { GuidanceTargetRefRegistry as R } from "../targets/ref-registry.js";
|
|
7
|
-
import { buildGuidanceStorageKey as
|
|
7
|
+
import { buildGuidanceStorageKey as r, buildSessionStatsKey as h, createDefaultSessionStats as G } from "../storage/storage-keys.js";
|
|
8
8
|
class _ {
|
|
9
9
|
sessionState = { status: "idle" };
|
|
10
|
+
activationToken = 0;
|
|
10
11
|
listeners = /* @__PURE__ */ new Set();
|
|
11
12
|
eventHandlers = /* @__PURE__ */ new Map();
|
|
12
|
-
guideRegistry = new
|
|
13
|
+
guideRegistry = new S();
|
|
13
14
|
triggerRegistry = new v();
|
|
14
15
|
targetRefRegistry = new R();
|
|
15
16
|
targetResolver;
|
|
@@ -127,7 +128,7 @@ class _ {
|
|
|
127
128
|
const e = this.sessionState.guideId;
|
|
128
129
|
if (e) {
|
|
129
130
|
if (t === "forever" && await this.config.storage.set({
|
|
130
|
-
[
|
|
131
|
+
[r(this.config.tenantId, e, "dismissed")]: {
|
|
131
132
|
dismissed: !0,
|
|
132
133
|
timestamp: Date.now()
|
|
133
134
|
}
|
|
@@ -141,6 +142,26 @@ class _ {
|
|
|
141
142
|
async snooze(t) {
|
|
142
143
|
(t ?? this.sessionState.guideId) && await this.dismiss("snoozed");
|
|
143
144
|
}
|
|
145
|
+
async goToPreviousStep() {
|
|
146
|
+
const t = this.sessionState.guideId, e = this.sessionState.stepId;
|
|
147
|
+
if (!t || !e || this.sessionState.status !== "active")
|
|
148
|
+
return;
|
|
149
|
+
const s = this.guideRegistry.get(t);
|
|
150
|
+
if (!s)
|
|
151
|
+
return;
|
|
152
|
+
const i = u(s, e);
|
|
153
|
+
i <= 0 || s.steps[i - 1]?.advanceOn !== "click-next" || await this.activateGuide(s, i - 1);
|
|
154
|
+
}
|
|
155
|
+
async goToStep(t) {
|
|
156
|
+
const e = this.sessionState.guideId;
|
|
157
|
+
if (!e || this.sessionState.status !== "active")
|
|
158
|
+
return;
|
|
159
|
+
const s = this.guideRegistry.get(e);
|
|
160
|
+
if (!s)
|
|
161
|
+
return;
|
|
162
|
+
const i = u(s, t);
|
|
163
|
+
i < 0 || await this.activateGuide(s, i);
|
|
164
|
+
}
|
|
144
165
|
async advanceStep() {
|
|
145
166
|
const t = this.sessionState.guideId, e = this.sessionState.stepId;
|
|
146
167
|
if (!t || !e || this.sessionState.status !== "active")
|
|
@@ -149,10 +170,10 @@ class _ {
|
|
|
149
170
|
if (!s)
|
|
150
171
|
return;
|
|
151
172
|
this.track("step.completed", { guideId: t, stepId: e });
|
|
152
|
-
const i = await
|
|
173
|
+
const i = await c(
|
|
153
174
|
s,
|
|
154
175
|
e,
|
|
155
|
-
(
|
|
176
|
+
(a) => this.triggerRegistry.evaluateExpression(a, this.buildTriggerContext())
|
|
156
177
|
);
|
|
157
178
|
if (!i) {
|
|
158
179
|
await this.completeGuide(t);
|
|
@@ -173,7 +194,38 @@ class _ {
|
|
|
173
194
|
}
|
|
174
195
|
async skipStep() {
|
|
175
196
|
const t = this.sessionState.guideId, e = this.sessionState.stepId;
|
|
176
|
-
!t || !e ||
|
|
197
|
+
if (!t || !e || this.sessionState.status !== "active")
|
|
198
|
+
return;
|
|
199
|
+
const s = this.guideRegistry.get(t);
|
|
200
|
+
!s || !g(s, e)?.skippable || await this.moveToFollowingStep();
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Leaves a step whose target will not appear, including while the engine is
|
|
204
|
+
* still waiting for that target.
|
|
205
|
+
*/
|
|
206
|
+
async continuePastUnavailableStep() {
|
|
207
|
+
const t = this.sessionState.status;
|
|
208
|
+
t !== "evaluating" && t !== "blocked" && t !== "active" || (this.activationToken += 1, await this.moveToFollowingStep());
|
|
209
|
+
}
|
|
210
|
+
async moveToFollowingStep() {
|
|
211
|
+
const t = this.sessionState.guideId, e = this.sessionState.stepId;
|
|
212
|
+
if (!t || !e)
|
|
213
|
+
return;
|
|
214
|
+
const s = this.guideRegistry.get(t);
|
|
215
|
+
if (!s)
|
|
216
|
+
return;
|
|
217
|
+
this.track("step.skipped", { guideId: t, stepId: e });
|
|
218
|
+
const i = await c(
|
|
219
|
+
s,
|
|
220
|
+
e,
|
|
221
|
+
(a) => this.triggerRegistry.evaluateExpression(a, this.buildTriggerContext())
|
|
222
|
+
);
|
|
223
|
+
if (!i) {
|
|
224
|
+
await this.completeGuide(t);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
const n = u(s, i);
|
|
228
|
+
await this.activateGuide(s, n);
|
|
177
229
|
}
|
|
178
230
|
getRenderInstruction() {
|
|
179
231
|
return this.cachedRenderInstruction;
|
|
@@ -183,11 +235,12 @@ class _ {
|
|
|
183
235
|
this.cachedRenderInstruction = null;
|
|
184
236
|
return;
|
|
185
237
|
}
|
|
186
|
-
const t = this.guideRegistry.get(this.sessionState.guideId), e = t ?
|
|
238
|
+
const t = this.guideRegistry.get(this.sessionState.guideId), e = t ? g(t, this.sessionState.stepId) : void 0;
|
|
187
239
|
if (!t || !e) {
|
|
188
240
|
this.cachedRenderInstruction = null;
|
|
189
241
|
return;
|
|
190
242
|
}
|
|
243
|
+
const s = this.sessionState.stepIndex > 0 ? t.steps[this.sessionState.stepIndex - 1] : void 0;
|
|
191
244
|
this.cachedRenderInstruction = {
|
|
192
245
|
guideId: t.id,
|
|
193
246
|
stepId: e.id,
|
|
@@ -197,7 +250,11 @@ class _ {
|
|
|
197
250
|
content: f(t, e, this.config.locale),
|
|
198
251
|
target: this.sessionState.resolvedTarget ?? null,
|
|
199
252
|
skippable: e.skippable,
|
|
200
|
-
advanceOn: e.advanceOn
|
|
253
|
+
advanceOn: e.advanceOn,
|
|
254
|
+
canGoBack: s?.advanceOn === "click-next",
|
|
255
|
+
placement: e.placement ?? "auto",
|
|
256
|
+
modalBehavior: e.modalBehavior,
|
|
257
|
+
interactionFooter: e.interactionFooter
|
|
201
258
|
};
|
|
202
259
|
}
|
|
203
260
|
async evaluateTriggers(t) {
|
|
@@ -207,106 +264,111 @@ class _ {
|
|
|
207
264
|
if (e.guidesShownThisSession >= this.config.maxGuidesPerSession || e.lastGuideEndedAt && Date.now() - e.lastGuideEndedAt < this.config.cooldownBetweenGuides)
|
|
208
265
|
return;
|
|
209
266
|
const s = t ? this.guideRegistry.getForRoute(t) : [], i = s.length > 0 ? s : this.guideRegistry.getAll();
|
|
210
|
-
await this.hydrateVisitCounts(i.map((
|
|
267
|
+
await this.hydrateVisitCounts(i.map((d) => d.id));
|
|
211
268
|
const n = [];
|
|
212
|
-
for (const
|
|
213
|
-
i.map((
|
|
269
|
+
for (const d of this.guideRegistry.getSortedByPriority(
|
|
270
|
+
i.map((o) => o.id)
|
|
214
271
|
))
|
|
215
|
-
await this.isGuideEligible(
|
|
272
|
+
await this.isGuideEligible(d, e) && n.push(d);
|
|
216
273
|
if (!n.length)
|
|
217
274
|
return;
|
|
218
|
-
const
|
|
275
|
+
const a = n[0];
|
|
219
276
|
this.log("evaluateTriggers.start", {
|
|
220
|
-
guideId:
|
|
277
|
+
guideId: a.id,
|
|
221
278
|
routePath: this.routePath
|
|
222
|
-
}), this.track("guide.triggered", { guideId:
|
|
279
|
+
}), this.track("guide.triggered", { guideId: a.id }), await this.start(a.id);
|
|
223
280
|
}
|
|
224
281
|
async activateGuide(t, e) {
|
|
225
|
-
const s = t.steps[e];
|
|
226
|
-
if (!
|
|
282
|
+
const s = ++this.activationToken, i = t.steps[e];
|
|
283
|
+
if (!i) {
|
|
227
284
|
await this.completeGuide(t.id);
|
|
228
285
|
return;
|
|
229
286
|
}
|
|
230
|
-
let
|
|
231
|
-
if (
|
|
232
|
-
if (
|
|
287
|
+
let n = null;
|
|
288
|
+
if (i.target) {
|
|
289
|
+
if (n = I(
|
|
233
290
|
this.targetResolver,
|
|
234
|
-
|
|
235
|
-
),
|
|
291
|
+
i.target
|
|
292
|
+
), n?.element || (this.setSession({
|
|
236
293
|
status: "evaluating",
|
|
237
294
|
guideId: t.id,
|
|
238
295
|
stepIndex: e,
|
|
239
|
-
stepId:
|
|
240
|
-
}),
|
|
296
|
+
stepId: i.id
|
|
297
|
+
}), n = await y(
|
|
241
298
|
this.targetResolver,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
299
|
+
i.target,
|
|
300
|
+
i.timeout ?? 5e3,
|
|
301
|
+
() => s !== this.activationToken
|
|
302
|
+
)), s !== this.activationToken)
|
|
303
|
+
return;
|
|
304
|
+
if (!n?.element) {
|
|
245
305
|
this.log("activateGuide.blocked", {
|
|
246
306
|
guideId: t.id,
|
|
247
|
-
stepId:
|
|
307
|
+
stepId: i.id,
|
|
248
308
|
stepIndex: e,
|
|
249
|
-
reason:
|
|
250
|
-
targetId:
|
|
309
|
+
reason: n ? "target_not_visible" : "target_not_found",
|
|
310
|
+
targetId: i.target?.targetId
|
|
251
311
|
}), this.setSession({
|
|
252
312
|
status: "blocked",
|
|
253
313
|
guideId: t.id,
|
|
254
314
|
stepIndex: e,
|
|
255
|
-
stepId:
|
|
256
|
-
reason:
|
|
315
|
+
stepId: i.id,
|
|
316
|
+
reason: n ? "target_not_visible" : "target_not_found"
|
|
257
317
|
});
|
|
258
318
|
return;
|
|
259
319
|
}
|
|
260
|
-
} else if (
|
|
320
|
+
} else if (i.renderer !== "announcement") {
|
|
261
321
|
this.log("activateGuide.blocked", {
|
|
262
322
|
guideId: t.id,
|
|
263
|
-
stepId:
|
|
323
|
+
stepId: i.id,
|
|
264
324
|
stepIndex: e,
|
|
265
325
|
reason: "target_not_found"
|
|
266
326
|
}), this.setSession({
|
|
267
327
|
status: "blocked",
|
|
268
328
|
guideId: t.id,
|
|
269
329
|
stepIndex: e,
|
|
270
|
-
stepId:
|
|
330
|
+
stepId: i.id,
|
|
271
331
|
reason: "target_not_found"
|
|
272
332
|
});
|
|
273
333
|
return;
|
|
274
334
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
335
|
+
if (s !== this.activationToken)
|
|
336
|
+
return;
|
|
337
|
+
const a = this.sessionState;
|
|
338
|
+
if (a.status === "idle" || a.guideId !== t.id) {
|
|
339
|
+
this.log("guideStart", { guideId: t.id, stepId: i.id }), this.emitEvent("guideStart", { guideId: t.id, stepId: i.id }), this.track("guide.started", { guideId: t.id });
|
|
278
340
|
const o = await this.loadSessionStats();
|
|
279
341
|
o.guidesShownThisSession += 1, await this.saveSessionStats(o), await this.incrementVisitCount(t.id);
|
|
280
342
|
}
|
|
281
|
-
this.emitEvent("stepChange", { guideId: t.id, stepId:
|
|
343
|
+
this.emitEvent("stepChange", { guideId: t.id, stepId: i.id }), this.track("step.viewed", { guideId: t.id, stepId: i.id }), this.log("step.active", {
|
|
282
344
|
guideId: t.id,
|
|
283
|
-
stepId:
|
|
345
|
+
stepId: i.id,
|
|
284
346
|
stepIndex: e,
|
|
285
|
-
hasTarget: !!
|
|
347
|
+
hasTarget: !!i.target
|
|
286
348
|
}), this.setSession({
|
|
287
349
|
status: "active",
|
|
288
350
|
guideId: t.id,
|
|
289
351
|
stepIndex: e,
|
|
290
|
-
stepId:
|
|
291
|
-
resolvedTarget:
|
|
292
|
-
...
|
|
293
|
-
rect:
|
|
352
|
+
stepId: i.id,
|
|
353
|
+
resolvedTarget: n?.element ? {
|
|
354
|
+
...n,
|
|
355
|
+
rect: n.element.getBoundingClientRect()
|
|
294
356
|
} : void 0
|
|
295
357
|
}), t.persistence.resumeOnRefresh && await this.config.storage.set({
|
|
296
|
-
[
|
|
297
|
-
stepId:
|
|
358
|
+
[r(this.config.tenantId, t.id, "lastStep")]: {
|
|
359
|
+
stepId: i.id,
|
|
298
360
|
timestamp: Date.now()
|
|
299
361
|
}
|
|
300
362
|
});
|
|
301
363
|
}
|
|
302
364
|
async completeGuide(t) {
|
|
303
365
|
this.guideRegistry.get(t)?.persistence.mode === "showOnce" && await this.config.storage.set({
|
|
304
|
-
[
|
|
366
|
+
[r(this.config.tenantId, t, "dismissed")]: {
|
|
305
367
|
dismissed: !0,
|
|
306
368
|
timestamp: Date.now()
|
|
307
369
|
}
|
|
308
370
|
}), await this.config.storage.delete([
|
|
309
|
-
|
|
371
|
+
r(this.config.tenantId, t, "lastStep")
|
|
310
372
|
]);
|
|
311
373
|
const s = await this.loadSessionStats();
|
|
312
374
|
s.lastGuideEndedAt = Date.now(), await this.saveSessionStats(s), this.emitEvent("guideEnd", { guideId: t, reason: "completed" }), this.track("guide.completed", { guideId: t }), this.setSession({ status: "completed", guideId: t }), await this.dequeueNextGuide();
|
|
@@ -321,19 +383,19 @@ class _ {
|
|
|
321
383
|
return this.isGuideEligible(s, i);
|
|
322
384
|
}
|
|
323
385
|
async isGuideEligible(t, e) {
|
|
324
|
-
const s =
|
|
386
|
+
const s = r(
|
|
325
387
|
this.config.tenantId,
|
|
326
388
|
t.id,
|
|
327
389
|
"dismissed"
|
|
328
390
|
);
|
|
329
391
|
if ((await this.config.storage.get([s]))[s]?.dismissed && t.persistence.mode !== "replayable")
|
|
330
392
|
return !1;
|
|
331
|
-
const
|
|
332
|
-
if (
|
|
393
|
+
const a = e.snoozedUntil[t.id];
|
|
394
|
+
if (a && Date.now() < a || (e.dismissedCounts[t.id] ?? 0) >= 3 && t.persistence.mode === "showOnce")
|
|
333
395
|
return !1;
|
|
334
396
|
if (t.persistence.schedule) {
|
|
335
|
-
const
|
|
336
|
-
if (
|
|
397
|
+
const o = Date.now(), l = Date.parse(t.persistence.schedule.start), p = Date.parse(t.persistence.schedule.end);
|
|
398
|
+
if (o < l || o > p)
|
|
337
399
|
return !1;
|
|
338
400
|
}
|
|
339
401
|
return this.triggerRegistry.evaluateAll(
|
|
@@ -371,31 +433,31 @@ class _ {
|
|
|
371
433
|
await this.start(t);
|
|
372
434
|
}
|
|
373
435
|
async loadSessionStats() {
|
|
374
|
-
const t =
|
|
436
|
+
const t = h(this.config.tenantId);
|
|
375
437
|
return (await this.config.storage.get([t]))[t] ?? G();
|
|
376
438
|
}
|
|
377
439
|
async saveSessionStats(t) {
|
|
378
440
|
await this.config.storage.set({
|
|
379
|
-
[
|
|
441
|
+
[h(this.config.tenantId)]: t
|
|
380
442
|
});
|
|
381
443
|
}
|
|
382
444
|
async hydrateVisitCounts(t) {
|
|
383
445
|
if (!t.length)
|
|
384
446
|
return;
|
|
385
447
|
const e = t.map(
|
|
386
|
-
(i) =>
|
|
448
|
+
(i) => r(this.config.tenantId, i, "visitCount")
|
|
387
449
|
), s = await this.config.storage.get(e);
|
|
388
450
|
for (const i of t) {
|
|
389
|
-
const n =
|
|
451
|
+
const n = r(
|
|
390
452
|
this.config.tenantId,
|
|
391
453
|
i,
|
|
392
454
|
"visitCount"
|
|
393
|
-
),
|
|
394
|
-
typeof
|
|
455
|
+
), a = s[n];
|
|
456
|
+
typeof a == "number" && (this.visitCounts[i] = a);
|
|
395
457
|
}
|
|
396
458
|
}
|
|
397
459
|
async incrementVisitCount(t) {
|
|
398
|
-
const e =
|
|
460
|
+
const e = r(
|
|
399
461
|
this.config.tenantId,
|
|
400
462
|
t,
|
|
401
463
|
"visitCount"
|
|
@@ -413,7 +475,7 @@ class _ {
|
|
|
413
475
|
}
|
|
414
476
|
async clearPersistedLastStep(t) {
|
|
415
477
|
await this.config.storage.delete([
|
|
416
|
-
|
|
478
|
+
r(this.config.tenantId, t, "lastStep")
|
|
417
479
|
]);
|
|
418
480
|
}
|
|
419
481
|
scheduleEvaluation() {
|