mnfst 0.5.266 → 0.5.267

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  (function () {
4
4
 
5
- const MANIFEST_BUILD_VERSION = '0.5.266';
5
+ const MANIFEST_BUILD_VERSION = '0.5.267';
6
6
 
7
7
  /* Manifest Data Sources - Appwrite Integration */
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  (function () {
4
4
 
5
- const MANIFEST_BUILD_VERSION = '0.5.266';
5
+ const MANIFEST_BUILD_VERSION = '0.5.267';
6
6
 
7
7
  /* Manifest Data Sources - Configuration */
8
8
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest.appwrite.auth.js": "sha384-gWLSeVPqCLMiUZB8MU7GqMg3x2yULFUsp8nTTZrPp/9Dlkix42rBn9yIimvwrHqZ",
3
- "manifest.appwrite.data.js": "sha384-lGkmd3KHrHnHOKFu4heKsASb7Vu7F3bbr9kKLAStDKSqyHCP5nwb0zt9NlHAlfTM",
3
+ "manifest.appwrite.data.js": "sha384-81l7vI/UteYuZxU0z7NMMOC7nUzu8nMaB4JbGLHUbIxutpjeuD81PYsL7beVKsih",
4
4
  "manifest.appwrite.presences.js": "sha384-/CagPsgWhO1sWEevCNGJmZ/ezRK9YCjLjvF7hxNSM4gVlJmEVtfSLfF7wnsRq441",
5
5
  "manifest.bindings.js": "sha384-lPtMf8Ykaic9gNVZKq8Scia1881ZeMAyxer3WCIkUNwwrgzGBWto1OXADUwjvORF",
6
6
  "manifest.charts.js": "sha384-AFbP7mQnigy7DU1s+YE30yKTeQAKfgNazhbfSNbfd9ZpLgeulZKaPi/fAq3gJHDO",
@@ -11,7 +11,7 @@
11
11
  "manifest.combobox.js": "sha384-/lJo6vaxKjgnBSRs/dzkhK1dzGk3GBw8FISoNJZB70mwAVwu1k5veZyBXjOb4keS",
12
12
  "manifest.components.js": "sha384-BUFA8h+G5Plr82sV7bKzO42pPoiRZwRQcKj1lt2ROFiKjjlkayU/vmkAFqEsdBA+",
13
13
  "manifest.computed.js": "sha384-GYML/e81gQfN+iDbqhPUgny8bINCyL+SrbTofoGk4hlCnLLjv51mCv42JMqq+ku5",
14
- "manifest.data.js": "sha384-FYX4So6jz/1Zj9B7Dxz+B7LpuqD+JZe5rUmtSwggRQe3t113dTjvXWjpanL/NfYI",
14
+ "manifest.data.js": "sha384-aEAnoRnpJZaXR0AWUZ+pGF9Cu8qlPpFzlcT58DnMkaZuKC9yL0l36LdRPGlkPIx0",
15
15
  "manifest.datepicker.js": "sha384-EzlMwvIxlla/0BuyhAEqxN0M8TGcWIWgEIg840V0akKQQK1uY648wPWMkobvtq/o",
16
16
  "manifest.defer.js": "sha384-5cHzFTbx+cZmGpk9FuiUtW3ciC9NvvHwJeHP7xL5yiZVp9PhMWVdQ7L9y6ju2yoo",
17
17
  "manifest.device.js": "sha384-YeQaS56L8IILqrQNBSeAOLwIh5DuAOrE60cYLK1+46qJtUrXlAvqGe2j5mbV4Vq7",
@@ -20,7 +20,7 @@
20
20
  "manifest.export.js": "sha384-C4W5LrGQFnSILRWoWOCliajUK6rAzNW+EliogRx72vD1cUOYScSdfzHNbjSWv5XU",
21
21
  "manifest.icons.js": "sha384-kKOINpX70YzNO3FvkV6umrmO3f0KIu0DNbwB+ej55a7y/lhU7v/myQtXL0bwCTbt",
22
22
  "manifest.localization.js": "sha384-EImsIw8Z3l13V5eH9ZJF/yfsOfIvR1oPRNSArANkPji7V8O3IRf6zMwsNiAGj3Hk",
23
- "manifest.markdown.js": "sha384-SQqvC175/Ai3yLNjWNK1EOwrxVpoCrZVFSfzA5wg2btrQPQmNNQk3ICGeBY6f502",
23
+ "manifest.markdown.js": "sha384-8bZCrYOZ/s0lcZIU79YmB6U7/XOS0UgdjxNvWIVc/aSdQxPTXTCuFfkbvkS0DnPG",
24
24
  "manifest.native.js": "sha384-YeQaS56L8IILqrQNBSeAOLwIh5DuAOrE60cYLK1+46qJtUrXlAvqGe2j5mbV4Vq7",
25
25
  "manifest.payments.js": "sha384-8pofk2zhxtapPMpwnFyTelPMrYhShNhDCE722uQh/EYFvZFuPLmSdgunqsarVQjv",
26
26
  "manifest.rich.text.js": "sha384-ZBV9jXmu2nmprEHicddRE/m7nR4RPZtVc969Jte0+EJYBcVph7itkjcgN/61PyeC",
@@ -28,10 +28,10 @@
28
28
  "manifest.slides.js": "sha384-3uRTkyK9XPLmnxI2+igZlpi4EyPlU/7IHj5j3BZJJ2KN455vXyk99fiXV3feO/XY",
29
29
  "manifest.status.js": "sha384-ofu7nBnVIGZ1U1o2R9d2H3V8aEMPUCVbl5FO3gIToXqi0oa36fTviEdh5UU7Kitw",
30
30
  "manifest.svg.js": "sha384-qr/8H9+2cIhSXNbRWRtIdrDlTOxKlNJqwEefHvCYoiBNW/kKhPTFa109Orv/EBnb",
31
- "manifest.sw.js": "sha384-pmKqe+pl5NMyIv9E96g8if5y+/wVzeNGwUt8PWPgeMpCOQui/xNqk64kezmI2qKP",
31
+ "manifest.sw.js": "sha384-BWZsM4KfbumoQMhr8aGWLpUgTDfWHEW6thJ4TbBoR/hA/clJcUbXNearDmqTK5vM",
32
32
  "manifest.tabs.js": "sha384-otU09H7jnawVKQdLAYpMCd3jx00tgyPVr42D2hLIBzN5dG4se505YesavdnMqEi1",
33
33
  "manifest.tailwind.js": "sha384-yuP3LEvWU+QVjxjkZ0YhErtC9RrGmhOmHjjFjhS9obqZbp5/KTIEnSR0CXDvHE0B",
34
- "manifest.toasts.js": "sha384-3zkWxzw693pxg3QDFsoYCA3CqYaLKmBaMArULXODD66Utolpewl0OAeTB92aWUVv",
34
+ "manifest.toasts.js": "sha384-UpOz9fAdGeGUhL0NamBg5iPepEfIy73p9HYdcxfOQC5b7CVsl7Our0skdZzaLNcC",
35
35
  "manifest.tooltips.js": "sha384-hXGp5j0s6p2kGZY/hqLPEbaUv68ca63kFCjYiZqK3DcC12mpHTBy1vz3kuApyf4p",
36
36
  "manifest.url.parameters.js": "sha384-J2aSVBOPsoqsbafHndrWLHEDpKb4AKJAoQnVmKA4gZh5P/8HHjFWHO/lkusmG84l",
37
37
  "manifest.utilities.js": "sha384-h17EquaRtNcEW0yfhk7R+a+2+CzTlBxPuFryO6i9NV/OiIRMihREoyzQ77QawoQ7",
@@ -15,15 +15,8 @@ if (typeof window !== 'undefined') {
15
15
  });
16
16
  }
17
17
 
18
- // DOMPurify config for Manifest markdown: allow x-* custom elements and
19
- // directive attributes to survive, but reject on* event handlers.
20
- const MARKDOWN_PURIFY_CONFIG = {
21
- CUSTOM_ELEMENT_HANDLING: {
22
- tagNameCheck: /^x-[a-z][\w-]*$/,
23
- attributeNameCheck: /^(?!on)[a-z][\w\-:]*$/i,
24
- allowCustomizedBuiltInElements: false
25
- }
26
- };
18
+ // DOMPurify defaults for .safe: no custom elements, no directive or event attributes
19
+ const MARKDOWN_PURIFY_CONFIG = {};
27
20
 
28
21
  // Shared DOMPurify loader on window (svg.js or markdown, whichever loads first).
29
22
  // A top-level `let purifyPromise` would collide with svg.js's identical one.
@@ -243,10 +236,10 @@ async function configureMarked(marked) {
243
236
 
244
237
  const iconHtml = iconValue ? `<span x-icon="${escapeForAttribute(iconValue)}"></span>` : '';
245
238
 
246
- // Count top-level elements
247
- const temp = document.createElement('div');
239
+ // Count top-level elements (inert parse: content isn't sanitized yet)
240
+ const temp = document.createElement('template');
248
241
  temp.innerHTML = parsedContent;
249
- const elementCount = temp.children.length;
242
+ const elementCount = temp.content.children.length;
250
243
 
251
244
  // Wrap only when there's an icon plus 2+ elements (icon needs a sibling wrapper).
252
245
  const needsWrapper = elementCount >= 2 && iconValue;
@@ -282,10 +275,10 @@ function renderXCodeGroup(markdown) {
282
275
 
283
276
  // Enable task-list checkboxes by removing marked's disabled attribute.
284
277
  function enableCheckboxes(html) {
285
- const temp = document.createElement('div');
278
+ const temp = document.createElement('template');
286
279
  temp.innerHTML = html;
287
280
 
288
- const checkboxes = temp.querySelectorAll('input[type="checkbox"]');
281
+ const checkboxes = temp.content.querySelectorAll('input[type="checkbox"]');
289
282
  checkboxes.forEach(checkbox => {
290
283
  checkbox.removeAttribute('disabled');
291
284
  });
@@ -16,7 +16,7 @@
16
16
 
17
17
  // Build stamps the published version here; unstamped (dev) falls back to the
18
18
  // registration URL's `v`, then 'dev'.
19
- const BUILD_VERSION = '0.5.266';
19
+ const BUILD_VERSION = '0.5.267';
20
20
  const CACHE_PREFIX = 'mnfst-sw:';
21
21
  const META_CACHE = CACHE_PREFIX + 'meta';
22
22
  // Sized to hold a full precache.json warm-up (PRECACHE_MAX_ENTRIES server-side)
@@ -81,7 +81,7 @@ function initializeToastPlugin() {
81
81
  };
82
82
 
83
83
  // Helper function to show toast
84
- const showToast = (message, { type = '', duration = TOAST_DURATION, dismissible = false, fixed = false, icon = null } = {}) => {
84
+ const showToast = (message, { type = '', duration = TOAST_DURATION, dismissible = false, fixed = false, icon = null, html = false } = {}) => {
85
85
  const container = getContainer();
86
86
 
87
87
  // Create toast element
@@ -99,12 +99,17 @@ function initializeToastPlugin() {
99
99
  // Create content with optional icon
100
100
  const contentHtml = `
101
101
  ${icon ? '<span class="toast-icon"></span>' : ''}
102
- <div class="toast-content">${message}</div>
102
+ <div class="toast-content"></div>
103
103
  ${dismissible || fixed ? '<button class="toast-dismiss-button" aria-label="Dismiss"></button>' : ''}
104
104
  `;
105
105
 
106
106
  toast.innerHTML = contentHtml;
107
107
 
108
+ // Text by default; author markup and the html opt-in render as HTML
109
+ const content = toast.querySelector('.toast-content');
110
+ if (html) content.innerHTML = message;
111
+ else content.textContent = message;
112
+
108
113
  // Add icon if specified
109
114
  if (icon) {
110
115
  const iconContainer = toast.querySelector('.toast-icon');
@@ -188,6 +193,7 @@ function initializeToastPlugin() {
188
193
  dismissible: modifiers.includes('dismiss'),
189
194
  fixed: modifiers.includes('fixed')
190
195
  };
196
+ const htmlOptIn = modifiers.includes('html');
191
197
 
192
198
  // Find duration modifier (any number)
193
199
  const durationModifier = modifiers.find(mod => !isNaN(mod));
@@ -198,7 +204,7 @@ function initializeToastPlugin() {
198
204
  }
199
205
 
200
206
  // Static text (author HTML included) shows as written; expressions
201
- // evaluate on every click. Empty results (null, false, '') show nothing.
207
+ // evaluate on every click as text unless .html. Empty results (null, false, '') show nothing.
202
208
  const src = expression.trim();
203
209
  const evaluate = expressionResolver(el, src, evaluateLater);
204
210
  if (evaluate && src.startsWith('$x.')) evaluate(() => {}); // starts the source loading
@@ -211,12 +217,12 @@ function initializeToastPlugin() {
211
217
  originalClick.call(el, e);
212
218
  }
213
219
  // Show toast after original handler
214
- if (!evaluate) { showToast(expression, options); return; }
220
+ if (!evaluate) { showToast(expression, { ...options, html: true }); return; }
215
221
  // After the element's other click listeners, so state they change shows
216
222
  setTimeout(() => evaluate((v, asText) => {
217
- if (asText) { showToast(expression, options); return; }
223
+ if (asText) { showToast(expression, { ...options, html: true }); return; }
218
224
  const message = v == null || v === false ? '' : String(v);
219
- if (message !== '') showToast(message, options);
225
+ if (message !== '') showToast(message, { ...options, html: htmlOptIn });
220
226
  }));
221
227
  };
222
228
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnfst",
3
- "version": "0.5.266",
3
+ "version": "0.5.267",
4
4
  "private": false,
5
5
  "workspaces": [
6
6
  "templates/starter",