@helpdice/ui 2.1.5 → 2.1.8

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 (42) hide show
  1. package/dist/auto-complete/index.js +12 -10
  2. package/dist/button/button.d.ts +1 -1
  3. package/dist/button/index.js +73 -16
  4. package/dist/button/styles.d.ts +1 -0
  5. package/dist/carousal/index.js +73 -16
  6. package/dist/copy-to-clipboard/clipboard.d.ts +2 -0
  7. package/dist/copy-to-clipboard/copy.d.ts +2 -0
  8. package/dist/copy-to-clipboard/index.d.ts +2 -0
  9. package/dist/copy-to-clipboard/index.js +1717 -0
  10. package/dist/copy-to-clipboard/toggle-selection.d.ts +1 -0
  11. package/dist/html-renderer/index.js +35 -12
  12. package/dist/index.d.ts +3 -2
  13. package/dist/index.js +539 -220
  14. package/dist/input/index.js +12 -10
  15. package/dist/input/input-props.d.ts +1 -0
  16. package/dist/modal/index.js +73 -16
  17. package/dist/notetip/index.js +690 -0
  18. package/dist/notetip/{index.d.ts → note-tip.d.ts} +2 -2
  19. package/dist/table/index.js +990 -930
  20. package/esm/button/button.d.ts +1 -1
  21. package/esm/button/button.js +51 -5
  22. package/esm/button/styles.d.ts +1 -0
  23. package/esm/button/styles.js +22 -11
  24. package/esm/copy-to-clipboard/clipboard.d.ts +2 -0
  25. package/esm/copy-to-clipboard/copy.d.ts +2 -0
  26. package/esm/copy-to-clipboard/copy.js +105 -0
  27. package/esm/copy-to-clipboard/index.d.ts +2 -0
  28. package/esm/copy-to-clipboard/index.js +2 -0
  29. package/esm/copy-to-clipboard/toggle-selection.d.ts +1 -0
  30. package/esm/copy-to-clipboard/toggle-selection.js +31 -0
  31. package/esm/index.d.ts +3 -2
  32. package/esm/index.js +3 -2
  33. package/esm/input/input-field.js +12 -10
  34. package/esm/input/input-props.d.ts +1 -0
  35. package/esm/notetip/index.js +2 -97
  36. package/esm/notetip/{index.d.ts → note-tip.d.ts} +2 -2
  37. package/esm/notetip/note-tip.js +97 -0
  38. package/esm/table/table-body.js +2 -2
  39. package/esm/table/table-cell.js +1 -1
  40. package/esm/table/table-head.js +4 -2
  41. package/esm/table/table.js +0 -1
  42. package/package.json +14 -7
@@ -0,0 +1 @@
1
+ export default function _default(): () => void;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
 
7
- /*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */
7
+ /*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
8
8
 
9
9
  const {
10
10
  entries,
@@ -190,7 +190,7 @@ function lookupGetter(object, prop) {
190
190
  }
191
191
 
192
192
  const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
193
- const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'slot', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
193
+ const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
194
194
  const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
195
195
  // List of SVG elements that are disallowed by default.
196
196
  // We still need to know them so that we can do namespace
@@ -204,7 +204,7 @@ const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongd
204
204
  const text = freeze(['#text']);
205
205
 
206
206
  const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
207
- const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
207
+ const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
208
208
  const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
209
209
  const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
210
210
 
@@ -302,7 +302,7 @@ const _createHooksMap = function _createHooksMap() {
302
302
  function createDOMPurify() {
303
303
  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
304
304
  const DOMPurify = root => createDOMPurify(root);
305
- DOMPurify.version = '3.2.7';
305
+ DOMPurify.version = '3.3.0';
306
306
  DOMPurify.removed = [];
307
307
  if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
308
308
  // Not running in a browser, provide a factory function
@@ -413,6 +413,21 @@ function createDOMPurify() {
413
413
  let FORBID_TAGS = null;
414
414
  /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
415
415
  let FORBID_ATTR = null;
416
+ /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
417
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
418
+ tagCheck: {
419
+ writable: true,
420
+ configurable: false,
421
+ enumerable: true,
422
+ value: null
423
+ },
424
+ attributeCheck: {
425
+ writable: true,
426
+ configurable: false,
427
+ enumerable: true,
428
+ value: null
429
+ }
430
+ }));
416
431
  /* Decide if ARIA attributes are okay */
417
432
  let ALLOW_ARIA_ATTR = true;
418
433
  /* Decide if custom data attributes are okay */
@@ -605,16 +620,24 @@ function createDOMPurify() {
605
620
  }
606
621
  /* Merge configuration parameters */
607
622
  if (cfg.ADD_TAGS) {
608
- if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
609
- ALLOWED_TAGS = clone(ALLOWED_TAGS);
623
+ if (typeof cfg.ADD_TAGS === 'function') {
624
+ EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
625
+ } else {
626
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
627
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
628
+ }
629
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
610
630
  }
611
- addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
612
631
  }
613
632
  if (cfg.ADD_ATTR) {
614
- if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
615
- ALLOWED_ATTR = clone(ALLOWED_ATTR);
633
+ if (typeof cfg.ADD_ATTR === 'function') {
634
+ EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
635
+ } else {
636
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
637
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
638
+ }
639
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
616
640
  }
617
- addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
618
641
  }
619
642
  if (cfg.ADD_URI_SAFE_ATTR) {
620
643
  addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
@@ -922,7 +945,7 @@ function createDOMPurify() {
922
945
  return true;
923
946
  }
924
947
  /* Remove element if anything forbids its presence */
925
- if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
948
+ if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
926
949
  /* Check if we have a custom element to handle */
927
950
  if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
928
951
  if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
@@ -994,7 +1017,7 @@ function createDOMPurify() {
994
1017
  (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
995
1018
  XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
996
1019
  We don't need to check the value; it's always URI safe. */
997
- if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
1020
+ if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
998
1021
  if (
999
1022
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
1000
1023
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
package/dist/index.d.ts CHANGED
@@ -93,9 +93,9 @@ export type { HUIThemes, HUserTheme } from './themes';
93
93
  export { default as Toggle } from './toggle';
94
94
  export type { ToggleProps } from './toggle';
95
95
  export { default as Tooltip } from './tooltip';
96
- export { default as Notetip } from './notetip';
96
+ export { default as Notetip } from './notetip/note-tip';
97
97
  export type { TooltipProps } from './tooltip';
98
- export type { NotetipProps } from './notetip';
98
+ export type { NotetipProps } from './notetip/note-tip';
99
99
  export { default as Tree } from './tree';
100
100
  export type { TreeProps } from './tree';
101
101
  export { useTime, useTimer, useStopwatch } from './timer';
@@ -129,3 +129,4 @@ export { default as CurrencyInput } from './currency-input';
129
129
  export type { CurrencyInputProps, CurrencyInputOnChangeValues } from './currency-input';
130
130
  export { default as useToasts } from './use-toasts';
131
131
  export type { Toast, ToastInput, ToastAction, ToastLayout } from './use-toasts';
132
+ export { default as Clipboard } from './copy-to-clipboard';