@qualified-salesforce/web 0.0.1-oidc-bootstrap
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/41842993ec71d6628e4949e9a22b146b.svg +3 -0
- package/7271f3433ed82fc7f56adcd9e30275f4.svg +17 -0
- package/LICENSE.txt +82 -0
- package/components/helpers/entriesStringValidations.js +69 -0
- package/components/helpers/languages.js +32 -0
- package/components/shared/assertUnreachable.js +5 -0
- package/components/shared/controls/imageCropperHelpers.js +43 -0
- package/components/shared/meetingLoadingProgressSpec.js +116 -0
- package/constants.generated.js +9883 -0
- package/css/widget/multimodal_v2/host.split-css.css +162 -0
- package/css/widget/multimodal_v2/index.split-css.panda.css +5240 -0
- package/css/widget/widget.split-css.css +100 -0
- package/fonts/inter/Inter-Black.woff +0 -0
- package/fonts/inter/Inter-Black.woff2 +0 -0
- package/fonts/inter/Inter-BlackItalic.woff +0 -0
- package/fonts/inter/Inter-BlackItalic.woff2 +0 -0
- package/fonts/inter/Inter-Bold.woff +0 -0
- package/fonts/inter/Inter-Bold.woff2 +0 -0
- package/fonts/inter/Inter-BoldItalic.woff +0 -0
- package/fonts/inter/Inter-BoldItalic.woff2 +0 -0
- package/fonts/inter/Inter-ExtraBold.woff +0 -0
- package/fonts/inter/Inter-ExtraBold.woff2 +0 -0
- package/fonts/inter/Inter-ExtraBoldItalic.woff +0 -0
- package/fonts/inter/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/inter/Inter-ExtraLight.woff +0 -0
- package/fonts/inter/Inter-ExtraLight.woff2 +0 -0
- package/fonts/inter/Inter-ExtraLightItalic.woff +0 -0
- package/fonts/inter/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/inter/Inter-Italic.woff +0 -0
- package/fonts/inter/Inter-Italic.woff2 +0 -0
- package/fonts/inter/Inter-Light.woff +0 -0
- package/fonts/inter/Inter-Light.woff2 +0 -0
- package/fonts/inter/Inter-LightItalic.woff +0 -0
- package/fonts/inter/Inter-LightItalic.woff2 +0 -0
- package/fonts/inter/Inter-Medium.woff +0 -0
- package/fonts/inter/Inter-Medium.woff2 +0 -0
- package/fonts/inter/Inter-MediumItalic.woff +0 -0
- package/fonts/inter/Inter-MediumItalic.woff2 +0 -0
- package/fonts/inter/Inter-Regular.woff +0 -0
- package/fonts/inter/Inter-Regular.woff2 +0 -0
- package/fonts/inter/Inter-SemiBold.woff +0 -0
- package/fonts/inter/Inter-SemiBold.woff2 +0 -0
- package/fonts/inter/Inter-SemiBoldItalic.woff +0 -0
- package/fonts/inter/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/inter/Inter-Thin.woff +0 -0
- package/fonts/inter/Inter-Thin.woff2 +0 -0
- package/fonts/inter/Inter-ThinItalic.woff +0 -0
- package/fonts/inter/Inter-ThinItalic.woff2 +0 -0
- package/fonts/inter/Inter-italic.var.woff2 +0 -0
- package/fonts/inter/Inter-roman.var.woff2 +0 -0
- package/images/close.js +63 -0
- package/images/logo.js +22 -0
- package/js/4101.js +19721 -0
- package/js/daily-esm.js +9948 -0
- package/js/date-fns.js +427 -0
- package/js/multimodal_v2.js +1653 -0
- package/js/runtime.js +109 -0
- package/media/Inter-Black.796be8d8bf.woff2 +0 -0
- package/media/Inter-Black.b254104c56.woff +0 -0
- package/media/Inter-BlackItalic.70306b0eae.woff +0 -0
- package/media/Inter-BlackItalic.752f1e0aaa.woff2 +0 -0
- package/media/Inter-Bold.579e0f95ca.woff2 +0 -0
- package/media/Inter-Bold.b1234477a5.woff +0 -0
- package/media/Inter-BoldItalic.3d0d804323.woff +0 -0
- package/media/Inter-BoldItalic.828a494e04.woff2 +0 -0
- package/media/Inter-ExtraBold.208a9e6c99.woff +0 -0
- package/media/Inter-ExtraBold.d65f028165.woff2 +0 -0
- package/media/Inter-ExtraBoldItalic.30429962ec.woff +0 -0
- package/media/Inter-ExtraBoldItalic.8c7eac5ce3.woff2 +0 -0
- package/media/Inter-ExtraLight.15c082a57d.woff +0 -0
- package/media/Inter-ExtraLight.6824177d1e.woff2 +0 -0
- package/media/Inter-ExtraLightItalic.05138dddf3.woff2 +0 -0
- package/media/Inter-ExtraLightItalic.3beee54f59.woff +0 -0
- package/media/Inter-Italic.9beab78452.woff +0 -0
- package/media/Inter-Italic.d593a8df79.woff2 +0 -0
- package/media/Inter-Light.27083fa637.woff2 +0 -0
- package/media/Inter-Light.91dfddd842.woff +0 -0
- package/media/Inter-LightItalic.0a783b89b3.woff2 +0 -0
- package/media/Inter-LightItalic.f8ccf2813f.woff +0 -0
- package/media/Inter-Medium.dc792b508e.woff2 +0 -0
- package/media/Inter-Medium.ec7dd2d9d8.woff +0 -0
- package/media/Inter-MediumItalic.17301e5b40.woff +0 -0
- package/media/Inter-MediumItalic.84d3493a9f.woff2 +0 -0
- package/media/Inter-Regular.f1f0c35b32.woff2 +0 -0
- package/media/Inter-Regular.f356e84aa0.woff +0 -0
- package/media/Inter-SemiBold.55027e4724.woff +0 -0
- package/media/Inter-SemiBold.fcb100c760.woff2 +0 -0
- package/media/Inter-SemiBoldItalic.ab9105ed3b.woff +0 -0
- package/media/Inter-SemiBoldItalic.d90f295d0c.woff2 +0 -0
- package/media/Inter-Thin.16325d9b0f.woff +0 -0
- package/media/Inter-Thin.dafaa44d99.woff2 +0 -0
- package/media/Inter-ThinItalic.4fc662b3cf.woff2 +0 -0
- package/media/Inter-ThinItalic.d3d8994788.woff +0 -0
- package/media/Inter-italic.var.958a0b9742.woff2 +0 -0
- package/media/Inter-roman.var.b2129c009c.woff2 +0 -0
- package/package.json +20 -0
- package/packs/widget/api/docking/docking_host.js +97 -0
- package/packs/widget/api/docking/index.js +294 -0
- package/packs/widget/api/docking/shared.js +164 -0
- package/packs/widget/api/docking/viewport_lock.js +488 -0
- package/packs/widget/api/docking/viewport_resize.js +1203 -0
- package/packs/widget/esm/fonts/Inter-Black.796be8d8bf.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Black.b254104c56.woff +0 -0
- package/packs/widget/esm/fonts/Inter-BlackItalic.70306b0eae.woff +0 -0
- package/packs/widget/esm/fonts/Inter-BlackItalic.752f1e0aaa.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Bold.579e0f95ca.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Bold.b1234477a5.woff +0 -0
- package/packs/widget/esm/fonts/Inter-BoldItalic.3d0d804323.woff +0 -0
- package/packs/widget/esm/fonts/Inter-BoldItalic.828a494e04.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraBold.208a9e6c99.woff +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraBold.d65f028165.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraBoldItalic.30429962ec.woff +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraBoldItalic.8c7eac5ce3.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraLight.15c082a57d.woff +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraLight.6824177d1e.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraLightItalic.05138dddf3.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraLightItalic.3beee54f59.woff +0 -0
- package/packs/widget/esm/fonts/Inter-Italic.9beab78452.woff +0 -0
- package/packs/widget/esm/fonts/Inter-Italic.d593a8df79.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Light.27083fa637.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Light.91dfddd842.woff +0 -0
- package/packs/widget/esm/fonts/Inter-LightItalic.0a783b89b3.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-LightItalic.f8ccf2813f.woff +0 -0
- package/packs/widget/esm/fonts/Inter-Medium.dc792b508e.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Medium.ec7dd2d9d8.woff +0 -0
- package/packs/widget/esm/fonts/Inter-MediumItalic.17301e5b40.woff +0 -0
- package/packs/widget/esm/fonts/Inter-MediumItalic.84d3493a9f.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Regular.f1f0c35b32.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Regular.f356e84aa0.woff +0 -0
- package/packs/widget/esm/fonts/Inter-SemiBold.55027e4724.woff +0 -0
- package/packs/widget/esm/fonts/Inter-SemiBold.fcb100c760.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-SemiBoldItalic.ab9105ed3b.woff +0 -0
- package/packs/widget/esm/fonts/Inter-SemiBoldItalic.d90f295d0c.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Thin.16325d9b0f.woff +0 -0
- package/packs/widget/esm/fonts/Inter-Thin.dafaa44d99.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ThinItalic.4fc662b3cf.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ThinItalic.d3d8994788.woff +0 -0
- package/packs/widget/esm/fonts/Inter-italic.var.958a0b9742.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-roman.var.b2129c009c.woff2 +0 -0
- package/packs/widget/esm/index.js +183 -0
- package/packs/widget/esm/qualified.css +5502 -0
- package/routes/app/offers/scripts/OfferMainScript.js +154 -0
- package/routes/app/offers/scripts/constants.js +71 -0
- package/routes/app/offers/scripts/main/ButtonManager.js +65 -0
- package/routes/app/offers/scripts/main/FormManager.js +325 -0
- package/routes/app/offers/scripts/main/MainContext.js +19 -0
- package/routes/app/offers/scripts/main/OfferManager.js +91 -0
- package/routes/app/offers/scripts/main/TriggerManager.js +125 -0
- package/routes/app/offers/scripts/rendering/ContentManager.js +53 -0
- package/routes/app/offers/scripts/rendering/LocationManager.js +83 -0
- package/routes/app/offers/scripts/rendering/RenderedOffer.js +188 -0
- package/routes/app/offers/scripts/rendering/Renderer.js +69 -0
- package/routes/app/offers/scripts/rendering/RenderingInitializer.js +62 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationManager.js +31 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationManagerFooter.js +81 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationManagerHeader.js +81 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationManagerModal.js +117 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationManagerSidebar.js +75 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationResult.js +43 -0
- package/routes/app/offers/scripts/rendering/animations/Animator.js +78 -0
- package/routes/app/offers/scripts/rendering/animations/BaseAnimationManager.js +25 -0
- package/routes/app/offers/scripts/rendering/lib/BaseComponent.js +106 -0
- package/routes/app/offers/scripts/rendering/lib/FormComponent.js +134 -0
- package/routes/app/offers/scripts/rendering/lib/OfferComponent.js +144 -0
- package/routes/app/offers/scripts/rendering/lib/ScrollbarWidth.js +27 -0
- package/routes/app/offers/scripts/rendering/lib/decorators.js +20 -0
- package/routes/app/offers/scripts/rendering/locations/CSSVarsManager.js +66 -0
- package/routes/app/offers/scripts/rendering/locations/ElementResizeObserver.js +49 -0
- package/routes/app/offers/scripts/rendering/locations/footer.js +53 -0
- package/routes/app/offers/scripts/rendering/locations/header/AsyncBatchProcessor.js +70 -0
- package/routes/app/offers/scripts/rendering/locations/header/CSSTransitionObserver.js +182 -0
- package/routes/app/offers/scripts/rendering/locations/header/ElementStyleChangeObserver.js +138 -0
- package/routes/app/offers/scripts/rendering/locations/header/ExternalStyleManager.js +110 -0
- package/routes/app/offers/scripts/rendering/locations/header/Header.js +353 -0
- package/routes/app/offers/scripts/rendering/locations/header/InlineStyleManager.js +105 -0
- package/routes/app/offers/scripts/rendering/locations/header/MatchingElementsObserver.js +107 -0
- package/routes/app/offers/scripts/rendering/locations/header/NewElementsObserver.js +129 -0
- package/routes/app/offers/scripts/rendering/locations/header/RuleWrapper.js +46 -0
- package/routes/app/offers/scripts/rendering/locations/header/SelectorObservable.js +23 -0
- package/routes/app/offers/scripts/rendering/locations/header/SelectorObserver.js +61 -0
- package/routes/app/offers/scripts/rendering/locations/header/ShiftedElementsManager.js +45 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleElementManager.js +37 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleElementWrapper.js +62 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleSelectorObserver/ObservedSelectorValue.js +45 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleSelectorObserver/ObservedSelectors.js +62 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleSelectorObserver/StyleSelectorObserver.js +294 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleSelectorObserver/constants.js +21 -0
- package/routes/app/offers/scripts/rendering/locations/header/WindowResizeObserver.js +43 -0
- package/routes/app/offers/scripts/rendering/locations/header/utils.js +25 -0
- package/routes/app/offers/scripts/rendering/locations/popup.js +66 -0
- package/routes/app/offers/scripts/rendering/locations/sidebar.js +21 -0
- package/routes/app/offers/scripts/rendering/variations/ButtonBanner.js +105 -0
- package/routes/app/offers/scripts/rendering/variations/ButtonModal.js +114 -0
- package/routes/app/offers/scripts/rendering/variations/FormBanner.js +214 -0
- package/routes/app/offers/scripts/rendering/variations/FormModal.js +325 -0
- package/routes/app/offers/scripts/rendering/variations/LinkBanner.js +105 -0
- package/routes/app/offers/scripts/rendering/variations/components/Body.js +29 -0
- package/routes/app/offers/scripts/rendering/variations/components/Button.js +128 -0
- package/routes/app/offers/scripts/rendering/variations/components/DismissButton.js +39 -0
- package/routes/app/offers/scripts/rendering/variations/components/ForegroundImageBanner.js +110 -0
- package/routes/app/offers/scripts/rendering/variations/components/ForegroundImageModal.js +128 -0
- package/routes/app/offers/scripts/rendering/variations/components/Headline.js +94 -0
- package/routes/app/offers/scripts/rendering/variations/components/MultiFieldForm.js +302 -0
- package/routes/app/offers/scripts/rendering/variations/components/Tooltip.js +74 -0
- package/routes/app/offers/scripts/rendering/variations/icons.js +15 -0
- package/routes/app/offers/scripts/utils.js +115 -0
- package/routes/app/offers/utils/HTMLUtils.js +10 -0
- package/routes/app/offers/utils/createTypeGuard.js +32 -0
- package/routes/app/offers/utils/promise-utils.js +22 -0
- package/routes/app/websiteBuilder/stores/storeHelpers.js +18 -0
- package/sounds/message-initial.mp3 +0 -0
- package/sounds/message-received.mp3 +0 -0
- package/sounds/message-sent.mp3 +0 -0
- package/src/arrays.js +15 -0
- package/src/audio.js +106 -0
- package/src/bounded-set.js +16 -0
- package/src/bounding_box_observer.js +129 -0
- package/src/decorators.js +29 -0
- package/src/dom.js +128 -0
- package/src/dom_roots.js +26 -0
- package/src/embedded_forms/EmbeddedForm.js +638 -0
- package/src/embedded_forms/QualifiedEmbeddedForm.js +51 -0
- package/src/embedded_forms/QualifiedFormField.js +137 -0
- package/src/embedded_forms/utils.js +17 -0
- package/src/graphql-types.js +1686 -0
- package/src/iframes.js +86 -0
- package/src/localstorage.js +43 -0
- package/src/mirror/Shipper.js +133 -0
- package/src/mirror/constants.generated.js +13 -0
- package/src/mirror/constants.js +238 -0
- package/src/mirror/shipper/ChangeQueue.js +155 -0
- package/src/mirror/shipper/DOMSerializer.js +392 -0
- package/src/mirror/shipper/observers.js +441 -0
- package/src/mirror/shipper/utils.js +98 -0
- package/src/mixins/disposable.js +125 -0
- package/src/mixins/injectable.js +37 -0
- package/src/personalizations/personalization-manager.js +110 -0
- package/src/personalizations/strategies/node-freezing-strategy.js +174 -0
- package/src/personalizations/utils.js +187 -0
- package/src/promises.js +107 -0
- package/src/proxy.js +144 -0
- package/src/qualified_root.js +35 -0
- package/src/query_params.js +55 -0
- package/src/shadow-dom-helper.js +63 -0
- package/src/singleton_host.js +39 -0
- package/src/smart_website/trigger.js +49 -0
- package/src/smart_website/utils.js +149 -0
- package/src/string.js +53 -0
- package/src/timezone.js +57 -0
- package/src/timing.js +49 -0
- package/src/type-utils.js +76 -0
- package/src/url-utils.js +102 -0
- package/src/url.js +50 -0
- package/src/utils.js +72 -0
- package/src/validation.js.js +29 -0
- package/src/validation_ts.js +6 -0
- package/vendor/actioncable/adapters.js +6 -0
- package/vendor/actioncable/connection.js +204 -0
- package/vendor/actioncable/connection_monitor.js +129 -0
- package/vendor/actioncable/consumer.js +91 -0
- package/vendor/actioncable/index.js +34 -0
- package/vendor/actioncable/internal.js +22 -0
- package/vendor/actioncable/logger.js +28 -0
- package/vendor/actioncable/subscription.js +93 -0
- package/vendor/actioncable/subscriptions.js +89 -0
- package/vendor/open-telemetry-idgenerator.js +43 -0
- package/widget/analytics/facebook_tracker.js +8 -0
- package/widget/analytics/google_analytics_tracker.js +83 -0
- package/widget/analytics/google_tag_manager_tracker.js +22 -0
- package/widget/analytics.js +58 -0
- package/widget/api_handler/api_handler.js +730 -0
- package/widget/api_handler/base_api_handler.js +249 -0
- package/widget/booker_intent_tracker.js +391 -0
- package/widget/booker_outcome_tracker.js +329 -0
- package/widget/capture_widget_exceptions.js +150 -0
- package/widget/channel.js +282 -0
- package/widget/composite_experience_adapter.js +101 -0
- package/widget/constants.generated.js +350 -0
- package/widget/constants.js +21 -0
- package/widget/container.js +193 -0
- package/widget/content_activity_emitter.js +36 -0
- package/widget/data360_visitor.js +67 -0
- package/widget/date_provider.js +11 -0
- package/widget/debug_mode_state.js +175 -0
- package/widget/dummy_module.js +9 -0
- package/widget/eloqua_visitor.js +17 -0
- package/widget/form_cta_booker_intent.js +246 -0
- package/widget/hubspot_visitor.js +39 -0
- package/widget/inline_meeting_booker_page.js +90 -0
- package/widget/local_state/abstract_local_state.js +38 -0
- package/widget/local_state/debug_state/abstract_debug_flow.js +29 -0
- package/widget/local_state/debug_state/custom_form_flow.js +14 -0
- package/widget/local_state/debug_state/hubspot_form_flow.js +19 -0
- package/widget/local_state/debug_state/hubspot_v4_form_flow.js +19 -0
- package/widget/local_state/debug_state/marketo_form_flow.js +20 -0
- package/widget/local_state/debug_state/pardot_form_flow.js +18 -0
- package/widget/local_state/debug_state.js +362 -0
- package/widget/local_state/trace_state.js +20 -0
- package/widget/location_provider.js +9 -0
- package/widget/marketo_visitor.js +39 -0
- package/widget/meetings/tracing/buttons_forms_triggering_tracer.js +124 -0
- package/widget/meetings/tracing/spans/button_spans.js +18 -0
- package/widget/meetings/tracing/spans/form_spans.js +11 -0
- package/widget/multimodal_v2/assets_preloader.js +97 -0
- package/widget/multimodal_v2/components/AppLayout.js +93 -0
- package/widget/multimodal_v2/components/CursorOverlay.js +93 -0
- package/widget/multimodal_v2/components/PointerRectOverlay.js +74 -0
- package/widget/multimodal_v2/components/app/Artifact.js +109 -0
- package/widget/multimodal_v2/components/app/Background.js +27 -0
- package/widget/multimodal_v2/components/app/CalendarLoadingContent.js +255 -0
- package/widget/multimodal_v2/components/app/Chat.js +39 -0
- package/widget/multimodal_v2/components/app/CookieConsentModal.js +149 -0
- package/widget/multimodal_v2/components/app/Foreground.js +48 -0
- package/widget/multimodal_v2/components/app/HiddenInput.js +41 -0
- package/widget/multimodal_v2/components/app/Input.js +72 -0
- package/widget/multimodal_v2/components/app/LightboxExperience.js +769 -0
- package/widget/multimodal_v2/components/app/LoadingOverlay.js +97 -0
- package/widget/multimodal_v2/components/app/Main.js +985 -0
- package/widget/multimodal_v2/components/app/MessengerButton.js +160 -0
- package/widget/multimodal_v2/components/app/Multimodal.js +17 -0
- package/widget/multimodal_v2/components/app/OverlayControls.js +79 -0
- package/widget/multimodal_v2/components/app/Preview.js +32 -0
- package/widget/multimodal_v2/components/app/PrivacyDisclosure.js +57 -0
- package/widget/multimodal_v2/components/app/RotateDeviceOverlay.js +70 -0
- package/widget/multimodal_v2/components/app/Toolbar.js +156 -0
- package/widget/multimodal_v2/components/chat/ChatComposer.js +129 -0
- package/widget/multimodal_v2/components/chat/ChatInputForm.js +398 -0
- package/widget/multimodal_v2/components/chat/ColdStartQuestions.js +354 -0
- package/widget/multimodal_v2/components/chat/ComposerErrorBanner.js +62 -0
- package/widget/multimodal_v2/components/chat/PostCallSurvey.js +359 -0
- package/widget/multimodal_v2/components/chat/preview/FieldRequestRenderer.js +41 -0
- package/widget/multimodal_v2/components/chat/preview/PreviewMessageRenderer.js +60 -0
- package/widget/multimodal_v2/components/chat/preview/SharedOfferRenderer.js +143 -0
- package/widget/multimodal_v2/components/chat/preview/TextRenderer.js +27 -0
- package/widget/multimodal_v2/components/chat/preview/TimelinePreview.js +254 -0
- package/widget/multimodal_v2/components/chat/timeline/CalendarEventOfferRenderer.js +103 -0
- package/widget/multimodal_v2/components/chat/timeline/CalendarEventPickRenderer.js +148 -0
- package/widget/multimodal_v2/components/chat/timeline/FieldEntryRenderer.js +84 -0
- package/widget/multimodal_v2/components/chat/timeline/FieldRequestRenderer.js +56 -0
- package/widget/multimodal_v2/components/chat/timeline/InlinePrivacyDisclosure.js +66 -0
- package/widget/multimodal_v2/components/chat/timeline/LinkPreviewCard.js +70 -0
- package/widget/multimodal_v2/components/chat/timeline/MessageEntry.js +88 -0
- package/widget/multimodal_v2/components/chat/timeline/PresentContentRenderer.js +30 -0
- package/widget/multimodal_v2/components/chat/timeline/PresentDeckRenderer.js +279 -0
- package/widget/multimodal_v2/components/chat/timeline/PresentVideoRenderer.js +131 -0
- package/widget/multimodal_v2/components/chat/timeline/ShareContentRenderer.js +59 -0
- package/widget/multimodal_v2/components/chat/timeline/SharedOfferRenderer.js +131 -0
- package/widget/multimodal_v2/components/chat/timeline/SystemRenderer.js +82 -0
- package/widget/multimodal_v2/components/chat/timeline/TextRenderer.js +66 -0
- package/widget/multimodal_v2/components/chat/timeline/Timeline.js +158 -0
- package/widget/multimodal_v2/components/debug/DebugMultimodalPanel.js +327 -0
- package/widget/multimodal_v2/components/decks/index.js +160 -0
- package/widget/multimodal_v2/components/field_request/BooleanField.js +77 -0
- package/widget/multimodal_v2/components/field_request/FieldComponents.js +69 -0
- package/widget/multimodal_v2/components/field_request/Form.js +87 -0
- package/widget/multimodal_v2/components/field_request/MultiPicklistField.js +240 -0
- package/widget/multimodal_v2/components/field_request/PicklistField.js +166 -0
- package/widget/multimodal_v2/components/field_request/SingleLineInputField.js +69 -0
- package/widget/multimodal_v2/components/field_request/TextField.js +37 -0
- package/widget/multimodal_v2/components/field_request/index.js +170 -0
- package/widget/multimodal_v2/components/helpers/AutoScroll.js +37 -0
- package/widget/multimodal_v2/components/helpers/ErrorBoundary.js +53 -0
- package/widget/multimodal_v2/components/helpers/FocusTrapDialog.js +26 -0
- package/widget/multimodal_v2/components/helpers/ImpressionTracker.js +94 -0
- package/widget/multimodal_v2/components/helpers/ListRenderer.js +37 -0
- package/widget/multimodal_v2/components/helpers/Localization.js +76 -0
- package/widget/multimodal_v2/components/helpers/Persisted.js +166 -0
- package/widget/multimodal_v2/components/helpers/RichText.js +358 -0
- package/widget/multimodal_v2/components/helpers/ScreenReaderHeading.js +17 -0
- package/widget/multimodal_v2/components/helpers/Thumbnail.js +190 -0
- package/widget/multimodal_v2/components/helpers/VisuallyHidden.js +41 -0
- package/widget/multimodal_v2/components/helpers/content_click_payloads.js +58 -0
- package/widget/multimodal_v2/components/helpers/useDraggable.js +103 -0
- package/widget/multimodal_v2/components/helpers/useTextOverflow.js +44 -0
- package/widget/multimodal_v2/components/lightbox_gather/index.js +741 -0
- package/widget/multimodal_v2/components/meetings/ArtifactEntryPoint.js +252 -0
- package/widget/multimodal_v2/components/meetings/MeetingAdditionalAttendees.js +325 -0
- package/widget/multimodal_v2/components/meetings/MeetingBookerEntry.js +100 -0
- package/widget/multimodal_v2/components/meetings/MeetingDetailsCard.js +99 -0
- package/widget/multimodal_v2/components/meetings/MeetingErrorBanner.js +62 -0
- package/widget/multimodal_v2/components/meetings/MeetingOfferEmailStep.js +239 -0
- package/widget/multimodal_v2/components/meetings/MeetingOfferFooter.js +104 -0
- package/widget/multimodal_v2/components/meetings/MeetingOfferSelectionStep.js +60 -0
- package/widget/multimodal_v2/components/meetings/MeetingRepHeader.js +222 -0
- package/widget/multimodal_v2/components/meetings/MeetingStepShell.js +92 -0
- package/widget/multimodal_v2/components/meetings/MeetingSummaryRail.js +515 -0
- package/widget/multimodal_v2/components/meetings/MeetingTimeSelector.js +603 -0
- package/widget/multimodal_v2/components/meetings/MonthDatePicker.js +422 -0
- package/widget/multimodal_v2/components/meetings/NavigationButtons.js +76 -0
- package/widget/multimodal_v2/components/meetings/TimeSlotHeader.js +357 -0
- package/widget/multimodal_v2/components/meetings/WeekViewHeader.js +20 -0
- package/widget/multimodal_v2/components/meetings/constants.js +7 -0
- package/widget/multimodal_v2/components/meetings/index.js +47 -0
- package/widget/multimodal_v2/components/meetings/utils.js +328 -0
- package/widget/multimodal_v2/components/multimodal/Audio.js +28 -0
- package/widget/multimodal_v2/components/multimodal/Controls.js +188 -0
- package/widget/multimodal_v2/components/multimodal/LiveVideo.js +63 -0
- package/widget/multimodal_v2/components/multimodal/MultiModalComponent.js +424 -0
- package/widget/multimodal_v2/components/multimodal/MultimodalAvatar.js +36 -0
- package/widget/multimodal_v2/components/multimodal/OrbAvatar.js +326 -0
- package/widget/multimodal_v2/components/multimodal/Status.js +220 -0
- package/widget/multimodal_v2/components/multimodal/VideoAvatar.js +24 -0
- package/widget/multimodal_v2/components/multimodal/VideoPreview.js +114 -0
- package/widget/multimodal_v2/components/multimodal/useAudioLevelMonitoring.js +96 -0
- package/widget/multimodal_v2/components/multimodal/useMultimodal.js +434 -0
- package/widget/multimodal_v2/components/presentations/index.js +372 -0
- package/widget/multimodal_v2/components/shared/Avatar.js +92 -0
- package/widget/multimodal_v2/components/shared/AvatarGroup.js +135 -0
- package/widget/multimodal_v2/components/shared/Button.js +245 -0
- package/widget/multimodal_v2/components/shared/ButtonGroup.js +133 -0
- package/widget/multimodal_v2/components/shared/ComposerForm.js +98 -0
- package/widget/multimodal_v2/components/shared/SpeakingIndicator.js +239 -0
- package/widget/multimodal_v2/components/shared/ThinkingAnimation.js +165 -0
- package/widget/multimodal_v2/components/shared/Tooltip.js +266 -0
- package/widget/multimodal_v2/components/shared/controls/Dropdown.js +79 -0
- package/widget/multimodal_v2/components/shared/controls/PillToggle.js +142 -0
- package/widget/multimodal_v2/components/shared/controls/TextArea.js +114 -0
- package/widget/multimodal_v2/components/shared/toolCallLabels.js +12 -0
- package/widget/multimodal_v2/components/slides/SlidesThumbnail.js +47 -0
- package/widget/multimodal_v2/components/slides/index.js +61 -0
- package/widget/multimodal_v2/constants.js +88 -0
- package/widget/multimodal_v2/host.split-css.js +2 -0
- package/widget/multimodal_v2/host.string.js +96 -0
- package/widget/multimodal_v2/images/icons.js +582 -0
- package/widget/multimodal_v2/images/posters/piper_low_res.jpg +0 -0
- package/widget/multimodal_v2/index.js +23 -0
- package/widget/multimodal_v2/index.panda.js +28 -0
- package/widget/multimodal_v2/index.split-css.panda.js +2 -0
- package/widget/multimodal_v2/inline_meeting_booker.js +182 -0
- package/widget/multimodal_v2/locales/cs.js +196 -0
- package/widget/multimodal_v2/locales/da.js +196 -0
- package/widget/multimodal_v2/locales/de.js +196 -0
- package/widget/multimodal_v2/locales/en.js +196 -0
- package/widget/multimodal_v2/locales/en_AU.js +197 -0
- package/widget/multimodal_v2/locales/en_GB.js +197 -0
- package/widget/multimodal_v2/locales/es.js +197 -0
- package/widget/multimodal_v2/locales/es_LA.js +196 -0
- package/widget/multimodal_v2/locales/fi.js +196 -0
- package/widget/multimodal_v2/locales/fr.js +197 -0
- package/widget/multimodal_v2/locales/fr_CA.js +196 -0
- package/widget/multimodal_v2/locales/id.js +196 -0
- package/widget/multimodal_v2/locales/index.js +48 -0
- package/widget/multimodal_v2/locales/it.js +196 -0
- package/widget/multimodal_v2/locales/ja.js +196 -0
- package/widget/multimodal_v2/locales/ko.js +196 -0
- package/widget/multimodal_v2/locales/nb.js +196 -0
- package/widget/multimodal_v2/locales/nl.js +196 -0
- package/widget/multimodal_v2/locales/pl.js +196 -0
- package/widget/multimodal_v2/locales/pt_BR.js +196 -0
- package/widget/multimodal_v2/locales/ru.js +196 -0
- package/widget/multimodal_v2/locales/sv.js +196 -0
- package/widget/multimodal_v2/locales/th.js +196 -0
- package/widget/multimodal_v2/locales/tr.js +196 -0
- package/widget/multimodal_v2/locales/vi.js +196 -0
- package/widget/multimodal_v2/locales/zh_CN.js +196 -0
- package/widget/multimodal_v2/locales/zh_TW.js +196 -0
- package/widget/multimodal_v2/multimodal.js +633 -0
- package/widget/multimodal_v2/multimodal_channel.js +195 -0
- package/widget/multimodal_v2/signals/active_conversation_signal.js +33 -0
- package/widget/multimodal_v2/signals/allowed_conversation_mode_signal.js +38 -0
- package/widget/multimodal_v2/signals/artifact_signal.js +22 -0
- package/widget/multimodal_v2/signals/layout_signal.js +98 -0
- package/widget/multimodal_v2/signals/messages_signal.js +207 -0
- package/widget/multimodal_v2/signals/ui_state_signal.js +128 -0
- package/widget/multimodal_v2/stable_bundle_src.js +44 -0
- package/widget/multimodal_v2/stores/ai_conversation_store.js +221 -0
- package/widget/multimodal_v2/stores/artifact_store.js +205 -0
- package/widget/multimodal_v2/stores/base_store.js +16 -0
- package/widget/multimodal_v2/stores/call_store.js +770 -0
- package/widget/multimodal_v2/stores/call_ui_adapter.js +225 -0
- package/widget/multimodal_v2/stores/debug_multimodal_scenario_store.js +471 -0
- package/widget/multimodal_v2/stores/decks_store.js +285 -0
- package/widget/multimodal_v2/stores/device_store.js +63 -0
- package/widget/multimodal_v2/stores/docking_store.js +62 -0
- package/widget/multimodal_v2/stores/field_request_store.js +326 -0
- package/widget/multimodal_v2/stores/meeting_store.js +477 -0
- package/widget/multimodal_v2/stores/participant_store.js +73 -0
- package/widget/multimodal_v2/stores/post_call_survey_store.js +160 -0
- package/widget/multimodal_v2/stores/pounce_tracking_store.js +163 -0
- package/widget/multimodal_v2/stores/pounce_tracking_store_v2.js +511 -0
- package/widget/multimodal_v2/stores/presentations_store.js +111 -0
- package/widget/multimodal_v2/stores/root_store.js +1919 -0
- package/widget/multimodal_v2/stores/screen_share_store.js +217 -0
- package/widget/multimodal_v2/stores/slides_store.js +21 -0
- package/widget/multimodal_v2/stores/translation_store.js +185 -0
- package/widget/multimodal_v2/stores/ui_store.js +496 -0
- package/widget/multimodal_v2/stores/waiting_store.js +159 -0
- package/widget/multimodal_v2/stores/website_navigation_store.js +767 -0
- package/widget/multimodal_v2/styled-system/css/conditions.js +34 -0
- package/widget/multimodal_v2/styled-system/css/css.js +48 -0
- package/widget/multimodal_v2/styled-system/css/cva.js +96 -0
- package/widget/multimodal_v2/styled-system/css/cx.js +13 -0
- package/widget/multimodal_v2/styled-system/css/index.js +15 -0
- package/widget/multimodal_v2/styled-system/css/sva.js +69 -0
- package/widget/multimodal_v2/styled-system/helpers.js +384 -0
- package/widget/multimodal_v2/styled-system/jsx/create-style-context.js +96 -0
- package/widget/multimodal_v2/styled-system/jsx/factory-helper.js +19 -0
- package/widget/multimodal_v2/styled-system/jsx/factory.js +111 -0
- package/widget/multimodal_v2/styled-system/jsx/index.js +12 -0
- package/widget/multimodal_v2/styled-system/jsx/is-valid-prop.js +22 -0
- package/widget/multimodal_v2/types.js +105 -0
- package/widget/multimodal_v2/utils/auto_scroller.js +157 -0
- package/widget/multimodal_v2/utils/flip_animation.js +124 -0
- package/widget/multimodal_v2/utils/focus_gate.js +237 -0
- package/widget/multimodal_v2/utils/locale.js +16 -0
- package/widget/multimodal_v2/utils/media_queries.js +30 -0
- package/widget/multimodal_v2/utils/multimodal_cache.js +19 -0
- package/widget/multimodal_v2/utils/mutation_effect.js +14 -0
- package/widget/multimodal_v2/utils/navigation_interceptor.js +205 -0
- package/widget/multimodal_v2/utils/navigation_strategies/dom_swap.js +393 -0
- package/widget/multimodal_v2/utils/navigation_strategies/index.js +12 -0
- package/widget/multimodal_v2/utils/navigation_strategies/lwr.js +61 -0
- package/widget/multimodal_v2/utils/navigation_strategies/navigation_utils.js +46 -0
- package/widget/multimodal_v2/utils/navigation_strategies/next_js.js +24 -0
- package/widget/multimodal_v2/utils/navigation_strategies/wouter_v3.js +15 -0
- package/widget/multimodal_v2/utils/objects_map.js +38 -0
- package/widget/multimodal_v2/utils/perceived_voice_turn_tracker.js +345 -0
- package/widget/multimodal_v2/utils/sanitize_html.js +132 -0
- package/widget/multimodal_v2/utils/signals.js +97 -0
- package/widget/multimodal_v2/utils/slide_zoom.js +114 -0
- package/widget/multimodal_v2/utils/theme_styles.js +137 -0
- package/widget/multimodal_v2/utils/url_observer.js +52 -0
- package/widget/multimodal_v2/utils/voice_onset_detector.js +127 -0
- package/widget/page_mirror.js +89 -0
- package/widget/page_view_activity_emitter.js +71 -0
- package/widget/pardot_visitor.js +137 -0
- package/widget/personalization_observer.js +96 -0
- package/widget/personalizations_config.js +160 -0
- package/widget/qualified_form/constants.js +23 -0
- package/widget/qualified_form/phone_utils.js +38 -0
- package/widget/qualified_form/qualified_form_action.js +91 -0
- package/widget/qualified_form/qualified_form_action_orchestrator.js +21 -0
- package/widget/qualified_form/qualified_form_api.js +471 -0
- package/widget/scroll_disabler.js +109 -0
- package/widget/server-logger.js +156 -0
- package/widget/smart_website_config.js +112 -0
- package/widget/telemetry/context.js +75 -0
- package/widget/telemetry/index.js +16 -0
- package/widget/telemetry/messenger_uptime.js +80 -0
- package/widget/telemetry/metrics.js +120 -0
- package/widget/telemetry/span.js +82 -0
- package/widget/telemetry/telemetry.js +180 -0
- package/widget/telemetry/tracer.js +41 -0
- package/widget/telemetry/tracing_store.js +310 -0
- package/widget/tracker.js +916 -0
- package/widget/utils/native_globals.js +129 -0
- package/widget/v1_adapter.js +50 -0
- package/widget/v2_adapter.js +368 -0
- package/widget/visitor/base_visitor_state.js +11 -0
- package/widget/visitor/cookie_visitor_state.js +128 -0
- package/widget/visitor/in_memory_visitor_state.js +29 -0
- package/widget/visitor/visitor_state.js +384 -0
- package/widget/visitor.js +356 -0
- package/widget/widget/linked_widget_v2.js +227 -0
- package/widget/widget/page_mirror_factory.js +22 -0
- package/widget/widget/sentry.js +130 -0
- package/widget/widget/widget.js +1698 -0
- package/widget/widget.split-css.js +2 -0
- package/widget/widget_bootstrap.js +97 -0
- package/widget/widget_object.js +73 -0
package/src/iframes.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { __webpack_require__ } from "../js/runtime.js";
|
|
2
|
+
import "../js/4101.js";
|
|
3
|
+
|
|
4
|
+
const escapeRegExp = __webpack_require__("64700");
|
|
5
|
+
var escapeRegExp_default = /*#__PURE__*/__webpack_require__.n(escapeRegExp);
|
|
6
|
+
|
|
7
|
+
function isIframed() {
|
|
8
|
+
try {
|
|
9
|
+
return window.self !== window.top;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
return true; // Some browsers will raise a same origin exception on `window.top`
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function getParentOrigin() {
|
|
15
|
+
let origin;
|
|
16
|
+
try {
|
|
17
|
+
var _window_location_ancestorOrigins;
|
|
18
|
+
// ancestorOrigins is always correct but is only supported on Chrome/Edge/Safari.
|
|
19
|
+
if (((_window_location_ancestorOrigins = window.location.ancestorOrigins) == null ? void 0 : _window_location_ancestorOrigins.length) > 0) {
|
|
20
|
+
origin = window.location.ancestorOrigins[0];
|
|
21
|
+
}
|
|
22
|
+
// document.referrer works in all browsers, but may be wrong if an iframe is redirected
|
|
23
|
+
// like after an embedded form submission.
|
|
24
|
+
if (!origin) {
|
|
25
|
+
origin = new URL(document.referrer).origin;
|
|
26
|
+
}
|
|
27
|
+
} catch (e) {
|
|
28
|
+
/* IGNORE */ }
|
|
29
|
+
return origin;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if a url matches a list of domain patterns
|
|
33
|
+
* @param hosts array of strings that represent domain patterns. If checkPath is true, this can also represent full urls (host + pathname)
|
|
34
|
+
* @param url valid url string
|
|
35
|
+
* @param checkPath if true, the pathname of the url will be checked as well
|
|
36
|
+
*/ function isDomainMatch(hosts, url, checkPath) {
|
|
37
|
+
if (checkPath === void 0) checkPath = false;
|
|
38
|
+
if (!url) return false;
|
|
39
|
+
let urlHost;
|
|
40
|
+
let normalizedUrl;
|
|
41
|
+
try {
|
|
42
|
+
const parsedUrl = new URL(url);
|
|
43
|
+
urlHost = parsedUrl.host.toLowerCase();
|
|
44
|
+
urlHost = urlHost.startsWith("www.") && checkPath ? urlHost.slice(4) : urlHost;
|
|
45
|
+
normalizedUrl = urlHost + parsedUrl.pathname.toLocaleLowerCase();
|
|
46
|
+
normalizedUrl = normalizedUrl.endsWith("/") ? normalizedUrl.slice(0, -1) : normalizedUrl;
|
|
47
|
+
} catch (e) {
|
|
48
|
+
return false; // invalid url always returns false
|
|
49
|
+
}
|
|
50
|
+
if (hosts.length === 0) return true; // here if hosts is empty then we allow all valid urls
|
|
51
|
+
// compile regex patterns from hosts string array
|
|
52
|
+
// this implementation mirrors implementation of Team::Allowlisting#allowlisted? and Domains::RegexMap#compile_pattern
|
|
53
|
+
const allowedRegexMap = {};
|
|
54
|
+
hosts.forEach((host)=>{
|
|
55
|
+
const splitStringList = host.split(".");
|
|
56
|
+
const splitStringRegexpList = [];
|
|
57
|
+
splitStringList.forEach((stringSegment)=>{
|
|
58
|
+
if (stringSegment === "*") {
|
|
59
|
+
splitStringRegexpList.push("(.*?)");
|
|
60
|
+
} else {
|
|
61
|
+
splitStringRegexpList.push(escapeRegExp_default()(stringSegment));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
allowedRegexMap[host] = new RegExp("^" + splitStringRegexpList.join("\\.") + "$");
|
|
65
|
+
});
|
|
66
|
+
const normalizedHostPattern = (host)=>host.replace(/^https?:\/\//, "").toLowerCase();
|
|
67
|
+
for (const [host, regexExp] of Object.entries(allowedRegexMap)){
|
|
68
|
+
const hostPattern = normalizedHostPattern(host);
|
|
69
|
+
const hasPath = hostPattern.includes("/");
|
|
70
|
+
// If checkPath is true, we have to check the pathname
|
|
71
|
+
// But, if host represents an entire domain (eg: "example.com"), we don't need to check the pathname
|
|
72
|
+
// If host represents a specific page (eg: "example.com/path"), we need to check the pathname
|
|
73
|
+
if (checkPath && hasPath) {
|
|
74
|
+
if (regexExp.test(normalizedUrl)) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
// If checkPath is false, we only check the host
|
|
78
|
+
} else if (regexExp.test(urlHost)) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var iframes_getParentOrigin = /* unused export */ undefined;
|
|
86
|
+
export { iframes_getParentOrigin as getParentOrigin, isDomainMatch, isIframed };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function set(key, value) {
|
|
2
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
function safeSet(key, value) {
|
|
6
|
+
try {
|
|
7
|
+
return set(key, value);
|
|
8
|
+
} catch (e) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function get(key) {
|
|
13
|
+
const str = localStorage.getItem(key);
|
|
14
|
+
return JSON.parse(str);
|
|
15
|
+
}
|
|
16
|
+
function safeGet(key) {
|
|
17
|
+
try {
|
|
18
|
+
return get(key);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function remove(key) {
|
|
24
|
+
localStorage.removeItem(key);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
function safeRemove(key) {
|
|
28
|
+
try {
|
|
29
|
+
return remove(key);
|
|
30
|
+
} catch (e) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// TODO: update downstream imports from "safeSet as localStorageSet" to "localStorageSet"
|
|
35
|
+
const localStorageSet = safeSet;
|
|
36
|
+
const localStorageGet = safeGet;
|
|
37
|
+
const localStorageRemove = safeRemove;
|
|
38
|
+
|
|
39
|
+
var localstorage_get = /* unused export */ undefined;
|
|
40
|
+
var localstorage_remove = /* unused export */ undefined;
|
|
41
|
+
var localstorage_safeRemove = /* unused export */ undefined;
|
|
42
|
+
var localstorage_set = /* unused export */ undefined;
|
|
43
|
+
export { localStorageGet, localStorageRemove, localStorageSet, localstorage_get as get, localstorage_remove as remove, localstorage_safeRemove as safeRemove, localstorage_set as set, safeGet, safeSet };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { __webpack_require__ } from "../../js/runtime.js";
|
|
2
|
+
import "../../js/4101.js";
|
|
3
|
+
import { MessageType } from "./constants.js";
|
|
4
|
+
import { ChangeQueue } from "./shipper/ChangeQueue.js";
|
|
5
|
+
import { DOMSerializer } from "./shipper/DOMSerializer.js";
|
|
6
|
+
import { WindowFocus, Location, MousePosition, MouseClick, Selection, Mutations, Visibility, StylesheetRulesObserver, DocumentScroll, Dimensions, ElementFocus, MediaStateObserver, InputValueObserver, DocumentTree } from "./shipper/observers.js";
|
|
7
|
+
|
|
8
|
+
const throttle = __webpack_require__("61442");
|
|
9
|
+
var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle);
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// Helper classes resposible for state or observering. Order here matters for inclusion in keyframes.
|
|
16
|
+
const Helpers = [
|
|
17
|
+
Location,
|
|
18
|
+
DocumentTree,
|
|
19
|
+
DocumentScroll,
|
|
20
|
+
MousePosition,
|
|
21
|
+
MouseClick,
|
|
22
|
+
Dimensions,
|
|
23
|
+
Visibility,
|
|
24
|
+
WindowFocus,
|
|
25
|
+
Selection,
|
|
26
|
+
ElementFocus,
|
|
27
|
+
Mutations,
|
|
28
|
+
StylesheetRulesObserver,
|
|
29
|
+
MediaStateObserver,
|
|
30
|
+
InputValueObserver
|
|
31
|
+
];
|
|
32
|
+
class Shipper {
|
|
33
|
+
dispose() {
|
|
34
|
+
this.clear();
|
|
35
|
+
this.helpers.forEach((helper)=>helper.dispose());
|
|
36
|
+
if (this.window.__qlfdNodeForId) {
|
|
37
|
+
delete this.window.__qlfdNodeForId;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// Reverse lookup: a co-browse node-id -> the live host-page node it was assigned to. Used by the
|
|
41
|
+
// multimodal widget to anchor Piper's cursor to a specific element (point_at_page). The element's
|
|
42
|
+
// node-id is the same on both ends (Shipper assigns it; the renderer's Receiver mirrors it), so
|
|
43
|
+
// this survives scroll/reflow unlike pixel coordinates.
|
|
44
|
+
//
|
|
45
|
+
// Backed by a lazily-built reverse Map of serializer.nodesToIds, rebuilt only when that map has
|
|
46
|
+
// changed. Additions always bump serializer.idSeq and deletions always shrink the map, so the
|
|
47
|
+
// (idSeq, size) pair changes on every mutation and is a sound staleness check.
|
|
48
|
+
nodeForId(id) {
|
|
49
|
+
var _this_idsToNodes_get;
|
|
50
|
+
const { nodesToIds, idSeq } = this.serializer;
|
|
51
|
+
if (!this.idsToNodes || this.idsToNodesIdSeq !== idSeq || this.idsToNodesSize !== nodesToIds.size) {
|
|
52
|
+
this.idsToNodes = new Map();
|
|
53
|
+
for (const [node, nodeId] of nodesToIds){
|
|
54
|
+
this.idsToNodes.set(nodeId, node);
|
|
55
|
+
}
|
|
56
|
+
this.idsToNodesIdSeq = idSeq;
|
|
57
|
+
this.idsToNodesSize = nodesToIds.size;
|
|
58
|
+
}
|
|
59
|
+
return (_this_idsToNodes_get = this.idsToNodes.get(id)) != null ? _this_idsToNodes_get : null;
|
|
60
|
+
}
|
|
61
|
+
clear() {
|
|
62
|
+
this.serializer.clear();
|
|
63
|
+
this.changeQueue.clear();
|
|
64
|
+
this.sendFrame.cancel();
|
|
65
|
+
}
|
|
66
|
+
start() {
|
|
67
|
+
if (this.started) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.helpers.forEach((helper)=>helper.init());
|
|
71
|
+
this.started = true;
|
|
72
|
+
// Expose the id->node reverse lookup on the host window so the multimodal widget can anchor
|
|
73
|
+
// Piper's cursor to an element by its co-browse node-id (see website_navigation_store#pointAtNode).
|
|
74
|
+
this.window.__qlfdNodeForId = (id)=>this.nodeForId(id);
|
|
75
|
+
this.sendKeyframe();
|
|
76
|
+
}
|
|
77
|
+
// A message is: [protocolVersion!, messageType!, changes[], newNodes[], deletedNodes[]]
|
|
78
|
+
sendKeyframe() {
|
|
79
|
+
if (!this.started) {
|
|
80
|
+
return;
|
|
81
|
+
} // Ignore keyframe requests until we start.
|
|
82
|
+
this.clear();
|
|
83
|
+
// It's important serializer.take() happens after changes serialization.
|
|
84
|
+
const changes = this.keyframeHelpers.map((helper)=>helper.serialize()), [newNodes, deletedNodes] = this.serializer.take();
|
|
85
|
+
this.sendMessage([
|
|
86
|
+
(/* inlined export .ProtocolVersion */1),
|
|
87
|
+
MessageType.Keyframe,
|
|
88
|
+
changes,
|
|
89
|
+
newNodes,
|
|
90
|
+
deletedNodes
|
|
91
|
+
]);
|
|
92
|
+
}
|
|
93
|
+
onNestedShipperMessage(iframeElement, message) {
|
|
94
|
+
this.changeQueue.nestedShipperMessage(iframeElement, message);
|
|
95
|
+
this.sendFrame();
|
|
96
|
+
}
|
|
97
|
+
constructor(wind, doc, sendMessage, observeInputValue = false){
|
|
98
|
+
this.sendFrame = throttle_default()(()=>{
|
|
99
|
+
// Order here also matters like in sendKeyframe.
|
|
100
|
+
const changes = this.changeQueue.take(), [newNodes, deletedNodes] = this.serializer.take();
|
|
101
|
+
this.sendMessage([
|
|
102
|
+
(/* inlined export .ProtocolVersion */1),
|
|
103
|
+
MessageType.Frame,
|
|
104
|
+
changes,
|
|
105
|
+
newNodes,
|
|
106
|
+
deletedNodes
|
|
107
|
+
]);
|
|
108
|
+
}, 1000 / (/* inlined export .FRAME_FPS */15));
|
|
109
|
+
this.window = wind;
|
|
110
|
+
this.document = doc;
|
|
111
|
+
this.sendMessage = sendMessage;
|
|
112
|
+
this.observeInputValue = observeInputValue;
|
|
113
|
+
this.started = false;
|
|
114
|
+
this.serializer = new DOMSerializer(this);
|
|
115
|
+
this.changeQueue = new ChangeQueue(this);
|
|
116
|
+
// Lazily-built reverse index for nodeForId (see below).
|
|
117
|
+
this.idsToNodes = null;
|
|
118
|
+
this.idsToNodesIdSeq = 0;
|
|
119
|
+
this.idsToNodesSize = 0;
|
|
120
|
+
this.helpers = [];
|
|
121
|
+
this.keyframeHelpers = [];
|
|
122
|
+
Helpers.forEach((Helper)=>{
|
|
123
|
+
const helper = new Helper(this);
|
|
124
|
+
this.helpers.push(helper);
|
|
125
|
+
if (Helper.includedInKeyframe) {
|
|
126
|
+
this.keyframeHelpers.push(helper);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
export default Shipper;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// DO NOT EDIT! This file is auto-generated from:
|
|
2
|
+
// app/javascript/codegen.rb
|
|
3
|
+
//
|
|
4
|
+
// To regenerate this file, run `./bin/rails js:codegen`.
|
|
5
|
+
const COBROWSE_PSEUDO_CLASSES = {
|
|
6
|
+
":hover": ".__q__hover",
|
|
7
|
+
":focus-within": ".__q__focus_within",
|
|
8
|
+
":focus-visible": ".__q__focus_visible",
|
|
9
|
+
":focus": ".__q__focus",
|
|
10
|
+
":active": ".__q__active"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { COBROWSE_PSEUDO_CLASSES };
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { __webpack_require__ } from "../../js/runtime.js";
|
|
2
|
+
import "../../js/4101.js";
|
|
3
|
+
|
|
4
|
+
const invert = __webpack_require__("81198");
|
|
5
|
+
var invert_default = /*#__PURE__*/__webpack_require__.n(invert);
|
|
6
|
+
const mapValues = __webpack_require__("20504");
|
|
7
|
+
var mapValues_default = /*#__PURE__*/__webpack_require__.n(mapValues);
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const FRAME_FPS = 15;
|
|
11
|
+
const FRAME_MS = (/* unused pure expression or super */ null && (1000 / FRAME_FPS));
|
|
12
|
+
// Detecting IFRAME load can be tricky, especially on Safari, so this canary is used as an extra check.
|
|
13
|
+
// We use a non-displaying character because if nested IFRAMEs fail, we don't want users to see anything.
|
|
14
|
+
// Note: Must match public/console/live-view.html (used by Firefox)
|
|
15
|
+
const IFRAME_BODY_CANARY = "\u200B";
|
|
16
|
+
const IFRAME_SRCDOC = "<body>​</body>";
|
|
17
|
+
// Protocol Constants
|
|
18
|
+
const ProtocolVersion = 1;
|
|
19
|
+
const MessageType = {
|
|
20
|
+
Keyframe: 1,
|
|
21
|
+
Frame: 2,
|
|
22
|
+
Connected: 3,
|
|
23
|
+
Disconnected: 4
|
|
24
|
+
};
|
|
25
|
+
const ChangeType = {
|
|
26
|
+
DocumentTree: 1,
|
|
27
|
+
NodeTree: 2,
|
|
28
|
+
NodeAttribute: 3,
|
|
29
|
+
NodeData: 4,
|
|
30
|
+
NodeProperty: 5,
|
|
31
|
+
DocumentScroll: 6,
|
|
32
|
+
Mouse: 7,
|
|
33
|
+
Click: 8,
|
|
34
|
+
Dimensions: 9,
|
|
35
|
+
Visibility: 10,
|
|
36
|
+
WindowFocus: 11,
|
|
37
|
+
Selection: 12,
|
|
38
|
+
ElementFocus: 13,
|
|
39
|
+
Location: 14,
|
|
40
|
+
NestedMessage: 15
|
|
41
|
+
};
|
|
42
|
+
// DOM Serialization Constants to save on message space
|
|
43
|
+
const NODE_TYPES = (/* unused pure expression or super */ null && ({
|
|
44
|
+
1: "Element",
|
|
45
|
+
3: "Text",
|
|
46
|
+
4: "CDATASection",
|
|
47
|
+
7: "ProcessingInstruction",
|
|
48
|
+
8: "Comment",
|
|
49
|
+
9: "Document",
|
|
50
|
+
10: "DocumentType",
|
|
51
|
+
11: "DocumentFragment"
|
|
52
|
+
}));
|
|
53
|
+
// Common tags, attributes, and properties to reduce message sizes.
|
|
54
|
+
// DO NOT CHANGE the order or insert a new one in the middle, it will change the protocol.
|
|
55
|
+
const invertCodingArray = (array)=>mapValues_default()(invert_default()(array), (value)=>Number.parseInt(value, 10));
|
|
56
|
+
const NAMESPACE_CODING = [
|
|
57
|
+
"http://www.w3.org/1999/xhtml",
|
|
58
|
+
"http://www.w3.org/2000/svg",
|
|
59
|
+
"http://www.w3.org/1999/xlink",
|
|
60
|
+
"http://www.w3.org/1998/Math/MathML"
|
|
61
|
+
];
|
|
62
|
+
const NAMESPACES = invertCodingArray(NAMESPACE_CODING);
|
|
63
|
+
const TAGNAME_CODING = [
|
|
64
|
+
null,
|
|
65
|
+
// HTML
|
|
66
|
+
"A",
|
|
67
|
+
"ABBR",
|
|
68
|
+
"ADDRESS",
|
|
69
|
+
"AREA",
|
|
70
|
+
"ARTICLE",
|
|
71
|
+
"ASIDE",
|
|
72
|
+
"AUDIO",
|
|
73
|
+
"B",
|
|
74
|
+
"BASE",
|
|
75
|
+
"BDI",
|
|
76
|
+
"BDO",
|
|
77
|
+
"BIG",
|
|
78
|
+
"BLOCKQUOTE",
|
|
79
|
+
"BODY",
|
|
80
|
+
"BR",
|
|
81
|
+
"BUTTON",
|
|
82
|
+
"CANVAS",
|
|
83
|
+
"CAPTION",
|
|
84
|
+
"CITE",
|
|
85
|
+
"CODE",
|
|
86
|
+
"COL",
|
|
87
|
+
"COLGROUP",
|
|
88
|
+
"DATA",
|
|
89
|
+
"DATALIST",
|
|
90
|
+
"DD",
|
|
91
|
+
"DEL",
|
|
92
|
+
"DETAILS",
|
|
93
|
+
"DFN",
|
|
94
|
+
"DIALOG",
|
|
95
|
+
"DIV",
|
|
96
|
+
"DL",
|
|
97
|
+
"DT",
|
|
98
|
+
"EM",
|
|
99
|
+
"EMBED",
|
|
100
|
+
"FIELDSET",
|
|
101
|
+
"FIGCAPTION",
|
|
102
|
+
"FIGURE",
|
|
103
|
+
"FOOTER",
|
|
104
|
+
"FORM",
|
|
105
|
+
"H1",
|
|
106
|
+
"H2",
|
|
107
|
+
"H3",
|
|
108
|
+
"H4",
|
|
109
|
+
"H5",
|
|
110
|
+
"H6",
|
|
111
|
+
"HEAD",
|
|
112
|
+
"HEADER",
|
|
113
|
+
"HR",
|
|
114
|
+
"HTML",
|
|
115
|
+
"I",
|
|
116
|
+
"IFRAME",
|
|
117
|
+
"IMG",
|
|
118
|
+
"INPUT",
|
|
119
|
+
"INS",
|
|
120
|
+
"KBD",
|
|
121
|
+
"KEYGEN",
|
|
122
|
+
"LABEL",
|
|
123
|
+
"LEGEND",
|
|
124
|
+
"LI",
|
|
125
|
+
"LINK",
|
|
126
|
+
"MAIN",
|
|
127
|
+
"MAP",
|
|
128
|
+
"MARK",
|
|
129
|
+
"MENU",
|
|
130
|
+
"MENUITEM",
|
|
131
|
+
"META",
|
|
132
|
+
"METER",
|
|
133
|
+
"NAV",
|
|
134
|
+
"NOSCRIPT",
|
|
135
|
+
"OBJECT",
|
|
136
|
+
"OL",
|
|
137
|
+
"OPTGROUP",
|
|
138
|
+
"OPTION",
|
|
139
|
+
"OUTPUT",
|
|
140
|
+
"P",
|
|
141
|
+
"PARAM",
|
|
142
|
+
"PICTURE",
|
|
143
|
+
"PRE",
|
|
144
|
+
"PROGRESS",
|
|
145
|
+
"Q",
|
|
146
|
+
"RP",
|
|
147
|
+
"RT",
|
|
148
|
+
"RUBY",
|
|
149
|
+
"S",
|
|
150
|
+
"SAMP",
|
|
151
|
+
"SCRIPT",
|
|
152
|
+
"SECTION",
|
|
153
|
+
"SELECT",
|
|
154
|
+
"SMALL",
|
|
155
|
+
"SOURCE",
|
|
156
|
+
"SPAN",
|
|
157
|
+
"STRONG",
|
|
158
|
+
"STYLE",
|
|
159
|
+
"SUB",
|
|
160
|
+
"SUMMARY",
|
|
161
|
+
"SUP",
|
|
162
|
+
"TABLE",
|
|
163
|
+
"TBODY",
|
|
164
|
+
"TD",
|
|
165
|
+
"TEXTAREA",
|
|
166
|
+
"TFOOT",
|
|
167
|
+
"TH",
|
|
168
|
+
"THEAD",
|
|
169
|
+
"TIME",
|
|
170
|
+
"TITLE",
|
|
171
|
+
"TR",
|
|
172
|
+
"TRACK",
|
|
173
|
+
"U",
|
|
174
|
+
"UL",
|
|
175
|
+
"VAR",
|
|
176
|
+
"VIDEO",
|
|
177
|
+
"WBR",
|
|
178
|
+
// SVG
|
|
179
|
+
"circle",
|
|
180
|
+
"clipPath",
|
|
181
|
+
"defs",
|
|
182
|
+
"ellipse",
|
|
183
|
+
"g",
|
|
184
|
+
"line",
|
|
185
|
+
"linearGradient",
|
|
186
|
+
"mask",
|
|
187
|
+
"path",
|
|
188
|
+
"pattern",
|
|
189
|
+
"polygon",
|
|
190
|
+
"polyline",
|
|
191
|
+
"radialGradient",
|
|
192
|
+
"rect",
|
|
193
|
+
"stop",
|
|
194
|
+
"svg",
|
|
195
|
+
"text",
|
|
196
|
+
"tspan",
|
|
197
|
+
"use"
|
|
198
|
+
];
|
|
199
|
+
const TAGNAMES = invertCodingArray(TAGNAME_CODING);
|
|
200
|
+
const ATTRIBUTE_CODING = [
|
|
201
|
+
null
|
|
202
|
+
];
|
|
203
|
+
const ATTRIBUTES = invertCodingArray(ATTRIBUTE_CODING);
|
|
204
|
+
const PROPERTY_CODING = [
|
|
205
|
+
null,
|
|
206
|
+
"scrollLeft",
|
|
207
|
+
"scrollTop",
|
|
208
|
+
"value",
|
|
209
|
+
"paused",
|
|
210
|
+
"currentTime",
|
|
211
|
+
"controls"
|
|
212
|
+
];
|
|
213
|
+
const PROPERTIES = invertCodingArray(PROPERTY_CODING);
|
|
214
|
+
const VALID_PROPERTIES = PROPERTY_CODING.filter((propertyName)=>!!propertyName);
|
|
215
|
+
// These tags neither ship mutations on the Shipper side, nor emit DOM on the receiver side. It's
|
|
216
|
+
// important to filter on both sides because of security implications.
|
|
217
|
+
const IGNORED_TAGS = [
|
|
218
|
+
"NOSCRIPT",
|
|
219
|
+
"SCRIPT",
|
|
220
|
+
"TITLE",
|
|
221
|
+
"FRAME"
|
|
222
|
+
];
|
|
223
|
+
|
|
224
|
+
const safeArrayGet = (array, untrustedIndex)=>typeof untrustedIndex === "number" && untrustedIndex >= 0 && untrustedIndex < array.length ? array[untrustedIndex] : undefined;
|
|
225
|
+
|
|
226
|
+
var constants_ATTRIBUTES = /* unused export */ undefined;
|
|
227
|
+
var constants_ATTRIBUTE_CODING = /* unused export */ undefined;
|
|
228
|
+
var constants_FRAME_MS = /* unused export */ undefined;
|
|
229
|
+
var constants_IFRAME_BODY_CANARY = /* unused export */ undefined;
|
|
230
|
+
var constants_IFRAME_SRCDOC = /* unused export */ undefined;
|
|
231
|
+
var constants_NAMESPACE_CODING = /* unused export */ undefined;
|
|
232
|
+
var constants_NODE_TYPES = /* unused export */ undefined;
|
|
233
|
+
var constants_PROPERTIES = /* unused export */ undefined;
|
|
234
|
+
var constants_PROPERTY_CODING = /* unused export */ undefined;
|
|
235
|
+
var constants_TAGNAME_CODING = /* unused export */ undefined;
|
|
236
|
+
var constants_safeArrayGet = /* unused export */ undefined;
|
|
237
|
+
export { ChangeType, FRAME_FPS, IGNORED_TAGS, MessageType, NAMESPACES, ProtocolVersion, TAGNAMES, VALID_PROPERTIES, constants_ATTRIBUTES as ATTRIBUTES, constants_ATTRIBUTE_CODING as ATTRIBUTE_CODING, constants_FRAME_MS as FRAME_MS, constants_IFRAME_BODY_CANARY as IFRAME_BODY_CANARY, constants_IFRAME_SRCDOC as IFRAME_SRCDOC, constants_NAMESPACE_CODING as NAMESPACE_CODING, constants_NODE_TYPES as NODE_TYPES, constants_PROPERTIES as PROPERTIES, constants_PROPERTY_CODING as PROPERTY_CODING, constants_TAGNAME_CODING as TAGNAME_CODING, constants_safeArrayGet as safeArrayGet };
|
|
238
|
+
export { COBROWSE_PSEUDO_CLASSES } from "./constants.generated.js";
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { ChangeType, IGNORED_TAGS } from "../constants.js";
|
|
2
|
+
import { ShipperHelper } from "./utils.js";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ChangeQueue extends ShipperHelper {
|
|
7
|
+
clear() {
|
|
8
|
+
this.changes = [];
|
|
9
|
+
this.changedGlobals.clear();
|
|
10
|
+
this.changedNodes.clear();
|
|
11
|
+
}
|
|
12
|
+
// ENQUEUE CHANGES
|
|
13
|
+
globalChanged(state) {
|
|
14
|
+
this.changedGlobals.add(state);
|
|
15
|
+
}
|
|
16
|
+
// Event-like changes immediately queue up a change record, they don't de-dupe between frames.
|
|
17
|
+
eventHappened(eventChangeRecord) {
|
|
18
|
+
this.changes.push(eventChangeRecord);
|
|
19
|
+
}
|
|
20
|
+
// Tree changes immediately queue up a change record, they don't de-dupe between frames.
|
|
21
|
+
nodeTreeChanged(target, removedNodes, nextSibling, addedNodes) {
|
|
22
|
+
const changeRecord = [
|
|
23
|
+
this.serializer.nodeToId(target),
|
|
24
|
+
0,
|
|
25
|
+
nextSibling != null ? this.serializer.nodeToId(nextSibling) : 0,
|
|
26
|
+
0
|
|
27
|
+
];
|
|
28
|
+
if (removedNodes.length > 0) {
|
|
29
|
+
changeRecord[1] = [];
|
|
30
|
+
for(let j = 0; j < removedNodes.length; j++){
|
|
31
|
+
const removedNode = removedNodes[j];
|
|
32
|
+
this.serializer.possiblyRemoved(removedNode);
|
|
33
|
+
changeRecord[1].push(this.serializer.nodeToId(removedNode));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (addedNodes.length > 0) {
|
|
37
|
+
changeRecord[3] = [];
|
|
38
|
+
for(let j = 0; j < addedNodes.length; j++){
|
|
39
|
+
const addedNode = addedNodes[j];
|
|
40
|
+
changeRecord[3].push(this.serializer.idTree(addedNode));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
this.changes.push([
|
|
44
|
+
ChangeType.NodeTree,
|
|
45
|
+
changeRecord
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
// Single node changes are marked dirty and converted to change records at next frame.
|
|
49
|
+
nodeAttributeChanged(node, attributeName) {
|
|
50
|
+
if (this.isRelevantNodeType(node)) {
|
|
51
|
+
this.getNodeChanges(node).markAttribute(attributeName);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
nodeDataChanged(node) {
|
|
55
|
+
if (this.isRelevantNodeType(node)) {
|
|
56
|
+
this.getNodeChanges(node).markData();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
nodePropertyChanged(node, propertyName) {
|
|
60
|
+
if (this.isRelevantNodeType(node)) {
|
|
61
|
+
this.getNodeChanges(node).markProperty(propertyName);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
nestedShipperMessage(node, message) {
|
|
65
|
+
this.changes.push([
|
|
66
|
+
ChangeType.NestedMessage,
|
|
67
|
+
[
|
|
68
|
+
this.serializer.nodeToId(node),
|
|
69
|
+
message
|
|
70
|
+
]
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
73
|
+
// DEQUEUE
|
|
74
|
+
take() {
|
|
75
|
+
// Add a change record for every node attribute, property, or data that changed since last frame.
|
|
76
|
+
this.changedNodes.forEach((nodeChanges, node)=>{
|
|
77
|
+
nodeChanges.forEachProperty((propertyName)=>{
|
|
78
|
+
this.changes.push([
|
|
79
|
+
ChangeType.NodeProperty,
|
|
80
|
+
this.serializer.serializeNodePropertyRow(node, propertyName)
|
|
81
|
+
]);
|
|
82
|
+
});
|
|
83
|
+
nodeChanges.forEachAttribute((attributeName)=>{
|
|
84
|
+
this.changes.push([
|
|
85
|
+
ChangeType.NodeAttribute,
|
|
86
|
+
this.serializer.serializeNodeAttributeRow(node, attributeName)
|
|
87
|
+
]);
|
|
88
|
+
});
|
|
89
|
+
if (nodeChanges.data) {
|
|
90
|
+
this.changes.push([
|
|
91
|
+
ChangeType.NodeData,
|
|
92
|
+
this.serializer.serializeNodeDataRow(node)
|
|
93
|
+
]);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
// Add change records for any global state that changed.
|
|
97
|
+
if (this.changedGlobals.size > 0) {
|
|
98
|
+
this.changedGlobals.forEach((state)=>{
|
|
99
|
+
this.changes.push(state.serialize());
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
const changesOut = this.changes;
|
|
103
|
+
this.clear();
|
|
104
|
+
return changesOut;
|
|
105
|
+
}
|
|
106
|
+
// PRIVATE
|
|
107
|
+
isRelevantNodeType(node) {
|
|
108
|
+
const { Node } = this.shipper.window, { nodeType } = node;
|
|
109
|
+
return nodeType === Node.TEXT_NODE || nodeType === Node.ELEMENT_NODE && !IGNORED_TAGS.includes(node.tagName) || nodeType === Node.DOCUMENT_NODE;
|
|
110
|
+
}
|
|
111
|
+
getNodeChanges(node) {
|
|
112
|
+
if (!this.changedNodes.has(node)) {
|
|
113
|
+
const nodeChanges = new NodeChanges();
|
|
114
|
+
this.changedNodes.set(node, nodeChanges);
|
|
115
|
+
return nodeChanges;
|
|
116
|
+
} else {
|
|
117
|
+
return this.changedNodes.get(node);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
constructor(shipper){
|
|
121
|
+
super(shipper);
|
|
122
|
+
this.changes = [];
|
|
123
|
+
this.changedGlobals = new Set();
|
|
124
|
+
this.changedNodes = new Map();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Track what parts of a node changed for the next frame. This auto-dedupes multiple changes to the
|
|
128
|
+
// same property or attribute between frames.
|
|
129
|
+
//
|
|
130
|
+
// TODO: don't dedupe class or style attributes, as they control animations and transitions. Need
|
|
131
|
+
// a next tick setting mechanism in Receiver nodes to properly do that.
|
|
132
|
+
class NodeChanges {
|
|
133
|
+
markProperty(propertyName) {
|
|
134
|
+
this.properties[propertyName] = true;
|
|
135
|
+
}
|
|
136
|
+
markAttribute(attributeName) {
|
|
137
|
+
this.attributes[attributeName] = true;
|
|
138
|
+
}
|
|
139
|
+
markData() {
|
|
140
|
+
this.data = true;
|
|
141
|
+
}
|
|
142
|
+
forEachProperty(callback) {
|
|
143
|
+
Object.keys(this.properties).forEach(callback);
|
|
144
|
+
}
|
|
145
|
+
forEachAttribute(callback) {
|
|
146
|
+
Object.keys(this.attributes).forEach(callback);
|
|
147
|
+
}
|
|
148
|
+
constructor(){
|
|
149
|
+
this.properties = {};
|
|
150
|
+
this.attributes = {};
|
|
151
|
+
this.data = false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export { ChangeQueue };
|