@descope/web-components-ui 1.0.295 → 1.0.297

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. package/dist/cjs/index.cjs.js +586 -359
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +2 -1
  4. package/dist/index.esm.js +569 -341
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/1224.js +1 -1
  7. package/dist/umd/1438.js +16 -9
  8. package/dist/umd/1438.js.LICENSE.txt +12 -0
  9. package/dist/umd/1612.js +338 -0
  10. package/dist/umd/1621.js +2 -2
  11. package/dist/umd/2362.js +129 -0
  12. package/dist/umd/3830.js +2 -0
  13. package/dist/umd/{3003.js.LICENSE.txt → 3830.js.LICENSE.txt} +12 -0
  14. package/dist/umd/3951.js +116 -4
  15. package/dist/umd/3951.js.LICENSE.txt +18 -0
  16. package/dist/umd/{9211.js → 4024.js} +5 -5
  17. package/dist/umd/{2775.js → 4028.js} +10 -10
  18. package/dist/umd/4028.js.LICENSE.txt +23 -0
  19. package/dist/umd/4052.js +338 -0
  20. package/dist/umd/4392.js +1 -0
  21. package/dist/umd/4569.js +1 -0
  22. package/dist/umd/4746.js +124 -0
  23. package/dist/umd/{6091.js.LICENSE.txt → 4746.js.LICENSE.txt} +6 -0
  24. package/dist/umd/4978.js +1 -0
  25. package/dist/umd/{4595.js → 5135.js} +93 -5
  26. package/dist/umd/{2775.js.LICENSE.txt → 5135.js.LICENSE.txt} +2 -2
  27. package/dist/umd/5517.js +1 -1
  28. package/dist/umd/5806.js +4 -4
  29. package/dist/umd/5910.js +1 -1
  30. package/dist/umd/63.js +147 -1
  31. package/dist/umd/63.js.LICENSE.txt +13 -1
  32. package/dist/umd/6594.js +2 -0
  33. package/dist/umd/{1940.js.LICENSE.txt → 6594.js.LICENSE.txt} +1 -1
  34. package/dist/umd/6770.js +4 -4
  35. package/dist/umd/7056.js +376 -5
  36. package/dist/umd/7056.js.LICENSE.txt +6 -0
  37. package/dist/umd/7164.js +148 -0
  38. package/dist/umd/{2106.js.LICENSE.txt → 7164.js.LICENSE.txt} +1 -7
  39. package/dist/umd/7531.js +2 -2
  40. package/dist/umd/7911.js +4 -4
  41. package/dist/umd/7911.js.LICENSE.txt +6 -0
  42. package/dist/umd/{3092.js → 8191.js} +40 -5
  43. package/dist/umd/8866.js +97 -5
  44. package/dist/umd/8866.js.LICENSE.txt +12 -0
  45. package/dist/umd/9092.js +440 -12
  46. package/dist/umd/9092.js.LICENSE.txt +6 -0
  47. package/dist/umd/{1940.js → 9314.js} +126 -7
  48. package/dist/umd/9314.js.LICENSE.txt +11 -0
  49. package/dist/umd/9423.js +608 -0
  50. package/dist/umd/9423.js.LICENSE.txt +23 -0
  51. package/dist/umd/9562.js +338 -0
  52. package/dist/umd/9562.js.LICENSE.txt +11 -0
  53. package/dist/umd/DescopeDev.js +1 -0
  54. package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +1 -1
  55. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +2 -1
  56. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +2 -1
  57. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
  58. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js +1 -1
  59. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
  60. package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js +1 -1
  61. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  62. package/dist/umd/descope-avatar-index-js.js +1 -1
  63. package/dist/umd/descope-badge-index-js.js +1 -1
  64. package/dist/umd/descope-button-index-js.js +338 -1
  65. package/dist/umd/descope-button-index-js.js.LICENSE.txt +11 -0
  66. package/dist/umd/descope-combo-box-index-js.js +113 -1
  67. package/dist/umd/descope-container-index-js.js +1 -1
  68. package/dist/umd/descope-date-picker-index-js.js +1 -1
  69. package/dist/umd/descope-divider-index-js.js +1 -1
  70. package/dist/umd/descope-email-field-index-js.js +54 -1
  71. package/dist/umd/descope-email-field-index-js.js.LICENSE.txt +11 -0
  72. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +90 -1
  73. package/dist/umd/{1735.js.LICENSE.txt → descope-grid-descope-grid-custom-column-index-js.js.LICENSE.txt} +2 -2
  74. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +2 -1
  75. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.LICENSE.txt +17 -0
  76. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +90 -1
  77. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js.LICENSE.txt +17 -0
  78. package/dist/umd/descope-grid-index-js.js +1 -1
  79. package/dist/umd/descope-image-index-js.js +1 -1
  80. package/dist/umd/descope-link-index-js.js +1 -1
  81. package/dist/umd/descope-loader-linear-index-js.js +1 -1
  82. package/dist/umd/descope-loader-radial-index-js.js +1 -1
  83. package/dist/umd/descope-logo-index-js.js +1 -1
  84. package/dist/umd/descope-modal-index-js.js +1 -1
  85. package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
  86. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  87. package/dist/umd/descope-new-password-index-js.js +1 -1
  88. package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -1
  89. package/dist/umd/descope-notification-index-js.js +1 -1
  90. package/dist/umd/descope-notp-image-index-js.js +1 -1
  91. package/dist/umd/descope-number-field-index-js.js +1 -1
  92. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  93. package/dist/umd/descope-passcode-index-js.js +37 -1
  94. package/dist/umd/descope-passcode-index-js.js.LICENSE.txt +11 -0
  95. package/dist/umd/descope-password-index-js.js +1 -1
  96. package/dist/umd/descope-policy-validation-index-js.js +1 -1
  97. package/dist/umd/descope-recaptcha-index-js.js +1 -1
  98. package/dist/umd/descope-text-area-index-js.js +1 -1
  99. package/dist/umd/descope-text-field-index-js.js +37 -1
  100. package/dist/umd/descope-text-field-index-js.js.LICENSE.txt +11 -0
  101. package/dist/umd/descope-totp-image-index-js.js +1 -1
  102. package/dist/umd/descope-upload-file-index-js.js +1 -1
  103. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  104. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  105. package/dist/umd/index.js +1 -1
  106. package/dist/umd/mapping-fields-descope-mappings-field-descope-mapping-item-index-js.js +1 -1
  107. package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js +1 -1
  108. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -126
  109. package/dist/umd/mapping-fields-descope-saml-group-mappings-descope-saml-group-mappings-internal-index-js.js +1 -1
  110. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  111. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  112. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  113. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +37 -1
  114. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.LICENSE.txt +11 -0
  115. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  116. package/dist/umd/text-components-descope-markdown-content-index-js.js +1 -0
  117. package/dist/umd/text-components-descope-text-index-js.js +1 -0
  118. package/package.json +4 -2
  119. package/src/components/descope-divider/DividerClass.js +1 -1
  120. package/src/components/descope-divider/index.js +1 -1
  121. package/src/components/descope-link/LinkClass.js +1 -1
  122. package/src/components/descope-link/index.js +1 -1
  123. package/src/components/descope-user-attribute/UserAttributeClass.js +1 -1
  124. package/src/components/descope-user-attribute/index.js +1 -1
  125. package/src/components/descope-user-auth-method/UserAuthMethodClass.js +3 -2
  126. package/src/components/descope-user-auth-method/index.js +1 -1
  127. package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +1 -1
  128. package/src/components/mapping-fields/descope-mappings-field/index.js +1 -1
  129. package/src/components/text-components/createBaseTextClass.js +26 -0
  130. package/src/components/text-components/descope-markdown-content/MarkdownContentClass.js +98 -0
  131. package/src/components/text-components/descope-markdown-content/helpers.js +41 -0
  132. package/src/components/text-components/descope-markdown-content/index.js +5 -0
  133. package/src/components/text-components/descope-text/TextClass.js +34 -0
  134. package/src/components/text-components/hideWhenEmptyMixin.js +17 -0
  135. package/src/dev/index.js +1 -0
  136. package/src/index.cjs.js +2 -1
  137. package/src/index.d.ts +2 -1
  138. package/src/index.js +2 -1
  139. package/src/mixins/normalizeBooleanAttributesMixin.js +1 -1
  140. package/src/theme/components/index.js +2 -0
  141. package/src/theme/components/markdownContent.js +84 -0
  142. package/src/theme/components/text.js +1 -1
  143. package/dist/umd/1000.js +0 -1
  144. package/dist/umd/1037.js +0 -2
  145. package/dist/umd/1721.js +0 -1
  146. package/dist/umd/1735.js +0 -73
  147. package/dist/umd/2066.js +0 -2
  148. package/dist/umd/2106.js +0 -73
  149. package/dist/umd/2269.js +0 -2
  150. package/dist/umd/2269.js.LICENSE.txt +0 -5
  151. package/dist/umd/2481.js +0 -1
  152. package/dist/umd/262.js +0 -2
  153. package/dist/umd/262.js.LICENSE.txt +0 -5
  154. package/dist/umd/3003.js +0 -2
  155. package/dist/umd/3208.js +0 -2
  156. package/dist/umd/3208.js.LICENSE.txt +0 -5
  157. package/dist/umd/322.js +0 -90
  158. package/dist/umd/322.js.LICENSE.txt +0 -5
  159. package/dist/umd/3249.js +0 -2
  160. package/dist/umd/3249.js.LICENSE.txt +0 -5
  161. package/dist/umd/3373.js +0 -2
  162. package/dist/umd/3373.js.LICENSE.txt +0 -5
  163. package/dist/umd/3585.js +0 -1
  164. package/dist/umd/3878.js +0 -1
  165. package/dist/umd/4201.js +0 -1
  166. package/dist/umd/422.js +0 -2
  167. package/dist/umd/422.js.LICENSE.txt +0 -5
  168. package/dist/umd/4226.js +0 -114
  169. package/dist/umd/4447.js +0 -1
  170. package/dist/umd/4567.js +0 -1
  171. package/dist/umd/4577.js +0 -1
  172. package/dist/umd/4595.js.LICENSE.txt +0 -11
  173. package/dist/umd/4803.js +0 -1
  174. package/dist/umd/4905.js +0 -2
  175. package/dist/umd/4905.js.LICENSE.txt +0 -5
  176. package/dist/umd/4946.js +0 -2
  177. package/dist/umd/4946.js.LICENSE.txt +0 -5
  178. package/dist/umd/6091.js +0 -124
  179. package/dist/umd/6606.js +0 -17
  180. package/dist/umd/6687.js +0 -9
  181. package/dist/umd/6687.js.LICENSE.txt +0 -5
  182. package/dist/umd/6977.js +0 -2
  183. package/dist/umd/6977.js.LICENSE.txt +0 -5
  184. package/dist/umd/7044.js +0 -1
  185. package/dist/umd/7583.js +0 -113
  186. package/dist/umd/8623.js +0 -2
  187. package/dist/umd/8623.js.LICENSE.txt +0 -5
  188. package/dist/umd/8725.js +0 -37
  189. package/dist/umd/9189.js +0 -2
  190. package/dist/umd/9189.js.LICENSE.txt +0 -5
  191. package/dist/umd/9211.js.LICENSE.txt +0 -5
  192. package/dist/umd/9214.js +0 -1
  193. package/dist/umd/9320.js +0 -2
  194. package/dist/umd/9320.js.LICENSE.txt +0 -5
  195. package/dist/umd/9383.js +0 -94
  196. package/dist/umd/9434.js +0 -1
  197. package/dist/umd/9437.js +0 -19
  198. package/dist/umd/9437.js.LICENSE.txt +0 -5
  199. package/dist/umd/9680.js +0 -2
  200. package/dist/umd/9680.js.LICENSE.txt +0 -5
  201. package/dist/umd/9789.js +0 -1
  202. package/dist/umd/descope-text-index-js.js +0 -1
  203. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.LICENSE.txt +0 -5
  204. package/src/components/descope-text/TextClass.js +0 -67
  205. /package/dist/umd/{3092.js.LICENSE.txt → 1612.js.LICENSE.txt} +0 -0
  206. /package/dist/umd/{6606.js.LICENSE.txt → 2362.js.LICENSE.txt} +0 -0
  207. /package/dist/umd/{4226.js.LICENSE.txt → 4024.js.LICENSE.txt} +0 -0
  208. /package/dist/umd/{8725.js.LICENSE.txt → 4052.js.LICENSE.txt} +0 -0
  209. /package/dist/umd/{9383.js.LICENSE.txt → 8191.js.LICENSE.txt} +0 -0
  210. /package/dist/umd/{1037.js.LICENSE.txt → boolean-fields-descope-checkbox-index-js.js.LICENSE.txt} +0 -0
  211. /package/dist/umd/{2066.js.LICENSE.txt → boolean-fields-descope-switch-toggle-index-js.js.LICENSE.txt} +0 -0
  212. /package/dist/umd/{7583.js.LICENSE.txt → descope-combo-box-index-js.js.LICENSE.txt} +0 -0
  213. /package/src/components/{descope-text → text-components/descope-text}/index.js +0 -0
@@ -0,0 +1,98 @@
1
+ import markdownit from 'markdown-it';
2
+ import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../../mixins';
3
+ import { compose } from '../../../helpers';
4
+ import { getComponentName } from '../../../helpers/componentHelpers';
5
+ import { hideWhenEmptyMixin } from '../hideWhenEmptyMixin';
6
+ import { createBaseTextClass } from '../createBaseTextClass';
7
+ import { enrichTokens, onClipboardCopy } from './helpers';
8
+
9
+ export const componentName = getComponentName('markdown-content');
10
+
11
+ const BaseMarkdownContentClass = createBaseTextClass(componentName);
12
+
13
+ const markdownContentMixin = (superclass) =>
14
+ class MarkdownContentMixinClass extends superclass {
15
+ static get observedAttributes() {
16
+ return ['disabled-rules', 'line-break'];
17
+ }
18
+
19
+ get lineBreak() {
20
+ return this.getAttribute('line-break');
21
+ }
22
+
23
+ get disabledRules() {
24
+ return (this.getAttribute('disabled-rules') || '').split(',').filter(Boolean);
25
+ }
26
+
27
+ init() {
28
+ super.init();
29
+ this.#initMarkdown();
30
+ this.textSlot.addEventListener('slotchange', this.#parseChildren.bind(this));
31
+ }
32
+
33
+ attributeChangedCallback(attrName, oldValue, newValue) {
34
+ super.attributeChangedCallback?.(attrName, oldValue, newValue);
35
+
36
+ if (attrName === 'disabled-rules') {
37
+ if (newValue !== oldValue) {
38
+ this.#initMarkdown(newValue);
39
+ this.#parseChildren();
40
+ }
41
+ }
42
+ }
43
+
44
+ #initMarkdown() {
45
+ this.markdown = markdownit({ breaks: this.lineBreak }).disable(this.disabledRules);
46
+ }
47
+
48
+ #parseChildren() {
49
+ const node = this.textSlot.assignedNodes({ flatten: true })?.[0];
50
+
51
+ if (node && node.nodeType === Node.TEXT_NODE) {
52
+ const tokens = this.markdown.parse(node.textContent, { references: undefined });
53
+ const result = this.markdown.renderer.render(enrichTokens(tokens), {
54
+ breaks: this.lineBreak,
55
+ });
56
+
57
+ if (result !== node.textContent) {
58
+ const span = document.createElement('div');
59
+ span.classList.add('markdown-wrapper');
60
+ // eslint-disable-next-line no-use-before-define
61
+ span.innerHTML = `${getStyleReset()}${result}`;
62
+ span.addEventListener('copy', onClipboardCopy);
63
+ node.parentNode.replaceChild(span, node);
64
+ }
65
+ }
66
+ }
67
+ };
68
+
69
+ export const MarkdownContentClass = compose(
70
+ createStyleMixin({
71
+ mappings: {
72
+ hostWidth: { selector: () => ':host', property: 'width' },
73
+ hostDirection: { selector: () => ':host', property: 'direction' },
74
+ fontSize: {},
75
+ fontFamily: {},
76
+ fontWeight: {},
77
+ textColor: { property: 'color' },
78
+ textLineHeight: { property: 'line-height' },
79
+ marginReset: { selector: '*', property: 'margin' },
80
+ textAlign: {},
81
+ },
82
+ }),
83
+ draggableMixin,
84
+ componentNameValidationMixin,
85
+ markdownContentMixin,
86
+ hideWhenEmptyMixin
87
+ )(BaseMarkdownContentClass);
88
+
89
+ function getStyleReset() {
90
+ return `
91
+ <style>
92
+ .markdown-wrapper > * { margin:0 }
93
+ .markdown-wrapper > *:not(:only-child):not(:last-child) {
94
+ margin-bottom: var(${MarkdownContentClass.cssVarList.textLineHeight})
95
+ }
96
+ </style>
97
+ `;
98
+ }
@@ -0,0 +1,41 @@
1
+ const customEleMap = {
2
+ a: 'descope-link',
3
+ };
4
+
5
+ const getTokenTag = (token) => customEleMap[token.tag] || token.tag;
6
+
7
+ const isImageToken = (token) => token?.children?.[0].type === 'image';
8
+
9
+ export const enrichTokens = (tokens) =>
10
+ tokens.map((token) => {
11
+ const tag = getTokenTag(token);
12
+
13
+ if (isImageToken(token)) {
14
+ token.children[0].attrs.push(['style', 'width:100%']);
15
+ return {
16
+ ...token,
17
+ tag,
18
+ };
19
+ }
20
+
21
+ if (token?.children?.length > 0) {
22
+ return {
23
+ ...token,
24
+ tag,
25
+ children: enrichTokens(token.children),
26
+ };
27
+ }
28
+
29
+ return {
30
+ ...token,
31
+ tag,
32
+ };
33
+ });
34
+
35
+ export const onClipboardCopy = (e) => {
36
+ const selection = document.getSelection().toString();
37
+ const clipdata = e.clipboardData || window.clipboardData;
38
+ clipdata.setData('text/plain', selection);
39
+ clipdata.setData('text/html', selection);
40
+ e.preventDefault();
41
+ };
@@ -0,0 +1,5 @@
1
+ import { componentName, MarkdownContentClass } from './MarkdownContentClass';
2
+
3
+ customElements.define(componentName, MarkdownContentClass);
4
+
5
+ export { MarkdownContentClass };
@@ -0,0 +1,34 @@
1
+ import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../../mixins';
2
+ import { compose } from '../../../helpers';
3
+ import { getComponentName } from '../../../helpers/componentHelpers';
4
+ import { hideWhenEmptyMixin } from '../hideWhenEmptyMixin';
5
+ import { createBaseTextClass } from '../createBaseTextClass';
6
+
7
+ export const componentName = getComponentName('text');
8
+
9
+ const BaseTextClass = createBaseTextClass(componentName);
10
+
11
+ export const TextClass = compose(
12
+ createStyleMixin({
13
+ mappings: {
14
+ hostWidth: { selector: () => ':host', property: 'width' },
15
+ hostDirection: { selector: () => ':host', property: 'direction' },
16
+ fontSize: {},
17
+ textColor: { property: 'color' },
18
+ textLineHeight: { property: 'line-height' },
19
+ textLetterSpacing: { property: 'letter-spacing' },
20
+ textShadow: {},
21
+ textAlign: {},
22
+ textTransform: {},
23
+ fontFamily: {},
24
+ fontStyle: {},
25
+ fontWeight: {},
26
+ borderWidth: {},
27
+ borderStyle: {},
28
+ borderColor: {},
29
+ },
30
+ }),
31
+ draggableMixin,
32
+ componentNameValidationMixin,
33
+ hideWhenEmptyMixin
34
+ )(BaseTextClass);
@@ -0,0 +1,17 @@
1
+ import { observeChildren } from '../../helpers/componentHelpers';
2
+
3
+ export const hideWhenEmptyMixin = (superclass) =>
4
+ class HideWhenEmptyMixinClass extends superclass {
5
+ get hideWhenEmpty() {
6
+ return this.getAttribute('hide-when-empty') === 'true';
7
+ }
8
+
9
+ init() {
10
+ super.init();
11
+
12
+ observeChildren(this, () => {
13
+ const hasChildren = !!this.childNodes.length;
14
+ this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';
15
+ });
16
+ }
17
+ };
package/src/dev/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { defaultTheme } from '../theme';
2
+ export { default as darkTheme } from '../darkTheme';
2
3
  export { themeToStyle } from '../helpers/themeHelpers';
package/src/index.cjs.js CHANGED
@@ -20,7 +20,8 @@ export { NotpImageClass } from './components/descope-notp-image/NotpImageClass';
20
20
  export { NumberFieldClass } from './components/descope-number-field/NumberFieldClass';
21
21
  export { PasscodeClass } from './components/descope-passcode/PasscodeClass';
22
22
  export { PasswordClass } from './components/descope-password/PasswordClass';
23
- export { TextClass } from './components/descope-text/TextClass';
23
+ export { TextClass } from './components/text-components/descope-text/TextClass';
24
+ export { MarkdownContentClass } from './components/text-components/descope-markdown-content/MarkdownContentClass';
24
25
  export { TextAreaClass } from './components/descope-text-area/TextAreaClass';
25
26
  export { TextFieldClass } from './components/descope-text-field/TextFieldClass';
26
27
  export { ImageClass } from './components/descope-image/ImageClass';
package/src/index.d.ts CHANGED
@@ -24,7 +24,8 @@ export { NotpImageClass } from './components/descope-notp-image';
24
24
  export { NumberFieldClass } from './components/descope-number-field';
25
25
  export { PasscodeClass } from './components/descope-passcode';
26
26
  export { PasswordClass } from './components/descope-password';
27
- export { TextClass } from './components/descope-text';
27
+ export { TextClass } from './components/text-components/descope-text';
28
+ export { MarkdownContentClass } from './components/text-components/descope-markdown-content';
28
29
  export { TextAreaClass } from './components/descope-text-area';
29
30
  export { TextFieldClass } from './components/descope-text-field';
30
31
  export { ImageClass } from './components/descope-image';
package/src/index.js CHANGED
@@ -14,7 +14,8 @@ export * from './components/descope-notp-image';
14
14
  export * from './components/descope-number-field';
15
15
  export * from './components/descope-passcode';
16
16
  export * from './components/descope-password';
17
- export * from './components/descope-text';
17
+ export * from './components/text-components/descope-text';
18
+ export * from './components/text-components/descope-markdown-content';
18
19
  export * from './components/descope-text-area';
19
20
  export * from './components/descope-text-field';
20
21
  export * from './components/descope-image';
@@ -46,7 +46,7 @@ export const normalizeBooleanAttributesMixin = (superclass) =>
46
46
  }
47
47
  } else if (!attrVal) {
48
48
  // eslint-disable-next-line no-console
49
- console.warn(
49
+ console.debug(
50
50
  `attribute "${attr}" has no value, should it be added to the boolean attributes list?`
51
51
  );
52
52
  }
@@ -11,6 +11,7 @@ import * as logo from './logo';
11
11
  import * as totpImage from './totpImage';
12
12
  import * as notpImage from './notpImage';
13
13
  import * as text from './text';
14
+ import * as markdownContent from './markdownContent';
14
15
  import * as link from './link';
15
16
  import * as divider from './divider';
16
17
  import * as passcode from './passcode';
@@ -51,6 +52,7 @@ const components = {
51
52
  totpImage,
52
53
  notpImage,
53
54
  text,
55
+ markdownContent,
54
56
  link,
55
57
  divider,
56
58
  passcode,
@@ -0,0 +1,84 @@
1
+ import globals from '../globals';
2
+ import { getThemeRefs } from '../../helpers/themeHelpers';
3
+ import { MarkdownContentClass } from '../../components/text-components/descope-markdown-content/MarkdownContentClass';
4
+
5
+ const globalRefs = getThemeRefs(globals);
6
+ const vars = MarkdownContentClass.cssVarList;
7
+
8
+ const markdownContent = {
9
+ [vars.hostDirection]: globalRefs.direction,
10
+
11
+ [vars.fontSize]: globalRefs.typography.body1.size,
12
+ [vars.fontWeight]: globalRefs.typography.body1.weight,
13
+ [vars.fontFamily]: globalRefs.typography.body1.font,
14
+
15
+ [vars.textLineHeight]: '1.35em',
16
+ [vars.textAlign]: 'left',
17
+ [vars.textColor]: globalRefs.colors.surface.dark,
18
+
19
+ mode: {
20
+ primary: {
21
+ [vars.textColor]: globalRefs.colors.surface.contrast,
22
+ },
23
+ secondary: {
24
+ [vars.textColor]: globalRefs.colors.surface.dark,
25
+ },
26
+ error: {
27
+ [vars.textColor]: globalRefs.colors.error.main,
28
+ },
29
+ success: {
30
+ [vars.textColor]: globalRefs.colors.success.main,
31
+ },
32
+ },
33
+
34
+ variant: {
35
+ h1: {
36
+ [vars.fontSize]: globalRefs.typography.h1.size,
37
+ [vars.fontWeight]: globalRefs.typography.h1.weight,
38
+ [vars.fontFamily]: globalRefs.typography.h1.font,
39
+ },
40
+ h2: {
41
+ [vars.fontSize]: globalRefs.typography.h2.size,
42
+ [vars.fontWeight]: globalRefs.typography.h2.weight,
43
+ [vars.fontFamily]: globalRefs.typography.h2.font,
44
+ },
45
+ h3: {
46
+ [vars.fontSize]: globalRefs.typography.h3.size,
47
+ [vars.fontWeight]: globalRefs.typography.h3.weight,
48
+ [vars.fontFamily]: globalRefs.typography.h3.font,
49
+ },
50
+ subtitle1: {
51
+ [vars.fontSize]: globalRefs.typography.subtitle1.size,
52
+ [vars.fontWeight]: globalRefs.typography.subtitle1.weight,
53
+ [vars.fontFamily]: globalRefs.typography.subtitle1.font,
54
+ },
55
+ subtitle2: {
56
+ [vars.fontSize]: globalRefs.typography.subtitle2.size,
57
+ [vars.fontWeight]: globalRefs.typography.subtitle2.weight,
58
+ [vars.fontFamily]: globalRefs.typography.subtitle2.font,
59
+ },
60
+ body1: {
61
+ [vars.fontSize]: globalRefs.typography.body1.size,
62
+ [vars.fontWeight]: globalRefs.typography.body1.weight,
63
+ [vars.fontFamily]: globalRefs.typography.body1.font,
64
+ },
65
+ body2: {
66
+ [vars.fontSize]: globalRefs.typography.body2.size,
67
+ [vars.fontWeight]: globalRefs.typography.body2.weight,
68
+ [vars.fontFamily]: globalRefs.typography.body2.font,
69
+ },
70
+ },
71
+
72
+ textAlign: {
73
+ right: { [vars.textAlign]: 'right' },
74
+ left: { [vars.textAlign]: 'left' },
75
+ center: { [vars.textAlign]: 'center' },
76
+ },
77
+
78
+ _fullWidth: {
79
+ [vars.hostWidth]: '100%',
80
+ },
81
+ };
82
+
83
+ export default markdownContent;
84
+ export { vars };
@@ -1,6 +1,6 @@
1
1
  import globals from '../globals';
2
2
  import { getThemeRefs } from '../../helpers/themeHelpers';
3
- import { TextClass } from '../../components/descope-text/TextClass';
3
+ import { TextClass } from '../../components/text-components/descope-text/TextClass';
4
4
 
5
5
  const globalRefs = getThemeRefs(globals);
6
6
  const vars = TextClass.cssVarList;
package/dist/umd/1000.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[1e3],{2561:(t,e,s)=>{s.d(e,{s:()=>h});var i=s(2061),n=s(357),r=s(7878);const a=t=>class extends t{#t=r.C.bind(this,"components-context");updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}};var o=s(2666),l=s(8084);const h=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#e;#s=!0;get baseSelector(){return e}get baseElement(){return this.#e??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#e||console.warn("missing base element for component",this.localName),this.#e}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#s&&(this.#s=!1,this.init?.())}}return(0,i.qC)(n.A,o._,l.Q,a)(s)}},7878:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{C:()=>i})},357:(t,e,s)=>{s.d(e,{A:()=>i});const i=t=>class extends t{#i(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#i()}}},2666:(t,e,s)=>{s.d(e,{_:()=>i});const i=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}}},1e3:(t,e,s)=>{s.d(e,{li:()=>M,Ae:()=>f.A,DM:()=>m,yk:()=>h,e4:()=>u,_A:()=>A._,mE:()=>x,wX:()=>g,QT:()=>w.Q,Iw:()=>C,dj:()=>y});var i=s(5279),n=s(2061),r=s(4567),a=s(5561);class o{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>`${t}${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const l=(t,e)=>Object.keys(e).reduce(((e,s)=>Object.assign(e,{[s]:(0,r.Tk)(t,s)})),{}),h=({mappings:t={},componentNameOverride:e=""})=>s=>{const h=e||s.componentName;return class extends s{static get cssVarList(){return{...s.cssVarList,...l(h,{...t})}}#n;#r;#a;#o;#l;#h;#u;#c;#d;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#o=s,this.#l=r,this.#u=a??this.baseSelector,this.#d=e,this.#c=Object.keys(t).map((t=>(0,n.E3)("st",s,t)))}get#m(){return a.componentsThemeManager.currentTheme?.[h]||""}#p(){this.#r.innerHTML=this.#m[this.#l]}#g(){this.#r=document.createElement("style"),this.#r.id=`style-mixin-theme__${h}`,this.#h.prepend(this.#r),this.#a=a.componentsThemeManager.onCurrentThemeChange(this.#p.bind(this)),this.#p()}#b(){if(this.#c.length){this.#n=document.createElement("style"),this.#n.id=`style-mixin-overrides__${h}`;const s=(t=h,e=i.k4,Array(e).fill(`.${t}`).join(""));this.#n.innerText=`:host(${s}) {}`,this.#h.append(this.#n)}var t,e}#E(t,e){const s=this.#n?.sheet?.cssRules[0].style;if(!s)return;const i=(0,r.Tk)(h,t.replace(new RegExp("^st-"),""));e?s?.setProperty(i,e):(s?.removeProperty(i),this.removeAttribute(t))}#v(t=[]){let e=!1;t.forEach((t=>{this.#c.includes(t)&&(this.#E(t,this.getAttribute(t)),e=!0)})),e&&(this.#n.innerHTML=this.#n?.sheet?.cssRules[0].cssText)}#y(){if(Object.keys(t).length){const e=document.createElement("style");e.id=`style-mixin-mappings__${h}`,e.innerHTML=((t,e,s)=>{const i=new o;return Object.keys(s).forEach((a=>{const o=((t,e)=>{const s={selector:"",property:(0,n.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...s,...t}))):[{...s,...e}]:[s]})(a,s[a]),l=(0,r.Tk)(t,a);o.forEach((({selector:t,property:s,important:r,fallback:a})=>{i.add(((t="",e="")=>(0,n.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,n.mf)(s)?s():s,((t,e)=>`var(${t}${e?`, ${e}`:""})`)(l,a)+(r?"!important":""))}))})),i.toString()})((0,n.E3)(h,this.#o),this.#u,t),this.#h.prepend(e)}}#f(t){(this.#h.classList||this.#h.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#h=await(this.#d?.(this))||this.shadowRoot,this.#f(h),this.#y(),this.#g(),this.#b(),(0,r.FX)(this,this.#v.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#a?.()}}},u=t=>class extends t{#A=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#A=document.createElement("style"),this.#A.innerText="* { cursor: inherit!important }"}#S(t){t?this.shadowRoot.appendChild(this.#A):this.#A.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#S("true"===s)}};var c=s(2561),d=s(7878);const m=({componentName:t,wrappedEleName:e,slots:s=[],style:i,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[],delegatesFocus:h=!0})=>{class u extends((0,c.s)({componentName:t,baseSelector:e})){#C=d.C.bind(this,"blur");#M=d.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:h}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,n.mf)(i)?i():i}</style>\n\t\t\t<${e}>\n\t\t\t${s.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""} ></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#C()})),this.baseElement.addEventListener("focus",(t=>{this.#M()})),(0,r.Db)(this.baseElement,this,l),(0,r.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return u};s(5910);const p=["required","pattern"],g=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...p]}static get formAssociated(){return!0}#w;get internals(){return this.#w}set internals(t){this.#w=t}constructor(){super(),this.#w=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}getErrorMessage(t){const{valueMissing:e,patternMismatch:s,typeMismatch:i,stepMismatch:n,tooShort:r,tooLong:a,rangeOverflow:o,rangeUnderflow:l,badInput:h,customError:u}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case s||i||n||h:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case r:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case l:return this.defaultErrorMsgRangeUnderflow;case o:return this.defaultErrorMsgRangeOverflow;case u:return this.validationMessage;default:return""}}#x(){const t=this.isReadOnly?{}:this.getValidity();this.#w.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#w.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#w.validity.valid}reportValidity(){return this.#w.reportValidity()}get validity(){return this.#w.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#w.setValidity({customError:!0},t,this.validationTarget):(this.#w.setValidity({}),this.#x())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#w.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),p.includes(t)&&this.#x()}init(){super.init?.(),this.addEventListener("change",this.#x),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#x),setTimeout((()=>this.#x()))}},b=["invalid","required"],E=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e.localName)return e},v=({proxyProps:t=[],inputEvent:e="input",triggerValidationEvents:s=[],proxyParentValidation:i=!1})=>n=>class extends(g(n)){static get observedAttributes(){return[...n.observedAttributes||[],...b]}#T;#L=d.C.bind(this,"change");constructor(){super(),this.#T=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#T&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#T)return this.#T;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#T=E(t)||E(e),this.#T}set inputElement(t){this.#T=t}getValidity(){return this.inputElement?.validity||{}}#V(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#V(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},s.forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.inputElement?.setCustomValidity("")}))})),setTimeout((()=>{(Array.isArray(e)?e:[e]).forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#V()}))})),this.baseElement.addEventListener("change",(()=>{this.#L()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#V()})),t.forEach((t=>{var e,s;e=this.inputElement,s=t,Object.defineProperty(this,s,{set(t){e[s]=t},get:()=>e[s],configurable:!0})})),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,r.oP)(this,this.inputElement,{includeAttrs:["inputmode"]})})),i){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,s)=>"function"==typeof t[s]&&"setValidity"===s?(...i)=>{if(3===i.length){const t=i.slice(0,i.length-1);t.push(e.inputElement),e.internals[s](...t)}else e.internals[s](...i);return t[s](...i)}:"function"==typeof t[s]?(...i)=>(e.internals[s](...i),t[s](...i)):t[s]})}}},y=t=>(0,n.qC)(v(t),h({componentNameOverride:(0,r.iY)("input-wrapper")}));var f=s(357),A=s(2666);const S=t=>async e=>{const s=await t(e);return new Promise((t=>{let e=0;const i=()=>{if(e>20)return console.error("could not get shadow root for element",s),void t(s);e++,s?.shadowRoot?t(s.shadowRoot):setTimeout(i)};i()}))},C=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>u=>{const c=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=h({mappings:s})(u);return class extends d{static get cssVarList(){return{...d.cssVarList,[c]:l((0,n.E3)(u.componentName,"_"+c),s)}}#k;constructor(){const t=S((async t=>{const s=t.shadowRoot.querySelector(t.baseSelector);return e?(await S((()=>s))(t)).querySelector(e):s}));super({getRootElement:t,componentNameSuffix:"_"+c,themeSection:i.qM+c,baseSelector:":host"}),this.#k=t(this).then((t=>t.host))}async#$(){const t=await this.#k;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#k;(0,r.oP)(this,t,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#$()}}},M=t=>class extends t{#L=d.C.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#L(),this.prevValue=this.value)}))}};var w=s(8084);const x=t=>class extends t{init(){this.#N(),super.init?.()}#N(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,d.C.call(this,"blur"),d.C.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(d.C.call(this,"focus"),d.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,s)=>{s.d(e,{Q:()=>r});var i=s(4567);const n=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options"],r=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>n.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.warn(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}}}]);
package/dist/umd/1037.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 1037.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[1037],{1037:(e,t,o)=>{o.d(t,{Dt:()=>a,G6:()=>h,T:()=>d,gn:()=>s,i7:()=>u,vU:()=>c});const n=e=>e.test(navigator.userAgent),r=e=>e.test(navigator.platform),a=n(/Android/u),u=n(/Chrome/u)&&/Google Inc/u.test(navigator.vendor),c=n(/Firefox/u),i=r(/^iPad/u)||r(/^Mac/u)&&navigator.maxTouchPoints>1,s=r(/^iPhone/u)||i,h=n(/^((?!chrome|android).)*safari/iu),d=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})()}}]);
package/dist/umd/1721.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[1721],{1721:(e,s,c)=>{c(4750),c(7078)}}]);
package/dist/umd/1735.js DELETED
@@ -1,73 +0,0 @@
1
- /*! For license information please see 1735.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[1735,7911],{48:(t,e,i)=>{i.d(e,{Pe:()=>h,kO:()=>_,jq:()=>u,KE:()=>g});var s=i(9392),n=i(6977);const o=t=>(...e)=>({_$litDirective$:t,values:e});class r{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}var a=i(3692);class c extends r{constructor(t){if(super(t),this.et=a.Ld,2!==t.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===a.Ld||null==t)return this.vt=void 0,this.et=t;if(t===a.Jb)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;const e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}}c.directiveName="unsafeHTML",c.resultType=1,o(c);class l extends c{}l.directiveName="unsafeSVG",l.resultType=2;const d=o(l);function h(t){let e=s.Ld;if(t){const i=t.cloneNode(!0);i.removeAttribute("id"),e=s.YP`${d(i.outerHTML)}`}return e}function _(t){let e=null==t||""===t?s.Ld:t;return function(t){return(0,n.hN)(t,n.VJ.SVG)||t===s.Ld}(e)||(console.error("[vaadin-icon] Invalid svg passed, please use Lit svg literal."),e=s.Ld),e}function u(t,e){const i=_(t);(0,s.sY)(i,e)}function g(t){return s.YP`${d(t)}`}},3529:(t,e,i)=>{i.d(e,{D:()=>_});var s=i(4241),n=i(2807),o=i(2521),r=i(48);const a={},c=new Set;function l(t,e){return(t||"").replace(`${e}:`,"")}function d(t){if(t)return t.split(":")[0]||"vaadin"}function h(t,e){t._icons=[...t.querySelectorAll("[id]")].reduce(((t,i)=>(t[l(i.id,e)]=i,t)),{})}class _ extends((0,o.S)(s.H3)){static get template(){return null}static get is(){return"vaadin-iconset"}static get properties(){return{name:{type:String,observer:"__nameChanged"},size:{type:Number,value:24}}}static get attachedIcons(){return c}static getIconset(t){return a[t]}static getIconSvg(t,e){const i=e||d(t),s=this.getIconset(i);if(!t||!s)return{svg:(0,r.Pe)(null)};const n=l(t,i),o=s._icons[n];return{preserveAspectRatio:o?o.getAttribute("preserveAspectRatio"):null,svg:(0,r.Pe)(o),size:s.size,viewBox:o?o.getAttribute("viewBox"):null}}static register(t,e,i){if(!a[t]){const s=document.createElement("vaadin-iconset");s.appendChild(i.content.cloneNode(!0)),a[t]=s,h(s,t),s.size=e,s.name=t,s.__nameChanged(t)}}connectedCallback(){super.connectedCallback(),this.style.display="none";const{name:t}=this;a[t]=this,h(this,t),this.__updateIcons(t)}__updateIcons(t){c.forEach((e=>{t===d(e.icon)&&e._applyIcon()}))}__nameChanged(t,e){e&&(a[t]=a[e],delete a[e]),t&&this.__updateIcons(t)}}(0,n.M)(_)},7911:(t,e,i)=>{i(9098);var s=i(6570);(0,s.hC)("vaadin-icon",s.iv`
3
- :host {
4
- width: var(--lumo-icon-size-m);
5
- height: var(--lumo-icon-size-m);
6
- }
7
- `,{moduleId:"lumo-icon"});var n=i(4241),o=i(6155),r=i(2807),a=i(2521),c=i(4946),l=i(4463),d=i(1014),h=i(9680),_=i(1037);const u=!CSS.supports("container-type: inline-size")||!!_.G6&&!function(){const t=document.createElement("style");t.textContent="\n .vaadin-icon-test-element {\n container-type: size;\n height: 2px;\n visibility: hidden;\n position: fixed;\n }\n\n .vaadin-icon-test-element::before {\n content: '';\n display: block;\n height: 100cqh;\n ";const e=document.createElement("div");e.classList.add("vaadin-icon-test-element"),document.body.append(t,e);const{height:i}=getComputedStyle(e,"::before");return t.remove(),e.remove(),"2px"===i}();u&&(0,s.hC)("vaadin-icon",s.iv`
8
- :host::after,
9
- :host::before {
10
- font-size: var(--_vaadin-font-icon-size);
11
- }
12
- `,"vaadin-icon-font-size-mixin-styles");const g=(0,d.o)((t=>u?class extends((0,h.F)(t)){static get observers(){return["__iconFontSizeMixinfontChanged(iconClass, char, ligature)"]}ready(){super.ready(),this.__updateFontIconSize()}__iconFontSizeMixinfontChanged(t,e,i){this.__updateFontIconSize()}_onResize(){this.__updateFontIconSize()}__updateFontIconSize(){if(this.char||this.iconClass||this.ligature){const{paddingTop:t,paddingBottom:e,height:i}=getComputedStyle(this),s=parseFloat(i)-parseFloat(t)-parseFloat(e);this.style.setProperty("--_vaadin-font-icon-size",`${s}px`)}}}:t));var p=i(48),v=i(3529);const f=new Map;class m extends((0,s.Tb)((0,a.S)((0,o.k)((0,c.W)(g(n.H3)))))){static get template(){return n.dy`
13
- <style>
14
- :host {
15
- display: inline-flex;
16
- justify-content: center;
17
- align-items: center;
18
- box-sizing: border-box;
19
- vertical-align: middle;
20
- width: 24px;
21
- height: 24px;
22
- fill: currentColor;
23
- container-type: size;
24
- }
25
-
26
- :host::after,
27
- :host::before {
28
- line-height: 1;
29
- font-size: 100cqh;
30
- -webkit-font-smoothing: antialiased;
31
- text-rendering: optimizeLegibility;
32
- -moz-osx-font-smoothing: grayscale;
33
- }
34
-
35
- :host([hidden]) {
36
- display: none !important;
37
- }
38
-
39
- svg {
40
- display: block;
41
- width: 100%;
42
- height: 100%;
43
- }
44
-
45
- :host(:is([icon-class], [font-icon-content])) svg {
46
- display: none;
47
- }
48
-
49
- :host([font-icon-content])::before {
50
- content: attr(font-icon-content);
51
- }
52
- </style>
53
- <svg
54
- version="1.1"
55
- xmlns="http://www.w3.org/2000/svg"
56
- xmlns:xlink="http://www.w3.org/1999/xlink"
57
- viewBox="[[__computeViewBox(size, __viewBox)]]"
58
- preserveAspectRatio="[[__computePAR(__defaultPAR, __preserveAspectRatio)]]"
59
- fill$="[[__fill]]"
60
- stroke$="[[__stroke]]"
61
- stroke-width$="[[__strokeWidth]]"
62
- stroke-linecap$="[[__strokeLinecap]]"
63
- stroke-linejoin$="[[__strokeLinejoin]]"
64
- aria-hidden="true"
65
- >
66
- <g id="svg-group"></g>
67
- <g id="use-group" visibility$="[[__computeVisibility(__useRef, svg)]]">
68
- <use href$="[[__useRef]]" />
69
- </g>
70
- </svg>
71
-
72
- <slot name="tooltip"></slot>
73
- `}static get is(){return"vaadin-icon"}static get properties(){return{icon:{type:String,reflectToAttribute:!0,observer:"__iconChanged"},svg:{type:Object},src:{type:String},symbol:{type:String},iconClass:{type:String,reflectToAttribute:!0},char:{type:String},ligature:{type:String},fontFamily:{type:String,observer:"__fontFamilyChanged"},size:{type:Number,value:24},__defaultPAR:{type:String,value:"xMidYMid meet"},__preserveAspectRatio:String,__useRef:Object,__svgElement:String,__viewBox:String,__fill:String,__stroke:String,__strokeWidth:String,__strokeLinecap:String,__strokeLinejoin:String}}static get observers(){return["__svgChanged(svg, __svgElement)","__fontChanged(iconClass, char, ligature)","__srcChanged(src, symbol)"]}static get observedAttributes(){return[...super.observedAttributes,"class"]}constructor(){super(),this.__fetch=fetch.bind(window)}get slotStyles(){return[`\n ${this.localName}[icon-class] {\n display: inline-flex;\n vertical-align: middle;\n font-size: inherit;\n }\n `]}get __iconClasses(){return this.iconClass?this.iconClass.split(" "):[]}ready(){super.ready(),this.__svgElement=this.shadowRoot.querySelector("#svg-group"),this._tooltipController=new l.f(this),this.addController(this._tooltipController)}connectedCallback(){super.connectedCallback(),v.D.attachedIcons.add(this)}disconnectedCallback(){super.disconnectedCallback(),v.D.attachedIcons.delete(this)}_applyIcon(){const{preserveAspectRatio:t,svg:e,size:i,viewBox:s}=v.D.getIconSvg(this.icon);s&&(this.__viewBox=s),t&&(this.__preserveAspectRatio=t),i&&i!==this.size&&(this.size=i),this.svg=e}__iconChanged(t){t?this._applyIcon():this.svg=(0,p.kO)(null)}async __srcChanged(t,e){if(t)if(this.icon="",t.startsWith("data:")||!e&&!t.includes("#"))try{f.has(t)||f.set(t,this.__fetch(t,{mode:"cors"}).then((t=>{if(!t.ok)throw new Error("Error loading icon");return t.text()})));const i=await f.get(t);m.__domParser||(m.__domParser=new DOMParser);const s=m.__domParser.parseFromString(i,"text/html").querySelector("svg");if(!s)throw new Error(`SVG element not found on path: ${t}`);this.svg=(0,p.KE)(s.innerHTML),e&&(this.__useRef=`#${e}`),this.__viewBox=s.getAttribute("viewBox"),this.__fill=s.getAttribute("fill"),this.__stroke=s.getAttribute("stroke"),this.__strokeWidth=s.getAttribute("stroke-width"),this.__strokeLinecap=s.getAttribute("stroke-linecap"),this.__strokeLinejoin=s.getAttribute("stroke-linejoin")}catch(t){console.error(t),this.svg=null}else{const[i,s]=t.split("#");this.__useRef=`${i}#${e||s}`}else this.svg=null}__svgChanged(t,e){e&&(0,p.jq)(t,e)}__computePAR(t,e){return e||t}__computeVisibility(t){return t?"visible":"hidden"}__computeViewBox(t,e){return e||`0 0 ${t} ${t}`}__fontChanged(t,e,i){this.classList.remove(...this.__addedIconClasses||[]),t&&(this.__addedIconClasses=[...this.__iconClasses],this.classList.add(...this.__addedIconClasses)),e?this.setAttribute("font-icon-content",e.length>1?String.fromCodePoint(parseInt(e,16)):e):i?this.setAttribute("font-icon-content",i):this.removeAttribute("font-icon-content"),(t||e||i)&&!this.icon&&(this.icon="")}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),"class"===t&&this.__iconClasses.some((t=>!this.classList.contains(t)))&&this.classList.add(...this.__iconClasses)}__fontFamilyChanged(t){this.style.fontFamily=`'${t}'`}}(0,r.M)(m)}}]);
package/dist/umd/2066.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 2066.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[2066],{3726:(e,t,n)=>{function o(e){const t=[];for(;e;){if(e.nodeType===Node.DOCUMENT_NODE){t.push(e);break}e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?e=e.assignedSlot?e.assignedSlot:e.parentNode:(t.push(e),e=e.host)}return t}function s(e){const t=[];let n;return"slot"===e.localName?n=e.assignedElements():(t.push(e),n=[...e.children]),n.forEach((e=>t.push(...s(e)))),t}function u(e,t){return t?t.closest(e)||u(e,t.getRootNode().host):null}function r(e){return e?new Set(e.split(" ")):new Set}function i(e){return e?[...e].join(" "):""}function c(e,t,n){const o=r(e.getAttribute(t));o.add(n),e.setAttribute(t,i(o))}function d(e,t,n){const o=r(e.getAttribute(t));o.delete(n),0!==o.size?e.setAttribute(t,i(o)):e.removeAttribute(t)}function l(e){return e.nodeType===Node.TEXT_NODE&&""===e.textContent.trim()}n.d(t,{$2:()=>c,AD:()=>o,Q4:()=>u,dV:()=>i,eC:()=>l,hK:()=>r,xX:()=>s,x_:()=>d})}}]);