@codingame/monaco-vscode-welcome-service-override 37.6.1 → 38.0.1

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.
Files changed (42) hide show
  1. package/common.js +6 -1
  2. package/package.json +3 -3
  3. package/vscode/src/vs/platform/onboarding/common/onboardingTryoutHandoff.d.ts +13 -0
  4. package/vscode/src/vs/platform/onboarding/common/onboardingTryoutHandoff.js +7 -0
  5. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/microsoft-dark.svg +1 -0
  6. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/microsoft-light.svg +1 -0
  7. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorTryout.contribution.d.ts +1 -0
  8. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorTryout.contribution.js +67 -0
  9. package/vscode/src/vs/workbench/contrib/onboarding/browser/media/spotlight.css +18 -1
  10. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboarding.contribution.d.ts +1 -1
  11. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboarding.contribution.js +10 -6
  12. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingSamplePresentation.d.ts +25 -0
  13. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingSamplePresentation.js +137 -0
  14. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingService.d.ts +8 -1
  15. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingService.js +93 -32
  16. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryout.contribution.d.ts +9 -0
  17. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryout.contribution.js +153 -0
  18. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryoutActions.d.ts +28 -0
  19. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryoutActions.js +122 -0
  20. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryoutRunner.d.ts +8 -0
  21. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryoutRunner.js +50 -0
  22. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryoutService.d.ts +31 -0
  23. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryoutService.js +292 -0
  24. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryoutUrlHandler.d.ts +26 -0
  25. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryoutUrlHandler.js +110 -0
  26. package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightOverlay.d.ts +11 -0
  27. package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightOverlay.js +76 -22
  28. package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightPresentation.d.ts +1 -0
  29. package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightPresentation.js +170 -50
  30. package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingPresentation.d.ts +3 -0
  31. package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingPresentation.js +5 -0
  32. package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.contribution.js +3 -3
  33. package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.js +25 -26
  34. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/browser/media/variationA.css +9 -0
  35. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/browser/onboardingVariationA.d.ts +8 -3
  36. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/browser/onboardingVariationA.js +113 -70
  37. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/browser/welcomeOnboarding.contribution.js +1 -1
  38. package/vscode/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.js +10 -10
  39. package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcomeContribution.js +1 -1
  40. package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcomeExtensionPoint.js +8 -8
  41. package/vscode/src/vs/workbench/contrib/onboarding/browser/sequence/sequencePresentation.d.ts +0 -10
  42. package/vscode/src/vs/workbench/contrib/onboarding/browser/sequence/sequencePresentation.js +0 -154
package/common.js CHANGED
@@ -2,13 +2,18 @@
2
2
  import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
3
3
  import { IOnboardingScenarioService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingScenarioService.service';
4
4
  import { OnboardingScenarioService } from './vscode/src/vs/workbench/contrib/onboarding/browser/onboardingService.js';
5
+ import { OnboardingTryoutService } from './vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryoutService.js';
6
+ import { IOnboardingTryoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingTryout.service';
7
+ import './vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorTryout.contribution.js';
8
+ import './vscode/src/vs/workbench/contrib/onboarding/browser/onboardingTryout.contribution.js';
5
9
  import './vscode/src/vs/workbench/contrib/onboarding/browser/onboarding.contribution.js';
6
10
  import './vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.js';
7
11
  import './vscode/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.js';
8
12
 
9
13
  function getServiceOverride() {
10
14
  return {
11
- [IOnboardingScenarioService.toString()]: new SyncDescriptor(OnboardingScenarioService, [], true)
15
+ [IOnboardingScenarioService.toString()]: new SyncDescriptor(OnboardingScenarioService, [], true),
16
+ [IOnboardingTryoutService.toString()]: new SyncDescriptor(OnboardingTryoutService, [], true)
12
17
  };
13
18
  }
14
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-welcome-service-override",
3
- "version": "37.6.1",
3
+ "version": "38.0.1",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - welcome service-override",
6
6
  "keywords": [],
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "37.6.1",
19
- "@codingame/monaco-vscode-katex-common": "37.6.1"
18
+ "@codingame/monaco-vscode-api": "38.0.1",
19
+ "@codingame/monaco-vscode-katex-common": "38.0.1"
20
20
  },
21
21
  "main": "index.js",
22
22
  "module": "index.js",
@@ -0,0 +1,13 @@
1
+ export declare const ONBOARDING_TRYOUT_CHANNEL = "onboardingTryout";
2
+ export type OnboardingTryoutSource = "releaseNotes" | "externalLink" | "direct";
3
+ export interface IOnboardingTryoutRunOptions {
4
+ readonly source: OnboardingTryoutSource;
5
+ readonly runId?: string;
6
+ }
7
+ export declare function isOnboardingTryoutSource(value: unknown): value is OnboardingTryoutSource;
8
+ export interface IOnboardingTryoutWindowRequest {
9
+ readonly requestId: string;
10
+ readonly tryoutId: string;
11
+ readonly source: OnboardingTryoutSource;
12
+ }
13
+ export type OnboardingTryoutWindowRequestResult = "accepted" | "cancelled" | "rejected" | "superseded";
@@ -0,0 +1,7 @@
1
+
2
+
3
+ function isOnboardingTryoutSource(value) {
4
+ return value === 'releaseNotes' || value === 'externalLink' || value === 'direct';
5
+ }
6
+
7
+ export { isOnboardingTryoutSource };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="white"><path d="M7.5 1.5H1.5V7.5H7.5V1.5Z"/><path d="M14.5 1.5H8.5V7.5H14.5V1.5Z"/><path d="M14.5 8.5H8.5V14.5H14.5V8.5Z"/><path d="M7.5 8.5H1.5V14.5H7.5V8.5Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="black"><path d="M7.5 1.5H1.5V7.5H7.5V1.5Z"/><path d="M14.5 1.5H8.5V7.5H14.5V1.5Z"/><path d="M14.5 8.5H8.5V14.5H14.5V8.5Z"/><path d="M7.5 8.5H1.5V14.5H7.5V8.5Z"/></svg>
@@ -0,0 +1,67 @@
1
+
2
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
3
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
4
+ import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
5
+ import { registerOnboardingTryout } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingTryout';
6
+
7
+ class DiffEditorTryoutContribution extends Disposable {
8
+ static {
9
+ this.ID = "workbench.contrib.diffEditorTryout";
10
+ }
11
+ constructor() {
12
+ super();
13
+ this._register(registerOnboardingTryout({
14
+ id: "editor.smart-diff",
15
+ title: ( localize(15493, "Try Smart Diff Layout")),
16
+ description: ( localize(
17
+ 15494,
18
+ "Open a read-only sample comparison. Use Diff View to choose Inline, Side by Side, or Automatic, then resize the editor."
19
+ )),
20
+ presentation: {
21
+ kind: "editorSample",
22
+ payload: {
23
+ type: "diff",
24
+ title: ( localize(15495, "Smart Diff Layout Example")),
25
+ languageId: "typescript",
26
+ original: [
27
+ "interface Project {",
28
+ "\tname: string;",
29
+ "\tarchived: boolean;",
30
+ "}",
31
+ "",
32
+ "export function findProject(projects: Project[], name: string): Project | undefined {",
33
+ "\treturn projects.find(project => project.name === name);",
34
+ "}",
35
+ "",
36
+ "export function listProjects(projects: Project[]): string[] {",
37
+ "\treturn projects.map(project => project.name);",
38
+ "}"
39
+ ].join("\n"),
40
+ modified: [
41
+ "interface Project {",
42
+ "\tname: string;",
43
+ "\tarchived: boolean;",
44
+ "}",
45
+ "",
46
+ "export function findProject(projects: Project[], name: string): Project | undefined {",
47
+ "\tconst normalizedName = name.trim().toLowerCase();",
48
+ "\treturn projects.find(project => project.name.toLowerCase() === normalizedName);",
49
+ "}",
50
+ "",
51
+ "export function listProjects(projects: Project[]): string[] {",
52
+ "\treturn projects",
53
+ "\t\t.filter(project => !project.archived)",
54
+ "\t\t.map(project => project.name)",
55
+ "\t\t.sort();",
56
+ "}"
57
+ ].join("\n")
58
+ }
59
+ }
60
+ }));
61
+ }
62
+ }
63
+ registerWorkbenchContribution2(
64
+ DiffEditorTryoutContribution.ID,
65
+ DiffEditorTryoutContribution,
66
+ WorkbenchPhase.BlockRestore
67
+ );
@@ -13,11 +13,28 @@
13
13
  z-index: 2600;
14
14
  }
15
15
 
16
- /* Expanded pickers and mobile sheets remain above the spotlight blocker. */
16
+ /*
17
+ * Expanded pickers stay above the scrim, but their full-window dismiss layers
18
+ * must not cover the callout's actions. Avoid a shared stacking context here.
19
+ */
17
20
  .spotlight-overlay.target-overlay-visible {
21
+ position: static;
22
+ z-index: auto;
23
+ }
24
+
25
+ .spotlight-overlay.target-overlay-visible .spotlight-blocker,
26
+ .spotlight-overlay.target-overlay-visible .spotlight-hole {
18
27
  z-index: 1999;
19
28
  }
20
29
 
30
+ .spotlight-overlay.target-overlay-visible .spotlight-callout {
31
+ z-index: 2600;
32
+ }
33
+
34
+ .spotlight-overlay.target-overlay-visible .spotlight-callout-pointer {
35
+ z-index: 2601;
36
+ }
37
+
21
38
  /* Full-screen click blocker. Transparent; swallows interaction outside the hole. */
22
39
  .spotlight-blocker {
23
40
  position: fixed;
@@ -17,8 +17,9 @@ import { ONBOARDING_DEVELOPER_MODE_VARIATIONS_CONFIG, ONBOARDING_DEVELOPER_MODE_
17
17
  import { IOnboardingScenarioService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingScenarioService.service';
18
18
  import './onboardingService.js';
19
19
  import { RunOnboardingStepPresentation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/browser/sequence/runOnboardingStep';
20
- import { OnboardingSequencePresentation } from './sequence/sequencePresentation.js';
20
+ import { OnboardingSequencePresentation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/browser/sequence/sequencePresentation';
21
21
  import { SpotlightPresentation } from './spotlight/spotlightPresentation.js';
22
+ import './onboardingTryout.contribution.js';
22
23
 
23
24
  const configurationRegistry = ( Registry.as(Extensions.Configuration));
24
25
  function buildDeveloperModeConfigurationNode() {
@@ -26,7 +27,10 @@ function buildDeveloperModeConfigurationNode() {
26
27
  const defaultValue = {};
27
28
  const variationProperties = {};
28
29
  const variationDefaultValue = {};
29
- for (const scenario of [...onboardingScenarioRegistry.getScenarios()].sort((a, b) => a.id.localeCompare(b.id))) {
30
+ for (const scenario of [...onboardingScenarioRegistry.getScenarioDescriptors()].sort((a, b) => a.id.localeCompare(b.id))) {
31
+ if (scenario.tryout) {
32
+ continue;
33
+ }
30
34
  properties[scenario.id] = {
31
35
  type: "boolean",
32
36
  default: false
@@ -53,7 +57,7 @@ function buildDeveloperModeConfigurationNode() {
53
57
  },
54
58
  tags: ["experimental"],
55
59
  description: ( localize(
56
- 17128,
60
+ 19627,
57
61
  "Map of onboarding scenario/tour id to whether developer mode is enabled for it. When enabled for a scenario, that onboarding tour ignores usage-based eligibility checks (such as how many sessions you have started), previously persisted shown state, and any linked experiment (so it is shown even if the experiment is not running or you are in the control group). It does not override the {0} setting. The tour is still shown at most once per window session, so reload the window to show it again.",
58
62
  `\`#${ONBOARDING_ENABLED_CONFIG}#\``
59
63
  ))
@@ -67,7 +71,7 @@ function buildDeveloperModeConfigurationNode() {
67
71
  },
68
72
  tags: ["experimental"],
69
73
  description: ( localize(
70
- 17129,
74
+ 19628,
71
75
  "Map of onboarding scenario/tour id to the variation used while developer mode is enabled for that scenario. An empty value uses the experiment-selected or default variation."
72
76
  ))
73
77
  }
@@ -82,7 +86,7 @@ configurationRegistry.registerConfiguration({
82
86
  type: "boolean",
83
87
  default: true,
84
88
  description: ( localize(
85
- 17130,
89
+ 19629,
86
90
  "When enabled, onboarding tours and hints may appear automatically to highlight features. Disabling this does not affect tours you start manually."
87
91
  ))
88
92
  }
@@ -126,7 +130,7 @@ registerAction2(class extends Action2 {
126
130
  constructor() {
127
131
  super({
128
132
  id: "workbench.action.onboarding.resetShownState",
129
- title: ( localize2(17131, "Reset Onboarding Shown State")),
133
+ title: ( localize2(19630, "Reset Onboarding Shown State")),
130
134
  category: Categories.Developer,
131
135
  f1: true
132
136
  });
@@ -0,0 +1,25 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
3
+ import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
4
+ import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
5
+ import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
6
+ import { ITextModelContentProvider } from "@codingame/monaco-vscode-model-service-override/vscode/vs/editor/common/services/resolverService";
7
+ import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
8
+ import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
9
+ import { IOnboardingTryoutPresentationDefinition, IOnboardingTryoutRunContext, OnboardingTryoutAvailability, OnboardingTryoutPreparation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingTryout";
10
+ import { IOnboardingTryoutService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingTryout.service";
11
+ import { EditorSampleTryoutPayload, isEditorSampleTryoutPayload } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingTryoutActions";
12
+ export declare class EditorSampleTryoutPresentation extends Disposable implements IOnboardingTryoutPresentationDefinition<EditorSampleTryoutPayload>, ITextModelContentProvider {
13
+ private readonly editorService;
14
+ private readonly textModelService;
15
+ private readonly modelService;
16
+ private readonly languageService;
17
+ private readonly tryoutService;
18
+ readonly kind = "editorSample";
19
+ readonly isPayload: typeof isEditorSampleTryoutPayload;
20
+ get onDidChangeAvailability(): import("@codingame/monaco-vscode-api/vscode/vs/sessions/sessions.web.main.internal").Event<void>;
21
+ constructor(editorService: IEditorService, textModelService: ITextModelService, modelService: IModelService, languageService: ILanguageService, tryoutService: IOnboardingTryoutService);
22
+ getAvailability(payload: EditorSampleTryoutPayload): OnboardingTryoutAvailability;
23
+ prepare(payload: EditorSampleTryoutPayload, context: IOnboardingTryoutRunContext): Promise<OnboardingTryoutPreparation>;
24
+ provideTextContent(resource: URI): Promise<ITextModel>;
25
+ }
@@ -0,0 +1,137 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { Disposable, thenRegisterOrDispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
5
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
6
+ import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
7
+ import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
8
+ import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
9
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
10
+ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
11
+ import { isOnboardingTryoutId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingTryout';
12
+ import { IOnboardingTryoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingTryout.service';
13
+ import { isEditorSampleTryoutPayload } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingTryoutActions';
14
+
15
+ let EditorSampleTryoutPresentation = class EditorSampleTryoutPresentation extends Disposable {
16
+ get onDidChangeAvailability() {
17
+ return this.languageService.onDidChange;
18
+ }
19
+ constructor(
20
+ editorService,
21
+ textModelService,
22
+ modelService,
23
+ languageService,
24
+ tryoutService
25
+ ) {
26
+ super();
27
+ this.editorService = editorService;
28
+ this.textModelService = textModelService;
29
+ this.modelService = modelService;
30
+ this.languageService = languageService;
31
+ this.tryoutService = tryoutService;
32
+ this.kind = "editorSample";
33
+ this.isPayload = isEditorSampleTryoutPayload;
34
+ }
35
+ getAvailability(payload) {
36
+ return !payload.languageId || this.languageService.isRegisteredLanguageId(payload.languageId) ? {
37
+ kind: "ready"
38
+ } : {
39
+ kind: "unavailable",
40
+ message: ( localize(19631, "Language support for this example is not available yet."))
41
+ };
42
+ }
43
+ async prepare(payload, context) {
44
+ const original = ( URI.from({
45
+ scheme: Schemas.vscodeOnboardingSample,
46
+ path: `/${context.id}/${payload.type === "diff" ? "original" : "text"}`
47
+ }));
48
+ const modified = payload.type === "diff" ? ( URI.from({
49
+ scheme: Schemas.vscodeOnboardingSample,
50
+ path: `/${context.id}/modified`
51
+ })) : undefined;
52
+ await thenRegisterOrDispose(this.textModelService.createModelReference(original), context.store);
53
+ if (context.token.isCancellationRequested || context.store.isDisposed) {
54
+ return {
55
+ kind: "cancelled"
56
+ };
57
+ }
58
+ if (modified) {
59
+ await thenRegisterOrDispose(this.textModelService.createModelReference(modified), context.store);
60
+ }
61
+ if (context.token.isCancellationRequested || context.store.isDisposed) {
62
+ return {
63
+ kind: "cancelled"
64
+ };
65
+ }
66
+ return {
67
+ kind: "ready",
68
+ run: async () => {
69
+ if (context.token.isCancellationRequested) {
70
+ return {
71
+ kind: "cancelled"
72
+ };
73
+ }
74
+ const pane = await this.editorService.openEditor(modified ? {
75
+ original: {
76
+ resource: original
77
+ },
78
+ modified: {
79
+ resource: modified
80
+ },
81
+ label: payload.title,
82
+ options: {
83
+ pinned: true
84
+ }
85
+ } : {
86
+ resource: original,
87
+ label: payload.title,
88
+ options: {
89
+ pinned: true
90
+ }
91
+ });
92
+ return pane ? {
93
+ kind: "opened"
94
+ } : {
95
+ kind: "unavailable",
96
+ message: ( localize(19632, "The example editor could not be opened."))
97
+ };
98
+ }
99
+ };
100
+ }
101
+ async provideTextContent(resource) {
102
+ const [, id, part, ...extra] = resource.path.split("/");
103
+ if (resource.scheme !== Schemas.vscodeOnboardingSample || resource.authority || resource.query || resource.fragment || extra.length || !isOnboardingTryoutId(id) || (part !== "text" && part !== "original" && part !== "modified")) {
104
+ throw ( new Error(( localize(
105
+ 19633,
106
+ "This sample is no longer available. Open its feature example from the release notes again."
107
+ ))));
108
+ }
109
+ const model = this.modelService.getModel(resource);
110
+ if (model) {
111
+ return model;
112
+ }
113
+ const scenario = this.tryoutService.getTryout(id);
114
+ const payload = scenario?.presentation.payload;
115
+ if (scenario?.presentation.kind !== this.kind || !isEditorSampleTryoutPayload(payload)) {
116
+ throw ( new Error(( localize(
117
+ 19633,
118
+ "This sample is no longer available. Open its feature example from the release notes again."
119
+ ))));
120
+ }
121
+ const text = payload.type === "text" && part === "text" ? payload.text : payload.type === "diff" && part === "original" ? payload.original : payload.type === "diff" && part === "modified" ? payload.modified : undefined;
122
+ if (text === undefined) {
123
+ throw ( new Error(( localize(
124
+ 19633,
125
+ "This sample is no longer available. Open its feature example from the release notes again."
126
+ ))));
127
+ }
128
+ return this.modelService.createModel(
129
+ text,
130
+ this.languageService.createById(payload.languageId ?? "plaintext"),
131
+ resource
132
+ );
133
+ }
134
+ };
135
+ EditorSampleTryoutPresentation = ( __decorate([( __param(0, IEditorService)), ( __param(1, ITextModelService)), ( __param(2, IModelService)), ( __param(3, ILanguageService)), ( __param(4, IOnboardingTryoutService))], EditorSampleTryoutPresentation));
136
+
137
+ export { EditorSampleTryoutPresentation };
@@ -1,4 +1,6 @@
1
+ import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
1
2
  import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
3
+ import { IReader } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
2
4
  import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
3
5
  import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
4
6
  import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
@@ -36,6 +38,7 @@ export declare class OnboardingScenarioService extends Disposable implements IOn
36
38
  private _activeAbort;
37
39
  /** Resolved experiment treatment state, keyed by scenario id. */
38
40
  private readonly _experimentStates;
41
+ private readonly _experimentStatesChanged;
39
42
  /**
40
43
  * Assignment-context ids whose telemetry gate is open. While an onboarding id is *not* in
41
44
  * this set, the eagerly-registered filter excludes it from telemetry (see the prefix
@@ -50,8 +53,9 @@ export declare class OnboardingScenarioService extends Disposable implements IOn
50
53
  private _stop;
51
54
  start(): void;
52
55
  getScenarios(): readonly IOnboardingScenario[];
53
- runScenario(id: string): Promise<OnboardingOutcome>;
56
+ runScenario(id: string, token?: CancellationToken): Promise<OnboardingOutcome>;
54
57
  hasBeenShown(id: string): boolean;
58
+ shouldShowNudge(id: string, reader?: IReader): boolean;
55
59
  reset(id: string): void;
56
60
  resetAll(): void;
57
61
  /**
@@ -82,17 +86,20 @@ export declare class OnboardingScenarioService extends Disposable implements IOn
82
86
  * moment: the telemetry gate is opened for the experiment's assignment-context id
83
87
  * (in both arms), and then only the treatment arm is enqueued to actually show the
84
88
  * tour. Control opens the gate but renders nothing and is not marked as shown.
89
+ * A pre-tour nudge opens the same gate earlier, at its own would-show moment.
85
90
  *
86
91
  * Developer mode is the exception: it shows the tour unconditionally and never
87
92
  * opens the telemetry gate, so a local preview can never affect the experiment
88
93
  * scorecard regardless of which arm the developer happens to be assigned to.
89
94
  */
90
95
  private _evaluate;
96
+ private _shouldShow;
91
97
  private _isAutoEligible;
92
98
  private _enqueue;
93
99
  private _pump;
94
100
  private _doPump;
95
101
  private _runPresentation;
102
+ private _showPresentation;
96
103
  /** Emit an impression when a presentation has rendered visible onboarding UI. */
97
104
  private _reportShown;
98
105
  /** Emit per-tour telemetry. Only called when a tour was actually shown. */