@lwc/shared 8.18.2 → 8.19.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/dist/context.d.ts +17 -0
- package/dist/index.cjs.js +43 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +38 -3
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const ContextEventName = "lightning:context-request";
|
|
2
|
+
export type ContextKeys = {
|
|
3
|
+
connectContext: symbol;
|
|
4
|
+
disconnectContext: symbol;
|
|
5
|
+
};
|
|
6
|
+
export type ContextProvidedCallback = (contextSignal?: object) => void;
|
|
7
|
+
export interface ContextBinding<C extends object> {
|
|
8
|
+
component: C;
|
|
9
|
+
provideContext<V extends object>(contextVariety: V, providedContextSignal: object): void;
|
|
10
|
+
consumeContext<V extends object>(contextVariety: V, contextProvidedCallback: ContextProvidedCallback): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function setContextKeys(config: ContextKeys): void;
|
|
13
|
+
export declare function getContextKeys(): ContextKeys;
|
|
14
|
+
export declare function setTrustedContextSet(context: WeakSet<object>): void;
|
|
15
|
+
export declare function addTrustedContext(contextParticipant: object): void;
|
|
16
|
+
export declare function isTrustedContext(target: object): boolean;
|
|
17
|
+
//# sourceMappingURL=context.d.ts.map
|
package/dist/index.cjs.js
CHANGED
|
@@ -436,8 +436,42 @@ const ID_REFERENCING_ATTRIBUTES_SET = /*@__PURE__*/ new Set([
|
|
|
436
436
|
'aria-labelledby',
|
|
437
437
|
'aria-owns',
|
|
438
438
|
'for',
|
|
439
|
+
'popovertarget',
|
|
439
440
|
]);
|
|
440
441
|
|
|
442
|
+
/*
|
|
443
|
+
* Copyright (c) 2024, salesforce.com, inc.
|
|
444
|
+
* All rights reserved.
|
|
445
|
+
* SPDX-License-Identifier: MIT
|
|
446
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
447
|
+
*/
|
|
448
|
+
const ContextEventName = 'lightning:context-request';
|
|
449
|
+
let trustedContext;
|
|
450
|
+
let contextKeys;
|
|
451
|
+
function setContextKeys(config) {
|
|
452
|
+
isFalse$1(contextKeys, '`setContextKeys` cannot be called more than once');
|
|
453
|
+
contextKeys = config;
|
|
454
|
+
}
|
|
455
|
+
function getContextKeys() {
|
|
456
|
+
return contextKeys;
|
|
457
|
+
}
|
|
458
|
+
function setTrustedContextSet(context) {
|
|
459
|
+
isFalse$1(trustedContext, 'Trusted Context Set is already set!');
|
|
460
|
+
trustedContext = context;
|
|
461
|
+
}
|
|
462
|
+
function addTrustedContext(contextParticipant) {
|
|
463
|
+
// This should be a no-op when the trustedSignals set isn't set by runtime
|
|
464
|
+
trustedContext?.add(contextParticipant);
|
|
465
|
+
}
|
|
466
|
+
function isTrustedContext(target) {
|
|
467
|
+
if (!trustedContext) {
|
|
468
|
+
// The runtime didn't set a trustedContext set
|
|
469
|
+
// this check should only be performed for runtimes that care about filtering context participants to track
|
|
470
|
+
return true;
|
|
471
|
+
}
|
|
472
|
+
return trustedContext.has(target);
|
|
473
|
+
}
|
|
474
|
+
|
|
441
475
|
/*
|
|
442
476
|
* Copyright (c) 2023, Salesforce.com, inc.
|
|
443
477
|
* All rights reserved.
|
|
@@ -584,6 +618,7 @@ const GLOBAL_ATTRIBUTE = /*@__PURE__*/ new Set([
|
|
|
584
618
|
'lang',
|
|
585
619
|
'nonce',
|
|
586
620
|
'part',
|
|
621
|
+
'popover',
|
|
587
622
|
'slot',
|
|
588
623
|
'spellcheck',
|
|
589
624
|
'style',
|
|
@@ -736,7 +771,7 @@ function htmlEscape(str, attrMode = false) {
|
|
|
736
771
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
737
772
|
*/
|
|
738
773
|
// Increment whenever the LWC template compiler changes
|
|
739
|
-
const LWC_VERSION = "8.
|
|
774
|
+
const LWC_VERSION = "8.19.1";
|
|
740
775
|
const LWC_VERSION_COMMENT = `LWC compiler v${LWC_VERSION}`;
|
|
741
776
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
742
777
|
|
|
@@ -958,6 +993,7 @@ exports.ArraySome = ArraySome;
|
|
|
958
993
|
exports.ArraySort = ArraySort;
|
|
959
994
|
exports.ArraySplice = ArraySplice;
|
|
960
995
|
exports.ArrayUnshift = ArrayUnshift;
|
|
996
|
+
exports.ContextEventName = ContextEventName;
|
|
961
997
|
exports.DEFAULT_SSR_MODE = DEFAULT_SSR_MODE;
|
|
962
998
|
exports.DISALLOWED_PROP_SET = DISALLOWED_PROP_SET;
|
|
963
999
|
exports.HIGHEST_API_VERSION = HIGHEST_API_VERSION;
|
|
@@ -995,6 +1031,7 @@ exports.StringToLowerCase = StringToLowerCase;
|
|
|
995
1031
|
exports.StringTrim = StringTrim;
|
|
996
1032
|
exports.XLINK_NAMESPACE = XLINK_NAMESPACE;
|
|
997
1033
|
exports.XML_NAMESPACE = XML_NAMESPACE;
|
|
1034
|
+
exports.addTrustedContext = addTrustedContext;
|
|
998
1035
|
exports.addTrustedSignal = addTrustedSignal;
|
|
999
1036
|
exports.arrayEvery = arrayEvery;
|
|
1000
1037
|
exports.assert = assert;
|
|
@@ -1009,6 +1046,7 @@ exports.freeze = freeze;
|
|
|
1009
1046
|
exports.fromEntries = fromEntries;
|
|
1010
1047
|
exports.generateCustomElementTagName = generateCustomElementTagName;
|
|
1011
1048
|
exports.getAPIVersionFromNumber = getAPIVersionFromNumber;
|
|
1049
|
+
exports.getContextKeys = getContextKeys;
|
|
1012
1050
|
exports.getOwnPropertyDescriptor = getOwnPropertyDescriptor;
|
|
1013
1051
|
exports.getOwnPropertyDescriptors = getOwnPropertyDescriptors;
|
|
1014
1052
|
exports.getOwnPropertyNames = getOwnPropertyNames;
|
|
@@ -1032,6 +1070,7 @@ exports.isNumber = isNumber;
|
|
|
1032
1070
|
exports.isObject = isObject;
|
|
1033
1071
|
exports.isString = isString;
|
|
1034
1072
|
exports.isTrue = isTrue;
|
|
1073
|
+
exports.isTrustedContext = isTrustedContext;
|
|
1035
1074
|
exports.isTrustedSignal = isTrustedSignal;
|
|
1036
1075
|
exports.isUndefined = isUndefined;
|
|
1037
1076
|
exports.isVoidElement = isVoidElement;
|
|
@@ -1043,9 +1082,11 @@ exports.normalizeStyleAttributeValue = normalizeStyleAttributeValue;
|
|
|
1043
1082
|
exports.normalizeTabIndex = normalizeTabIndex;
|
|
1044
1083
|
exports.parseStyleText = parseStyleText;
|
|
1045
1084
|
exports.seal = seal;
|
|
1085
|
+
exports.setContextKeys = setContextKeys;
|
|
1046
1086
|
exports.setHooks = setHooks;
|
|
1047
1087
|
exports.setPrototypeOf = setPrototypeOf;
|
|
1088
|
+
exports.setTrustedContextSet = setTrustedContextSet;
|
|
1048
1089
|
exports.setTrustedSignalSet = setTrustedSignalSet;
|
|
1049
1090
|
exports.toString = toString;
|
|
1050
|
-
/** version: 8.
|
|
1091
|
+
/** version: 8.19.1 */
|
|
1051
1092
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -432,8 +432,42 @@ const ID_REFERENCING_ATTRIBUTES_SET = /*@__PURE__*/ new Set([
|
|
|
432
432
|
'aria-labelledby',
|
|
433
433
|
'aria-owns',
|
|
434
434
|
'for',
|
|
435
|
+
'popovertarget',
|
|
435
436
|
]);
|
|
436
437
|
|
|
438
|
+
/*
|
|
439
|
+
* Copyright (c) 2024, salesforce.com, inc.
|
|
440
|
+
* All rights reserved.
|
|
441
|
+
* SPDX-License-Identifier: MIT
|
|
442
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
443
|
+
*/
|
|
444
|
+
const ContextEventName = 'lightning:context-request';
|
|
445
|
+
let trustedContext;
|
|
446
|
+
let contextKeys;
|
|
447
|
+
function setContextKeys(config) {
|
|
448
|
+
isFalse$1(contextKeys, '`setContextKeys` cannot be called more than once');
|
|
449
|
+
contextKeys = config;
|
|
450
|
+
}
|
|
451
|
+
function getContextKeys() {
|
|
452
|
+
return contextKeys;
|
|
453
|
+
}
|
|
454
|
+
function setTrustedContextSet(context) {
|
|
455
|
+
isFalse$1(trustedContext, 'Trusted Context Set is already set!');
|
|
456
|
+
trustedContext = context;
|
|
457
|
+
}
|
|
458
|
+
function addTrustedContext(contextParticipant) {
|
|
459
|
+
// This should be a no-op when the trustedSignals set isn't set by runtime
|
|
460
|
+
trustedContext?.add(contextParticipant);
|
|
461
|
+
}
|
|
462
|
+
function isTrustedContext(target) {
|
|
463
|
+
if (!trustedContext) {
|
|
464
|
+
// The runtime didn't set a trustedContext set
|
|
465
|
+
// this check should only be performed for runtimes that care about filtering context participants to track
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
return trustedContext.has(target);
|
|
469
|
+
}
|
|
470
|
+
|
|
437
471
|
/*
|
|
438
472
|
* Copyright (c) 2023, Salesforce.com, inc.
|
|
439
473
|
* All rights reserved.
|
|
@@ -580,6 +614,7 @@ const GLOBAL_ATTRIBUTE = /*@__PURE__*/ new Set([
|
|
|
580
614
|
'lang',
|
|
581
615
|
'nonce',
|
|
582
616
|
'part',
|
|
617
|
+
'popover',
|
|
583
618
|
'slot',
|
|
584
619
|
'spellcheck',
|
|
585
620
|
'style',
|
|
@@ -732,7 +767,7 @@ function htmlEscape(str, attrMode = false) {
|
|
|
732
767
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
733
768
|
*/
|
|
734
769
|
// Increment whenever the LWC template compiler changes
|
|
735
|
-
const LWC_VERSION = "8.
|
|
770
|
+
const LWC_VERSION = "8.19.1";
|
|
736
771
|
const LWC_VERSION_COMMENT = `LWC compiler v${LWC_VERSION}`;
|
|
737
772
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
738
773
|
|
|
@@ -929,6 +964,6 @@ function normalizeTabIndex(value) {
|
|
|
929
964
|
return shouldNormalize ? 0 : value;
|
|
930
965
|
}
|
|
931
966
|
|
|
932
|
-
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, 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, addTrustedSignal, arrayEvery, assert, assign, create, defineProperties, defineProperty, entries, flattenStylesheets, forEach, freeze, fromEntries, generateCustomElementTagName, getAPIVersionFromNumber, getOwnPropertyDescriptor, getOwnPropertyDescriptors, getOwnPropertyNames, getOwnPropertySymbols, getPropertyDescriptor, getPrototypeOf, hasOwnProperty, htmlEscape, htmlPropertyToAttribute, isAPIFeatureEnabled, isAriaAttribute, isArray, isBoolean, isBooleanAttribute, isFalse, isFrozen, isFunction, isGlobalHtmlAttribute, isNull, isNumber, isObject, isString, isTrue, isTrustedSignal, isUndefined, isVoidElement, kebabCaseToCamelCase, keys, noop, normalizeClass, normalizeStyleAttributeValue, normalizeTabIndex, parseStyleText, sanitizeHtmlContent, seal, setHooks, setPrototypeOf, setTrustedSignalSet, toString };
|
|
933
|
-
/** version: 8.
|
|
967
|
+
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.19.1 */
|
|
934
969
|
//# sourceMappingURL=index.js.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.
|
|
7
|
+
"version": "8.19.1",
|
|
8
8
|
"description": "Utilities and methods that are shared across packages",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"lwc"
|