@stencil/core 5.0.0-beta.0 → 5.0.0-beta.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/app-data/index.d.ts +1 -1
- package/dist/compiler/browser.d.ts +1534 -0
- package/dist/compiler/browser.js +16436 -0
- package/dist/compiler/index.d.mts +1 -1
- package/dist/compiler/index.mjs +1 -1
- package/dist/compiler/utils/index.d.mts +1 -1
- package/dist/{compiler-NrvbUOX1.mjs → compiler-CJG6qvQt.mjs} +320 -68
- package/dist/declarations/stencil-public-compiler.d.ts +18 -3
- package/dist/declarations/stencil-public-runtime.d.ts +21 -5
- package/dist/{index-DnISpqrd.d.ts → index-BXAcVN2j.d.ts} +3 -11
- package/dist/{index-RrQfiPWK.d.mts → index-BopBfjPu.d.mts} +18 -3
- package/dist/{index-BOrz3rbJ.d.mts → index-DmHmu3y0.d.mts} +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +81 -1
- package/dist/runtime/client/lazy.js +98 -7
- package/dist/runtime/client/runtime.d.ts +30 -12
- package/dist/runtime/client/runtime.js +98 -7
- package/dist/runtime/index.d.ts +28 -2
- package/dist/runtime/index.js +98 -7
- package/dist/runtime/server/index.d.mts +27 -1
- package/dist/runtime/server/index.mjs +96 -5
- package/dist/sys/node/index.d.mts +1 -1
- package/dist/sys/node/worker.mjs +1 -1
- package/dist/testing/index.d.mts +17 -2
- package/dist/testing/index.mjs +19 -49
- package/package.json +9 -5
|
@@ -457,8 +457,6 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
457
457
|
if (module) return module[exportName];
|
|
458
458
|
const retryCount = failedLoadAttempts.get(bundleId) ?? 0;
|
|
459
459
|
const cacheBustParams = [retryCount > 0 ? `s-retry=${retryCount}` : "", BUILD$1.hotModuleReplacement && hmrVersionId ? `s-hmr=${hmrVersionId}` : ""].filter(Boolean).join("&");
|
|
460
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
461
|
-
const entryFile = `${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`;
|
|
462
460
|
const onLoad = (importedModule) => {
|
|
463
461
|
if (!BUILD$1.hotModuleReplacement) {
|
|
464
462
|
failedLoadAttempts.delete(bundleId);
|
|
@@ -470,6 +468,8 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
470
468
|
failedLoadAttempts.set(bundleId, retryCount + 1);
|
|
471
469
|
consoleError(e, hostRef.$hostElement$);
|
|
472
470
|
};
|
|
471
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
472
|
+
const entryFile = `${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`;
|
|
473
473
|
if (lazyLoadBasePath) return import(
|
|
474
474
|
/* @vite-ignore */
|
|
475
475
|
/* webpackInclude: /\.entry\.js$/ */
|
|
@@ -3713,12 +3713,13 @@ const restoreSafeSelector = (placeholders, content) => {
|
|
|
3713
3713
|
const _polyfillHost = "-shadowcsshost";
|
|
3714
3714
|
const _polyfillSlotted = "-shadowcssslotted";
|
|
3715
3715
|
const _polyfillHostContext = "-shadowcsscontext";
|
|
3716
|
+
const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
|
|
3716
3717
|
let _cssColonHostRe;
|
|
3717
3718
|
let _cssColonHostContextRe;
|
|
3718
3719
|
let _cssColonSlottedRe;
|
|
3719
|
-
const getCssColonHostRe = () => _cssColonHostRe ??=
|
|
3720
|
-
const getCssColonHostContextRe = () => _cssColonHostContextRe ??=
|
|
3721
|
-
const getCssColonSlottedRe = () => _cssColonSlottedRe ??=
|
|
3720
|
+
const getCssColonHostRe = () => _cssColonHostRe ??= new RegExp("(-shadowcsshost" + _parenSuffix, "gim");
|
|
3721
|
+
const getCssColonHostContextRe = () => _cssColonHostContextRe ??= new RegExp("(-shadowcsscontext" + _parenSuffix, "gim");
|
|
3722
|
+
const getCssColonSlottedRe = () => _cssColonSlottedRe ??= new RegExp("(-shadowcssslotted" + _parenSuffix, "gim");
|
|
3722
3723
|
const _polyfillHostNoCombinator = "-shadowcsshost-no-combinator";
|
|
3723
3724
|
const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
|
|
3724
3725
|
const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
|
|
@@ -4284,6 +4285,14 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
4284
4285
|
//#endregion
|
|
4285
4286
|
//#region src/runtime/proxy-component.ts
|
|
4286
4287
|
/**
|
|
4288
|
+
* Serialize a prop value the way `setAccessor()` does when it reflects it, so the runtime can
|
|
4289
|
+
* recognize an `attributeChangedCallback` it triggered itself.
|
|
4290
|
+
*
|
|
4291
|
+
* @param propValue the current value of a reflected prop
|
|
4292
|
+
* @returns the string the attribute would hold, or `null` if the attribute would be removed
|
|
4293
|
+
*/
|
|
4294
|
+
const reflectedAttrValue = (propValue) => propValue == null || propValue === false ? null : propValue === true ? "" : String(propValue);
|
|
4295
|
+
/**
|
|
4287
4296
|
* Attach a series of runtime constructs to a compiled Stencil component
|
|
4288
4297
|
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
4289
4298
|
* decorators, callbacks for when attributes change, and so on.
|
|
@@ -4431,7 +4440,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
4431
4440
|
return;
|
|
4432
4441
|
}
|
|
4433
4442
|
const propFlags = members.find(([m]) => m === propName);
|
|
4434
|
-
const
|
|
4443
|
+
const propMemberFlags = propFlags ? propFlags[1][0] : 0;
|
|
4444
|
+
const isBooleanTarget = propMemberFlags & MEMBER_FLAGS.Boolean;
|
|
4445
|
+
if (BUILD$1.reflect && propMemberFlags & MEMBER_FLAGS.ReflectAttr && propMemberFlags & MEMBER_FLAGS.Any && !isComplexType(this[propName]) && reflectedAttrValue(this[propName]) === newValue) return;
|
|
4435
4446
|
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
4436
4447
|
if (isBooleanTarget) newValue = !(newValue === null || newValue === "false");
|
|
4437
4448
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
@@ -5047,6 +5058,86 @@ const hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
|
5047
5058
|
capture: (flags & LISTENER_FLAGS.Capture) !== 0
|
|
5048
5059
|
} : (flags & LISTENER_FLAGS.Capture) !== 0;
|
|
5049
5060
|
//#endregion
|
|
5061
|
+
//#region src/runtime/inject-side-effect-style.ts
|
|
5062
|
+
const styleSheets = /* @__PURE__ */ new Map();
|
|
5063
|
+
const knownRoots = /* @__PURE__ */ new Set();
|
|
5064
|
+
const adoptedRoots = /* @__PURE__ */ new WeakMap();
|
|
5065
|
+
const knownFontFaces = /* @__PURE__ */ new Set();
|
|
5066
|
+
const adopt = (root, sheet) => {
|
|
5067
|
+
let roots = adoptedRoots.get(sheet);
|
|
5068
|
+
if (!roots) {
|
|
5069
|
+
roots = /* @__PURE__ */ new WeakSet();
|
|
5070
|
+
adoptedRoots.set(sheet, roots);
|
|
5071
|
+
}
|
|
5072
|
+
if (!roots.has(root)) {
|
|
5073
|
+
roots.add(root);
|
|
5074
|
+
root.adoptedStyleSheets = [...root.adoptedStyleSheets, sheet];
|
|
5075
|
+
}
|
|
5076
|
+
};
|
|
5077
|
+
/**
|
|
5078
|
+
* Registers a root (a shadow root, or `document`) to receive every side-effect CSS import
|
|
5079
|
+
* (a plain, non-component `import './foo.css'`), now and in future. Call in `connectedCallback`,
|
|
5080
|
+
* paired with `unregisterSideEffectStyleTarget` in `disconnectedCallback` so the registry doesn't
|
|
5081
|
+
* hold disconnected roots forever.
|
|
5082
|
+
* @param root the root to register
|
|
5083
|
+
*/
|
|
5084
|
+
function registerSideEffectStyleTarget(root) {
|
|
5085
|
+
knownRoots.add(root);
|
|
5086
|
+
for (const sheet of styleSheets.values()) adopt(root, sheet);
|
|
5087
|
+
}
|
|
5088
|
+
/**
|
|
5089
|
+
* Removes a root registered via `registerSideEffectStyleTarget` - call in `disconnectedCallback`.
|
|
5090
|
+
* @param root the root to unregister
|
|
5091
|
+
*/
|
|
5092
|
+
function unregisterSideEffectStyleTarget(root) {
|
|
5093
|
+
knownRoots.delete(root);
|
|
5094
|
+
}
|
|
5095
|
+
const FONT_FACE_RE = /@font-face\s*\{[^{}]*\}/g;
|
|
5096
|
+
/**
|
|
5097
|
+
* Splits `@font-face` rules out of a CSS text - exported standalone (from private
|
|
5098
|
+
* module state - usually 3rd party node_modules) exported for testing
|
|
5099
|
+
* @param cssText the CSS text to split
|
|
5100
|
+
* @returns the font-face rules joined together (`null` if there were none) and the remaining CSS
|
|
5101
|
+
*/
|
|
5102
|
+
function splitFontFaces(cssText) {
|
|
5103
|
+
const fontFaces = cssText.match(FONT_FACE_RE);
|
|
5104
|
+
if (!fontFaces) return {
|
|
5105
|
+
fontFaceText: null,
|
|
5106
|
+
rest: cssText
|
|
5107
|
+
};
|
|
5108
|
+
return {
|
|
5109
|
+
fontFaceText: fontFaces.join("\n"),
|
|
5110
|
+
rest: cssText.replace(FONT_FACE_RE, "")
|
|
5111
|
+
};
|
|
5112
|
+
}
|
|
5113
|
+
/**
|
|
5114
|
+
* Applies plain (non-component) CSS text to every registered root - respects shadow DOM
|
|
5115
|
+
* encapsulation instead of always reaching for the top-level document. Not meant to be called
|
|
5116
|
+
* directly: this is what the compiler's CSS-to-ESM output calls for CSS with no Stencil `tag`
|
|
5117
|
+
* (i.e. not a component's own `styleUrl`), typically a third-party dependency's CSS import.
|
|
5118
|
+
*
|
|
5119
|
+
* `@font-face` rules are pulled out and adopted onto top-level `document` not per-root
|
|
5120
|
+
* (Chromium (https://issues.chromium.org/issues/41085401) per-root never loads).
|
|
5121
|
+
* @param cssText the CSS text to apply
|
|
5122
|
+
*/
|
|
5123
|
+
function injectSideEffectStyle(cssText) {
|
|
5124
|
+
const { fontFaceText, rest } = splitFontFaces(cssText);
|
|
5125
|
+
if (fontFaceText && !knownFontFaces.has(fontFaceText)) {
|
|
5126
|
+
knownFontFaces.add(fontFaceText);
|
|
5127
|
+
const fontFaceSheet = new CSSStyleSheet();
|
|
5128
|
+
fontFaceSheet.replaceSync(fontFaceText);
|
|
5129
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, fontFaceSheet];
|
|
5130
|
+
}
|
|
5131
|
+
if (!rest.trim()) return;
|
|
5132
|
+
let sheet = styleSheets.get(rest);
|
|
5133
|
+
if (!sheet) {
|
|
5134
|
+
sheet = new CSSStyleSheet();
|
|
5135
|
+
sheet.replaceSync(rest);
|
|
5136
|
+
styleSheets.set(rest, sheet);
|
|
5137
|
+
}
|
|
5138
|
+
for (const root of knownRoots) adopt(root, sheet);
|
|
5139
|
+
}
|
|
5140
|
+
//#endregion
|
|
5050
5141
|
//#region src/runtime/mixin.ts
|
|
5051
5142
|
const baseClass = BUILD$1.lazyLoad ? class {} : globalThis.HTMLElement || class {};
|
|
5052
5143
|
function Mixin(...mixins) {
|
|
@@ -5218,4 +5309,4 @@ function hasKeys(obj) {
|
|
|
5218
5309
|
return false;
|
|
5219
5310
|
}
|
|
5220
5311
|
//#endregion
|
|
5221
|
-
export { AttachInternals, AttrDeserialize, BUILD, Build, Component, Element$1 as Element, Env, Event, Fragment, H, H as HTMLElement, HYDRATED_STYLE_ID, Host, Listen, Method, Mixin, NAMESPACE, Prop, PropSerialize, ReactiveControllerHost, STENCIL_DEV_MODE, State, Watch, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRegistry, getRenderingRef, getShadowRoot, getValue, h, isMemberInElement, jsx, jsxDEV, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, normalizeWatchers, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, render, resolveVar, setAssetPath, setErrorHandler, setLazyLoadBasePath, setMode, setNonce, setPlatformHelpers, setPlatformOptions, setRegistry, setScopedSsr, setTagTransformer, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, transformTag, win, writeTask };
|
|
5312
|
+
export { AttachInternals, AttrDeserialize, BUILD, Build, Component, Element$1 as Element, Env, Event, Fragment, H, H as HTMLElement, HYDRATED_STYLE_ID, Host, Listen, Method, Mixin, NAMESPACE, Prop, PropSerialize, ReactiveControllerHost, STENCIL_DEV_MODE, State, Watch, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRegistry, getRenderingRef, getShadowRoot, getValue, h, injectSideEffectStyle, isMemberInElement, jsx, jsxDEV, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, normalizeWatchers, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, registerSideEffectStyleTarget, render, resolveVar, setAssetPath, setErrorHandler, setLazyLoadBasePath, setMode, setNonce, setPlatformHelpers, setPlatformOptions, setRegistry, setScopedSsr, setTagTransformer, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, transformTag, unregisterSideEffectStyleTarget, win, writeTask };
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ReactiveControllerHostInterface, E as VNode, S as MixedInCtor, T as TagTransformer, _ as ComponentInterface, a as ComponentConstructor, b as HTMLStencilElement, c as ComponentRuntimeMeta, d as HostRef, f as LazyBundlesRuntimeData, g as RuntimeRef, h as RenderNode, i as ChildType, l as ComponentRuntimeMetaCompact, m as PropsType, o as ComponentConstructorChangeHandlers, p as PlatformRuntime, s as ComponentRuntimeHostListener, u as HostElement, v as CustomElementsDefineOptions, w as ResolutionHandler, x as JSXBase, y as FunctionalComponent } from "../index-
|
|
1
|
+
import { C as ReactiveControllerHostInterface, E as VNode, S as MixedInCtor, T as TagTransformer, _ as ComponentInterface, a as ComponentConstructor, b as HTMLStencilElement, c as ComponentRuntimeMeta, d as HostRef, f as LazyBundlesRuntimeData, g as RuntimeRef, h as RenderNode, i as ChildType, l as ComponentRuntimeMetaCompact, m as PropsType, o as ComponentConstructorChangeHandlers, p as PlatformRuntime, s as ComponentRuntimeHostListener, u as HostElement, v as CustomElementsDefineOptions, w as ResolutionHandler, x as JSXBase, y as FunctionalComponent } from "../index-BXAcVN2j.js";
|
|
2
2
|
//#region src/runtime/asset-path.d.ts
|
|
3
3
|
declare const getAssetPath: (path: string) => string;
|
|
4
4
|
declare const setAssetPath: (path: string) => string;
|
|
@@ -47,6 +47,32 @@ declare const Fragment: FunctionalComponent;
|
|
|
47
47
|
//#region src/runtime/host-listener.d.ts
|
|
48
48
|
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
|
|
49
49
|
//#endregion
|
|
50
|
+
//#region src/runtime/inject-side-effect-style.d.ts
|
|
51
|
+
/**
|
|
52
|
+
* Registers a root (a shadow root, or `document`) to receive every side-effect CSS import
|
|
53
|
+
* (a plain, non-component `import './foo.css'`), now and in future. Call in `connectedCallback`,
|
|
54
|
+
* paired with `unregisterSideEffectStyleTarget` in `disconnectedCallback` so the registry doesn't
|
|
55
|
+
* hold disconnected roots forever.
|
|
56
|
+
* @param root the root to register
|
|
57
|
+
*/
|
|
58
|
+
declare function registerSideEffectStyleTarget(root: DocumentOrShadowRoot): void;
|
|
59
|
+
/**
|
|
60
|
+
* Removes a root registered via `registerSideEffectStyleTarget` - call in `disconnectedCallback`.
|
|
61
|
+
* @param root the root to unregister
|
|
62
|
+
*/
|
|
63
|
+
declare function unregisterSideEffectStyleTarget(root: DocumentOrShadowRoot): void;
|
|
64
|
+
/**
|
|
65
|
+
* Applies plain (non-component) CSS text to every registered root - respects shadow DOM
|
|
66
|
+
* encapsulation instead of always reaching for the top-level document. Not meant to be called
|
|
67
|
+
* directly: this is what the compiler's CSS-to-ESM output calls for CSS with no Stencil `tag`
|
|
68
|
+
* (i.e. not a component's own `styleUrl`), typically a third-party dependency's CSS import.
|
|
69
|
+
*
|
|
70
|
+
* `@font-face` rules are pulled out and adopted onto top-level `document` not per-root
|
|
71
|
+
* (Chromium (https://issues.chromium.org/issues/41085401) per-root never loads).
|
|
72
|
+
* @param cssText the CSS text to apply
|
|
73
|
+
*/
|
|
74
|
+
declare function injectSideEffectStyle(cssText: string): void;
|
|
75
|
+
//#endregion
|
|
50
76
|
//#region src/runtime/mixin.d.ts
|
|
51
77
|
type Ctor<T = {}> = new (...args: any[]) => T;
|
|
52
78
|
declare function Mixin(...mixins: ((base: Ctor) => Ctor)[]): Ctor<{}>;
|
|
@@ -210,4 +236,4 @@ declare const jsxs: typeof jsx;
|
|
|
210
236
|
*/
|
|
211
237
|
declare const jsxDEV: typeof jsx;
|
|
212
238
|
//#endregion
|
|
213
|
-
export { Fragment, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Mixin, ReactiveControllerHost, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRegistry, getRenderingRef, getShadowRoot, getValue, h, jsx, jsxDEV, jsxs, normalizeWatchers, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, setAssetPath, setMode, setNonce, setPlatformOptions, setRegistry, setTagTransformer, setValue, transformTag };
|
|
239
|
+
export { Fragment, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Mixin, ReactiveControllerHost, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRegistry, getRenderingRef, getShadowRoot, getValue, h, injectSideEffectStyle, jsx, jsxDEV, jsxs, normalizeWatchers, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, registerSideEffectStyleTarget, render, setAssetPath, setMode, setNonce, setPlatformOptions, setRegistry, setTagTransformer, setValue, transformTag, unregisterSideEffectStyleTarget };
|
package/dist/runtime/index.js
CHANGED
|
@@ -347,8 +347,6 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
347
347
|
if (module) return module[exportName];
|
|
348
348
|
const retryCount = failedLoadAttempts.get(bundleId) ?? 0;
|
|
349
349
|
const cacheBustParams = [retryCount > 0 ? `s-retry=${retryCount}` : "", BUILD.hotModuleReplacement && hmrVersionId ? `s-hmr=${hmrVersionId}` : ""].filter(Boolean).join("&");
|
|
350
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
351
|
-
const entryFile = `${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`;
|
|
352
350
|
const onLoad = (importedModule) => {
|
|
353
351
|
if (!BUILD.hotModuleReplacement) {
|
|
354
352
|
failedLoadAttempts.delete(bundleId);
|
|
@@ -360,6 +358,8 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
360
358
|
failedLoadAttempts.set(bundleId, retryCount + 1);
|
|
361
359
|
consoleError(e, hostRef.$hostElement$);
|
|
362
360
|
};
|
|
361
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
362
|
+
const entryFile = `${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`;
|
|
363
363
|
return import(
|
|
364
364
|
/* @vite-ignore */
|
|
365
365
|
/* webpackInclude: /\.entry\.js$/ */
|
|
@@ -3585,12 +3585,13 @@ const restoreSafeSelector = (placeholders, content) => {
|
|
|
3585
3585
|
const _polyfillHost = "-shadowcsshost";
|
|
3586
3586
|
const _polyfillSlotted = "-shadowcssslotted";
|
|
3587
3587
|
const _polyfillHostContext = "-shadowcsscontext";
|
|
3588
|
+
const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
|
|
3588
3589
|
let _cssColonHostRe;
|
|
3589
3590
|
let _cssColonHostContextRe;
|
|
3590
3591
|
let _cssColonSlottedRe;
|
|
3591
|
-
const getCssColonHostRe = () => _cssColonHostRe ??=
|
|
3592
|
-
const getCssColonHostContextRe = () => _cssColonHostContextRe ??=
|
|
3593
|
-
const getCssColonSlottedRe = () => _cssColonSlottedRe ??=
|
|
3592
|
+
const getCssColonHostRe = () => _cssColonHostRe ??= new RegExp("(-shadowcsshost" + _parenSuffix, "gim");
|
|
3593
|
+
const getCssColonHostContextRe = () => _cssColonHostContextRe ??= new RegExp("(-shadowcsscontext" + _parenSuffix, "gim");
|
|
3594
|
+
const getCssColonSlottedRe = () => _cssColonSlottedRe ??= new RegExp("(-shadowcssslotted" + _parenSuffix, "gim");
|
|
3594
3595
|
const _polyfillHostNoCombinator = "-shadowcsshost-no-combinator";
|
|
3595
3596
|
const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
|
|
3596
3597
|
const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
|
|
@@ -4156,6 +4157,14 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
4156
4157
|
//#endregion
|
|
4157
4158
|
//#region src/runtime/proxy-component.ts
|
|
4158
4159
|
/**
|
|
4160
|
+
* Serialize a prop value the way `setAccessor()` does when it reflects it, so the runtime can
|
|
4161
|
+
* recognize an `attributeChangedCallback` it triggered itself.
|
|
4162
|
+
*
|
|
4163
|
+
* @param propValue the current value of a reflected prop
|
|
4164
|
+
* @returns the string the attribute would hold, or `null` if the attribute would be removed
|
|
4165
|
+
*/
|
|
4166
|
+
const reflectedAttrValue = (propValue) => propValue == null || propValue === false ? null : propValue === true ? "" : String(propValue);
|
|
4167
|
+
/**
|
|
4159
4168
|
* Attach a series of runtime constructs to a compiled Stencil component
|
|
4160
4169
|
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
4161
4170
|
* decorators, callbacks for when attributes change, and so on.
|
|
@@ -4303,7 +4312,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
4303
4312
|
return;
|
|
4304
4313
|
}
|
|
4305
4314
|
const propFlags = members.find(([m]) => m === propName);
|
|
4306
|
-
const
|
|
4315
|
+
const propMemberFlags = propFlags ? propFlags[1][0] : 0;
|
|
4316
|
+
const isBooleanTarget = propMemberFlags & MEMBER_FLAGS.Boolean;
|
|
4317
|
+
if (BUILD.reflect && propMemberFlags & MEMBER_FLAGS.ReflectAttr && propMemberFlags & MEMBER_FLAGS.Any && !isComplexType(this[propName]) && reflectedAttrValue(this[propName]) === newValue) return;
|
|
4307
4318
|
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
4308
4319
|
if (isBooleanTarget) newValue = !(newValue === null || newValue === "false");
|
|
4309
4320
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
@@ -4919,6 +4930,86 @@ const hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
|
4919
4930
|
capture: (flags & LISTENER_FLAGS.Capture) !== 0
|
|
4920
4931
|
} : (flags & LISTENER_FLAGS.Capture) !== 0;
|
|
4921
4932
|
//#endregion
|
|
4933
|
+
//#region src/runtime/inject-side-effect-style.ts
|
|
4934
|
+
const styleSheets = /* @__PURE__ */ new Map();
|
|
4935
|
+
const knownRoots = /* @__PURE__ */ new Set();
|
|
4936
|
+
const adoptedRoots = /* @__PURE__ */ new WeakMap();
|
|
4937
|
+
const knownFontFaces = /* @__PURE__ */ new Set();
|
|
4938
|
+
const adopt = (root, sheet) => {
|
|
4939
|
+
let roots = adoptedRoots.get(sheet);
|
|
4940
|
+
if (!roots) {
|
|
4941
|
+
roots = /* @__PURE__ */ new WeakSet();
|
|
4942
|
+
adoptedRoots.set(sheet, roots);
|
|
4943
|
+
}
|
|
4944
|
+
if (!roots.has(root)) {
|
|
4945
|
+
roots.add(root);
|
|
4946
|
+
root.adoptedStyleSheets = [...root.adoptedStyleSheets, sheet];
|
|
4947
|
+
}
|
|
4948
|
+
};
|
|
4949
|
+
/**
|
|
4950
|
+
* Registers a root (a shadow root, or `document`) to receive every side-effect CSS import
|
|
4951
|
+
* (a plain, non-component `import './foo.css'`), now and in future. Call in `connectedCallback`,
|
|
4952
|
+
* paired with `unregisterSideEffectStyleTarget` in `disconnectedCallback` so the registry doesn't
|
|
4953
|
+
* hold disconnected roots forever.
|
|
4954
|
+
* @param root the root to register
|
|
4955
|
+
*/
|
|
4956
|
+
function registerSideEffectStyleTarget(root) {
|
|
4957
|
+
knownRoots.add(root);
|
|
4958
|
+
for (const sheet of styleSheets.values()) adopt(root, sheet);
|
|
4959
|
+
}
|
|
4960
|
+
/**
|
|
4961
|
+
* Removes a root registered via `registerSideEffectStyleTarget` - call in `disconnectedCallback`.
|
|
4962
|
+
* @param root the root to unregister
|
|
4963
|
+
*/
|
|
4964
|
+
function unregisterSideEffectStyleTarget(root) {
|
|
4965
|
+
knownRoots.delete(root);
|
|
4966
|
+
}
|
|
4967
|
+
const FONT_FACE_RE = /@font-face\s*\{[^{}]*\}/g;
|
|
4968
|
+
/**
|
|
4969
|
+
* Splits `@font-face` rules out of a CSS text - exported standalone (from private
|
|
4970
|
+
* module state - usually 3rd party node_modules) exported for testing
|
|
4971
|
+
* @param cssText the CSS text to split
|
|
4972
|
+
* @returns the font-face rules joined together (`null` if there were none) and the remaining CSS
|
|
4973
|
+
*/
|
|
4974
|
+
function splitFontFaces(cssText) {
|
|
4975
|
+
const fontFaces = cssText.match(FONT_FACE_RE);
|
|
4976
|
+
if (!fontFaces) return {
|
|
4977
|
+
fontFaceText: null,
|
|
4978
|
+
rest: cssText
|
|
4979
|
+
};
|
|
4980
|
+
return {
|
|
4981
|
+
fontFaceText: fontFaces.join("\n"),
|
|
4982
|
+
rest: cssText.replace(FONT_FACE_RE, "")
|
|
4983
|
+
};
|
|
4984
|
+
}
|
|
4985
|
+
/**
|
|
4986
|
+
* Applies plain (non-component) CSS text to every registered root - respects shadow DOM
|
|
4987
|
+
* encapsulation instead of always reaching for the top-level document. Not meant to be called
|
|
4988
|
+
* directly: this is what the compiler's CSS-to-ESM output calls for CSS with no Stencil `tag`
|
|
4989
|
+
* (i.e. not a component's own `styleUrl`), typically a third-party dependency's CSS import.
|
|
4990
|
+
*
|
|
4991
|
+
* `@font-face` rules are pulled out and adopted onto top-level `document` not per-root
|
|
4992
|
+
* (Chromium (https://issues.chromium.org/issues/41085401) per-root never loads).
|
|
4993
|
+
* @param cssText the CSS text to apply
|
|
4994
|
+
*/
|
|
4995
|
+
function injectSideEffectStyle(cssText) {
|
|
4996
|
+
const { fontFaceText, rest } = splitFontFaces(cssText);
|
|
4997
|
+
if (fontFaceText && !knownFontFaces.has(fontFaceText)) {
|
|
4998
|
+
knownFontFaces.add(fontFaceText);
|
|
4999
|
+
const fontFaceSheet = new CSSStyleSheet();
|
|
5000
|
+
fontFaceSheet.replaceSync(fontFaceText);
|
|
5001
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, fontFaceSheet];
|
|
5002
|
+
}
|
|
5003
|
+
if (!rest.trim()) return;
|
|
5004
|
+
let sheet = styleSheets.get(rest);
|
|
5005
|
+
if (!sheet) {
|
|
5006
|
+
sheet = new CSSStyleSheet();
|
|
5007
|
+
sheet.replaceSync(rest);
|
|
5008
|
+
styleSheets.set(rest, sheet);
|
|
5009
|
+
}
|
|
5010
|
+
for (const root of knownRoots) adopt(root, sheet);
|
|
5011
|
+
}
|
|
5012
|
+
//#endregion
|
|
4922
5013
|
//#region src/runtime/mixin.ts
|
|
4923
5014
|
const baseClass = BUILD.lazyLoad ? class {} : globalThis.HTMLElement || class {};
|
|
4924
5015
|
function Mixin(...mixins) {
|
|
@@ -5090,4 +5181,4 @@ function hasKeys(obj) {
|
|
|
5090
5181
|
return false;
|
|
5091
5182
|
}
|
|
5092
5183
|
//#endregion
|
|
5093
|
-
export { Fragment, HYDRATED_STYLE_ID, Host, Mixin, ReactiveControllerHost, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRegistry, getRenderingRef, getShadowRoot, getValue, h, jsx, jsxDEV, jsxs, normalizeWatchers, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, setAssetPath, setMode, setNonce, setPlatformOptions, setRegistry, setTagTransformer, setValue, transformTag };
|
|
5184
|
+
export { Fragment, HYDRATED_STYLE_ID, Host, Mixin, ReactiveControllerHost, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRegistry, getRenderingRef, getShadowRoot, getValue, h, injectSideEffectStyle, jsx, jsxDEV, jsxs, normalizeWatchers, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, registerSideEffectStyleTarget, render, setAssetPath, setMode, setNonce, setPlatformOptions, setRegistry, setTagTransformer, setValue, transformTag, unregisterSideEffectStyleTarget };
|
|
@@ -1069,6 +1069,32 @@ declare const Fragment: FunctionalComponent;
|
|
|
1069
1069
|
//#region src/runtime/host-listener.d.ts
|
|
1070
1070
|
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
|
|
1071
1071
|
//#endregion
|
|
1072
|
+
//#region src/runtime/inject-side-effect-style.d.ts
|
|
1073
|
+
/**
|
|
1074
|
+
* Registers a root (a shadow root, or `document`) to receive every side-effect CSS import
|
|
1075
|
+
* (a plain, non-component `import './foo.css'`), now and in future. Call in `connectedCallback`,
|
|
1076
|
+
* paired with `unregisterSideEffectStyleTarget` in `disconnectedCallback` so the registry doesn't
|
|
1077
|
+
* hold disconnected roots forever.
|
|
1078
|
+
* @param root the root to register
|
|
1079
|
+
*/
|
|
1080
|
+
declare function registerSideEffectStyleTarget(root: DocumentOrShadowRoot): void;
|
|
1081
|
+
/**
|
|
1082
|
+
* Removes a root registered via `registerSideEffectStyleTarget` - call in `disconnectedCallback`.
|
|
1083
|
+
* @param root the root to unregister
|
|
1084
|
+
*/
|
|
1085
|
+
declare function unregisterSideEffectStyleTarget(root: DocumentOrShadowRoot): void;
|
|
1086
|
+
/**
|
|
1087
|
+
* Applies plain (non-component) CSS text to every registered root - respects shadow DOM
|
|
1088
|
+
* encapsulation instead of always reaching for the top-level document. Not meant to be called
|
|
1089
|
+
* directly: this is what the compiler's CSS-to-ESM output calls for CSS with no Stencil `tag`
|
|
1090
|
+
* (i.e. not a component's own `styleUrl`), typically a third-party dependency's CSS import.
|
|
1091
|
+
*
|
|
1092
|
+
* `@font-face` rules are pulled out and adopted onto top-level `document` not per-root
|
|
1093
|
+
* (Chromium (https://issues.chromium.org/issues/41085401) per-root never loads).
|
|
1094
|
+
* @param cssText the CSS text to apply
|
|
1095
|
+
*/
|
|
1096
|
+
declare function injectSideEffectStyle(cssText: string): void;
|
|
1097
|
+
//#endregion
|
|
1072
1098
|
//#region src/runtime/mixin.d.ts
|
|
1073
1099
|
type Ctor<T = {}> = new (...args: any[]) => T;
|
|
1074
1100
|
declare function Mixin(...mixins: ((base: Ctor) => Ctor)[]): Ctor<{}>;
|
|
@@ -1248,4 +1274,4 @@ declare const setAssetPath: (path: string) => string;
|
|
|
1248
1274
|
declare const setScopedSsr: (opts: SsrFactoryOptions) => void;
|
|
1249
1275
|
declare const needsScopedSSR: () => boolean;
|
|
1250
1276
|
//#endregion
|
|
1251
|
-
export { BUILD, Build, Env, Fragment, Host, Mixin, NAMESPACE, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getShadowRoot, getValue, hAsync as h, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setScopedSsr, setTagTransformer, setValue, ssrApp, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, transformTag, win, writeTask };
|
|
1277
|
+
export { BUILD, Build, Env, Fragment, Host, Mixin, NAMESPACE, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getShadowRoot, getValue, hAsync as h, injectSideEffectStyle, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, registerSideEffectStyleTarget, renderVdom, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setScopedSsr, setTagTransformer, setValue, ssrApp, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, transformTag, unregisterSideEffectStyleTarget, win, writeTask };
|
|
@@ -3329,12 +3329,13 @@ const restoreSafeSelector = (placeholders, content) => {
|
|
|
3329
3329
|
const _polyfillHost = "-shadowcsshost";
|
|
3330
3330
|
const _polyfillSlotted = "-shadowcssslotted";
|
|
3331
3331
|
const _polyfillHostContext = "-shadowcsscontext";
|
|
3332
|
+
const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
|
|
3332
3333
|
let _cssColonHostRe;
|
|
3333
3334
|
let _cssColonHostContextRe;
|
|
3334
3335
|
let _cssColonSlottedRe;
|
|
3335
|
-
const getCssColonHostRe = () => _cssColonHostRe ??=
|
|
3336
|
-
const getCssColonHostContextRe = () => _cssColonHostContextRe ??=
|
|
3337
|
-
const getCssColonSlottedRe = () => _cssColonSlottedRe ??=
|
|
3336
|
+
const getCssColonHostRe = () => _cssColonHostRe ??= new RegExp("(-shadowcsshost" + _parenSuffix, "gim");
|
|
3337
|
+
const getCssColonHostContextRe = () => _cssColonHostContextRe ??= new RegExp("(-shadowcsscontext" + _parenSuffix, "gim");
|
|
3338
|
+
const getCssColonSlottedRe = () => _cssColonSlottedRe ??= new RegExp("(-shadowcssslotted" + _parenSuffix, "gim");
|
|
3338
3339
|
const _polyfillHostNoCombinator = "-shadowcsshost-no-combinator";
|
|
3339
3340
|
const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
|
|
3340
3341
|
const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
|
|
@@ -3900,6 +3901,14 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3900
3901
|
//#endregion
|
|
3901
3902
|
//#region src/runtime/proxy-component.ts
|
|
3902
3903
|
/**
|
|
3904
|
+
* Serialize a prop value the way `setAccessor()` does when it reflects it, so the runtime can
|
|
3905
|
+
* recognize an `attributeChangedCallback` it triggered itself.
|
|
3906
|
+
*
|
|
3907
|
+
* @param propValue the current value of a reflected prop
|
|
3908
|
+
* @returns the string the attribute would hold, or `null` if the attribute would be removed
|
|
3909
|
+
*/
|
|
3910
|
+
const reflectedAttrValue = (propValue) => propValue == null || propValue === false ? null : propValue === true ? "" : String(propValue);
|
|
3911
|
+
/**
|
|
3903
3912
|
* Attach a series of runtime constructs to a compiled Stencil component
|
|
3904
3913
|
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
3905
3914
|
* decorators, callbacks for when attributes change, and so on.
|
|
@@ -4047,7 +4056,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
4047
4056
|
return;
|
|
4048
4057
|
}
|
|
4049
4058
|
const propFlags = members.find(([m]) => m === propName);
|
|
4050
|
-
const
|
|
4059
|
+
const propMemberFlags = propFlags ? propFlags[1][0] : 0;
|
|
4060
|
+
const isBooleanTarget = propMemberFlags & MEMBER_FLAGS.Boolean;
|
|
4061
|
+
if (BUILD$1.reflect && propMemberFlags & MEMBER_FLAGS.ReflectAttr && propMemberFlags & MEMBER_FLAGS.Any && !isComplexType(this[propName]) && reflectedAttrValue(this[propName]) === newValue) return;
|
|
4051
4062
|
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
4052
4063
|
if (isBooleanTarget) newValue = !(newValue === null || newValue === "false");
|
|
4053
4064
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
@@ -4660,6 +4671,86 @@ const getHostListenerTarget = (doc, elm, flags) => {
|
|
|
4660
4671
|
};
|
|
4661
4672
|
const hostListenerOpts = (flags) => (flags & LISTENER_FLAGS.Capture) !== 0;
|
|
4662
4673
|
//#endregion
|
|
4674
|
+
//#region src/runtime/inject-side-effect-style.ts
|
|
4675
|
+
const styleSheets = /* @__PURE__ */ new Map();
|
|
4676
|
+
const knownRoots = /* @__PURE__ */ new Set();
|
|
4677
|
+
const adoptedRoots = /* @__PURE__ */ new WeakMap();
|
|
4678
|
+
const knownFontFaces = /* @__PURE__ */ new Set();
|
|
4679
|
+
const adopt = (root, sheet) => {
|
|
4680
|
+
let roots = adoptedRoots.get(sheet);
|
|
4681
|
+
if (!roots) {
|
|
4682
|
+
roots = /* @__PURE__ */ new WeakSet();
|
|
4683
|
+
adoptedRoots.set(sheet, roots);
|
|
4684
|
+
}
|
|
4685
|
+
if (!roots.has(root)) {
|
|
4686
|
+
roots.add(root);
|
|
4687
|
+
root.adoptedStyleSheets = [...root.adoptedStyleSheets, sheet];
|
|
4688
|
+
}
|
|
4689
|
+
};
|
|
4690
|
+
/**
|
|
4691
|
+
* Registers a root (a shadow root, or `document`) to receive every side-effect CSS import
|
|
4692
|
+
* (a plain, non-component `import './foo.css'`), now and in future. Call in `connectedCallback`,
|
|
4693
|
+
* paired with `unregisterSideEffectStyleTarget` in `disconnectedCallback` so the registry doesn't
|
|
4694
|
+
* hold disconnected roots forever.
|
|
4695
|
+
* @param root the root to register
|
|
4696
|
+
*/
|
|
4697
|
+
function registerSideEffectStyleTarget(root) {
|
|
4698
|
+
knownRoots.add(root);
|
|
4699
|
+
for (const sheet of styleSheets.values()) adopt(root, sheet);
|
|
4700
|
+
}
|
|
4701
|
+
/**
|
|
4702
|
+
* Removes a root registered via `registerSideEffectStyleTarget` - call in `disconnectedCallback`.
|
|
4703
|
+
* @param root the root to unregister
|
|
4704
|
+
*/
|
|
4705
|
+
function unregisterSideEffectStyleTarget(root) {
|
|
4706
|
+
knownRoots.delete(root);
|
|
4707
|
+
}
|
|
4708
|
+
const FONT_FACE_RE = /@font-face\s*\{[^{}]*\}/g;
|
|
4709
|
+
/**
|
|
4710
|
+
* Splits `@font-face` rules out of a CSS text - exported standalone (from private
|
|
4711
|
+
* module state - usually 3rd party node_modules) exported for testing
|
|
4712
|
+
* @param cssText the CSS text to split
|
|
4713
|
+
* @returns the font-face rules joined together (`null` if there were none) and the remaining CSS
|
|
4714
|
+
*/
|
|
4715
|
+
function splitFontFaces(cssText) {
|
|
4716
|
+
const fontFaces = cssText.match(FONT_FACE_RE);
|
|
4717
|
+
if (!fontFaces) return {
|
|
4718
|
+
fontFaceText: null,
|
|
4719
|
+
rest: cssText
|
|
4720
|
+
};
|
|
4721
|
+
return {
|
|
4722
|
+
fontFaceText: fontFaces.join("\n"),
|
|
4723
|
+
rest: cssText.replace(FONT_FACE_RE, "")
|
|
4724
|
+
};
|
|
4725
|
+
}
|
|
4726
|
+
/**
|
|
4727
|
+
* Applies plain (non-component) CSS text to every registered root - respects shadow DOM
|
|
4728
|
+
* encapsulation instead of always reaching for the top-level document. Not meant to be called
|
|
4729
|
+
* directly: this is what the compiler's CSS-to-ESM output calls for CSS with no Stencil `tag`
|
|
4730
|
+
* (i.e. not a component's own `styleUrl`), typically a third-party dependency's CSS import.
|
|
4731
|
+
*
|
|
4732
|
+
* `@font-face` rules are pulled out and adopted onto top-level `document` not per-root
|
|
4733
|
+
* (Chromium (https://issues.chromium.org/issues/41085401) per-root never loads).
|
|
4734
|
+
* @param cssText the CSS text to apply
|
|
4735
|
+
*/
|
|
4736
|
+
function injectSideEffectStyle(cssText) {
|
|
4737
|
+
const { fontFaceText, rest } = splitFontFaces(cssText);
|
|
4738
|
+
if (fontFaceText && !knownFontFaces.has(fontFaceText)) {
|
|
4739
|
+
knownFontFaces.add(fontFaceText);
|
|
4740
|
+
const fontFaceSheet = new CSSStyleSheet();
|
|
4741
|
+
fontFaceSheet.replaceSync(fontFaceText);
|
|
4742
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, fontFaceSheet];
|
|
4743
|
+
}
|
|
4744
|
+
if (!rest.trim()) return;
|
|
4745
|
+
let sheet = styleSheets.get(rest);
|
|
4746
|
+
if (!sheet) {
|
|
4747
|
+
sheet = new CSSStyleSheet();
|
|
4748
|
+
sheet.replaceSync(rest);
|
|
4749
|
+
styleSheets.set(rest, sheet);
|
|
4750
|
+
}
|
|
4751
|
+
for (const root of knownRoots) adopt(root, sheet);
|
|
4752
|
+
}
|
|
4753
|
+
//#endregion
|
|
4663
4754
|
//#region src/runtime/mixin.ts
|
|
4664
4755
|
const baseClass = BUILD$1.lazyLoad ? class {} : globalThis.HTMLElement || class {};
|
|
4665
4756
|
function Mixin(...mixins) {
|
|
@@ -5363,4 +5454,4 @@ const setScopedSsr = (opts) => {
|
|
|
5363
5454
|
const needsScopedSSR = () => scopedSSR;
|
|
5364
5455
|
let scopedSSR = false;
|
|
5365
5456
|
//#endregion
|
|
5366
|
-
export { BUILD, Build, Env, Fragment, Host, Mixin, NAMESPACE, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getShadowRoot, getValue, hAsync as h, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setScopedSsr, setTagTransformer, setValue, ssrApp, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, transformTag, win, writeTask };
|
|
5457
|
+
export { BUILD, Build, Env, Fragment, Host, Mixin, NAMESPACE, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getShadowRoot, getValue, hAsync as h, injectSideEffectStyle, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, registerSideEffectStyleTarget, renderVdom, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setScopedSsr, setTagTransformer, setValue, ssrApp, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, transformTag, unregisterSideEffectStyleTarget, win, writeTask };
|
package/dist/sys/node/worker.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as createWorkerMessageHandler } from "../../compiler-
|
|
1
|
+
import { l as createWorkerMessageHandler } from "../../compiler-CJG6qvQt.mjs";
|
|
2
2
|
import { t as createNodeSys } from "../../node-75gQKkFz.mjs";
|
|
3
3
|
//#region src/sys/node/node-worker-thread.ts
|
|
4
4
|
/**
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -973,10 +973,19 @@ interface StencilConfig {
|
|
|
973
973
|
*/
|
|
974
974
|
rolldownConfig?: RolldownConfig;
|
|
975
975
|
/**
|
|
976
|
-
* Sets if the JS browser files are minified or not.
|
|
976
|
+
* Sets if the JS browser files are minified or not.
|
|
977
977
|
* Defaults to `false` in dev mode and `true` in production mode.
|
|
978
978
|
*/
|
|
979
979
|
minifyJs?: boolean;
|
|
980
|
+
/**
|
|
981
|
+
* Which minifier to use for JS output when `minifyJs` is enabled.
|
|
982
|
+
*
|
|
983
|
+
* - `oxc`: built into rolldown. Much faster than terser. Output may be slightly larger.
|
|
984
|
+
* - `terser`: slower, but currently produces the smallest output.
|
|
985
|
+
*
|
|
986
|
+
* Defaults to `oxc`.
|
|
987
|
+
*/
|
|
988
|
+
jsMinifier?: 'terser' | 'oxc';
|
|
980
989
|
/**
|
|
981
990
|
* Sets if the CSS is minified or not.
|
|
982
991
|
* Defaults to `false` in dev mode and `true` in production mode.
|
|
@@ -1322,7 +1331,7 @@ type RequireFields<T, K extends keyof T> = T & { [P in K]-?: T[P]; };
|
|
|
1322
1331
|
/**
|
|
1323
1332
|
* Fields in {@link Config} to make required for {@link ValidatedConfig}
|
|
1324
1333
|
*/
|
|
1325
|
-
type StrictConfigFields = keyof Pick<Config, 'cacheDir' | 'devServer' | 'compat' | 'fsNamespace' | 'hydratedFlag' | 'logLevel' | 'logger' | 'minifyCss' | 'minifyJs' | 'namespace' | 'outputTargets' | 'packageJsonFilePath' | 'rolldownConfig' | 'rootDir' | 'srcDir' | 'srcIndexHtml' | 'sys' | 'transformAliasedImportPaths'>;
|
|
1334
|
+
type StrictConfigFields = keyof Pick<Config, 'cacheDir' | 'devServer' | 'compat' | 'fsNamespace' | 'hydratedFlag' | 'jsMinifier' | 'logLevel' | 'logger' | 'minifyCss' | 'minifyJs' | 'namespace' | 'outputTargets' | 'packageJsonFilePath' | 'rolldownConfig' | 'rootDir' | 'srcDir' | 'srcIndexHtml' | 'sys' | 'transformAliasedImportPaths'>;
|
|
1326
1335
|
/**
|
|
1327
1336
|
* A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
|
|
1328
1337
|
* When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
|
|
@@ -4480,6 +4489,12 @@ interface TransformCssToEsmOutput {
|
|
|
4480
4489
|
varName: string;
|
|
4481
4490
|
importPath: string;
|
|
4482
4491
|
}[];
|
|
4492
|
+
/**
|
|
4493
|
+
* Whether `output` itself has an observable side effect (a plain, untagged CSS file's
|
|
4494
|
+
* generated module self-injects CSSStyleSheets; a Stencil component's tagged `styleUrl`
|
|
4495
|
+
* output doesn't)
|
|
4496
|
+
*/
|
|
4497
|
+
moduleSideEffects?: boolean;
|
|
4483
4498
|
}
|
|
4484
4499
|
interface PackageJsonData {
|
|
4485
4500
|
name?: string;
|