@akylas/nativescript 9.1.4 → 9.1.5
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/application/application-common.d.ts +9 -3
- package/application/application-common.js +16 -3
- package/application/application-common.js.map +1 -1
- package/application/application.android.js +2 -6
- package/application/application.android.js.map +1 -1
- package/application/application.ios.js +8 -12
- package/application/application.ios.js.map +1 -1
- package/application/helpers-common.d.ts +2 -0
- package/application/helpers-common.js +23 -0
- package/application/helpers-common.js.map +1 -1
- package/config/config.interface.d.ts +1 -1
- package/config/config.interface.js.map +1 -1
- package/css-mediaquery/index.d.ts +6 -1
- package/css-mediaquery/index.js +31 -2
- package/css-mediaquery/index.js.map +1 -1
- package/debugger/webinspector-network.d.ts +29 -0
- package/fetch/index.d.ts +79 -0
- package/fetch/index.js +408 -0
- package/fetch/index.js.map +1 -0
- package/file-system/file-system-access.android.d.ts +1 -0
- package/file-system/file-system-access.android.js +18 -21
- package/file-system/file-system-access.android.js.map +1 -1
- package/global-types.d.ts +1 -1
- package/globals/index.js +4 -4
- package/globals/index.js.map +1 -1
- package/http/http-request/index.android.js +5 -1
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request-internal/http-request-internal-common.d.ts +1 -0
- package/http/http-request-internal/http-request-internal-common.js +9 -0
- package/http/http-request-internal/http-request-internal-common.js.map +1 -1
- package/http/http-request-internal/index.android.js +7 -5
- package/http/http-request-internal/index.android.js.map +1 -1
- package/http/http-request-internal/index.ios.js +33 -16
- package/http/http-request-internal/index.ios.js.map +1 -1
- package/image-source/index.ios.js +7 -6
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +1 -1
- package/js-libs/easysax/easysax.d.ts +49 -7
- package/js-libs/easysax/easysax.js +631 -747
- package/js-libs/easysax/easysax.js.map +1 -0
- package/media-query-list/index.js +57 -15
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/helpers.d.ts +1 -1
- package/module-name-resolver/helpers.js.map +1 -1
- package/module-name-resolver/index.d.ts +2 -2
- package/module-name-resolver/index.js.map +1 -1
- package/native-window/native-window.ios.js +3 -5
- package/native-window/native-window.ios.js.map +1 -1
- package/package.json +2 -3
- package/timer/index.android.js +2 -1
- package/timer/index.android.js.map +1 -1
- package/ui/action-bar/index.android.js +5 -4
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/animation/index.ios.js +6 -1
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/builder/binding-builder.d.ts +8 -0
- package/ui/builder/binding-builder.js +12 -0
- package/ui/builder/binding-builder.js.map +1 -1
- package/ui/builder/component-builder/index.d.ts +7 -4
- package/ui/builder/component-builder/index.js +13 -7
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.d.ts +16 -2
- package/ui/builder/index.js +52 -12
- package/ui/builder/index.js.map +1 -1
- package/ui/button/index.android.js +4 -3
- package/ui/button/index.android.js.map +1 -1
- package/ui/content-view/index.js +2 -0
- package/ui/content-view/index.js.map +1 -1
- package/ui/core/bindable/bindable-types.d.ts +15 -0
- package/ui/core/bindable/bindable-types.js.map +1 -1
- package/ui/core/bindable/index.d.ts +1 -1
- package/ui/core/bindable/index.js +12 -7
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/view/index.android.js +11 -9
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/date-picker/index.android.js +1 -1
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/editable-text-base/index.android.d.ts +2 -0
- package/ui/editable-text-base/index.android.js +15 -6
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.d.ts +8 -0
- package/ui/frame/fragment.transitions.android.d.ts +8 -5
- package/ui/frame/fragment.transitions.android.js +16 -18
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/index.android.d.ts +1 -0
- package/ui/frame/index.android.js +10 -4
- package/ui/frame/index.android.js.map +1 -1
- package/ui/gestures/index.android.js +18 -9
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +6 -6
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/image/index.android.js +1 -1
- package/ui/image/index.android.js.map +1 -1
- package/ui/image-cache/index.android.js +1 -2
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/index.d.ts +1 -1
- package/ui/index.js.map +1 -1
- package/ui/list-picker/index.android.d.ts +1 -0
- package/ui/list-picker/index.android.js +6 -5
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-view/index.android.js +17 -9
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/page/index.ios.js +7 -3
- package/ui/page/index.ios.js.map +1 -1
- package/ui/search-bar/index.android.js +2 -2
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.android.js +8 -8
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/slider/index.android.js +1 -2
- package/ui/slider/index.android.js.map +1 -1
- package/ui/styling/background-common.js +2 -2
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.d.ts +1 -1
- package/ui/styling/background.ios.d.ts +1 -1
- package/ui/styling/background.ios.js +1 -1
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/style/index.d.ts +13 -2
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-scope.js +6 -0
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.android.js +1 -1
- package/ui/switch/index.android.js.map +1 -1
- package/ui/tab-view/index.android.js +9 -16
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.js +2 -2
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/text-base/index.android.js +1 -1
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.js +1 -1
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/time-picker/index.android.js +1 -1
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/transition/page-transition.android.js +0 -44
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/web-view/index.android.js +1 -1
- package/ui/web-view/index.android.js.map +1 -1
- package/utils/android-runtime-version.d.ts +12 -0
- package/utils/android-runtime-version.js +36 -0
- package/utils/android-runtime-version.js.map +1 -0
- package/utils/native-helper-for-android.js +3 -1
- package/utils/native-helper-for-android.js.map +1 -1
- package/xhr/index.d.ts +5 -4
- package/xhr/index.js +18 -18
- package/xhr/index.js.map +1 -1
- package/xml/index.d.ts +2 -2
- package/xml/index.js +1 -1
- package/xml/index.js.map +1 -1
- package/LICENSE +0 -19
- package/fetch/index.mjs +0 -535
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers-common.js","sourceRoot":"","sources":["../../../../packages/core/application/helpers-common.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,IAAI,SAAoB,CAAC;AAgBzB,SAAS,UAAU;IAClB,IAAI,SAAS,EAAE,CAAC;QACf,OAAO,CAAC,CAAC,oBAAoB,CAAC,cAAc,EAAE,CAAC,QAAQ,CAAC;IACzD,CAAC;SAAM,CAAC;QACP,aAAa;QACb,kFAAkF;QAClF,uEAAuE;QACvE,OAAO,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,sBAAsB,CAAC;IAC5D,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY;IAC3B,IAAI,WAAW,EAAE,CAAC;QACjB,IAAI,CAAC,SAAS,EAAE,CAAC;YAChB,iGAAiG;YACjG,gEAAgE;YAChE,IAAI,GAAG,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC;gBACrC,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC,WAAW,EAAE,CAAC;YAC3D,CAAC;YAED,IAAI,CAAC,SAAS,IAAI,UAAU,EAAE,EAAE,CAAC;gBAChC,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;YAC/D,CAAC;YAED,+GAA+G;YAC/G,IAAI,CAAC,SAAS,EAAE,CAAC;gBAChB,iJAAiJ;g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AAK,SAAS,CAAC,aAAa,CAAC;IAC3D,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,MAAM,UAAU,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5E,eAAe,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5C,eAAe,EAAE,CAAC,SAAS,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["/**\n * Do not import other files here to avoid circular dependencies.\n * Used to define helper functions and variables that are shared between Android and iOS.\n * This file can declare cross platform types and use bundler platform checks.\n * For example, use `__ANDROID__` or `__APPLE__` to check the platform.\n */\n\nimport type { NativeWindow } from '../native-window';\n\n/**\n * Application type. UIApplication on iOS or android.app.Application on Android.\n */\ntype NativeApp = UIApplication | android.app.Application;\n\nlet nativeApp: NativeApp;\n\ndeclare namespace com {\n\tnamespace tns {\n\t\tclass NativeScriptApplication extends android.app.Application {\n\t\t\tstatic getInstance(): NativeScriptApplication;\n\t\t}\n\n\t\tnamespace embedding {\n\t\t\tclass ApplicationHolder {\n\t\t\t\tstatic getInstance(): android.app.Application;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction isEmbedded(): boolean {\n\tif (__APPLE__) {\n\t\treturn !!NativeScriptEmbedder.sharedInstance().delegate;\n\t} else {\n\t\t// @ts-ignore\n\t\t// Check if the Bootstrap class exists and has the isEmbeddedNativeScript property\n\t\t// This is a way to determine if the app is embedded in a host project.\n\t\treturn org.nativescript?.Bootstrap?.isEmbeddedNativeScript;\n\t}\n}\n\n/**\n * Get the current application instance.\n * @returns current application instance, UIApplication on iOS or android.app.Application on Android.\n */\nexport function getNativeApp<T extends NativeApp>(): T {\n\tif (__ANDROID__) {\n\t\tif (!nativeApp) {\n\t\t\t// Try getting it from module - check whether application.android.init has been explicitly called\n\t\t\t// check whether the com.tns.NativeScriptApplication type exists\n\t\t\tif (com.tns.NativeScriptApplication) {\n\t\t\t\tnativeApp = com.tns.NativeScriptApplication.getInstance();\n\t\t\t}\n\n\t\t\tif (!nativeApp && isEmbedded()) {\n\t\t\t\tnativeApp = com.tns.embedding.ApplicationHolder.getInstance();\n\t\t\t}\n\n\t\t\t// the getInstance might return null if com.tns.NativeScriptApplication exists but is not the starting app type\n\t\t\tif (!nativeApp) {\n\t\t\t\t// TODO: Should we handle the case when a custom application type is provided and the user has not explicitly initialized the application module?\n\t\t\t\tconst clazz = java.lang.Class.forName('android.app.ActivityThread');\n\t\t\t\tif (clazz) {\n\t\t\t\t\tconst method = clazz.getMethod('currentApplication', null);\n\t\t\t\t\tif (method) {\n\t\t\t\t\t\tnativeApp = method.invoke(null, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nativeApp! as T;\n}\n\n/**\n * This is called internally to set the native application instance.\n * You typically do not need to call this directly.\n * However, it's exposed for special case purposes, such as custom application initialization.\n * @param app The native application instance to set.\n * This should be called once during application startup to set the native app instance.\n */\nexport function setNativeApp(app: NativeApp) {\n\tnativeApp = app;\n}\n\nlet rootView: any;\n\nexport function getRootView() {\n\treturn rootView;\n}\n\nexport function setRootView(view: any) {\n\trootView = view;\n}\nlet subrootView: any;\n\nexport function getSubRootView() {\n\treturn subrootView;\n}\n\nexport function setSubRootView(view: any) {\n\tsubrootView = view;\n}\n\nlet _appInBackground: boolean = false;\nexport function isAppInBackground() {\n\treturn _appInBackground;\n}\nexport function setAppInBackground(value: boolean) {\n\t_appInBackground = value;\n}\n\n/**\n * Backs `Application.autoSystemAppearanceChanged`. Lives here so windows can read it\n * without importing the application module.\n */\nlet _autoSystemAppearanceChanged: boolean = true;\nexport function getAutoSystemAppearanceChanged(): boolean {\n\treturn _autoSystemAppearanceChanged;\n}\nexport function setAutoSystemAppearanceChanged(value: boolean) {\n\t_autoSystemAppearanceChanged = value;\n}\n\n/**\n * Backs `Application.activeWindow`. Lives here so window-scoped lookups - the frame stack\n * above all - can read it without importing the application module.\n */\nlet _activeWindow: NativeWindow | undefined;\nexport function getActiveWindow(): NativeWindow | undefined {\n\treturn _activeWindow;\n}\nexport function setActiveWindow(window: NativeWindow | undefined) {\n\t_activeWindow = window;\n}\n\nlet _iosWindow: UIWindow;\nexport function getiOSWindow(): UIWindow {\n\treturn _iosWindow;\n}\nexport function setiOSWindow(value: UIWindow) {\n\t_iosWindow = value;\n}\n\nlet _appMainEntry: any; /* NavigationEntry */\n\nexport function getAppMainEntry(): any /* NavigationEntry */ {\n\treturn _appMainEntry;\n}\nexport function setAppMainEntry(entry: any /* NavigationEntry */) {\n\t_appMainEntry = entry;\n}\n\n// Aids avoiding circular dependencies by allowing the application event listeners to be toggled\nlet _toggleApplicationEventListenersHandler: (toAdd: boolean, callback: (args: any) => void) => void;\nexport function toggleApplicationEventListeners(toAdd: boolean, callback: (args: any) => void) {\n\tif (_toggleApplicationEventListenersHandler) {\n\t\t_toggleApplicationEventListenersHandler(toAdd, callback);\n\t}\n}\nexport function setToggleApplicationEventListenersCallback(callback: (toAdd: boolean, callback: (args: any) => void) => void) {\n\t_toggleApplicationEventListenersHandler = callback;\n}\n\n// Aids avoiding circular dependencies by allowing the application properties to be retrieved\ntype ApplicationPropertyValues = { orientation: 'portrait' | 'landscape' | 'unknown'; systemAppearance: 'dark' | 'light' | null };\nlet _applicationPropertiesCallback: () => ApplicationPropertyValues;\nexport function getApplicationProperties(): ApplicationPropertyValues {\n\tif (_applicationPropertiesCallback) {\n\t\treturn _applicationPropertiesCallback();\n\t}\n\treturn { orientation: 'unknown', systemAppearance: null };\n}\nexport function setApplicationPropertiesCallback(callback: () => ApplicationPropertyValues) {\n\t_applicationPropertiesCallback = callback;\n}\n\nlet _a11yUpdatePropertiesCallback: (view: any /* View */) => void;\nexport function setA11yUpdatePropertiesCallback(callback: (view: any /* View */) => void) {\n\t_a11yUpdatePropertiesCallback = callback;\n}\nexport function updateA11yPropertiesCallback(view: any /* View */) {\n\tif (_a11yUpdatePropertiesCallback) {\n\t\t_a11yUpdatePropertiesCallback(view);\n\t}\n}\n\n/**\n * Internal Android app helpers\n */\nlet _imageFetcher: org.nativescript.widgets.image.Fetcher;\nexport function getImageFetcher(): org.nativescript.widgets.image.Fetcher {\n\treturn _imageFetcher;\n}\nexport function setImageFetcher(fetcher: org.nativescript.widgets.image.Fetcher) {\n\t_imageFetcher = fetcher;\n}\nexport enum CacheMode {\n\tnone,\n\tmemory,\n\tdiskAndMemory,\n}\n\nlet _currentCacheMode: CacheMode;\n\nexport function initImageCache(context: android.content.Context, mode = CacheMode.diskAndMemory, memoryCacheSize = 0.25, diskCacheSize: number = 10 * 1024 * 1024): void {\n\tif (_currentCacheMode === mode) {\n\t\treturn;\n\t}\n\n\t_currentCacheMode = mode;\n\tif (!getImageFetcher()) {\n\t\tsetImageFetcher(org.nativescript.widgets.image.Fetcher.getInstance(context));\n\t} else {\n\t\tgetImageFetcher().clearCache();\n\t}\n\n\tconst params = new org.nativescript.widgets.image.Cache.CacheParams();\n\tparams.memoryCacheEnabled = mode !== CacheMode.none;\n\tparams.setMemCacheSizePercent(memoryCacheSize); // Set memory cache to % of app memory\n\tparams.diskCacheEnabled = mode === CacheMode.diskAndMemory;\n\tparams.diskCacheSize = diskCacheSize;\n\tconst imageCache = org.nativescript.widgets.image.Cache.getInstance(params);\n\tgetImageFetcher().addImageCache(imageCache);\n\tgetImageFetcher().initCache();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"helpers-common.js","sourceRoot":"","sources":["../../../../packages/core/application/helpers-common.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,IAAI,SAAoB,CAAC;AAgBzB,SAAS,UAAU;IAClB,IAAI,SAAS,EAAE,CAAC;QACf,OAAO,CAAC,CAAC,oBAAoB,CAAC,cAAc,EAAE,CAAC,QAAQ,CAAC;IACzD,CAAC;SAAM,CAAC;QACP,aAAa;QACb,kFAAkF;QAClF,uEAAuE;QACvE,OAAO,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,sBAAsB,C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gB,GAAG,IAAI,KAAK,SAAS,CAAC,aAAa,CAAC;IAC3D,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,MAAM,UAAU,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5E,eAAe,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5C,eAAe,EAAE,CAAC,SAAS,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["/**\n * Do not import other files here to avoid circular dependencies.\n * Used to define helper functions and variables that are shared between Android and iOS.\n * This file can declare cross platform types and use bundler platform checks.\n * For example, use `__ANDROID__` or `__APPLE__` to check the platform.\n */\n\nimport type { NativeWindow } from '../native-window';\n\n/**\n * Application type. UIApplication on iOS or android.app.Application on Android.\n */\ntype NativeApp = UIApplication | android.app.Application;\n\nlet nativeApp: NativeApp;\n\ndeclare namespace com {\n\tnamespace tns {\n\t\tclass NativeScriptApplication extends android.app.Application {\n\t\t\tstatic getInstance(): NativeScriptApplication;\n\t\t}\n\n\t\tnamespace embedding {\n\t\t\tclass ApplicationHolder {\n\t\t\t\tstatic getInstance(): android.app.Application;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction isEmbedded(): boolean {\n\tif (__APPLE__) {\n\t\treturn !!NativeScriptEmbedder.sharedInstance().delegate;\n\t} else {\n\t\t// @ts-ignore\n\t\t// Check if the Bootstrap class exists and has the isEmbeddedNativeScript property\n\t\t// This is a way to determine if the app is embedded in a host project.\n\t\treturn org.nativescript?.Bootstrap?.isEmbeddedNativeScript;\n\t}\n}\n\n/**\n * Get the current application instance.\n * @returns current application instance, UIApplication on iOS or android.app.Application on Android.\n */\nexport function getNativeApp<T extends NativeApp>(): T {\n\tif (__ANDROID__) {\n\t\tif (!nativeApp) {\n\t\t\t// Try getting it from module - check whether application.android.init has been explicitly called\n\t\t\t// check whether the com.tns.NativeScriptApplication type exists\n\t\t\tif (com.tns.NativeScriptApplication) {\n\t\t\t\tnativeApp = com.tns.NativeScriptApplication.getInstance();\n\t\t\t}\n\n\t\t\tif (!nativeApp && isEmbedded()) {\n\t\t\t\tnativeApp = com.tns.embedding.ApplicationHolder.getInstance();\n\t\t\t}\n\n\t\t\t// the getInstance might return null if com.tns.NativeScriptApplication exists but is not the starting app type\n\t\t\tif (!nativeApp) {\n\t\t\t\t// TODO: Should we handle the case when a custom application type is provided and the user has not explicitly initialized the application module?\n\t\t\t\tconst clazz = java.lang.Class.forName('android.app.ActivityThread');\n\t\t\t\tif (clazz) {\n\t\t\t\t\tconst method = clazz.getMethod('currentApplication', null);\n\t\t\t\t\tif (method) {\n\t\t\t\t\t\tnativeApp = method.invoke(null, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nativeApp! as T;\n}\n\n/**\n * This is called internally to set the native application instance.\n * You typically do not need to call this directly.\n * However, it's exposed for special case purposes, such as custom application initialization.\n * @param app The native application instance to set.\n * This should be called once during application startup to set the native app instance.\n */\nexport function setNativeApp(app: NativeApp) {\n\tnativeApp = app;\n}\n\nlet rootView: any;\n\nexport function getRootView() {\n\treturn rootView;\n}\n\nexport function setRootView(view: any) {\n\trootView = view;\n}\nlet subrootView: any;\n\nexport function getSubRootView() {\n\treturn subrootView;\n}\n\nexport function setSubRootView(view: any) {\n\tsubrootView = view;\n}\n\nlet _appInBackground: boolean = false;\nexport function isAppInBackground() {\n\treturn _appInBackground;\n}\nexport function setAppInBackground(value: boolean) {\n\t_appInBackground = value;\n}\n\n/**\n * Backs `Application.autoSystemAppearanceChanged`. Lives here so windows can read it\n * without importing the application module.\n */\nlet _autoSystemAppearanceChanged: boolean = true;\nexport function getAutoSystemAppearanceChanged(): boolean {\n\treturn _autoSystemAppearanceChanged;\n}\nexport function setAutoSystemAppearanceChanged(value: boolean) {\n\t_autoSystemAppearanceChanged = value;\n}\n\n/**\n * Backs `Application.activeWindow`. Lives here so window-scoped lookups - the frame stack\n * above all - can read it without importing the application module.\n */\nlet _activeWindow: NativeWindow | undefined;\nexport function getActiveWindow(): NativeWindow | undefined {\n\treturn _activeWindow;\n}\nexport function setActiveWindow(window: NativeWindow | undefined) {\n\t_activeWindow = window;\n}\n\nlet _iosWindow: UIWindow;\nexport function getiOSWindow(): UIWindow {\n\treturn _iosWindow;\n}\nexport function setiOSWindow(value: UIWindow) {\n\t_iosWindow = value;\n}\n\nlet _appMainEntry: any; /* NavigationEntry */\n\nexport function getAppMainEntry(): any /* NavigationEntry */ {\n\treturn _appMainEntry;\n}\nexport function setAppMainEntry(entry: any /* NavigationEntry */) {\n\t_appMainEntry = entry;\n}\n\n// Aids avoiding circular dependencies by allowing the application event listeners to be toggled\nlet _toggleApplicationEventListenersHandler: (toAdd: boolean, callback: (args: any) => void) => void;\n// Listeners requested before the platform installs its handler\nconst _pendingApplicationEventListeners = new Set<(args: any) => void>();\nexport function toggleApplicationEventListeners(toAdd: boolean, callback: (args: any) => void) {\n\tif (_toggleApplicationEventListenersHandler) {\n\t\t_toggleApplicationEventListenersHandler(toAdd, callback);\n\t} else if (toAdd) {\n\t\t_pendingApplicationEventListeners.add(callback);\n\t} else {\n\t\t_pendingApplicationEventListeners.delete(callback);\n\t}\n}\nexport function setToggleApplicationEventListenersCallback(callback: (toAdd: boolean, callback: (args: any) => void) => void) {\n\t_toggleApplicationEventListenersHandler = callback;\n\n\tfor (const listener of _pendingApplicationEventListeners) {\n\t\tcallback(true, listener);\n\t}\n\t_pendingApplicationEventListeners.clear();\n}\n\n// Aids avoiding circular dependencies by allowing the application properties to be retrieved\ntype ApplicationPropertyValues = { orientation: 'portrait' | 'landscape' | 'unknown'; systemAppearance: 'dark' | 'light' | null };\nlet _applicationPropertiesCallback: () => ApplicationPropertyValues;\nexport function getApplicationProperties(): ApplicationPropertyValues {\n\tif (_applicationPropertiesCallback) {\n\t\treturn _applicationPropertiesCallback();\n\t}\n\treturn { orientation: 'unknown', systemAppearance: null };\n}\nexport function setApplicationPropertiesCallback(callback: () => ApplicationPropertyValues) {\n\t_applicationPropertiesCallback = callback;\n}\n\n// Lets the application create its root host without importing the UI stack, which workers must not load\nlet _contentViewFactory: () => any /* ContentView */;\nexport function setContentViewFactory(factory: () => any /* ContentView */) {\n\t_contentViewFactory = factory;\n}\nexport function createContentView(): any /* ContentView */ {\n\tif (!_contentViewFactory) {\n\t\tthrow new Error('ContentView is not registered: import \"@nativescript/core/ui/content-view\" before creating the root view.');\n\t}\n\treturn _contentViewFactory();\n}\n\nlet _a11yUpdatePropertiesCallback: (view: any /* View */) => void;\nexport function setA11yUpdatePropertiesCallback(callback: (view: any /* View */) => void) {\n\t_a11yUpdatePropertiesCallback = callback;\n}\nexport function updateA11yPropertiesCallback(view: any /* View */) {\n\tif (_a11yUpdatePropertiesCallback) {\n\t\t_a11yUpdatePropertiesCallback(view);\n\t}\n}\n\n/**\n * Internal Android app helpers\n */\nlet _imageFetcher: org.nativescript.widgets.image.Fetcher;\nexport function getImageFetcher(): org.nativescript.widgets.image.Fetcher {\n\treturn _imageFetcher;\n}\nexport function setImageFetcher(fetcher: org.nativescript.widgets.image.Fetcher) {\n\t_imageFetcher = fetcher;\n}\nexport enum CacheMode {\n\tnone,\n\tmemory,\n\tdiskAndMemory,\n}\n\nlet _currentCacheMode: CacheMode;\n\nexport function initImageCache(context: android.content.Context, mode = CacheMode.diskAndMemory, memoryCacheSize = 0.25, diskCacheSize: number = 10 * 1024 * 1024): void {\n\tif (_currentCacheMode === mode) {\n\t\treturn;\n\t}\n\n\t_currentCacheMode = mode;\n\tif (!getImageFetcher()) {\n\t\tsetImageFetcher(org.nativescript.widgets.image.Fetcher.getInstance(context));\n\t} else {\n\t\tgetImageFetcher().clearCache();\n\t}\n\n\tconst params = new org.nativescript.widgets.image.Cache.CacheParams();\n\tparams.memoryCacheEnabled = mode !== CacheMode.none;\n\tparams.setMemCacheSizePercent(memoryCacheSize); // Set memory cache to % of app memory\n\tparams.diskCacheEnabled = mode === CacheMode.diskAndMemory;\n\tparams.diskCacheSize = diskCacheSize;\n\tconst imageCache = org.nativescript.widgets.image.Cache.getInstance(params);\n\tgetImageFetcher().addImageCache(imageCache);\n\tgetImageFetcher().initCache();\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.interface.js","sourceRoot":"","sources":["../../../../packages/core/config/config.interface.ts"],"names":[],"mappings":"","sourcesContent":["import type { InstrumentationMode } from '../profiling';\n\ninterface IConfigPlatform {\n\t/**\n\t * App's bundle id\n\t */\n\tid?: string;\n\t/**\n\t * @deprecated Since runtime 9.1 uncaught JS errors no longer crash the app by default, so this flag is\n\t * no longer needed; remove it, or set the top-level `uncaughtErrorPolicy` instead.\n\t * The CLI copies a `true` value here to the top level of the emitted `package.json`, where it is still\n\t * honored exactly like the top-level `discardUncaughtJsExceptions`.\n\t */\n\tdiscardUncaughtJsExceptions?: boolean;\n\t/**\n\t * Custom runtime package name.\n\t * Override the npm package name of the NativeScript runtime used for this platform.\n\t * For example, \"@nativescript/ios-hermes\"\n\t */\n\truntimePackageName?: string;\n}\n\ninterface IOSSPMPackageBase {\n\tname: string;\n\tlibs: string[];\n\t/**\n\t * Optional: If you have more targets (like widgets for example)\n\t * you can list their names here to include the Swift Package with them\n\t */\n\ttargets?: string[];\n}\n\nexport interface IOSRemoteSPMPackage extends IOSSPMPackageBase {\n\trepositoryURL: string;\n\tversion: string;\n}\n\nexport interface IOSLocalSPMPackage extends IOSSPMPackageBase {\n\tpath: string;\n}\n\nexport type IOSSPMPackage = IOSRemoteSPMPackage | IOSLocalSPMPackage;\n\ninterface IConfigIOS extends IConfigPlatform {\n\t/**\n\t * Swift Package Manager\n\t * List packages to be included in the iOS build.\n\t */\n\tSPMPackages?: Array<IOSSPMPackage>;\n\t/**\n\t * Include native source code from anywhere\n\t */\n\tNativeSource?: Array<{\n\t\t/**\n\t\t * The folder name which will group these referenced files together in Xcode\n\t\t */\n\t\tname: string;\n\t\t/**\n\t\t * The path to the native source code.\n\t\t * You can also use glob patterns, including directories outside of the project root.\n\t\t */\n\t\tpath: string;\n\t}>;\n}\n\ninterface IConfigVisionOS extends IConfigIOS {}\n\ninterface IConfigAndroid extends IConfigPlatform {\n\t/**\n\t * These are the v8 runtime flags you can pass in, you must have \"--expose_gc\" as this is used in the runtime\n\t */\n\tv8Flags?: string;\n\n\t/**\n\t * Enable code cache by setting this to \"true\"\n\t */\n\tcodeCache?: boolean;\n\n\t/**\n\t * Depreciated\n\t * Do not change\n\t */\n\theapSnapshotScript?: string;\n\n\t/**\n\t * Depreciated\n\t * Do No change - File to use for Snapshots\n\t */\n\tSnapshotFile?: string;\n\n\t/**\n\t * Directory of profiler out put files\n\t */\n\tprofilerOutputDir?: string;\n\n\t/**\n\t * How frequently in MS to automatically trigger a gc (0 = Disabled & Default)\n\t * Docs: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/memory-management\n\t */\n\tgcThrottleTime?: number;\n\n\t/**\n\t * \"none\" & \"full\" is supported, \"full\" is depreciated\n\t * Default: none\n\t */\n\tmarkingMode?: string;\n\n\t/**\n\t * Allow time zone changes to notify app, default: false\n\t */\n\thandleTimeZoneChanges?: boolean;\n\n\t/**\n\t * Maximum size of a single output string; default: 1024\n\t */\n\tmaxLogcatObjectSize?: number;\n\n\t/**\n\t * Enable logging in Release applications, default: false\n\t */\n\tforceLog?: boolean;\n\n\t/**\n\t * How frequently in ms that it does the freeMemoryRatio check\n\t * Docs: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/memory-management\n\t */\n\tmemoryCheckInterval?: number;\n\n\t/**\n\t * Percentage of memory (0.0 to 1.0) before it forces a GC (default & disabled = 0)\n\t * Paired with he memoryCheckInterval\n\t * Docs: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/memory-management\n\t */\n\tfreeMemoryRatio?: number;\n\n\t/**\n\t * Used for Advanced debugging\n\t */\n\tenableLineBreakpoints?: boolean;\n\n\t/**\n\t * Enable the multithreaded JavaScript engine, this will probably break plugins...\n\t * Default: false - disabled.\n\t */\n\tenableMultithreadedJavascript?: boolean;\n}\n\ninterface IConfigCLI {\n\t/**\n\t * Set the package manager to use for this project.\n\t * Defaults to the CLI set package manager, or `npm` if not set globally\n\t */\n\tpackageManager: 'yarn' | 'pnpm' | 'npm';\n\n\t/**\n\t * Optional - Override the files or paths to clean when running the `ns clean` command\n\t */\n\tpathsToClean?: string[];\n\n\t/**\n\t * Optional - Additional files or paths to clean when running the `ns clean` command, the paths are appended to the default list of paths.\n\t */\n\tadditionalPathsToClean?: string[];\n}\n\ninterface IConfigHook {\n\t// prettier-ignore\n\t/**\n\t * Event name for when to run the hook.\n\t * Possible event names are any of the following with the pattern\n\t * `before-*` and `after-*`\n\t *\n\t *\t* `buildAndroidPlugin` - Builds aar file for Android plugin, runs during prepareNativeApp\n\t *\t* `buildAndroid` - Builds Android app\n\t *\t* `buildIOS` - Builds iOS app\n\t *\t* `checkEnvironment` - Validate project env, runs during ns doctor, clean, and most build commands\n\t *\t* `checkForChanges` - Changes occurred during watch\n\t *\t* `install` - Application installed to device/emulator\n\t *\t* `prepare` - Compiles webpack and prepares native app in platforms folder\n\t *\t* `prepareNativeApp` - Preparing the actual native app, runs during prepare/watch hook\n\t *\t* `resolveCommand` - Resolves command and arguments, runs before all cli commands\n\t *\t* `watch` - Setup watchers for live sync, runs during prepare hook\n\t *\t* `watchPatterns` - Setup watch patterns, runs during watch hook\n\t */\n\ttype:\n\t\t| 'before-buildAndroidPlugin'\t| 'after-buildAndroidPlugin'\n\t\t| 'before-buildAndroid'\t\t\t| 'after-buildAndroid'\n\t\t| 'before-buildIOS'\t\t\t\t| 'after-buildIOS'\n\t\t| 'before-checkEnvironment'\t\t| 'after-checkEnvironment'\n\t\t| 'before-checkForChanges'\t\t| 'after-checkForChanges'\n\t\t| 'before-install'\t\t\t\t| 'after-install'\n\t\t| 'before-prepare'\t\t\t\t| 'after-prepare'\n\t\t| 'before-prepareNativeApp'\t\t| 'after-prepareNativeApp'\n\t\t| 'before-resolveCommand'\t\t| 'after-resolveCommand'\n\t\t| 'before-watch'\t\t\t\t| 'after-watch'\n\t\t| 'before-watchPatterns'\t\t| 'after-watchPatterns';\n\n\t/**\n\t * Path to the hook script file to run\n\t */\n\tscript: string;\n}\n\ninterface IConfigEmbedProps {\n\t/**\n\t * Relative path to the platform host project directory.\n\t */\n\thostProjectPath?: string;\n\t/**\n\t * (Android only) Optional custom module name.\n\t */\n\thostProjectModuleName?: string;\n}\n\ninterface IConfigEmbed extends IConfigEmbedProps {\n\t/**\n\t * iOS specific embed configurations\n\t */\n\tios?: IConfigEmbedProps;\n\t/**\n\t * Android specific embed configurations\n\t */\n\tandroid?: IConfigEmbedProps;\n}\n\ninterface ISecurityConfig {\n\t/**\n\t * Enable remote ES module loading in production.\n\t * Default: false\n\t *\n\t * When false, any attempt to import(\"https://...\") in production\n\t * will throw an error.\n\t */\n\tallowRemoteModules: boolean;\n\n\t/**\n\t * Restrict remote modules to specific URL prefixes.\n\t * Only used when allowRemoteModules is true.\n\t *\n\t * If empty or not provided, all HTTPS URLs are allowed\n\t * (not recommended for production).\n\t */\n\tremoteModuleAllowlist?: string[];\n}\n\ntype BundlerType = 'webpack' | 'vite';\n\n/**\n * What the runtime does with an uncaught JS error or unhandled promise rejection once no\n * `globalThis` `error` / `unhandledrejection` listener has called `preventDefault()` on it.\n *\n * - `'report'` - log the error, fire `Application.uncaughtErrorEvent` and keep the app running.\n * - `'throw'` - after reporting, rethrow the error natively. An error thrown while a native\n * caller is on the stack is rethrown synchronously at that boundary (a native try/catch\n * around the call can handle it); errors from timers, microtasks and rejections are thrown\n * from a clean frame on the runtime loop. The app terminates only if nothing catches it,\n * in which case crash reporters capture it with the JavaScript stack attached.\n */\nexport type UncaughtErrorPolicy = 'report' | 'throw';\n\nexport interface NativeScriptConfig {\n\t/**\n\t * App's bundle id\n\t * Used for both iOS and Android if they use the same bundle id. You can override per platform in the respective platform specific configurations.\n\t */\n\tid?: string;\n\t/**\n\t * App's main entry file - this setting overrides the value set in package.json\n\t */\n\tmain?: string;\n\t/**\n\t * Path to the app source directory\n\t * This is often the `src` or `app` directory however can be changed.\n\t */\n\tappPath?: string;\n\t/**\n\t * App_Resources path\n\t * This is often at the root or inside `src` or `app` directory however can be anywhere.\n\t */\n\tappResourcesPath?: string;\n\tshared?: boolean;\n\tpreviewAppSchema?: string;\n\toverridePods?: string;\n\t/**\n\t * Custom platform project name.\n\t * By default, the platforms/{platform}/{name} is based on the basename of the project directory.\n\t * You can override that to use a name of your choice by setting this.\n\t */\n\tprojectName?: string;\n\t/**\n\t * For embedding into existing platform host projects.\n\t */\n\tembed?: IConfigEmbed;\n\t/**\n\t * @deprecated Use `bundlerConfigPath` instead.\n\t * Custom webpack config path\n\t * The default is `webpack.config.js` in the root however you can use a custom name and place elsewhere.\n\t */\n\twebpackConfigPath?: string;\n\t/**\n\t * Custom bundler config path\n\t * For example, `vite.config.ts`, `webpack.config.js`, etc.\n\t * The default is `webpack.config.js` however you can use a custom name and place elsewhere.\n\t */\n\tbundlerConfigPath?: string;\n\t/**\n\t * Bundler to use for this project.\n\t * Default is 'webpack'.\n\t */\n\tbundler?: BundlerType;\n\t/**\n\t * Enable runtime logging of script loading.\n\t */\n\tlogScriptLoading?: boolean;\n\t/**\n\t * Show visual error display when an uncaught JS exception occurs.\n\t */\n\tshowErrorDisplay?: boolean;\n\t/**\n\t * Policy for uncaught JS errors and unhandled promise rejections that no listener handled.\n\t * Default: `'report'` - the app keeps running.\n\t *\n\t * Requires runtime 9.1+ (iOS and Android); older runtimes ignore the key and crash on\n\t * uncaught errors as before. Read only from the top level of the config - a value nested\n\t * under `ios` / `android` has no effect.\n\t *\n\t * To handle individual errors instead, add a `globalThis` listener and cancel the event:\n\t * `globalThis.addEventListener('unhandledrejection', (e) => e.preventDefault())`.\n\t */\n\tuncaughtErrorPolicy?: UncaughtErrorPolicy;\n\t/**\n\t * @deprecated Since runtime 9.1 uncaught JS errors no longer crash the app by default, so this flag is\n\t * no longer needed. Remove it, or use `uncaughtErrorPolicy`.\n\t *\n\t * Still honored while deprecated, with a one-time runtime warning: `true` routes uncaught errors to\n\t * `Application.discardedErrorEvent` (instead of `uncaughtErrorEvent`), skips the fatal log and\n\t * suppresses `uncaughtErrorPolicy: 'throw'`. `false` is ignored - it does NOT restore the old\n\t * crash-on-uncaught behavior; set `uncaughtErrorPolicy: 'throw'` for that.\n\t */\n\tdiscardUncaughtJsExceptions?: boolean;\n\t/**\n\t * iOS specific configurations\n\t * Various iOS specific configurations including iOS runtime flags.\n\t */\n\tios?: IConfigIOS;\n\t/**\n\t * Vision Pro specific configurations\n\t * Various VisionOS specific configurations including iOS runtime flags.\n\t */\n\tvisionos?: IConfigVisionOS;\n\t/**\n\t * Android specific configurations\n\t * Various Android specific configurations including Android runtime flags.\n\t */\n\tandroid?: IConfigAndroid;\n\t/**\n\t * Enable profiling for the application. Default: no profiling\n\t * In most cases when profiling, you will want to use \"timeline\"\n\t */\n\tprofiling?: InstrumentationMode;\n\t/**\n\t * Set the default CSS parser that NativeScript will use.\n\t * Default: css-tree\n\t */\n\tcssParser?: 'rework' | 'nativescript' | 'css-tree';\n\n\t/**\n\t * Optionally specify a list of npm package names for which you would like the NativeScript CLI to ignore when attaching native dependencies to the build\n\t */\n\tignoredNativeDependencies?: string[];\n\n\t/**\n\t * Set cli options\n\t */\n\tcli?: IConfigCLI;\n\n\t/**\n\t * Set project persistent hooks to run\n\t */\n\thooks?: IConfigHook[];\n\n\t/**\n\t * Security configurations\n\t */\n\tsecurity?: ISecurityConfig;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"config.interface.js","sourceRoot":"","sources":["../../../../packages/core/config/config.interface.ts"],"names":[],"mappings":"","sourcesContent":["import type { InstrumentationMode } from '../profiling';\n\nexport interface IConfigPlatform {\n\t/**\n\t * App's bundle id\n\t */\n\tid?: string;\n\t/**\n\t * @deprecated Since runtime 9.1 uncaught JS errors no longer crash the app by default, so this flag is\n\t * no longer needed; remove it, or set the top-level `uncaughtErrorPolicy` instead.\n\t * The CLI copies a `true` value here to the top level of the emitted `package.json`, where it is still\n\t * honored exactly like the top-level `discardUncaughtJsExceptions`.\n\t */\n\tdiscardUncaughtJsExceptions?: boolean;\n\t/**\n\t * Custom runtime package name.\n\t * Override the npm package name of the NativeScript runtime used for this platform.\n\t * For example, \"@nativescript/ios-hermes\"\n\t */\n\truntimePackageName?: string;\n}\n\ninterface IOSSPMPackageBase {\n\tname: string;\n\tlibs: string[];\n\t/**\n\t * Optional: If you have more targets (like widgets for example)\n\t * you can list their names here to include the Swift Package with them\n\t */\n\ttargets?: string[];\n}\n\nexport interface IOSRemoteSPMPackage extends IOSSPMPackageBase {\n\trepositoryURL: string;\n\tversion: string;\n}\n\nexport interface IOSLocalSPMPackage extends IOSSPMPackageBase {\n\tpath: string;\n}\n\nexport type IOSSPMPackage = IOSRemoteSPMPackage | IOSLocalSPMPackage;\n\ninterface IConfigIOS extends IConfigPlatform {\n\t/**\n\t * Swift Package Manager\n\t * List packages to be included in the iOS build.\n\t */\n\tSPMPackages?: Array<IOSSPMPackage>;\n\t/**\n\t * Include native source code from anywhere\n\t */\n\tNativeSource?: Array<{\n\t\t/**\n\t\t * The folder name which will group these referenced files together in Xcode\n\t\t */\n\t\tname: string;\n\t\t/**\n\t\t * The path to the native source code.\n\t\t * You can also use glob patterns, including directories outside of the project root.\n\t\t */\n\t\tpath: string;\n\t}>;\n}\n\ninterface IConfigVisionOS extends IConfigIOS {}\n\ninterface IConfigAndroid extends IConfigPlatform {\n\t/**\n\t * These are the v8 runtime flags you can pass in, you must have \"--expose_gc\" as this is used in the runtime\n\t */\n\tv8Flags?: string;\n\n\t/**\n\t * Enable code cache by setting this to \"true\"\n\t */\n\tcodeCache?: boolean;\n\n\t/**\n\t * Depreciated\n\t * Do not change\n\t */\n\theapSnapshotScript?: string;\n\n\t/**\n\t * Depreciated\n\t * Do No change - File to use for Snapshots\n\t */\n\tSnapshotFile?: string;\n\n\t/**\n\t * Directory of profiler out put files\n\t */\n\tprofilerOutputDir?: string;\n\n\t/**\n\t * How frequently in MS to automatically trigger a gc (0 = Disabled & Default)\n\t * Docs: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/memory-management\n\t */\n\tgcThrottleTime?: number;\n\n\t/**\n\t * \"none\" & \"full\" is supported, \"full\" is depreciated\n\t * Default: none\n\t */\n\tmarkingMode?: string;\n\n\t/**\n\t * Allow time zone changes to notify app, default: false\n\t */\n\thandleTimeZoneChanges?: boolean;\n\n\t/**\n\t * Maximum size of a single output string; default: 1024\n\t */\n\tmaxLogcatObjectSize?: number;\n\n\t/**\n\t * Enable logging in Release applications, default: false\n\t */\n\tforceLog?: boolean;\n\n\t/**\n\t * How frequently in ms that it does the freeMemoryRatio check\n\t * Docs: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/memory-management\n\t */\n\tmemoryCheckInterval?: number;\n\n\t/**\n\t * Percentage of memory (0.0 to 1.0) before it forces a GC (default & disabled = 0)\n\t * Paired with he memoryCheckInterval\n\t * Docs: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/memory-management\n\t */\n\tfreeMemoryRatio?: number;\n\n\t/**\n\t * Used for Advanced debugging\n\t */\n\tenableLineBreakpoints?: boolean;\n\n\t/**\n\t * Enable the multithreaded JavaScript engine, this will probably break plugins...\n\t * Default: false - disabled.\n\t */\n\tenableMultithreadedJavascript?: boolean;\n}\n\ninterface IConfigCLI {\n\t/**\n\t * Set the package manager to use for this project.\n\t * Defaults to the CLI set package manager, or `npm` if not set globally\n\t */\n\tpackageManager: 'yarn' | 'pnpm' | 'npm';\n\n\t/**\n\t * Optional - Override the files or paths to clean when running the `ns clean` command\n\t */\n\tpathsToClean?: string[];\n\n\t/**\n\t * Optional - Additional files or paths to clean when running the `ns clean` command, the paths are appended to the default list of paths.\n\t */\n\tadditionalPathsToClean?: string[];\n}\n\ninterface IConfigHook {\n\t// prettier-ignore\n\t/**\n\t * Event name for when to run the hook.\n\t * Possible event names are any of the following with the pattern\n\t * `before-*` and `after-*`\n\t *\n\t *\t* `buildAndroidPlugin` - Builds aar file for Android plugin, runs during prepareNativeApp\n\t *\t* `buildAndroid` - Builds Android app\n\t *\t* `buildIOS` - Builds iOS app\n\t *\t* `checkEnvironment` - Validate project env, runs during ns doctor, clean, and most build commands\n\t *\t* `checkForChanges` - Changes occurred during watch\n\t *\t* `install` - Application installed to device/emulator\n\t *\t* `prepare` - Compiles webpack and prepares native app in platforms folder\n\t *\t* `prepareNativeApp` - Preparing the actual native app, runs during prepare/watch hook\n\t *\t* `resolveCommand` - Resolves command and arguments, runs before all cli commands\n\t *\t* `watch` - Setup watchers for live sync, runs during prepare hook\n\t *\t* `watchPatterns` - Setup watch patterns, runs during watch hook\n\t */\n\ttype:\n\t\t| 'before-buildAndroidPlugin'\t| 'after-buildAndroidPlugin'\n\t\t| 'before-buildAndroid'\t\t\t| 'after-buildAndroid'\n\t\t| 'before-buildIOS'\t\t\t\t| 'after-buildIOS'\n\t\t| 'before-checkEnvironment'\t\t| 'after-checkEnvironment'\n\t\t| 'before-checkForChanges'\t\t| 'after-checkForChanges'\n\t\t| 'before-install'\t\t\t\t| 'after-install'\n\t\t| 'before-prepare'\t\t\t\t| 'after-prepare'\n\t\t| 'before-prepareNativeApp'\t\t| 'after-prepareNativeApp'\n\t\t| 'before-resolveCommand'\t\t| 'after-resolveCommand'\n\t\t| 'before-watch'\t\t\t\t| 'after-watch'\n\t\t| 'before-watchPatterns'\t\t| 'after-watchPatterns';\n\n\t/**\n\t * Path to the hook script file to run\n\t */\n\tscript: string;\n}\n\ninterface IConfigEmbedProps {\n\t/**\n\t * Relative path to the platform host project directory.\n\t */\n\thostProjectPath?: string;\n\t/**\n\t * (Android only) Optional custom module name.\n\t */\n\thostProjectModuleName?: string;\n}\n\ninterface IConfigEmbed extends IConfigEmbedProps {\n\t/**\n\t * iOS specific embed configurations\n\t */\n\tios?: IConfigEmbedProps;\n\t/**\n\t * Android specific embed configurations\n\t */\n\tandroid?: IConfigEmbedProps;\n}\n\ninterface ISecurityConfig {\n\t/**\n\t * Enable remote ES module loading in production.\n\t * Default: false\n\t *\n\t * When false, any attempt to import(\"https://...\") in production\n\t * will throw an error.\n\t */\n\tallowRemoteModules: boolean;\n\n\t/**\n\t * Restrict remote modules to specific URL prefixes.\n\t * Only used when allowRemoteModules is true.\n\t *\n\t * If empty or not provided, all HTTPS URLs are allowed\n\t * (not recommended for production).\n\t */\n\tremoteModuleAllowlist?: string[];\n}\n\ntype BundlerType = 'webpack' | 'vite';\n\n/**\n * What the runtime does with an uncaught JS error or unhandled promise rejection once no\n * `globalThis` `error` / `unhandledrejection` listener has called `preventDefault()` on it.\n *\n * - `'report'` - log the error, fire `Application.uncaughtErrorEvent` and keep the app running.\n * - `'throw'` - after reporting, rethrow the error natively. An error thrown while a native\n * caller is on the stack is rethrown synchronously at that boundary (a native try/catch\n * around the call can handle it); errors from timers, microtasks and rejections are thrown\n * from a clean frame on the runtime loop. The app terminates only if nothing catches it,\n * in which case crash reporters capture it with the JavaScript stack attached.\n */\nexport type UncaughtErrorPolicy = 'report' | 'throw';\n\nexport interface NativeScriptConfig {\n\t/**\n\t * App's bundle id\n\t * Used for both iOS and Android if they use the same bundle id. You can override per platform in the respective platform specific configurations.\n\t */\n\tid?: string;\n\t/**\n\t * App's main entry file - this setting overrides the value set in package.json\n\t */\n\tmain?: string;\n\t/**\n\t * Path to the app source directory\n\t * This is often the `src` or `app` directory however can be changed.\n\t */\n\tappPath?: string;\n\t/**\n\t * App_Resources path\n\t * This is often at the root or inside `src` or `app` directory however can be anywhere.\n\t */\n\tappResourcesPath?: string;\n\tshared?: boolean;\n\tpreviewAppSchema?: string;\n\toverridePods?: string;\n\t/**\n\t * Custom platform project name.\n\t * By default, the platforms/{platform}/{name} is based on the basename of the project directory.\n\t * You can override that to use a name of your choice by setting this.\n\t */\n\tprojectName?: string;\n\t/**\n\t * For embedding into existing platform host projects.\n\t */\n\tembed?: IConfigEmbed;\n\t/**\n\t * @deprecated Use `bundlerConfigPath` instead.\n\t * Custom webpack config path\n\t * The default is `webpack.config.js` in the root however you can use a custom name and place elsewhere.\n\t */\n\twebpackConfigPath?: string;\n\t/**\n\t * Custom bundler config path\n\t * For example, `vite.config.ts`, `webpack.config.js`, etc.\n\t * The default is `webpack.config.js` however you can use a custom name and place elsewhere.\n\t */\n\tbundlerConfigPath?: string;\n\t/**\n\t * Bundler to use for this project.\n\t * Default is 'webpack'.\n\t */\n\tbundler?: BundlerType;\n\t/**\n\t * Enable runtime logging of script loading.\n\t */\n\tlogScriptLoading?: boolean;\n\t/**\n\t * Show visual error display when an uncaught JS exception occurs.\n\t */\n\tshowErrorDisplay?: boolean;\n\t/**\n\t * Policy for uncaught JS errors and unhandled promise rejections that no listener handled.\n\t * Default: `'report'` - the app keeps running.\n\t *\n\t * Requires runtime 9.1+ (iOS and Android); older runtimes ignore the key and crash on\n\t * uncaught errors as before. Read only from the top level of the config - a value nested\n\t * under `ios` / `android` has no effect.\n\t *\n\t * To handle individual errors instead, add a `globalThis` listener and cancel the event:\n\t * `globalThis.addEventListener('unhandledrejection', (e) => e.preventDefault())`.\n\t */\n\tuncaughtErrorPolicy?: UncaughtErrorPolicy;\n\t/**\n\t * @deprecated Since runtime 9.1 uncaught JS errors no longer crash the app by default, so this flag is\n\t * no longer needed. Remove it, or use `uncaughtErrorPolicy`.\n\t *\n\t * Still honored while deprecated, with a one-time runtime warning: `true` routes uncaught errors to\n\t * `Application.discardedErrorEvent` (instead of `uncaughtErrorEvent`), skips the fatal log and\n\t * suppresses `uncaughtErrorPolicy: 'throw'`. `false` is ignored - it does NOT restore the old\n\t * crash-on-uncaught behavior; set `uncaughtErrorPolicy: 'throw'` for that.\n\t */\n\tdiscardUncaughtJsExceptions?: boolean;\n\t/**\n\t * iOS specific configurations\n\t * Various iOS specific configurations including iOS runtime flags.\n\t */\n\tios?: IConfigIOS;\n\t/**\n\t * Vision Pro specific configurations\n\t * Various VisionOS specific configurations including iOS runtime flags.\n\t */\n\tvisionos?: IConfigVisionOS;\n\t/**\n\t * Android specific configurations\n\t * Various Android specific configurations including Android runtime flags.\n\t */\n\tandroid?: IConfigAndroid;\n\t/**\n\t * Enable profiling for the application. Default: no profiling\n\t * In most cases when profiling, you will want to use \"timeline\"\n\t */\n\tprofiling?: InstrumentationMode;\n\t/**\n\t * Set the default CSS parser that NativeScript will use.\n\t * Default: css-tree\n\t */\n\tcssParser?: 'rework' | 'nativescript' | 'css-tree';\n\n\t/**\n\t * Optionally specify a list of npm package names for which you would like the NativeScript CLI to ignore when attaching native dependencies to the build\n\t */\n\tignoredNativeDependencies?: string[];\n\n\t/**\n\t * Set cli options\n\t */\n\tcli?: IConfigCLI;\n\n\t/**\n\t * Set project persistent hooks to run\n\t */\n\thooks?: IConfigHook[];\n\n\t/**\n\t * Security configurations\n\t */\n\tsecurity?: ISecurityConfig;\n}\n"]}
|
|
@@ -15,7 +15,7 @@ export interface MediaQueryEnvironmentParams {
|
|
|
15
15
|
}
|
|
16
16
|
export interface MediaQueryExpression {
|
|
17
17
|
inverse: boolean;
|
|
18
|
-
type: MediaQueryType;
|
|
18
|
+
type: MediaQueryType | string;
|
|
19
19
|
features: MediaQueryFeature[];
|
|
20
20
|
}
|
|
21
21
|
export interface MediaQueryFeature {
|
|
@@ -23,5 +23,10 @@ export interface MediaQueryFeature {
|
|
|
23
23
|
property: MediaQueryProperties | string;
|
|
24
24
|
value: string;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Whether a media query is valid and uses only features the runtime can evaluate.
|
|
28
|
+
* @param mediaQuery The media query string.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isEvaluableMediaQuery(mediaQuery: string): boolean;
|
|
26
31
|
export declare function matchQuery(mediaQuery: string, values: MediaQueryEnvironmentParams): boolean;
|
|
27
32
|
export declare function parseQuery(mediaQuery: string): MediaQueryExpression[];
|
package/css-mediaquery/index.js
CHANGED
|
@@ -8,14 +8,39 @@ import { Trace } from '../trace';
|
|
|
8
8
|
import { Length } from '../ui/styling/length-shared';
|
|
9
9
|
// -----------------------------------------------------------------------------
|
|
10
10
|
const RE_MEDIA_QUERY = /^(?:(only|not)?\s*([_a-z][_a-z0-9-]*)|(\([^\)]+\)))(?:\s*and\s*(.*))?$/i, RE_MQ_EXPRESSION = /^\(\s*([_a-z-][_a-z0-9-]*)\s*(?:\:\s*([^\)]+))?\s*\)$/, RE_MQ_FEATURE = /^(?:(min|max)-)?(.+)/, RE_LENGTH_UNIT = /(em|rem|px|cm|mm|in|pt|pc)?\s*$/, RE_RESOLUTION_UNIT = /(dpi|dpcm|dppx)?\s*$/;
|
|
11
|
+
const RESERVED_MEDIA_TYPES = new Set(['only', 'not', 'and', 'or', 'layer']);
|
|
11
12
|
export var MediaQueryType;
|
|
12
13
|
(function (MediaQueryType) {
|
|
13
14
|
MediaQueryType["all"] = "all";
|
|
14
15
|
MediaQueryType["print"] = "print";
|
|
15
16
|
MediaQueryType["screen"] = "screen";
|
|
16
17
|
})(MediaQueryType || (MediaQueryType = {}));
|
|
18
|
+
const EVALUABLE_FEATURES = new Set(['width', 'height', 'device-width', 'device-height', 'orientation', 'prefers-color-scheme']);
|
|
19
|
+
const parsedQueryCache = new Map();
|
|
20
|
+
function getParsedQuery(mediaQuery) {
|
|
21
|
+
let expressions = parsedQueryCache.get(mediaQuery);
|
|
22
|
+
if (!expressions) {
|
|
23
|
+
expressions = parseQuery(mediaQuery);
|
|
24
|
+
parsedQueryCache.set(mediaQuery, expressions);
|
|
25
|
+
}
|
|
26
|
+
return expressions;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Whether a media query is valid and uses only features the runtime can evaluate.
|
|
30
|
+
* @param mediaQuery The media query string.
|
|
31
|
+
*/
|
|
32
|
+
export function isEvaluableMediaQuery(mediaQuery) {
|
|
33
|
+
let expressions;
|
|
34
|
+
try {
|
|
35
|
+
expressions = getParsedQuery(mediaQuery);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
return expressions.every((query) => query.features.every((feature) => EVALUABLE_FEATURES.has(feature.property)));
|
|
41
|
+
}
|
|
17
42
|
export function matchQuery(mediaQuery, values) {
|
|
18
|
-
const expressions =
|
|
43
|
+
const expressions = getParsedQuery(mediaQuery);
|
|
19
44
|
return expressions.some((query) => {
|
|
20
45
|
const { type, inverse, features } = query;
|
|
21
46
|
// Either the parsed or specified `type` is "all", or the types must be
|
|
@@ -84,9 +109,13 @@ export function parseQuery(mediaQuery) {
|
|
|
84
109
|
const modifier = captures[1];
|
|
85
110
|
const type = captures[2];
|
|
86
111
|
const featureString = ((captures[3] || '') + (captures[4] || '')).trim();
|
|
112
|
+
const mediaType = type ? type.toLowerCase() : MediaQueryType.all;
|
|
113
|
+
if (RESERVED_MEDIA_TYPES.has(mediaType)) {
|
|
114
|
+
return { inverse: true, type: MediaQueryType.all, features: [] };
|
|
115
|
+
}
|
|
87
116
|
const expression = {
|
|
88
117
|
inverse: !!modifier && modifier.toLowerCase() === 'not',
|
|
89
|
-
type:
|
|
118
|
+
type: mediaType,
|
|
90
119
|
features: [],
|
|
91
120
|
};
|
|
92
121
|
// Check for media query features
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/core/css-mediaquery/index.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AAEF,0CAA0C;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,gFAAgF;AAEhF,MAAM,cAAc,GAAG,yEAAyE,EAC/F,gBAAgB,GAAG,uDAAuD,EAC1E,aAAa,GAAG,sBAAsB,EACtC,cAAc,GAAG,iCAAiC,EAClD,kBAAkB,GAAG,sBAAsB,CAAC;AAE7C,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACzB,6BAAW,CAAA;IACX,iCAAe,CAAA;IACf,mCAAiB,CAAA;AAClB,CAAC,EAJ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,OAAO,SAAS,KAAK,GAAG,CAAC,CAAC;YACtF,CAAC;YAED,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YAEnE,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACxB,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;gBACxB,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;gBACxB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;aAClB,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\n\n// https://github.com/ericf/css-mediaquery\n\nimport { Trace } from '../trace';\nimport { Length } from '../ui/styling/length-shared';\n\n// -----------------------------------------------------------------------------\n\nconst RE_MEDIA_QUERY = /^(?:(only|not)?\\s*([_a-z][_a-z0-9-]*)|(\\([^\\)]+\\)))(?:\\s*and\\s*(.*))?$/i,\n\tRE_MQ_EXPRESSION = /^\\(\\s*([_a-z-][_a-z0-9-]*)\\s*(?:\\:\\s*([^\\)]+))?\\s*\\)$/,\n\tRE_MQ_FEATURE = /^(?:(min|max)-)?(.+)/,\n\tRE_LENGTH_UNIT = /(em|rem|px|cm|mm|in|pt|pc)?\\s*$/,\n\tRE_RESOLUTION_UNIT = /(dpi|dpcm|dppx)?\\s*$/;\n\nexport enum MediaQueryType {\n\tall = 'all',\n\tprint = 'print',\n\tscreen = 'screen',\n}\n\nexport type MediaQueryProperties = 'width' | 'height' | 'device-width' | 'device-height' | 'orientation' | 'prefers-color-scheme';\n\nexport interface MediaQueryEnvironmentParams {\n\ttype?: MediaQueryType;\n\twidth?: number;\n\theight?: number;\n\t'device-width'?: number;\n\t'device-height'?: number;\n\torientation?: string;\n\t'prefers-color-scheme'?: string;\n}\n\nexport interface MediaQueryExpression {\n\tinverse: boolean;\n\ttype: MediaQueryType;\n\tfeatures: MediaQueryFeature[];\n}\n\nexport interface MediaQueryFeature {\n\tmodifier: string;\n\tproperty: MediaQueryProperties | string;\n\tvalue: string;\n}\n\nexport function matchQuery(mediaQuery: string, values: MediaQueryEnvironmentParams): boolean {\n\tconst expressions = parseQuery(mediaQuery);\n\n\treturn expressions.some((query) => {\n\t\tconst { type, inverse, features } = query;\n\n\t\t// Either the parsed or specified `type` is \"all\", or the types must be\n\t\t// equal for a match.\n\t\tconst typeMatch = query.type === 'all' || values.type === query.type;\n\n\t\t// `not` negates the whole query, the type included.\n\t\tif (!typeMatch) {\n\t\t\treturn inverse;\n\t\t}\n\n\t\tconst expressionsMatch = features.every((feature) => {\n\t\t\tconst value: any = values[feature.property];\n\n\t\t\t// Missing or falsy values don't match\n\t\t\tif (!value && value !== 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tswitch (feature.property) {\n\t\t\t\tcase 'orientation':\n\t\t\t\tcase 'prefers-color-scheme':\n\t\t\t\t\tif (typeof value !== 'string') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn value.toLowerCase() === feature.value.toLowerCase();\n\t\t\t\tdefault: {\n\t\t\t\t\t// Numeric properties\n\t\t\t\t\tlet numVal: number;\n\n\t\t\t\t\tif (typeof value !== 'number') {\n\t\t\t\t\t\tTrace.write(`Unknown CSS media query feature property: '${feature.property}' on '${query}'`, Trace.categories.MediaQuery, Trace.messageType.warn);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (feature.property) {\n\t\t\t\t\t\tcase 'width':\n\t\t\t\t\t\tcase 'height':\n\t\t\t\t\t\tcase 'device-width':\n\t\t\t\t\t\tcase 'device-height': {\n\t\t\t\t\t\t\tnumVal = Length.toDevicePixels(Length.parse(feature.value), 0);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tTrace.write(`Unknown CSS media query feature property: '${feature.property}' on '${query}'`, Trace.categories.MediaQuery, Trace.messageType.warn);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (feature.modifier) {\n\t\t\t\t\t\tcase 'min':\n\t\t\t\t\t\t\treturn value >= numVal;\n\t\t\t\t\t\tcase 'max':\n\t\t\t\t\t\t\treturn value <= numVal;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn value === numVal;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn inverse ? !expressionsMatch : expressionsMatch;\n\t});\n}\n\nexport function parseQuery(mediaQuery: string): MediaQueryExpression[] {\n\tconst mediaQueryStrings = mediaQuery.split(',');\n\n\treturn mediaQueryStrings.map((query) => {\n\t\tquery = query.trim();\n\n\t\tconst captures = query.match(RE_MEDIA_QUERY);\n\n\t\t// Media query must be valid\n\t\tif (!captures) {\n\t\t\tthrow new SyntaxError(`Invalid CSS media query: '${query}'`);\n\t\t}\n\n\t\tconst modifier = captures[1];\n\t\tconst type = captures[2];\n\t\tconst featureString = ((captures[3] || '') + (captures[4] || '')).trim();\n\n\t\tconst expression: MediaQueryExpression = {\n\t\t\tinverse: !!modifier && modifier.toLowerCase() === 'not',\n\t\t\ttype: MediaQueryType[type ? type.toLowerCase() : 'all'] ?? 'all',\n\t\t\tfeatures: [],\n\t\t};\n\n\t\t// Check for media query features\n\t\tif (!featureString) {\n\t\t\treturn expression;\n\t\t}\n\n\t\t// Split features string into a list\n\t\tconst features = featureString.match(/\\([^\\)]+\\)/g);\n\n\t\t// Media query must be valid\n\t\tif (!features) {\n\t\t\tthrow new SyntaxError(`Invalid CSS media query features: '${featureString}' on '${query}'`);\n\t\t}\n\n\t\tfor (const feature of features) {\n\t\t\tconst captures = feature.match(RE_MQ_EXPRESSION);\n\n\t\t\t// Media query must be valid\n\t\t\tif (!captures) {\n\t\t\t\tthrow new SyntaxError(`Invalid CSS media query feature: '${feature}' on '${query}'`);\n\t\t\t}\n\n\t\t\tconst featureData = captures[1].toLowerCase().match(RE_MQ_FEATURE);\n\n\t\t\texpression.features.push({\n\t\t\t\tmodifier: featureData[1],\n\t\t\t\tproperty: featureData[2],\n\t\t\t\tvalue: captures[2],\n\t\t\t});\n\t\t}\n\n\t\treturn expression;\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/core/css-mediaquery/index.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AAEF,0CAA0C;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,gFAAgF;AAEhF,MAAM,cAAc,GAAG,yEAAyE,EAC/F,gBAAgB,GAAG,uDAAuD,EAC1E,aAAa,GAAG,sBAAsB,EACtC,cAAc,GAAG,iCAAiC,EAClD,kBAAkB,GAAG,sBAAsB,CAAC;AAE7C,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AAE5E,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACzB,6BAAW,CAAA;IACX,iCAAe,CAAA;IACf,mCAAiB,CAAA;AAClB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AA0BD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAExI,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAkC,CAAC;AAEnE,SAAS,cAAc,CAAC,UAAkB;IACzC,IAAI,WAAW,GAAG,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,C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) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\n\n// https://github.com/ericf/css-mediaquery\n\nimport { Trace } from '../trace';\nimport { Length } from '../ui/styling/length-shared';\n\n// -----------------------------------------------------------------------------\n\nconst RE_MEDIA_QUERY = /^(?:(only|not)?\\s*([_a-z][_a-z0-9-]*)|(\\([^\\)]+\\)))(?:\\s*and\\s*(.*))?$/i,\n\tRE_MQ_EXPRESSION = /^\\(\\s*([_a-z-][_a-z0-9-]*)\\s*(?:\\:\\s*([^\\)]+))?\\s*\\)$/,\n\tRE_MQ_FEATURE = /^(?:(min|max)-)?(.+)/,\n\tRE_LENGTH_UNIT = /(em|rem|px|cm|mm|in|pt|pc)?\\s*$/,\n\tRE_RESOLUTION_UNIT = /(dpi|dpcm|dppx)?\\s*$/;\n\nconst RESERVED_MEDIA_TYPES = new Set(['only', 'not', 'and', 'or', 'layer']);\n\nexport enum MediaQueryType {\n\tall = 'all',\n\tprint = 'print',\n\tscreen = 'screen',\n}\n\nexport type MediaQueryProperties = 'width' | 'height' | 'device-width' | 'device-height' | 'orientation' | 'prefers-color-scheme';\n\nexport interface MediaQueryEnvironmentParams {\n\ttype?: MediaQueryType;\n\twidth?: number;\n\theight?: number;\n\t'device-width'?: number;\n\t'device-height'?: number;\n\torientation?: string;\n\t'prefers-color-scheme'?: string;\n}\n\nexport interface MediaQueryExpression {\n\tinverse: boolean;\n\ttype: MediaQueryType | string;\n\tfeatures: MediaQueryFeature[];\n}\n\nexport interface MediaQueryFeature {\n\tmodifier: string;\n\tproperty: MediaQueryProperties | string;\n\tvalue: string;\n}\n\nconst EVALUABLE_FEATURES = new Set<string>(['width', 'height', 'device-width', 'device-height', 'orientation', 'prefers-color-scheme']);\n\nconst parsedQueryCache = new Map<string, MediaQueryExpression[]>();\n\nfunction getParsedQuery(mediaQuery: string): MediaQueryExpression[] {\n\tlet expressions = parsedQueryCache.get(mediaQuery);\n\tif (!expressions) {\n\t\texpressions = parseQuery(mediaQuery);\n\t\tparsedQueryCache.set(mediaQuery, expressions);\n\t}\n\n\treturn expressions;\n}\n\n/**\n * Whether a media query is valid and uses only features the runtime can evaluate.\n * @param mediaQuery The media query string.\n */\nexport function isEvaluableMediaQuery(mediaQuery: string): boolean {\n\tlet expressions: MediaQueryExpression[];\n\n\ttry {\n\t\texpressions = getParsedQuery(mediaQuery);\n\t} catch {\n\t\treturn false;\n\t}\n\n\treturn expressions.every((query) => query.features.every((feature) => EVALUABLE_FEATURES.has(feature.property)));\n}\n\nexport function matchQuery(mediaQuery: string, values: MediaQueryEnvironmentParams): boolean {\n\tconst expressions = getParsedQuery(mediaQuery);\n\n\treturn expressions.some((query) => {\n\t\tconst { type, inverse, features } = query;\n\n\t\t// Either the parsed or specified `type` is \"all\", or the types must be\n\t\t// equal for a match.\n\t\tconst typeMatch = query.type === 'all' || values.type === query.type;\n\n\t\t// `not` negates the whole query, the type included.\n\t\tif (!typeMatch) {\n\t\t\treturn inverse;\n\t\t}\n\n\t\tconst expressionsMatch = features.every((feature) => {\n\t\t\tconst value: any = values[feature.property];\n\n\t\t\t// Missing or falsy values don't match\n\t\t\tif (!value && value !== 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tswitch (feature.property) {\n\t\t\t\tcase 'orientation':\n\t\t\t\tcase 'prefers-color-scheme':\n\t\t\t\t\tif (typeof value !== 'string') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn value.toLowerCase() === feature.value.toLowerCase();\n\t\t\t\tdefault: {\n\t\t\t\t\t// Numeric properties\n\t\t\t\t\tlet numVal: number;\n\n\t\t\t\t\tif (typeof value !== 'number') {\n\t\t\t\t\t\tTrace.write(`Unknown CSS media query feature property: '${feature.property}' on '${query}'`, Trace.categories.MediaQuery, Trace.messageType.warn);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (feature.property) {\n\t\t\t\t\t\tcase 'width':\n\t\t\t\t\t\tcase 'height':\n\t\t\t\t\t\tcase 'device-width':\n\t\t\t\t\t\tcase 'device-height': {\n\t\t\t\t\t\t\tnumVal = Length.toDevicePixels(Length.parse(feature.value), 0);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tTrace.write(`Unknown CSS media query feature property: '${feature.property}' on '${query}'`, Trace.categories.MediaQuery, Trace.messageType.warn);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (feature.modifier) {\n\t\t\t\t\t\tcase 'min':\n\t\t\t\t\t\t\treturn value >= numVal;\n\t\t\t\t\t\tcase 'max':\n\t\t\t\t\t\t\treturn value <= numVal;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn value === numVal;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn inverse ? !expressionsMatch : expressionsMatch;\n\t});\n}\n\nexport function parseQuery(mediaQuery: string): MediaQueryExpression[] {\n\tconst mediaQueryStrings = mediaQuery.split(',');\n\n\treturn mediaQueryStrings.map((query) => {\n\t\tquery = query.trim();\n\n\t\tconst captures = query.match(RE_MEDIA_QUERY);\n\n\t\t// Media query must be valid\n\t\tif (!captures) {\n\t\t\tthrow new SyntaxError(`Invalid CSS media query: '${query}'`);\n\t\t}\n\n\t\tconst modifier = captures[1];\n\t\tconst type = captures[2];\n\t\tconst featureString = ((captures[3] || '') + (captures[4] || '')).trim();\n\n\t\tconst mediaType = type ? type.toLowerCase() : MediaQueryType.all;\n\t\tif (RESERVED_MEDIA_TYPES.has(mediaType)) {\n\t\t\treturn { inverse: true, type: MediaQueryType.all, features: [] };\n\t\t}\n\n\t\tconst expression: MediaQueryExpression = {\n\t\t\tinverse: !!modifier && modifier.toLowerCase() === 'not',\n\t\t\ttype: mediaType,\n\t\t\tfeatures: [],\n\t\t};\n\n\t\t// Check for media query features\n\t\tif (!featureString) {\n\t\t\treturn expression;\n\t\t}\n\n\t\t// Split features string into a list\n\t\tconst features = featureString.match(/\\([^\\)]+\\)/g);\n\n\t\t// Media query must be valid\n\t\tif (!features) {\n\t\t\tthrow new SyntaxError(`Invalid CSS media query features: '${featureString}' on '${query}'`);\n\t\t}\n\n\t\tfor (const feature of features) {\n\t\t\tconst captures = feature.match(RE_MQ_EXPRESSION);\n\n\t\t\t// Media query must be valid\n\t\t\tif (!captures) {\n\t\t\t\tthrow new SyntaxError(`Invalid CSS media query feature: '${feature}' on '${query}'`);\n\t\t\t}\n\n\t\t\tconst featureData = captures[1].toLowerCase().match(RE_MQ_FEATURE);\n\n\t\t\texpression.features.push({\n\t\t\t\tmodifier: featureData[1],\n\t\t\t\tproperty: featureData[2],\n\t\t\t\tvalue: captures[2],\n\t\t\t});\n\t\t}\n\n\t\treturn expression;\n\t});\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as inspectorCommands from './InspectorBackendCommands';
|
|
2
|
+
|
|
3
|
+
export class Request {
|
|
4
|
+
constructor(networkDomainDebugger: NetworkDomainDebugger, requestID: string);
|
|
5
|
+
mimeType: string;
|
|
6
|
+
readonly requestID: string;
|
|
7
|
+
readonly hasTextContent: boolean;
|
|
8
|
+
data: any;
|
|
9
|
+
resourceType: string;
|
|
10
|
+
responseReceived(response: inspectorCommands.NetworkDomain.Response): void;
|
|
11
|
+
loadingFinished(): void;
|
|
12
|
+
requestWillBeSent(request: inspectorCommands.NetworkDomain.Request): void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class NetworkDomainDebugger implements inspectorCommands.NetworkDomain.NetworkDomainDispatcher {
|
|
16
|
+
events: inspectorCommands.NetworkDomain.NetworkFrontend;
|
|
17
|
+
readonly enabled: boolean;
|
|
18
|
+
enable(): void;
|
|
19
|
+
disable(): void;
|
|
20
|
+
setExtraHTTPHeaders(params: inspectorCommands.NetworkDomain.SetExtraHTTPHeadersMethodArguments): void;
|
|
21
|
+
getResponseBody(params: inspectorCommands.NetworkDomain.GetResponseBodyMethodArguments): { body: string; base64Encoded: boolean };
|
|
22
|
+
canClearBrowserCache(): { result: boolean };
|
|
23
|
+
clearBrowserCache(): void;
|
|
24
|
+
canClearBrowserCookies(): { result: boolean };
|
|
25
|
+
clearBrowserCookies(): void;
|
|
26
|
+
setCacheDisabled(params: inspectorCommands.NetworkDomain.SetCacheDisabledMethodArguments): void;
|
|
27
|
+
loadResource(params: inspectorCommands.NetworkDomain.LoadResourceMethodArguments): { content: string; mimeType: string; status: number };
|
|
28
|
+
create(): Request;
|
|
29
|
+
}
|
package/fetch/index.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Blob, FormData } from '../xhr';
|
|
2
|
+
import type AbortSignal from '../abortcontroller/abortsignal';
|
|
3
|
+
export type HeadersInit = Headers | string[][] | Record<string, string>;
|
|
4
|
+
export type BodyInit = string | Blob | FormData | ArrayBuffer | ArrayBufferView | URLSearchParams | null;
|
|
5
|
+
export type RequestInfo = Request | string;
|
|
6
|
+
export interface RequestInit {
|
|
7
|
+
body?: BodyInit;
|
|
8
|
+
credentials?: string;
|
|
9
|
+
headers?: HeadersInit;
|
|
10
|
+
method?: string;
|
|
11
|
+
mode?: string;
|
|
12
|
+
signal?: AbortSignal | null;
|
|
13
|
+
}
|
|
14
|
+
export interface ResponseInit {
|
|
15
|
+
headers?: HeadersInit;
|
|
16
|
+
status?: number;
|
|
17
|
+
statusText?: string;
|
|
18
|
+
url?: string | null;
|
|
19
|
+
}
|
|
20
|
+
export declare class Headers {
|
|
21
|
+
map: Record<string, string>;
|
|
22
|
+
constructor(headers?: HeadersInit);
|
|
23
|
+
append(name: string, value: string): void;
|
|
24
|
+
delete(name: string): void;
|
|
25
|
+
get(name: string): string | null;
|
|
26
|
+
has(name: string): boolean;
|
|
27
|
+
set(name: string, value: string): void;
|
|
28
|
+
forEach(callback: (value: string, name: string, headers: Headers) => void, thisArg?: any): void;
|
|
29
|
+
keys(): IterableIterator<string>;
|
|
30
|
+
values(): IterableIterator<string>;
|
|
31
|
+
entries(): IterableIterator<[string, string]>;
|
|
32
|
+
[Symbol.iterator](): IterableIterator<[string, string]>;
|
|
33
|
+
}
|
|
34
|
+
declare abstract class Body {
|
|
35
|
+
bodyUsed: boolean;
|
|
36
|
+
abstract headers: Headers;
|
|
37
|
+
_bodyInit: any;
|
|
38
|
+
_bodyText: string;
|
|
39
|
+
_bodyBlob: Blob;
|
|
40
|
+
_bodyFormData: FormData;
|
|
41
|
+
_bodyArrayBuffer: any;
|
|
42
|
+
_initBody(body: any): void;
|
|
43
|
+
blob(): Promise<Blob>;
|
|
44
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
45
|
+
text(): Promise<string>;
|
|
46
|
+
formData(): Promise<FormData>;
|
|
47
|
+
json(): Promise<any>;
|
|
48
|
+
}
|
|
49
|
+
export declare class Request extends Body {
|
|
50
|
+
url: string;
|
|
51
|
+
credentials: string;
|
|
52
|
+
headers: Headers;
|
|
53
|
+
method: string;
|
|
54
|
+
mode: string | null;
|
|
55
|
+
signal: AbortSignal | null | undefined;
|
|
56
|
+
referrer: string | null;
|
|
57
|
+
constructor(input: RequestInfo, options?: RequestInit);
|
|
58
|
+
clone(): Request;
|
|
59
|
+
}
|
|
60
|
+
export declare class Response extends Body {
|
|
61
|
+
type: string;
|
|
62
|
+
status: number;
|
|
63
|
+
ok: boolean;
|
|
64
|
+
statusText: string;
|
|
65
|
+
headers: Headers;
|
|
66
|
+
url: string;
|
|
67
|
+
constructor(bodyInit?: BodyInit, options?: ResponseInit);
|
|
68
|
+
clone(): Response;
|
|
69
|
+
static error(): Response;
|
|
70
|
+
static redirect(url: string, status: number): Response;
|
|
71
|
+
}
|
|
72
|
+
/** The runtime's DOMException, or whatwg-fetch's stand-in where it has none. */
|
|
73
|
+
export declare let DOMException: any;
|
|
74
|
+
export declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
75
|
+
/** Marks this fetch as a polyfill, as whatwg-fetch does. */
|
|
76
|
+
export declare namespace fetch {
|
|
77
|
+
const polyfill = true;
|
|
78
|
+
}
|
|
79
|
+
export {};
|