UNPKG

repoweaver

Version:

A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies

1 lines 12.2 kB
{"ast":null,"code":"'use client';\n\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport invariant from 'fbjs/lib/invariant';\nimport unmountComponentAtNode from \"../unmountComponentAtNode\";\nimport renderApplication, { getApplication as _getApplication } from \"./renderApplication\";\nvar emptyObject = {};\nvar runnables = {};\nvar componentProviderInstrumentationHook = function componentProviderInstrumentationHook(component) {\n return component();\n};\nvar wrapperComponentProvider;\nvar AppRegistry = function () {\n function AppRegistry() {\n _classCallCheck(this, AppRegistry);\n }\n return _createClass(AppRegistry, null, [{\n key: \"getAppKeys\",\n value: function getAppKeys() {\n return Object.keys(runnables);\n }\n }, {\n key: \"getApplication\",\n value: function getApplication(appKey, appParameters) {\n invariant(runnables[appKey] && runnables[appKey].getApplication, \"Application \" + appKey + \" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n return runnables[appKey].getApplication(appParameters);\n }\n }, {\n key: \"registerComponent\",\n value: function registerComponent(appKey, componentProvider) {\n runnables[appKey] = {\n getApplication: function getApplication(appParameters) {\n return _getApplication(componentProviderInstrumentationHook(componentProvider), appParameters ? appParameters.initialProps : emptyObject, wrapperComponentProvider && wrapperComponentProvider(appParameters));\n },\n run: function run(appParameters) {\n return renderApplication(componentProviderInstrumentationHook(componentProvider), wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.callback, {\n hydrate: appParameters.hydrate || false,\n initialProps: appParameters.initialProps || emptyObject,\n mode: appParameters.mode || 'concurrent',\n rootTag: appParameters.rootTag\n });\n }\n };\n return appKey;\n }\n }, {\n key: \"registerConfig\",\n value: function registerConfig(config) {\n config.forEach(function (_ref) {\n var appKey = _ref.appKey,\n component = _ref.component,\n run = _ref.run;\n if (run) {\n AppRegistry.registerRunnable(appKey, run);\n } else {\n invariant(component, 'No component provider passed in');\n AppRegistry.registerComponent(appKey, component);\n }\n });\n }\n }, {\n key: \"registerRunnable\",\n value: function registerRunnable(appKey, run) {\n runnables[appKey] = {\n run: run\n };\n return appKey;\n }\n }, {\n key: \"runApplication\",\n value: function runApplication(appKey, appParameters) {\n var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';\n if (isDevelopment) {\n var params = _objectSpread({}, appParameters);\n params.rootTag = \"#\" + params.rootTag.id;\n console.log(\"Running application \\\"\" + appKey + \"\\\" with appParams:\\n\", params, \"\\nDevelopment-level warnings: \" + (isDevelopment ? 'ON' : 'OFF') + \".\" + (\"\\nPerformance optimizations: \" + (isDevelopment ? 'OFF' : 'ON') + \".\"));\n }\n invariant(runnables[appKey] && runnables[appKey].run, \"Application \\\"\" + appKey + \"\\\" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n return runnables[appKey].run(appParameters);\n }\n }, {\n key: \"setComponentProviderInstrumentationHook\",\n value: function setComponentProviderInstrumentationHook(hook) {\n componentProviderInstrumentationHook = hook;\n }\n }, {\n key: \"setWrapperComponentProvider\",\n value: function setWrapperComponentProvider(provider) {\n wrapperComponentProvider = provider;\n }\n }, {\n key: \"unmountApplicationComponentAtRootTag\",\n value: function unmountApplicationComponentAtRootTag(rootTag) {\n unmountComponentAtNode(rootTag);\n }\n }]);\n}();\nexport { AppRegistry as default };","map":{"version":3,"names":["_classCallCheck","_createClass","_objectSpread","invariant","unmountComponentAtNode","renderApplication","getApplication","_getApplication","emptyObject","runnables","componentProviderInstrumentationHook","component","wrapperComponentProvider","AppRegistry","key","value","getAppKeys","Object","keys","appKey","appParameters","registerComponent","componentProvider","initialProps","run","callback","hydrate","mode","rootTag","registerConfig","config","forEach","_ref","registerRunnable","runApplication","isDevelopment","process","env","NODE_ENV","params","id","console","log","setComponentProviderInstrumentationHook","hook","setWrapperComponentProvider","provider","unmountApplicationComponentAtRootTag","default"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-web/dist/exports/AppRegistry/index.js"],"sourcesContent":["/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n'use client';\n\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport invariant from 'fbjs/lib/invariant';\nimport unmountComponentAtNode from '../unmountComponentAtNode';\nimport renderApplication, { getApplication as _getApplication } from './renderApplication';\nvar emptyObject = {};\nvar runnables = {};\nvar componentProviderInstrumentationHook = component => component();\nvar wrapperComponentProvider;\n\n/**\n * `AppRegistry` is the JS entry point to running all React Native apps.\n */\nexport default class AppRegistry {\n static getAppKeys() {\n return Object.keys(runnables);\n }\n static getApplication(appKey, appParameters) {\n invariant(runnables[appKey] && runnables[appKey].getApplication, \"Application \" + appKey + \" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n return runnables[appKey].getApplication(appParameters);\n }\n static registerComponent(appKey, componentProvider) {\n runnables[appKey] = {\n getApplication: appParameters => _getApplication(componentProviderInstrumentationHook(componentProvider), appParameters ? appParameters.initialProps : emptyObject, wrapperComponentProvider && wrapperComponentProvider(appParameters)),\n run: appParameters => renderApplication(componentProviderInstrumentationHook(componentProvider), wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.callback, {\n hydrate: appParameters.hydrate || false,\n initialProps: appParameters.initialProps || emptyObject,\n mode: appParameters.mode || 'concurrent',\n rootTag: appParameters.rootTag\n })\n };\n return appKey;\n }\n static registerConfig(config) {\n config.forEach(_ref => {\n var appKey = _ref.appKey,\n component = _ref.component,\n run = _ref.run;\n if (run) {\n AppRegistry.registerRunnable(appKey, run);\n } else {\n invariant(component, 'No component provider passed in');\n AppRegistry.registerComponent(appKey, component);\n }\n });\n }\n\n // TODO: fix style sheet creation when using this method\n static registerRunnable(appKey, run) {\n runnables[appKey] = {\n run\n };\n return appKey;\n }\n static runApplication(appKey, appParameters) {\n var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';\n if (isDevelopment) {\n var params = _objectSpread({}, appParameters);\n params.rootTag = \"#\" + params.rootTag.id;\n console.log(\"Running application \\\"\" + appKey + \"\\\" with appParams:\\n\", params, \"\\nDevelopment-level warnings: \" + (isDevelopment ? 'ON' : 'OFF') + \".\" + (\"\\nPerformance optimizations: \" + (isDevelopment ? 'OFF' : 'ON') + \".\"));\n }\n invariant(runnables[appKey] && runnables[appKey].run, \"Application \\\"\" + appKey + \"\\\" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n return runnables[appKey].run(appParameters);\n }\n static setComponentProviderInstrumentationHook(hook) {\n componentProviderInstrumentationHook = hook;\n }\n static setWrapperComponentProvider(provider) {\n wrapperComponentProvider = provider;\n }\n static unmountApplicationComponentAtRootTag(rootTag) {\n unmountComponentAtNode(rootTag);\n }\n}"],"mappings":"AAUA,YAAY;;AAAC,OAAAA,eAAA;AAAA,OAAAC,YAAA;AAEb,OAAOC,aAAa,MAAM,sCAAsC;AAChE,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,sBAAsB;AAC7B,OAAOC,iBAAiB,IAAIC,cAAc,IAAIC,eAAe;AAC7D,IAAIC,WAAW,GAAG,CAAC,CAAC;AACpB,IAAIC,SAAS,GAAG,CAAC,CAAC;AAClB,IAAIC,oCAAoC,GAAG,SAAvCA,oCAAoCA,CAAGC,SAAS;EAAA,OAAIA,SAAS,CAAC,CAAC;AAAA;AACnE,IAAIC,wBAAwB;AAAC,IAKRC,WAAW;EAAA,SAAAA,YAAA;IAAAb,eAAA,OAAAa,WAAA;EAAA;EAAA,OAAAZ,YAAA,CAAAY,WAAA;IAAAC,GAAA;IAAAC,KAAA,EAC9B,SAAOC,UAAUA,CAAA,EAAG;MAClB,OAAOC,MAAM,CAACC,IAAI,CA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