@scalebun/web 1.0.0 → 1.2.2
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/dist/bootstrap/SDKBootstrapper.d.ts +6 -6
- package/dist/bootstrap/SDKBootstrapper.js +8 -8
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +8 -6
- package/dist/browser.js.map +1 -1
- package/dist/config/endpoints.d.ts +12 -0
- package/dist/config/endpoints.d.ts.map +1 -0
- package/dist/config/endpoints.js +12 -0
- package/dist/config/endpoints.js.map +1 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +5 -3
- package/dist/config/schema.js.map +1 -1
- package/dist/core/breadcrumbs.js +1 -1
- package/dist/core/index.d.ts +13 -13
- package/dist/core/index.js +13 -13
- package/dist/core/observe.js +1 -1
- package/dist/core/pageContext.d.ts +1 -1
- package/dist/features/analytics/AnalyticsFeature.d.ts +2 -2
- package/dist/features/analytics/AnalyticsFeature.js +10 -10
- package/dist/features/analytics/autocapture.js +4 -4
- package/dist/features/analytics/sampler.js +1 -1
- package/dist/features/bugreport/BugReportFeature.d.ts +1 -1
- package/dist/features/bugreport/BugReportFeature.js +1 -1
- package/dist/features/bugreport/collect.js +1 -1
- package/dist/features/bugreport/widget.js +9 -9
- package/dist/features/coach/CoachmarkFeature.d.ts +1 -1
- package/dist/features/coach/CoachmarkFeature.js +5 -5
- package/dist/features/coach/anchor.d.ts +1 -1
- package/dist/features/coach/overlay.d.ts +1 -1
- package/dist/features/coach/overlay.js +21 -21
- package/dist/features/coach/position.d.ts +1 -1
- package/dist/features/coach/predicate.d.ts +1 -1
- package/dist/features/coach/tour.d.ts +4 -4
- package/dist/features/coach/tour.js +1 -1
- package/dist/features/coach/types.d.ts +1 -1
- package/dist/features/coach/wait.d.ts +2 -2
- package/dist/features/config/ConfigFeature.d.ts +1 -1
- package/dist/features/config/ConfigFeature.js +5 -5
- package/dist/features/config/configStore.d.ts +1 -1
- package/dist/features/config/targeting.d.ts +1 -1
- package/dist/features/console/ConsoleFeature.js +3 -3
- package/dist/features/console/normalize.js +2 -2
- package/dist/features/console/throttle.d.ts +1 -1
- package/dist/features/crash/CrashFeature.js +2 -2
- package/dist/features/engage/EngageFeature.d.ts +3 -3
- package/dist/features/engage/EngageFeature.js +5 -5
- package/dist/features/engage/attachments.d.ts +1 -1
- package/dist/features/engage/attachments.js +3 -3
- package/dist/features/engage/gameLogic.d.ts +1 -1
- package/dist/features/engage/gameResolver.d.ts +2 -2
- package/dist/features/engage/gameResolver.js +1 -1
- package/dist/features/engage/inappSlots.d.ts +1 -1
- package/dist/features/engage/inappSlots.js +1 -1
- package/dist/features/engage/normalize.d.ts +1 -1
- package/dist/features/engage/richInApp.d.ts +3 -3
- package/dist/features/engage/richInApp.js +6 -6
- package/dist/features/engage/runtime.d.ts +3 -3
- package/dist/features/engage/runtime.js +7 -7
- package/dist/features/engage/shakeDetector.js +1 -1
- package/dist/features/engage/throttle.d.ts +1 -1
- package/dist/features/engage/transport.d.ts +1 -1
- package/dist/features/engage/transport.js +1 -1
- package/dist/features/engage/triggerEngine.d.ts +1 -1
- package/dist/features/engage/widget/InAppWidget.d.ts +1 -1
- package/dist/features/engage/widget/InAppWidget.js +18 -18
- package/dist/features/engage/widget/SurveyWidget.d.ts +1 -1
- package/dist/features/engage/widget/SurveyWidget.js +66 -66
- package/dist/features/errors/ErrorsFeature.d.ts +1 -1
- package/dist/features/errors/ErrorsFeature.js +6 -6
- package/dist/features/errors/group/fingerprint.js +1 -1
- package/dist/features/errors/lazy.d.ts +3 -3
- package/dist/features/errors/lazy.js +3 -3
- package/dist/features/errors/normalize.d.ts +2 -2
- package/dist/features/errors/normalize.js +2 -2
- package/dist/features/errors/redact.js +1 -1
- package/dist/features/errors/sampling.js +1 -1
- package/dist/features/exit-intent/ExitIntentFeature.js +1 -1
- package/dist/features/exit-intent/engine.js +1 -1
- package/dist/features/forms/index.js +1 -1
- package/dist/features/inapp/InApp2Feature.js +1 -1
- package/dist/features/inapp/anchor/controller.d.ts +2 -2
- package/dist/features/inapp/anchor/controller.js +3 -3
- package/dist/features/inapp/api.d.ts +5 -5
- package/dist/features/inapp/api.js +3 -3
- package/dist/features/inapp/blocks/blocks.d.ts +1 -1
- package/dist/features/inapp/blocks/blocks.js +1 -1
- package/dist/features/inapp/blocks/feedback.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/carousel.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/chart.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/code.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/confetti.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/countdown.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/index.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/index.js +18 -18
- package/dist/features/inapp/blocks/heavy/markdown.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/productgrid.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/qr.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/scratch.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/scratch.js +1 -1
- package/dist/features/inapp/blocks/heavy/slot.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/slot.js +1 -1
- package/dist/features/inapp/blocks/heavy/spinwheel.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/spinwheel.js +1 -1
- package/dist/features/inapp/blocks/heavy/steps.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/streak.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/table.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/unavailable.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/video.d.ts +1 -1
- package/dist/features/inapp/blocks/styles.js +191 -191
- package/dist/features/inapp/center/bridge.d.ts +3 -3
- package/dist/features/inapp/center/bridge.js +1 -1
- package/dist/features/inapp/center/panel.d.ts +2 -2
- package/dist/features/inapp/center/panel.js +33 -33
- package/dist/features/inapp/center/store.d.ts +1 -1
- package/dist/features/inapp/center/sync.d.ts +1 -1
- package/dist/features/inapp/center/types.d.ts +1 -1
- package/dist/features/inapp/core/analytics.d.ts +3 -3
- package/dist/features/inapp/core/analytics.js +1 -1
- package/dist/features/inapp/core/compat.d.ts +2 -2
- package/dist/features/inapp/core/debugOverlay.d.ts +2 -2
- package/dist/features/inapp/core/debugOverlay.js +12 -12
- package/dist/features/inapp/core/engine.d.ts +3 -3
- package/dist/features/inapp/core/engine.js +10 -10
- package/dist/features/inapp/core/host.js +22 -22
- package/dist/features/inapp/core/metrics.d.ts +1 -1
- package/dist/features/inapp/core/migration.d.ts +2 -2
- package/dist/features/inapp/core/migration.js +2 -2
- package/dist/features/inapp/core/orchestrator.d.ts +1 -1
- package/dist/features/inapp/core/respect.d.ts +1 -1
- package/dist/features/inapp/core/targeting.d.ts +1 -1
- package/dist/features/inapp/core/targeting.js +1 -1
- package/dist/features/inapp/core/triggers.d.ts +1 -1
- package/dist/features/inapp/core/triggers.js +2 -2
- package/dist/features/inapp/inappContract.web.d.ts +1 -1
- package/dist/features/inapp/index.d.ts +15 -15
- package/dist/features/inapp/index.js +10 -10
- package/dist/features/inapp/registry.web.canonical.d.ts +1 -1
- package/dist/features/inapp/registry.web.catalog.d.ts +1 -1
- package/dist/features/inapp/surfaces/banner.d.ts +1 -1
- package/dist/features/inapp/surfaces/banner.js +1 -1
- package/dist/features/inapp/surfaces/checklist.d.ts +1 -1
- package/dist/features/inapp/surfaces/coachmark.d.ts +1 -1
- package/dist/features/inapp/surfaces/coachmark.js +2 -2
- package/dist/features/inapp/surfaces/hotspot.d.ts +1 -1
- package/dist/features/inapp/surfaces/hotspot.js +2 -2
- package/dist/features/inapp/surfaces/inline.d.ts +4 -4
- package/dist/features/inapp/surfaces/inline.js +11 -11
- package/dist/features/inapp/surfaces/launcher.d.ts +1 -1
- package/dist/features/inapp/surfaces/modal.d.ts +1 -1
- package/dist/features/inapp/surfaces/modal.js +2 -2
- package/dist/features/inapp/surfaces/mount.d.ts +4 -4
- package/dist/features/inapp/surfaces/mount.js +4 -4
- package/dist/features/inapp/surfaces/palette.d.ts +1 -1
- package/dist/features/inapp/surfaces/palette.js +1 -1
- package/dist/features/inapp/surfaces/panel.d.ts +1 -1
- package/dist/features/inapp/surfaces/popover.d.ts +1 -1
- package/dist/features/inapp/surfaces/popover.js +2 -2
- package/dist/features/inapp/surfaces/render.d.ts +4 -4
- package/dist/features/inapp/surfaces/render.d.ts.map +1 -1
- package/dist/features/inapp/surfaces/render.js +23 -19
- package/dist/features/inapp/surfaces/render.js.map +1 -1
- package/dist/features/inapp/surfaces/slideover.d.ts +1 -1
- package/dist/features/inapp/surfaces/slideover.js +1 -1
- package/dist/features/inapp/surfaces/styles.js +179 -179
- package/dist/features/inapp/surfaces/surface.d.ts +4 -4
- package/dist/features/inapp/surfaces/surface.js +2 -2
- package/dist/features/inapp/surfaces/takeover.d.ts +1 -1
- package/dist/features/inapp/surfaces/takeover.js +2 -2
- package/dist/features/inapp/surfaces/toast.d.ts +1 -1
- package/dist/features/inapp/surfaces/toast.js +1 -1
- package/dist/features/inapp/surfaces/toolbar.d.ts +1 -1
- package/dist/features/inapp/surfaces/toolbar.js +2 -2
- package/dist/features/inapp/surfaces/tour.d.ts +1 -1
- package/dist/features/inapp/surfaces/tour.js +5 -5
- package/dist/features/inbox/InboxFeature.d.ts +1 -1
- package/dist/features/inbox/InboxFeature.js +5 -5
- package/dist/features/inbox/runtime.d.ts +2 -2
- package/dist/features/inbox/runtime.js +3 -3
- package/dist/features/inbox/store.d.ts +1 -1
- package/dist/features/inbox/sync.d.ts +2 -2
- package/dist/features/inbox/sync.js +1 -1
- package/dist/features/inbox/widget/InboxWidget.d.ts +1 -1
- package/dist/features/inbox/widget/InboxWidget.js +85 -85
- package/dist/features/journey/InteractionTracker.js +1 -1
- package/dist/features/journey/JourneyFeature.js +3 -3
- package/dist/features/manifest.d.ts +1 -1
- package/dist/features/manifest.js +18 -18
- package/dist/features/network/NetworkFeature.d.ts +1 -1
- package/dist/features/network/NetworkFeature.js +10 -10
- package/dist/features/network/capture/body.d.ts +1 -1
- package/dist/features/network/capture/body.js +1 -1
- package/dist/features/network/classify.d.ts +1 -1
- package/dist/features/network/fetchInterceptor.d.ts +1 -1
- package/dist/features/network/fetchInterceptor.js +1 -1
- package/dist/features/network/intercept/beacon.d.ts +1 -1
- package/dist/features/network/intercept/sse.d.ts +1 -1
- package/dist/features/network/intercept/streams.d.ts +4 -4
- package/dist/features/network/intercept/streams.js +3 -3
- package/dist/features/network/intercept/websocket.d.ts +1 -1
- package/dist/features/network/lazy.d.ts +3 -3
- package/dist/features/network/lazy.js +2 -2
- package/dist/features/network/normalize.d.ts +1 -1
- package/dist/features/network/normalize.js +3 -3
- package/dist/features/network/parse/graphql.d.ts +1 -1
- package/dist/features/network/sampler.js +1 -1
- package/dist/features/network/timing.d.ts +1 -1
- package/dist/features/network/xhrInterceptor.d.ts +1 -1
- package/dist/features/network/xhrInterceptor.js +1 -1
- package/dist/features/performance/PerformanceFeature.d.ts +2 -2
- package/dist/features/performance/PerformanceFeature.js +11 -11
- package/dist/features/performance/longTasks.js +1 -1
- package/dist/features/performance/normalize.js +1 -1
- package/dist/features/performance/sampler.js +1 -1
- package/dist/features/performance/trace/index.d.ts +4 -4
- package/dist/features/performance/trace/index.js +3 -3
- package/dist/features/performance/trace/pageload.d.ts +1 -1
- package/dist/features/performance/trace/pageload.js +1 -1
- package/dist/features/performance/trace/transaction.d.ts +2 -2
- package/dist/features/performance/trace/transaction.js +2 -2
- package/dist/features/profiler/ProfilerFeature.js +1 -1
- package/dist/features/push/PushFeature.d.ts +4 -4
- package/dist/features/push/PushFeature.js +3 -3
- package/dist/features/push/softAsk.d.ts +1 -1
- package/dist/features/push/softAsk.js +26 -26
- package/dist/features/replay/ReplayFeature.d.ts +1 -1
- package/dist/features/replay/ReplayFeature.js +12 -12
- package/dist/features/replay/engine/canvas.d.ts +2 -2
- package/dist/features/replay/engine/crossOrigin.d.ts +1 -1
- package/dist/features/replay/engine/crossOrigin.js +3 -3
- package/dist/features/replay/engine/cssom.d.ts +2 -2
- package/dist/features/replay/engine/iframe.d.ts +2 -2
- package/dist/features/replay/engine/iframe.js +3 -3
- package/dist/features/replay/engine/interactions.d.ts +1 -1
- package/dist/features/replay/engine/interactions.js +1 -1
- package/dist/features/replay/engine/mutations.d.ts +3 -3
- package/dist/features/replay/engine/mutations.js +2 -2
- package/dist/features/replay/engine/player.d.ts +2 -2
- package/dist/features/replay/engine/player.js +1 -1
- package/dist/features/replay/engine/rebuild.d.ts +1 -1
- package/dist/features/replay/engine/replayWorker.js +16 -16
- package/dist/features/replay/engine/resources.d.ts +1 -1
- package/dist/features/replay/engine/resources.js +1 -1
- package/dist/features/replay/engine/snapshot.d.ts +2 -2
- package/dist/features/replay/engine/snapshot.js +1 -1
- package/dist/features/replay/engine/traverse.d.ts +1 -1
- package/dist/features/replay/lifecycle/recorder.d.ts +1 -1
- package/dist/features/replay/lifecycle/recorder.js +20 -20
- package/dist/features/replay/lifecycle/sampling.js +1 -1
- package/dist/features/replay/lifecycle/viewContext.js +1 -1
- package/dist/features/scroll/index.js +1 -1
- package/dist/features/session/sessionManager.d.ts +1 -1
- package/dist/features/session/sessionManager.js +2 -2
- package/dist/features/session/sessionStore.js +1 -1
- package/dist/features/watchdog/WatchdogFeature.d.ts +1 -1
- package/dist/features/watchdog/WatchdogFeature.js +1 -1
- package/dist/features/watchdog/collectors.d.ts +1 -1
- package/dist/features/watchdog/collectors.js +1 -1
- package/dist/features/watchdog/engine.js +8 -8
- package/dist/features/watchdog/incidents.d.ts +1 -1
- package/dist/features/watchdog/incidents.js +1 -1
- package/dist/features/watchdog/rollup.d.ts +1 -1
- package/dist/features/watchdog/rollup.js +1 -1
- package/dist/features/webVitals/WebVitalsFeature.js +4 -4
- package/dist/features/webVitals/observe.d.ts +1 -1
- package/dist/features/webVitals/observe.js +1 -1
- package/dist/features/webperf/WebPerfFeature.d.ts +1 -1
- package/dist/features/webperf/WebPerfFeature.js +3 -3
- package/dist/features/webperf/collectors.js +1 -1
- package/dist/inapp.d.ts +1 -1
- package/dist/inapp.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/pipeline/index.d.ts +1 -1
- package/dist/pipeline/index.js +1 -1
- package/dist/pipeline/pipeline.d.ts +3 -3
- package/dist/pipeline/pipeline.js +4 -4
- package/dist/public/ScaleBunFacade.d.ts +18 -18
- package/dist/public/ScaleBunFacade.js +11 -11
- package/dist/public/index.d.ts +4 -4
- package/dist/public/index.js +2 -2
- package/dist/scalebun-push-sw.js +236 -236
- package/dist/scalebun.min.js +17 -17
- package/dist/scalebun.min.js.map +4 -4
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/transport/httpClient.d.ts +1 -1
- package/dist/transport/httpClient.js +3 -3
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +1 -1
- package/package.json +7 -7
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* message did/didn't show and how the SDK is behaving. Intentionally dependency-free and lazy — it
|
|
7
7
|
* ships in its own chunk and never loads in production unless the flag is set.
|
|
8
8
|
*/
|
|
9
|
-
import { applyNonce } from '../../../core';
|
|
9
|
+
import { applyNonce } from '../../../core/index.js';
|
|
10
10
|
const PANEL_ID = 'scalebun-inapp-debug';
|
|
11
11
|
export function debugEnabled() {
|
|
12
12
|
try {
|
|
@@ -27,17 +27,17 @@ export function mountDebugOverlay(metrics, log) {
|
|
|
27
27
|
host.id = PANEL_ID;
|
|
28
28
|
const root = host.attachShadow({ mode: 'open' });
|
|
29
29
|
const style = applyNonce(document.createElement('style'));
|
|
30
|
-
style.textContent = `
|
|
31
|
-
.p{position:fixed;bottom:12px;left:12px;z-index:2147483646;width:320px;max-height:60vh;overflow:auto;
|
|
32
|
-
background:rgba(17,20,28,.96);color:#e6e9ef;border:1px solid #333b4a;border-radius:10px;
|
|
33
|
-
font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace;padding:10px 12px;box-shadow:0 10px 40px rgba(0,0,0,.5)}
|
|
34
|
-
.h{display:flex;justify-content:space-between;align-items:center;font-weight:700;margin-bottom:6px}
|
|
35
|
-
.h button{background:none;border:0;color:#9aa3b2;cursor:pointer;font:inherit}
|
|
36
|
-
.row{display:flex;justify-content:space-between;gap:8px;padding:1px 0}
|
|
37
|
-
.k{color:#9aa3b2}
|
|
38
|
-
.sec{margin-top:8px;border-top:1px solid #2a3140;padding-top:6px}
|
|
39
|
-
.d{padding:2px 0;border-bottom:1px solid #222833}
|
|
40
|
-
.a-SHOW{color:#5fd18b}.a-QUEUE{color:#e6c15f}.a-DEFER{color:#7c9dff}.a-DROP{color:#e0748a}.a-PREEMPT{color:#d18ee6}
|
|
30
|
+
style.textContent = `
|
|
31
|
+
.p{position:fixed;bottom:12px;left:12px;z-index:2147483646;width:320px;max-height:60vh;overflow:auto;
|
|
32
|
+
background:rgba(17,20,28,.96);color:#e6e9ef;border:1px solid #333b4a;border-radius:10px;
|
|
33
|
+
font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace;padding:10px 12px;box-shadow:0 10px 40px rgba(0,0,0,.5)}
|
|
34
|
+
.h{display:flex;justify-content:space-between;align-items:center;font-weight:700;margin-bottom:6px}
|
|
35
|
+
.h button{background:none;border:0;color:#9aa3b2;cursor:pointer;font:inherit}
|
|
36
|
+
.row{display:flex;justify-content:space-between;gap:8px;padding:1px 0}
|
|
37
|
+
.k{color:#9aa3b2}
|
|
38
|
+
.sec{margin-top:8px;border-top:1px solid #2a3140;padding-top:6px}
|
|
39
|
+
.d{padding:2px 0;border-bottom:1px solid #222833}
|
|
40
|
+
.a-SHOW{color:#5fd18b}.a-QUEUE{color:#e6c15f}.a-DEFER{color:#7c9dff}.a-DROP{color:#e0748a}.a-PREEMPT{color:#d18ee6}
|
|
41
41
|
`;
|
|
42
42
|
root.appendChild(style);
|
|
43
43
|
const panel = document.createElement('div');
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* Everything here is lazy (loaded via the ReplayFeature-style dynamic import), so it costs no
|
|
9
9
|
* eager-core bytes. Fail-safe: any error degrades to "show nothing", never throws into the host.
|
|
10
10
|
*/
|
|
11
|
-
import { type InAppEvent } from './transport';
|
|
12
|
-
import { type UserProfile } from './targeting';
|
|
13
|
-
import { type MigrationConfig } from './migration';
|
|
11
|
+
import { type InAppEvent } from './transport.js';
|
|
12
|
+
import { type UserProfile } from './targeting.js';
|
|
13
|
+
import { type MigrationConfig } from './migration.js';
|
|
14
14
|
export interface EngineDeps {
|
|
15
15
|
apiBaseUrl: string;
|
|
16
16
|
clientKey: string;
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
* Everything here is lazy (loaded via the ReplayFeature-style dynamic import), so it costs no
|
|
9
9
|
* eager-core bytes. Fail-safe: any error degrades to "show nothing", never throws into the host.
|
|
10
10
|
*/
|
|
11
|
-
import { InAppTransport } from './transport';
|
|
12
|
-
import { TriggerBus, routePlugin, eventPlugin, idlePlugin, matchTrigger } from './triggers';
|
|
13
|
-
import { evaluateEligibility, FrequencyStore } from './targeting';
|
|
14
|
-
import { decide } from './orchestrator';
|
|
15
|
-
import { migrateConfig } from './migration';
|
|
16
|
-
import { ShadowHost } from './host';
|
|
17
|
-
import { SlotRegistry } from './slots';
|
|
18
|
-
import { renderVariant } from '../surfaces/render';
|
|
19
|
-
import { zoneForVariant, SURFACE_FOCUS, SURFACE_COST } from '../inappContract.web';
|
|
20
|
-
import { normalizeConfig } from '../../engage/normalize';
|
|
11
|
+
import { InAppTransport } from './transport.js';
|
|
12
|
+
import { TriggerBus, routePlugin, eventPlugin, idlePlugin, matchTrigger } from './triggers.js';
|
|
13
|
+
import { evaluateEligibility, FrequencyStore } from './targeting.js';
|
|
14
|
+
import { decide } from './orchestrator.js';
|
|
15
|
+
import { migrateConfig } from './migration.js';
|
|
16
|
+
import { ShadowHost } from './host.js';
|
|
17
|
+
import { SlotRegistry } from './slots.js';
|
|
18
|
+
import { renderVariant } from '../surfaces/render.js';
|
|
19
|
+
import { zoneForVariant, SURFACE_FOCUS, SURFACE_COST } from '../inappContract.web.js';
|
|
20
|
+
import { normalizeConfig } from '../../engage/normalize.js';
|
|
21
21
|
const TICK_DEBOUNCE_MS = 120;
|
|
22
22
|
export class InAppEngine {
|
|
23
23
|
constructor(deps) {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* The host exposes named mount points per zone (§8.1). Surfaces mount into these; the host itself is
|
|
11
11
|
* headless — it knows nothing about variants or surfaces.
|
|
12
12
|
*/
|
|
13
|
-
import { applyNonce } from '../../../core';
|
|
13
|
+
import { applyNonce } from '../../../core/index.js';
|
|
14
14
|
const HOST_ID = 'scalebun-inapp-host';
|
|
15
15
|
/**
|
|
16
16
|
* The base reset + theme tokens. Kept tiny; surface-specific CSS ships with each lazy surface chunk.
|
|
@@ -34,27 +34,27 @@ const HOST_ID = 'scalebun-inapp-host';
|
|
|
34
34
|
* Comments live out here rather than inside the template literal: everything in the string is shipped
|
|
35
35
|
* to every page load.
|
|
36
36
|
*/
|
|
37
|
-
const BASE_CSS = `
|
|
38
|
-
:host{ all: initial; }
|
|
39
|
-
.layer{
|
|
40
|
-
position: fixed; inset: 0; z-index: 2147483600;
|
|
41
|
-
pointer-events: none; /* the layer is transparent to clicks; surfaces opt back in */
|
|
42
|
-
font-family: var(--scalebun-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
|
|
43
|
-
color: var(--scalebun-fg);
|
|
44
|
-
}
|
|
45
|
-
.layer > *{ pointer-events: auto; }
|
|
46
|
-
.zone{ position: absolute; }
|
|
47
|
-
.zone-top-banner{ top: 0; left: 0; right: 0; }
|
|
48
|
-
.zone-bottom-banner{ bottom: 0; left: 0; right: 0; }
|
|
49
|
-
.zone-toast{ bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
|
|
50
|
-
.zone-side-right{ top: 0; right: 0; bottom: 0; }
|
|
51
|
-
.zone-side-left{ top: 0; left: 0; bottom: 0; }
|
|
52
|
-
.zone-launcher{ bottom: 16px; right: 16px; }
|
|
53
|
-
/* full-bleed zones: click-transparent by design — see the BASE_CSS docblock */
|
|
54
|
-
.zone-modal, .zone-takeover, .zone-palette{ inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
|
|
55
|
-
.zone-anchored{ inset: 0; pointer-events: none; }
|
|
56
|
-
.zone-center{ top: 0; right: 0; }
|
|
57
|
-
@media (prefers-reduced-motion: reduce){ .layer *{ animation: none !important; transition: none !important; } }
|
|
37
|
+
const BASE_CSS = `
|
|
38
|
+
:host{ all: initial; }
|
|
39
|
+
.layer{
|
|
40
|
+
position: fixed; inset: 0; z-index: 2147483600;
|
|
41
|
+
pointer-events: none; /* the layer is transparent to clicks; surfaces opt back in */
|
|
42
|
+
font-family: var(--scalebun-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
|
|
43
|
+
color: var(--scalebun-fg);
|
|
44
|
+
}
|
|
45
|
+
.layer > *{ pointer-events: auto; }
|
|
46
|
+
.zone{ position: absolute; }
|
|
47
|
+
.zone-top-banner{ top: 0; left: 0; right: 0; }
|
|
48
|
+
.zone-bottom-banner{ bottom: 0; left: 0; right: 0; }
|
|
49
|
+
.zone-toast{ bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
|
|
50
|
+
.zone-side-right{ top: 0; right: 0; bottom: 0; }
|
|
51
|
+
.zone-side-left{ top: 0; left: 0; bottom: 0; }
|
|
52
|
+
.zone-launcher{ bottom: 16px; right: 16px; }
|
|
53
|
+
/* full-bleed zones: click-transparent by design — see the BASE_CSS docblock */
|
|
54
|
+
.zone-modal, .zone-takeover, .zone-palette{ inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
|
|
55
|
+
.zone-anchored{ inset: 0; pointer-events: none; }
|
|
56
|
+
.zone-center{ top: 0; right: 0; }
|
|
57
|
+
@media (prefers-reduced-motion: reduce){ .layer *{ animation: none !important; transition: none !important; } }
|
|
58
58
|
`;
|
|
59
59
|
/** Theme tokens for light/dark. Applied as CSS vars on the shadow root :host. */
|
|
60
60
|
const THEME_VARS = {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Zero-dependency; all timing via `performance.now()` when present.
|
|
12
12
|
*/
|
|
13
|
-
import type { Decision } from './orchestrator';
|
|
13
|
+
import type { Decision } from './orchestrator.js';
|
|
14
14
|
export interface MetricsSnapshot {
|
|
15
15
|
renders: number;
|
|
16
16
|
renderErrors: number;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* • 'native' — new schema-driven variants only.
|
|
8
8
|
* The backend keeps serving the legacy flat mirror to very old embeds regardless (mirror-degrade).
|
|
9
9
|
*/
|
|
10
|
-
import type { InAppMessage } from '../../engage/types';
|
|
11
|
-
import type { Variant } from '../types';
|
|
10
|
+
import type { InAppMessage } from '../../engage/types.js';
|
|
11
|
+
import type { Variant } from '../types.js';
|
|
12
12
|
export type InAppEngineMode = 'legacy' | 'compat' | 'native';
|
|
13
13
|
export interface MigrationConfig {
|
|
14
14
|
/** Which engine to run. Default 'compat' (safe: new engine, legacy campaigns still work). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { legacyConfigToVariants } from './compat';
|
|
2
|
-
import { isValidVariant } from '../inappContract.web';
|
|
1
|
+
import { legacyConfigToVariants } from './compat.js';
|
|
2
|
+
import { isValidVariant } from '../inappContract.web.js';
|
|
3
3
|
export function resolveEngineMode(config) {
|
|
4
4
|
return config?.engine ?? 'compat';
|
|
5
5
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* The reference fixture (§8.8) — critical banner + tour + toast + AI panel + checklist, all live —
|
|
11
11
|
* is enforced by orchestrator.test.ts as a deterministic snapshot.
|
|
12
12
|
*/
|
|
13
|
-
import type { Category, FocusClass, PriorityTier, Zone } from '../types';
|
|
13
|
+
import type { Category, FocusClass, PriorityTier, Zone } from '../types.js';
|
|
14
14
|
export type Action = 'SHOW' | 'QUEUE' | 'DEFER' | 'DROP' | 'PREEMPT';
|
|
15
15
|
/** A fully-resolved candidate — the engine fills zone/focus/cost/tier from the contract maps so
|
|
16
16
|
* `decide` stays a pure function of its arguments (no table lookups, no DOM). */
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* or guidance. Ambient/passive surfaces (hints, inbox, hotspots) are never vetoed: they don't
|
|
12
12
|
* interrupt, so respecting the user never means hiding them.
|
|
13
13
|
*/
|
|
14
|
-
import type { Candidate, GuardVerdict } from './orchestrator';
|
|
14
|
+
import type { Candidate, GuardVerdict } from './orchestrator.js';
|
|
15
15
|
export interface RespectProbes {
|
|
16
16
|
isTyping?: () => boolean;
|
|
17
17
|
isFullscreen?: () => boolean;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* The server remains authoritative (it decides the served set); this is the last-mile client guard
|
|
13
13
|
* that also enforces the rules the server can't track per-device (frequency, DOM presence, viewport).
|
|
14
14
|
*/
|
|
15
|
-
import type { Variant } from '../types';
|
|
15
|
+
import type { Variant } from '../types.js';
|
|
16
16
|
/** Is `el` at least `minRatio` visible in the viewport? Reuses coach's pure visibleRatio. */
|
|
17
17
|
export declare function elementVisible(el: Element, minRatio?: number, vp?: {
|
|
18
18
|
width: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visibleRatio } from '../../coach/wait';
|
|
1
|
+
import { visibleRatio } from '../../coach/wait.js';
|
|
2
2
|
// ── Element visibility (P2.5) ──────────────────────────────────────────────────
|
|
3
3
|
/** Is `el` at least `minRatio` visible in the viewport? Reuses coach's pure visibleRatio. */
|
|
4
4
|
export function elementVisible(el, minRatio = 0.5, vp) {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Phase 0 ships route/event/idle plugins. element/hover/selection/keyboard/right-click plugins plug
|
|
11
11
|
* into the same bus later (P2.5/P3.4) with no bus change — they just emit more signal types.
|
|
12
12
|
*/
|
|
13
|
-
import type { TriggerRef, TriggerType } from '../types';
|
|
13
|
+
import type { TriggerRef, TriggerType } from '../types.js';
|
|
14
14
|
export interface TriggerSignal {
|
|
15
15
|
type: TriggerType;
|
|
16
16
|
/** route path · event name · selector — type-specific. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { matchRoute } from './targeting';
|
|
2
|
-
import { ChordManager } from './keyboard';
|
|
1
|
+
import { matchRoute } from './targeting.js';
|
|
2
|
+
import { ChordManager } from './keyboard.js';
|
|
3
3
|
/** Pure: does a variant's trigger ref match this fired signal? */
|
|
4
4
|
export function matchTrigger(ref, sig) {
|
|
5
5
|
if (ref.type !== sig.type)
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* lives in, its focus class, its attention cost, and zone capacities — so the scheduler is pure data
|
|
12
12
|
* over these tables and a new surface just adds rows here.
|
|
13
13
|
*/
|
|
14
|
-
import type { BlockKind, FocusClass, Platform, PriorityTier, Surface, TriggerType, Variant, Zone } from './types';
|
|
14
|
+
import type { BlockKind, FocusClass, Platform, PriorityTier, Surface, TriggerType, Variant, Zone } from './types.js';
|
|
15
15
|
export declare const PLATFORMS: readonly Platform[];
|
|
16
16
|
export declare const SURFACES: readonly Surface[];
|
|
17
17
|
export declare const PRIORITY_TIERS: readonly PriorityTier[];
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
* barrel is reachable only via the `./inapp` subpath, so `src/index.ts` (the size-gated core) never
|
|
6
6
|
* statically imports it.
|
|
7
7
|
*/
|
|
8
|
-
export type { Platform, Category, Surface, Zone, FocusClass, PriorityTier, BlockKind, ContentBlock, TriggerType, TriggerRef, TargetingRule, SurfaceOptions, FrequencyRule, DismissRule, MotionName, MotionSpec, A11ySpec, AnalyticsSpec, VariantContract, Variant, InAppRegistry, } from './types';
|
|
9
|
-
export { validateVariant, isValidVariant, stripPreviewOnly, zoneForVariant, zoneCap, SURFACES, SURFACE_ZONE, SURFACE_FOCUS, SURFACE_COST } from './inappContract.web';
|
|
10
|
-
export type { ValidationIssue } from './inappContract.web';
|
|
11
|
-
export { WEB_REGISTRY, WEB_REGISTRY_VERSION, getVariantById, getVariantByKey } from './registry.web.canonical';
|
|
12
|
-
export { WEB_CATALOG } from './registry.web.catalog';
|
|
13
|
-
export { migrateConfig, resolveEngineMode, useNewEngine, type InAppEngineMode } from './core/migration';
|
|
14
|
-
export { InAppHeadless, noopHooks } from './api';
|
|
15
|
-
export { renderVariant, isSurfaceSupported, SURFACE_LOADERS } from './surfaces/render';
|
|
16
|
-
export type { RenderedSurface, RenderDeps } from './surfaces/render';
|
|
17
|
-
export type { SurfaceHooks } from './surfaces/surface';
|
|
18
|
-
export { ShadowHost, applyThemeVars } from './core/host';
|
|
19
|
-
export type { ThemeMode } from './core/host';
|
|
20
|
-
export { SlotRegistry } from './core/slots';
|
|
21
|
-
export { ensureHeavyBlocks, HEAVY_BLOCK_KINDS, isHeavyBlock } from './blocks/heavy';
|
|
22
|
-
export { legacyToVariant, legacyConfigToVariants, mapLayoutToSurface } from './core/compat';
|
|
8
|
+
export type { Platform, Category, Surface, Zone, FocusClass, PriorityTier, BlockKind, ContentBlock, TriggerType, TriggerRef, TargetingRule, SurfaceOptions, FrequencyRule, DismissRule, MotionName, MotionSpec, A11ySpec, AnalyticsSpec, VariantContract, Variant, InAppRegistry, } from './types.js';
|
|
9
|
+
export { validateVariant, isValidVariant, stripPreviewOnly, zoneForVariant, zoneCap, SURFACES, SURFACE_ZONE, SURFACE_FOCUS, SURFACE_COST } from './inappContract.web.js';
|
|
10
|
+
export type { ValidationIssue } from './inappContract.web.js';
|
|
11
|
+
export { WEB_REGISTRY, WEB_REGISTRY_VERSION, getVariantById, getVariantByKey } from './registry.web.canonical.js';
|
|
12
|
+
export { WEB_CATALOG } from './registry.web.catalog.js';
|
|
13
|
+
export { migrateConfig, resolveEngineMode, useNewEngine, type InAppEngineMode } from './core/migration.js';
|
|
14
|
+
export { InAppHeadless, noopHooks } from './api.js';
|
|
15
|
+
export { renderVariant, isSurfaceSupported, SURFACE_LOADERS } from './surfaces/render.js';
|
|
16
|
+
export type { RenderedSurface, RenderDeps } from './surfaces/render.js';
|
|
17
|
+
export type { SurfaceHooks } from './surfaces/surface.js';
|
|
18
|
+
export { ShadowHost, applyThemeVars } from './core/host.js';
|
|
19
|
+
export type { ThemeMode } from './core/host.js';
|
|
20
|
+
export { SlotRegistry } from './core/slots.js';
|
|
21
|
+
export { ensureHeavyBlocks, HEAVY_BLOCK_KINDS, isHeavyBlock } from './blocks/heavy/index.js';
|
|
22
|
+
export { legacyToVariant, legacyConfigToVariants, mapLayoutToSurface } from './core/compat.js';
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
* barrel is reachable only via the `./inapp` subpath, so `src/index.ts` (the size-gated core) never
|
|
6
6
|
* statically imports it.
|
|
7
7
|
*/
|
|
8
|
-
export { validateVariant, isValidVariant, stripPreviewOnly, zoneForVariant, zoneCap, SURFACES, SURFACE_ZONE, SURFACE_FOCUS, SURFACE_COST } from './inappContract.web';
|
|
8
|
+
export { validateVariant, isValidVariant, stripPreviewOnly, zoneForVariant, zoneCap, SURFACES, SURFACE_ZONE, SURFACE_FOCUS, SURFACE_COST } from './inappContract.web.js';
|
|
9
9
|
// Canonical registry + full catalog
|
|
10
|
-
export { WEB_REGISTRY, WEB_REGISTRY_VERSION, getVariantById, getVariantByKey } from './registry.web.canonical';
|
|
11
|
-
export { WEB_CATALOG } from './registry.web.catalog';
|
|
10
|
+
export { WEB_REGISTRY, WEB_REGISTRY_VERSION, getVariantById, getVariantByKey } from './registry.web.canonical.js';
|
|
11
|
+
export { WEB_CATALOG } from './registry.web.catalog.js';
|
|
12
12
|
// Migration (M5)
|
|
13
|
-
export { migrateConfig, resolveEngineMode, useNewEngine } from './core/migration';
|
|
13
|
+
export { migrateConfig, resolveEngineMode, useNewEngine } from './core/migration.js';
|
|
14
14
|
// Headless / slot API + renderer
|
|
15
|
-
export { InAppHeadless, noopHooks } from './api';
|
|
16
|
-
export { renderVariant, isSurfaceSupported, SURFACE_LOADERS } from './surfaces/render';
|
|
17
|
-
export { ShadowHost, applyThemeVars } from './core/host';
|
|
18
|
-
export { SlotRegistry } from './core/slots';
|
|
15
|
+
export { InAppHeadless, noopHooks } from './api.js';
|
|
16
|
+
export { renderVariant, isSurfaceSupported, SURFACE_LOADERS } from './surfaces/render.js';
|
|
17
|
+
export { ShadowHost, applyThemeVars } from './core/host.js';
|
|
18
|
+
export { SlotRegistry } from './core/slots.js';
|
|
19
19
|
// Heavy content blocks (lazy) — ensure them before rendering variants that use markdown/code/chart/table/video.
|
|
20
|
-
export { ensureHeavyBlocks, HEAVY_BLOCK_KINDS, isHeavyBlock } from './blocks/heavy';
|
|
20
|
+
export { ensureHeavyBlocks, HEAVY_BLOCK_KINDS, isHeavyBlock } from './blocks/heavy/index.js';
|
|
21
21
|
// Compat (M0 migration)
|
|
22
|
-
export { legacyToVariant, legacyConfigToVariants, mapLayoutToSurface } from './core/compat';
|
|
22
|
+
export { legacyToVariant, legacyConfigToVariants, mapLayoutToSurface } from './core/compat.js';
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Phase 0 seed: a representative slice of the ~100-variant catalog (Task 2) covering the surfaces the
|
|
14
14
|
* early phases render. The full sweep lands in P4.3.
|
|
15
15
|
*/
|
|
16
|
-
import type { InAppRegistry, Variant } from './types';
|
|
16
|
+
import type { InAppRegistry, Variant } from './types.js';
|
|
17
17
|
export declare const WEB_REGISTRY_VERSION = 1;
|
|
18
18
|
export declare const WEB_REGISTRY: InAppRegistry;
|
|
19
19
|
export declare function getVariantById(id: string): Variant | undefined;
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This is the "add a message = add a data row" promise at scale: no renderer switches on id.
|
|
9
9
|
*/
|
|
10
|
-
import type { Variant } from './types';
|
|
10
|
+
import type { Variant } from './types.js';
|
|
11
11
|
export declare const WEB_CATALOG: Variant[];
|
|
12
12
|
//# sourceMappingURL=registry.web.catalog.d.ts.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* S9 — Banner surface (P1.2). Top/bottom sticky bar. Ambient (never steals focus), inline blocks,
|
|
3
3
|
* optional close button. Announced politely to screen readers via role=region + aria-live.
|
|
4
4
|
*/
|
|
5
|
-
import type { SurfaceInstance, SurfaceMountCtx } from './surface';
|
|
5
|
+
import type { SurfaceInstance, SurfaceMountCtx } from './surface.js';
|
|
6
6
|
export declare function bannerSurface(ctx: SurfaceMountCtx): SurfaceInstance;
|
|
7
7
|
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* `completeStep(id)` when a tracked event fires (server-/event-driven activation). When every step is
|
|
6
6
|
* done it fires `checklist_complete` (a celebration surface can follow).
|
|
7
7
|
*/
|
|
8
|
-
import type { SurfaceInstance, SurfaceMountCtx } from './surface';
|
|
8
|
+
import type { SurfaceInstance, SurfaceMountCtx } from './surface.js';
|
|
9
9
|
export interface ChecklistApi {
|
|
10
10
|
completeStep(id: string): void;
|
|
11
11
|
}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* so the user can act on the highlighted element. Anchoring, self-heal, and graceful fallback come
|
|
6
6
|
* from the unified LiveAnchor (P2.1).
|
|
7
7
|
*/
|
|
8
|
-
import type { SurfaceInstance, SurfaceMountCtx } from './surface';
|
|
8
|
+
import type { SurfaceInstance, SurfaceMountCtx } from './surface.js';
|
|
9
9
|
export declare function coachmarkSurface(ctx: SurfaceMountCtx): SurfaceInstance;
|
|
10
10
|
//# sourceMappingURL=coachmark.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderVariantBlocks } from './surface';
|
|
2
|
-
import { LiveAnchor, specFromSelector } from '../anchor/controller';
|
|
1
|
+
import { renderVariantBlocks } from './surface.js';
|
|
2
|
+
import { LiveAnchor, specFromSelector } from '../anchor/controller.js';
|
|
3
3
|
function anchorSelector(ctx) {
|
|
4
4
|
return ctx.variant.targeting?.element ?? ctx.variant.triggers.find((t) => (t.type === 'element' || t.type === 'hover') && t.match)?.match;
|
|
5
5
|
}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* reveals a small card. Zero-interruption discovery — it never blocks or steals focus, and it uses
|
|
4
4
|
* the unified LiveAnchor so the beacon follows its target and degrades gracefully if it vanishes.
|
|
5
5
|
*/
|
|
6
|
-
import type { SurfaceInstance, SurfaceMountCtx } from './surface';
|
|
6
|
+
import type { SurfaceInstance, SurfaceMountCtx } from './surface.js';
|
|
7
7
|
export declare function hotspotSurface(ctx: SurfaceMountCtx): SurfaceInstance;
|
|
8
8
|
//# sourceMappingURL=hotspot.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderVariantBlocks } from './surface';
|
|
2
|
-
import { LiveAnchor, specFromSelector } from '../anchor/controller';
|
|
1
|
+
import { renderVariantBlocks } from './surface.js';
|
|
2
|
+
import { LiveAnchor, specFromSelector } from '../anchor/controller.js';
|
|
3
3
|
function anchorSelector(ctx) {
|
|
4
4
|
return ctx.variant.targeting?.element ?? ctx.variant.triggers.find((t) => (t.type === 'element' || t.type === 'hover') && t.match)?.match;
|
|
5
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Variant } from '../types';
|
|
2
|
-
import type { SlotRegistry } from '../core/slots';
|
|
3
|
-
import { type ThemeMode } from '../core/host';
|
|
4
|
-
import { type SurfaceHooks } from './surface';
|
|
1
|
+
import type { Variant } from '../types.js';
|
|
2
|
+
import type { SlotRegistry } from '../core/slots.js';
|
|
3
|
+
import { type ThemeMode } from '../core/host.js';
|
|
4
|
+
import { type SurfaceHooks } from './surface.js';
|
|
5
5
|
export interface MountedInline {
|
|
6
6
|
close(): void;
|
|
7
7
|
mounted(): boolean;
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
* root (the §7.5 inline exception) so host CSS can't leak in and ours can't leak out, while staying in
|
|
5
5
|
* the normal layout flow. Late-binds to its slot via the SlotRegistry.
|
|
6
6
|
*/
|
|
7
|
-
import { injectStyle } from '../../../core';
|
|
8
|
-
import { applyThemeVars } from '../core/host';
|
|
9
|
-
import { BLOCKS_CSS } from '../blocks/styles';
|
|
10
|
-
import { buildBlockContext, observeView } from './surface';
|
|
11
|
-
import { renderBlocks } from '../blocks/blocks';
|
|
12
|
-
const INLINE_CSS = `
|
|
13
|
-
:host{ display:block; }
|
|
14
|
-
.scalebun-inline{ position:relative; background:var(--scalebun-bg); color:var(--scalebun-fg);
|
|
15
|
-
border:1px solid var(--scalebun-border); border-radius:var(--scalebun-radius); padding:18px; }
|
|
16
|
-
.scalebun-inline .scalebun-x{ position:absolute; top:8px; right:8px; background:none; border:0;
|
|
17
|
-
color:var(--scalebun-muted); cursor:pointer; font-size:16px; border-radius:6px; }
|
|
7
|
+
import { injectStyle } from '../../../core/index.js';
|
|
8
|
+
import { applyThemeVars } from '../core/host.js';
|
|
9
|
+
import { BLOCKS_CSS } from '../blocks/styles.js';
|
|
10
|
+
import { buildBlockContext, observeView } from './surface.js';
|
|
11
|
+
import { renderBlocks } from '../blocks/blocks.js';
|
|
12
|
+
const INLINE_CSS = `
|
|
13
|
+
:host{ display:block; }
|
|
14
|
+
.scalebun-inline{ position:relative; background:var(--scalebun-bg); color:var(--scalebun-fg);
|
|
15
|
+
border:1px solid var(--scalebun-border); border-radius:var(--scalebun-radius); padding:18px; }
|
|
16
|
+
.scalebun-inline .scalebun-x{ position:absolute; top:8px; right:8px; background:none; border:0;
|
|
17
|
+
color:var(--scalebun-muted); cursor:pointer; font-size:16px; border-radius:6px; }
|
|
18
18
|
`;
|
|
19
19
|
export function mountInline(registry, variant, hooks, opts = {}) {
|
|
20
20
|
const slotName = variant.surfaceOptions?.slot ?? 'default';
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* surfaceOptions.commands; selecting one routes an action to the host. Placement is viewport-safe
|
|
5
5
|
* (lives in the fixed launcher zone → never spans monitors).
|
|
6
6
|
*/
|
|
7
|
-
import type { SurfaceInstance, SurfaceMountCtx } from './surface';
|
|
7
|
+
import type { SurfaceInstance, SurfaceMountCtx } from './surface.js';
|
|
8
8
|
export declare function launcherSurface(ctx: SurfaceMountCtx): SurfaceInstance;
|
|
9
9
|
//# sourceMappingURL=launcher.d.ts.map
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* AA focus management (trap + background inert + restore-on-close), keyboard (Esc), and backdrop
|
|
4
4
|
* click — all rule-gated by the variant's dismiss config. role=dialog + aria-modal + aria-labelledby.
|
|
5
5
|
*/
|
|
6
|
-
import type { SurfaceInstance, SurfaceMountCtx } from './surface';
|
|
6
|
+
import type { SurfaceInstance, SurfaceMountCtx } from './surface.js';
|
|
7
7
|
export declare function modalSurface(ctx: SurfaceMountCtx): SurfaceInstance;
|
|
8
8
|
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderVariantBlocks } from './surface';
|
|
2
|
-
import { trapFocus, focusInitial, inertBackground, captureFocus } from '../a11y/focus';
|
|
1
|
+
import { renderVariantBlocks } from './surface.js';
|
|
2
|
+
import { trapFocus, focusInitial, inertBackground, captureFocus } from '../a11y/focus.js';
|
|
3
3
|
let uid = 0;
|
|
4
4
|
export function modalSurface(ctx) {
|
|
5
5
|
const { doc, variant } = ctx;
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* back a handle whose `close(method)` tears down + records the dismiss exactly once. Surfaces stay
|
|
7
7
|
* tiny — they only build their own chrome and call `requestClose` when the user dismisses.
|
|
8
8
|
*/
|
|
9
|
-
import type { Variant } from '../types';
|
|
10
|
-
import type { ShadowHost } from '../core/host';
|
|
11
|
-
import type { DismissMethod } from '../core/analytics';
|
|
12
|
-
import { type AnchorMetricsSink, type SurfaceHooks, type SurfaceRenderer } from './surface';
|
|
9
|
+
import type { Variant } from '../types.js';
|
|
10
|
+
import type { ShadowHost } from '../core/host.js';
|
|
11
|
+
import type { DismissMethod } from '../core/analytics.js';
|
|
12
|
+
import { type AnchorMetricsSink, type SurfaceHooks, type SurfaceRenderer } from './surface.js';
|
|
13
13
|
export interface MountedSurface {
|
|
14
14
|
variantId: string;
|
|
15
15
|
el: HTMLElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { zoneForVariant } from '../inappContract.web';
|
|
2
|
-
import { BLOCKS_CSS } from '../blocks/styles';
|
|
3
|
-
import { SURFACES_CSS } from './styles';
|
|
4
|
-
import { observeView } from './surface';
|
|
1
|
+
import { zoneForVariant } from '../inappContract.web.js';
|
|
2
|
+
import { BLOCKS_CSS } from '../blocks/styles.js';
|
|
3
|
+
import { SURFACES_CSS } from './styles.js';
|
|
4
|
+
import { observeView } from './surface.js';
|
|
5
5
|
export function mountSurface(host, variant, renderer, hooks, metrics) {
|
|
6
6
|
host.addStyles('scalebun-blocks', BLOCKS_CSS);
|
|
7
7
|
host.addStyles('scalebun-surfaces', SURFACES_CSS);
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* Esc/Enter/arrows, but doesn't inert the whole app. Commands come from the variant's
|
|
5
5
|
* surfaceOptions.commands; selecting one routes an action to the host (and follows a deep link).
|
|
6
6
|
*/
|
|
7
|
-
import type { SurfaceInstance, SurfaceMountCtx } from './surface';
|
|
7
|
+
import type { SurfaceInstance, SurfaceMountCtx } from './surface.js';
|
|
8
8
|
export declare function paletteSurface(ctx: SurfaceMountCtx): SurfaceInstance;
|
|
9
9
|
//# sourceMappingURL=palette.d.ts.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* streams the answer back via `appendAssistant(token)` / `endAssistant()` exposed on the root element.
|
|
6
6
|
* (No LLM ships in the SDK.)
|
|
7
7
|
*/
|
|
8
|
-
import type { SurfaceInstance, SurfaceMountCtx } from './surface';
|
|
8
|
+
import type { SurfaceInstance, SurfaceMountCtx } from './surface.js';
|
|
9
9
|
export interface PanelStreamApi {
|
|
10
10
|
appendAssistant(token: string): void;
|
|
11
11
|
endAssistant(): void;
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* anchor vanishes and can't be re-found within the grace window, the popover degrades gracefully
|
|
6
6
|
* (closes) rather than floating in a dead spot. Ambient (never steals focus).
|
|
7
7
|
*/
|
|
8
|
-
import type { SurfaceInstance, SurfaceMountCtx } from './surface';
|
|
8
|
+
import type { SurfaceInstance, SurfaceMountCtx } from './surface.js';
|
|
9
9
|
export declare function popoverSurface(ctx: SurfaceMountCtx): SurfaceInstance;
|
|
10
10
|
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderVariantBlocks } from './surface';
|
|
2
|
-
import { LiveAnchor, specFromSelector } from '../anchor/controller';
|
|
1
|
+
import { renderVariantBlocks } from './surface.js';
|
|
2
|
+
import { LiveAnchor, specFromSelector } from '../anchor/controller.js';
|
|
3
3
|
function anchorSelector(ctx) {
|
|
4
4
|
return ctx.variant.targeting?.element ?? ctx.variant.triggers.find((t) => (t.type === 'element' || t.type === 'hover') && t.match)?.match;
|
|
5
5
|
}
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* and every framework adapter call this same function. Pay-per-capability bundling falls out for free
|
|
8
8
|
* (a page that only shows a toast never downloads the modal/popover code).
|
|
9
9
|
*/
|
|
10
|
-
import type { Surface, Variant } from '../types';
|
|
11
|
-
import type { ShadowHost } from '../core/host';
|
|
12
|
-
import type { SlotRegistry } from '../core/slots';
|
|
13
|
-
import type { AnchorMetricsSink, SurfaceHooks, SurfaceRenderer } from './surface';
|
|
10
|
+
import type { Surface, Variant } from '../types.js';
|
|
11
|
+
import type { ShadowHost } from '../core/host.js';
|
|
12
|
+
import type { SlotRegistry } from '../core/slots.js';
|
|
13
|
+
import type { AnchorMetricsSink, SurfaceHooks, SurfaceRenderer } from './surface.js';
|
|
14
14
|
export declare const SURFACE_LOADERS: Partial<Record<Surface, () => Promise<SurfaceRenderer>>>;
|
|
15
15
|
export interface RenderDeps {
|
|
16
16
|
host: ShadowHost;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/features/inapp/surfaces/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAIlF,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC,CAgBpF,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,uFAAuF;AACvF,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/features/inapp/surfaces/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAIlF,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC,CAgBpF,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,uFAAuF;AACvF,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CAyBrH"}
|