@lwc/shared 8.20.0 → 8.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -771,7 +771,7 @@ function htmlEscape(str, attrMode = false) {
771
771
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
772
772
  */
773
773
  // Increment whenever the LWC template compiler changes
774
- const LWC_VERSION = "8.20.0";
774
+ const LWC_VERSION = "8.20.2";
775
775
  const LWC_VERSION_COMMENT = `LWC compiler v${LWC_VERSION}`;
776
776
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
777
777
 
@@ -828,20 +828,23 @@ function normalizeClass(value) {
828
828
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
829
829
  */
830
830
  let hooksAreSet = false;
831
+ let sanitizeHtmlContentImpl = () => {
832
+ // locker-service patches this function during runtime to sanitize HTML content.
833
+ throw new Error('sanitizeHtmlContent hook must be implemented.');
834
+ };
831
835
  /**
832
836
  * EXPERIMENTAL: This function acts like a hook for Lightning Locker Service and other similar
833
837
  * libraries to sanitize HTML content. This hook process the content passed via the template to
834
838
  * lwc:inner-html directive.
835
839
  * It is meant to be overridden via `setHooks`; it throws an error by default.
836
840
  */
837
- exports.sanitizeHtmlContent = () => {
838
- // locker-service patches this function during runtime to sanitize HTML content.
839
- throw new Error('sanitizeHtmlContent hook must be implemented.');
841
+ const sanitizeHtmlContent = (value) => {
842
+ return sanitizeHtmlContentImpl(value);
840
843
  };
841
844
  function setHooks(hooks) {
842
845
  isFalse$1(hooksAreSet, 'Hooks are already overridden, only one definition is allowed.');
843
846
  hooksAreSet = true;
844
- exports.sanitizeHtmlContent = hooks.sanitizeHtmlContent;
847
+ sanitizeHtmlContentImpl = hooks.sanitizeHtmlContent;
845
848
  }
846
849
 
847
850
  /*
@@ -1081,6 +1084,7 @@ exports.normalizeClass = normalizeClass;
1081
1084
  exports.normalizeStyleAttributeValue = normalizeStyleAttributeValue;
1082
1085
  exports.normalizeTabIndex = normalizeTabIndex;
1083
1086
  exports.parseStyleText = parseStyleText;
1087
+ exports.sanitizeHtmlContent = sanitizeHtmlContent;
1084
1088
  exports.seal = seal;
1085
1089
  exports.setContextKeys = setContextKeys;
1086
1090
  exports.setHooks = setHooks;
@@ -1088,5 +1092,5 @@ exports.setPrototypeOf = setPrototypeOf;
1088
1092
  exports.setTrustedContextSet = setTrustedContextSet;
1089
1093
  exports.setTrustedSignalSet = setTrustedSignalSet;
1090
1094
  exports.toString = toString;
1091
- /** version: 8.20.0 */
1095
+ /** version: 8.20.2 */
1092
1096
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.js CHANGED
@@ -767,7 +767,7 @@ function htmlEscape(str, attrMode = false) {
767
767
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
768
768
  */
769
769
  // Increment whenever the LWC template compiler changes
770
- const LWC_VERSION = "8.20.0";
770
+ const LWC_VERSION = "8.20.2";
771
771
  const LWC_VERSION_COMMENT = `LWC compiler v${LWC_VERSION}`;
772
772
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
773
773
 
@@ -824,20 +824,23 @@ function normalizeClass(value) {
824
824
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
825
825
  */
826
826
  let hooksAreSet = false;
827
+ let sanitizeHtmlContentImpl = () => {
828
+ // locker-service patches this function during runtime to sanitize HTML content.
829
+ throw new Error('sanitizeHtmlContent hook must be implemented.');
830
+ };
827
831
  /**
828
832
  * EXPERIMENTAL: This function acts like a hook for Lightning Locker Service and other similar
829
833
  * libraries to sanitize HTML content. This hook process the content passed via the template to
830
834
  * lwc:inner-html directive.
831
835
  * It is meant to be overridden via `setHooks`; it throws an error by default.
832
836
  */
833
- let sanitizeHtmlContent = () => {
834
- // locker-service patches this function during runtime to sanitize HTML content.
835
- throw new Error('sanitizeHtmlContent hook must be implemented.');
837
+ const sanitizeHtmlContent = (value) => {
838
+ return sanitizeHtmlContentImpl(value);
836
839
  };
837
840
  function setHooks(hooks) {
838
841
  isFalse$1(hooksAreSet, 'Hooks are already overridden, only one definition is allowed.');
839
842
  hooksAreSet = true;
840
- sanitizeHtmlContent = hooks.sanitizeHtmlContent;
843
+ sanitizeHtmlContentImpl = hooks.sanitizeHtmlContent;
841
844
  }
842
845
 
843
846
  /*
@@ -965,5 +968,5 @@ function normalizeTabIndex(value) {
965
968
  }
966
969
 
967
970
  export { AMBIGUOUS_PROP_SET, AriaAttrNameToPropNameMap, AriaPropNameToAttrNameMap, ArrayConcat, ArrayCopyWithin, ArrayEvery, ArrayFill, ArrayFilter, ArrayFind, ArrayFindIndex, ArrayFrom, ArrayIncludes, ArrayIndexOf, ArrayJoin, ArrayMap, ArrayPop, ArrayPush, ArrayReduce, ArrayReverse, ArrayShift, ArraySlice, ArraySome, ArraySort, ArraySplice, ArrayUnshift, ContextEventName, DEFAULT_SSR_MODE, DISALLOWED_PROP_SET, HIGHEST_API_VERSION, HTML_NAMESPACE, ID_REFERENCING_ATTRIBUTES_SET, IMPORTANT_FLAG, KEY__LEGACY_SHADOW_TOKEN, KEY__LEGACY_SHADOW_TOKEN_PRIVATE, KEY__NATIVE_GET_ELEMENT_BY_ID, KEY__NATIVE_ONLY_CSS, KEY__NATIVE_QUERY_SELECTOR_ALL, KEY__SCOPED_CSS, KEY__SHADOW_RESOLVER, KEY__SHADOW_RESOLVER_PRIVATE, KEY__SHADOW_STATIC, KEY__SHADOW_STATIC_PRIVATE, KEY__SHADOW_TOKEN, KEY__SHADOW_TOKEN_PRIVATE, KEY__SYNTHETIC_MODE, LOWEST_API_VERSION, LWC_VERSION, LWC_VERSION_COMMENT, LWC_VERSION_COMMENT_REGEX, MATHML_NAMESPACE, REFLECTIVE_GLOBAL_PROPERTY_SET, SPECIAL_PROPERTY_ATTRIBUTE_MAPPING, SVG_NAMESPACE, StringCharAt, StringCharCodeAt, StringFromCharCode, StringReplace, StringSlice, StringSplit, StringToLowerCase, StringTrim, XLINK_NAMESPACE, XML_NAMESPACE, addTrustedContext, addTrustedSignal, arrayEvery, assert, assign, create, defineProperties, defineProperty, entries, flattenStylesheets, forEach, freeze, fromEntries, generateCustomElementTagName, getAPIVersionFromNumber, getContextKeys, getOwnPropertyDescriptor, getOwnPropertyDescriptors, getOwnPropertyNames, getOwnPropertySymbols, getPropertyDescriptor, getPrototypeOf, hasOwnProperty, htmlEscape, htmlPropertyToAttribute, isAPIFeatureEnabled, isAriaAttribute, isArray, isBoolean, isBooleanAttribute, isFalse, isFrozen, isFunction, isGlobalHtmlAttribute, isNull, isNumber, isObject, isString, isTrue, isTrustedContext, isTrustedSignal, isUndefined, isVoidElement, kebabCaseToCamelCase, keys, noop, normalizeClass, normalizeStyleAttributeValue, normalizeTabIndex, parseStyleText, sanitizeHtmlContent, seal, setContextKeys, setHooks, setPrototypeOf, setTrustedContextSet, setTrustedSignalSet, toString };
968
- /** version: 8.20.0 */
971
+ /** version: 8.20.2 */
969
972
  //# sourceMappingURL=index.js.map
@@ -10,7 +10,7 @@ interface OverridableHooks {
10
10
  * lwc:inner-html directive.
11
11
  * It is meant to be overridden via `setHooks`; it throws an error by default.
12
12
  */
13
- export declare let sanitizeHtmlContent: SanitizeHtmlContentHook;
13
+ export declare const sanitizeHtmlContent: SanitizeHtmlContentHook;
14
14
  export declare function setHooks(hooks: OverridableHooks): void;
15
15
  export {};
16
16
  //# sourceMappingURL=overridable-hooks.d.ts.map
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
5
5
  ],
6
6
  "name": "@lwc/shared",
7
- "version": "8.20.0",
7
+ "version": "8.20.2",
8
8
  "description": "Utilities and methods that are shared across packages",
9
9
  "keywords": [
10
10
  "lwc"