powerbi-visuals-tools 5.1.0 → 5.2.0-beta.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 (41) hide show
  1. package/Changelog.md +3 -0
  2. package/bin/pbiviz.js +1 -1
  3. package/certs/PowerBICustomVisualTest_private.key +26 -26
  4. package/certs/PowerBICustomVisualTest_public.crt +17 -17
  5. package/lib/CommandManager.js +2 -0
  6. package/lib/FeatureManager.js +43 -0
  7. package/lib/Package.js +46 -0
  8. package/lib/Visual.js +34 -0
  9. package/lib/VisualManager.js +72 -0
  10. package/lib/features/APIVersion.js +16 -0
  11. package/lib/features/AdvancedEditMode.js +11 -0
  12. package/lib/features/AllowInteractions.js +11 -0
  13. package/lib/features/AnalyticsPane.js +16 -0
  14. package/lib/features/BaseFeature.js +11 -0
  15. package/lib/features/Bookmarks.js +11 -0
  16. package/lib/features/ColorPalette.js +11 -0
  17. package/lib/features/ConditionalFormatting.js +11 -0
  18. package/lib/features/ContextMenu.js +11 -0
  19. package/lib/features/DrillDown.js +15 -0
  20. package/lib/features/ESLint.js +11 -0
  21. package/lib/features/FeatureTypes.js +23 -0
  22. package/lib/features/FetchMoreData.js +21 -0
  23. package/lib/features/FileDownload.js +11 -0
  24. package/lib/features/FormatPane.js +11 -0
  25. package/lib/features/HighContrast.js +11 -0
  26. package/lib/features/HighlightData.js +11 -0
  27. package/lib/features/KeyboardNavigation.js +11 -0
  28. package/lib/features/LandingPage.js +11 -0
  29. package/lib/features/LaunchURL.js +11 -0
  30. package/lib/features/LocalStorage.js +11 -0
  31. package/lib/features/Localizations.js +11 -0
  32. package/lib/features/ModalDialog.js +11 -0
  33. package/lib/features/RenderingEvents.js +12 -0
  34. package/lib/features/SelectionAcrossVisuals.js +11 -0
  35. package/lib/features/SyncSlicer.js +11 -0
  36. package/lib/features/Tooltips.js +11 -0
  37. package/lib/features/TotalSubTotal.js +11 -0
  38. package/lib/features/VisualVersion.js +12 -0
  39. package/lib/features/WarningIcon.js +11 -0
  40. package/lib/features/index.js +29 -0
  41. package/package.json +2 -1
package/Changelog.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  This page contains information about changes to the PowerBI Visual Tools (pbiviz).
4
4
 
5
+ ## 5.2.0
6
+ * Integrated PAC validation
7
+
5
8
  ## 5.1.0
6
9
  * New flag `--skip-api` to skip verifying api version. It might produce different errors in visual, so use it only in some specific cases (ex. installing something during the build process brakes packages managed by monorepo managers).
7
10
  * New flag `--all-locales` to disable optimization using localization loader. It's recommended not to use this flag because all locales take a huge amount of package size. If you need just a few of them follow [this guide](https://learn.microsoft.com/en-us/power-bi/developer/visuals/localization?tabs=English#step-5---add-a-resources-file-for-each-language). In this case, only declared in stringResources locales will be added to your visual package.
package/bin/pbiviz.js CHANGED
@@ -97,4 +97,4 @@ pbiviz
97
97
  CommandManager.package(options, rootPath);
98
98
  });
99
99
 
100
- program.parse(process.argv);
100
+ program.parse(process.argv);
@@ -1,28 +1,28 @@
1
1
  -----BEGIN PRIVATE KEY-----
2
- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEKuHsNka9n8H9
3
- 28W1ARv0lBkZYfQMxNK7IOSWopNp+l2w13ns3/Uz6IMB7iRqSCR8i8p0vQHatZP+
4
- 0o8QY2NkMgaRiXlSH48GxmaRfhdTaPv0r2WTB7jibl3c5xEunjL3cvO2F8qVh+8S
5
- SybpY2v4RCqHCAg2o2ZyAkXJk+Rkh/TIOcmQzbQk8SLkuFIPBAXObS8SxZ03/VXJ
6
- x+5iYYqC28TJAkHh8ZSknpkIRCDfV5RzRkwWXvP70aY0Mm1T7rETBh9yDlThZbg5
7
- 9WWYcyqZUn0PgNmM/VWwAYWD16/X832BFYFMbFrANv8CFchtZ58aLcAd9hXarpVT
8
- 2UxFQpOPAgMBAAECggEADMGTyA4jfX3frzKqYZcn3+NS2oFceF7C1qOl7wcKuk/V
9
- 5dkCjF0Sjy87IwCpt4uSFn3p9W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@@ -18,6 +18,7 @@ export default class CommandManager {
18
18
  const visualManager = new VisualManager(rootPath);
19
19
  await visualManager
20
20
  .prepareVisual()
21
+ .validateVisual()
21
22
  .initializeWebpack(webpackOptions);
22
23
  visualManager.startWebpackServer(options.drop);
23
24
  }
@@ -39,6 +40,7 @@ export default class CommandManager {
39
40
  };
40
41
  new VisualManager(rootPath)
41
42
  .prepareVisual()
43
+ .validateVisual()
42
44
  .initializeWebpack(webpackOptions)
43
45
  .then(visualManager => visualManager.generatePackage());
44
46
  }
@@ -0,0 +1,43 @@
1
+ import { Severity } from "./features/FeatureTypes.js";
2
+ import * as features from "./features/index.js";
3
+ export var Status;
4
+ (function (Status) {
5
+ Status[Status["Success"] = 0] = "Success";
6
+ Status[Status["Error"] = 1] = "Error";
7
+ })(Status || (Status = {}));
8
+ export class FeatureManager {
9
+ features = Object.keys(features).map(key => features[key]);
10
+ validate(stage, sourceInstance) {
11
+ const result = {
12
+ status: Status.Success,
13
+ logs: {
14
+ errors: [],
15
+ warnings: [],
16
+ info: [],
17
+ deprecation: []
18
+ }
19
+ };
20
+ this.features
21
+ .filter(feature => feature.stage == stage)
22
+ .filter(feature => feature.visualFeatureType & sourceInstance.visualFeatureType)
23
+ .filter(feature => !feature.isSupported(sourceInstance))
24
+ .forEach(({ errorMessage, severity }) => {
25
+ switch (severity) {
26
+ case Severity.Error:
27
+ result.status = Status.Error;
28
+ result.logs.errors.push(errorMessage);
29
+ break;
30
+ case Severity.Warning:
31
+ result.logs.warnings.push(errorMessage);
32
+ break;
33
+ case Severity.Info:
34
+ result.logs.info.push(errorMessage);
35
+ break;
36
+ case Severity.Deprecation:
37
+ result.logs.deprecation.push(errorMessage);
38
+ break;
39
+ }
40
+ });
41
+ return result;
42
+ }
43
+ }
package/lib/Package.js ADDED
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Power BI Visual CLI
3
+ *
4
+ * Copyright (c) Microsoft Corporation
5
+ * All rights reserved.
6
+ * MIT License
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the ""Software""), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ */
26
+ "use strict";
27
+ import isMatch from "lodash.ismatch";
28
+ /**
29
+ * Represents an instance of a visual package based on file path
30
+ */
31
+ export default class Package {
32
+ sourceCode;
33
+ capabilities;
34
+ visualFeatureType;
35
+ constructor(sourceCode, capabilities, visualFeatureType) {
36
+ this.sourceCode = sourceCode;
37
+ this.capabilities = capabilities;
38
+ this.visualFeatureType = visualFeatureType;
39
+ }
40
+ contain(keyword) {
41
+ return this.sourceCode.includes(keyword);
42
+ }
43
+ isCapabilityEnabled(expectedObject) {
44
+ return isMatch(this.capabilities, expectedObject);
45
+ }
46
+ }
package/lib/Visual.js ADDED
@@ -0,0 +1,34 @@
1
+ import { compareVersions } from "compare-versions";
2
+ import { VisualFeatureType } from "./features/FeatureTypes.js";
3
+ export class Visual {
4
+ visualFeatureType;
5
+ capabilities;
6
+ config;
7
+ packageJSON;
8
+ visualVersion;
9
+ constructor(capabilities, config, packageJson) {
10
+ this.capabilities = capabilities;
11
+ this.config = config;
12
+ this.visualFeatureType = this.getVisualFeatureType();
13
+ this.packageJSON = packageJson;
14
+ this.visualVersion = config.visual.version;
15
+ }
16
+ doesAPIVersionMatch(minAPIversion) {
17
+ return compareVersions(this.config.apiVersion ?? minAPIversion, minAPIversion) !== -1;
18
+ }
19
+ doesESLlintSupported() {
20
+ return Object.entries(this.packageJSON.scripts).some(([, value]) => value.includes("eslint"));
21
+ }
22
+ isVisualVersionValid(length) {
23
+ return this.visualVersion.split(".").length === length;
24
+ }
25
+ getVisualFeatureType() {
26
+ const isMatrixSupported = this.capabilities?.dataViewMappings?.some(dataView => dataView.matrix);
27
+ const isSlicer = Boolean(this.capabilities?.objects?.general?.properties?.filter?.type?.filter);
28
+ let type = isSlicer ? VisualFeatureType.Slicer : VisualFeatureType.NonSlicer;
29
+ if (isMatrixSupported) {
30
+ type = type | VisualFeatureType.Matrix;
31
+ }
32
+ return type;
33
+ }
34
+ }
@@ -33,7 +33,12 @@ import ConsoleWriter from './ConsoleWriter.js';
33
33
  import VisualGenerator from './VisualGenerator.js';
34
34
  import { readJsonFromRoot, readJsonFromVisual } from './utils.js';
35
35
  import WebpackWrap from './WebPackWrap.js';
36
+ import Package from './Package.js';
37
+ import { Visual } from "./Visual.js";
38
+ import { FeatureManager, Status } from "./FeatureManager.js";
39
+ import { Severity, Stage } from "./features/FeatureTypes.js";
36
40
  import TemplateFetcher from "./TemplateFetcher.js";
41
+ const globalConfig = readJsonFromRoot('config.json');
37
42
  const PBIVIZ_FILE = 'pbiviz.json';
38
43
  /**
39
44
  * Represents an instance of a visual package based on file path
@@ -41,7 +46,11 @@ const PBIVIZ_FILE = 'pbiviz.json';
41
46
  export default class VisualManager {
42
47
  basePath;
43
48
  pbivizConfig;
49
+ capabilities;
44
50
  webpackConfig;
51
+ visual;
52
+ package;
53
+ featureManager;
45
54
  compiler;
46
55
  webpackDevServer;
47
56
  constructor(rootPath) {
@@ -50,6 +59,7 @@ export default class VisualManager {
50
59
  prepareVisual() {
51
60
  if (this.doesPBIVIZExists()) {
52
61
  this.pbivizConfig = readJsonFromVisual(PBIVIZ_FILE, this.basePath);
62
+ this.createVisualInstance();
53
63
  }
54
64
  else {
55
65
  ConsoleWriter.error(PBIVIZ_FILE + ' not found. You must be in the root of a visual project to run this command.');
@@ -57,6 +67,11 @@ export default class VisualManager {
57
67
  }
58
68
  return this;
59
69
  }
70
+ createVisualInstance() {
71
+ this.capabilities = readJsonFromVisual("capabilities.json", this.basePath);
72
+ const packageJSON = readJsonFromVisual("package.json", this.basePath);
73
+ this.visual = new Visual(this.capabilities, this.pbivizConfig, packageJSON);
74
+ }
60
75
  async initializeWebpack(webpackOptions) {
61
76
  const webpackWrap = new WebpackWrap();
62
77
  this.webpackConfig = await webpackWrap.generateWebpackConfig(this, webpackOptions);
@@ -65,6 +80,9 @@ export default class VisualManager {
65
80
  }
66
81
  generatePackage() {
67
82
  const callback = (err, stats) => {
83
+ this.createPackageInstance();
84
+ const logs = this.validatePackage();
85
+ this.outputResults(logs);
68
86
  this.parseCompilationResults(err, stats);
69
87
  };
70
88
  this.compiler.run(callback);
@@ -96,6 +114,32 @@ export default class VisualManager {
96
114
  process.exit(1);
97
115
  }
98
116
  }
117
+ validateVisual() {
118
+ this.featureManager = new FeatureManager();
119
+ const { status, logs } = this.featureManager.validate(Stage.PreBuild, this.visual);
120
+ this.outputResults(logs);
121
+ if (status === Status.Error) {
122
+ process.exit(1);
123
+ }
124
+ return this;
125
+ }
126
+ validatePackage() {
127
+ const featureManager = new FeatureManager();
128
+ const { logs } = featureManager.validate(Stage.PostBuild, this.package);
129
+ return logs;
130
+ }
131
+ outputResults({ errors, deprecation, warnings, info }) {
132
+ const featuresTotalLog = {
133
+ errors: `Visual doesn't support some features required for all custom visuals:`,
134
+ deprecation: `Some features are going to be required soon, please update the visual:`,
135
+ warn: `Visual doesn't support some features recommended for all custom visuals:`,
136
+ info: `Visual can be improved by adding some features:`
137
+ };
138
+ this.outputLogsWithHeadMessage(featuresTotalLog.errors, errors, Severity.Error);
139
+ this.outputLogsWithHeadMessage(featuresTotalLog.deprecation, deprecation, Severity.Deprecation);
140
+ this.outputLogsWithHeadMessage(featuresTotalLog.warn, warnings, Severity.Warning);
141
+ this.outputLogsWithHeadMessage(featuresTotalLog.info, info, Severity.Info);
142
+ }
99
143
  displayInfo() {
100
144
  if (this.pbivizConfig) {
101
145
  ConsoleWriter.infoTable(this.pbivizConfig);
@@ -178,6 +222,11 @@ export default class VisualManager {
178
222
  this.webpackDevServer = null;
179
223
  }
180
224
  }
225
+ createPackageInstance() {
226
+ const pathToJSContent = path.join((this.pbivizConfig.build ?? globalConfig.build).dropFolder, "visual.js");
227
+ const sourceCode = fs.readFileSync(pathToJSContent, "utf8");
228
+ this.package = new Package(sourceCode, this.capabilities, this.visual.visualFeatureType);
229
+ }
181
230
  parseCompilationResults(err, stats) {
182
231
  ConsoleWriter.blank();
183
232
  if (err) {
@@ -191,4 +240,27 @@ export default class VisualManager {
191
240
  ConsoleWriter.done('Build completed successfully');
192
241
  }
193
242
  }
243
+ outputLogsWithHeadMessage(headMessage, logs, severity) {
244
+ if (!logs.length) {
245
+ return;
246
+ }
247
+ let outputLog;
248
+ switch (severity) {
249
+ case Severity.Error || Severity.Deprecation:
250
+ outputLog = ConsoleWriter.error;
251
+ break;
252
+ case Severity.Warning:
253
+ outputLog = ConsoleWriter.warning;
254
+ break;
255
+ default:
256
+ outputLog = ConsoleWriter.info;
257
+ break;
258
+ }
259
+ if (headMessage) {
260
+ outputLog(headMessage);
261
+ ConsoleWriter.blank();
262
+ }
263
+ logs.forEach(error => outputLog(error));
264
+ ConsoleWriter.blank();
265
+ }
194
266
  }
@@ -0,0 +1,16 @@
1
+ import { readJsonFromRoot } from "../utils.js";
2
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
3
+ export default class APIVersion {
4
+ static featureName = "Api";
5
+ static severity = Severity.Error;
6
+ static stage = Stage.PreBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer;
8
+ static minAPIversion;
9
+ static errorMessage;
10
+ static isSupported(visual) {
11
+ const globalConfig = readJsonFromRoot('config.json');
12
+ this.minAPIversion = globalConfig.constants.minAPIversion;
13
+ this.errorMessage = `API version must be at least ${this.minAPIversion}.`;
14
+ return visual.doesAPIVersionMatch(this.minAPIversion);
15
+ }
16
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class AdvancedEditMode {
3
+ static featureName = "Advanced Edit Mode";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/advanced-edit-mode";
5
+ static severity = Severity.Info;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return !packageInstance.isCapabilityEnabled({ advancedEditMode: 0 }); // 0 - Advanced edit mode is disabled
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class AllowInteractions {
3
+ static featureName = "Allow Interactions";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/visuals-interactions";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain('.allowInteractions');
10
+ }
11
+ }
@@ -0,0 +1,16 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class AnalyticsPane {
3
+ static featureName = "Analytics Pane";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/analytics-pane";
5
+ static severity = Severity.Info;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return (packageInstance.isCapabilityEnabled({
10
+ objects: {
11
+ objectCategory: 2
12
+ }
13
+ }) ||
14
+ packageInstance.contain("analyticsPane=true"));
15
+ }
16
+ }
@@ -0,0 +1,11 @@
1
+ export default class BaseFeature {
2
+ static severity;
3
+ static stage;
4
+ static visualFeatureType;
5
+ static featureName;
6
+ static documentationLink;
7
+ static get errorMessage() {
8
+ return `${this.featureName} - ${this.documentationLink}`;
9
+ }
10
+ static isSupported() { }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class Bookmarks {
3
+ static featureName = "Bookmarks";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/bookmarks-support";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain("applySelectionFromFilter") || packageInstance.contain("registerOnSelectCallback");
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class ColorPalette {
3
+ static featureName = "Color Palette";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/add-colors-power-bi-visual";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain(".colorPalette");
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class ConditionalFormatting {
3
+ static featureName = "Conditional Formatting";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/conditional-format";
5
+ static severity = Severity.Info;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain(".createDataViewWildcardSelector");
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class ContextMenu {
3
+ static featureName = "Context Menu";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/context-menu";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain(".showContextMenu");
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class DrillDown {
3
+ static featureName = "Drill Down";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/drill-down-support";
5
+ static severity = Severity.Info;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.isCapabilityEnabled({
10
+ drilldown: {
11
+ roles: []
12
+ }
13
+ });
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class ESLint {
3
+ static featureName = "ESLint";
4
+ static documentationLink = "https://github.com/microsoft/eslint-plugin-powerbi-visuals";
5
+ static severity = Severity.Error;
6
+ static stage = Stage.PreBuild;
7
+ static visualFeatureType = VisualFeatureType.All;
8
+ static isSupported(visual) {
9
+ return visual.doesESLlintSupported();
10
+ }
11
+ }
@@ -0,0 +1,23 @@
1
+ export var Severity;
2
+ (function (Severity) {
3
+ Severity["Error"] = "error";
4
+ Severity["Deprecation"] = "deprecation";
5
+ Severity["Warning"] = "warning";
6
+ Severity["Info"] = "info";
7
+ })(Severity || (Severity = {}));
8
+ export var Stage;
9
+ (function (Stage) {
10
+ Stage["PreBuild"] = "pre-build";
11
+ Stage["PostBuild"] = "post-build";
12
+ })(Stage || (Stage = {}));
13
+ export var VisualFeatureType;
14
+ (function (VisualFeatureType) {
15
+ VisualFeatureType[VisualFeatureType["NonSlicer"] = 2] = "NonSlicer";
16
+ VisualFeatureType[VisualFeatureType["Slicer"] = 4] = "Slicer";
17
+ VisualFeatureType[VisualFeatureType["Matrix"] = 8] = "Matrix";
18
+ VisualFeatureType[VisualFeatureType["All"] = 14] = "All";
19
+ })(VisualFeatureType || (VisualFeatureType = {}));
20
+ // Interaction types: Selection or filter (slicer)
21
+ // Slicer type: Basic, Advanced, Tuple filter, Identity filter
22
+ // Visual Type: TS/JS or R-Visual or RHTML
23
+ // Dataview Type: Single or Matrix or Table or Category or All
@@ -0,0 +1,21 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class FetchMoreData {
3
+ static featureName = "Fetch More Data";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/fetch-more-data";
5
+ static severity = Severity.Info;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.isCapabilityEnabled({
10
+ dataViewMappings: [
11
+ {
12
+ table: {
13
+ rows: {
14
+ dataReductionAlgorithm: {}
15
+ }
16
+ }
17
+ }
18
+ ]
19
+ });
20
+ }
21
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class FileDownload {
3
+ static featureName = "File Download";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/file-download-api";
5
+ static severity = Severity.Info;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain(".downloadService") && packageInstance.contain(".exportVisualsContent");
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class FormatPane {
3
+ static featureName = "Format Pane";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/format-pane";
5
+ static severity = Severity.Deprecation;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.All;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain("getFormattingModel");
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class HighContrast {
3
+ static featureName = "High Contrast";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/high-contrast-support";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain(".isHighContrast");
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class HighlightData {
3
+ static featureName = "Highlight Data";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/highlight";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.isCapabilityEnabled({ supportsHighlight: true });
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class KeyboardNavigation {
3
+ static featureName = "Keyboard Navigation";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/supportskeyboardfocus-feature";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.isCapabilityEnabled({ supportsKeyboardFocus: true });
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class LandingPage {
3
+ static featureName = "Landing Page";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/landing-page";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.isCapabilityEnabled({ supportsLandingPage: true });
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class LaunchURL {
3
+ static featureName = "Launch URL";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/launch-url";
5
+ static severity = Severity.Info;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain(".launchUrl");
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class LocalStorage {
3
+ static featureName = "Local Storage";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/local-storage";
5
+ static severity = Severity.Info;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain(".storageService");
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class Localizations {
3
+ static featureName = "Localizations";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/localization";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain(".createLocalizationManager");
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class ModalDialog {
3
+ static featureName = "Modal Dialog";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/create-display-dialog-box";
5
+ static severity = Severity.Info;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain(".openModalDialog");
10
+ }
11
+ }
@@ -0,0 +1,12 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class RenderingEvents {
3
+ static featureName = "Rendering Events";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/event-service";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.All;
8
+ static isSupported(packageInstance) {
9
+ const keywords = [".eventService", ".renderingStarted", ".renderingFinished"];
10
+ return !keywords.some(keyword => !packageInstance.contain(keyword));
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class SelectionAcrossVisuals {
3
+ static featureName = "Selection Across Visuals";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/supportsmultivisualselection-feature";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.isCapabilityEnabled({ supportsMultiVisualSelection: true });
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class SyncSlicer {
3
+ static featureName = "Sync Slicer";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/enable-sync-slicers";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.isCapabilityEnabled({ supportsSynchronizingFilterState: true });
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class Tooltips {
3
+ static featureName = "Tooltips";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/add-tooltips";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain("tooltipService") && packageInstance.isCapabilityEnabled({ tooltips: {} });
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class TotalSubTotal {
3
+ static featureName = "Total SubTotal";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/total-subtotal-api";
5
+ static severity = Severity.Warning;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.Matrix | VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.isCapabilityEnabled({ subtotals: true });
10
+ }
11
+ }
@@ -0,0 +1,12 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class VisualVersion {
3
+ static featureName = "Visual version";
4
+ static expectedVersionLength = 4;
5
+ static errorMessage = `${this.featureName} should consist of ${this.expectedVersionLength} parts. Update the pbiviz.json file`;
6
+ static severity = Severity.Error;
7
+ static stage = Stage.PreBuild;
8
+ static visualFeatureType = VisualFeatureType.All;
9
+ static isSupported(visual) {
10
+ return visual.isVisualVersionValid(this.expectedVersionLength);
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
+ export default class WarningIcon {
3
+ static featureName = "Warning Icon";
4
+ static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/visual-display-warning-icon";
5
+ static severity = Severity.Info;
6
+ static stage = Stage.PostBuild;
7
+ static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static isSupported(packageInstance) {
9
+ return packageInstance.contain(".displayWarningIcon");
10
+ }
11
+ }
@@ -0,0 +1,29 @@
1
+ import AdvancedEditMode from './AdvancedEditMode.js';
2
+ import AllowInteractions from './AllowInteractions.js';
3
+ import AnalyticsPane from './AnalyticsPane.js';
4
+ import Bookmarks from './Bookmarks.js';
5
+ import ColorPalette from './ColorPalette.js';
6
+ import ConditionalFormatting from './ConditionalFormatting.js';
7
+ import ContextMenu from './ContextMenu.js';
8
+ import DrillDown from './DrillDown.js';
9
+ import FetchMoreData from './FetchMoreData.js';
10
+ import FileDownload from './FileDownload.js';
11
+ import FormatPane from './FormatPane.js';
12
+ import HighContrast from './HighContrast.js';
13
+ import HighlightData from './HighlightData.js';
14
+ import KeyboardNavigation from './KeyboardNavigation.js';
15
+ import LandingPage from './LandingPage.js';
16
+ import LaunchURL from './LaunchURL.js';
17
+ import Localizations from './Localizations.js';
18
+ import LocalStorage from './LocalStorage.js';
19
+ import ModalDialog from './ModalDialog.js';
20
+ import RenderingEvents from './RenderingEvents.js';
21
+ import SelectionAcrossVisuals from './SelectionAcrossVisuals.js';
22
+ import SyncSlicer from './SyncSlicer.js';
23
+ import Tooltips from './Tooltips.js';
24
+ import TotalSubTotal from './TotalSubTotal.js';
25
+ import WarningIcon from './WarningIcon.js';
26
+ import APIVersion from './APIVersion.js';
27
+ import ESLint from './ESLint.js';
28
+ import VisualVersion from './VisualVersion.js';
29
+ export { AdvancedEditMode, AllowInteractions, AnalyticsPane, Bookmarks, ColorPalette, ConditionalFormatting, ContextMenu, DrillDown, FetchMoreData, FileDownload, FormatPane, HighContrast, HighlightData, KeyboardNavigation, LandingPage, LaunchURL, Localizations, LocalStorage, ModalDialog, RenderingEvents, SelectionAcrossVisuals, SyncSlicer, Tooltips, TotalSubTotal, WarningIcon, APIVersion, ESLint, VisualVersion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerbi-visuals-tools",
3
- "version": "5.1.0",
3
+ "version": "5.2.0-beta.1",
4
4
  "description": "Command line tool for creating and publishing visuals for Power BI",
5
5
  "main": "./bin/pbiviz.js",
6
6
  "type": "module",
@@ -54,6 +54,7 @@
54
54
  "lodash.clonedeep": "4.5.0",
55
55
  "lodash.defaults": "4.2.0",
56
56
  "lodash.isequal": "4.5.0",
57
+ "lodash.ismatch": "^4.4.0",
57
58
  "mini-css-extract-plugin": "^2.7.6",
58
59
  "os-browserify": "^0.3.0",
59
60
  "path-browserify": "^1.0.1",