@absolutejs/absolute 0.19.0-beta.707 → 0.19.0-beta.709
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/angular/browser.js +26 -32
- package/dist/angular/browser.js.map +5 -4
- package/dist/angular/components/constants.js +6 -0
- package/dist/angular/index.js +117 -29
- package/dist/angular/index.js.map +5 -5
- package/dist/angular/server.js +117 -29
- package/dist/angular/server.js.map +5 -5
- package/dist/build.js +264 -152
- package/dist/build.js.map +12 -12
- package/dist/cli/index.js +44 -25
- package/dist/client/index.js +105 -28
- package/dist/client/index.js.map +4 -4
- package/dist/core/streamingSlotRegistrar.js +1 -19
- package/dist/core/streamingSlotRegistrar.js.map +2 -2
- package/dist/core/streamingSlotRegistry.js +1 -19
- package/dist/core/streamingSlotRegistry.js.map +2 -2
- package/dist/dev/client/cssUtils.ts +6 -2
- package/dist/dev/client/handlers/angular.ts +41 -35
- package/dist/dev/client/handlers/angularRuntime.ts +8 -3
- package/dist/dev/client/hmrClient.ts +1 -1
- package/dist/dev/client/reactRefreshSetup.ts +0 -1
- package/dist/image-client/imageClient.js +16 -4
- package/dist/index.js +298 -170
- package/dist/index.js.map +15 -15
- package/dist/islands/browser.js +1 -19
- package/dist/islands/browser.js.map +2 -2
- package/dist/islands/index.js +107 -20
- package/dist/islands/index.js.map +4 -4
- package/dist/react/browser.js +1 -19
- package/dist/react/browser.js.map +2 -2
- package/dist/react/components/browser/index.js +16 -4
- package/dist/react/components/index.js +24 -31
- package/dist/react/components/index.js.map +5 -4
- package/dist/react/hooks/index.js +1 -19
- package/dist/react/hooks/index.js.map +2 -2
- package/dist/react/index.js +117 -29
- package/dist/react/index.js.map +5 -5
- package/dist/react/jsxDevRuntimeCompat.js +1 -19
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/server.js +23 -29
- package/dist/react/server.js.map +4 -4
- package/dist/src/angular/components/constants.d.ts +4 -0
- package/dist/src/client/streamSwap.d.ts +0 -10
- package/dist/src/constants.d.ts +4 -0
- package/dist/src/dev/rebuildTrigger.d.ts +1 -1
- package/dist/src/svelte/renderToPipeableStream.d.ts +2 -2
- package/dist/src/svelte/renderToReadableStream.d.ts +2 -2
- package/dist/src/svelte/renderToString.d.ts +2 -2
- package/dist/src/vue/components/Image.d.ts +3 -3
- package/dist/svelte/browser.js +1 -19
- package/dist/svelte/browser.js.map +2 -2
- package/dist/svelte/index.js +119 -30
- package/dist/svelte/index.js.map +6 -6
- package/dist/svelte/server.js +25 -30
- package/dist/svelte/server.js.map +5 -5
- package/dist/types/globals.d.ts +10 -2
- package/dist/vue/browser.js +1 -19
- package/dist/vue/browser.js.map +2 -2
- package/dist/vue/components/Image.js +24 -31
- package/dist/vue/components/Image.js.map +5 -4
- package/dist/vue/components/index.js +24 -31
- package/dist/vue/components/index.js.map +5 -4
- package/dist/vue/index.js +121 -41
- package/dist/vue/index.js.map +6 -6
- package/dist/vue/server.js +23 -29
- package/dist/vue/server.js.map +4 -4
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (\n\t\tprocess.env.NODE_ENV === 'production' ||\n\t\tisStreamingSlotCollectionActive()\n\t) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAM,+BAA+B,OAAO,IAC3C,mCACD;AACA,IAAM,qCAAqC,OAAO,IACjD,2CACD;AACA,IAAM,wCAAwC,OAAO,IACpD,8CACD;AAEA,IAAM,sCAAsC,MAAM;AAAA,EACjD,MAAM,QAAQ,QAAQ,IAAI,YAAY,4BAA4B;AAAA,EAClE,IAAI,OAAO,UAAU,cAAc,UAAU,MAAM;AAAA,IAClD,OAAO;AAAA,EACR;AAAA,EAEA;AAAA;AAGD,IAAM,iBAAiB,CAAC,UACvB,QAAQ,KAAK,KAAK,OAAO,UAAU;AAEpC,IAAM,mCAAmC,CACxC,UAEA,eAAe,KAAK,MACpB,eAAe,UACf,OAAO,MAAM,cAAc;AAE5B,IAAM,sCAAsC,CAC3C,UAEA,eAAe,KAAK,MACpB,kBAAkB,UAClB,OAAO,MAAM,iBAAiB;AAE/B,IAAM,uBAAuB,MAAM;AAAA,EAClC,MAAM,QAAQ,QAAQ,IAAI,YAAY,kCAAkC;AAAA,EACxE,IAAI,UAAU,QAAQ,OAAO,UAAU;AAAA,IAAa;AAAA,EAEpD,OAAO,iCAAiC,KAAK,IAAI,QAAQ;AAAA;AAG1D,IAAM,0BAA0B,MAAM;AAAA,EACrC,MAAM,QAAQ,QAAQ,IACrB,YACA,qCACD;AAAA,EACA,IAAI,UAAU,QAAQ,OAAO,UAAU;AAAA,IAAa;AAAA,EAEpD,OAAO,oCAAoC,KAAK,IAAI,QAAQ;AAAA;AAGtD,IAAM,sCAAsC,MAClD,OAAO,oCAAoC,MAAM;AAC3C,IAAM,kCAAkC,MAC9C,wBAAwB,GAAG,aAAa,MAAM;AACxC,IAAM,wBAAwB,CAAC,SAAwB;AAAA,EAC7D,oCAAoC,IAAI,IAAI;AAAA;AAEtC,IAAM,uCAAuC,CACnD,eACI;AAAA,EACJ,QAAQ,IAAI,YAAY,uCAAuC,UAAU;AAAA;AAEnE,IAAM,4BAA4B,CACxC,kBACI;AAAA,EACJ,QAAQ,IAAI,YAAY,8BAA8B,aAAa;AAAA;AAE7D,IAAM,oCAAoC,CAChD,eACI;AAAA,EACJ,QAAQ,IAAI,YAAY,oCAAoC,UAAU;AAAA;AAEhE,IAAM,oCAAoC,CAAC,kBAA0B;AAAA,EAC3E,IAEC,gCAAgC,GAC/B;AAAA,IACD;AAAA,EACD;AAAA,EAEA,qBAAqB,GAAG,UAAU,aAAa;AAAA;",
|
|
8
|
+
"debugId": "16D309745D6C56CC64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -3,7 +3,6 @@ var __create = Object.create;
|
|
|
3
3
|
var __getProtoOf = Object.getPrototypeOf;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
7
|
function __accessProp(key) {
|
|
9
8
|
return this[key];
|
|
@@ -30,23 +29,6 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
30
29
|
cache.set(mod, to);
|
|
31
30
|
return to;
|
|
32
31
|
};
|
|
33
|
-
var __toCommonJS = (from) => {
|
|
34
|
-
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
35
|
-
if (entry)
|
|
36
|
-
return entry;
|
|
37
|
-
entry = __defProp({}, "__esModule", { value: true });
|
|
38
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
39
|
-
for (var key of __getOwnPropNames(from))
|
|
40
|
-
if (!__hasOwnProp.call(entry, key))
|
|
41
|
-
__defProp(entry, key, {
|
|
42
|
-
get: __accessProp.bind(from, key),
|
|
43
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
__moduleCache.set(from, entry);
|
|
47
|
-
return entry;
|
|
48
|
-
};
|
|
49
|
-
var __moduleCache;
|
|
50
32
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
51
33
|
var __returnValue = (v) => v;
|
|
52
34
|
function __exportSetter(name, newValue) {
|
|
@@ -190,5 +172,5 @@ export {
|
|
|
190
172
|
hasActiveStreamingSlotRegistry
|
|
191
173
|
};
|
|
192
174
|
|
|
193
|
-
//# debugId=
|
|
175
|
+
//# debugId=1E0C8696BC3EED4B64756E2164756E21
|
|
194
176
|
//# sourceMappingURL=streamingSlotRegistry.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (\n\t\tprocess.env.NODE_ENV === 'production' ||\n\t\tisStreamingSlotCollectionActive()\n\t) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n",
|
|
6
6
|
"import type { StreamingSlot } from '../utils/streamingSlots';\nimport {\n\tsetStreamingSlotCollectionController,\n\tsetStreamingSlotRegistrar\n} from './streamingSlotRegistrar';\n\ntype SlotStore = Map<string, StreamingSlot>;\ntype AsyncLocalStorageType =\n\timport('node:async_hooks').AsyncLocalStorage<SlotStore>;\n\nconst STREAMING_SLOT_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotAsyncLocalStorage'\n);\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isAsyncLocalStorage = (value: unknown): value is AsyncLocalStorageType =>\n\tisObjectRecord(value) &&\n\t'getStore' in value &&\n\ttypeof value.getStore === 'function' &&\n\t'run' in value &&\n\ttypeof value.run === 'function';\n\nconst getStorageGlobal = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') {\n\t\treturn value;\n\t}\n\n\treturn isAsyncLocalStorage(value) ? value : undefined;\n};\n\nconst isServerRuntime = () =>\n\ttypeof process !== 'undefined' &&\n\ttypeof process.versions?.node === 'string';\n\nconst ensureAsyncLocalStorage = async () => {\n\tconst storage = getStorageGlobal();\n\tif (typeof storage !== 'undefined') {\n\t\treturn storage;\n\t}\n\tif (!isServerRuntime()) {\n\t\tReflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, null);\n\n\t\treturn getStorageGlobal();\n\t}\n\n\tconst mod = await import('node:async_hooks');\n\tReflect.set(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_STORAGE_KEY,\n\t\tnew mod.AsyncLocalStorage<SlotStore>()\n\t);\n\n\treturn getStorageGlobal();\n};\n\nconst getActiveSlotStore = () => {\n\tconst storage = getStorageGlobal();\n\tif (!storage) return undefined;\n\n\treturn storage.getStore();\n};\n\nconst registerStreamingSlot = (slot: StreamingSlot) => {\n\tconst store = getActiveSlotStore();\n\tif (!store) return;\n\tstore.set(slot.id, slot);\n};\n\nsetStreamingSlotRegistrar(registerStreamingSlot);\nsetStreamingSlotCollectionController({\n\tisCollecting: () => getActiveSlotStore() !== undefined\n});\n\nexport const hasActiveStreamingSlotRegistry = () =>\n\tgetActiveSlotStore() !== undefined;\n\nexport const runWithStreamingSlotRegistry = async <T>(\n\ttask: () => Promise<T> | T\n) => {\n\tconst storage = await ensureAsyncLocalStorage();\n\tif (!storage) {\n\t\tconst slots: StreamingSlot[] = [];\n\n\t\treturn {\n\t\t\tresult: await task(),\n\t\t\tslots\n\t\t};\n\t}\n\n\treturn storage.run(new Map<string, StreamingSlot>(), async () => {\n\t\tconst result = await task();\n\t\tconst store = storage.getStore();\n\n\t\treturn {\n\t\t\tresult,\n\t\t\tslots: store ? [...store.values()] : []\n\t\t};\n\t});\n};\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": "
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAM,+BAA+B,OAAO,IAC3C,mCACD;AACA,IAAM,qCAAqC,OAAO,IACjD,2CACD;AACA,IAAM,wCAAwC,OAAO,IACpD,8CACD;AAEA,IAAM,sCAAsC,MAAM;AAAA,EACjD,MAAM,QAAQ,QAAQ,IAAI,YAAY,4BAA4B;AAAA,EAClE,IAAI,OAAO,UAAU,cAAc,UAAU,MAAM;AAAA,IAClD,OAAO;AAAA,EACR;AAAA,EAEA;AAAA;AAGD,IAAM,iBAAiB,CAAC,UACvB,QAAQ,KAAK,KAAK,OAAO,UAAU;AAEpC,IAAM,mCAAmC,CACxC,UAEA,eAAe,KAAK,MACpB,eAAe,UACf,OAAO,MAAM,cAAc;AAE5B,IAAM,sCAAsC,CAC3C,UAEA,eAAe,KAAK,MACpB,kBAAkB,UAClB,OAAO,MAAM,iBAAiB;AAE/B,IAAM,uBAAuB,MAAM;AAAA,EAClC,M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A,IAChE,MAAM,SAAS,MAAM,KAAK;AAAA,IAC1B,MAAM,QAAQ,QAAQ,SAAS;AAAA,IAE/B,OAAO;AAAA,MACN;AAAA,MACA,OAAO,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC;AAAA,IACvC;AAAA,GACA;AAAA;",
|
|
9
|
+
"debugId": "1E0C8696BC3EED4B64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -179,7 +179,10 @@ export const reloadCSSStylesheets = (manifest: Record<string, string>) => {
|
|
|
179
179
|
});
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
-
const createCSSLoadPromise = (
|
|
182
|
+
const createCSSLoadPromise = (
|
|
183
|
+
linkElement: HTMLLinkElement,
|
|
184
|
+
newHref: string
|
|
185
|
+
) => {
|
|
183
186
|
const { promise, resolve } = Promise.withResolvers<void>();
|
|
184
187
|
let resolved = false;
|
|
185
188
|
const doResolve = function () {
|
|
@@ -194,7 +197,8 @@ const createCSSLoadPromise = (linkElement: HTMLLinkElement, newHref: string) =>
|
|
|
194
197
|
|
|
195
198
|
return sheets.some(
|
|
196
199
|
(sheet) =>
|
|
197
|
-
sheet.href &&
|
|
200
|
+
sheet.href &&
|
|
201
|
+
sheet.href.includes(newHref.split('?')[0] ?? '')
|
|
198
202
|
);
|
|
199
203
|
} catch {
|
|
200
204
|
return false;
|
|
@@ -64,8 +64,16 @@ type AngularComponentExport = ((...args: unknown[]) => unknown) & {
|
|
|
64
64
|
|
|
65
65
|
const isAngularComponentExport = (
|
|
66
66
|
value: unknown
|
|
67
|
-
): value is AngularComponentExport =>
|
|
68
|
-
typeof value
|
|
67
|
+
): value is AngularComponentExport => {
|
|
68
|
+
if (typeof value !== 'function') {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return 'ɵcmp' in value && Boolean(value.ɵcmp);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const isObjectRecord = (value: unknown): value is Record<string, unknown> =>
|
|
76
|
+
Boolean(value) && typeof value === 'object';
|
|
69
77
|
|
|
70
78
|
const swapStylesheet = (
|
|
71
79
|
cssUrl: string,
|
|
@@ -127,7 +135,7 @@ const copyInstanceProperty = (
|
|
|
127
135
|
};
|
|
128
136
|
|
|
129
137
|
const captureInstanceProperties = (
|
|
130
|
-
ngApi: NgApi,
|
|
138
|
+
ngApi: NgApi | undefined,
|
|
131
139
|
element: Element,
|
|
132
140
|
properties: Record<string, unknown>
|
|
133
141
|
) => {
|
|
@@ -135,11 +143,10 @@ const captureInstanceProperties = (
|
|
|
135
143
|
|
|
136
144
|
try {
|
|
137
145
|
const instance = ngApi.getComponent(element);
|
|
138
|
-
if (!instance) return;
|
|
146
|
+
if (!isObjectRecord(instance)) return;
|
|
139
147
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
copyInstanceProperty(record, key, properties);
|
|
148
|
+
Object.keys(instance).forEach((key) => {
|
|
149
|
+
copyInstanceProperty(instance, key, properties);
|
|
143
150
|
});
|
|
144
151
|
} catch {
|
|
145
152
|
/* ignored */
|
|
@@ -202,7 +209,7 @@ const restoreInstanceProperties = (
|
|
|
202
209
|
};
|
|
203
210
|
|
|
204
211
|
const restoreViaInstance = (
|
|
205
|
-
ngApi: NgApi,
|
|
212
|
+
ngApi: NgApi | undefined,
|
|
206
213
|
element: Element,
|
|
207
214
|
snap: StateSnapshot
|
|
208
215
|
) => {
|
|
@@ -210,10 +217,9 @@ const restoreViaInstance = (
|
|
|
210
217
|
|
|
211
218
|
try {
|
|
212
219
|
const instance = ngApi.getComponent(element);
|
|
213
|
-
if (!instance) return false;
|
|
220
|
+
if (!isObjectRecord(instance)) return false;
|
|
214
221
|
|
|
215
|
-
|
|
216
|
-
restoreInstanceProperties(record, snap);
|
|
222
|
+
restoreInstanceProperties(instance, snap);
|
|
217
223
|
if (typeof ngApi.applyChanges === 'function')
|
|
218
224
|
ngApi.applyChanges(element);
|
|
219
225
|
|
|
@@ -266,31 +272,31 @@ const restoreComponentState = (snapshots: StateSnapshot[]) => {
|
|
|
266
272
|
const waitForAngularApp = () => {
|
|
267
273
|
if (window.__ANGULAR_APP__) return Promise.resolve();
|
|
268
274
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
});
|
|
275
|
+
const { promise, resolve } = Promise.withResolvers<void>();
|
|
276
|
+
const timeout = setTimeout(resolve, ANGULAR_INIT_TIMEOUT_MS);
|
|
277
|
+
|
|
278
|
+
let stored = window.__ANGULAR_APP__;
|
|
279
|
+
|
|
280
|
+
Object.defineProperty(window, '__ANGULAR_APP__', {
|
|
281
|
+
configurable: true,
|
|
282
|
+
enumerable: true,
|
|
283
|
+
get() {
|
|
284
|
+
return stored;
|
|
285
|
+
},
|
|
286
|
+
set(val) {
|
|
287
|
+
stored = val;
|
|
288
|
+
Object.defineProperty(window, '__ANGULAR_APP__', {
|
|
289
|
+
configurable: true,
|
|
290
|
+
enumerable: true,
|
|
291
|
+
value: val,
|
|
292
|
+
writable: true
|
|
293
|
+
});
|
|
294
|
+
clearTimeout(timeout);
|
|
295
|
+
resolve();
|
|
296
|
+
}
|
|
293
297
|
});
|
|
298
|
+
|
|
299
|
+
return promise;
|
|
294
300
|
};
|
|
295
301
|
|
|
296
302
|
// ============================================================
|
|
@@ -33,6 +33,9 @@ type ComponentCtor = (abstract new (...args: never[]) => unknown) & {
|
|
|
33
33
|
ɵinj?: AngularComponentDefinition;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
const isComponentCtor = (value: unknown): value is ComponentCtor =>
|
|
37
|
+
typeof value === 'function';
|
|
38
|
+
|
|
36
39
|
type RegistryEntry = {
|
|
37
40
|
liveCtor: ComponentCtor;
|
|
38
41
|
id: string;
|
|
@@ -78,8 +81,8 @@ const hasProviderChanges = (oldCtor: ComponentCtor, newCtor: ComponentCtor) => {
|
|
|
78
81
|
return false;
|
|
79
82
|
};
|
|
80
83
|
|
|
81
|
-
const register = (id: string, ctor:
|
|
82
|
-
if (!id ||
|
|
84
|
+
const register = (id: string, ctor: unknown) => {
|
|
85
|
+
if (!id || !isComponentCtor(ctor)) return;
|
|
83
86
|
if (!componentRegistry.has(id)) {
|
|
84
87
|
componentRegistry.set(id, {
|
|
85
88
|
id,
|
|
@@ -151,7 +154,9 @@ const patchConstructor = (entry: RegistryEntry, newCtor: ComponentCtor) => {
|
|
|
151
154
|
entry.registeredAt = Date.now();
|
|
152
155
|
};
|
|
153
156
|
|
|
154
|
-
const applyUpdate = (id: string, newCtor:
|
|
157
|
+
const applyUpdate = (id: string, newCtor: unknown) => {
|
|
158
|
+
if (!isComponentCtor(newCtor)) return false;
|
|
159
|
+
|
|
155
160
|
const entry = componentRegistry.get(id);
|
|
156
161
|
if (!entry) {
|
|
157
162
|
register(id, newCtor);
|
|
@@ -90,7 +90,7 @@ type HMRMessage = {
|
|
|
90
90
|
framework?: string;
|
|
91
91
|
hasCSSChanges?: boolean;
|
|
92
92
|
hasComponentChanges?: boolean;
|
|
93
|
-
html?: string
|
|
93
|
+
html?: string;
|
|
94
94
|
line?: number;
|
|
95
95
|
lineText?: string;
|
|
96
96
|
manifest?: Record<string, string>;
|
|
@@ -8,7 +8,6 @@ import type {} from '../../types/globals';
|
|
|
8
8
|
is preserved so new component registrations feed into the SAME RefreshRuntime
|
|
9
9
|
instance that owns the current React tree. */
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
import * as RefreshRuntime from 'react-refresh/runtime';
|
|
13
12
|
|
|
14
13
|
if (!window.$RefreshRuntime$) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
var
|
|
1
|
+
// src/constants.ts
|
|
2
|
+
var HOURS_IN_DAY = 24;
|
|
3
|
+
var IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
3
4
|
640,
|
|
4
5
|
750,
|
|
5
6
|
828,
|
|
@@ -9,8 +10,19 @@ var DEFAULT_DEVICE_SIZES = [
|
|
|
9
10
|
2048,
|
|
10
11
|
3840
|
|
11
12
|
];
|
|
12
|
-
var
|
|
13
|
-
var
|
|
13
|
+
var IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
14
|
+
var IMAGE_DEFAULT_QUALITY = 75;
|
|
15
|
+
var MILLISECONDS_IN_A_SECOND = 1000;
|
|
16
|
+
var MINUTES_IN_AN_HOUR = 60;
|
|
17
|
+
var SECONDS_IN_A_MINUTE = 60;
|
|
18
|
+
var MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
|
|
19
|
+
var MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
|
|
20
|
+
var TWO_THIRDS = 2 / 3;
|
|
21
|
+
|
|
22
|
+
// src/utils/imageClient.ts
|
|
23
|
+
var DEFAULT_DEVICE_SIZES = IMAGE_DEFAULT_DEVICE_SIZES;
|
|
24
|
+
var DEFAULT_IMAGE_SIZES = IMAGE_DEFAULT_IMAGE_SIZES;
|
|
25
|
+
var DEFAULT_QUALITY = IMAGE_DEFAULT_QUALITY;
|
|
14
26
|
var OPTIMIZATION_ENDPOINT = "/_absolute/image";
|
|
15
27
|
var buildOptimizedUrl = (src, width, quality, basePath = OPTIMIZATION_ENDPOINT) => `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${quality}`;
|
|
16
28
|
var getAllSizes = (deviceSizes, imageSizes) => {
|