@qwickapps/react-framework 1.8.1 → 1.9.1
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.
- package/README.md +4 -7
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/forms/FormField.d.ts +2 -0
- package/dist/components/forms/FormField.d.ts.map +1 -1
- package/dist/components/forms/FormSelect.d.ts +2 -0
- package/dist/components/forms/FormSelect.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +107 -41
- package/dist/index.js +107 -41
- package/dist/palettes/manifest.json +22 -22
- package/dist/schemas/FormFieldSchema.d.ts +1 -0
- package/dist/schemas/FormFieldSchema.d.ts.map +1 -1
- package/dist/schemas/FormSelectSchema.d.ts +1 -0
- package/dist/schemas/FormSelectSchema.d.ts.map +1 -1
- package/package.json +23 -21
- package/scripts/build-palettes.cjs +0 -0
- package/scripts/create-project.sh +0 -0
- package/src/components/Html.tsx +7 -1
- package/src/components/Logo.tsx +1 -1
- package/src/components/Scaffold.css +3 -0
- package/src/components/forms/FormField.tsx +6 -0
- package/src/components/forms/FormSelect.tsx +6 -0
- package/src/schemas/FormFieldSchema.ts +11 -0
- package/src/schemas/FormSelectSchema.ts +11 -0
- /package/dist/palettes/{palette-autumn.1.8.1.css → palette-autumn.1.9.1.css} +0 -0
- /package/dist/palettes/{palette-autumn.1.8.1.min.css → palette-autumn.1.9.1.min.css} +0 -0
- /package/dist/palettes/{palette-boutique.1.8.1.css → palette-boutique.1.9.1.css} +0 -0
- /package/dist/palettes/{palette-boutique.1.8.1.min.css → palette-boutique.1.9.1.min.css} +0 -0
- /package/dist/palettes/{palette-cosmic.1.8.1.css → palette-cosmic.1.9.1.css} +0 -0
- /package/dist/palettes/{palette-cosmic.1.8.1.min.css → palette-cosmic.1.9.1.min.css} +0 -0
- /package/dist/palettes/{palette-default.1.8.1.css → palette-default.1.9.1.css} +0 -0
- /package/dist/palettes/{palette-default.1.8.1.min.css → palette-default.1.9.1.min.css} +0 -0
- /package/dist/palettes/{palette-ocean.1.8.1.css → palette-ocean.1.9.1.css} +0 -0
- /package/dist/palettes/{palette-ocean.1.8.1.min.css → palette-ocean.1.9.1.min.css} +0 -0
- /package/dist/palettes/{palette-spring.1.8.1.css → palette-spring.1.9.1.css} +0 -0
- /package/dist/palettes/{palette-spring.1.8.1.min.css → palette-spring.1.9.1.min.css} +0 -0
- /package/dist/palettes/{palette-winter.1.8.1.css → palette-winter.1.9.1.css} +0 -0
- /package/dist/palettes/{palette-winter.1.8.1.min.css → palette-winter.1.9.1.min.css} +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -5767,7 +5767,7 @@ function LogoView({
|
|
|
5767
5767
|
setCalculatedBadgePosition(badgePos);
|
|
5768
5768
|
setSvgWidth(requiredWidth);
|
|
5769
5769
|
}
|
|
5770
|
-
}, [name, badge, badgeOffset, calculateBadgePosition, fontSize, height, parseNameParts
|
|
5770
|
+
}, [name, badge, badgeOffset, calculateBadgePosition, fontSize, height, parseNameParts]);
|
|
5771
5771
|
// Determine CSS class for variant
|
|
5772
5772
|
let variantClass = '';
|
|
5773
5773
|
if (variant === 'high-contrast' || variant === 'monochrome' || variant === 'on-primary') {
|
|
@@ -15933,7 +15933,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
15933
15933
|
}
|
|
15934
15934
|
|
|
15935
15935
|
let result = '';
|
|
15936
|
-
// Used for hot swapping the result variable with an empty string
|
|
15936
|
+
// Used for hot swapping the result variable with an empty string
|
|
15937
|
+
// in order to "capture" the text written to it.
|
|
15937
15938
|
let tempResult = '';
|
|
15938
15939
|
|
|
15939
15940
|
function Frame(tag, attribs) {
|
|
@@ -15964,7 +15965,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
15964
15965
|
options.parser = Object.assign({}, htmlParserDefaults, options.parser);
|
|
15965
15966
|
|
|
15966
15967
|
const tagAllowed = function (name) {
|
|
15967
|
-
return options.allowedTags === false ||
|
|
15968
|
+
return options.allowedTags === false ||
|
|
15969
|
+
(options.allowedTags || []).indexOf(name) > -1;
|
|
15968
15970
|
};
|
|
15969
15971
|
|
|
15970
15972
|
// vulnerableTags
|
|
@@ -16146,7 +16148,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16146
16148
|
}
|
|
16147
16149
|
|
|
16148
16150
|
const isBeingEscaped = skip && (options.disallowedTagsMode === 'escape' || options.disallowedTagsMode === 'recursiveEscape');
|
|
16149
|
-
const shouldPreserveEscapedAttributes = isBeingEscaped &&
|
|
16151
|
+
const shouldPreserveEscapedAttributes = isBeingEscaped &&
|
|
16152
|
+
options.preserveEscapedAttributes;
|
|
16150
16153
|
|
|
16151
16154
|
if (shouldPreserveEscapedAttributes) {
|
|
16152
16155
|
each(attribs, function(value, a) {
|
|
@@ -16160,8 +16163,10 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16160
16163
|
delete frame.attribs[a];
|
|
16161
16164
|
return;
|
|
16162
16165
|
}
|
|
16163
|
-
// If the value is empty, check if the attribute is
|
|
16164
|
-
//
|
|
16166
|
+
// If the value is empty, check if the attribute is
|
|
16167
|
+
// in the allowedEmptyAttributes array.
|
|
16168
|
+
// If it is not in the allowedEmptyAttributes array,
|
|
16169
|
+
// and it is a known non-boolean attribute, delete it
|
|
16165
16170
|
// List taken from https://html.spec.whatwg.org/multipage/indices.html#attributes-3
|
|
16166
16171
|
if (value === '' && (!options.allowedEmptyAttributes.includes(a)) &&
|
|
16167
16172
|
(options.nonBooleanAttributes.includes(a) || options.nonBooleanAttributes.includes('*'))) {
|
|
@@ -16172,9 +16177,11 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16172
16177
|
// as necessary if there are specific values defined.
|
|
16173
16178
|
let passedAllowedAttributesMapCheck = false;
|
|
16174
16179
|
if (!allowedAttributesMap ||
|
|
16175
|
-
(has(allowedAttributesMap, name) &&
|
|
16180
|
+
(has(allowedAttributesMap, name) &&
|
|
16181
|
+
allowedAttributesMap[name].indexOf(a) !== -1) ||
|
|
16176
16182
|
(allowedAttributesMap['*'] && allowedAttributesMap['*'].indexOf(a) !== -1) ||
|
|
16177
|
-
(has(allowedAttributesGlobMap, name) &&
|
|
16183
|
+
(has(allowedAttributesGlobMap, name) &&
|
|
16184
|
+
allowedAttributesGlobMap[name].test(a)) ||
|
|
16178
16185
|
(allowedAttributesGlobMap['*'] && allowedAttributesGlobMap['*'].test(a))) {
|
|
16179
16186
|
passedAllowedAttributesMapCheck = true;
|
|
16180
16187
|
} else if (allowedAttributesMap && allowedAttributesMap[name]) {
|
|
@@ -16218,12 +16225,14 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16218
16225
|
const parsed = parseUrl(value);
|
|
16219
16226
|
|
|
16220
16227
|
if (options.allowedScriptHostnames || options.allowedScriptDomains) {
|
|
16221
|
-
const allowedHostname = (options.allowedScriptHostnames || [])
|
|
16222
|
-
|
|
16223
|
-
|
|
16224
|
-
|
|
16225
|
-
|
|
16226
|
-
|
|
16228
|
+
const allowedHostname = (options.allowedScriptHostnames || [])
|
|
16229
|
+
.find(function (hostname) {
|
|
16230
|
+
return hostname === parsed.url.hostname;
|
|
16231
|
+
});
|
|
16232
|
+
const allowedDomain = (options.allowedScriptDomains || [])
|
|
16233
|
+
.find(function(domain) {
|
|
16234
|
+
return parsed.url.hostname === domain || parsed.url.hostname.endsWith(`.${domain}`);
|
|
16235
|
+
});
|
|
16227
16236
|
allowed = allowedHostname || allowedDomain;
|
|
16228
16237
|
}
|
|
16229
16238
|
} catch (e) {
|
|
@@ -16247,13 +16256,18 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16247
16256
|
allowed = has(options, 'allowIframeRelativeUrls')
|
|
16248
16257
|
? options.allowIframeRelativeUrls
|
|
16249
16258
|
: (!options.allowedIframeHostnames && !options.allowedIframeDomains);
|
|
16250
|
-
} else if (
|
|
16251
|
-
|
|
16252
|
-
|
|
16253
|
-
|
|
16254
|
-
const
|
|
16255
|
-
|
|
16256
|
-
|
|
16259
|
+
} else if (
|
|
16260
|
+
options.allowedIframeHostnames ||
|
|
16261
|
+
options.allowedIframeDomains
|
|
16262
|
+
) {
|
|
16263
|
+
const allowedHostname = (options.allowedIframeHostnames || [])
|
|
16264
|
+
.find(function (hostname) {
|
|
16265
|
+
return hostname === parsed.url.hostname;
|
|
16266
|
+
});
|
|
16267
|
+
const allowedDomain = (options.allowedIframeDomains || [])
|
|
16268
|
+
.find(function(domain) {
|
|
16269
|
+
return parsed.url.hostname === domain || parsed.url.hostname.endsWith(`.${domain}`);
|
|
16270
|
+
});
|
|
16257
16271
|
allowed = allowedHostname || allowedDomain;
|
|
16258
16272
|
}
|
|
16259
16273
|
} catch (e) {
|
|
@@ -16307,9 +16321,17 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16307
16321
|
return t;
|
|
16308
16322
|
});
|
|
16309
16323
|
if (allowedSpecificClasses && allowedWildcardClasses) {
|
|
16310
|
-
value = filterClasses(
|
|
16324
|
+
value = filterClasses(
|
|
16325
|
+
value,
|
|
16326
|
+
deepmerge(allowedSpecificClasses, allowedWildcardClasses),
|
|
16327
|
+
allowedClassesGlobs
|
|
16328
|
+
);
|
|
16311
16329
|
} else {
|
|
16312
|
-
value = filterClasses(
|
|
16330
|
+
value = filterClasses(
|
|
16331
|
+
value,
|
|
16332
|
+
allowedSpecificClasses || allowedWildcardClasses,
|
|
16333
|
+
allowedClassesGlobs
|
|
16334
|
+
);
|
|
16313
16335
|
}
|
|
16314
16336
|
if (!value.length) {
|
|
16315
16337
|
delete frame.attribs[a];
|
|
@@ -16320,7 +16342,10 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16320
16342
|
if (options.parseStyleAttributes) {
|
|
16321
16343
|
try {
|
|
16322
16344
|
const abstractSyntaxTree = postcssParse(name + ' {' + value + '}', { map: false });
|
|
16323
|
-
const filteredAST = filterCss(
|
|
16345
|
+
const filteredAST = filterCss(
|
|
16346
|
+
abstractSyntaxTree,
|
|
16347
|
+
options.allowedStyles
|
|
16348
|
+
);
|
|
16324
16349
|
|
|
16325
16350
|
value = stringifyStyleAttributes(filteredAST);
|
|
16326
16351
|
|
|
@@ -16453,7 +16478,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16453
16478
|
tempResult = '';
|
|
16454
16479
|
}
|
|
16455
16480
|
// remove the opening tag from the result
|
|
16456
|
-
result = result.substring(0, frame.tagPosition) +
|
|
16481
|
+
result = result.substring(0, frame.tagPosition) +
|
|
16482
|
+
result.substring(frame.tagPosition + frame.openingTagLength);
|
|
16457
16483
|
return;
|
|
16458
16484
|
} else if (filterResult) {
|
|
16459
16485
|
result = result.substring(0, frame.tagPosition);
|
|
@@ -16488,6 +16514,16 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16488
16514
|
parser.write(html);
|
|
16489
16515
|
parser.end();
|
|
16490
16516
|
|
|
16517
|
+
if (options.disallowedTagsMode === 'escape' || options.disallowedTagsMode === 'recursiveEscape') {
|
|
16518
|
+
const lastParsedIndex = parser.endIndex;
|
|
16519
|
+
if (lastParsedIndex != null && lastParsedIndex >= 0 && lastParsedIndex < html.length) {
|
|
16520
|
+
const unparsed = html.substring(lastParsedIndex);
|
|
16521
|
+
result += escapeHtml(unparsed);
|
|
16522
|
+
} else if ((lastParsedIndex == null || lastParsedIndex < 0) && html.length > 0 && result === '') {
|
|
16523
|
+
result = escapeHtml(html);
|
|
16524
|
+
}
|
|
16525
|
+
}
|
|
16526
|
+
|
|
16491
16527
|
return result;
|
|
16492
16528
|
|
|
16493
16529
|
function initializeState() {
|
|
@@ -16598,8 +16634,10 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16598
16634
|
* Modifies the abstractSyntaxTree object.
|
|
16599
16635
|
*
|
|
16600
16636
|
* @param {object} abstractSyntaxTree - Object representation of CSS attributes.
|
|
16601
|
-
* @property {array[Declaration]} abstractSyntaxTree.nodes[0] -
|
|
16602
|
-
*
|
|
16637
|
+
* @property {array[Declaration]} abstractSyntaxTree.nodes[0] -
|
|
16638
|
+
* Each object contains prop and value key, i.e { prop: 'color', value: 'red' }.
|
|
16639
|
+
* @param {object} allowedStyles - Keys are properties (i.e color),
|
|
16640
|
+
* value is list of permitted regex rules (i.e /green/i).
|
|
16603
16641
|
* @return {object} - The modified tree.
|
|
16604
16642
|
*/
|
|
16605
16643
|
function filterCss(abstractSyntaxTree, allowedStyles) {
|
|
@@ -16621,7 +16659,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16621
16659
|
}
|
|
16622
16660
|
|
|
16623
16661
|
if (selectedRule) {
|
|
16624
|
-
abstractSyntaxTree.nodes[0].nodes = astRules.nodes
|
|
16662
|
+
abstractSyntaxTree.nodes[0].nodes = astRules.nodes
|
|
16663
|
+
.reduce(filterDeclarations(selectedRule), []);
|
|
16625
16664
|
}
|
|
16626
16665
|
|
|
16627
16666
|
return abstractSyntaxTree;
|
|
@@ -16632,7 +16671,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16632
16671
|
* values in the inline style attribute format.
|
|
16633
16672
|
*
|
|
16634
16673
|
* @param {AbstractSyntaxTree} filteredAST
|
|
16635
|
-
* @return {string} - Example:
|
|
16674
|
+
* @return {string} - Example:
|
|
16675
|
+
* "color:yellow;text-align:center !important;font-family:helvetica;"
|
|
16636
16676
|
*/
|
|
16637
16677
|
function stringifyStyleAttributes(filteredAST) {
|
|
16638
16678
|
return filteredAST.nodes[0].nodes
|
|
@@ -16649,21 +16689,25 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16649
16689
|
* Filters the existing attributes for the given property. Discards any attributes
|
|
16650
16690
|
* which don't match the allowlist.
|
|
16651
16691
|
*
|
|
16652
|
-
* @param {object} selectedRule
|
|
16653
|
-
* @param {array} allowedDeclarationsList
|
|
16654
|
-
*
|
|
16655
|
-
* @
|
|
16656
|
-
* @property {string} attributeObject.
|
|
16657
|
-
* @property {string} attributeObject.
|
|
16658
|
-
* @
|
|
16692
|
+
* @param {object} selectedRule - Example: { color: red, font-family: helvetica }
|
|
16693
|
+
* @param {array} allowedDeclarationsList - List of declarations
|
|
16694
|
+
* which pass the allowlist.
|
|
16695
|
+
* @param {object} attributeObject - Object representing the current css property.
|
|
16696
|
+
* @property {string} attributeObject.type - Typically 'declaration'.
|
|
16697
|
+
* @property {string} attributeObject.prop - The CSS property, i.e 'color'.
|
|
16698
|
+
* @property {string} attributeObject.value - The corresponding value to
|
|
16699
|
+
* the css property, i.e 'red'.
|
|
16700
|
+
* @return {function} - When used in Array.reduce,
|
|
16701
|
+
* will return an array of Declaration objects
|
|
16659
16702
|
*/
|
|
16660
16703
|
function filterDeclarations(selectedRule) {
|
|
16661
16704
|
return function (allowedDeclarationsList, attributeObject) {
|
|
16662
16705
|
// If this property is allowlisted...
|
|
16663
16706
|
if (has(selectedRule, attributeObject.prop)) {
|
|
16664
|
-
const matchesRegex = selectedRule[attributeObject.prop]
|
|
16665
|
-
|
|
16666
|
-
|
|
16707
|
+
const matchesRegex = selectedRule[attributeObject.prop]
|
|
16708
|
+
.some(function(regularExpression) {
|
|
16709
|
+
return regularExpression.test(attributeObject.value);
|
|
16710
|
+
});
|
|
16667
16711
|
|
|
16668
16712
|
if (matchesRegex) {
|
|
16669
16713
|
allowedDeclarationsList.push(attributeObject);
|
|
@@ -16795,7 +16839,7 @@ sanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge) {
|
|
|
16795
16839
|
|
|
16796
16840
|
return {
|
|
16797
16841
|
tagName: newTagName,
|
|
16798
|
-
attribs
|
|
16842
|
+
attribs
|
|
16799
16843
|
};
|
|
16800
16844
|
};
|
|
16801
16845
|
};
|
|
@@ -18116,7 +18160,9 @@ function HtmlView({
|
|
|
18116
18160
|
},
|
|
18117
18161
|
...styleProps.sx
|
|
18118
18162
|
},
|
|
18119
|
-
children: components
|
|
18163
|
+
children: Array.isArray(components) ? components.map((child, idx) => /*#__PURE__*/React.isValidElement(child) && child.key == null ? /*#__PURE__*/React.cloneElement(child, {
|
|
18164
|
+
key: `html-child-${idx}`
|
|
18165
|
+
}) : child) : components
|
|
18120
18166
|
});
|
|
18121
18167
|
} catch (error) {
|
|
18122
18168
|
console.error('Error transforming HTML content:', error);
|
|
@@ -23318,9 +23364,11 @@ function FormFieldView({
|
|
|
23318
23364
|
multiline = false,
|
|
23319
23365
|
rows,
|
|
23320
23366
|
placeholder,
|
|
23367
|
+
name,
|
|
23321
23368
|
startAdornment,
|
|
23322
23369
|
endAdornment,
|
|
23323
23370
|
inputProps,
|
|
23371
|
+
error,
|
|
23324
23372
|
// Exclude ViewProps that conflict with MUI FormControl types
|
|
23325
23373
|
margin: _margin,
|
|
23326
23374
|
marginTop: _marginTop,
|
|
@@ -23375,6 +23423,7 @@ function FormFieldView({
|
|
|
23375
23423
|
};
|
|
23376
23424
|
return jsxs(FormControl, {
|
|
23377
23425
|
fullWidth: fullWidth,
|
|
23426
|
+
error: error,
|
|
23378
23427
|
...restProps,
|
|
23379
23428
|
children: [jsx(InputLabel, {
|
|
23380
23429
|
htmlFor: fieldId,
|
|
@@ -23383,6 +23432,7 @@ function FormFieldView({
|
|
|
23383
23432
|
children: label
|
|
23384
23433
|
}), jsx(Input$5, {
|
|
23385
23434
|
id: fieldId,
|
|
23435
|
+
name: name,
|
|
23386
23436
|
type: type,
|
|
23387
23437
|
value: value,
|
|
23388
23438
|
onChange: handleChange,
|
|
@@ -23432,6 +23482,8 @@ function FormSelectView({
|
|
|
23432
23482
|
fullWidth = true,
|
|
23433
23483
|
size = 'small',
|
|
23434
23484
|
placeholder,
|
|
23485
|
+
name,
|
|
23486
|
+
error,
|
|
23435
23487
|
// Exclude ViewProps that conflict with MUI FormControl types
|
|
23436
23488
|
margin: _margin,
|
|
23437
23489
|
marginTop: _marginTop,
|
|
@@ -23475,12 +23527,14 @@ function FormSelectView({
|
|
|
23475
23527
|
return jsxs(FormControl, {
|
|
23476
23528
|
fullWidth: fullWidth,
|
|
23477
23529
|
size: size,
|
|
23530
|
+
error: error,
|
|
23478
23531
|
...restProps,
|
|
23479
23532
|
children: [label && jsx(InputLabel, {
|
|
23480
23533
|
sx: labelStyles,
|
|
23481
23534
|
shrink: true,
|
|
23482
23535
|
children: label
|
|
23483
23536
|
}), jsxs(Select, {
|
|
23537
|
+
name: name,
|
|
23484
23538
|
value: value,
|
|
23485
23539
|
onChange: handleChange,
|
|
23486
23540
|
disabled: disabled,
|
|
@@ -31455,6 +31509,12 @@ __decorate([Field(), Editor({
|
|
|
31455
31509
|
description: 'Placeholder text when no value is selected',
|
|
31456
31510
|
placeholder: 'Select an option...'
|
|
31457
31511
|
}), IsOptional(), IsString(), __metadata("design:type", String)], FormSelectModel.prototype, "placeholder", void 0);
|
|
31512
|
+
__decorate([Field(), Editor({
|
|
31513
|
+
field_type: FieldType.TEXT,
|
|
31514
|
+
label: 'Name',
|
|
31515
|
+
description: 'Name attribute for the select (for forms and accessibility)',
|
|
31516
|
+
placeholder: 'Enter name...'
|
|
31517
|
+
}), IsOptional(), IsString(), __metadata("design:type", String)], FormSelectModel.prototype, "name", void 0);
|
|
31458
31518
|
FormSelectModel = __decorate([Schema('FormSelect', '1.0.0')], FormSelectModel);
|
|
31459
31519
|
|
|
31460
31520
|
/**
|
|
@@ -31541,6 +31601,12 @@ __decorate([Field(), Editor({
|
|
|
31541
31601
|
description: 'Placeholder text',
|
|
31542
31602
|
placeholder: 'Enter text...'
|
|
31543
31603
|
}), IsOptional(), IsString(), __metadata("design:type", String)], FormFieldModel.prototype, "placeholder", void 0);
|
|
31604
|
+
__decorate([Field(), Editor({
|
|
31605
|
+
field_type: FieldType.TEXT,
|
|
31606
|
+
label: 'Name',
|
|
31607
|
+
description: 'Name attribute for the input (for forms and accessibility)',
|
|
31608
|
+
placeholder: 'Enter name...'
|
|
31609
|
+
}), IsOptional(), IsString(), __metadata("design:type", String)], FormFieldModel.prototype, "name", void 0);
|
|
31544
31610
|
FormFieldModel = __decorate([Schema('FormField', '1.0.0')], FormFieldModel);
|
|
31545
31611
|
|
|
31546
31612
|
/**
|
package/dist/index.js
CHANGED
|
@@ -5769,7 +5769,7 @@ function LogoView({
|
|
|
5769
5769
|
setCalculatedBadgePosition(badgePos);
|
|
5770
5770
|
setSvgWidth(requiredWidth);
|
|
5771
5771
|
}
|
|
5772
|
-
}, [name, badge, badgeOffset, calculateBadgePosition, fontSize, height, parseNameParts
|
|
5772
|
+
}, [name, badge, badgeOffset, calculateBadgePosition, fontSize, height, parseNameParts]);
|
|
5773
5773
|
// Determine CSS class for variant
|
|
5774
5774
|
let variantClass = '';
|
|
5775
5775
|
if (variant === 'high-contrast' || variant === 'monochrome' || variant === 'on-primary') {
|
|
@@ -15935,7 +15935,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
15935
15935
|
}
|
|
15936
15936
|
|
|
15937
15937
|
let result = '';
|
|
15938
|
-
// Used for hot swapping the result variable with an empty string
|
|
15938
|
+
// Used for hot swapping the result variable with an empty string
|
|
15939
|
+
// in order to "capture" the text written to it.
|
|
15939
15940
|
let tempResult = '';
|
|
15940
15941
|
|
|
15941
15942
|
function Frame(tag, attribs) {
|
|
@@ -15966,7 +15967,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
15966
15967
|
options.parser = Object.assign({}, htmlParserDefaults, options.parser);
|
|
15967
15968
|
|
|
15968
15969
|
const tagAllowed = function (name) {
|
|
15969
|
-
return options.allowedTags === false ||
|
|
15970
|
+
return options.allowedTags === false ||
|
|
15971
|
+
(options.allowedTags || []).indexOf(name) > -1;
|
|
15970
15972
|
};
|
|
15971
15973
|
|
|
15972
15974
|
// vulnerableTags
|
|
@@ -16148,7 +16150,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16148
16150
|
}
|
|
16149
16151
|
|
|
16150
16152
|
const isBeingEscaped = skip && (options.disallowedTagsMode === 'escape' || options.disallowedTagsMode === 'recursiveEscape');
|
|
16151
|
-
const shouldPreserveEscapedAttributes = isBeingEscaped &&
|
|
16153
|
+
const shouldPreserveEscapedAttributes = isBeingEscaped &&
|
|
16154
|
+
options.preserveEscapedAttributes;
|
|
16152
16155
|
|
|
16153
16156
|
if (shouldPreserveEscapedAttributes) {
|
|
16154
16157
|
each(attribs, function(value, a) {
|
|
@@ -16162,8 +16165,10 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16162
16165
|
delete frame.attribs[a];
|
|
16163
16166
|
return;
|
|
16164
16167
|
}
|
|
16165
|
-
// If the value is empty, check if the attribute is
|
|
16166
|
-
//
|
|
16168
|
+
// If the value is empty, check if the attribute is
|
|
16169
|
+
// in the allowedEmptyAttributes array.
|
|
16170
|
+
// If it is not in the allowedEmptyAttributes array,
|
|
16171
|
+
// and it is a known non-boolean attribute, delete it
|
|
16167
16172
|
// List taken from https://html.spec.whatwg.org/multipage/indices.html#attributes-3
|
|
16168
16173
|
if (value === '' && (!options.allowedEmptyAttributes.includes(a)) &&
|
|
16169
16174
|
(options.nonBooleanAttributes.includes(a) || options.nonBooleanAttributes.includes('*'))) {
|
|
@@ -16174,9 +16179,11 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16174
16179
|
// as necessary if there are specific values defined.
|
|
16175
16180
|
let passedAllowedAttributesMapCheck = false;
|
|
16176
16181
|
if (!allowedAttributesMap ||
|
|
16177
|
-
(has(allowedAttributesMap, name) &&
|
|
16182
|
+
(has(allowedAttributesMap, name) &&
|
|
16183
|
+
allowedAttributesMap[name].indexOf(a) !== -1) ||
|
|
16178
16184
|
(allowedAttributesMap['*'] && allowedAttributesMap['*'].indexOf(a) !== -1) ||
|
|
16179
|
-
(has(allowedAttributesGlobMap, name) &&
|
|
16185
|
+
(has(allowedAttributesGlobMap, name) &&
|
|
16186
|
+
allowedAttributesGlobMap[name].test(a)) ||
|
|
16180
16187
|
(allowedAttributesGlobMap['*'] && allowedAttributesGlobMap['*'].test(a))) {
|
|
16181
16188
|
passedAllowedAttributesMapCheck = true;
|
|
16182
16189
|
} else if (allowedAttributesMap && allowedAttributesMap[name]) {
|
|
@@ -16220,12 +16227,14 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16220
16227
|
const parsed = parseUrl(value);
|
|
16221
16228
|
|
|
16222
16229
|
if (options.allowedScriptHostnames || options.allowedScriptDomains) {
|
|
16223
|
-
const allowedHostname = (options.allowedScriptHostnames || [])
|
|
16224
|
-
|
|
16225
|
-
|
|
16226
|
-
|
|
16227
|
-
|
|
16228
|
-
|
|
16230
|
+
const allowedHostname = (options.allowedScriptHostnames || [])
|
|
16231
|
+
.find(function (hostname) {
|
|
16232
|
+
return hostname === parsed.url.hostname;
|
|
16233
|
+
});
|
|
16234
|
+
const allowedDomain = (options.allowedScriptDomains || [])
|
|
16235
|
+
.find(function(domain) {
|
|
16236
|
+
return parsed.url.hostname === domain || parsed.url.hostname.endsWith(`.${domain}`);
|
|
16237
|
+
});
|
|
16229
16238
|
allowed = allowedHostname || allowedDomain;
|
|
16230
16239
|
}
|
|
16231
16240
|
} catch (e) {
|
|
@@ -16249,13 +16258,18 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16249
16258
|
allowed = has(options, 'allowIframeRelativeUrls')
|
|
16250
16259
|
? options.allowIframeRelativeUrls
|
|
16251
16260
|
: (!options.allowedIframeHostnames && !options.allowedIframeDomains);
|
|
16252
|
-
} else if (
|
|
16253
|
-
|
|
16254
|
-
|
|
16255
|
-
|
|
16256
|
-
const
|
|
16257
|
-
|
|
16258
|
-
|
|
16261
|
+
} else if (
|
|
16262
|
+
options.allowedIframeHostnames ||
|
|
16263
|
+
options.allowedIframeDomains
|
|
16264
|
+
) {
|
|
16265
|
+
const allowedHostname = (options.allowedIframeHostnames || [])
|
|
16266
|
+
.find(function (hostname) {
|
|
16267
|
+
return hostname === parsed.url.hostname;
|
|
16268
|
+
});
|
|
16269
|
+
const allowedDomain = (options.allowedIframeDomains || [])
|
|
16270
|
+
.find(function(domain) {
|
|
16271
|
+
return parsed.url.hostname === domain || parsed.url.hostname.endsWith(`.${domain}`);
|
|
16272
|
+
});
|
|
16259
16273
|
allowed = allowedHostname || allowedDomain;
|
|
16260
16274
|
}
|
|
16261
16275
|
} catch (e) {
|
|
@@ -16309,9 +16323,17 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16309
16323
|
return t;
|
|
16310
16324
|
});
|
|
16311
16325
|
if (allowedSpecificClasses && allowedWildcardClasses) {
|
|
16312
|
-
value = filterClasses(
|
|
16326
|
+
value = filterClasses(
|
|
16327
|
+
value,
|
|
16328
|
+
deepmerge(allowedSpecificClasses, allowedWildcardClasses),
|
|
16329
|
+
allowedClassesGlobs
|
|
16330
|
+
);
|
|
16313
16331
|
} else {
|
|
16314
|
-
value = filterClasses(
|
|
16332
|
+
value = filterClasses(
|
|
16333
|
+
value,
|
|
16334
|
+
allowedSpecificClasses || allowedWildcardClasses,
|
|
16335
|
+
allowedClassesGlobs
|
|
16336
|
+
);
|
|
16315
16337
|
}
|
|
16316
16338
|
if (!value.length) {
|
|
16317
16339
|
delete frame.attribs[a];
|
|
@@ -16322,7 +16344,10 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16322
16344
|
if (options.parseStyleAttributes) {
|
|
16323
16345
|
try {
|
|
16324
16346
|
const abstractSyntaxTree = postcssParse(name + ' {' + value + '}', { map: false });
|
|
16325
|
-
const filteredAST = filterCss(
|
|
16347
|
+
const filteredAST = filterCss(
|
|
16348
|
+
abstractSyntaxTree,
|
|
16349
|
+
options.allowedStyles
|
|
16350
|
+
);
|
|
16326
16351
|
|
|
16327
16352
|
value = stringifyStyleAttributes(filteredAST);
|
|
16328
16353
|
|
|
@@ -16455,7 +16480,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16455
16480
|
tempResult = '';
|
|
16456
16481
|
}
|
|
16457
16482
|
// remove the opening tag from the result
|
|
16458
|
-
result = result.substring(0, frame.tagPosition) +
|
|
16483
|
+
result = result.substring(0, frame.tagPosition) +
|
|
16484
|
+
result.substring(frame.tagPosition + frame.openingTagLength);
|
|
16459
16485
|
return;
|
|
16460
16486
|
} else if (filterResult) {
|
|
16461
16487
|
result = result.substring(0, frame.tagPosition);
|
|
@@ -16490,6 +16516,16 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16490
16516
|
parser.write(html);
|
|
16491
16517
|
parser.end();
|
|
16492
16518
|
|
|
16519
|
+
if (options.disallowedTagsMode === 'escape' || options.disallowedTagsMode === 'recursiveEscape') {
|
|
16520
|
+
const lastParsedIndex = parser.endIndex;
|
|
16521
|
+
if (lastParsedIndex != null && lastParsedIndex >= 0 && lastParsedIndex < html.length) {
|
|
16522
|
+
const unparsed = html.substring(lastParsedIndex);
|
|
16523
|
+
result += escapeHtml(unparsed);
|
|
16524
|
+
} else if ((lastParsedIndex == null || lastParsedIndex < 0) && html.length > 0 && result === '') {
|
|
16525
|
+
result = escapeHtml(html);
|
|
16526
|
+
}
|
|
16527
|
+
}
|
|
16528
|
+
|
|
16493
16529
|
return result;
|
|
16494
16530
|
|
|
16495
16531
|
function initializeState() {
|
|
@@ -16600,8 +16636,10 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16600
16636
|
* Modifies the abstractSyntaxTree object.
|
|
16601
16637
|
*
|
|
16602
16638
|
* @param {object} abstractSyntaxTree - Object representation of CSS attributes.
|
|
16603
|
-
* @property {array[Declaration]} abstractSyntaxTree.nodes[0] -
|
|
16604
|
-
*
|
|
16639
|
+
* @property {array[Declaration]} abstractSyntaxTree.nodes[0] -
|
|
16640
|
+
* Each object contains prop and value key, i.e { prop: 'color', value: 'red' }.
|
|
16641
|
+
* @param {object} allowedStyles - Keys are properties (i.e color),
|
|
16642
|
+
* value is list of permitted regex rules (i.e /green/i).
|
|
16605
16643
|
* @return {object} - The modified tree.
|
|
16606
16644
|
*/
|
|
16607
16645
|
function filterCss(abstractSyntaxTree, allowedStyles) {
|
|
@@ -16623,7 +16661,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16623
16661
|
}
|
|
16624
16662
|
|
|
16625
16663
|
if (selectedRule) {
|
|
16626
|
-
abstractSyntaxTree.nodes[0].nodes = astRules.nodes
|
|
16664
|
+
abstractSyntaxTree.nodes[0].nodes = astRules.nodes
|
|
16665
|
+
.reduce(filterDeclarations(selectedRule), []);
|
|
16627
16666
|
}
|
|
16628
16667
|
|
|
16629
16668
|
return abstractSyntaxTree;
|
|
@@ -16634,7 +16673,8 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16634
16673
|
* values in the inline style attribute format.
|
|
16635
16674
|
*
|
|
16636
16675
|
* @param {AbstractSyntaxTree} filteredAST
|
|
16637
|
-
* @return {string} - Example:
|
|
16676
|
+
* @return {string} - Example:
|
|
16677
|
+
* "color:yellow;text-align:center !important;font-family:helvetica;"
|
|
16638
16678
|
*/
|
|
16639
16679
|
function stringifyStyleAttributes(filteredAST) {
|
|
16640
16680
|
return filteredAST.nodes[0].nodes
|
|
@@ -16651,21 +16691,25 @@ function sanitizeHtml(html, options, _recursing) {
|
|
|
16651
16691
|
* Filters the existing attributes for the given property. Discards any attributes
|
|
16652
16692
|
* which don't match the allowlist.
|
|
16653
16693
|
*
|
|
16654
|
-
* @param {object} selectedRule
|
|
16655
|
-
* @param {array} allowedDeclarationsList
|
|
16656
|
-
*
|
|
16657
|
-
* @
|
|
16658
|
-
* @property {string} attributeObject.
|
|
16659
|
-
* @property {string} attributeObject.
|
|
16660
|
-
* @
|
|
16694
|
+
* @param {object} selectedRule - Example: { color: red, font-family: helvetica }
|
|
16695
|
+
* @param {array} allowedDeclarationsList - List of declarations
|
|
16696
|
+
* which pass the allowlist.
|
|
16697
|
+
* @param {object} attributeObject - Object representing the current css property.
|
|
16698
|
+
* @property {string} attributeObject.type - Typically 'declaration'.
|
|
16699
|
+
* @property {string} attributeObject.prop - The CSS property, i.e 'color'.
|
|
16700
|
+
* @property {string} attributeObject.value - The corresponding value to
|
|
16701
|
+
* the css property, i.e 'red'.
|
|
16702
|
+
* @return {function} - When used in Array.reduce,
|
|
16703
|
+
* will return an array of Declaration objects
|
|
16661
16704
|
*/
|
|
16662
16705
|
function filterDeclarations(selectedRule) {
|
|
16663
16706
|
return function (allowedDeclarationsList, attributeObject) {
|
|
16664
16707
|
// If this property is allowlisted...
|
|
16665
16708
|
if (has(selectedRule, attributeObject.prop)) {
|
|
16666
|
-
const matchesRegex = selectedRule[attributeObject.prop]
|
|
16667
|
-
|
|
16668
|
-
|
|
16709
|
+
const matchesRegex = selectedRule[attributeObject.prop]
|
|
16710
|
+
.some(function(regularExpression) {
|
|
16711
|
+
return regularExpression.test(attributeObject.value);
|
|
16712
|
+
});
|
|
16669
16713
|
|
|
16670
16714
|
if (matchesRegex) {
|
|
16671
16715
|
allowedDeclarationsList.push(attributeObject);
|
|
@@ -16797,7 +16841,7 @@ sanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge) {
|
|
|
16797
16841
|
|
|
16798
16842
|
return {
|
|
16799
16843
|
tagName: newTagName,
|
|
16800
|
-
attribs
|
|
16844
|
+
attribs
|
|
16801
16845
|
};
|
|
16802
16846
|
};
|
|
16803
16847
|
};
|
|
@@ -18118,7 +18162,9 @@ function HtmlView({
|
|
|
18118
18162
|
},
|
|
18119
18163
|
...styleProps.sx
|
|
18120
18164
|
},
|
|
18121
|
-
children: components
|
|
18165
|
+
children: Array.isArray(components) ? components.map((child, idx) => /*#__PURE__*/React.isValidElement(child) && child.key == null ? /*#__PURE__*/React.cloneElement(child, {
|
|
18166
|
+
key: `html-child-${idx}`
|
|
18167
|
+
}) : child) : components
|
|
18122
18168
|
});
|
|
18123
18169
|
} catch (error) {
|
|
18124
18170
|
console.error('Error transforming HTML content:', error);
|
|
@@ -23320,9 +23366,11 @@ function FormFieldView({
|
|
|
23320
23366
|
multiline = false,
|
|
23321
23367
|
rows,
|
|
23322
23368
|
placeholder,
|
|
23369
|
+
name,
|
|
23323
23370
|
startAdornment,
|
|
23324
23371
|
endAdornment,
|
|
23325
23372
|
inputProps,
|
|
23373
|
+
error,
|
|
23326
23374
|
// Exclude ViewProps that conflict with MUI FormControl types
|
|
23327
23375
|
margin: _margin,
|
|
23328
23376
|
marginTop: _marginTop,
|
|
@@ -23377,6 +23425,7 @@ function FormFieldView({
|
|
|
23377
23425
|
};
|
|
23378
23426
|
return jsxRuntime.jsxs(material.FormControl, {
|
|
23379
23427
|
fullWidth: fullWidth,
|
|
23428
|
+
error: error,
|
|
23380
23429
|
...restProps,
|
|
23381
23430
|
children: [jsxRuntime.jsx(material.InputLabel, {
|
|
23382
23431
|
htmlFor: fieldId,
|
|
@@ -23385,6 +23434,7 @@ function FormFieldView({
|
|
|
23385
23434
|
children: label
|
|
23386
23435
|
}), jsxRuntime.jsx(material.Input, {
|
|
23387
23436
|
id: fieldId,
|
|
23437
|
+
name: name,
|
|
23388
23438
|
type: type,
|
|
23389
23439
|
value: value,
|
|
23390
23440
|
onChange: handleChange,
|
|
@@ -23434,6 +23484,8 @@ function FormSelectView({
|
|
|
23434
23484
|
fullWidth = true,
|
|
23435
23485
|
size = 'small',
|
|
23436
23486
|
placeholder,
|
|
23487
|
+
name,
|
|
23488
|
+
error,
|
|
23437
23489
|
// Exclude ViewProps that conflict with MUI FormControl types
|
|
23438
23490
|
margin: _margin,
|
|
23439
23491
|
marginTop: _marginTop,
|
|
@@ -23477,12 +23529,14 @@ function FormSelectView({
|
|
|
23477
23529
|
return jsxRuntime.jsxs(material.FormControl, {
|
|
23478
23530
|
fullWidth: fullWidth,
|
|
23479
23531
|
size: size,
|
|
23532
|
+
error: error,
|
|
23480
23533
|
...restProps,
|
|
23481
23534
|
children: [label && jsxRuntime.jsx(material.InputLabel, {
|
|
23482
23535
|
sx: labelStyles,
|
|
23483
23536
|
shrink: true,
|
|
23484
23537
|
children: label
|
|
23485
23538
|
}), jsxRuntime.jsxs(material.Select, {
|
|
23539
|
+
name: name,
|
|
23486
23540
|
value: value,
|
|
23487
23541
|
onChange: handleChange,
|
|
23488
23542
|
disabled: disabled,
|
|
@@ -31457,6 +31511,12 @@ __decorate([schema.Field(), schema.Editor({
|
|
|
31457
31511
|
description: 'Placeholder text when no value is selected',
|
|
31458
31512
|
placeholder: 'Select an option...'
|
|
31459
31513
|
}), classValidator.IsOptional(), classValidator.IsString(), __metadata("design:type", String)], exports.FormSelectModel.prototype, "placeholder", void 0);
|
|
31514
|
+
__decorate([schema.Field(), schema.Editor({
|
|
31515
|
+
field_type: schema.FieldType.TEXT,
|
|
31516
|
+
label: 'Name',
|
|
31517
|
+
description: 'Name attribute for the select (for forms and accessibility)',
|
|
31518
|
+
placeholder: 'Enter name...'
|
|
31519
|
+
}), classValidator.IsOptional(), classValidator.IsString(), __metadata("design:type", String)], exports.FormSelectModel.prototype, "name", void 0);
|
|
31460
31520
|
exports.FormSelectModel = __decorate([schema.Schema('FormSelect', '1.0.0')], exports.FormSelectModel);
|
|
31461
31521
|
|
|
31462
31522
|
/**
|
|
@@ -31543,6 +31603,12 @@ __decorate([schema.Field(), schema.Editor({
|
|
|
31543
31603
|
description: 'Placeholder text',
|
|
31544
31604
|
placeholder: 'Enter text...'
|
|
31545
31605
|
}), classValidator.IsOptional(), classValidator.IsString(), __metadata("design:type", String)], exports.FormFieldModel.prototype, "placeholder", void 0);
|
|
31606
|
+
__decorate([schema.Field(), schema.Editor({
|
|
31607
|
+
field_type: schema.FieldType.TEXT,
|
|
31608
|
+
label: 'Name',
|
|
31609
|
+
description: 'Name attribute for the input (for forms and accessibility)',
|
|
31610
|
+
placeholder: 'Enter name...'
|
|
31611
|
+
}), classValidator.IsOptional(), classValidator.IsString(), __metadata("design:type", String)], exports.FormFieldModel.prototype, "name", void 0);
|
|
31546
31612
|
exports.FormFieldModel = __decorate([schema.Schema('FormField', '1.0.0')], exports.FormFieldModel);
|
|
31547
31613
|
|
|
31548
31614
|
/**
|