@ichicraft/widgets-widget-base 1.14.0 → 1.14.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.
package/README.md CHANGED
@@ -9,6 +9,9 @@ All notable changes to this project will be documented here.
9
9
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
10
10
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
11
 
12
+ ## 1.14.1 - 2025-06-17
13
+ - Reverted module type 'commonjs' for backwards compatibility
14
+
12
15
  ## 1.14.0 - 2025-05-21
13
16
  - Version bumped `@microsoft/sp-http` dependency to latest SPFx version `1.21.1`
14
17
 
package/lib/BaseWidget.js CHANGED
@@ -1,5 +1,8 @@
1
- export default class BaseWidget {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class BaseWidget {
2
4
  constructor(context) {
3
5
  this.context = context;
4
6
  }
5
7
  }
8
+ exports.default = BaseWidget;
package/lib/index.js CHANGED
@@ -1,2 +1,23 @@
1
- export { default as BaseWidget } from './BaseWidget';
2
- export * from './types';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.BaseWidget = void 0;
21
+ var BaseWidget_1 = require("./BaseWidget");
22
+ Object.defineProperty(exports, "BaseWidget", { enumerable: true, get: function () { return __importDefault(BaseWidget_1).default; } });
23
+ __exportStar(require("./types"), exports);
@@ -1,4 +1,7 @@
1
- export var DebugComponentType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommandBarItemType = exports.CustomCommandBarItemSeverity = exports.ICPersonaType = exports.DebugComponentType = void 0;
4
+ var DebugComponentType;
2
5
  (function (DebugComponentType) {
3
6
  /**
4
7
  * This is the default component type and just opens the default widget board.
@@ -9,29 +12,29 @@ export var DebugComponentType;
9
12
  * dialog of the widget you're working on
10
13
  */
11
14
  DebugComponentType["AdminConfig"] = "AdminConfig";
12
- })(DebugComponentType || (DebugComponentType = {}));
13
- export var ICPersonaType;
15
+ })(DebugComponentType || (exports.DebugComponentType = DebugComponentType = {}));
16
+ var ICPersonaType;
14
17
  (function (ICPersonaType) {
15
18
  ICPersonaType[ICPersonaType["User"] = 0] = "User";
16
19
  ICPersonaType[ICPersonaType["SPGroup"] = 1] = "SPGroup";
17
20
  ICPersonaType[ICPersonaType["Other"] = 2] = "Other";
18
21
  ICPersonaType[ICPersonaType["Custom"] = 3] = "Custom";
19
- })(ICPersonaType || (ICPersonaType = {}));
22
+ })(ICPersonaType || (exports.ICPersonaType = ICPersonaType = {}));
20
23
  /**
21
24
  * Tells the severity of the command bar item, resulting in
22
25
  * distinguishable presentation of the item
23
26
  */
24
- export var CustomCommandBarItemSeverity;
27
+ var CustomCommandBarItemSeverity;
25
28
  (function (CustomCommandBarItemSeverity) {
26
29
  /** Normal severity, displays just like all the other command bar items */
27
30
  CustomCommandBarItemSeverity[CustomCommandBarItemSeverity["Normal"] = 0] = "Normal";
28
31
  /** Warning severity, displays the item with a more noticable warning color */
29
32
  CustomCommandBarItemSeverity[CustomCommandBarItemSeverity["Warning"] = 1] = "Warning";
30
- })(CustomCommandBarItemSeverity || (CustomCommandBarItemSeverity = {}));
33
+ })(CustomCommandBarItemSeverity || (exports.CustomCommandBarItemSeverity = CustomCommandBarItemSeverity = {}));
31
34
  /**
32
35
  * Tells how to render the command bar item, e.g. as an icon button or as a link.
33
36
  */
34
- export var CommandBarItemType;
37
+ var CommandBarItemType;
35
38
  (function (CommandBarItemType) {
36
39
  /** Renders the item as an Icon */
37
40
  CommandBarItemType["Icon"] = "icon";
@@ -41,4 +44,4 @@ export var CommandBarItemType;
41
44
  CommandBarItemType["SearchBar"] = "search-bar";
42
45
  /** Renders the item in the overflow menu */
43
46
  CommandBarItemType["Overflow"] = "overflow";
44
- })(CommandBarItemType || (CommandBarItemType = {}));
47
+ })(CommandBarItemType || (exports.CommandBarItemType = CommandBarItemType = {}));
@@ -1,8 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConfigurationHelper = void 0;
1
4
  /**
2
5
  * @class
3
6
  * Helper class for Configuration related things.
4
7
  */
5
- export class ConfigurationHelper {
8
+ class ConfigurationHelper {
6
9
  /**
7
10
  *
8
11
  * @param config The serialized configuration to parse into an object
@@ -16,3 +19,4 @@ export class ConfigurationHelper {
16
19
  return JSON.stringify(config);
17
20
  }
18
21
  }
22
+ exports.ConfigurationHelper = ConfigurationHelper;
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -7,26 +8,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
9
  });
9
10
  };
10
- import { ICPersonaType } from '../types';
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UserHelper = void 0;
13
+ const types_1 = require("../types");
11
14
  /**
12
15
  * @class
13
16
  * Helper class for User related methods.
14
17
  */
15
- export class UserHelper {
18
+ class UserHelper {
16
19
  static isCurrentUserInScope(personas, context) {
17
20
  return __awaiter(this, void 0, void 0, function* () {
18
21
  let userIsPartOfThis = false;
19
22
  for (let i = 0; i < personas.length; i++) {
20
23
  const personaItem = personas[i];
21
24
  switch (personaItem.type) {
22
- case ICPersonaType.SPGroup: {
25
+ case types_1.ICPersonaType.SPGroup: {
23
26
  const userIsMemberOfSPGroup = yield context.isCurrentUserMemberOfSPGroup(Number.parseInt(personaItem.id));
24
27
  if (userIsMemberOfSPGroup) {
25
28
  userIsPartOfThis = true;
26
29
  }
27
30
  break;
28
31
  }
29
- case ICPersonaType.User: {
32
+ case types_1.ICPersonaType.User: {
30
33
  // handle a username exact match and partial match in case picker is in format 'i:0#.f|membership|USERNAME'
31
34
  if (personaItem.id.toLowerCase() === context.userName.toLowerCase() ||
32
35
  personaItem.id.toLowerCase() ===
@@ -39,7 +42,7 @@ export class UserHelper {
39
42
  }
40
43
  break;
41
44
  }
42
- case ICPersonaType.Other:
45
+ case types_1.ICPersonaType.Other:
43
46
  case null: {
44
47
  let personaItemId = personaItem.id;
45
48
  // Check if this is the infamous "Everyone except external users" group,
@@ -91,3 +94,4 @@ export class UserHelper {
91
94
  return personas;
92
95
  }
93
96
  }
97
+ exports.UserHelper = UserHelper;
@@ -1,2 +1,18 @@
1
- export * from './ConfigurationHelper';
2
- export * from './UserHelper';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ConfigurationHelper"), exports);
18
+ __exportStar(require("./UserHelper"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "Part of the Widget Development Kit for building widgets for Ichicraft Boards",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",