@progress/kendo-angular-common 25.3.0-develop.1 → 25.3.0-develop.2

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.
@@ -240,6 +240,58 @@ const processCssValue = (value) => {
240
240
  return null;
241
241
  };
242
242
 
243
+ const allowedUrlSchemes = /^(https?|mailto|tel):/i;
244
+ const allowedImageDataUrl = /^data:image\/(?!svg\+xml\b)[a-z0-9.+-]+[,;]/i;
245
+ const urlScheme = /^[a-z][a-z\d+.-]*:/i;
246
+ const schemeName = /^[a-z][a-z\d+.-]*$/i;
247
+ const removeControlCharacters = (url) => Array.from(url)
248
+ .filter((character) => {
249
+ const characterCode = character.codePointAt(0) ?? 0;
250
+ return characterCode > 31 && characterCode !== 127;
251
+ })
252
+ .join('');
253
+ const buildExtraSchemesPattern = (extraSchemes) => {
254
+ const valid = extraSchemes.filter((scheme) => schemeName.test(scheme));
255
+ if (valid.length === 0) {
256
+ return null;
257
+ }
258
+ return new RegExp('^(' + valid.join('|') + '):', 'i');
259
+ };
260
+ /**
261
+ * @hidden
262
+ * Returns `true` when the URL is a relative reference/fragment or uses an allow-listed scheme (http, https, mailto, tel).
263
+ * Callers may pass `extraSchemes` (without trailing colon) to widen the allow-list for their specific use case.
264
+ */
265
+ const isSafeUrl = (url, extraSchemes) => {
266
+ if (url === null || url === undefined) {
267
+ return true;
268
+ }
269
+ const normalizedUrl = removeControlCharacters(String(url).trim());
270
+ if (!urlScheme.test(normalizedUrl)) {
271
+ return true;
272
+ }
273
+ if (allowedUrlSchemes.test(normalizedUrl)) {
274
+ return true;
275
+ }
276
+ const extra = extraSchemes && extraSchemes.length > 0 ? buildExtraSchemesPattern(extraSchemes) : null;
277
+ return extra?.test(normalizedUrl) ?? false;
278
+ };
279
+ /**
280
+ * @hidden
281
+ * Same as {@link isSafeUrl} but also accepts `data:image/<mime>` URLs (excluding `data:image/svg+xml`)
282
+ * so that base64-embedded raster images continue to work in image src attributes.
283
+ */
284
+ const isSafeImageUrl = (url) => {
285
+ if (url === null || url === undefined) {
286
+ return true;
287
+ }
288
+ const normalizedUrl = removeControlCharacters(String(url).trim());
289
+ if (!urlScheme.test(normalizedUrl)) {
290
+ return true;
291
+ }
292
+ return allowedUrlSchemes.test(normalizedUrl) || allowedImageDataUrl.test(normalizedUrl);
293
+ };
294
+
243
295
  class DraggableDirective {
244
296
  element;
245
297
  ngZone;
@@ -2351,5 +2403,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
2351
2403
  * Generated bundle index. Do not edit.
2352
2404
  */
2353
2405
 
2354
- export { ScrollbarService as BrowserSupportService, ComponentNameDirective, DraggableDirective, EventsOutsideAngularDirective, KENDO_ADORNMENTS, KENDO_COMMON, KENDO_COMPONENT_NAME, KENDO_DRAGGABLE, KENDO_EVENTS, KENDO_RESIZESENSOR, KENDO_TEMPLATE_CONTEXT, KENDO_TOGGLEBUTTONTABSTOP, KENDO_WATERMARK, KENDO_WEBMCP_HOST, KendoInput, Keys, MultiTabStop, PrefixTemplateDirective, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent, ScrollbarService, SeparatorComponent, SuffixTemplateDirective, TemplateContextDirective, ToggleButtonTabStopDirective, WatermarkOverlayComponent, anyChanged, applyAttributes, areObjectsEqual, closest, closestBySelector, closestInScope, contains, findElement, findFocusable, findFocusableChild, firefoxMaxHeight, focusableSelector, getLicenseMessage, getter, guid, hasClasses, hasFocusableParent, hasObservers, isChanged, isControlRequired, isDocumentAvailable, isFirefox, isFocusable, isFocusableWithTabKey, isObject, isObjectPresent, isPresent, isSafari, isSet, isString, isVisible, matchesClasses, matchesNodeName, normalizeKeys, parseAttributes, parseCSSClassNames, processCssValue, provideComponentName, removeHTMLAttributes, replaceMessagePlaceholder, rtlScrollLeft, rtlScrollPosition, scrollbarWidth, setHTMLAttributes, setter, shouldShowValidationUI, splitStringToArray };
2406
+ export { ScrollbarService as BrowserSupportService, ComponentNameDirective, DraggableDirective, EventsOutsideAngularDirective, KENDO_ADORNMENTS, KENDO_COMMON, KENDO_COMPONENT_NAME, KENDO_DRAGGABLE, KENDO_EVENTS, KENDO_RESIZESENSOR, KENDO_TEMPLATE_CONTEXT, KENDO_TOGGLEBUTTONTABSTOP, KENDO_WATERMARK, KENDO_WEBMCP_HOST, KendoInput, Keys, MultiTabStop, PrefixTemplateDirective, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent, ScrollbarService, SeparatorComponent, SuffixTemplateDirective, TemplateContextDirective, ToggleButtonTabStopDirective, WatermarkOverlayComponent, anyChanged, applyAttributes, areObjectsEqual, closest, closestBySelector, closestInScope, contains, findElement, findFocusable, findFocusableChild, firefoxMaxHeight, focusableSelector, getLicenseMessage, getter, guid, hasClasses, hasFocusableParent, hasObservers, isChanged, isControlRequired, isDocumentAvailable, isFirefox, isFocusable, isFocusableWithTabKey, isObject, isObjectPresent, isPresent, isSafari, isSafeImageUrl, isSafeUrl, isSet, isString, isVisible, matchesClasses, matchesNodeName, normalizeKeys, parseAttributes, parseCSSClassNames, processCssValue, provideComponentName, removeHTMLAttributes, replaceMessagePlaceholder, rtlScrollLeft, rtlScrollPosition, scrollbarWidth, setHTMLAttributes, setter, shouldShowValidationUI, splitStringToArray };
2355
2407
 
package/index.d.ts CHANGED
@@ -290,6 +290,19 @@ declare const areObjectsEqual: (firstObject: any, secondObject: any) => boolean;
290
290
 
291
291
  declare const processCssValue: (value: number | string) => string | null;
292
292
 
293
+ /**
294
+ * @hidden
295
+ * Returns `true` when the URL is a relative reference/fragment or uses an allow-listed scheme (http, https, mailto, tel).
296
+ * Callers may pass `extraSchemes` (without trailing colon) to widen the allow-list for their specific use case.
297
+ */
298
+ declare const isSafeUrl: (url: string | null | undefined, extraSchemes?: readonly string[]) => boolean;
299
+ /**
300
+ * @hidden
301
+ * Same as {@link isSafeUrl} but also accepts `data:image/<mime>` URLs (excluding `data:image/svg+xml`)
302
+ * so that base64-embedded raster images continue to work in image src attributes.
303
+ */
304
+ declare const isSafeImageUrl: (url: string | null | undefined) => boolean;
305
+
293
306
  /**
294
307
  * Enum with key codes.
295
308
  */
@@ -819,5 +832,5 @@ declare class ComponentNameDirective {
819
832
  static ɵdir: i0.ɵɵDirectiveDeclaration<ComponentNameDirective, "[kendoComponentName]", never, { "name": { "alias": "kendoComponentName"; "required": false; }; }, {}, never, never, true, never>;
820
833
  }
821
834
 
822
- export { ScrollbarService as BrowserSupportService, ComponentNameDirective, DraggableDirective, EventsOutsideAngularDirective, KENDO_ADORNMENTS, KENDO_COMMON, KENDO_COMPONENT_NAME, KENDO_DRAGGABLE, KENDO_EVENTS, KENDO_RESIZESENSOR, KENDO_TEMPLATE_CONTEXT, KENDO_TOGGLEBUTTONTABSTOP, KENDO_WATERMARK, KENDO_WEBMCP_HOST, KendoInput, Keys, MultiTabStop, PrefixTemplateDirective, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent, ScrollbarService, SeparatorComponent, SuffixTemplateDirective, TemplateContextDirective, ToggleButtonTabStopDirective, WatermarkOverlayComponent, anyChanged, applyAttributes, areObjectsEqual, closest, closestBySelector, closestInScope, contains, findElement, findFocusable, findFocusableChild, firefoxMaxHeight, focusableSelector, getLicenseMessage, getter, guid, hasClasses, hasFocusableParent, hasObservers, isChanged, isControlRequired, isDocumentAvailable, isFirefox, isFocusable, isFocusableWithTabKey, isObject, isObjectPresent, isPresent, isSafari, isSet, isString, isVisible, matchesClasses, matchesNodeName, normalizeKeys, parseAttributes, parseCSSClassNames, processCssValue, provideComponentName, removeHTMLAttributes, replaceMessagePlaceholder, rtlScrollLeft, rtlScrollPosition, scrollbarWidth, setHTMLAttributes, setter, shouldShowValidationUI, splitStringToArray };
835
+ export { ScrollbarService as BrowserSupportService, ComponentNameDirective, DraggableDirective, EventsOutsideAngularDirective, KENDO_ADORNMENTS, KENDO_COMMON, KENDO_COMPONENT_NAME, KENDO_DRAGGABLE, KENDO_EVENTS, KENDO_RESIZESENSOR, KENDO_TEMPLATE_CONTEXT, KENDO_TOGGLEBUTTONTABSTOP, KENDO_WATERMARK, KENDO_WEBMCP_HOST, KendoInput, Keys, MultiTabStop, PrefixTemplateDirective, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent, ScrollbarService, SeparatorComponent, SuffixTemplateDirective, TemplateContextDirective, ToggleButtonTabStopDirective, WatermarkOverlayComponent, anyChanged, applyAttributes, areObjectsEqual, closest, closestBySelector, closestInScope, contains, findElement, findFocusable, findFocusableChild, firefoxMaxHeight, focusableSelector, getLicenseMessage, getter, guid, hasClasses, hasFocusableParent, hasObservers, isChanged, isControlRequired, isDocumentAvailable, isFirefox, isFocusable, isFocusableWithTabKey, isObject, isObjectPresent, isPresent, isSafari, isSafeImageUrl, isSafeUrl, isSet, isString, isVisible, matchesClasses, matchesNodeName, normalizeKeys, parseAttributes, parseCSSClassNames, processCssValue, provideComponentName, removeHTMLAttributes, replaceMessagePlaceholder, rtlScrollLeft, rtlScrollPosition, scrollbarWidth, setHTMLAttributes, setter, shouldShowValidationUI, splitStringToArray };
823
836
  export type { SeparatorOrientation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-common",
3
- "version": "25.3.0-develop.1",
3
+ "version": "25.3.0-develop.2",
4
4
  "description": "Kendo UI for Angular - Utility Package",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -23,7 +23,7 @@
23
23
  "@progress/kendo-common": "^1.0.1",
24
24
  "@progress/kendo-draggable": "^3.0.2",
25
25
  "tslib": "^2.3.1",
26
- "@progress/kendo-angular-schematics": "25.3.0-develop.1"
26
+ "@progress/kendo-angular-schematics": "25.3.0-develop.2"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"