Skip to content

Instantly share code, notes, and snippets.

@lemonmade
Created June 3, 2020 15:57
Show Gist options
  • Save lemonmade/7598324461776bf56f283c6600097eee to your computer and use it in GitHub Desktop.
Save lemonmade/7598324461776bf56f283c6600097eee to your computer and use it in GitHub Desktop.
!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s="./src/index.js")}({"./src/index.js":function(e,n,t){"use strict";t.r(n),function(){var e;(e=self.shopify).extend.apply(e,arguments)}("Checkout::KitchenSink",(function(e){var n=e.createComponent("FormLayout"),t=e.createComponent("TextField",{label:"Email",onChange:function(e){console.log("email",e)}}),r=e.createComponent("Button",{onPress:function(){console.log("Paid!")}});return r.appendChild(e.createText("Pay")),n.appendChild(t),n.appendChild(r),e.appendChild(n),e.mount(),{}}))}});
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./src/index.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ../node_modules/@shopify/argo-checkout-testing/build/esnext/api/extend.esnext
var extend = function extend() {
var _self$shopify;
return (_self$shopify = self.shopify).extend.apply(_self$shopify, arguments);
};
// CONCATENATED MODULE: ../node_modules/@shopify/argo-checkout-testing/build/esnext/utilities.esnext
/**
* We want all the components we export to be usable and strongly
* typed, regardless of whether they are used by the JavaScript API
* (`root.createComponent()`) or are used as JSX constructor functions.
* This function takes in the "real" value (the string name of the
* component), and returns an object it fakes to have the right type
* to satisfy both of the use cases above.
*/
function createRemoteComponent(componentType) {
return componentType;
}
// CONCATENATED MODULE: ../node_modules/@shopify/argo-checkout-testing/build/esnext/components/FormLayout/FormLayout.esnext
var FormLayout = createRemoteComponent('FormLayout');
// CONCATENATED MODULE: ../node_modules/@shopify/argo-checkout-testing/build/esnext/components/TextField/TextField.esnext
var TextField = createRemoteComponent('TextField');
// CONCATENATED MODULE: ../node_modules/@shopify/argo-checkout-testing/build/esnext/components/Button/Button.esnext
var Button = createRemoteComponent('Button');
// CONCATENATED MODULE: ./src/index.js
extend('Checkout::KitchenSink', function (root) {
var formLayout = root.createComponent(FormLayout);
var textField = root.createComponent(TextField, {
label: 'Email',
onChange: function onChange(value) {
console.log('email', value);
}
});
var button = root.createComponent(Button, {
onPress: function onPress() {
console.log('Paid!');
}
});
button.appendChild(root.createText('Pay'));
formLayout.appendChild(textField);
formLayout.appendChild(button);
root.appendChild(formLayout);
root.mount();
return {};
});
/***/ })
/******/ });
import {
extend,
Button,
FormLayout,
TextField,
} from '@shopify/argo-checkout-testing';
extend('Checkout::KitchenSink', (root) => {
const formLayout = root.createComponent(FormLayout);
const textField = root.createComponent(TextField, {
label: 'Email',
onChange(value) {
console.log('email', value);
},
});
const button = root.createComponent(Button, {
onPress() {
console.log('Paid!');
},
});
button.appendChild(root.createText('Pay'));
formLayout.appendChild(textField);
formLayout.appendChild(button);
root.appendChild(formLayout);
root.mount();
return {};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment