@sprucelabs/heartwood-view-controllers 118.0.9 → 118.0.10

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.
@@ -114,7 +114,7 @@ export default class AbstractViewController {
114
114
  alert(options) {
115
115
  return __awaiter(this, void 0, void 0, function* () {
116
116
  var _a, _b, _c;
117
- const { title = 'Alert!', message, style } = options;
117
+ const { title = 'Alert!', message, style, okButtonLabel } = options;
118
118
  const header = {
119
119
  title,
120
120
  };
@@ -124,21 +124,26 @@ export default class AbstractViewController {
124
124
  return;
125
125
  }
126
126
  this.activeAlert = Object.assign(Object.assign({}, options), { title });
127
+ const text = {};
128
+ if (message.includes('<')) {
129
+ text.html = message;
130
+ }
131
+ else {
132
+ text.content = message;
133
+ }
127
134
  const dlg = this.renderInDialog({
128
135
  header,
129
136
  body: {
130
137
  sections: [
131
138
  {
132
- text: {
133
- content: message,
134
- },
139
+ text,
135
140
  },
136
141
  ],
137
142
  },
138
143
  footer: {
139
144
  buttons: [
140
145
  {
141
- label: 'Ok',
146
+ label: okButtonLabel !== null && okButtonLabel !== void 0 ? okButtonLabel : 'Ok',
142
147
  type: buttonStyleToType(style),
143
148
  onClick: () => {
144
149
  void dlg.hide();
@@ -101,7 +101,7 @@ class AbstractViewController {
101
101
  this.toastHandler(options);
102
102
  }
103
103
  async alert(options) {
104
- const { title = 'Alert!', message, style } = options;
104
+ const { title = 'Alert!', message, style, okButtonLabel } = options;
105
105
  const header = {
106
106
  title,
107
107
  };
@@ -111,21 +111,26 @@ class AbstractViewController {
111
111
  return;
112
112
  }
113
113
  this.activeAlert = { ...options, title };
114
+ const text = {};
115
+ if (message.includes('<')) {
116
+ text.html = message;
117
+ }
118
+ else {
119
+ text.content = message;
120
+ }
114
121
  const dlg = this.renderInDialog({
115
122
  header,
116
123
  body: {
117
124
  sections: [
118
125
  {
119
- text: {
120
- content: message,
121
- },
126
+ text,
122
127
  },
123
128
  ],
124
129
  },
125
130
  footer: {
126
131
  buttons: [
127
132
  {
128
- label: 'Ok',
133
+ label: okButtonLabel ?? 'Ok',
129
134
  type: buttonStyleToType(style),
130
135
  onClick: () => {
131
136
  void dlg.hide();
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "sideEffects": false,
14
14
  "license": "MIT",
15
15
  "description": "All the power of Heartwood in one, convenient package.",
16
- "version": "118.0.9",
16
+ "version": "118.0.10",
17
17
  "skill": {
18
18
  "namespace": "HeartwoodViewControllers",
19
19
  "commandOverrides": {